Advent-Incremental/assets/index.922d4e4f.js

19 lines
208 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as k,l as Xe,aa as le,t as R,ay as Yl,ar as ul,aE as b,a0 as x,aK as Bt,a1 as f,O as B,aG as Vl,A as rt,_ as Y,a8 as o,b6 as K,b8 as Zl,bs as Jn,C as u,aq as cl,bu as Ml,bb as en,T as La,a7 as d,u as tn,j as Ga,bv as Dn,q as Bl,b1 as Dt,G as Qe,aC as Xn,w as xt,b2 as _t,ao as Qa,I as Ye,J as ce,$ as T,aH as zt,aF as Wt,z as Ft,aN as qe,al as Ql,aL as tl,H as ja,aJ as Yn,bn as za,br as Wa,be as Ka}from"./@vue.4ce677c2.js";import{c as Zn}from"./nanoevents.1080beb7.js";import{L as Yt}from"./lz-string.731cedc5.js";import{i as Ja}from"./is-plain-object.906d88e8.js";import{Y as Xa}from"./vue-next-select.a2bfab1d.js";import{s as Ya,u as ea}from"./vue-toastification.6f567382.js";import{D as Za}from"./vuedraggable.7949458c.js";import{p as ei}from"./vue-textarea-autosize.35804eaf.js";import{v as ti,n as li}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const ni=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&a(r)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}};ni();const ai="modulepreload",Fn={},ii="./",jl=function(t,l){return!l||l.length===0?t():Promise.all(l.map(a=>{if(a=`${ii}${a}`,a in Fn)return;Fn[a]=!0;const i=a.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${s}`))return;const r=document.createElement("link");if(r.rel=i?"stylesheet":ai,i||(r.as="script",r.crossOrigin=""),r.href=a,document.head.appendChild(r),i)return new Promise((c,p)=>{r.addEventListener("load",c),r.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())},oi="./projInfo-schema.json",si="Advent Incremental",ri="An incremental game you play a day at a time, leading up to Christmas!",ui="advent-incremental",ci="thepaperpilot and friends",di="",pi="",mi="0.3",fi="Initial Commit",hi=!0,gi=!1,vi=2,yi=!0,bi=null,wi="",ki=["main"],Ci=3600,_i=0,Si=!0,Ni="base64";var Ae={$schema:oi,title:si,description:ri,id:ui,author:ci,discordName:di,discordLink:pi,versionNumber:mi,versionTitle:fi,allowGoBack:hi,defaultShowSmall:gi,defaultDecimalsShown:vi,useHeader:yi,banner:bi,logo:wi,initialTabs:ki,maxTickLength:Ci,offlineLimit:_i,enablePausing:Si,exportEncoding:Ni};const pn=17,Mi=9e15,xi=Math.log10(9e15),Ai=1/9e15,Ei=308,Ii=-324,Tn=5,Bi=function(){const e=[];for(let l=Ii+1;l<=Ei;l++)e.push(Number("1e"+l));const t=323;return function(l){return e[l+t]}}(),ol=[2,Math.E,3,4,5,6,7,8,9,10],Pi=[[1,1.0891168053867777,1.1789745164521264,1.2701428397304229,1.3632066654400328,1.4587804913784246,1.557523817412741,1.660158301473385,1.767487542936873,1.8804205225512542,2],[1,1.1121114330934,1.23103892493161,1.35838369631113,1.49605193039935,1.64635423375119,1.81213853570186,1.99697132461829,2.20538955455724,2.44325744833852,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.1793017514670474,1.394054150657457,1.65664127441059,1.985170999970283,2.4069682290577457,2.9647310119960752,3.7278665320924946,4.814462547283592,6.436522247411611,9],[1,1.18422737399915,1.4066113788546144,1.680911177655277,2.027492094355525,2.4775152854601967,3.080455730250329,3.918234505962507,5.1332705696484595,6.9878696918072905,10]],Di=[[-1,-.9194161097107025,-.8335625019330468,-.7425599821143978,-.6466611521029437,-.5462617907227869,-.4419033816638769,-.3342645487554494,-.224140440909962,-.11241087890006762,0],[-1,-.90603157029014,-.80786507256596,-.7064666939634,-.60294836853664,-.49849837513117,-.39430303318768,-.29147201034755,-.19097820800866,-.09361896280296,0],[-1,-.9021579584316141,-.8005762598234203,-.6964780623319391,-.5911906810998454,-.486050182576545,-.3823089430815083,-.28106046722897615,-.1831906535795894,-.08935809204418144,0],[-1,-.8917227442365535,-.781258746326964,-.6705130326902455,-.5612813129406509,-.4551067709033134,-.35319256652135966,-.2563741554088552,-.1651412821106526,-.0796919581982668,0],[-1,-.8843387974366064,-.7678744063886243,-.6529563724510552,-.5415870994657841,-.4352842206588936,-.33504449124791424,-.24138853420685147,-.15445285440944467,-.07409659641336663,0],[-1,-.8786709358426346,-.7577735191184886,-.6399546189952064,-.527284921869926,-.4211627631006314,-.3223479611761232,-.23107655627789858,-.1472057700818259,-.07035171210706326,0],[-1,-.8740862815291583,-.7497032990976209,-.6297119746181752,-.5161838335958787,-.41036238255751956,-.31277212146489963,-.2233976621705518,-.1418697367979619,-.06762117662323441,0],[-1,-.8702632331800649,-.7430366914122081,-.6213373075161548,-.5072025698095242,-.40171437727184167,-.30517930701410456,-.21736343968190863,-.137710238299109,-.06550774483471955,0],[-1,-.8670016295947213,-.7373984232432306,-.6143173985094293,-.49973884395492807,-.394584953527678,-.2989649949848695,-.21245647317021688,-.13434688362382652,-.0638072667348083,0],[-1,-.8641642839543857,-.732534623168535,-.6083127477059322,-.4934049257184696,-.3885773075899922,-.29376029055315767,-.2083678561173622,-.13155653399373268,-.062401588652553186,0]],v=function(t){return n.fromValue_noAlloc(t)},ee=function(e,t,l){return n.fromComponents(e,t,l)},me=function(t,l,a){return n.fromComponents_noNormalize(t,l,a)},Xt=function(t,l){const a=l+1,i=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,a-i))*Math.pow(10,i-a);return parseFloat(s.toFixed(Math.max(a-i,0)))},mn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Fi=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let l=.9189385332046727;l=l+(e+.5)*Math.log(e),l=l-e;const a=e*e;let i=e;return l=l+1/(12*i),i=i*a,l=l+1/(360*i),i=i*a,l=l+1/(1260*i),i=i*a,l=l+1/(1680*i),i=i*a,l=l+1/(1188*i),i=i*a,l=l+691/(360360*i),i=i*a,l=l+7/(1092*i),i=i*a,l=l+3617/(122400*i),Math.exp(l)/t},ta=.5671432904097838,$n=function(e,t=1e-10){let l,a;if(!Number.isFinite(e)||e===0)return e;if(e===1)return ta;e<10?l=0:l=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(a=(e*Math.exp(-l)+l*l)/(l+1),Math.abs(a-l)<t*Math.abs(a))return a;l=a}throw Error(`Iteration failed to converge: ${e.toString()}`)};function On(e,t=1e-10){let l,a,i,s;if(!Number.isFinite(e.mag)||e===n.dZero)return e;if(e===n.dOne)return v(ta);n.abs(e),l=n.ln(e);for(let r=0;r<100;++r){if(a=n.exp(-l),i=l.sub(e.mul(a)),s=l.sub(i.div(l.add(1).sub(l.add(2).mul(i).div(n.mul(2,l).add(2))))),n.abs(s.sub(l)).lt(n.abs(s).mul(t)))return s;l=s}throw Error(`Iteration failed to converge: ${e.toString()}`)}const _=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof _||e!=null&&typeof e=="object"&&"sign"in e&&"mag"in e&&"layer"in e?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0)}get m(){if(this.sign===0)return 0;if(this.layer===0){const e=Math.floor(Math.log10(this.mag));let t;return this.mag===5e-324?t=5:t=this.mag/Bi(e),this.sign*t}else if(this.layer===1){const e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}else return this.sign}set m(e){this.layer<=2?this.fromMantissaExponent(e,this.e):(this.sign=Math.sign(e),this.sign===0&&(this.layer,this.exponent))}get e(){return this.sign===0?0:this.layer===0?Math.floor(Math.log10(this.mag)):this.layer===1?Math.floor(this.mag):this.layer===2?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY}set e(e){this.fromMantissaExponent(this.m,e)}get s(){return this.sign}set s(e){e===0?(this.sign=0,this.layer=0,this.mag=0):this.sign=e}get mantissa(){return this.m}set mantissa(e){this.m=e}get exponent(){return this.e}set exponent(e){this.e=e}static fromComponents(e,t,l){return new _().fromComponents(e,t,l)}static fromComponents_noNormalize(e,t,l){return new _().fromComponents_noNormalize(e,t,l)}static fromMantissaExponent(e,t){return new _().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new _().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new _().fromDecimal(e)}static fromNumber(e){return new _().fromNumber(e)}static fromString(e){return new _().fromString(e)}static fromValue(e){return new _().fromValue(e)}static fromValue_noAlloc(e){return e instanceof _?e:new _(e)}static abs(e){return v(e).abs()}static neg(e){return v(e).neg()}static negate(e){return v(e).neg()}static negated(e){return v(e).neg()}static sign(e){return v(e).sign}static sgn(e){return v(e).sign}static round(e){return v(e).round()}static floor(e){return v(e).floor()}static ceil(e){return v(e).ceil()}static trunc(e){return v(e).trunc()}static add(e,t){return v(e).add(t)}static plus(e,t){return v(e).add(t)}static sub(e,t){return v(e).sub(t)}static subtract(e,t){return v(e).sub(t)}static minus(e,t){return v(e).sub(t)}static mul(e,t){return v(e).mul(t)}static multiply(e,t){return v(e).mul(t)}static times(e,t){return v(e).mul(t)}static div(e,t){return v(e).div(t)}static divide(e,t){return v(e).div(t)}static recip(e){return v(e).recip()}static reciprocal(e){return v(e).recip()}static reciprocate(e){return v(e).reciprocate()}static cmp(e,t){return v(e).cmp(t)}static cmpabs(e,t){return v(e).cmpabs(t)}static compare(e,t){return v(e).cmp(t)}static isNaN(e){return e=v(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=v(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return v(e).eq(t)}static equals(e,t){return v(e).eq(t)}static neq(e,t){return v(e).neq(t)}static notEquals(e,t){return v(e).notEquals(t)}static lt(e,t){return v(e).lt(t)}static lte(e,t){return v(e).lte(t)}static gt(e,t){return v(e).gt(t)}static gte(e,t){return v(e).gte(t)}static max(e,t){return v(e).max(t)}static min(e,t){return v(e).min(t)}static minabs(e,t){return v(e).minabs(t)}static maxabs(e,t){return v(e).maxabs(t)}static clamp(e,t,l){return v(e).clamp(t,l)}static clampMin(e,t){return v(e).clampMin(t)}static clampMax(e,t){return v(e).clampMax(t)}static cmp_tolerance(e,t,l){return v(e).cmp_tolerance(t,l)}static compare_tolerance(e,t,l){return v(e).cmp_tolerance(t,l)}static eq_tolerance(e,t,l){return v(e).eq_tolerance(t,l)}static equals_tolerance(e,t,l){return v(e).eq_tolerance(t,l)}static neq_tolerance(e,t,l){return v(e).neq_tolerance(t,l)}static notEquals_tolerance(e,t,l){return v(e).notEquals_tolerance(t,l)}static lt_tolerance(e,t,l){return v(e).lt_tolerance(t,l)}static lte_tolerance(e,t,l){return v(e).lte_tolerance(t,l)}static gt_tolerance(e,t,l){return v(e).gt_tolerance(t,l)}static gte_tolerance(e,t,l){return v(e).gte_tolerance(t,l)}static pLog10(e){return v(e).pLog10()}static absLog10(e){return v(e).absLog10()}static log10(e){return v(e).log10()}static log(e,t){return v(e).log(t)}static log2(e){return v(e).log2()}static ln(e){return v(e).ln()}static logarithm(e,t){return v(e).logarithm(t)}static pow(e,t){return v(e).pow(t)}static pow10(e){return v(e).pow10()}static root(e,t){return v(e).root(t)}static factorial(e,t){return v(e).factorial()}static gamma(e,t){return v(e).gamma()}static lngamma(e,t){return v(e).lngamma()}static exp(e){return v(e).exp()}static sqr(e){return v(e).sqr()}static sqrt(e){return v(e).sqrt()}static cube(e){return v(e).cube()}static cbrt(e){return v(e).cbrt()}static tetrate(e,t=2,l=me(1,0,1)){return v(e).tetrate(t,l)}static iteratedexp(e,t=2,l=me(1,0,1)){return v(e).iteratedexp(t,l)}static iteratedlog(e,t=10,l=1){return v(e).iteratedlog(t,l)}static layeradd10(e,t){return v(e).layeradd10(t)}static layeradd(e,t,l=10){return v(e).layeradd(t,l)}static slog(e,t=10){return v(e).slog(t)}static lambertw(e){return v(e).lambertw()}static ssqrt(e){return v(e).ssqrt()}static pentate(e,t=2,l=me(1,0,1)){return v(e).pentate(t,l)}static affordGeometricSeries(e,t,l,a){return this.affordGeometricSeries_core(v(e),v(t),v(l),a)}static sumGeometricSeries(e,t,l,a){return this.sumGeometricSeries_core(e,v(t),v(l),a)}static affordArithmeticSeries(e,t,l,a){return this.affordArithmeticSeries_core(v(e),v(t),v(l),v(a))}static sumArithmeticSeries(e,t,l,a){return this.sumArithmeticSeries_core(v(e),v(t),v(l),v(a))}static efficiencyOfPurchase(e,t,l){return this.efficiencyOfPurchase_core(v(e),v(t),v(l))}static randomDecimalForTesting(e){if(Math.random()*20<1)return me(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return me(t,0,1);const l=Math.floor(Math.random()*(e+1));let a=l===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(a=Math.trunc(a));let i=Math.pow(10,a);return Math.random()>.9&&(i=Math.trunc(i)),ee(t,l,i)}static affordGeometricSeries_core(e,t,l,a){const i=t.mul(l.pow(a));return _.floor(e.div(i).mul(l.sub(1)).add(1).log10().div(l.log10()))}static sumGeometricSeries_core(e,t,l,a){return t.mul(l.pow(a)).mul(_.sub(1,l.pow(e))).div(_.sub(1,l))}static affordArithmeticSeries_core(e,t,l,a){const s=t.add(a.mul(l)).sub(l.div(2)),r=s.pow(2);return s.neg().add(r.add(l.mul(e).mul(2)).sqrt()).div(l).floor()}static sumArithmeticSeries_core(e,t,l,a){const i=t.add(a.mul(l));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(l)))}static efficiencyOfPurchase_core(e,t,l){return e.div(t).add(e.div(l))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag<Ai)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Mi)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<xi&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this.normalize(),this}fromComponents_noNormalize(e,t,l){return this.sign=e,this.layer=t,this.mag=l,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){e=e.replace(",","");const t=e.split("^^^");if(t.length===2){const w=parseFloat(t[0]),h=parseFloat(t[1]),C=t[1].split(";");let S=1;if(C.length===2&&(S=parseFloat(C[1]),isFinite(S)||(S=1)),isFinite(w)&&isFinite(h)){const N=_.pentate(w,h,S);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}const l=e.split("^^");if(l.length===2){const w=parseFloat(l[0]),h=parseFloat(l[1]),C=l[1].split(";");let S=1;if(C.length===2&&(S=parseFloat(C[1]),isFinite(S)||(S=1)),isFinite(w)&&isFinite(h)){const N=_.tetrate(w,h,S);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}const a=e.split("^");if(a.length===2){const w=parseFloat(a[0]),h=parseFloat(a[1]);if(isFinite(w)&&isFinite(h)){const C=_.pow(w,h);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,this}}e=e.trim().toLowerCase();let i,s,r=e.split("pt");if(r.length===2){i=10,s=parseFloat(r[0]),r[1]=r[1].replace("(",""),r[1]=r[1].replace(")","");let w=parseFloat(r[1]);if(isFinite(w)||(w=1),isFinite(i)&&isFinite(s)){const h=_.tetrate(i,s,w);return this.sign=h.sign,this.layer=h.layer,this.mag=h.mag,this}}if(r=e.split("p"),r.length===2){i=10,s=parseFloat(r[0]),r[1]=r[1].replace("(",""),r[1]=r[1].replace(")","");let w=parseFloat(r[1]);if(isFinite(w)||(w=1),isFinite(i)&&isFinite(s)){const h=_.tetrate(i,s,w);return this.sign=h.sign,this.layer=h.layer,this.mag=h.mag,this}}const c=e.split("e"),p=c.length-1;if(p===0){const w=parseFloat(e);if(isFinite(w))return this.fromNumber(w)}else if(p===1){const w=parseFloat(e);if(isFinite(w)&&w!==0)return this.fromNumber(w)}const m=e.split("e^");if(m.length===2){this.sign=1,m[0].charAt(0)=="-"&&(this.sign=-1);let w="";for(let h=0;h<m[1].length;++h){const C=m[1].charCodeAt(h);if(C>=43&&C<=57||C===101)w+=m[1].charAt(h);else return this.layer=parseFloat(w),this.mag=parseFloat(m[1].substr(h+1)),this.normalize(),this}}if(p<1)return this.sign=0,this.layer=0,this.mag=0,this;const y=parseFloat(c[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,this;let g=parseFloat(c[c.length-1]);if(p>=2){const w=parseFloat(c[c.length-2]);isFinite(w)&&(g*=Math.sign(w),g+=mn(w))}if(!isFinite(y))this.sign=c[0]==="-"?-1:1,this.layer=p,this.mag=g;else if(p===1)this.sign=Math.sign(y),this.layer=1,this.mag=g+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=p,p===2){const w=_.mul(ee(1,2,g),v(y));return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,this}else this.mag=g;return this.normalize(),this}fromValue(e){return e instanceof _||e!=null&&typeof e=="object"&&"sign"in e&&"mag"in e&&"layer"in e?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0,this)}toNumber(){return Number.isFinite(this.layer)?this.layer===0?this.sign*this.mag:this.layer===1?this.sign*Math.pow(10,this.mag):this.mag>0?this.sign>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:0:Number.NaN}mantissaWithDecimalPlaces(e){return isNaN(this.m)?Number.NaN:this.m===0?0:Xt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Xt(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=Tn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):Xt(this.m,e)+"e"+Xt(this.e,e):this.layer===1?Xt(this.m,e)+"e"+Xt(this.e,e):this.layer<=Tn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Xt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Xt(this.mag,e)}abs(){return me(this.sign===0?0:1,this.layer,this.mag)}neg(){return me(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?_.dZero:this.layer===0?ee(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?_.dZero:this.layer===0?ee(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?_.dZero:this.layer===0?ee(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?_.dZero:this.layer===0?ee(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=v(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer)||this.sign===0)return t;if(t.sign===0)return this;if(this.sign===-t.sign&&this.layer===t.layer&&this.mag===t.mag)return me(0,0,0);let l,a;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(_.cmpabs(this,t)>0?(l=this,a=t):(l=t,a=this),l.layer===0&&a.layer===0)return v(l.sign*l.mag+a.sign*a.mag);const i=l.layer*Math.sign(l.mag),s=a.layer*Math.sign(a.mag);if(i-s>=2)return l;if(i===0&&s===-1){if(Math.abs(a.mag-Math.log10(l.mag))>pn)return l;{const r=Math.pow(10,Math.log10(l.mag)-a.mag),c=a.sign+l.sign*r;return ee(Math.sign(c),1,a.mag+Math.log10(Math.abs(c)))}}if(i===1&&s===0){if(Math.abs(l.mag-Math.log10(a.mag))>pn)return l;{const r=Math.pow(10,l.mag-Math.log10(a.mag)),c=a.sign+l.sign*r;return ee(Math.sign(c),1,Math.log10(a.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(l.mag-a.mag)>pn)return l;{const r=Math.pow(10,l.mag-a.mag),c=a.sign+l.sign*r;return ee(Math.sign(c),1,a.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(v(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=v(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return me(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return me(this.sign*t.sign,0,1);let l,a;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(l=this,a=t):(l=t,a=this),l.layer===0&&a.layer===0)return v(l.sign*a.sign*l.mag*a.mag);if(l.layer>=3||l.layer-a.layer>=2)return ee(l.sign*a.sign,l.layer,l.mag);if(l.layer===1&&a.layer===0)return ee(l.sign*a.sign,1,l.mag+Math.log10(a.mag));if(l.layer===1&&a.layer===1)return ee(l.sign*a.sign,1,l.mag+a.mag);if(l.layer===2&&a.layer===1){const i=ee(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(ee(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)));return ee(l.sign*a.sign,i.layer+1,i.sign*i.mag)}if(l.layer===2&&a.layer===2){const i=ee(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(ee(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)));return ee(l.sign*a.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=v(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?_.dNaN:this.layer===0?ee(this.sign,0,1/this.mag):ee(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=v(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=v(e),l=this.mag>0?this.layer:-this.layer,a=t.mag>0?t.layer:-t.layer;return l>a?1:l<a?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=v(e);return this.sign===t.sign&&this.layer===t.layer&&this.mag===t.mag}equals(e){return this.eq(e)}neq(e){return!this.eq(e)}notEquals(e){return this.neq(e)}lt(e){return this.cmp(e)===-1}lte(e){return!this.gt(e)}gt(e){return this.cmp(e)===1}gte(e){return!this.lt(e)}max(e){const t=v(e);return this.lt(t)?t:this}min(e){const t=v(e);return this.gt(t)?t:this}maxabs(e){const t=v(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=v(e);return this.cmpabs(t)>0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const l=v(e);return this.eq_tolerance(l,t)?0:this.cmp(l)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const l=v(e);if(t==null&&(t=1e-7),this.sign!==l.sign||Math.abs(this.layer-l.layer)>1)return!1;let a=this.mag,i=l.mag;return this.layer>l.layer&&(i=mn(i)),this.layer<l.layer&&(a=mn(a)),Math.abs(a-i)<=t*Math.max(Math.abs(a),Math.abs(i))}equals_tolerance(e,t){return this.eq_tolerance(e,t)}neq_tolerance(e,t){return!this.eq_tolerance(e,t)}notEquals_tolerance(e,t){return this.neq_tolerance(e,t)}lt_tolerance(e,t){const l=v(e);return!this.eq_tolerance(l,t)&&this.lt(l)}lte_tolerance(e,t){const l=v(e);return this.eq_tolerance(l,t)||this.lt(l)}gt_tolerance(e,t){const l=v(e);return!this.eq_tolerance(l,t)&&this.gt(l)}gte_tolerance(e,t){const l=v(e);return this.eq_tolerance(l,t)||this.gt(l)}pLog10(){return this.lt(_.dZero)?_.dZero:this.log10()}absLog10(){return this.sign===0?_.dNaN:this.layer>0?ee(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):ee(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?_.dNaN:this.layer>0?ee(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):ee(this.sign,0,Math.log10(this.mag))}log(e){return e=v(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?_.dNaN:this.layer===0&&e.layer===0?ee(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):_.div(this.log10(),e.log10())}log2(){return this.sign<=0?_.dNaN:this.layer===0?ee(this.sign,0,Math.log2(this.mag)):this.layer===1?ee(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?ee(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):ee(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?_.dNaN:this.layer===0?ee(this.sign,0,Math.log(this.mag)):this.layer===1?ee(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?ee(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):ee(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=v(e),l=this,a=t;if(l.sign===0)return a.eq(0)?me(1,0,1):l;if(l.sign===1&&l.layer===0&&l.mag===1)return l;if(a.sign===0)return me(1,0,1);if(a.sign===1&&a.layer===0&&a.mag===1)return l;const i=l.absLog10().mul(a).pow10();return this.sign===-1?Math.abs(a.toNumber()%2)%2===1?i.neg():Math.abs(a.toNumber()%2)%2===0?i:_.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return _.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return ee(1,0,t);if(e.sign===0)return _.dOne;e=me(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?ee(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?ee(-e.sign,e.layer+1,-e.mag):_.dOne}pow_base(e){return v(e).pow(this)}root(e){const t=v(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(me(1,0,24)))return v(Fi(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const l=e*e;let a=e,i=12*a,s=1/i,r=t+s;if(r===t||(t=r,a=a*l,i=360*a,s=1/i,r=t-s,r===t))return _.exp(t);t=r,a=a*l,i=1260*a;let c=1/i;return t=t+c,a=a*l,i=1680*a,c=1/i,t=t-c,_.exp(t)}else return this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?_.dOne:this.layer===0&&this.mag<=709.7?v(Math.exp(this.sign*this.mag)):this.layer===0?ee(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?ee(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):ee(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return v(Math.sqrt(this.sign*this.mag));if(this.layer===1)return ee(1,2,Math.log10(this.mag)-.3010299956639812);{const e=_.div(me(this.sign,this.layer-1,this.mag),me(1,0,2));return e.layer+=1,e.normalize(),e}}cube(){return this.pow(3)}cbrt(){return this.pow(1/3)}tetrate(e=2,t=me(1,0,1)){if(e===1)return _.pow(this,t);if(e===0)return new _(t);if(this.eq(_.dOne))return _.dOne;if(this.eq(-1))return _.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return new _(Math.E);const s=_.ln(this).neg();return s.lambertw().div(s)}else return i>1.444667861009766?new _(Number.POSITIVE_INFINITY):_.dNaN}if(this.eq(_.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),new _(i)}if(e<0)return _.iteratedlog(t,this,-e);t=v(t);const l=e;e=Math.trunc(e);const a=l-e;if(this.gt(_.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i<e;++i){const s=t;if(t=this.pow(t),s.eq(t))return t}if(a!=0){const i=this.pow(t);return t.mul(1-a).add(i.mul(a))}return t}a!==0&&(t.eq(_.dOne)?this.gt(10)?t=this.pow(a):(t=v(_.tetrate_critical(this.toNumber(),a)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(a):t=t.layeradd(a,this));for(let i=0;i<e;++i){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return me(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=me(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return _.tetrate(e,-t,this);e=v(e);let l=v(this);const a=t;t=Math.trunc(t);const i=a-t;if(l.layer-e.layer>3){const s=Math.min(t,l.layer-e.layer-3);t-=s,l.layer-=s}for(let s=0;s<t;++s){if(l=l.log(e),!isFinite(l.layer)||!isFinite(l.mag))return l.normalize();if(s>1e4)return l}return i>0&&i<1&&(e.eq(10)?l=l.layeradd10(-i):l=l.layeradd(-i,e)),l}slog(e=10){if(e=v(e),e.lte(_.dZero)||e.eq(_.dOne))return _.dNaN;if(e.lt(_.dOne))return this.eq(_.dOne)?_.dZero:this.eq(_.dZero)?_.dNegOne:_.dNaN;if(this.mag<0||this.eq(_.dZero))return _.dNegOne;let t=0,l=v(this);if(l.layer-e.layer>3){const a=l.layer-e.layer-3;t+=a,l.layer-=a}for(let a=0;a<100;++a)if(l.lt(_.dZero))l=_.pow(e,l),t-=1;else{if(l.lte(_.dOne))return v(t+_.slog_critical(e.toNumber(),l.toNumber()));t+=1,l=_.log(l,e)}return v(t)}static slog_critical(e,t){return e>10?t-1:_.critical_section(e,t,Di)}static tetrate_critical(e,t){return _.critical_section(e,t,Pi)}static critical_section(e,t,l){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let a=0,i=0;for(let c=0;c<ol.length;++c)if(ol[c]==e){a=l[c][Math.floor(t)],i=l[c][Math.ceil(t)];break}else if(ol[c]<e&&ol[c+1]>e){const p=(e-ol[c])/(ol[c+1]-ol[c]);a=l[c][Math.floor(t)]*(1-p)+l[c+1][Math.floor(t)]*p,i=l[c][Math.ceil(t)]*(1-p)+l[c+1][Math.ceil(t)]*p;break}const s=t-Math.floor(t);return a*(1-s)+i*s}layeradd10(e){e=_.fromValue_noAlloc(e).toNumber();const t=v(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const l=Math.trunc(e);e-=l,t.layer+=l}if(e<=-1){const l=Math.trunc(e);if(e-=l,t.layer+=l,t.layer<0)for(let a=0;a<100;++a){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const a=this.slog(t).toNumber()+e;return a>=0?_.tetrate(t,a):Number.isFinite(a)?a>=-1?_.log(_.tetrate(t,a+1),t):_.log(_.log(_.tetrate(t,a+2),t),t):_.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return v($n(this.toNumber()));if(this.layer===0)return v($n(this.sign*this.mag));if(this.layer===1)return On(this);if(this.layer===2)return On(this);if(this.layer>=3)return me(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return me(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=me(1,0,1)){t=v(t);const l=e;e=Math.trunc(e);const a=l-e;a!==0&&(t.eq(_.dOne)?(++e,t=new _(a)):this.eq(10)?t=t.layeradd10(a):t=t.layeradd(a,this));for(let i=0;i<e;++i){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(i>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?v(Math.sin(this.sign*this.mag)):me(0,0,0)}cos(){return this.mag<0?_.dOne:this.layer===0?v(Math.cos(this.sign*this.mag)):me(0,0,0)}tan(){return this.mag<0?this:this.layer===0?v(Math.tan(this.sign*this.mag)):me(0,0,0)}asin(){return this.mag<0?this:this.layer===0?v(Math.asin(this.sign*this.mag)):me(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?v(Math.acos(this.toNumber())):this.layer===0?v(Math.acos(this.sign*this.mag)):me(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?v(Math.atan(this.sign*this.mag)):v(Math.atan(this.sign*(1/0)))}sinh(){return this.exp().sub(this.negate().exp()).div(2)}cosh(){return this.exp().add(this.negate().exp()).div(2)}tanh(){return this.sinh().div(this.cosh())}asinh(){return _.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return _.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?me(Number.NaN,Number.NaN,Number.NaN):_.ln(this.add(1).div(v(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(_.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let n=_;n.dZero=me(0,0,0);n.dOne=me(1,0,1);n.dNegOne=me(-1,0,1);n.dTwo=me(1,0,2);n.dTen=me(1,0,10);n.dNaN=me(Number.NaN,Number.NaN,Number.NaN);n.dInf=me(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);n.dNegInf=me(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);n.dNumberMax=ee(1,0,Number.MAX_VALUE);n.dNumberMin=ee(1,0,Number.MIN_VALUE);const Ti=new n(1);function _l(e,t,l=!0){let a=n.log10(e).floor(),i=n.div(e,n.pow(10,a));i.toStringWithDecimalPlaces(t)==="10"&&(i=Ti,a=a.add(1));const s=a.gte(1e9)?ne(a,Math.max(Math.max(t,3),Ae.defaultDecimalsShown)):a.gte(1e4)?zl(a,0):a.toStringWithDecimalPlaces(0);return l?i.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function zl(e,t){if(e==null)return"NaN";if(e=new n(e),e.mag<.001)return 0 .toFixed(t);const a=e.toStringWithDecimalPlaces(t).split(".");return a[0]=a[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),a.length==1?a[0]:a[0]+"."+a[1]}function la(e,t){return e==null?"NaN":(e=new n(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),Ae.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const $i=new n("eeee1000"),Oi=new n("e100000"),Rn=new n("e1000"),na=new n(1e9),Ri=new n(1e6),Ui=new n(1e3),qi=new n(.98),Hi=new n(.001),aa=new n(0);function ne(e,t,l){if(t==null&&(t=Ae.defaultDecimalsShown),l=l!=null?l:Ae.defaultShowSmall,e=new n(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ne(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte($i)){const a=e.slog();return a.gte(Ri)?"F"+ne(a.floor()):n.pow(10,a.sub(a.floor())).toStringWithDecimalPlaces(3)+"F"+zl(a.floor(),0)}else{if(e.gte(Oi))return _l(e,0,!1);if(e.gte(Rn))return _l(e,0);if(e.gte(na))return _l(e,t);if(e.gte(Ui))return zl(e,0);if(e.gte(Hi)||!l)return la(e,t);if(e.eq(aa))return 0 .toFixed(t)}return e=ia(e),e.lt(Rn)?_l(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ne(e,t)+"\u207B\xB9"}function te(e){return e=new n(e),e.sign<0?"-"+te(e.neg()):e.gte(na)||e.lte(qi)&&!e.eq(aa)?ne(e):ne(e,0)}function gn(e,t){return t==null&&(t=Ae.defaultDecimalsShown),n.lt(e,0)?"-"+gn(n.neg(e),t):n.gt(e,2**51)?ne(n.div(e,31536e3))+"y":(e=new n(e).toNumber(),e<60?ne(e)+"s":e<3600?te(Math.floor(e/60))+"m "+ne(e%60,t)+"s":e<86400?te(Math.floor(e/3600))+"h "+te(Math.floor(e/60)%60)+"m "+te(e%60)+"s":e<31536e3?te(Math.floor(e/84600)%365)+"d "+te(Math.floor(e/3600)%24)+"h "+te(Math.floor(e/60)%60)+"m":te(Math.floor(e/31536e3))+"y "+te(Math.floor(e/84600)%365)+"d "+te(Math.floor(e/3600)%24)+"h")}function Vi(e,t,l){e=new n(e);let a=e.toStringWithDecimalPlaces(t);return new n(a).gte(l)&&(a=n.sub(l,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),a}function Li(e,t){return ne(e,t,!0)}function ia(e){let t=n.log10(e).ceil();const l=n.div(e,n.pow(10,t));return t=t.neg(),e=new n(10).pow(t).times(l),e}function oa(e,t,l=n.dOne){let a=e[0][0],i=e[0][1];for(let s=1;s<e.length;s++)n.lt(e[s][0],a)&&(a=e[s][0],i=e[s][1]);return ne(n.times(a,l))+t+", limited by "+i}function sa(e){return{[-1]:`${ne(e)}/s`,0:"",1:`+${ne(e)}/s`}[n.compare(e,0)]}var Gi=Object.freeze(Object.defineProperty({__proto__:null,default:n,exponentialFormat:_l,commaFormat:zl,regularFormat:la,format:ne,formatWhole:te,formatTime:gn,toPlaces:Vi,formatSmall:Li,invertOOM:ia,formatLimit:oa,formatGain:sa},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Qi,commaFormat:ji,regularFormat:zi,format:ke,formatWhole:he,formatTime:ln,toPlaces:Wi,formatSmall:Ki,formatLimit:ra,invertOOM:Ji,formatGain:Wl}=Gi;window.Decimal=n;window.exponentialFormat=Qi;window.commaFormat=ji;window.regularFormat=zi;window.format=ke;window.formatWhole=he;window.formatTime=ln;window.toPlaces=Wi;window.formatSmall=Ki;window.formatLimit=ra;window.invertOOM=Ji;window.formatGain=Wl;function ua(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function hn(e){return typeof e=="function"}var ye=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(ye||{});const xl=Symbol("DoNotCache");function U(e,t){const l=e[t];hn(l)&&l.length===0&&!l[xl]?e[t]=k(l.bind(e)):hn(l)&&(e[t]=l.bind(e),e[t][xl]=!0)}function it(e){return hn(e)&&!e[xl]&&(e=k(e)),e}const nl=Symbol("Component"),al=Symbol("GatherProps");let Xi=0;function yl(e="feature-"){return e+Xi++}var tt=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(tt||{});function I(e){return e[xl]=!0,e}function F(e,t=2){return e?0:t}function ot(e,t,l){e[t]===void 0&&l!=null&&(e[t]=l)}function ca(e,...t){const l=[],a=i=>{Object.keys(i).forEach(s=>{const r=i[s];r&&typeof r=="object"&&(t.includes(r.type)?l.push(r):!(r instanceof n)&&!Xe(r)&&a(r))})};return a(e),l}const sl={variables:{"--foreground":"#dfdfdf","--background":"#0f0f0f","--feature-foreground":"#0f0f0f","--tooltip-background":"rgba(0, 0, 0, 0.75)","--raised-background":"#0f0f0f","--points":"#ffffff","--locked":"#bf8f8f","--highlighted":"#333","--bought":"#77bf5f","--danger":"rgb(220, 53, 69)","--link":"#02f2f2","--outline":"#dfdfdf","--accent1":"#627a82","--accent2":"#658262","--accent3":"#7c6282","--border-radius":"15px","--modal-border":"solid 2px var(--color)","--feature-margin":"0px"},floatingTabs:!0,mergeAdjacent:!0,showPin:!0};var vn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(vn||{}),Pl={classic:sl,paper:{...sl,variables:{...sl.variables,"--background":"#2a323d","--feature-foreground":"#000","--raised-background":"#333c4a","--locked":"#3a3e45","--bought":"#5C8A58","--outline":"#333c4a","--border-radius":"4px","--modal-border":"","--feature-margin":"5px"},floatingTabs:!1},nordic:{...sl,variables:{...sl.variables,"--foreground":"#D8DEE9","--background":"#2E3440","--feature-foreground":"#000","--raised-background":"#3B4252","--points":"#E5E9F0","--locked":"#4c566a","--highlighted":"#434c5e","--bought":"#8FBCBB","--danger":"#D08770","--link":"#88C0D0","--outline":"#3B4252","--accent1":"#B48EAD","--accent2":"#A3BE8C","--accent3":"#EBCB8B","--border-radius":"4px","--modal-border":"solid 2px #3B4252","--feature-margin":"5px"},floatingTabs:!1},aqua:{...sl,variables:{...sl.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const He=Zn();document.fonts.onloadingdone=()=>He.emit("fontsLoaded");var Yi=Object.freeze(Object.defineProperty({__proto__:null,globalBus:He},Symbol.toStringTag,{value:"Module"}));var Se=(e,t)=>{const l=e.__vccOpts||e;for(const[a,i]of t)l[a]=i;return l};const Zi=le({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var y;const l=R({}),a=new ResizeObserver(c),i=R(null);Yl(()=>{const g=i.value;g!=null&&a.observe(g)});let s=!0,r=R((y=i.value)==null?void 0:y.getBoundingClientRect());function c(){s&&(s=!1,ul(()=>{var g;r.value=(g=i.value)==null?void 0:g.getBoundingClientRect(),Object.values(l.value).filter(w=>w).forEach(w=>w.rect=w.element.getBoundingClientRect()),t("updateNodes",l.value),s=!0}))}He.on("fontsLoaded",c);const p={attributes:!1,childList:!0,subtree:!1};Vl(yn,(g,w)=>{const h=new MutationObserver(()=>m(g));h.observe(w,p),l.value[g]={element:w,observer:h,rect:w.getBoundingClientRect()},c()}),Vl(bn,g=>{var w;(w=l.value[g])==null||w.observer.disconnect(),l.value[g]=void 0,c()}),Vl(wn,l),Vl(kn,r);function m(g){const w=l.value[g];w!=null&&(w.rect=w.element.getBoundingClientRect(),t("updateNodes",l.value))}return(g,w)=>(b(),x(B,null,[Bt(g.$slots,"default",{},void 0,!0),f("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var da=Se(Zi,[["__scopeId","data-v-2b1dc1bc"]]);const eo=["onPointerdown"],to={class:"modal-wrapper"},lo={class:"modal-container"},no={class:"modal-header"},ao=d(" default header "),io={class:"modal-body"},oo=d(" default body "),so={class:"modal-footer"},ro=f("div",{class:"modal-default-flex-grow"},null,-1),gt=le({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:l}){const i=rt(e),s=k(()=>i.modelValue||c.value);function r(){l("update:modelValue",!1)}const c=R(!1),p=R(null),m=k(()=>{var y,g;return(g=(y=p.value)==null?void 0:y.nodes)!=null?g:null});return t({isOpen:s,nodes:m}),(y,g)=>(b(),Y(La,{to:"#modal-root"},[o(en,{name:"modal",onBeforeEnter:g[0]||(g[0]=w=>c.value=!0),onAfterLeave:g[1]||(g[1]=w=>c.value=!1)},{default:K(()=>[Zl(f("div",cl({class:"modal-mask",onPointerdown:Ml(r,["self"])},y.$attrs),[f("div",to,[f("div",lo,[f("div",no,[Bt(y.$slots,"header",{shown:u(s)},()=>[ao])]),f("div",io,[o(da,{ref_key:"contextRef",ref:p},{default:K(()=>[Bt(y.$slots,"body",{shown:u(s)},()=>[oo])]),_:3},512)]),f("div",so,[Bt(y.$slots,"footer",{shown:u(s)},()=>[f("div",{class:"modal-default-footer"},[ro,f("button",{class:"button modal-default-button",onClick:r}," Close ")])])])])])],16,eo),[[Jn,e.modelValue]])]),_:3})]))}}),yn=Symbol("RegisterNode"),bn=Symbol("UnregisterNode"),wn=Symbol("Nodes"),kn=Symbol("Bounds"),ct=tn({});window.layers=ct;const hl={},Et=[];function Tt(e,t){return bt(()=>{const l={},a=l.emitter=Zn();if(l.on=a.on.bind(a),l.emit=a.emit.bind(a),l.nodes=R({}),l.id=e,Et.push(e),hl[e]=new Set,l.minimized=be(!1),Object.assign(l,t.call(l)),Et[Et.length-1]==null||Et[Et.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${Et}
Trying to pop ${l.id}`;return Et.pop(),U(l,"color"),U(l,"display"),U(l,"name"),ot(l,"name",l.id),U(l,"minWidth"),ot(l,"minWidth",600),U(l,"minimizable"),ot(l,"minimizable",!0),l})}function pa(e,t){if(console.info("Adding layer",e.id),ct[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ct[e.id]);return}ot(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ct[e.id]=e,He.emit("addLayer",e,t.layers[e.id])}function uo(e){return ct[e]}function ma(e){console.info("Removing layer",e.id),He.emit("removeLayer",e),ct[e.id]=void 0}function co(e){ma(e),pa(e,Q)}function po(e){const t=R(!1);return{openModal:()=>t.value=!0,modal:I(()=>o(gt,{modelValue:t.value,"onUpdate:modelValue":l=>t.value=l},{header:()=>o("h2",null,[u(e.name)]),body:u(e.display)}))}}He.on("update",function(t){Object.values(ct).forEach(l=>{l==null||l.emit("preUpdate",t)}),Object.values(ct).forEach(l=>{l==null||l.emit("update",t)}),Object.values(ct).forEach(l=>{l==null||l.emit("postUpdate",t)})});var mo=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:yn,UnregisterNodeInjectionKey:bn,NodesInjectionKey:wn,BoundsInjectionKey:kn,layers:ct,persistentRefs:hl,addingLayers:Et,createLayer:Tt,addLayer:pa,getLayer:uo,removeLayer:ma,reloadLayer:co,setupLayerModal:po},Symbol.toStringTag,{value:"Module"}));const Cn=Symbol("PersistentState"),el=Symbol("DefaultValue"),Kl=Symbol("StackTrace"),fa=Symbol("Deleted"),Al=Symbol("NonPersistent"),Sl=Symbol("SaveDataPath");function fo(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function be(e){const t=Xe(e)?e:R(e);t[Cn]=t,t[el]=Xe(e)?e.value:e,t[Kl]=fo(),t[fa]=!1;const l=k({get(){return t.value},set(a){t.value=a}});return l[el]=t[el],t[Al]=l,t[Sl]=void 0,Et.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[Kl]):hl[Et[Et.length-1]].add(t),t}function ho(e){return e&&typeof e=="object"&&Cn in e}function H(e){return e[Al]}He.on("addLayer",(e,t)=>{const l=[],a=(i,s=[])=>{let r=!1;return Object.keys(i).forEach(c=>{let p=i[c];if(p&&typeof p=="object")if(Ve in p&&(p=p[Ve]),ho(p)){if(r=!0,p[fa]){console.warn("Deleted persistent ref present in returned object. Ignoring...",p,`
Created at:
`+p[Kl]);return}hl[e.id].delete(p);const m=[e.id,...s,c];p[Sl]!=null&&JSON.stringify(m)!==JSON.stringify(p[Sl])&&console.error(`Persistent ref is being saved to \`${m.join(".")}\` when it's already present at \`${p[Sl].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,p),p[Sl]=m;const y=s.reduce((w,h)=>(h in w||(w[h]={}),w[h]),t),g=y[c];y[c]=p[Cn],Ga(y)?g!=null?y[c]=g:y[c]=p[el]:g!=null?y[c].value=g:y[c].value=p[el]}else!(p instanceof n)&&!Xe(p)&&!l.includes(p)&&(typeof p.type=="symbol"&&l.push(p),a(p,[...s,c])&&(Dn(p)&&!Dn(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Ve in i?i[Ve]:i,c):r=!0))}),r};a(e[Ve]),hl[e.id].forEach(i=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,`
Created at:
`+i[Kl])}),hl[e.id].clear()});const Ve=Symbol("ProxyState"),fl=Symbol("ProxyPath");function bt(e,t={}){const l=t;let a=!1;function i(){return a||(Object.assign(l,e(l)),a=!0),l}return new Proxy(l,{get(s,r){if(r===Ve)return i();const c=i()[r];return c&&typeof c=="object"&&Al in c?c[Al]:c},set(s,r,c){return i()[r]=c,!0},has(s,r){return r===Ve?!0:Reflect.has(i(),r)},ownKeys(){return Reflect.ownKeys(i())},getOwnPropertyDescriptor(s,r){return a||(Object.assign(l,e(l)),a=!0),Object.getOwnPropertyDescriptor(s,r)}})}var Ge=window.state=tn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const ha=Bl({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function ga(e){return JSON.stringify(e,(t,l)=>u(l))}const va={get(e,t){var a;if(t===Ve||t===fl)return e[t];const l=e[Ve][t];if(t!=="value"&&(Ja(l)||Array.isArray(l))){if(l!==((a=e[t])==null?void 0:a[Ve])){const i=[...e[fl],t];e[t]=new Proxy({[Ve]:l,[fl]:i},va)}return e[t]}return l},set(e,t,l,a){if(!Ge.hasNaN&&(typeof l=="number"&&isNaN(l)||l instanceof n&&(isNaN(l.sign)||isNaN(l.layer)||isNaN(l.mag)))){const i=e[Ve][t];if(!(typeof i=="number"&&isNaN(i)||i instanceof n&&(isNaN(i.sign)||isNaN(i.layer)||isNaN(i.mag))))throw ha.autosave=!1,Ge.hasNaN=!0,Ge.NaNPath=[...e[fl],t],Ge.NaNReceiver=a,console.error("Attempted to set NaN value",[...e[fl],t],e[Ve]),"Attempted to set NaN value. See above for details"}return e[Ve][t]=l,!0},ownKeys(e){return Reflect.ownKeys(e[Ve])},has(e,t){return Reflect.has(e[Ve],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[Ve],t)}};var Q=window.player=new Proxy({[Ve]:ha,[fl]:["player"]},va);function ya(e={}){return Object.assign({id:`${Ae.id}-0`,name:"Default Save",tabs:Ae.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:Ae.id,modVersion:Ae.versionNumber,layers:{}},e)}function It(e){const t=Yt.compressToUTF16(ga(e!=null?e:Q[Ve]));return localStorage.setItem((e!=null?e:Q[Ve]).id,t),t}async function go(){yo();try{let e=localStorage.getItem(Le.active);if(e==null){await rl(gl());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==Ae.id){await rl(gl());return}t.id=Le.active,await rl(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await rl(gl())}}function gl(){const e=Gl(),t=ya({id:e});return It(t),Le.saves.push(e),t}function Gl(){let e,t=0;do e=`${Ae.id}-${t++}`;while(localStorage.getItem(e));return e}const _n=R(!1);async function rl(e){console.info("Loading save",e),_n.value=!0;const{layers:t,removeLayer:l,addLayer:a}=await jl(()=>Promise.resolve().then(function(){return mo}),void 0),{fixOldSave:i,getInitialLayers:s}=await jl(()=>Promise.resolve().then(function(){return or}),void 0);for(const r in t){const c=t[r];c&&l(c)}s(e).forEach(r=>a(r,e)),e=ya(e),e.offlineProd&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,Ae.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==Ae.versionNumber&&i(e.modVersion,e),Object.assign(Q,e),Le.active=Q.id,He.emit("onLoad")}setInterval(()=>{Q.autosave&&It()},1e3);window.onbeforeunload=()=>{Q.autosave&&It()};window.save=It;const vo=window.hardReset=async()=>{await rl(gl())},El=Bl({active:"",saves:[],showTPS:!0,theme:vn.Nordic,unthrottled:!1});Dt(El,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(Ae.id,t)},{deep:!0});var Le=window.settings=El;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:vn.Nordic};He.emit("loadSettings",e),Object.assign(El,e),vo()};function yo(){try{let e=localStorage.getItem(Ae.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(El,t)}He.emit("loadSettings",El)}catch{}}const ba=Bl([]);function bo(e){ba.push(e)}const wa=Bl([]);function wo(e){wa.push(e)}const ko=Bl([]),Co={class:"table"},kt=le({__name:"Column",setup(e){const t=k(()=>Pl[Le.theme].mergeAdjacent);return(l,a)=>(b(),x("div",Co,[f("div",{class:Qe(["col",{mergeAdjacent:u(t)}])},[Bt(l.$slots,"default")],2)]))}}),_o={class:"table"},Il=le({__name:"Row",setup(e){const t=k(()=>Pl[Le.theme].mergeAdjacent);return(l,a)=>(b(),x("div",_o,[f("div",{class:Qe(["row",{mergeAdjacent:u(t)}])},[Bt(l.$slots,"default")],2)]))}});function Sn(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Qa(e)}function Ce(e,t="span"){return typeof e=="function"?le({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),le({template:e})):le({render:()=>({})}):e}function ue(e){if(jt(e))return typeof e=="function"?e():Ce(e);const t=e[nl];return o(t,e[al](),null)}function _e(...e){let t;return o(Il,null,Sn(t=e.map(ue))?t:{default:()=>[t]})}function Nl(...e){let t;return o(kt,null,Sn(t=e.map(ue))?t:{default:()=>[t]})}function Pt(e){if(jt(e))return typeof e=="function"?e():typeof e=="string"?o(B,null,[e]):o(e,null,null);const t=e[nl];return o(t,e[al](),null)}function So(...e){let t;return o(kt,null,Sn(t=e.map(Pt))?t:{default:()=>[t]})}function jt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[xl]===!0}function ka(e,t,l){const a=R(null),i=R(void 0);function s(p){a.value||(a.value=setInterval(c,250)),i.value=p,l&&(l.value=!0)}function r(){a.value&&(clearInterval(a.value),a.value=null),l&&(l.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Xn(r),{start:s,stop:r,handleHolding:c}}function No(e,t){const l=k(()=>e.filter(a=>u(a.visibility)===tt.Visible&&t(a)));return{firstFeature:k(()=>l.value[0]),collapsedContent:I(()=>Nl(...l.value.slice(1))),hasCollapsedContent:k(()=>l.value.length>1)}}function Jl(e,t="div"){const l=xt();return _t(()=>{l.value=Ce(lt(e),t)}),l}function ll(e,t="div"){const l=xt(null);return _t(()=>{const a=lt(e);l.value=a==null?null:Ce(a,t)}),l}function Mo(e){return k(()=>lt(e))}function lt(e){return u(u(e))}function q(...e){return e.includes(Object)||e.push(Object),e}const we=le({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,l)=>(b(),x("div",{style:Ye({width:e.width,height:e.height})},null,4))}});const xo={},Ao={class:"notif"};function Eo(e,t){return b(),x("div",Ao,"!")}var Un=Se(xo,[["render",Eo],["__scopeId","data-v-66323fd4"]]);const nn=e=>(zt("data-v-9de19f28"),e=e(),Wt(),e),Io={key:0,class:"day feature dontMerge opened"},Bo={class:"date"},Po=d("Dec"),Do=nn(()=>f("br",null,null,-1)),Fo={class:"date"},To=d("Dec"),$o=nn(()=>f("br",null,null,-1)),Oo=nn(()=>f("div",{class:"doors"},null,-1)),Ro={class:"date"},Uo=d("Dec"),qo=nn(()=>f("br",null,null,-1)),Ho={key:0,class:"material-icons lock"},Vo={key:1,class:"timer"},Lo={key:2,class:"timer"},Go=le({__name:"Day",props:{day:null,symbol:null,layer:null,opened:null,recentlyUpdated:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const l=e,a=k(()=>l.layer&&n.gte(J.day.value,l.day)&&new Date().getMonth()===11&&new Date().getDate()>=l.day);function i(){a.value&&t("unlockLayer")}return(s,r)=>e.opened.value?(b(),x("div",Io,[o(en,{appear:"",name:"door"},{default:K(()=>[f("div",{class:"doors",onClick:r[0]||(r[0]=c=>t("openLayer"))},[f("div",Bo,[Po,Do,d(ce(e.day),1)]),f("div",Fo,[To,$o,d(ce(e.day),1)])])]),_:1}),f("div",{class:"icon",style:Ye({backgroundImage:`url(${e.symbol})`})},null,4),f("div",{class:"lore",onClick:r[1]||(r[1]=c=>t("openLore"))},"?"),u(e.shouldNotify)?(b(),Y(Un,{key:0})):T("",!0)])):(b(),x("div",{key:1,class:Qe(["day feature dontMerge",{can:u(a),locked:!u(a),canOpen:u(a)}]),onClick:i},[Oo,f("div",Ro,[Uo,qo,d(ce(e.day),1)]),u(a)?T("",!0):(b(),x("div",Ho,"lock")),u(J).day.value===e.day&&!u(a)?(b(),x("div",Vo,ce(u(gn)(u(J).timeUntilNewDay.value,0)),1)):u(J).day.value===e.day&&e.layer==null?(b(),x("div",Lo,"NYI")):T("",!0),u(a)?(b(),Y(Un,{key:3})):T("",!0)],2))}});var Qo=Se(Go,[["__scopeId","data-v-9de19f28"]]);const jo=le({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,l=Jl(Ft(t,"display")),a=Jl(Ft(t,"content"));return(i,s)=>(b(),Y(kt,{class:"collapsible-container"},{default:K(()=>[f("button",{onClick:s[0]||(s[0]=r=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(b(),Y(qe(u(l))))]),e.collapsed.value?T("",!0):(b(),Y(qe(u(a)),{key:0}))]),_:1}))}});var zo=Se(jo,[["__scopeId","data-v-a72c16aa"]]);const Wo={key:0},Ko={key:0,class:"mark star"},Jo=["src"],Xo=le({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,l)=>e.mark?(b(),x("div",Wo,[e.mark===!0?(b(),x("div",Ko)):(b(),x("img",{key:1,class:"mark",src:e.mark},null,8,Jo))])):T("",!0)}});var an=Se(Xo,[["__scopeId","data-v-2207999f"]]);const Yo=le({__name:"Node",props:{id:null},setup(e){const l=rt(e),a=Ql(yn,()=>{}),i=Ql(bn,()=>{}),s=xt(null),r=k(()=>s.value&&s.value.parentElement);return Dt([r,l.id],([c,p],[m,y])=>{m&&i(u(y)),c&&a(p,c)}),Xn(()=>i(u(l.id))),(c,p)=>(b(),x("div",{class:"node",ref_key:"node",ref:s},null,512))}});var Dl=Se(Yo,[["__scopeId","data-v-a48cb382"]]);const Zo=le({props:{progress:{type:q(String,Object,Number),required:!0},width:{type:q(Number),required:!0},height:{type:q(Number),required:!0},direction:{type:q(String),required:!0},display:q(Object,String,Function),visibility:{type:q(Number),required:!0},style:q(Object,String,Array),classes:q(Object),borderStyle:q(Object,String,Array),textStyle:q(Object,String,Array),baseStyle:q(Object,String,Array),fillStyle:q(Object,String,Array),mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:an,Node:Dl},setup(e){const{progress:t,width:l,height:a,direction:i,display:s}=rt(e),r=k(()=>{let m=t.value instanceof n?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(m,0),1))*100}),c=k(()=>{const m={width:lt(l)+.5+"px",height:lt(a)+.5+"px"};switch(u(i)){case ye.Up:m.clipPath=`inset(${r.value}% 0% 0% 0%)`,m.width=lt(l)+1+"px";break;case ye.Down:m.clipPath=`inset(0% 0% ${r.value}% 0%)`,m.width=lt(l)+1+"px";break;case ye.Right:m.clipPath=`inset(0% ${r.value}% 0% 0%)`;break;case ye.Left:m.clipPath=`inset(0% 0% 0% ${r.value} + '%)`;break;case ye.Default:m.clipPath="inset(0% 50% 0% 0%)";break}return m}),p=ll(s);return{normalizedProgress:r,barStyle:c,component:p,unref:u,Visibility:tt}}});function es(e,t,l,a,i,s){var p,m,y,g,w,h,C;const r=tl("MarkNode"),c=tl("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),x("div",{key:0,style:Ye([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:{}]),class:Qe({bar:!0,...e.unref(e.classes)})},[f("div",{class:"overlayTextContainer border",style:Ye([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(m=e.unref(e.borderStyle))!=null?m:{}])},[e.component?(b(),x("span",{key:0,class:"overlayText",style:Ye(e.unref(e.textStyle))},[(b(),Y(qe(e.component)))],4)):T("",!0)],4),f("div",{class:"border",style:Ye([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(y=e.unref(e.style))!=null?y:{},(g=e.unref(e.baseStyle))!=null?g:{},(w=e.unref(e.borderStyle))!=null?w:{}])},[f("div",{class:"fill",style:Ye([e.barStyle,(h=e.unref(e.style))!=null?h:{},(C=e.unref(e.fillStyle))!=null?C:{}])},null,4)],4),o(r,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],6)):T("",!0)}var ts=Se(Zo,[["render",es],["__scopeId","data-v-02d0d7b2"]]);const ls=Symbol("Bar");function Qt(e){return bt(()=>{const t=e();return t.id=yl("bar-"),t.type=ls,t[nl]=ts,U(t,"visibility"),ot(t,"visibility",tt.Visible),U(t,"width"),U(t,"height"),U(t,"direction"),U(t,"style"),U(t,"classes"),U(t,"borderStyle"),U(t,"baseStyle"),U(t,"textStyle"),U(t,"fillStyle"),U(t,"progress"),U(t,"display"),U(t,"mark"),t[al]=function(){const{progress:l,width:a,height:i,direction:s,display:r,visibility:c,style:p,classes:m,borderStyle:y,textStyle:g,baseStyle:w,fillStyle:h,mark:C,id:S}=this;return{progress:l,width:a,height:i,direction:s,display:r,visibility:c,style:u(p),classes:m,borderStyle:y,textStyle:g,baseStyle:w,fillStyle:h,mark:C,id:S}},t})}var ns=le({props:{display:{type:q(Object,String,Function),required:!0},visibility:{type:q(Number),required:!0},style:q(Object,String,Array),classes:q(Object),onClick:Function,onHold:Function,canClick:{type:q(Boolean),required:!0},small:Boolean,mark:q(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:Dl,MarkNode:an},setup(e){const{display:t,onClick:l,onHold:a}=rt(e),i=xt("");_t(()=>{const c=lt(t);if(c==null){i.value="";return}if(jt(c)){i.value=Ce(c);return}const p=Ce(c.title||"","h3"),m=Ce(c.description,"div");i.value=Ce(I(()=>o("span",null,[c.title?o("div",null,[o(p,null,null)]):null,o(m,null,null)])))});const{start:s,stop:r}=ka(l,a,e.isHolding);return{start:s,stop:r,comp:i,Visibility:tt,unref:u}}});function as(e,t,l,a,i,s){var p;const r=tl("MarkNode"),c=tl("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),x("button",{key:0,style:Ye([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:[]]),onClick:t[0]||(t[0]=(...m)=>e.onClick&&e.onClick(...m)),onMousedown:t[1]||(t[1]=(...m)=>e.start&&e.start(...m)),onMouseleave:t[2]||(t[2]=(...m)=>e.stop&&e.stop(...m)),onMouseup:t[3]||(t[3]=(...m)=>e.stop&&e.stop(...m)),onTouchstartPassive:t[4]||(t[4]=(...m)=>e.start&&e.start(...m)),onTouchendPassive:t[5]||(t[5]=(...m)=>e.stop&&e.stop(...m)),onTouchcancelPassive:t[6]||(t[6]=(...m)=>e.stop&&e.stop(...m)),class:Qe({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(b(),Y(qe(e.unref(e.comp)),{key:0})):T("",!0),o(r,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],38)):T("",!0)}var Ca=Se(ns,[["render",as],["__scopeId","data-v-8cedd7da"]]);const is=Symbol("Clickable");function V(e){return bt(()=>{var l;const t=(l=e==null?void 0:e())!=null?l:{};if(t.id=yl("clickable-"),t.type=is,t[nl]=Ca,t.isHolding=R(!1),U(t,"visibility"),ot(t,"visibility",tt.Visible),U(t,"canClick"),ot(t,"canClick",!0),U(t,"classes"),U(t,"style"),U(t,"mark"),U(t,"display"),t.onClick){const a=t.onClick.bind(t);t.onClick=function(i){u(t.canClick)&&a(i)}}if(t.onHold){const a=t.onHold.bind(t);t.onHold=function(){u(t.canClick)&&a()}}return t[al]=function(){const{display:a,visibility:i,style:s,classes:r,onClick:c,onHold:p,isHolding:m,canClick:y,small:g,mark:w,id:h}=this;return{display:a,visibility:i,style:u(s),classes:r,onClick:c,onHold:p,isHolding:m,canClick:y,small:g,mark:w,id:h}},t})}function st(e,t="points",l=0,a=void 0){const i=Xe(e)?e:be(e);if(i.displayName=t,i.precision=l,i.small=a,!Xe(e)){const s=i[Al];s.displayName=t,s.precision=l,s.small=a}return i}function qn(e){const t=be(e.value);return Dt(e,l=>{_n.value||n.gt(l,t.value)&&(t.value=l)}),t}function os(e){const t=be(e.value);return Dt(e,(l,a)=>{_n.value||n.gt(l,a)&&(t.value=n.add(t.value,n.sub(l,a)))}),t}new n("10^^8");new n("1e100");function Fl(e,t){const l=t!=null?t:e.value;return n.eq(e.precision,0)?he(e.small?l:n.floor(l)):ke(l,e.precision,e.small)}const ss=["x1","y1","x2","y2"],rs=le({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const l=rt(e),a=k(()=>{const s=l.startNode.value.rect,r=l.boundingRect.value,c=r?{x:s.x+s.width/2-r.x,y:s.y+s.height/2-r.y}:{x:0,y:0};return l.link.value.offsetStart&&(c.x+=l.link.value.offsetStart.x,c.y+=l.link.value.offsetStart.y),c}),i=k(()=>{const s=l.endNode.value.rect,r=l.boundingRect.value,c=r?{x:s.x+s.width/2-r.x,y:s.y+s.height/2-r.y}:{x:0,y:0};return l.link.value.offsetEnd&&(c.x+=l.link.value.offsetEnd.x,c.y+=l.link.value.offsetEnd.y),c});return(s,r)=>(b(),x("line",cl({"stroke-width":"15px",stroke:"white"},e.link,{x1:u(a).x,y1:u(a).y,x2:u(i).x,y2:u(i).y}),null,16,ss))}});const us=le({__name:"Links",props:{links:null},setup(e){var p;const l=Ft(e,"links"),a=R(null),i=Ql(wn,R({})),s=Ql(kn,R(void 0)),r=R((p=a.value)==null?void 0:p.getBoundingClientRect());Dt(s,()=>{var m;return r.value=(m=a.value)==null?void 0:m.getBoundingClientRect()}),Yl(()=>{var m;return r.value=(m=a.value)==null?void 0:m.getBoundingClientRect()});const c=k(()=>{var y,g;const m=i.value;return(g=(y=l.value)==null?void 0:y.filter(w=>{var h,C;return((h=m[w.startNode.id])==null?void 0:h.rect)&&((C=m[w.startNode.id])==null?void 0:C.rect)}))!=null?g:[]});return(m,y)=>(b(),x(B,null,[u(c)?(b(),x("svg",ja(cl({key:0},m.$attrs)),[(b(!0),x(B,null,Yn(u(c),(g,w)=>(b(),Y(rs,{key:w,link:g,boundingRect:r.value,startNode:u(i)[g.startNode.id],endNode:u(i)[g.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):T("",!0),f("div",{ref_key:"resizeListener",ref:a,class:"resize-listener"},null,512)],64))}});var cs=Se(us,[["__scopeId","data-v-063f6d6b"]]);le({props:{nodes:{type:q(Array),required:!0},leftSideNodes:q(Array),rightSideNodes:q(Array),branches:q(Array)},components:{Links:cs},setup(e){const{nodes:t,leftSideNodes:l,rightSideNodes:a}=rt(e),i=xt();_t(()=>{const c=lt(t);i.value=Ce(I(()=>o(B,null,[c.map(p=>o("span",{class:"row tree-row",style:"margin: 50px auto;"},[p.map(Pt)]))])))});const s=xt();_t(()=>{const c=lt(l);s.value=c?Ce(I(()=>o("span",{class:"left-side-nodes small"},[c.map(Pt)]))):""});const r=xt();return _t(()=>{const c=lt(a);r.value=c?Ce(I(()=>o("span",{class:"side-nodes small"},[c.map(Pt)]))):""}),{unref:u,nodesComp:i,leftNodesComp:s,rightNodesComp:r}}});le({props:{display:q(Object,String,Function),visibility:{type:q(Number),required:!0},style:q(String,Object,Array),classes:q(Object),onClick:Function,onHold:Function,color:q(String),glowColor:q(String),canClick:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:an,Node:Dl},setup(e){const{onClick:t,onHold:l,display:a}=rt(e),i=ll(a),{start:s,stop:r}=ka(t,l);return{start:s,stop:r,comp:i,unref:u,Visibility:tt,isCoercableComponent:jt}}});function dl(e){const t=[],l={};let a=!1;function i(){return a||(t.push(...e()),l.base=t.map(c=>it(c.base)),l.baseText=t.map(c=>it(c.baseText)),l.visible=t.map(c=>it(c.visible)),a=!0),t}const s=be({});return[I(()=>{const c=i();let p=!0;const m=c.map((y,g)=>{var S,N,oe;if(u(l.visible[g])===!1)return null;const w=o("h3",{onClick:()=>s.value[g]=!s.value[g],style:"cursor: pointer"},[o("span",{class:"modifier-toggle"+(u(s.value[g])?" collapsed":"")},[d("\u25BC")]),y.title,y.subtitle?o("span",{class:"subtitle"},[d(" ("),y.subtitle,d(")")]):null]),h=u(s.value[g])?null:o(B,null,[o("div",{class:"modifier-container"},[o("span",{class:"modifier-description"},[Pt((S=u(l.baseText[g]))!=null?S:"Base")]),o("span",{class:"modifier-amount"},[ke((N=u(l.base[g]))!=null?N:1),y.unit])]),Pt(u(y.modifier.description))]),C=!p;return p=!1,o(B,null,[C?o("br",null,null):null,o("div",null,[w,o("br",null,null),h,o("hr",null,null),o("div",{class:"modifier-container"},[o("span",{class:"modifier-description"},[d("Total")]),o("span",{class:"modifier-amount"},[ke(y.modifier.apply((oe=u(l.base[g]))!=null?oe:1)),y.unit])])])])});return o(B,null,[m])}),s]}function Xl(e){const t=Object.values(e).reverse(),l=be(!0),a=k(()=>t.filter(p=>p.earned.value===!1)),{firstFeature:i,collapsedContent:s,hasCollapsedContent:r}=No(t,p=>p.earned.value),c=I(()=>{const p=[...a.value];return i.value&&p.push(i.value),So(...p,I(()=>Zl(o(zo,{collapsed:l,content:s,display:l.value?"Show other completed milestones":"Hide other completed milestones"},null),[[Jn,u(r)]])))});return{collapseMilestones:l,display:c}}function pl(e){const t=os(e.resource),l=()=>{var c,p;if(J.day.value!==e.day)return 1;let s=n.add(t.value,1),r=e.goal;return((p=(c=e.usingLog)==null?void 0:c.value)!=null?p:Q.usingLog)&&(s=s.log10(),r=n.log10(r)),n.div(s,r)},a=Qt(()=>({direction:ye.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:l,display:I(()=>J.day.value===e.day?o(B,null,[te(t.value),d("/"),te(e.goal)]):"")})),i=I(()=>o(B,null,[o("div",null,[J.day.value===e.day?o(B,null,[d("Reach "),te(e.goal),d(" total "),e.resource.displayName,d(" to complete the day")]):o(B,null,[e.name,d(" Complete!")]),e.modal?o(B,null,[" ",d("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[d("Check Modifiers")])]):void 0]),ue(a),e.modal?ue(e.modal.display):void 0]));return _t(()=>{J.day.value===e.day&&n.gte(t.value,e.goal)&&J.completeDay()}),{total:t,trackerDisplay:i}}const ds=Symbol("Buyable");function De(e){const t=be(0);return bt(()=>{var s,r,c;const l=e();if(l.canPurchase==null&&(l.resource==null||l.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",l),"Cannot create buyable without a canPurchase property or a resource and cost property";l.id=yl("buyable-"),l.type=ds,l[nl]=Ca,l.amount=t,l.amount[el]=(s=l.initialValue)!=null?s:0,l.canAfford=k(()=>{const p=l,m=u(p.cost);return p.resource!=null&&m!=null&&n.gte(p.resource.value,m)}),l.canPurchase==null&&(l.canPurchase=k(()=>u(l.visibility)===tt.Visible&&u(l.canAfford)&&n.lt(l.amount.value,u(l.purchaseLimit)))),l.maxed=k(()=>n.gte(l.amount.value,u(l.purchaseLimit))),U(l,"classes");const a=l.classes;l.classes=k(()=>{const p=u(a)||{};return l.maxed.value&&(p.bought=!0),p}),U(l,"canPurchase"),l.canClick=l.canPurchase,l.onClick=l.purchase=(c=(r=l.onClick)!=null?r:l.purchase)!=null?c:function(){var y;const p=l;if(!u(p.canPurchase))return;const m=u(p.cost);p.cost!=null&&p.resource!=null&&(p.resource.value=n.sub(p.resource.value,m),p.amount.value=n.add(p.amount.value,1)),(y=p.onPurchase)==null||y.call(p,m)},U(l,"display");const i=l.display;return l.display=I(()=>{const p=u(i);if(jt(p)){const m=Ce(p);return o(m,null,null)}if(p!=null&&l.cost!=null&&l.resource!=null){const m=l,y=Ce(p.title||"","h3"),g=Ce(p.description||""),w=Ce(p.effectDisplay||"");return o("span",null,[p.title?o("div",null,[o(y,null,null)]):null,p.description?o(g,null,null):null,p.showAmount===!1?null:o("div",null,[o("br",null,null),u(m.purchaseLimit)===n.dInf?o(B,null,[d("Amount: "),he(m.amount.value)]):o(B,null,[d("Amount: "),he(m.amount.value),d(" /")," ",he(u(m.purchaseLimit))])]),p.effectDisplay?o("div",null,[o("br",null,null),d("Currently: "),o(w,null,null)]):null,m.cost&&!m.maxed.value?o("div",null,[d("Cost: "),ke(u(m.cost)||0)," ",l.resource.displayName]):null])}return""}),U(l,"visibility"),ot(l,"visibility",tt.Visible),U(l,"cost"),U(l,"resource"),U(l,"purchaseLimit"),ot(l,"purchaseLimit",n.dInf),U(l,"style"),U(l,"mark"),U(l,"small"),l[al]=function(){const{display:p,visibility:m,style:y,classes:g,onClick:w,canClick:h,small:C,mark:S,id:N}=this;return{display:p,visibility:m,style:u(y),classes:g,onClick:w,canClick:h,small:C,mark:S,id:N}},l})}const on=tn({}),Nn=Symbol("Hotkey");function vl(e){return bt(()=>{const t=e();return t.type=Nn,U(t,"enabled"),ot(t,"enabled",!0),U(t,"description"),t})}He.on("addLayer",e=>{ca(e,Nn).forEach(t=>{on[t.key]=t})});He.on("removeLayer",e=>{ca(e,Nn).forEach(t=>{on[t.key]=void 0})});document.onkeydown=function(e){var a;if(((a=e.target)==null?void 0:a.tagName)==="INPUT"||An.value&&!Q.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const l=on[t];l&&u(l.enabled)&&(e.preventDefault(),l.onPress())};wo(I(()=>{const e=Object.values(on).filter(t=>u(t==null?void 0:t.enabled));return e.length===0?"":o("div",null,[o("br",null,null),o("h4",null,[d("Hotkeys")]),e.map(t=>o("div",null,[t==null?void 0:t.key,d(": "),t==null?void 0:t.description]))])}));const ps=le({__name:"Sticky",setup(e){const t=R("0"),l=new ResizeObserver(i),a=xt(null);function i(){let s=a.value;if(s==null)return;let r=0;for(;s.previousSibling;){const c=s.previousSibling;c.dataset&&"vSticky"in c.dataset&&(r+=c.offsetHeight),s=c}t.value=r+"px"}return ul(i),document.fonts.ready.then(i),Yl(()=>{var r;const s=(r=a.value)==null?void 0:r.parentElement;s&&l.observe(s)}),(s,r)=>(b(),x("div",{class:"sticky",style:Ye({top:t.value}),ref_key:"element",ref:a,"data-v-sticky":""},[Bt(s.$slots,"default",{},void 0,!0)],4))}});var ms=Se(ps,[["__scopeId","data-v-cccac690"]]);const Hn=le({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,l=k(()=>Fl(t.resource));return(a,i)=>(b(),x("h2",{style:Ye({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},ce(u(l)),5))}});const fs={class:"main-display"},hs={key:0},gs={key:1},vs=d(", "),ys={key:2},bs=f("br",null,null,-1),ws={class:"main-display"},ks={key:0},Cs={key:1},_s=d(", "),Ss={key:2},Ns=f("br",null,null,-1),St=le({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const l=rt(e),a=R(null),i=ll(l.effectDisplay),s=ll(l.productionDisplay),r=k(()=>n.lt(l.resource.value,"1e1000"));return(c,p)=>{var m,y;return e.sticky?(b(),Y(ms,{key:0},{default:K(()=>{var g,w,h,C;return[f("div",{class:Qe(["main-display-container",(g=e.classes)!=null?g:{}]),style:Ye([{height:`${((h=(w=a.value)==null?void 0:w.$el.clientHeight)!=null?h:0)+50}px`},(C=e.style)!=null?C:{}])},[f("div",fs,[u(r)?(b(),x("span",hs,"You have ")):T("",!0),o(Hn,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),d(" "+ce(e.resource.displayName),1),u(i)?(b(),x("span",gs,[vs,(b(),Y(qe(u(i)),{ref_key:"effectRef",ref:a},null,512))])):T("",!0),u(s)?(b(),x("span",ys,[bs,(b(),Y(qe(u(s)),{ref_key:"effectRef",ref:a},null,512))])):T("",!0)])],6)]}),_:1})):(b(),x("div",{key:1,class:Qe(["main-display-container",(m=e.classes)!=null?m:{}]),style:Ye([{height:"50px"},(y=e.style)!=null?y:{}])},[f("div",ws,[u(r)?(b(),x("span",ks,"You have ")):T("",!0),o(Hn,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),d(" "+ce(e.resource.displayName),1),u(i)?(b(),x("span",Cs,[_s,(b(),Y(qe(u(i)),{ref_key:"effectRef",ref:a},null,512))])):T("",!0),u(s)?(b(),x("span",Ss,[Ns,(b(),Y(qe(u(s)),{ref_key:"effectRef",ref:a},null,512))])):T("",!0)])],6))}}});var Ms=le({props:{display:{type:q(String,Object,Function),required:!0},visibility:{type:q(Number),required:!0},style:q(String,Object,Array),classes:q(Object),resource:Object,cost:q(String,Object,Number),canPurchase:{type:q(Boolean),required:!0},bought:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Dl,MarkNode:an},setup(e){const{display:t,cost:l}=rt(e),a=xt("");return _t(()=>{const i=lt(t);if(i==null){a.value="";return}if(jt(i)){a.value=Ce(i);return}const s=lt(l),r=Ce(i.title||"","h3"),c=Ce(i.description,"div"),p=Ce(i.effectDisplay||"");a.value=Ce(I(()=>{var m;return o("span",null,[i.title?o("div",null,[o(r,null,null)]):null,o(c,null,null),i.effectDisplay?o("div",null,[d("Currently: "),o(p,null,null)]):null,e.resource!=null&&i.showCost!==!1?o(B,null,[o("br",null,null),d("Cost: "),e.resource&&Fl(e.resource,s)," ",(m=e.resource)==null?void 0:m.displayName]):null])}))}),{component:a,unref:u,Visibility:tt}}});const xs=["disabled"];function As(e,t,l,a,i,s){var p;const r=tl("MarkNode"),c=tl("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),x("button",{key:0,style:Ye([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(p=e.unref(e.style))!=null?p:{}]),onClick:t[0]||(t[0]=(...m)=>e.purchase&&e.purchase(...m)),class:Qe({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(b(),Y(qe(e.unref(e.component)),{key:0})):T("",!0),o(r,{mark:e.unref(e.mark)},null,8,["mark"]),o(c,{id:e.id},null,8,["id"])],14,xs)):T("",!0)}var Es=Se(Ms,[["render",As],["__scopeId","data-v-7f411ac8"]]);const Is=Symbol("Upgrade");function G(e){const t=be(!1);return bt(()=>{const l=e();return l.id=yl("upgrade-"),l.type=Is,l[nl]=Es,l.canAfford==null&&(l.resource==null||l.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",l),l.bought=t,l.canAfford==null?l.canAfford=k(()=>{const a=l;return a.resource!=null&&a.cost!=null&&n.gte(a.resource.value,u(a.cost))}):U(l,"canAfford"),l.canPurchase=k(()=>u(l.visibility)===tt.Visible&&u(l.canAfford)&&!u(l.bought)),l.purchase=function(){var i;const a=l;!u(a.canPurchase)||(a.resource!=null&&a.cost!=null&&(a.resource.value=n.sub(a.resource.value,u(a.cost))),t.value=!0,(i=a.onPurchase)==null||i.call(a))},U(l,"visibility"),ot(l,"visibility",tt.Visible),U(l,"classes"),U(l,"style"),U(l,"display"),U(l,"mark"),U(l,"cost"),U(l,"resource"),l[al]=function(){const{display:a,visibility:i,style:s,classes:r,resource:c,cost:p,canPurchase:m,bought:y,mark:g,id:w,purchase:h}=this;return{display:a,visibility:i,style:u(s),classes:r,resource:c,cost:p,canPurchase:m,bought:y,mark:g,id:w,purchase:h}},l})}function ae(e){return bt(()=>{const{addend:t,description:l,enabled:a}=e(),i=it(t),s=it(l),r=a==null?void 0:it(a);return{apply:c=>n.add(c,u(i)),revert:c=>n.sub(c,u(i)),enabled:r,description:l==null?void 0:I(()=>o("div",{class:"modifier-container"},[u(s)?o("span",{class:"modifier-description"},[Pt(u(s))]):null,o("span",{class:"modifier-amount"},[n.gte(u(i),0)?"+":"",ke(u(i))])]))}})}function E(e){return bt(()=>{const{multiplier:t,description:l,enabled:a}=e(),i=it(t),s=it(l),r=a==null?void 0:it(a);return{apply:c=>n.times(c,u(i)),revert:c=>n.div(c,u(i)),enabled:r,description:l==null?void 0:I(()=>o("div",{class:"modifier-container"},[u(s)?o("span",{class:"modifier-description"},[Pt(u(s))]):null,o("span",{class:"modifier-amount"},[d("\xD7"),ke(u(i))])]))}})}function _a(e){return bt(()=>{const{exponent:t,description:l,enabled:a,supportLowNumbers:i}=e(),s=it(t),r=it(l),c=a==null?void 0:it(a);return{apply:p=>{let m=p;return i&&(m=n.add(m,1)),m=n.pow(m,u(s)),i&&(m=n.sub(m,1)),m},revert:p=>{let m=p;return i&&(m=n.add(m,1)),m=n.root(m,u(s)),i&&(m=n.sub(m,1)),m},enabled:c,description:l==null?void 0:I(()=>o("div",{class:"modifier-container"},[u(r)?o("span",{class:"modifier-description"},[Pt(u(r)),i?" (+1 effective)":null]):null,o("span",{class:"modifier-amount"},[d("^"),ke(u(s))])]))}})}function X(e){return bt(()=>{const t=e();return{apply:l=>t.filter(a=>u(a.enabled)!==!1).reduce((a,i)=>i.apply(a),l),revert:t.every(l=>l.revert!=null)?l=>t.filter(a=>u(a.enabled)!==!1).reduceRight((a,i)=>i.revert(a),l):void 0,enabled:k(()=>t.filter(l=>u(l.enabled)!==!1).length>0),description:I(()=>o(B,null,[t.filter(l=>u(l.enabled)!==!1).map(l=>u(l.description)).filter(l=>l).map(Pt)]))}})}function Sa(e){return bt(()=>{const t=e();return t.currentGain==null&&(t.currentGain=k(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=n.floor(l).max(0),u(t.buyMax)||(l=l.min(1)),l})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=k(()=>{let l=t.scaling.currentAt(t);return t.roundUpCost&&(l=n.ceil(l)),l})),t.nextAt==null&&(t.nextAt=k(()=>{let l=t.scaling.nextAt(t);return t.roundUpCost&&(l=n.ceil(l)),l})),t.convert==null&&(t.convert=function(){var i;const l=u(t.currentGain),a=u(t.currentAt);t.gainResource.value=n.add(t.gainResource.value,l),t.spend(l,a),(i=t.onConvert)==null||i.call(t,l)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),U(t,"currentGain"),U(t,"actualGain"),U(t,"currentAt"),U(t,"nextAt"),U(t,"buyMax"),ot(t,"buyMax",!0),U(t,"roundUpCost"),ot(t,"roundUpCost",!0),t})}function Mn(e,t){const l=it(e),a=it(t);return{currentGain(i){let s=u(i.baseResource.value);if(i.costModifier&&(s=i.costModifier.apply(s)),n.lt(s,u(l)))return 0;const r=n.div(s,u(l)).pow(u(a));return r.isNan()?new n(0):r},currentAt(i){let s=u(i.currentGain);return i.gainModifier&&(s=i.gainModifier.revert(s)),s=n.max(0,s).root(u(a)).times(u(l)),i.costModifier&&(s=i.costModifier.revert(s)),s},nextAt(i){let s=n.add(u(i.currentGain),1).floor();return i.gainModifier&&(s=i.gainModifier.revert(s)),s=n.max(0,s).root(u(a)).times(u(l)).max(u(l)),i.costModifier&&(s=i.costModifier.revert(s)),s}}}function Na(e){return Sa(e)}function Bs(e){return Sa(()=>{const t=e();return ot(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=k(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=n.floor(l).max(t.gainResource.value),u(t.buyMax)||(l=l.min(n.add(t.gainResource.value,1))),l})),t.actualGain==null&&(t.actualGain=k(()=>{let l=n.sub(n.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return u(t.buyMax)||(l=l.min(1)),l})),ot(t,"convert",function(){var i;const l=u(t.actualGain),a=u(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(u(t.currentGain)):u(t.currentGain),t.spend(l,a),(i=t.onConvert)==null||i.call(t,l)}),t})}const Ps="boxes",Vn=6,Ct=Tt(Ps,function(){const e="Boxes",t="#964B00",l=st(0,"boxes"),a=Na(()=>({scaling:Mn(1e10,1),baseResource:ge.logs,gainResource:H(l),roundUpCost:!0})),i=V(()=>({display:I(()=>o(B,null,[o("span",{style:"font-size: large"},[d("Create "),he(a.currentGain.value),d(" "),l.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[d("Cost:")," ",Fl(ge.logs,n.gte(a.actualGain.value,1)?a.currentAt.value:a.nextAt.value)," ",ge.logs.displayName])])),canClick:()=>n.gte(a.actualGain.value,1),onClick(){!u(this.canClick)||a.convert()},style:"width: 600px; min-height: unset"})),s=G(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){J.days[3].recentlyUpdated.value=!0},resource:H(l),cost:100})),r=G(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){J.days[3].recentlyUpdated.value=!0},resource:H(l),cost:1e3})),c=G(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){J.days[3].recentlyUpdated.value=!0},resource:H(l),cost:4e3})),p={logsUpgrade:s,ashUpgrade:r,coalUpgrade:c},m=De(()=>({display:{title:"Carry more logs",description:"Use boxes to carry even more logs, boosting their gain",effectDisplay:I(()=>o(B,null,[ke(n.div(m.amount.value,2).add(1)),d("x")]))},resource:H(l),cost(){return n.pow(3,m.amount.value).times(100)},visibility:()=>F(s.bought.value)})),y=De(()=>({display:{title:"Carry more ash",description:"Use boxes to carry even more ash, boosting its gain",effectDisplay:I(()=>o(B,null,[ke(n.div(y.amount.value,2).add(1)),d("x")]))},resource:H(l),cost(){return n.pow(5,y.amount.value).times(1e3)},visibility:()=>F(r.bought.value)})),g=De(()=>({display:{title:"Carry more coal",description:"Use boxes to carry even more coal, boosting its gain",effectDisplay:I(()=>o(B,null,[ke(n.div(g.amount.value,2).add(1)),d("x")]))},resource:H(l),cost(){return n.pow(7,g.amount.value).times(1e3)},visibility:()=>F(c.bought.value)})),w={logBoxesBuyable:m,ashBoxesBuyable:y,coalBoxesBuyable:g},{total:h,trackerDisplay:C}=pl({resource:l,goal:5e4,name:e,day:Vn,color:t});return{name:e,day:Vn,color:t,boxes:l,totalBoxes:h,boxesConversion:a,upgrades:p,buyables:w,minWidth:700,display:I(()=>o(B,null,[ue(C),o(we,null,null),o(St,{resource:l,color:t,style:"margin-bottom: 0"},null),o(we,null,null),ue(i),o(we,null,null),_e(...Object.values(p)),_e(...Object.values(w))]))}});const Ds={class:"field"},Fs=le({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,a=k(()=>Ce(u(l.title)||"<span></span>","span")),i=k({get(){return!!l.modelValue},set(s){t("update:modelValue",s)}});return(s,r)=>(b(),x("label",Ds,[Zl(f("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":r[0]||(r[0]=c=>Xe(i)?i.value=c:null)},null,512),[[za,u(i)]]),(b(),Y(qe(u(a))))]))}});var Gt=Se(Fs,[["__scopeId","data-v-33d57459"]]);const Ts={class:"field"},$s={key:0,class:"field-title"},xn=le({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var r;const l=e,a=ll(Ft(l,"title"),"span"),i=R((r=l.options.find(c=>c.value===l.modelValue))!=null?r:null);Dt(Ft(l,"modelValue"),c=>{var p;lt(i)!==c&&(i.value=(p=l.options.find(m=>m.value===c))!=null?p:null)});function s(c){t("update:modelValue",c.value)}return(c,p)=>(b(),x("div",Ts,[u(a)?(b(),x("span",$s,[(b(),Y(qe(u(a))))])):T("",!0),o(u(Xa),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[p[0]||(p[0]=m=>i.value=m),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var Os=le({props:{visibility:{type:q(Number),required:!0},display:{type:q(String,Object,Function),required:!0},style:q(String,Object,Array),classes:q(Object),earned:{type:q(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:Dl},setup(e){const{display:t}=rt(e),l=xt("");return _t(()=>{const a=lt(t);if(a==null){l.value="";return}if(jt(a)){l.value=Ce(a);return}const i=Ce(a.requirement,"h3"),s=Ce(a.effectDisplay||"","b"),r=Ce(a.optionsDisplay||"","span");l.value=Ce(I(()=>o("span",null,[o(i,null,null),a.effectDisplay?o("div",null,[o(s,null,null)]):null,a.optionsDisplay?o("div",{class:"equal-spaced"},[o(r,null,null)]):null])))}),{comp:l,unref:u,Visibility:tt}}});function Rs(e,t,l,a,i,s){var c;const r=tl("Node");return e.unref(e.visibility)!==e.Visibility.None?(b(),x("div",{key:0,style:Ye([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:Qe({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(b(),Y(qe(e.unref(e.comp)))),o(r,{id:e.id},null,8,["id"])],6)):T("",!0)}var Us=Se(Os,[["render",Rs],["__scopeId","data-v-f4e8794e"]]);He.on("setupVue",e=>e.use(Ya));const Ln=ea(),qs=Symbol("Milestone");let Zt;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(Zt||(Zt={}));function Ee(e){const t=be(!1);return bt(()=>{var i;const l=(i=e==null?void 0:e())!=null?i:{};l.id=yl("milestone-"),l.type=qs,l[nl]=Us,l.earned=t,l.complete=function(){var r;const s=l;if(t.value=!0,(r=s.onComplete)==null||r.call(s),s.display&&u(s.showPopups)===!0){const c=u(s.display),p=Ce(jt(c)?c:c.requirement);Ln(o(B,null,[o("h3",null,[d("Milestone earned!")]),o("div",null,[o(p,null,null)])]))}},U(l,"visibility"),ot(l,"visibility",tt.Visible);const a=l.visibility;if(l.visibility=k(()=>{const s=u(l.display);switch(Le.msDisplay){default:case Zt.All:return u(a);case Zt.Configurable:return u(l.earned)&&!(s!=null&&typeof s=="object"&&"optionsDisplay"in s)?tt.None:u(a);case Zt.Incomplete:return u(l.earned)?tt.None:u(a);case Zt.None:return tt.None}}),U(l,"style"),U(l,"classes"),U(l,"display"),U(l,"showPopups"),l[al]=function(){const{visibility:s,display:r,style:c,classes:p,earned:m,id:y}=this;return{visibility:s,display:r,style:u(c),classes:p,earned:m,id:y}},l.shouldEarn){const s=l;_t(()=>{var r,c;if(Le.active===Q.id&&!s.earned.value&&u(s.visibility)===tt.Visible&&((r=s.shouldEarn)==null?void 0:r.call(s))&&(s.earned.value=!0,(c=s.onComplete)==null||c.call(s),s.display&&u(s.showPopups)===!0)){const p=u(s.display),m=Ce(jt(p)?p:p.requirement);Ln(o(B,null,[o("h3",null,[d("Milestone earned!")]),o("div",null,[o(m,null,null)])]))}})}return l})}He.on("loadSettings",e=>{ot(e,"msDisplay",Zt.All)});const Hs=Object.values(Zt).map(e=>({label:ua(e),value:e}));bo(I(()=>o(xn,{title:"Show Milestones",options:Hs,"onUpdate:modelValue":e=>Le.msDisplay=e,modelValue:Le.msDisplay},null)));const Vs=Symbol("Reset");function Ls(e){return bt(()=>{const t=e();return t.id=yl("reset-"),t.type=Vs,t.reset=function(){var a;const l=i=>{if(i&&typeof i=="object")if(el in i){const s=i;s.value=s[el]}else!(i instanceof n)&&!Xe(i)&&Object.values(i).forEach(s=>l(s))};u(t.thingsToReset).forEach(l),He.emit("reset",t),(a=t.onReset)==null||a.call(t)},U(t,"thingsToReset"),t})}const Ll={};He.on("removeLayer",e=>{var t;(t=Ll[e.id])==null||t.call(Ll),Ll[e.id]=void 0});const Gs="paper",Gn=5,xe=Tt(Gs,function(){const e="Paper",t="#E8DCB8",l=st(0,"paper"),a=st(k(()=>n.min(n.div(ge.logs.value,1e9),n.div(O.ash.value,1e6))),"pulp"),i=Na(()=>({scaling:Mn(1,1.2),baseResource:a,gainResource:H(l),roundUpCost:!0,spend(de,L){ge.logs.value=n.sub(ge.logs.value,n.times(L,1e9)),O.ash.value=n.sub(O.ash.value,n.times(L,1e6))},gainModifier:oe})),s=V(()=>({display:I(()=>{const de=n.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value;return o(B,null,[o("span",{style:"font-size: large"},[d("Create "),he(i.currentGain.value),d(" "),l.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[d("Cost: "),Fl(ge.logs,de),d(" "),a.displayName,d(" ("),he(n.times(de,1e9)),d(" "),ge.logs.displayName,d(";")," ",he(n.times(de,1e6)),d(" "),O.ash.displayName,d(")")])])}),canClick:()=>n.gte(i.actualGain.value,1),onClick(){!u(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"}));function r(de){const L=De(()=>({...de,display:{title:de.name,description:`Print a copy of "${de.name}", which ${de.elfName} will use to improve their skills! Each copy printed will reduce the "${de.buyableName}" price scaling by 0.95x and make ${de.elfName} purchase +10% faster!`,effectDisplay:I(()=>o(B,null,[ke(n.pow(.95,L.amount.value)),d("x price scaling,")," ",ke(n.div(L.amount.value,10).add(1)),d("x auto-purchase speed")])),showAmount:!1},resource:H(l),cost:()=>n.pow(5,L.amount.value).times(10),style:"width: 600px"}));return L}const c=r({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),p=r({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),m=r({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),y=r({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),g=r({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),w=r({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),h=r({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>F(Je.elves.smallFireElf.bought.value)}),C=r({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>F(Je.elves.bonfireElf.bought.value)}),S=r({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>F(Je.elves.kilnElf.bought.value)}),N={cuttersBook:c,plantersBook:p,expandersBook:m,heatedCuttersBook:y,heatedPlantersBook:g,fertilizerBook:w,smallFireBook:h,bonfireBook:C,kilnBook:S},oe=X(()=>[E(()=>({multiplier:2,description:"Scholar's shoes",enabled:qt.paperUpgrades.paperUpgrade1.bought})),E(()=>({multiplier:2,description:"Scholar's slacks",enabled:qt.paperUpgrades.paperUpgrade2.bought})),E(()=>({multiplier:2,description:"Scholar's jacket",enabled:qt.paperUpgrades.paperUpgrade3.bought}))]),[A,M]=dl(()=>[{title:"Paper Gain",modifier:oe,base:1}]),D=R(!1),Ne=I(()=>o(gt,{modelValue:D.value,"onUpdate:modelValue":de=>D.value=de},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:A})),{total:Te,trackerDisplay:Z}=pl({resource:l,goal:5e3,name:e,day:Gn,color:t,textColor:"var(--feature-foreground)",modal:{show:D,display:Ne}});return{name:e,day:Gn,color:t,paper:l,totalPaper:Te,paperConversion:i,books:N,generalTabCollapsed:M,minWidth:700,display:I(()=>o(B,null,[ue(Z),o(we,null,null),o(St,{resource:l,color:t,style:"margin-bottom: 0"},null),o(we,null,null),ue(s),o(we,null,null),Nl(...Object.values(N))]))}}),Qs="workshop",kl=2,ft=Tt(Qs,function(){const e="Workshop",t="#D66B02",l="#D66B02",a=st(0,"foundation progress"),i=Bs(()=>({scaling:Mn(250,1.5),baseResource:ge.logs,gainResource:H(a),roundUpCost:!0,buyMax:!1,spend(D,Ne){ge.logs.value=n.sub(ge.logs.value,Ne)}})),s=V(()=>({display:I(()=>o(B,null,[o("b",{style:"font-size: x-large"},[d("Build part of the foundation")]),o("br",null,null),o("br",null,null),o("span",{style:"font-size: large"},[d("Cost:")," ",Fl(ge.logs,n.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value)," ",ge.logs.displayName])])),visibility:()=>F(n.lt(a.value,100)),canClick:()=>n.gte(i.actualGain.value,1)&&n.lt(a.value,100),onClick(){!u(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"})),r=vl(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{s.canClick.value&&s.onClick()}})),c=k(()=>!Je.milestones[6].earned.value),p=Ee(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>n.gte(a.value,1),showPopups:c})),m=Ee(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>n.gte(a.value,10),visibility:()=>F(p.earned.value),showPopups:c})),y=Ee(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>n.gte(a.value,20),visibility:()=>F(m.earned.value),showPopups:c})),g=Ee(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>n.gte(a.value,30),visibility:()=>F(y.earned.value),showPopups:c})),w=Ee(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>n.gte(a.value,40),visibility:()=>F(g.earned.value),showPopups:c})),h=Ee(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>n.gte(a.value,50),visibility:()=>F(w.earned.value),showPopups:c})),C=Ee(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>n.gte(a.value,75),visibility:()=>F(h.earned.value),showPopups:c})),S=Ee(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>n.gte(a.value,100),visibility:()=>F(C.earned.value),showPopups:c})),N={logGainMilestone1:p,autoCutMilestone1:m,autoPlantMilestone1:y,autoCutMilestone2:g,autoPlantMilestone2:w,logGainMilestone2:h,morePlantsMilestone1:C,logGainMilestone3:S},{collapseMilestones:oe,display:A}=Xl(N),M=Qt(()=>({direction:ye.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>J.day.value===kl?n.div(a.value,100):1,display:I(()=>J.day.value===kl?o(B,null,[he(a.value),d("%")]):"")}));return _t(()=>{J.day.value===kl&&n.gte(a.value,100)&&J.completeDay()}),{name:e,day:kl,color:t,foundationProgress:a,foundationConversion:i,milestones:N,collapseMilestones:oe,minWidth:700,buildFoundationHK:r,display:I(()=>o(B,null,[o("div",null,[J.day.value===kl?"Complete the foundation to complete the day":`${e} Complete!`]),ue(M),o(we,null,null),o("div",null,[o("span",null,[d("The foundation is ")]),o("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[he(a.value)]),d("% completed")]),n.lt(a.value,100)?o(we,null,null):null,ue(s),o(we,null,null),A()]))}}),js="elves",Cl=4,Je=Tt(js,function(){const e="Elves",t="red",l="#911D21",i=Qt(()=>({direction:ye.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>J.day.value===Cl?n.div(pe.value,6).times(.8333333333333334).add(n.div(n.add(O.coal.value,1).log10(),n.log10(1e9)).clamp(0,1).div(6)):1,display:I(()=>J.day.value===Cl?n.lt(pe.value,6)?o(B,null,[he(pe.value),d("/6 elves")]):o(B,null,[he(O.coal.value),d("/"),he(1e9),d(" coal")]):"")})),s=Ls(()=>({thingsToReset:[ge,ft,O],onReset(){setTimeout(()=>{nt.earned.value?(ge.row1Upgrades.forEach(j=>j.bought.value=!0),ge.row2Upgrades.forEach(j=>j.bought.value=!0)):ve.earned.value&&(ge.row1Upgrades[4].bought.value=!0,ge.row2Upgrades[4].bought.value=!0),ie.earned.value&&(ft.foundationProgress.value=100)})}})),r=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>n.gt(xe.books.cuttersBook.amount.value,0)}))]),c=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>n.gt(xe.books.plantersBook.amount.value,0)}))]),p=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>n.gt(xe.books.expandersBook.amount.value,0)}))]),m=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>n.gt(xe.books.heatedCuttersBook.amount.value,0)}))]),y=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>n.gt(xe.books.heatedPlantersBook.amount.value,0)}))]),g=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>n.gt(xe.books.fertilizerBook.amount.value,0)}))]),w=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>n.gt(xe.books.smallFireBook.amount.value,0)}))]),h=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>n.gt(xe.books.bonfireBook.amount.value,0)}))]),C=X(()=>[E(()=>({multiplier:2,description:"6 Elves Trained",enabled:Be.earned})),E(()=>({multiplier:()=>n.times(xe.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>n.gt(xe.books.kilnBook.amount.value,0)}))]),[S,N]=dl(()=>[{title:"Holly Auto-Buy Frequency",modifier:r,base:10,unit:"/s",visible:z.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:z.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:p,base:10,unit:"/s",visible:z.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:z.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:y,base:10,unit:"/s",visible:z.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:g,base:10,unit:"/s",visible:z.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:z.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:h,base:10,unit:"/s",visible:z.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:C,base:10,unit:"/s",visible:z.kilnElf.bought}]),oe=R(!1),A=I(()=>o(gt,{modelValue:oe.value,"onUpdate:modelValue":j=>oe.value=j},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:S}));function M(j){var Mt;const dt=k(()=>n.pow(4,pe.value).times(1e6)),fe=be(0),se=j.hasToggle?be(!1):R(!0),Ht=k(()=>j.cooldownModifier.apply(10)),yt=it((Mt=j.canBuy)!=null?Mt:!0);function $t(wt){var ze;if($.bought.value&&u(yt)){fe.value=n.add(fe.value,wt);const Ot=n.recip(Ht.value);for(;n.gte(fe.value,Ot);)if(j.customCost==null?u(j.buyable.canPurchase):n.gte(j.buyable.resource.value,j.customCost(j.buyable.amount.value)))j.buyable.amount.value=n.add(j.buyable.amount.value,1),fe.value=n.sub(fe.value,Ot),(ze=j.onAutoPurchase)==null||ze.call(j);else{fe.value=Ot;break}}}const $=G(()=>({...j,buyable:void 0,toggle:se,buyProgress:fe,update:$t,resource:O.coal,cost:dt,computedAutoBuyCooldown:Ht,display:()=>({title:j.name,description:I(()=>o(B,null,[j.description,$.bought.value?null:o(B,null,[" ",d("Training this elf will require resetting all your progress from days 1-3.")]),$.bought.value&&j.hasToggle===!0?o(B,null,[o(Gt,{title:j.toggleDesc,"onUpdate:modelValue":wt=>se.value=wt,modelValue:se.value},null)]):null])),showCost:!$.bought.value}),style:"width: 190px",onPurchase(){var wt;(wt=j.onPurchase)==null||wt.call(j),s.reset()}}));return $}const D=M({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:ge.row1Buyables[0],cooldownModifier:r}),Ne=M({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:ge.row1Buyables[1],cooldownModifier:c}),Te=M({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:ge.row1Buyables[2],cooldownModifier:p}),Z=[D,Ne,Te],de=M({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:O.heatedCutters,cooldownModifier:m}),L=M({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:O.heatedPlanters,cooldownModifier:y}),Ze=M({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:O.moreFertilizer,cooldownModifier:g}),$e=[de,L,Ze],Oe=M({name:"Joy",description:"Joy will automatically purchase small fires you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased small fires automatically. Small fires will start giving a boost to ash and coal gain.",buyable:O.buildFire,cooldownModifier:w,visibility:()=>F(Ct.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){Oe.toggle.value&&(O.activeFires.value=n.add(O.activeFires.value,1))},onPurchase(){J.days[4].recentlyUpdated.value=!0}}),Ie=M({name:"Faith",description:"Faith will automatically purchase bonfires you can afford. You can toggle whether or not to enable the purchased bonfires automatically. Bonfires will start giving a boost to ash and coal gain.",buyable:O.buildBonfire,cooldownModifier:h,visibility:()=>F(Ct.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){const j=u(this.buyable.cost);O.activeFires.value=n.sub(O.activeFires.value,j).max(0),O.buildFire.amount.value=n.sub(O.buildFire.amount.value,j).max(0),Ie.toggle.value&&(O.activeBonfires.value=n.add(O.activeBonfires.value,1))},onPurchase(){J.days[4].recentlyUpdated.value=!0},canBuy:O.unlockBonfire.bought}),je=M({name:"Snowball",description:"Snowball will automatically purchase kilns you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased kilns automatically. Kilns will start giving a boost to ash and coal gain.",buyable:O.buildKiln,cooldownModifier:C,visibility:()=>F(Ct.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){je.toggle.value&&(O.activeKilns.value=n.add(O.activeKilns.value,1))},onPurchase(){J.days[4].recentlyUpdated.value=!0},canBuy:O.unlockKiln.bought}),ut=[Oe,Ie,je],z={cuttersElf:D,plantersElf:Ne,expandersElf:Te,heatedCuttersElf:de,heatedPlantersElf:L,fertilizerElf:Ze,smallFireElf:Oe,bonfireElf:Ie,kilnElf:je},pe=k(()=>Object.values(z).filter(j=>j.bought.value).length),W=Ee(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>n.gte(pe.value,1)})),ve=Ee(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>n.gte(pe.value,2),visibility:()=>F(W.earned.value)})),Me=Ee(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>n.gte(pe.value,3),visibility:()=>F(ve.earned.value)})),et=Ee(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>n.gte(pe.value,4),visibility:()=>F(Me.earned.value)})),Re=Ee(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>n.gte(pe.value,5),visibility:()=>F(et.earned.value)})),Be=Ee(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>n.gte(pe.value,6),visibility:()=>F(Re.earned.value)})),ie=Ee(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>n.gte(pe.value,7),visibility:()=>F(Be.earned.value&&J.day.value>5)})),Pe=Ee(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>n.gte(pe.value,8),visibility:()=>F(ie.earned.value)})),nt=Ee(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>n.gte(pe.value,9),visibility:()=>F(Pe.earned.value)})),Ue=[W,ve,Me,et,Re,Be,ie,Pe,nt],re={manualMilestone:W,researchMilestone:ve,coalGainMilestone:Me,logGainMilestone:et,forestMilestone:Re,elvesMilestone:Be,foundationMilestone:ie,forestMilestone2:Pe,treeUpgradesMilestone:nt},{collapseMilestones:vt,display:at}=Xl(re);return He.on("update",j=>{n.lt(J.day.value,Cl)||Object.values(z).forEach(dt=>dt.update(j))}),_t(()=>{J.day.value===Cl&&n.gte(pe.value,6)&&n.gte(O.coal.value,1e9)&&J.completeDay()}),{name:e,color:t,elves:z,totalElves:pe,milestones:Ue,collapseMilestones:vt,generalTabCollapsed:N,minWidth:700,display:I(()=>o(B,null,[o("div",null,[J.day.value===Cl?`Reach ${he(6)} trained elves and ${he(1e9)} ${O.coal.displayName} to complete the day`:`${e} Complete!`," ",d("-")," ",o("button",{class:"button",style:"display: inline-block;",onClick:()=>oe.value=!0},[d("Check Modifiers")])]),ue(i),ue(A),o(we,null,null),o("div",{style:"width: 600px"},[_e(...Z),_e(...$e),_e(...ut)]),at()]))}}),zs={},Ws={style:{"white-space":"nowrap"}},Ks=f("span",{style:{"font-size":"larger","font-family":"initial"}},"\u221A",-1),Js={style:{"text-decoration":"overline"}};function Xs(e,t){return b(),x("span",Ws,[Ks,f("span",Js,[Bt(e.$slots,"default")])])}var Ys=Se(zs,[["render",Xs]]);const Zs="oil",fn=9,We=Tt(Zs,function(){const e="Oil",t="#000000",l="var(--foreground)",a=st(0,"oil"),i=st(0,"depth"),s=be(0),r=k(()=>n.lt(i.value,990)?n.add(10,i.value):n.pow(1.001,n.sub(i.value,990)).mul(1e3));function c(){if(n.lt(i.value,990)){const Fe=n.min(n.affordArithmeticSeries(s.value,10,1,i.value),n.sub(990,i.value)),mt=n.sumArithmeticSeries(Fe,10,1,i.value);s.value=n.sub(s.value,mt),i.value=n.add(i.value,Fe)}if(n.gte(i.value,990)){const Fe=n.affordGeometricSeries(s.value,1e3,1.001,n.sub(i.value,990)),mt=n.sumGeometricSeries(Fe,1e3,1.001,n.sub(i.value,990));s.value=n.sub(s.value,mt),i.value=n.add(i.value,Fe)}}const p=be(0),m=k(()=>n.times(n.pow(p.value,oe.value).pow(2),1e14)),y=k(()=>n.times(n.pow(p.value,oe.value),1)),g=De(()=>({resource:ht.metal,cost(){let Fe=new n(this.amount.value);return n.pow(1.3,Fe).times(25e3)},display:I(()=>o(B,null,[o("h3",null,[d("Heavy Drill")]),o("br",null,null),d("A large drill specialized at deep mining."),o("br",null,null),d("Consumes 1e14x"),o("sup",null,[d("2")]),d(" coal/sec for 1x drill power."),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("-"),ne(m.value),d(" coal/sec"),o("br",null,null),d("+"),ne(y.value),d(" drill power"),o("br",null,null),o("br",null,null),d("Cost: "),te(u(g.cost)),d(" "),g.resource.displayName])),onPurchase(){p.value=n.add(p.value,1)},style:{color:l,width:"160px"}})),w=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(p.value,0)},onClick(){p.value=0}})),h=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(p.value,0)},onClick(){p.value=n.sub(p.value,1)}})),C=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(p.value,g.amount.value)},onClick(){p.value=n.add(p.value,1)}})),S=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(p.value,g.amount.value)},onClick(){p.value=g.amount.value}})),N=be(0),oe=k(()=>n.add(N.value,Math.E).ln()),A=De(()=>({resource:ht.metal,cost(){let Fe=new n(this.amount.value);return n.pow(2,Fe).times(1e5)},display:I(()=>o(B,null,[o("h3",null,[d("Heavy Drill Drill")]),o("br",null,null),d("Attach extra drills to Heavy Drills to make them faster"),o("br",null,null),d("Raise amount of effective Heavy Drills by ^ln(x + e)."),o("br",null,null),d("(also affect coal consumption)."),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("^"),ne(oe.value),d(" Heavy Drill amount"),o("br",null,null),o("br",null,null),d("Cost: "),te(u(A.cost)),d(" "),A.resource.displayName])),onPurchase(){N.value=n.add(N.value,1)},style:{color:l,width:"160px"}})),M=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(N.value,0)},onClick(){N.value=0}})),D=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(N.value,0)},onClick(){N.value=n.sub(N.value,1)}})),Ne=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(N.value,A.amount.value)},onClick(){N.value=n.add(N.value,1)}})),Te=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(N.value,A.amount.value)},onClick(){N.value=A.amount.value}})),Z=be(0),de=k(()=>n.pow(1/3,Z.value)),L=k(()=>n.pow(2,Z.value)),Ze=k(()=>n.pow(1.2,Z.value)),$e=De(()=>({resource:ht.metal,cost(){let Fe=new n(this.amount.value);return n.pow(8,Fe).times(2e5)},display:I(()=>o(B,null,[o("h3",null,[d("Heavy Extractor")]),o("br",null,null),d("Attach extractors to the drill to mine coal and ore, with a price."),o("br",null,null),d("Sacrifice 3\xD7 drill power to get 2\xD7 coal/sec and 1.2\xD7 ore/sec."),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("\xD7"),ne(de.value),d(" drill power"),o("br",null,null),d("\xD7"),ne(L.value),d(" coal/sec"),o("br",null,null),d("\xD7"),ne(Ze.value),d(" ore/sec"),o("br",null,null),o("br",null,null),d("Cost: "),te(u($e.cost)),d(" "),$e.resource.displayName])),onPurchase(){Z.value=n.add(Z.value,1)},style:{color:l,width:"160px"}})),Oe=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(Z.value,0)},onClick(){Z.value=0}})),Ie=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(Z.value,0)},onClick(){Z.value=n.sub(Z.value,1)}})),je=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(Z.value,$e.amount.value)},onClick(){Z.value=n.add(Z.value,1)}})),ut=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(Z.value,$e.amount.value)},onClick(){Z.value=$e.amount.value}})),z=be(0),pe=k(()=>n.pow(At[3].bought.value?4:5,z.value)),W=k(()=>n.pow(z.value,2).mul(p.value).mul(n.add(N.value,1)).mul(Z.value).mul(i.value).div(1e5)),ve=De(()=>({resource:ht.metal,cost(){let Fe=new n(this.amount.value),mt=n.pow(16,Fe).times(2e6);return At[4].bought.value&&(mt=mt.div(n.add(il.value,1).root(6))),mt},display:I(()=>o(B,null,[o("h3",null,[d("Oil Pump")]),o("br",null,null),d("Pump those oil from the ground."),o("br",null,null),d("Gain oil based on the number of Heavy stuff active and well depth, but coal usage increases by "),At[3].bought.value?4:5,d("\xD7."),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("\xD7"),ne(pe.value),d(" coal usage"),o("br",null,null),d("+"),ne(W.value),d(" oil/sec"),o("br",null,null),o("br",null,null),d("Cost: "),te(u(ve.cost)),d(" "),ve.resource.displayName])),onPurchase(){z.value=n.add(z.value,1)},style:{color:l,width:"160px"}})),Me=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(z.value,0)},onClick(){z.value=0}})),et=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(z.value,0)},onClick(){z.value=n.sub(z.value,1)}})),Re=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(z.value,ve.amount.value)},onClick(){z.value=n.add(z.value,1)}})),Be=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(z.value,ve.amount.value)},onClick(){z.value=ve.amount.value}})),ie=be(0),Pe=k(()=>n.pow(ie.value,2)),nt=k(()=>n.pow(ie.value,3).mul(1e19)),Ue=k(()=>n.add(ie.value,1)),re=De(()=>({resource:H(a),cost(){let Fe=new n(this.amount.value);return n.pow(2,Fe).times(50)},display:I(()=>o(B,null,[o("h3",null,[d("Oil Burner")]),o("br",null,null),d("Burn oil as fuel."),o("br",null,null),d("1x"),o("sup",null,[d("2")]),d(" unit of oil can substitude 1e19x"),o("sup",null,[d("3")]),d(" units of coal."),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("-"),ne(Pe.value),d(" oil/sec"),o("br",null,null),d("-"),ne(nt.value),d(" coal consumption"),At[2].bought.value?o(B,null,[o("br",null,null),d("\xD7"),ne(Ue.value),d(" auto smelting multi")]):"",o("br",null,null),o("br",null,null),d("Cost: "),te(u(re.cost)),d(" "),re.resource.displayName])),onPurchase(){ie.value=n.add(ie.value,1)},style:{color:l,width:"160px"}})),vt=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(ie.value,0)},onClick(){ie.value=0}})),at=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(ie.value,0)},onClick(){ie.value=n.sub(ie.value,1)}})),j=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(ie.value,re.amount.value)},onClick(){ie.value=n.add(ie.value,1)}})),dt=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(ie.value,re.amount.value)},onClick(){ie.value=re.amount.value}})),fe=be(0),se=k(()=>n.pow(fe.value,2).mul(100)),Ht=k(()=>n.add(fe.value,1)),yt=De(()=>({resource:ht.metal,cost(){let Fe=new n(this.amount.value),mt=n.pow(10,Fe).times(1e7);return At[4].bought.value&&(mt=mt.div(n.add(il.value,1).root(6))),mt},display:I(()=>o(B,null,[o("h3",null,[d("Oil Smelter")]),o("br",null,null),d("Use oil as a crucible fuel."),o("br",null,null),d("Burn 100x"),o("sup",null,[d("2")]),d(" oil to smelt +100% faster."),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("-"),ne(se.value),d(" oil/sec"),o("br",null,null),d("\xD7"),ne(Ht.value),d(" smelting speed"),o("br",null,null),o("br",null,null),d("Cost: "),te(u(yt.cost)),d(" "),yt.resource.displayName])),onPurchase(){fe.value=n.add(fe.value,1)},style:{color:l,width:"160px"}})),$t=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(fe.value,0)},onClick(){fe.value=0}})),$=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.gt(fe.value,0)},onClick(){fe.value=n.sub(fe.value,1)}})),Mt=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(fe.value,yt.amount.value)},onClick(){fe.value=n.add(fe.value,1)}})),wt=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:l},canClick(){return n.lt(fe.value,yt.amount.value)},onClick(){fe.value=yt.amount.value}})),ze=[Ee(()=>({display:{requirement:"5m Well Depth",effectDisplay:"Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."},shouldEarn:()=>n.gte(i.value,5)})),Ee(()=>({display:{requirement:"10m Well Depth",effectDisplay:"Drill too slow? Unlock some drill upgrades!"},shouldEarn:()=>n.gte(i.value,10),visibility:()=>F(ze[0].earned.value)})),Ee(()=>({display:{requirement:"25m Well Depth",effectDisplay:"Gain 5% more ore for each metre of well depth."},shouldEarn:()=>n.gte(i.value,25),visibility:()=>F(ze[1].earned.value)})),Ee(()=>({display:{requirement:"60m Well Depth",effectDisplay:"Drill still too slow? Try unlocking another drill!"},shouldEarn:()=>n.gte(i.value,60),visibility:()=>F(ze[2].earned.value)})),Ee(()=>({display:{requirement:"150m Well Depth",effectDisplay:"It appears that coal and metal appear a lot more when you go this deep! Unlock more coal and metal upgrades!"},shouldEarn:()=>n.gte(i.value,150),visibility:()=>F(ze[3].earned.value)})),Ee(()=>({display:{requirement:"350m Well Depth",effectDisplay:"There are even more coal and metal than you thought. Why don't you utilize your heavy drill to mine them? Unlock a new drill upgrade!"},shouldEarn:()=>n.gte(i.value,350),visibility:()=>F(ze[4].earned.value)})),Ee(()=>({display:{requirement:"1,000m Well Depth",effectDisplay:"You've finally found oil! Maybe it's time to get those oil pumps to the use! Unfortunately extracting them would use more coal than ever, also it's becoming much harder to mine deeper due to the thermal heat and pressure."},shouldEarn:()=>n.gte(i.value,1e3),visibility:()=>F(n.gte(i.value,1e3))})),Ee(()=>({display:{requirement:"3,000m Well Depth",effectDisplay:"You found a large oil spot! Double oil gain!"},shouldEarn:()=>n.gte(i.value,3e3),visibility:()=>F(n.gte(i.value,2e3))}))],{collapseMilestones:Ot,display:rn}=Xl(ze),Vt=[Ee(()=>({display:{requirement:"100 total oil",effectDisplay:"Hmm, these oil pumps are really expensive. Maybe you should find a way to solve this problem. Maybe you can use oil as fuel instead of coal?"},shouldEarn:()=>n.gte(il.value,100)})),Ee(()=>({display:{requirement:"500 total oil",effectDisplay:"Unlocks oil upgrades! These can be bought with oil."},shouldEarn:()=>n.gte(il.value,500),visibility:()=>F(Vt[0].earned.value)})),Ee(()=>({display:{requirement:"10,000 total oil",effectDisplay:"Wow, these are really bright when you burn it. Maybe it can be helpful to use them to smelt metal?"},shouldEarn:()=>n.gte(il.value,1e4),visibility:()=>F(Vt[1].earned.value)}))],{collapseMilestones:Bn,display:$l}=Xl(Vt),Rt=[G(()=>({resource:O.coal,cost:1e18,display:{title:"Coal Drill Synergy",description:"Increase drill power by +4% per coal Mining Drill owned.",effectDisplay:I(()=>o(B,null,[d("x"),ne(pt[0].value)]))},style:{color:l}})),G(()=>({resource:ht.metal,cost:15e4,display:{title:"Metal Drill Synergy",description:"Increase drill power by +4% per ore Mining Drill owned.",effectDisplay:I(()=>o(B,null,[d("x"),ne(pt[1].value)]))},style:{color:l}})),G(()=>({resource:O.coal,cost:1e20,display:{title:"Coal Drill Upgrade",description:"Increase drill power by +6% per OoM of coal owned.",effectDisplay:I(()=>o(B,null,[d("x"),ne(pt[2].value)]))},style:{color:l}})),G(()=>({resource:ht.metal,cost:15e5,display:{title:"Metal Drill Upgrade",description:"Increase drill power by +10% per OoM of metal ingot owned.",effectDisplay:I(()=>o(B,null,[d("x"),ne(pt[3].value)]))},style:{color:l}})),G(()=>({resource:H(a),cost:100,display:{title:"Drill Oil",description:"Increase previous upgrades' effect by +0.1% per thing per Heavy Drill owned.",effectDisplay:I(()=>o(B,null,[d("+"),ne(n.mul(pt[4].value,100)),d("%")]))},style:{color:l}}))],pt=[k(()=>n.mul(O.buildDrill.amount.value,n.add(.04,Lt.value)).add(1)),k(()=>n.mul(ht.oreDrill.amount.value,n.add(.04,Lt.value)).add(1)),k(()=>n.mul(n.max(O.coal.value,1).log10().floor(),n.add(.06,Lt.value)).add(1)),k(()=>n.mul(n.max(ht.metal.value,1).log10().floor(),n.add(.1,Lt.value)).add(1)),k(()=>n.mul(g.amount.value,.001))],At=[G(()=>({resource:H(a),cost:100,display:{title:"Oil the Oil Pump",description:"Double oil gain."},style:{color:l}})),G(()=>({resource:H(a),cost:500,display:{title:"Oil the Mining Drills",description:"Double ore mining speed and square the coal drill amount in its effect."},style:{color:l}})),G(()=>({resource:H(a),cost:1500,display:{title:"Blaster Burner",description:"The Oil Burner can now increase your metal gain."},style:{color:l}})),G(()=>({resource:H(a),cost:25e3,display:{title:"Oil Integration",description:"Reduce Oil Well's coal consumption multipler from 5 to 4"},style:{color:l}})),G(()=>({resource:H(a),cost:5e4,display:{title:"Be One with the Oil",description:I(()=>o(B,null,[d("Divide metal ingot prices of oil buildings by "),o("sup",null,[d("6")]),o(Ys,null,{default:()=>[d("total oil + 1")]})]))},style:{color:l}}))],ml=X(()=>[ae(()=>({addend:()=>n.negate(m.value),description:"Heavy Drill",enabled:()=>n.gt(p.value,0)})),E(()=>({multiplier:pe,description:"Oil Pump",enabled:()=>n.gt(z.value,0)})),ae(()=>({addend:un,description:"Oil to Coal Substitution",enabled:()=>n.gt(un.value,0)}))]),Ol=k(()=>ml.apply(0)),bl=X(()=>[ae(()=>({addend:y,description:"Heavy Drill",enabled:()=>n.gt(p.value,0)})),E(()=>({multiplier:de,description:"Heavy Extractor",enabled:()=>n.gt(Z.value,0)})),E(()=>({multiplier:pt[0],description:"Coal Drill Synergy",enabled:Rt[0].bought})),E(()=>({multiplier:pt[1],description:"Metal Drill Synergy",enabled:Rt[1].bought})),E(()=>({multiplier:pt[2],description:"Coal Drill Upgrade",enabled:Rt[2].bought})),E(()=>({multiplier:pt[3],description:"Metal Drill Upgrade",enabled:Rt[3].bought})),E(()=>({multiplier:()=>Ut.value,description:"Effectiveness",enabled:()=>n.lt(Ut.value,1)}))]),Rl=k(()=>bl.apply(0)),Ul=X(()=>[ae(()=>({addend:pt[4],description:"Drill Oil",enabled:Rt[4].bought}))]),Lt=k(()=>Ul.apply(0)),ql=X(()=>[ae(()=>({addend:W,description:"Oil Pump",enabled:()=>n.gt(z.value,0)})),E(()=>({multiplier:2,description:"Oil the Oil Pump",enabled:At[0].bought})),E(()=>({multiplier:2,description:"3000m Well Depth",enabled:ze[7].earned})),E(()=>({multiplier:()=>Ut.value,description:"Effectiveness",enabled:()=>n.lt(Ut.value,1)}))]),wl=k(()=>ql.apply(0)),Hl=X(()=>[ae(()=>({addend:()=>n.negate(Pe.value),description:"Oil Burner",enabled:()=>n.gt(ie.value,0)})),ae(()=>({addend:()=>n.negate(se.value),description:"Oil Smelter",enabled:()=>n.gt(fe.value,0)}))]),P=k(()=>Hl.apply(0)),Pn=X(()=>[ae(()=>({addend:nt,description:"Oil Burner",enabled:()=>n.gt(ie.value,0)})),E(()=>({multiplier:()=>Jt.value,description:"Effectiveness",enabled:()=>n.lt(Jt.value,1)}))]),un=k(()=>Pn.apply(0)),[Ua,qa]=dl(()=>[{title:"Coal Consumption",modifier:ml,unit:"/s",base:0},{title:"Drill Power",modifier:bl,base:0},{title:"Upgrade Bonus",modifier:Ul,base:0,visible(){return n.gt(Lt.value,0)}},{title:"Oil Speed",modifier:ql,unit:"/s",base:0,visible(){return n.gt(wl.value,0)}},{title:"Oil Consumption",modifier:Hl,unit:"/s",base:0,visible(){return n.lt(P.value,0)}},{title:"Oil to Coal Substitution",modifier:Pn,unit:"/s",base:0,visible(){return n.gt(un.value,0)}}]),cn=R(!1),Ha=I(()=>o(gt,{modelValue:cn.value,"onUpdate:modelValue":Fe=>cn.value=Fe},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:Ua})),Ut=R(n.dOne),Jt=R(n.dOne);He.on("update",Fe=>{if(n.lt(J.day.value,fn))return;const mt=n.negate(Ol.value);n.gt(mt,0)?(Ut.value=n.min(n.div(O.coal.value,mt),1),O.coal.value=n.sub(O.coal.value,n.mul(mt,Ut.value).mul(Fe))):Ut.value=n.dOne,s.value=n.add(s.value,n.mul(Rl.value,Fe)),a.value=n.add(a.value,n.mul(wl.value,Fe)),c();const dn=n.negate(P.value);n.gt(dn,0)?(Jt.value=n.min(n.div(a.value,dn),1),a.value=n.sub(a.value,n.mul(dn,Jt.value).mul(Fe))):Jt.value=n.dOne});const{total:il,trackerDisplay:Va}=pl({resource:a,goal:25e4,name:e,day:fn,color:t,modal:{show:cn,display:Ha}});return{name:e,day:fn,color:t,oil:a,totalOil:il,depth:i,drillProgress:s,activeHeavy:p,buildHeavy:g,activeHeavy2:N,buildHeavy2:A,activeExtractor:Z,buildExtractor:$e,activePump:z,buildPump:ve,activeBurner:ie,buildBurner:re,activeSmelter:fe,buildSmelter:yt,extractorCoal:L,extractorOre:Ze,coalEffectiveness:Ut,oilEffectiveness:Jt,depthMilestones:ze,collapsedDepthMilestones:Ot,row1Upgrades:Rt,row2Upgrades:At,minWidth:700,generalTabCollapsed:qa,display:I(()=>o(B,null,[ue(Va),o(we,null,null),n.lt(Ut.value,1)?"Coal efficiency: "+ne(n.mul(Ut.value,100))+"%":null,n.lt(Jt.value,1)?"Oil efficiency: "+ne(n.mul(Jt.value,100))+"%":null,o(St,{resource:a,color:t,sticky:!0,productionDisplay:I(()=>o(B,null,[n.lt(i.value,1e3)?"Reach 1000m to start gaining oil":Wl(n.add(wl.value,P.value))]))},null),o(Il,null,{default:()=>[ze[6].earned.value?o(kt,null,{default:()=>[ue(ve),o("div",null,[te(n.floor(z.value)),d("/"),te(n.floor(ve.amount.value))]),_e(Me,et,Re,Be)]}):null,Vt[0].earned.value?o(kt,null,{default:()=>[ue(re),o("div",null,[te(n.floor(ie.value)),d("/"),te(n.floor(re.amount.value))]),_e(vt,at,j,dt)]}):null,Vt[2].earned.value?o(kt,null,{default:()=>[ue(yt),o("div",null,[te(n.floor(fe.value)),d("/"),te(n.floor(yt.amount.value))]),_e($t,$,Mt,wt)]}):null]}),o("br",null,null),o("div",null,[o("span",null,[d("The well is ")]),o("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[te(i.value)]),d("m deep"),o("br",null,null),d("Next at "),ne(n.sub(r.value,s.value)),d(" drill power seconds")]),o("div",null,[o("span",null,[d("Your drill power is ")]),o("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[ne(Rl.value)])]),o(we,null,null),o(Il,null,{default:()=>[o(kt,null,{default:()=>[ue(g),o("div",null,[te(n.floor(p.value)),d("/"),te(n.floor(g.amount.value))]),_e(w,h,C,S)]}),ze[3].earned.value?o(kt,null,{default:()=>[ue(A),o("div",null,[te(n.floor(N.value)),d("/"),te(n.floor(A.amount.value))]),_e(M,D,Ne,Te)]}):null,ze[5].earned.value?o(kt,null,{default:()=>[ue($e),o("div",null,[te(n.floor(Z.value)),d("/"),te(n.floor($e.amount.value))]),_e(Oe,Ie,je,ut)]}):null]}),o(we,null,null),ze[1].earned.value?_e(...Rt):null,Vt[1].earned.value?_e(...At):null,o(we,null,null),rn(),n.gte(il.value,50)?$l():""]))}}),er="coal",Qn=3,O=Tt(er,function(){const e="Coal",t="#151716",l="#B2BeB5",a="var(--foreground)",i=st(0,"coal"),s=st(0,"ash"),r=be(0),c=k(()=>n.times(r.value,1e3)),p=k(()=>n.times(r.value,.1)),m=k(()=>n.times(r.value,50)),y=De(()=>({resource:ge.logs,cost(){let P=n.times(D.amount.value,u(D.cost)).plus(this.amount.value);return n.gte(P,100)&&(P=n.pow(P,2).div(100)),n.gte(P,1e4)&&(P=n.pow(P,2).div(1e4)),P=n.pow(.95,xe.books.smallFireBook.amount.value).times(P),P.pow(1.5).times(1e4)},display:I(()=>o(B,null,[o("h3",null,[d("Small Fire")]),o("br",null,null),d("Burn 1000 logs for 0.1 coal and 50 ash"),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("-"),ke(c.value),d(" logs/sec"),o("br",null,null),d("+"),ke(p.value),d(" coal/sec"),o("br",null,null),d("+"),ke(m.value),d(" ash/sec"),o("br",null,null),o("br",null,null),d("Cost: "),he(u(y.cost)),d(" "),y.resource.displayName])),onPurchase(){r.value=n.add(r.value,1)},style:{color:a,width:"160px"}})),g=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(r.value,0)},onClick(){r.value=0}})),w=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(r.value,0)},onClick(){r.value=n.sub(r.value,1)}})),h=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(r.value,y.amount.value)},onClick(){r.value=n.add(r.value,1)}})),C=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(r.value,y.amount.value)},onClick(){r.value=y.amount.value}})),S=st(y.amount,"small fires"),N=be(0),oe=k(()=>n.times(N.value,1e4)),A=k(()=>n.times(N.value,10)),M=k(()=>n.times(N.value,1e3)),D=De(()=>({resource:S,cost(){return n.pow(.95,xe.books.bonfireBook.amount.value).times(10)},display:I(()=>o(B,null,[o("h3",null,[d("Bonfire")]),o("br",null,null),d("Burn 10,000 logs for 10 coal and 1000 ash"),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("-"),ke(oe.value),d(" logs/sec"),o("br",null,null),d("+"),ke(A.value),d(" coal/sec"),o("br",null,null),d("+"),ke(M.value),d(" ash/sec"),o("br",null,null),o("br",null,null),d("Cost: "),he(u(D.cost)),d(" "),D.resource.displayName])),onPurchase(P){r.value=n.sub(r.value,P).max(0),N.value=n.add(N.value,1)},style:{color:a,width:"160px"},visibility:()=>F(re.bought.value)})),Ne=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(N.value,0)},onClick(){N.value=0}})),Te=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(N.value,0)},onClick(){N.value=n.sub(N.value,1)}})),Z=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(N.value,D.amount.value)},onClick(){N.value=n.add(N.value,1)}})),de=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(N.value,D.amount.value)},onClick(){N.value=D.amount.value}})),L=be(0),Ze=k(()=>n.times(L.value,1e6)),$e=k(()=>n.times(L.value,1e4)),Oe=k(()=>n.times(L.value,1e4)),Ie=De(()=>({resource:ge.logs,cost(){let P=this.amount.value;return n.gte(P,100)&&(P=n.pow(P,2).div(100)),n.gte(P,1e4)&&(P=n.pow(P,2).div(1e4)),P=n.pow(.95,xe.books.kilnBook.amount.value).times(P),n.pow(1.1,P).times(1e7)},display:I(()=>o(B,null,[o("h3",null,[d("Charcoal Kiln")]),o("br",null,null),d("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("-"),ke(Ze.value),d(" logs/sec"),o("br",null,null),d("+"),ke($e.value),d(" coal/sec"),o("br",null,null),d("+"),ke(Oe.value),d(" ash/sec"),o("br",null,null),o("br",null,null),d("Cost: "),he(u(Ie.cost)),d(" "),Ie.resource.displayName])),onPurchase(){L.value=n.add(L.value,1)},style:{color:a,width:"160px"},visibility:()=>F(fe.bought.value)})),je=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(L.value,0)},onClick(){L.value=0}})),ut=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(L.value,0)},onClick(){L.value=n.sub(L.value,1)}})),z=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(L.value,Ie.amount.value)},onClick(){L.value=n.add(L.value,1)}})),pe=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(L.value,Ie.amount.value)},onClick(){L.value=Ie.amount.value}})),W=be(0),ve=k(()=>n.times(n.pow(W.value,We.row2Upgrades[1].bought.value?2:1),5e7).times(ht.efficientDrill.bought.value?2:1)),Me=De(()=>({resource:ht.metal,cost(){let P=this.amount.value;return n.gte(P,100)&&(P=n.pow(P,2).div(100)),n.gte(P,1e4)&&(P=n.pow(P,2).div(1e4)),n.pow(1.15,P).times(10)},display:I(()=>o(B,null,[o("h3",null,[d("Mining Drill")]),o("br",null,null),d("Dig through the ground to find 50,000,000 coal"),o("br",null,null),o("br",null,null),d("Currently:"),o("br",null,null),d("+"),ke(ve.value),d(" coal/sec"),o("br",null,null),o("br",null,null),d("Cost: "),he(u(Me.cost)),d(" "),Me.resource.displayName])),onPurchase(){W.value=n.add(W.value,1)},style:{color:a,width:"160px"},visibility:()=>F(ht.coalDrill.bought.value)})),et=V(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(W.value,0)},onClick(){W.value=0}})),Re=V(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.gt(W.value,0)},onClick(){W.value=n.sub(W.value,1)}})),Be=V(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(W.value,Me.amount.value)},onClick(){W.value=n.add(W.value,1)}})),ie=V(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:a},canClick(){return n.lt(W.value,Me.amount.value)},onClick(){W.value=Me.amount.value}})),Pe=G(()=>({resource:H(i),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:a}})),nt=G(()=>({resource:H(i),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:a}})),Ue=G(()=>({resource:H(s),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:a}})),re=G(()=>({resource:S,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){S.value=n.add(S.value,this.cost)},style:{color:a}})),vt=[Pe,nt,Ue,re],at=G(()=>({resource:H(i),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:a},visibility:()=>F(re.bought.value)})),j=G(()=>({resource:H(i),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:a},visibility:()=>F(re.bought.value)})),dt=G(()=>({canAfford(){return n.gte(ge.logs.value,1e5)&&n.gte(s.value,1e5)},onPurchase(){ge.logs.value=n.sub(ge.logs.value,1e5),s.value=n.sub(s.value,1e5)},display:I(()=>o(B,null,[o("h3",null,[d("Mulched Soil")]),o("br",null,null),d("Double the bonus from Fertilized Soil"),o("br",null,null),o("br",null,null),d("Cost: "),he(1e5),d(" "),ge.logs.displayName,o("br",null,null),he(1e5),d(" "),s.displayName])),style:{color:a},visibility:()=>F(re.bought.value)})),fe=G(()=>({resource:ge.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:a},visibility:()=>F(re.bought.value)})),se=[at,j,dt,fe],Ht=G(()=>({resource:i,cost:1e19,display:{title:"Efficient Crucibles",description:"Double auto smelting speed and triple metal gain from auto smelting"},style:{color:a},visibility:()=>F(We.depthMilestones[4].earned.value)})),yt=[Ht],$t=De(()=>({resource:H(i),cost(){let P=this.amount.value;return n.gte(P,50)&&(P=n.pow(P,2).div(50)),n.gte(P,200)&&(P=n.pow(P,2).div(200)),n.gte(P,2e6)&&(P=n.pow(P,2).div(2e6)),P=n.pow(.95,xe.books.heatedCuttersBook.amount.value).times(P),n.add(P,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:I(()=>o(B,null,[d("Cutters cut down trees "),ke(Ot.value),d("x faster")]))},style:{color:a},visibility:()=>F(Pe.bought.value)})),$=De(()=>({resource:H(i),cost(){let P=this.amount.value;return n.gte(P,50)&&(P=n.pow(P,2).div(50)),n.gte(P,200)&&(P=n.pow(P,2).div(200)),n.gte(P,2e6)&&(P=n.pow(P,2).div(2e6)),P=n.pow(.95,xe.books.heatedPlantersBook.amount.value).times(P),n.add(P,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:I(()=>o(B,null,[d("Planters plant trees "),ke(Vt.value),d("x faster")]))},style:{color:a},visibility:()=>F(nt.bought.value)})),Mt=De(()=>({resource:H(s),cost(){let P=this.amount.value;return n.gte(P,50)&&(P=n.pow(P,2).div(50)),n.gte(P,200)&&(P=n.pow(P,2).div(200)),n.gte(P,2e6)&&(P=n.pow(P,2).div(2e6)),P=n.pow(.95,xe.books.fertilizerBook.amount.value).times(P),n.add(P,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:I(()=>o(B,null,[d("Trees give "),ke($l.value),d("x more logs")]))},style:{color:a},visibility:()=>F(Ue.bought.value)})),wt=[$t,$,Mt],ze=X(()=>[ae(()=>({addend(){return n.times($t.amount.value,.25)},description:"Heated Cutters",enabled(){return n.gt($t.amount.value,0)}})),E(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:at.bought}))]),Ot=k(()=>ze.apply(1)),rn=X(()=>[ae(()=>({addend(){return n.times($.amount.value,.25)},description:"Heated Planters",enabled(){return n.gt($.amount.value,0)}})),E(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:j.bought}))]),Vt=k(()=>rn.apply(1)),Bn=X(()=>[ae(()=>({addend(){return n.times(Mt.amount.value,.25)},description:"Fertilized Soil",enabled(){return n.gt(Mt.amount.value,0)}})),E(()=>({multiplier:2,description:"Mulched Soil",enabled:dt.bought}))]),$l=k(()=>Bn.apply(1)),Rt=X(()=>[ae(()=>({addend(){return p.value},description:"Small Fires",enabled(){return n.gt(r.value,0)}})),ae(()=>({addend(){return A.value},description:"Bonfires",enabled(){return n.gt(N.value,0)}})),ae(()=>({addend(){return $e.value},description:"Charcoal Kilns",enabled(){return n.gt(L.value,0)}})),ae(()=>({addend(){return ve.value},description:"Mining Drills",enabled(){return n.gt(W.value,0)}})),E(()=>({multiplier:2,description:"Carry coal in boxes",enabled:Ct.upgrades.coalUpgrade.bought})),E(()=>({multiplier:()=>n.div(Ct.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:Ct.upgrades.coalUpgrade.bought})),E(()=>({multiplier:()=>n.div(y.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Je.elves.smallFireElf.bought})),E(()=>({multiplier:()=>n.div(D.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Je.elves.bonfireElf.bought})),E(()=>({multiplier:()=>n.div(Ie.amount.value,100).add(1),description:"Kiln Synergy",enabled:Je.elves.kilnElf.bought})),E(()=>({multiplier:2,description:"Mining overalls",enabled:qt.metalUpgrades.metalUpgrade2.bought})),E(()=>({multiplier:3,description:"Mining helmet",enabled:qt.metalUpgrades.metalUpgrade3.bought})),_a(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Je.milestones[2].earned,supportLowNumbers:!0})),E(()=>({multiplier:()=>n.mul(We.depth.value,.25).add(1),description:"5m Well Depth",enabled:We.depthMilestones[0].earned})),E(()=>({multiplier:We.extractorCoal,description:"Heavy Extractor",enabled:()=>n.gt(We.activeExtractor.value,0)}))]),pt=k(()=>Rt.apply(0)),At=X(()=>[ae(()=>({addend(){return m.value},description:"Small Fires",enabled(){return n.gt(r.value,0)}})),ae(()=>({addend(){return M.value},description:"Bonfires",enabled(){return n.gt(N.value,0)}})),ae(()=>({addend(){return Oe.value},description:"Charcoal Kilns",enabled(){return n.gt(L.value,0)}})),E(()=>({multiplier:2,description:"Carry ash in boxes",enabled:Ct.upgrades.ashUpgrade.bought})),E(()=>({multiplier:()=>n.div(Ct.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:Ct.upgrades.ashUpgrade.bought})),E(()=>({multiplier:()=>n.div(y.amount.value,1e3).add(1),description:"Small Fires Synergy",enabled:Je.elves.smallFireElf.bought})),E(()=>({multiplier:()=>n.div(D.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Je.elves.bonfireElf.bought})),E(()=>({multiplier:()=>n.div(Ie.amount.value,100).add(1),description:"Kiln Synergy",enabled:Je.elves.kilnElf.bought})),E(()=>({multiplier:4,description:"Mining boots",enabled:qt.metalUpgrades.metalUpgrade1.bought}))]),ml=k(()=>At.apply(0)),Ol=X(()=>[ae(()=>({addend(){return n.negate(c.value)},description:"Small Fires",enabled(){return n.gt(r.value,0)}})),ae(()=>({addend(){return n.negate(oe.value)},description:"Bonfires",enabled(){return n.gt(N.value,0)}})),ae(()=>({addend(){return n.negate(Ze.value)},description:"Charcoal Kilns",enabled(){return n.gt(L.value,0)}}))]),bl=k(()=>Ol.apply(0)),[Rl,Ul]=dl(()=>[{title:"Log Consumption",modifier:Ol,base:0,visible(){return n.gt(r.value,0)||n.gt(N.value,0)||n.gt(L.value,0)}},{title:"Coal Gain",modifier:Rt,base:0,visible(){return n.gt(r.value,0)||n.gt(N.value,0)||n.gt(L.value,0)}},{title:"Ash Gain",modifier:At,base:0,visible(){return n.gt(r.value,0)||n.gt(N.value,0)||n.gt(L.value,0)}}]),Lt=R(!1),ql=I(()=>o(gt,{modelValue:Lt.value,"onUpdate:modelValue":P=>Lt.value=P},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:Rl}));He.on("update",P=>{n.lt(J.day.value,Qn)||n.times(P,bl.value).negate().gt(ge.logs.value)||(ge.logs.value=n.times(P,bl.value).plus(ge.logs.value),i.value=n.times(P,pt.value).plus(i.value),s.value=n.times(P,ml.value).plus(s.value),r.value=n.max(r.value,0))});const{total:wl,trackerDisplay:Hl}=pl({resource:i,goal:1e7,name:e,day:Qn,color:t,modal:{show:Lt,display:ql}});return{name:e,color:t,coal:i,totalCoal:wl,computedCoalGain:pt,ash:s,activeFires:r,buildFire:y,activeBonfires:N,buildBonfire:D,activeKilns:L,buildKiln:Ie,activeDrills:W,buildDrill:Me,warmerCutters:Pe,warmerPlanters:nt,basicFertilizer:Ue,unlockBonfire:re,dedicatedCutters:at,dedicatedPlanters:j,betterFertilizer:dt,unlockKiln:fe,efficientSmelther:Ht,heatedCutters:$t,heatedPlanters:$,moreFertilizer:Mt,computedHeatedCutterEffect:Ot,computedHeatedPlanterEffect:Vt,computedFertilizerEffect:$l,generalTabCollapsed:Ul,minWidth:700,display:I(()=>o(B,null,[ue(Hl),o(we,null,null),o(St,{resource:i,color:t,style:"margin-bottom: 0",effectDisplay:n.gt(pt.value,0)?`+${ke(pt.value)}/s`:void 0},null),o(we,null,null),o(St,{resource:s,color:l,style:"margin-bottom: 0",effectDisplay:n.gt(ml.value,0)?`+${ke(ml.value)}/s`:void 0},null),o(we,null,null),o(Il,null,{default:()=>[o(kt,null,{default:()=>[ue(y),o("div",null,[he(n.floor(r.value)),d("/"),he(n.floor(y.amount.value))]),_e(g,w,h,C)]}),re.bought.value?o(B,null,[o(we,null,null),o(kt,null,{default:()=>[ue(D),o("div",null,[he(N.value),d("/"),he(D.amount.value)]),_e(Ne,Te,Z,de)]})]):void 0,fe.bought.value?o(B,null,[o(we,null,null),o(kt,null,{default:()=>[ue(Ie),o("div",null,[he(L.value),d("/"),he(Ie.amount.value)]),_e(je,ut,z,pe)]})]):void 0,ht.coalDrill.bought.value?o(B,null,[o(we,null,null),o(kt,null,{default:()=>[ue(Me),o("div",null,[he(W.value),d("/"),he(Me.amount.value)]),_e(et,Re,Be,ie)]})]):void 0]}),o(we,null,null),_e(...vt),_e(...se),_e(...yt),_e(...wt)]))}}),tr="metal",jn=7,ht=Tt(tr,function(){const e="Metal",t="#888B8D",l=st(0,"metal ingots",void 0,!0),a=qn(l),i=st(0,"ore"),s=qn(i),r=X(()=>[E(()=>({multiplier:5,description:"Crucible",enabled:Ie.bought})),E(()=>({multiplier:1.5,description:"Industrial Crucible",enabled:()=>n.gte(W.amount.value,1)})),E(()=>({multiplier:2,description:"Industrial Furnace",enabled:ut.bought})),E(()=>({multiplier:()=>n.add(et.value,1),description:"Hotter Forges",enabled:()=>n.gte(Me.amount.value,1)}))]),c=k(()=>r.apply(.1)),p=X(()=>[ae(()=>({addend:()=>n.times(W.amount.value,10),description:"Industrial Crucibles",enabled:()=>n.gte(W.amount.value,1)})),E(()=>({multiplier:2,description:"Efficient Crucibles",enabled:O.efficientSmelther.bought})),E(()=>({multiplier:()=>n.mul(We.activeSmelter.value,We.oilEffectiveness.value).add(1),description:"Oil Smelter",enabled:()=>n.gt(We.activeSmelter.value,0)}))]),m=k(()=>p.apply(0)),y=X(()=>[E(()=>({multiplier:3,description:"Efficient Crucibles",enabled:O.efficientSmelther.bought})),E(()=>({multiplier:()=>n.add(We.activeBurner.value,1).mul(We.oilEffectiveness.value),description:"Blaster Burner",enabled:We.row2Upgrades[2].bought}))]),g=k(()=>y.apply(1)),w=1e10,h=k(()=>n.min(i.value,n.div(O.coal.value,w)).floor().max(0)),C=V(()=>({display:I(()=>{const re=n.gte(h.value,1)?h.value:n.add(h.value,1);return o(B,null,[o("span",{style:"font-size: large"},[d("Smelt "),ne(n.times(h.value,c.value))," ",l.displayName]),o("br",null,null),o("span",{style:"font-size: large"},[d("Cost: "),te(re),d(" "),i.displayName,d(";")," ",te(n.times(re,w)),d(" "),O.coal.displayName])])}),canClick:()=>n.gte(h.value,1),onClick(){!u(this.canClick)||S(h.value)},style:{width:"600px",minHeight:"unset"}}));function S(re,vt=1){const[at,j,dt]=[n.times(re,c.value).times(vt),re,n.times(re,w)];l.value=n.add(l.value,at),i.value=n.sub(i.value,j),O.coal.value=n.sub(O.coal.value,dt)}const N=X(()=>[ae(()=>({addend:()=>pe.amount.value,description:"Mining Drills",enabled:()=>n.gte(pe.amount.value,1)})),E(()=>({multiplier:()=>n.mul(We.depth.value,.05).add(1),description:"25m Well Depth",enabled:We.depthMilestones[2].earned})),E(()=>({multiplier:We.extractorOre,description:"Heavy Extractor",enabled:()=>n.gt(We.activeExtractor.value,0)}))]),oe=k(()=>N.apply(1)),A=X(()=>[E(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:$e.bought})),E(()=>({multiplier:2,description:"Double Pickaxe",enabled:Oe.bought})),E(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>n.gte(pe.amount.value,1)})),E(()=>({multiplier:2,description:"Efficient Drills",enabled:z.bought})),E(()=>({multiplier:2,description:"Oil the Mining Drills",enabled:We.row2Upgrades[1].bought}))]),M=k(()=>A.apply(n.recip(Ne))),D=be(0),Ne=10,Te=Qt(()=>({width:400,height:25,direction:ye.Right,fillStyle:{backgroundColor:t},progress:()=>D.value})),Z=X(()=>[ae(()=>({addend:oe})),E(()=>({multiplier:M}))]),de=k(()=>Z.apply(0)),L=X(()=>[ae(()=>({addend:de})),ae(()=>({addend:()=>n.negate(m.value),enabled:ve}))]),Ze=k(()=>L.apply(0)),$e=G(()=>({resource:H(l),cost:.1,display:{title:"A Simple Pickaxe",description:"Make a simple pickaxe to help mine faster.<br/><br/>Halve the time to mine more ore"}})),Oe=G(()=>({resource:H(l),cost:.1,display:{title:"Double Pickaxe",description:"This is too slow. What if you swung two pickaxes at once?<br/><br/>Halve the time to mine ore, again"},visibility:()=>F(Oe.bought.value)})),Ie=G(()=>({resource:H(l),cost:1,display:{title:"Crucible",description:"Smelting this all by hand is rather painful, and a lot of the metal is left in the slag. A small crucible should help a lot!<br/><br/>Increase the metal extracted per ore by 5x"},visibility:()=>F(Ie.bought.value||n.div(s.value,c.value).plus(a.value).gte(1))})),je=G(()=>({resource:H(l),cost:0,display:{title:"Coal Drilling",description:"These mining drills are pretty powerful, mining more ore than you can actually smelt. Could be worth making some to mine coal instead"},visibility:()=>F(n.gte(pe.amount.value,1)&&(je.bought.value||n.lt(O.computedCoalGain.value,n.times(oe.value,M.value).times(w)))),onPurchase(){J.days[2].recentlyUpdated.value=!0}})),ut=G(()=>({canAfford(){return n.gte(l.value,50)&&n.gte(O.coal.value,1e11)},onPurchase(){l.value=n.sub(l.value,50),O.coal.value=n.sub(O.coal.value,1e11)},display:{title:"Industrial Furnace",description:`Moving smelting out of the open air and into a dedicated furnace should make efficiency even better. Double metal gained per ore
<br/>
<br/>
Cost: 50 ${l.displayName}<br/>${ne(1e11)} ${O.coal.displayName}`}})),z=G(()=>({resource:H(l),cost:1e5,display:{title:"Efficient Drills",description:"Use metal and a bunch of R&D to make drilling stuff faster. Double coal and ore mining speed."},visibilty:()=>F(We.depthMilestones[4].earned.value)})),pe=De(()=>({resource:H(l),cost(){return n.pow(1.15,this.amount.value).times(10)},display:{title:"Mining Drill",description:"An automated machine to help you mine more ore, faster",effectDisplay:I(()=>o(B,null,[d("Mine 2.5x faster. Increase ore mining amount by")," ",te(pe.amount.value),d(" ore per operation")]))},visibility:()=>F(n.gte(pe.amount.value,1)||n.div(s.value,c.value).plus(a.value).gte(10)),style:{width:"200px"}})),W=De(()=>({resource:H(l),cost(){return n.pow(1.15,n.times(this.amount.value,10)).times(10)},display:{title:"Industrial Crucible",description:"A giant automated crucible furnace, letting you smelt ore faster",effectDisplay:I(()=>o(B,null,[d("Automatically smelts")," ",te(n.times(W.amount.value,10)),d(" ore per second")]))},visibility:()=>F(n.gte(W.amount.value,1)||n.gte(pe.amount.value,4)||n.gte(s.value,50)),style:{width:"200px"}})),ve=be(!0),Me=De(()=>({resource:O.coal,cost(){return n.pow(10,this.amount.value).times(1e12)},display:{title:"Hotter Forges",description:"More coal makes the fires burn hotter, getting just a little more metal out of each bit of ore",effectDisplay:I(()=>o(B,null,[d("Gain "),te(n.times(et.value,100)),d("% more metal per ore")]))},visibility:()=>F(n.gte(Me.amount.value,1)||ut.bought.value),style:{width:"200px"}})),et=k(()=>n.times(Me.amount.value,.25));He.on("update",re=>{D.value=n.times(re,M.value).plus(D.value);const vt=D.value.trunc();D.value=D.value.minus(vt),i.value=n.add(i.value,n.times(vt,oe.value)),ve.value&&S(n.min(h.value,n.times(m.value,re)),g.value)});const[Re,Be]=dl(()=>[{title:"Auto Smelt Speed",modifier:p,base:0,unit:"/s",visible(){return n.gt(W.amount.value,0)}},{title:"Auto Smelt Multiplier",modifier:y,base:1,visible(){return n.gt(g.value,1)}},{title:"Metal per Ore",modifier:r,base:.1},{title:"Ore per Mining Operation",modifier:N,base:1},{title:"Mining Speed",modifier:A,base:.1,unit:"/s"}]),ie=R(!1),Pe=I(()=>o(gt,{modelValue:ie.value,"onUpdate:modelValue":re=>ie.value=re},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:Re})),{total:nt,trackerDisplay:Ue}=pl({resource:l,goal:25e3,name:e,day:jn,color:t,modal:{show:ie,display:Pe}});return{name:e,day:jn,color:t,ore:i,bestOre:s,oreProgress:D,metal:l,bestMetal:a,totalMetal:nt,simplePickaxe:$e,doublePickaxe:Oe,crucible:Ie,coalDrill:je,industrialFurnace:ut,efficientDrill:z,oreDrill:pe,industrialCrucible:W,autoSmeltEnabled:ve,hotterForge:Me,generalTabCollapsed:Be,minWidth:700,display:I(()=>o(B,null,[ue(Ue),o(we,null,null),o(St,{resource:l,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:I(()=>o(B,null,[ve.value&&n.gte(W.amount.value,1)?`+${oa([[m.value,"smelting speed"],[de.value,"ore gain"],[n.div(O.computedCoalGain.value,w),"coal gain"]],"/s",n.mul(c.value,g.value))}`:void 0]))},null),o(we,null,null),ue(C),n.gte(W.amount.value,1)?o("div",{style:{width:"150px"}},[o(Gt,{title:"Auto Smelt",modelValue:ve.value,"onUpdate:modelValue":re=>ve.value=re},null)]):void 0,o(we,null,null),o(St,{resource:i,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:I(()=>o(B,null,[sa(Ze.value)]))},null),o(we,null,null),o("div",null,[d("Currently mining "),ne(oe.value),d(" ore every")," ",ne(n.recip(M.value)),d(" seconds")]),ue(Te),o(we,null,null),_e($e,Oe,Ie,je,ut,z),_e(pe,W,Me)]))}}),lr="cloth",zn=8,qt=Tt(lr,function(){const e="Cloth",t="white",l=st(0,"cloth"),a=st(0,"wool"),i=st(10,"sheep"),s=be(0),r=Qt(()=>({direction:ye.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>n.div(s.value,ve.value)})),c=V(()=>({display:{title:"Breed sheep",description:I(()=>o(B,null,[d("Breed "),te(n.floor(pe.value)),d(" sheep"),o("br",null,null),ue(r)]))},style:{minHeight:"80px"},canClick:()=>n.gte(s.value,ve.value),onClick(){if(n.lt(s.value,ve.value))return;const se=n.floor(pe.value);i.value=n.add(i.value,se),s.value=0}})),p=be(0),m=Qt(()=>({direction:ye.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>n.div(p.value,Be.value)})),y=V(()=>({display:{title:"Shear sheep",description:I(()=>o(B,null,[d("Shear up to "),te(n.floor(et.value)),d(" sheep"),o("br",null,null),ue(m)]))},style:{minHeight:"80px"},canClick:()=>n.gte(p.value,Be.value),onClick(){if(n.lt(p.value,Be.value))return;const se=n.min(i.value,et.value).floor();a.value=n.add(a.value,se),p.value=0}})),g=be(0),w=Qt(()=>({direction:ye.Right,width:100,height:10,style:"margin-top: 8px",borderStyle:"border-color: black",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s; background: black",progress:()=>n.div(g.value,Ue.value)})),h=V(()=>({display:{title:"Spinning wool",description:I(()=>o(B,null,[d("Spin "),te(n.floor(Pe.value)),d(" wool"),o("br",null,null),ue(w)]))},style:{minHeight:"80px"},canClick:()=>n.gte(g.value,Ue.value),onClick(){if(n.lt(g.value,Ue.value))return;const se=n.min(a.value,Pe.value).floor();l.value=n.add(l.value,se),a.value=n.sub(a.value,se),g.value=0}})),C=vl(()=>({key:"b",description:'Press the "Breed Sheep" button',onPress:()=>{c.canClick.value&&c.onClick()}})),S=vl(()=>({key:"h",description:'Press the "Shear Sheep" button',onPress:()=>{y.canClick.value&&y.onClick()}})),N=vl(()=>({key:"s",description:'Press the "Spin Wool" button',onPress:()=>{h.canClick.value&&h.onClick()}})),oe=De(()=>({resource:ge.logs,cost(){let se=this.amount.value;return n.gte(se,100)&&(se=n.pow(se,2).div(100)),n.pow(1.5,se).times(1e14)},display:{title:"Build more pens",description:"Breed +1 sheep at once"}})),A=De(()=>({resource:ht.metal,cost(){let se=this.amount.value;return n.gte(se,100)&&(se=n.pow(se,2).div(100)),n.pow(1.4,se).times(1e4)},display:{title:"Make stronger shears",description:"Shear +1 sheep at once"}})),M=De(()=>({resource:xe.paper,cost(){let se=this.amount.value;return n.gte(se,100)&&(se=n.pow(se,2).div(100)),n.pow(1.3,se).times(1e6)},display:{title:"Learn how to spin",description:"Spin +1 wool at once"}})),D=G(()=>({resource:H(l),cost:100,display:{title:"Lumberjack Boots",description:"Quadruple log gain"}})),Ne=G(()=>({resource:H(a),cost:150,visibility:()=>F(D.bought.value),display:{title:"Lumberjack Jeans",description:"Quadruple trees cut"}})),Z={treesUpgrade3:G(()=>({resource:H(i),cost:200,visibility:()=>F(Ne.bought.value),display:{title:"Lumberjack Plaid",description:"Quadruple trees planted"}})),treesUpgrade2:Ne,treesUpgrade1:D},de=G(()=>({resource:H(l),cost:150,display:{title:"Mining boots",description:"Quadruple ash gain"}})),L=G(()=>({resource:H(a),cost:225,visibility:()=>F(de.bought.value),display:{title:"Mining overalls",description:"Double coal gain"}})),$e={metalUpgrade3:G(()=>({resource:H(i),cost:300,visibility:()=>F(L.bought.value),display:{title:"Mining helmet",description:"Triple coal gain"}})),metalUpgrade2:L,metalUpgrade1:de},Oe=G(()=>({resource:H(l),cost:200,display:{title:"Scholar's shoes",description:"Double paper gain"}})),Ie=G(()=>({resource:H(a),cost:200,visibility:()=>F(Oe.bought.value),display:{title:"Scholar's slacks",description:"Double paper gain"}})),ut={paperUpgrade3:G(()=>({resource:H(i),cost:400,visibility:()=>F(Ie.bought.value),display:{title:"Scholar's jacket",description:"Double paper gain"}})),paperUpgrade2:Ie,paperUpgrade1:Oe},z=X(()=>[ae(()=>({addend:oe.amount,description:"Build more pens"}))]),pe=k(()=>z.apply(1)),W=X(()=>[]),ve=k(()=>W.apply(1)),Me=X(()=>[ae(()=>({addend:A.amount,description:"Make stronger shears"}))]),et=k(()=>Me.apply(1)),Re=X(()=>[]),Be=k(()=>Re.apply(1)),ie=X(()=>[ae(()=>({addend:M.amount,description:"Learn how to spin"}))]),Pe=k(()=>ie.apply(1)),nt=X(()=>[]),Ue=k(()=>nt.apply(1)),[re,vt]=dl(()=>[{title:"Sheep Gain",modifier:z,base:1},{title:"Sheep Breeding Cooldown",modifier:W,base:1,visible:!1,unit:"s"},{title:"Shearing Amount",modifier:Me,base:1},{title:"Shearing Cooldown",modifier:Re,base:1,visible:!1,unit:"s"},{title:"Spinning Amount",modifier:ie,base:1},{title:"Spinning Cooldown",modifier:nt,base:1,visible:!1,unit:"s"}]),at=R(!1),j=I(()=>o(gt,{modelValue:at.value,"onUpdate:modelValue":se=>at.value=se},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:re}));He.on("update",se=>{n.lt(J.day.value,zn)||(n.gte(s.value,ve.value)?s.value=ve.value:(s.value=n.add(s.value,se),c.isHolding.value&&c.onClick()),n.gte(p.value,Be.value)?p.value=Be.value:(p.value=n.add(p.value,se),y.isHolding.value&&y.onClick()),n.gte(g.value,Ue.value)?g.value=Ue.value:(g.value=n.add(g.value,se),h.isHolding.value&&h.onClick()))});const{total:dt,trackerDisplay:fe}=pl({resource:l,goal:1e3,name:e,day:zn,color:t,textColor:"var(--feature-foreground)",modal:{show:at,display:j}});return{name:e,color:t,cloth:l,totalCloth:dt,wool:a,sheep:i,buildPens:oe,betterShears:A,fasterSpinning:M,treesUpgrades:Z,metalUpgrades:$e,paperUpgrades:ut,generalTabCollapsed:vt,breedingProgress:s,shearingProgress:p,spinningProgress:g,breedSheepHK:C,shearSheepHK:S,spinWoolHK:N,minWidth:700,display:I(()=>o(B,null,[ue(fe),o(we,null,null),o(St,{resource:l,style:"margin-bottom: 0"},null),o(St,{resource:a,style:"margin-bottom: 0"},null),o(St,{resource:i,style:"margin-bottom: 0"},null),_e(c,y,h),_e(oe,A,M),o(we,null,null),o(Il,null,{default:()=>[Nl(...Object.values(Z)),Nl(...Object.values($e)),Nl(...Object.values(ut))]})]))}}),nr="trees",Wn=1,Kn=.1,ge=Tt(nr,function(){const e="Trees",t="#4BDC13",l="green",a=st(0,"logs"),i=st(0,"saplings"),s=R(0),r=X(()=>[ae(()=>({addend:()=>n.times(Z.amount.value,10),description:"Expand Forest",enabled:M.bought})),ae(()=>({addend:()=>n.div(ft.foundationProgress.value,2),description:"75% Foundation Completed",enabled:ft.milestones.morePlantsMilestone1.earned})),E(()=>({multiplier:2,description:"5 Elves Trained",enabled:Je.milestones[4].earned})),E(()=>({multiplier:2,description:"8 Elves Trained",enabled:Je.milestones[7].earned})),E(()=>({multiplier:4,description:"Lumberjack Boots",enabled:qt.treesUpgrades.treesUpgrade1.bought}))]),c=st(k(()=>n.sub(r.apply(10),i.value)),"trees"),p=k(()=>r.apply(10)),m=G(()=>({resource:H(a),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),y=G(()=>({resource:H(a),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),g=G(()=>({resource:H(a),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),w=G(()=>({resource:H(a),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),h=G(()=>({resource:H(a),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),C=[m,y,g,w,h],S=G(()=>({resource:H(a),cost:50,visibility:()=>F(h.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),N=G(()=>({resource:H(a),cost:50,visibility:()=>F(h.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),oe=G(()=>({resource:H(a),cost:150,visibility:()=>F(h.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),A=G(()=>({resource:H(a),cost:150,visibility:()=>F(h.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),M=G(()=>({resource:H(a),cost:300,visibility:()=>F(h.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),D=[S,N,oe,A,M],Ne=De(()=>({resource:H(a),cost(){let $=this.amount.value;return n.gte($,50)&&($=n.pow($,2).div(50)),n.gte($,200)&&($=n.pow($,2).div(200)),n.gte($,2e6)&&($=n.pow($,2).div(2e6)),$=n.pow(.95,xe.books.cuttersBook.amount.value).times($),n.times(100,$).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>F(M.bought.value)})),Te=De(()=>({resource:H(a),cost(){let $=this.amount.value;return n.gte($,50)&&($=n.pow($,2).div(50)),n.gte($,200)&&($=n.pow($,2).div(200)),n.gte($,2e6)&&($=n.pow($,2).div(2e6)),$=n.pow(.95,xe.books.plantersBook.amount.value).times($),n.times(100,$).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>F(M.bought.value)})),Z=De(()=>({resource:H(a),cost(){let $=this.amount.value;return n.gte($,100)&&($=n.pow($,2).div(100)),n.gte($,1e5)&&($=n.pow($,2).div(1e5)),$=n.pow(.95,xe.books.expandersBook.amount.value).times($),n.pow(n.add($,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>F(M.bought.value)})),de=[Ne,Te,Z],L=X(()=>[ae(()=>({addend:1,description:"Wooden Fingers",enabled:m.bought})),ae(()=>({addend:je,description:"Smart Knives",enabled:oe.bought}))]),Ze=k(()=>L.apply(1)),$e=X(()=>[E(()=>({multiplier:.5,description:"Sharper Fingers",enabled:S.bought})),E(()=>({multiplier:()=>n.pow(.5,Je.totalElves.value),description:"1 Elf Trained",enabled:Je.milestones[0].earned}))]),Oe=k(()=>$e.apply(1)),Ie=X(()=>[ae(()=>({addend:1,description:"Automated Knives",enabled:g.bought})),ae(()=>({addend:Ne.amount,description:"Generic Cutters",enabled:M.bought})),ae(()=>({addend:()=>n.div(ft.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:ft.milestones.autoCutMilestone1.earned})),E(()=>({multiplier:2,description:"30% Foundation Completed",enabled:ft.milestones.autoCutMilestone2.earned})),E(()=>({multiplier:2,description:"Warmer Cutters",enabled:O.warmerCutters.bought})),E(()=>({multiplier:O.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>n.gt(O.heatedCutters.amount.value,0)})),E(()=>({multiplier:4,description:"Lumberjack Jeans",enabled:qt.treesUpgrades.treesUpgrade2.bought}))]),je=k(()=>Ie.apply(0)),ut=X(()=>[ae(()=>({addend:1,description:"Leafy Fingers",enabled:y.bought})),ae(()=>({addend:Me,description:"Smart Spades",enabled:A.bought}))]),z=k(()=>ut.apply(1)),pe=X(()=>[E(()=>({multiplier:.5,description:"Greener Fingers",enabled:N.bought})),E(()=>({multiplier:()=>n.pow(.5,Je.totalElves.value),description:"1 Elf Trained",enabled:Je.milestones[0].earned}))]),W=k(()=>pe.apply(1)),ve=X(()=>[ae(()=>({addend:1,description:"Automated Spade",enabled:w.bought})),ae(()=>({addend:()=>n.div(Te.amount.value,2),description:"Generic Planters",enabled:M.bought})),ae(()=>({addend:()=>n.div(ft.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:ft.milestones.autoPlantMilestone1.earned})),E(()=>({multiplier:2,description:"40% Foundation Completed",enabled:ft.milestones.autoPlantMilestone2.earned})),E(()=>({multiplier:2,description:"Warmer Planters",enabled:O.warmerPlanters.bought})),E(()=>({multiplier:O.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>n.gt(O.heatedPlanters.amount.value,0)})),E(()=>({multiplier:4,description:"Lumberjack Plaid",enabled:qt.treesUpgrades.treesUpgrade3.bought}))]),Me=k(()=>ve.apply(0)),et=X(()=>[E(()=>({multiplier:1.25,description:"Research I",enabled:h.bought})),E(()=>({multiplier:1.25,description:"Research II",enabled:M.bought})),E(()=>({multiplier:()=>n.div(ft.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:ft.milestones.logGainMilestone1.earned})),E(()=>({multiplier:2,description:"50% Foundation Completed",enabled:ft.milestones.logGainMilestone2.earned})),E(()=>({multiplier:1.25,description:"Ashy Soil",enabled:O.basicFertilizer.bought})),E(()=>({multiplier:O.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>n.gt(O.moreFertilizer.amount.value,0)})),E(()=>({multiplier:2,description:"4 Elves Trained",enabled:Je.milestones[3].earned})),E(()=>({multiplier:2,description:"Carry logs in boxes",enabled:Ct.upgrades.logsUpgrade.bought})),E(()=>({multiplier:()=>n.div(Ct.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:Ct.upgrades.logsUpgrade.bought})),_a(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:ft.milestones.logGainMilestone3.earned}))]),Re=be(0),Be=Qt(()=>({direction:ye.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>n.div(Re.value,Oe.value)})),ie=V(()=>({display:{title:"Cut trees",description:I(()=>o(B,null,[d("Cut down up to "),he(n.floor(Ze.value))," ",d("tree"),n.eq(Ze.value,1)?"":"s",d(" at once!"),o("br",null,null),ue(Be)]))},style:{minHeight:"80px"},canClick:()=>n.gte(c.value,1)&&n.gte(Re.value,Oe.value),onClick(){if(n.lt(Re.value,Oe.value))return;const $=n.floor(n.min(c.value,n.times(Ze.value,n.div(Re.value,Oe.value).floor())));a.value=n.add(a.value,n.times(et.apply(1),$)),i.value=n.add(i.value,$),Re.value=0}})),Pe=be(0),nt=Qt(()=>({direction:ye.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>n.div(Pe.value,W.value)})),Ue=V(()=>({display:{title:"Plant trees",description:I(()=>o(B,null,[d("Plant up to "),he(n.floor(z.value))," ",d("tree"),n.eq(z.value,1)?"":"s",d(" at once!"),o("br",null,null),ue(nt)]))},style:{minHeight:"80px"},canClick:()=>n.gte(i.value,1)&&n.gte(Pe.value,W.value),onClick(){if(n.lt(Pe.value,W.value))return;const $=n.floor(n.min(i.value,n.times(z.value,n.div(Pe.value,W.value).floor())));i.value=n.sub(i.value,$),Pe.value=0}})),[re,vt]=dl(()=>[{title:"Logs per Tree",modifier:et,base:1,visible:h.bought},{title:"Manual Cutting Amount",modifier:L,base:1,visible:m.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:$e,base:1,visible:m.bought,unit:"s"},{title:"Manual Planting Amount",modifier:ut,base:1,visible:y.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:pe,base:1,visible:y.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:Ie,base:0,visible:g.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:ve,base:0,visible:w.bought,unit:"/s"},{title:"Forest Size",modifier:r,base:10,visible:M.bought}]),at=R(!1),j=I(()=>o(gt,{modelValue:at.value,"onUpdate:modelValue":$=>at.value=$},{header:()=>o("h2",null,[e,d(" Modifiers")]),body:re}));He.on("update",$=>{if(n.lt(J.day.value,Wn))return;n.gte(Re.value,Oe.value)?Re.value=Oe.value:(Re.value=n.add(Re.value,$),ie.isHolding.value&&ie.onClick()),n.gte(Pe.value,W.value)?Pe.value=W.value:(Pe.value=n.add(Pe.value,$),Ue.isHolding.value&&Ue.onClick());const Mt=n.min(c.value,n.times(je.value,$)),wt=n.mul(et.apply(1),Mt),ze=n.div(wt,$);s.value=n.mul(ze,Kn).add(n.mul(s.value,n.dOne.sub(Kn))),a.value=n.add(a.value,wt),i.value=n.add(i.value,Mt);const Ot=n.min(i.value,n.times(Me.value,$));i.value=n.sub(i.value,Ot)});const dt=k(()=>n.sub(je.value,Me.value)),fe=k(()=>n.sub(Me.value,je.value)),se=vl(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{ie.canClick.value&&ie.onClick()}})),Ht=vl(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{Ue.canClick.value&&Ue.onClick()}})),{total:yt,trackerDisplay:$t}=pl({resource:a,goal:1e4,name:e,day:Wn,color:l,modal:{show:at,display:j}});return{name:e,color:t,logs:a,totalLogs:yt,trees:c,saplings:i,cutTree:ie,plantTree:Ue,cutTreeHK:se,plantTreeHK:Ht,row1Upgrades:C,row2Upgrades:D,row1Buyables:de,manualCutProgress:Re,manualPlantProgress:Pe,generalTabCollapsed:vt,minWidth:700,display:I(()=>o(B,null,[ue($t),o(we,null,null),o(St,{resource:a,color:t,style:"margin-bottom: 0",productionDisplay:n.gt(je.value,0)?`+${ke(s.value)}/s average<br/>equilibrium: +${ra([[je.value,"cutting speed"],[Me.value,"planting speed"],[n.mul(p.value,20),"forest cap"]],"/s",et.apply(1))}`:void 0},null),o(St,{resource:i,color:l,style:"margin-bottom: 0",productionDisplay:Wl(dt.value)},null),o(St,{resource:c,color:l,style:"margin-bottom: 0",productionDisplay:Wl(fe.value)},null),o(we,null,null),_e(ie,Ue),o("div",null,[d("Tip: You can hold down on actions to perform them automatically")]),o(we,null,null),_e(...C),_e(...D),_e(...de)]))}});var Ma="./assets/tree.35808197.png",xa="./assets/sws.714ad454.png",Aa="data:image/png;base64,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",Ea="./assets/elf.9fbfa563.png",Ia="./assets/paperStacks.4c96ec8c.png",Ba="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAANRUlEQVR42u2deXBV5RmHfycLIdvNRiIJRMgCmhCQEINF41arxWltlRlnRGqRVMeZqjjO6GgdreA4pbXWsUXbKaNBhgrt2CJ1plZsLYQkLGGLAcISQgKYBRKy3GxAAm//4NImgdzz3dxzck/O+T0zGf7gved+3znvc5bvfN97NREBIeTaaBSEEApCCAUhhIIQQkEIoSCEUBBCKAghFIQQCkIIoSCEUBBCKAghFIQQCkIIBSGEghBCQQihIIRQEO4FQigIIRSEWD3hNC1FRBooCCFXy3ErgDIAlQC+ArAZwFci0kNBCAXRtBcBvHWN/9p8RRgR2UZBjNnZySLSyLQbU8fsnwDm64S1AvjPlT8ROUJB1HZuOIB7ANzt+fcmAAUiUsbUGxPHLxhAL4BQHz9aPUSYFgry/506b4AQ375GyEsi8hbTb0wIch+ATQZsascQYcQxgmiaNt0jwpW/BJ2PbBKR+Uy/MSHICgAvG7zZc0Me9itsJYimaQlDhJju4yb6AYSLSD9T0PKClAPIN/lr6ocIc2rMCaJp2kAh5hmwyfkisokpaGk5kgCcDsBXVw64HRvRcLLpgmiadtOQh+twg7/iVyLyMtPQ0oIsBLDOAk3ZPODZZVtABNE0bfIQISab3OndIpLPNLS0IKsAPGmxZrUNuR07YoogA4Zfr9w23RSAzk4UkdNMRcsKUgMgXSdMAGgBbOYxjzDbAWwQkc4RC+IZfh34LBFoFonIOqaiJeXIAlA1xpr9lIisUhbEM/w68LYp3mId+kBEnmQ6WlKQZwCsVAg9s3rJzZeON3dX7zjeGrq95uyNXef7YwPU7DQRqRtWEE3TogAswOVRpnsATAvgPla59NaKSDrT0ZKC/M2TS16ZnzNx+8K5qYNGNXsvXDx4uKmzpbS6xbX7RFvuKDX5oIjkeH0G0TTtSQCrxtixmCEiVUxJywnSDiBGL27ZD7JL0iZE3u4l5Hxb94X9+06195RWt0ysae6eblKTfyciz+kJMgVAXSB2aGRYSMe89PhD38pI6MtIjMxcsnp3EIDrFD66VERWMiUtJUcBgBKV2KLHbz4ZHKRdr3xbIWj6pq23pry2FdtqWtJbui4kG9Tsh0Rko1dBPJ3bDyBnNHZk3pS4ioLMhI6sZFdC+LjgQd+5vvzU9i8ONKm8UPxURBYwLS0lyM8BLNeLS42PqH3zwRlp/nzXhf5L1cfOdDWUHTsbUV7XOvNC/6XxI9yU68oIlp4g7wJ4zowdl54YWV2QOaEx9/rY8PjIcTMBDNuZ2pbu0mWfVRUobNYtIjFMS0sJsgXAnXpxC+emlszPmXi7kd/dda6/Yn99R8euuraYPSfaZuPytKQQnY9tFZFB7fUmyA8BbDSisQmR45puzUyomZsWj8lx4RlBmjZR9bMXL8mpwo92pyqG3yEiJUxNS8gRDcCtEvv2w7N2JkaH3WJWW17ZcOBEfXvvFIXQ10XkDVVBogB0jqRBocFB5+emxe2/LXNC97SkqORxIUF+PVC9tvHg8ZOtPSqjVMtEZDnT0xKCKJ9gPyrMd2uAy4x2+HuC9foeRPES2Q8gZM71sRX5afEdMyfFxESPD5ltZCc3HTy9dd3Ok3cohF51iSQBE+S3AJbqxc2cHLP/hfumzzSrHbUt3SXLPqtSuX3rEJGr3rvoCfIagDf0tpwSG35ixYKcKWZ1srnzfPkLn1TOVQyPERE3UzTggigN8vz0roziW9LjTTup+TvIoyeIacN0PuJeXLRL9RI8aJiOBESOqQBqVWLfX5T7dVRYiGnz955dX3HW3duXoBIqIu/5JIins20AdF/5v/5Adkl6YuTtZnX0N18eraz8pmOWQuhKEVnKNA2oIIUAPtSLCwsJ6ln147wIs9pxru/ioafW7s1SDL/mi2YVQUY8VcBIdta2Fv9+c43KpXjQVAESEEH+BGCR7hPx9MTynxRMnWtWO74+1VH8zr+OquTMcRHJuGZfFAR5GsB7et/gGh/SuvLRXNMmMXad7698+uN9sxTD00WklqkaMEEaAOi+2X75/hu3ZiVH32FWO97fXLO3vLZ1jkLosJNdVQRRnq78x8fmVI0PDc42q8NPrd3bfa7vYqRC6BMi8iFTNSBy5AHYrRL7weK8Y6HBQZkmNaV/cdGuYKitMXlURNaPSBBPp48ByNCLe/7eacWzU2NNG5EoKqsrLz7SrHJJXicii5iuARFkuOqJg0iMDmt4++FZKWa1o72nb89zf67IUwwfdsGdqiBKSybz0+L3PnN3xhyzOn24qXPris8Pq1ySm0QkmekaEEFUqifiodxJpQ/mphSY1Y7io83FRaV1KifrXSIy7ElXVZBHAKxXadiawvw++F49T4m+i5dqnlizJ0MxPF9EdjNlR1WOYAA9AMbpxf5iQU7ZpNjw28xqy5v/OHS4+nTXjQqhXot+qAqiXLbl3Udm74mLCM0zq+MvflJZf6bz/CSFUFZdHH1BlKsnfrQk/4ymIcmMdoig+fHVuxIVw78rIl/6JYin8zsB6N7/L7ltavFdNySa9hzy94qG0g1761Uuzay6OPqCKFVPnJYUdeTV72fdYFY76tt7t72y4cCtKjclACK8FR70RRDbdZ4YLohS9cTCgqnFd0437yS6cV9D6af7lE6iX4jI/V775IMg9wL4coxdPll1cfTksOVtuC+C2O4BjBgqiGr1RFlTmN8Pawzk3CwiewwRxLMTPgdwv17cg7kpZQ/lTjJNkK1HW4o/LK1VuUSz6uLoCWLLVwG+CmKrl0DEUEFUqida6WXyxyLyI6MFmQNgj0rsKEwjCAIQpBDLqovmy2Hb6Ug+lx6100Q0YpggStUTXeGhZ1cunJ1gVjt8nND6v+qJRguyFoDupclCU5lZddF8QWy7JGIkgthmMQwxTBCjqif6hRmL6kYiiHLVRbOXUy5dX9HS0ds3QSWUVRdNk8PWy7JH+vMHtliQTwwRZNSqJ3rDx8Ieg6onmiGIVUq6sOpi4AXZggBVTxyIWaWhRiqILYqCEb/lUC4uaHb1RB+KCy4XkWVmC2L7HUN4ohyxIE64tBLeavsriK0fzohSDth+sMYfQVh10dlyOGK436+fgbbzCyKie+wd8cLYX0FYddG5gjhiypG/gth2khrRPfaOmLTqryCsuuhMORyz7MEvQTw7y5YLZYjXY+6YhXNGCMKqi84TxDFLr40QxJaL9cmwx9tRxTuMEIRVF50liKPKP/ktiGen2a5gGBn2WDuqgKBRgrDqonMEcVQJWqMEsV3RYsLbaSMFYdVFZwjiuJ/BMEQQz86z1Q+nkGseY8cN6RspCKsu2l8Qx/0Un5GC2OrHG8lVx9eR04oME8SzE1l10b6COPLnwI0WxDY/IE+uOraOXNpgtCCsumhfQdoAxOrFvf5Adkl6on0WxxktyFQASpc0s5dhPru+4qy7t09lDcqzIvIeFfB6XB27vNpQQTw7k1UX7SfIawDe0ItLiQ0/sWJBzhSz2uFjgY4YEXFbURClUjDTrovCq9/LMu2gbjnSjNVldczuUSZrYjSmXReN7BQXspKjDd322h0n8e8qpVF5w0o8mSGIcjGxPzw2BxGhwWadbfDCJ5XM2AASGhyE7JRoZCe7MCPFhdR4/x47f7bhABrae1VCl4nIcqsKEg1A6dK29J5M5E2JM+0AvfTX/Whyn2OmWoS4iFBkp7guCzPJhbiIccqf9fGEZ1iZWcMF8UiyBQpVF7+TlYTH5hl7y3q4sRMHG9yoPtOFQ41uZqWFSY0PR3ayC9kpl68wocHDLy0vPtqMolKlW2ZDC5WbJYhS1cXk2HD8coF/Q9XftPbiYEMHqho7UdXoxoX+S8y8sfr8kuzCjOTLzy8ZSVGDb8e3HMeO42dVNmPooItZgigPC/764VlIig5T3nZ7Tx8O1LtxqNGNqsYOtHb3MbNsSERYCGYkRyMrxYXc1Fg8/5evVT9q6I8lmSKIRxKlqouEGIyhL37NFERpagIhRiIimqF5bKIgSlUXCXGqIMrTowlxnCAeSZQ2vqYwn0eWeGVx0S4KQggFoSCEglAQQkEoCKEgFIRQEApCKAgFIRSEghAKQkEIBaEghFAQCkIoCAUhFISCEApCQQgFoSCEglAQQkEoCKEgFIRQEApCKAgFIYSCUBBCQSgIoSAUhFAQCkIoCAUhFISCEApCQQgFoSCEglAQQigIBSEUhIIQCkJBCAWhIISCUBBCQSgIoSAUhFAQCkIoCAUhFISCEEJBKAihIBSEUBAKQigIBSEUhIIQCkJBCAWhIISCUBBCQSgIIRSEghAKQkEIBaEghIJQEEJBKAihIBSEUBAKQigIBSEUhIIQCkJBCKEgFIRQEApCKAgFIRSEghAKQkEIBaEghIJQEEJBKAihIBSEEApCCAWhIISC+CwIIUZBQQihIIRQEEIoCA8ZoSAUhFAQCkIoCAUhFISCEApCQQgFsbYghIx1KAghFIQQCkIIBSGEghBCQQihIIRQEEIoCCEUhBBCQQihIIRQEEIoCCEUhBAKQggFIcQ2/BcAB1oWINKo6AAAAABJRU5ErkJggg==",Pa="./assets/metal.7407f5d1.png",Da="./assets/cloth.7bcd7f37.png";const J=Tt("main",function(){const e=be(1),t=k(()=>(+new Date(new Date().getFullYear(),11,e.value)-Q.time)/1e3),l=R(!1),a=R(-1),i=R(""),s=R();function r(m){const y=be(!1),g=be(!1);return bt(()=>{const w=m(),h=it(w.shouldNotify),C=it(()=>u(h)||u(g));return{...w,opened:y,shouldNotify:C,recentlyUpdated:g,[nl]:Qo,[al]:function(){const{day:S,layer:N,symbol:oe,opened:A,shouldNotify:M,story:D,completedStory:Ne,recentlyUpdated:Te}=this;return{day:S,symbol:oe,layer:N,opened:A,recentlyUpdated:Te,shouldNotify:M,onOpenLore(){var L,Ze;const Z=J.day.value>S;a.value=Z?S-1:-1;const de=u((Ze=(L=ct[N!=null?N:"trees"])==null?void 0:L.name)!=null?Ze:"");i.value=Z?`${de} - Completed!`:de,s.value=Z?`${D}<hr style="
margin: 10px 0;"/>${Ne}`:D,l.value=!0},onOpenLayer(){if(Te.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(Q.tabs.includes(N!=null?N:"trees")){const Z=Q.tabs.lastIndexOf(N!=null?N:"trees");Q.tabs.splice(Z,1)}else Q.tabs.push(N!=null?N:"trees"),J.minimized.value=!0;else Q.tabs.splice(1,1/0,N!=null?N:"trees")},onUnlockLayer(){N&&(A.value=!0,setTimeout(()=>{var Z,de;a.value=-1,i.value=u((de=(Z=ct[N!=null?N:"trees"])==null?void 0:Z.name)!=null?de:""),s.value=D,Q.devSpeed=null,l.value=!0},1e3))}}}}})}const c=[r(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Ma,story:"Oh no! Santa forgot about Christmas and it's only 25 days away! He's asked for your help due to your history getting large quantities of things in short amounts of time. Unfortunately you're really starting from scratch here - let's start with getting wood, which you'll need for everything from building workshops to wrapping paper to many of the toys themselves!",completedStory:"Santa looks at all the wood you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!"})),r(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:xa,story:"Santa looked over your tree farm and was impressed with how much you could accomplish in just one day. Today's goal is to get a workshop built up for the elves to work in - and apparently, they need quite a lot of space to work!",completedStory:"The workshop complete, Santa once again dismisses you for the day. With a strong foundation, this workshop should suffice for supporting future work toward this impossible mission. Good Job!"})),r(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:Aa,story:"Santa tells you that unfortunately there are quite a few naughty children out there this year, and he's going to need you to gather as much coal as you can for him to give out.",completedStory:"Santa looks at all the coal you've gathered and tells you you've done well! He says you should take the rest of the day off so you're refreshed for tomorrow's work. Good Job!"})),r(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Ea,story:"Alright, it seems you finally have enough things set up to start bringing in the elves! Unfortunately, it seems they'll need to be retrained on how to help, since they've stopped practicing for 11 months!",completedStory:"The workshop now hums with the bustling elves working on everything. They can take it from here - you deserve a break after such a long day! Good Job!"})),r(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:Ia,story:"With the elves trained, we're almost ready to start working on these presents! Just a couple more pre-reqs first, starting with turning all this wood into wood pulp and finally into paper, which will be required for wrapping paper later on but in the meantime can be used to help write guides which will help these elves continue their education!",completedStory:"You look upon your rivers of book pulp as you hand out stacks of papers to elves to read through. You've continued getting closer and closer to preparing for Christmas, and can go to bed satisfied with your progress. Good Job!"})),r(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Ba,story:"You watch all these elves carrying incredibly large loads just in their open elf-sized hands, and realize there's probably a better way. You need to put the toys in boxes anyways, so why don't we get started working on those so the workers can take advantage as well?",completedStory:"Wow, those boxes are really convenient! The workshop feels more and more proper with every day. You tick another requirement on your list and start looking towards tomorrow. Good Job!"})),r(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:Pa,story:"You woke up ready to make some toys, before realizing most toys these days are made out of more than just wood! You're sure you're close to really getting to work, but there's a few more materials you're going to need - like metal! Lots of things need metal!",completedStory:"The sounds of drills and metal clanging join the already loud din as yet another piece of the puzzle fits into place. You're making solid progress, Good Job!"})),r(()=>({day:8,shouldNotify:!1,layer:"cloth",symbol:Da,story:"Another resource you're going to need for gifts is cloth! Fortunately you think this should be pretty easy to prepare using a sheep farm - and as you've already proven with the tree farm, that's something you can handle!",completedStory:"You fall into a pile of wool, sighing contentedly as you look at all the progress you've made today. Good Job!"})),r(()=>({day:9,shouldNotify:!1,layer:"oil",symbol:"",story:"Looks like you just need one more thing before the toy factory can get running: plastic! Every toy nowadays is made with plastic! But wait, how are you going to get plastic? What can make plastic? Wait that's right, oil! You figured out you might as well repurpose your coal and ore drills into something that can get you oil, unfortunately you'll need to mine much deeper that you're currently doing before, so let's get to work!",completedStory:"It took a while, but you finally got enough oil for the next step! You deserve a good rest after all these digging work - tomorrow will be a busy day! Good Job!"})),r(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),r(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function p(){a.value=e.value-1,i.value="Day Complete!",s.value=c[e.value-1].completedStory,l.value=!0,e.value++,J.minimized.value=!1,Q.devSpeed=0}return{name:"Calendar",days:c,day:e,timeUntilNewDay:t,loreScene:a,loreTitle:i,loreBody:s,showLoreModal:l,completeDay:p,minWidth:700,display:I(()=>o(B,null,[Q.devSpeed===0?o("div",null,[d("Game Paused")]):null,Q.devSpeed&&Q.devSpeed!==1?o("div",null,[d("Dev Speed: "),ke(Q.devSpeed),d("x")]):null,Q.offlineTime?o("div",null,[d("Offline Time: "),ln(Q.offlineTime)]):null,o(we,null,null),o("div",{class:"advent"},[c.reduce((m,y)=>(m[m.length-1].length===4&&m.push([]),m[m.length-1].push(y),m),[[]]).map(m=>_e(...m))])]))}}),ar=e=>[J,ge,ft,O,Je,xe,Ct,ht,qt,We],An=k(()=>!1);function ir(e,t){t.offlineProd=!1}var or=Object.freeze(Object.defineProperty({__proto__:null,main:J,getInitialLayers:ar,hasWon:An,fixOldSave:ir},Symbol.toStringTag,{value:"Module"}));const sr={class:"scene"},rr=["src"],ur=["src"],cr=["src"],dr=["src"],pr=["src"],mr=["src"],fr={key:6,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},hr=["src"],gr=["src"],vr=le({__name:"Scene",props:{day:null},setup(e){return(t,l)=>(b(),x("div",sr,[e.day>=7?(b(),x("img",{key:0,src:u(Da),class:"scene-item",style:{left:"4%",bottom:"3%",width:"40px",height:"40px"}},null,8,rr)):T("",!0),e.day>=0?(b(),x("img",{key:1,src:u(Ma),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,ur)):T("",!0),e.day>=1?(b(),x("img",{key:2,src:u(xa),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,cr)):T("",!0),e.day>=2?(b(),x("img",{key:3,src:u(Aa),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,dr)):T("",!0),e.day>=6?(b(),x("img",{key:4,src:u(Pa),class:"scene-item",style:{left:"72%",bottom:"8%",width:"40px",height:"40px"}},null,8,pr)):T("",!0),e.day>=3?(b(),x("img",{key:5,src:u(Ea),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,mr)):T("",!0),e.day>=4?(b(),x("div",fr,[e.day>=4?(b(),x("img",{key:0,src:u(Ia),class:"scene-item"},null,8,hr)):T("",!0),e.day>=5?(b(),x("img",{key:1,src:u(Ba),class:"scene-item"},null,8,gr)):T("",!0)])):T("",!0)]))}});var yr=Se(vr,[["__scopeId","data-v-217dad6a"]]);const br=le({components:{Context:da},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:q(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:q(Number,String),required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:l,minimized:a,minWidth:i,tab:s}=rt(e),r=Jl(t),c=k(()=>Ae.allowGoBack&&l.value>0&&!a.value);function p(){Q.tabs.splice(u(e.index),1)}ul(()=>y(a.value,u(i.value))),Dt([a,Mo(i)],([g,w])=>y(g,w));function m(g){e.nodes.value=g}function y(g,w){const h=typeof w=="number"||Number.isNaN(parseInt(w))?w+"px":w,C=s.value();C!=null&&(g?(C.style.flexGrow="0",C.style.flexShrink="0",C.style.width="60px",C.style.minWidth=C.style.flexBasis="",C.style.margin="0"):(C.style.flexGrow="",C.style.flexShrink="",C.style.width="",C.style.minWidth=C.style.flexBasis=h,C.style.margin=""))}return{component:r,showGoBack:c,updateNodes:m,unref:u,goBack:p}}});function wr(e,t,l,a,i,s){const r=tl("Context");return b(),x("div",{class:"layer-container",style:Ye({"--layer-color":e.unref(e.color)})},[e.showGoBack?(b(),x("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):T("",!0),e.minimized.value?(b(),x("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[f("div",null,ce(e.unref(e.name)),1)])):(b(),x("div",{key:2,class:Qe(["layer-tab",{showGoBack:e.showGoBack}])},[o(r,{onUpdateNodes:e.updateNodes},{default:K(()=>[(b(),Y(qe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(b(),x("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):T("",!0)],4)}var kr=Se(br,[["render",wr],["__scopeId","data-v-0158bec3"]]);const Fa=e=>(zt("data-v-4b4bda40"),e=e(),Wt(),e),Cr=Fa(()=>f("h2",null,"Changelog",-1)),_r=Fa(()=>f("details",{open:""},[f("summary",null,[d("v0.0 Initial Commit - "),f("time",null,"2021-09-04")]),d(" This is the first release :D "),f("ul",null,[f("li",{class:"feature"},"Did everything"),f("li",{class:"fix"},"Had some fun"),f("li",{class:"breaking"},"Removed everything"),f("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Sr=le({__name:"Changelog",setup(e,{expose:t}){const l=R(!1);return t({open(){l.value=!0}}),(a,i)=>(b(),Y(gt,{modelValue:l.value,"onUpdate:modelValue":i[0]||(i[0]=s=>l.value=s)},{header:K(()=>[Cr]),body:K(()=>[_r]),_:1},8,["modelValue"]))}});var Nr=Se(Sr,[["__scopeId","data-v-4b4bda40"]]),Mr=le({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),direction:q(String),xoffset:q(String),yoffset:q(String),pinned:Object},setup(e){const{element:t,display:l,pinned:a}=rt(e),i=R(!1),s=k(()=>(lt(a)||i.value)&&r.value),r=ll(l),c=xt(Ce(I(()=>{const y=lt(t);return y==null?"":Pt(y)})));function p(y){const g=a;y.shiftKey&&g&&(g.value=!g.value,y.stopPropagation(),y.preventDefault())}const m=k(()=>lt(a)&&Pl[Le.theme].showPin);return{Direction:ye,isHovered:i,isShown:s,comp:r,elementComp:c,unref:u,togglePinned:p,showPin:m}}});const xr={key:0,class:"material-icons pinned"};function Ar(e,t,l,a,i,s){return b(),x("div",{class:Qe(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=r=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=r=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...r)=>e.togglePinned&&e.togglePinned(...r))},[Bt(e.$slots,"default",{},void 0,!0),e.elementComp?(b(),Y(qe(e.elementComp),{key:0})):T("",!0),o(en,{name:"fade"},{default:K(()=>{var r;return[e.isShown?(b(),x("div",{key:0,class:Qe(["tooltip",{top:e.unref(e.direction)===e.Direction.Up,left:e.unref(e.direction)===e.Direction.Left,right:e.unref(e.direction)===e.Direction.Right,bottom:e.unref(e.direction)===e.Direction.Down,...e.unref(e.classes)}]),style:Ye([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(r=e.unref(e.style))!=null?r:{}])},[e.showPin?(b(),x("span",xr,"push_pin")):T("",!0),e.comp?(b(),Y(qe(e.comp),{key:1})):T("",!0)],6)):T("",!0)]}),_:1})],34)}var Ke=Se(Mr,[["render",Ar],["__scopeId","data-v-6102fa3a"]]);const Er={class:"info-modal-header"},Ir=["src","alt"],Br={class:"info-modal-title"},Pr={key:0},Dr=d(" - "),Fr={key:0},Tr={key:0},$r=f("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),Or=f("br",null,null,-1),Rr=f("br",null,null,-1),Ur=["href"],qr=f("span",{class:"material-icons info-modal-discord"},"discord",-1),Hr=f("div",null,[f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),d(" The Paper Pilot Community ")])],-1),Vr=f("div",null,[f("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),d(" The Modding Tree ")])],-1),Lr=f("br",null,null,-1);var Gr=le({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const l=e,{title:a,logo:i,author:s,discordName:r,discordLink:c,versionNumber:p,versionTitle:m}=Ae,y=rt(l),g=R(!1),w=k(()=>ln(Q.timePlayed)),h=k(()=>Ce(I(()=>o(B,null,[wa.map(ue)]))));t({open(){g.value=!0}});function C(){var S;(S=u(y.changelog))==null||S.open()}return(S,N)=>(b(),Y(gt,{class:"info-modal",modelValue:g.value,"onUpdate:modelValue":N[0]||(N[0]=oe=>g.value=oe)},{header:K(()=>[f("div",Er,[u(i)?(b(),x("img",{key:0,class:"info-modal-logo",src:u(i),alt:u(a)},null,8,Ir)):T("",!0),f("div",Br,[f("h2",null,"- "+ce(u(a))+" -",1),f("h4",null,[d(" - v"+ce(u(p)),1),u(m)?(b(),x("span",Pr,": "+ce(u(m)),1)):T("",!0),Dr])])])]),body:K(({shown:oe})=>[oe?(b(),x("div",Fr,[u(s)?(b(),x("div",Tr,"By "+ce(u(s)),1)):T("",!0),$r,Or,f("div",{class:"link",onClick:C},"Changelog"),Rr,f("div",null,[u(c)?(b(),x("a",{key:0,href:u(c),class:"info-modal-discord-link",target:"_blank"},[qr,d(" "+ce(u(r)),1)],8,Ur)):T("",!0)]),Hr,Vr,Lr,f("div",null,"Time Played: "+ce(u(w)),1),(b(),Y(qe(u(h))))])):T("",!0)]),_:1},8,["modelValue"]))}});const Ta=e=>(zt("data-v-0d685451"),e=e(),Wt(),e),Qr=Ta(()=>f("h2",null,"Options",-1)),jr=Ta(()=>f("hr",null,null,-1));var zr=le({__name:"Options",setup(e,{expose:t}){const l=R(!1);t({open(){l.value=!0}});const a=Object.keys(Pl).map(h=>({label:ua(h),value:h})),i=k(()=>Ce(I(()=>o(B,null,[ba.map(ue)])))),{showTPS:s,theme:r}=rt(Le),{autosave:c,usingLog:p}=rt(Q),m=k({get(){return Q.devSpeed===0},set(h){Q.devSpeed=h?0:null}}),y=I(()=>o("span",null,[d("Autosave"),o(Ke,{display:"Save-specific"},{default:()=>[d("*")]})])),g=I(()=>o("span",null,[d("Pause game"),o(Ke,{display:"Save-specific"},{default:()=>[d("*")]})])),w=I(()=>o("span",null,[d("Use log for progress bar"),o(Ke,{display:"Save-specific"},{default:()=>[d("*")]})]));return(h,C)=>(b(),Y(gt,{modelValue:l.value,"onUpdate:modelValue":C[5]||(C[5]=S=>l.value=S)},{header:K(()=>[Qr]),body:K(()=>[o(xn,{title:"Theme",options:u(a),modelValue:u(r),"onUpdate:modelValue":C[0]||(C[0]=S=>Xe(r)?r.value=S:null)},null,8,["options","modelValue"]),(b(),Y(qe(u(i)))),o(Gt,{title:"Show TPS",modelValue:u(s),"onUpdate:modelValue":C[1]||(C[1]=S=>Xe(s)?s.value=S:null)},null,8,["modelValue"]),jr,o(Gt,{title:u(y),modelValue:u(c),"onUpdate:modelValue":C[2]||(C[2]=S=>Xe(c)?c.value=S:null)},null,8,["title","modelValue"]),u(Ae).enablePausing?(b(),Y(Gt,{key:0,title:u(g),modelValue:u(m),"onUpdate:modelValue":C[3]||(C[3]=S=>Xe(m)?m.value=S:null)},null,8,["title","modelValue"])):T("",!0),o(Gt,{title:u(w),modelValue:u(p),"onUpdate:modelValue":C[4]||(C[4]=S=>Xe(p)?p.value=S:null)},null,8,["title","modelValue"])]),_:1},8,["modelValue"]))}});var Wr=Se(zr,[["__scopeId","data-v-0d685451"]]);const Kr=["onSubmit"],Jr={class:"field"},Xr={key:0,class:"field-title"},Yr=["placeholder"],Zr=le({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const l=e,a=ll(Ft(l,"title"),"span"),i=xt(null);Yl(()=>{var p;(p=i.value)==null||p.focus()});const s=k({get(){return u(l.modelValue)||""},set(p){t("update:modelValue",p)}});function r(){t("submit")}function c(){l.submitOnBlur!==!1?t("submit"):t("cancel")}return(p,m)=>(b(),x("form",{onSubmit:Ml(r,["prevent"])},[f("div",Jr,[u(a)?(b(),x("span",Xr,[(b(),Y(qe(u(a))))])):T("",!0),e.textArea?(b(),Y(u(ei),{key:1,modelValue:u(s),"onUpdate:modelValue":m[0]||(m[0]=y=>Xe(s)?s.value=y:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):Zl((b(),x("input",{key:2,type:"text","onUpdate:modelValue":m[1]||(m[1]=y=>Xe(s)?s.value=y:null),placeholder:e.placeholder,class:Qe({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:i},null,42,Yr)),[[Wa,u(s)]])])],40,Kr))}});var $a=Se(Zr,[["__scopeId","data-v-67b44a54"]]);const eu={key:0},tu=["onClick","disabled"],lu={key:0},nu=["onClick"],au=le({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const a=rt(e),i=R(!1);Dt(i,c=>{t("confirmingChanged",c)});function s(){if(u(a.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function r(){i.value=!1}return(c,p)=>(b(),x("span",{class:Qe(["container",{confirming:i.value}])},[i.value?(b(),x("span",eu,"Are you sure?")):T("",!0),f("button",{onClick:Ml(s,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(b(),x("span",lu,"Yes")):Bt(c.$slots,"default",{key:1},void 0,!0)],8,tu),i.value?(b(),x("button",{key:1,class:"button",onClick:Ml(r,["stop"])},"No",8,nu)):T("",!0)],2))}});var iu=Se(au,[["__scopeId","data-v-2f8ef34c"]]);const ou=["onClick"],su=le({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const l=R(!1),a=R(null);function i(){t("click"),a.value&&clearTimeout(a.value),l.value=!1,ul(()=>{l.value=!0,a.value=setTimeout(()=>l.value=!1,500)})}return(s,r)=>(b(),x("button",{onClick:Ml(i,["stop"]),class:Qe(["feedback",{activated:l.value,left:e.left}])},[Bt(s.$slots,"default",{},void 0,!0)],10,ou))}});var ru=Se(su,[["__scopeId","data-v-01a1b95c"]]);const Kt=e=>(zt("data-v-5285ac49"),e=e(),Wt(),e),uu=Kt(()=>f("div",{class:"handle material-icons"},"drag_handle",-1)),cu={key:0,class:"actions"},du=Kt(()=>f("span",{class:"material-icons"},"content_paste",-1)),pu=Kt(()=>f("span",{class:"material-icons"},"content_copy",-1)),mu=Kt(()=>f("span",{class:"material-icons"},"edit",-1)),fu=Kt(()=>f("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),hu={key:1,class:"actions"},gu=Kt(()=>f("span",{class:"material-icons"},"check",-1)),vu=Kt(()=>f("span",{class:"material-icons"},"close",-1)),yu={key:2,class:"details"},bu={class:"save-version"},wu=Kt(()=>f("br",null,null,-1)),ku={key:0},Cu={key:1},_u={key:3,class:"details"},Su={key:4,class:"details error"},Nu=Kt(()=>f("br",null,null,-1)),Mu=le({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const l=e,{save:a}=rt(l),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=R(!1),r=R(!1),c=R("");Dt(s,()=>c.value=a.value.name||"");const p=k(()=>a.value&&a.value.id===Q.id),m=k(()=>p.value?Q.time:a.value&&a.value.time||0),y=Jl(k(()=>{var w,h,C,S;return`Day ${(S=(C=(h=(w=a.value)==null?void 0:w.layers)==null?void 0:h.main)==null?void 0:C.day)!=null?S:1}`}));function g(){t("editName",c.value),s.value=!1}return(w,h)=>(b(),x("div",{class:Qe(["save",{active:u(p)}])},[uu,s.value?(b(),x("div",hu,[f("button",{onClick:g,class:"button"},[o(Ke,{display:"Save",direction:u(ye).Left,class:"info"},{default:K(()=>[gu]),_:1},8,["direction"])]),f("button",{onClick:h[5]||(h[5]=C=>s.value=!s.value),class:"button"},[o(Ke,{display:"Cancel",direction:u(ye).Left,class:"info"},{default:K(()=>[vu]),_:1},8,["direction"])])])):(b(),x("div",cu,[u(a).error==null&&!r.value?(b(),Y(ru,{key:0,onClick:h[0]||(h[0]=C=>t("export")),class:"button",left:""},{default:K(()=>[o(Ke,{display:"Export",direction:u(ye).Left,class:"info"},{default:K(()=>[du]),_:1},8,["direction"])]),_:1})):T("",!0),u(a).error==null&&!r.value?(b(),x("button",{key:1,onClick:h[1]||(h[1]=C=>t("duplicate")),class:"button"},[o(Ke,{display:"Duplicate",direction:u(ye).Left,class:"info"},{default:K(()=>[pu]),_:1},8,["direction"])])):T("",!0),u(a).error==null&&!r.value?(b(),x("button",{key:2,onClick:h[2]||(h[2]=C=>s.value=!s.value),class:"button"},[o(Ke,{display:"Edit Name",direction:u(ye).Left,class:"info"},{default:K(()=>[mu]),_:1},8,["direction"])])):T("",!0),o(iu,{disabled:u(p),onClick:h[3]||(h[3]=C=>t("delete")),onConfirmingChanged:h[4]||(h[4]=C=>r.value=C)},{default:K(()=>[o(Ke,{display:"Delete",direction:u(ye).Left,class:"info"},{default:K(()=>[fu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(a).error==null&&!s.value?(b(),x("div",yu,[f("button",{class:"button open",onClick:h[6]||(h[6]=C=>t("open"))},[f("h3",null,ce(u(a).name),1)]),f("span",bu,"v"+ce(u(a).modVersion),1),wu,u(m)?(b(),x("div",ku,"Last played "+ce(u(i).format(u(m))),1)):T("",!0),u(y)?(b(),x("div",Cu,[(b(),Y(qe(u(y))))])):T("",!0)])):u(a).error==null&&s.value?(b(),x("div",_u,[o($a,{modelValue:c.value,"onUpdate:modelValue":h[7]||(h[7]=C=>c.value=C),class:"editname",onSubmit:g},null,8,["modelValue"])])):(b(),x("div",Su,[d(" Error: Failed to load save with id "+ce(u(a).id),1),Nu,d(ce(u(a).error),1)]))],2))}});var xu=Se(Mu,[["__scopeId","data-v-5285ac49"]]);const En=e=>(zt("data-v-3b9991aa"),e=e(),Wt(),e),Au=En(()=>f("h2",null,"Saves Manager",-1)),Eu={class:"modal-footer"},Iu={class:"field"},Bu=En(()=>f("span",{class:"field-title"},"Create Save",-1)),Pu={class:"field-buttons"},Du={class:"footer"},Fu=En(()=>f("div",{style:{"flex-grow":"1"}},null,-1)),Tu=le({__name:"SavesManager",setup(e,{expose:t}){const l=R(!1),a=R(null);t({open(){l.value=!0}});const i=R(!1),s=R(""),r=R(null);Dt(s,A=>{A?ul(()=>{try{if(A[0]!=="{")if(A[0]==="e")A=decodeURIComponent(escape(atob(A)));else if(A[0]==="\u1BE1")A=Yt.decompressFromUTF16(A);else{console.warn("Unable to determine preset encoding",A),i.value=!0;return}const M=JSON.parse(A);if(typeof M!="object"){i.value=!0;return}const D=Gl();M.id=D,It(M),s.value="",i.value=!1,Le.saves.push(D)}catch{i.value=!0}}):i.value=!1});let c={},p=R(Object.keys(c).reduce((A,M)=>(A.push({label:M.split("/").slice(-1)[0].slice(0,-4),value:c[M]}),A),[]));const m=tn({});function y(A){if(m[A]==null){let M=localStorage.getItem(A);if(M==null)m[A]={error:"Save doesn't exist in localStorage",id:A};else if(M==="dW5kZWZpbmVk")m[A]={error:"Save is undefined",id:A};else try{if(M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=Yt.decompressFromUTF16(M);else return console.warn("Unable to determine preset encoding",M),i.value=!0,m[A]={error:"Unable to determine preset encoding",id:A},m[A];m[A]={...JSON.parse(M),id:A}}catch(D){m[A]={error:D,id:A},console.warn(`SavesManager: Failed to load info about save with id ${A}:
${D}
${M}`)}}return m[A]}Dt(l,A=>{A&&Object.keys(m).forEach(M=>delete m[M])});const g=k(()=>Le.saves.reduce((A,M)=>(A[M]=y(M),A),{}));function w(A){let M;switch(Q.id===A?M=ga(Q[Ve]):M=JSON.stringify(g.value[A]),Ae.exportEncoding){default:console.warn(`Unknown save encoding: ${Ae.exportEncoding}. Defaulting to lz`);case"lz":M=Yt.compressToUTF16(M);break;case"base64":M=btoa(unescape(encodeURIComponent(M)));break;case"plain":break}const D=document.createElement("textarea");D.value=M,document.body.appendChild(D),D.select(),D.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(D)}function h(A){Q.id===A&&It();const M={...g.value[A],id:Gl()};It(M),Le.saves.push(M.id)}function C(A){Le.saves=Le.saves.filter(M=>M!==A),localStorage.removeItem(A),m[A]=void 0}function S(A){g.value[Q.id].time=Q.time,It(),m[Q.id]=void 0,rl(g.value[A]),m[A]=void 0}function N(A){if(r.value=A,ul(()=>{r.value=null}),A[0]!=="{")if(A[0]==="e")A=decodeURIComponent(escape(atob(A)));else if(A[0]==="\u1BE1")A=Yt.decompressFromUTF16(A);else{console.warn("Unable to determine preset encoding",A);return}const M=JSON.parse(A);M.id=Gl(),It(M),Le.saves.push(M.id),S(M.id)}function oe(A,M){const D=g.value[A];D&&(D.name=M,Q.id===A?(Q.name=M,It()):(It(D),m[A]=void 0))}return(A,M)=>(b(),Y(gt,{modelValue:l.value,"onUpdate:modelValue":M[4]||(M[4]=D=>l.value=D),ref_key:"modal",ref:a},{header:K(()=>[Au]),body:K(({shown:D})=>[D?(b(),Y(u(Za),{key:0,list:u(Le).saves,handle:".handle",itemKey:Ne=>Ne},{item:K(({element:Ne})=>[o(xu,{save:u(g)[Ne],onOpen:Te=>S(Ne),onExport:Te=>w(Ne),onEditName:Te=>oe(Ne,Te),onDuplicate:Te=>h(Ne),onDelete:Te=>C(Ne)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):T("",!0)]),footer:K(()=>[f("div",Eu,[o($a,{modelValue:s.value,"onUpdate:modelValue":M[0]||(M[0]=D=>s.value=D),title:"Import Save",placeholder:"Paste your save here!",class:Qe({importingFailed:i.value})},null,8,["modelValue","class"]),f("div",Iu,[Bu,f("div",Pu,[f("button",{class:"button",onClick:M[1]||(M[1]=D=>S(u(gl)().id))},"New Game"),Object.keys(u(p)).length>0?(b(),Y(xn,{key:0,options:u(p),modelValue:r.value,"onUpdate:modelValue":M[2]||(M[2]=D=>N(D)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):T("",!0)])]),f("div",Du,[Fu,f("button",{class:"button modal-default-button",onClick:M[3]||(M[3]=D=>l.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Oa=Se(Tu,[["__scopeId","data-v-3b9991aa"]]);const Nt=e=>(zt("data-v-8495e562"),e=e(),Wt(),e),$u=["src","alt"],Ou={key:1,class:"title"},Ru=Nt(()=>f("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Uu={class:"discord"},qu={class:"discord-links"},Hu={key:0},Vu=["href"],Lu=Nt(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Gu=Nt(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Qu={href:"https://forums.moddingtree.com/",target:"_blank"},ju=Nt(()=>f("span",{class:"material-icons"},"forum",-1)),zu=Nt(()=>f("span",{class:"material-icons"},"info",-1)),Wu=Nt(()=>f("span",{class:"material-icons"},"library_books",-1)),Ku=Nt(()=>f("span",{class:"material-icons"},"settings",-1)),Ju=Nt(()=>f("span",{class:"material-icons"},"library_books",-1)),Xu=Nt(()=>f("span",{class:"material-icons"},"settings",-1)),Yu=Nt(()=>f("span",{class:"material-icons"},"info",-1)),Zu={href:"https://forums.moddingtree.com/",target:"_blank"},ec=Nt(()=>f("span",{class:"material-icons"},"forum",-1)),tc={class:"discord"},lc={class:"discord-links"},nc={key:0},ac=["href"],ic=Nt(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),oc=Nt(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),sc=le({__name:"Nav",setup(e){const t=R(null),l=R(null),a=R(null),i=R(null),{useHeader:s,banner:r,title:c,discordName:p,discordLink:m,versionNumber:y}=Ae;function g(){window.open(m,"mywindow")}return(w,h)=>(b(),x(B,null,[u(s)?(b(),x("div",cl({key:0,class:"nav"},w.$attrs),[u(r)?(b(),x("img",{key:0,src:u(r),class:"banner",alt:u(c)},null,8,$u)):(b(),x("div",Ou,ce(u(c)),1)),f("div",{onClick:h[0]||(h[0]=C=>{var S;return(S=i.value)==null?void 0:S.open()}),class:"version-container"},[o(Ke,{display:"Changelog",direction:u(ye).Down,class:"version"},{default:K(()=>[f("span",null,"v"+ce(u(y)),1)]),_:1},8,["direction"])]),Ru,f("div",Uu,[f("span",{onClick:g,class:"material-icons"},"discord"),f("ul",qu,[u(m)?(b(),x("li",Hu,[f("a",{href:u(m),target:"_blank"},ce(u(p)),9,Vu)])):T("",!0),Lu,Gu])]),f("div",null,[f("a",Qu,[o(Ke,{display:"Forums",direction:u(ye).Down,yoffset:"5px"},{default:K(()=>[ju]),_:1},8,["direction"])])]),f("div",{onClick:h[1]||(h[1]=C=>{var S;return(S=t.value)==null?void 0:S.open()})},[o(Ke,{display:"Info",direction:u(ye).Down,class:"info"},{default:K(()=>[zu]),_:1},8,["direction"])]),f("div",{onClick:h[2]||(h[2]=C=>{var S;return(S=l.value)==null?void 0:S.open()})},[o(Ke,{display:"Saves",direction:u(ye).Down,xoffset:"-20px"},{default:K(()=>[Wu]),_:1},8,["direction"])]),f("div",{onClick:h[3]||(h[3]=C=>{var S;return(S=a.value)==null?void 0:S.open()})},[o(Ke,{display:"Options",direction:u(ye).Down,xoffset:"-66px"},{default:K(()=>[Ku]),_:1},8,["direction"])])],16)):(b(),x("div",cl({key:1,class:"overlay-nav"},w.$attrs),[f("div",{onClick:h[4]||(h[4]=C=>{var S;return(S=i.value)==null?void 0:S.open()}),class:"version-container"},[o(Ke,{display:"Changelog",direction:u(ye).Right,xoffset:"25%",class:"version"},{default:K(()=>[f("span",null,"v"+ce(u(y)),1)]),_:1},8,["direction"])]),f("div",{onClick:h[5]||(h[5]=C=>{var S;return(S=l.value)==null?void 0:S.open()})},[o(Ke,{display:"Saves",direction:u(ye).Right},{default:K(()=>[Ju]),_:1},8,["direction"])]),f("div",{onClick:h[6]||(h[6]=C=>{var S;return(S=a.value)==null?void 0:S.open()})},[o(Ke,{display:"Options",direction:u(ye).Right},{default:K(()=>[Xu]),_:1},8,["direction"])]),f("div",{onClick:h[7]||(h[7]=C=>{var S;return(S=t.value)==null?void 0:S.open()})},[o(Ke,{display:"Info",direction:u(ye).Right},{default:K(()=>[Yu]),_:1},8,["direction"])]),f("div",null,[f("a",Zu,[o(Ke,{display:"Forums",direction:u(ye).Right,xoffset:"7px"},{default:K(()=>[ec]),_:1},8,["direction"])])]),f("div",tc,[f("span",{onClick:g,class:"material-icons"},"discord"),f("ul",lc,[u(m)?(b(),x("li",nc,[f("a",{href:u(m),target:"_blank"},ce(u(p)),9,ac)])):T("",!0),ic,oc])])],16)),o(Gr,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),o(Oa,{ref_key:"savesManager",ref:l},null,512),o(Wr,{ref_key:"options",ref:a},null,512),o(Nr,{ref_key:"changelog",ref:i},null,512)],64))}});var Ra=Se(sc,[["__scopeId","data-v-8495e562"]]);const In=e=>(zt("data-v-248e2ebb"),e=e(),Wt(),e),rc={class:"inner-tab"},uc={key:1},cc=In(()=>f("br",null,null,-1)),dc=d(" You can help continue the "),pc=In(()=>f("i",null,"advent",-1)),mc=d("ure at: "),fc=In(()=>f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),d(" The Paper Pilot Community ")],-1)),hc=le({__name:"Game",setup(e){const t=Ft(Q,"tabs"),l=k(()=>Object.keys(ct)),a=Ae.useHeader,i=ll(J.loreBody);function s(r){const{display:c,minimized:p,minWidth:m,name:y,color:g,minimizable:w,nodes:h}=r;return{display:c,minimized:p,minWidth:m,name:y,color:g,minimizable:w,nodes:h}}return(r,c)=>(b(),x("div",{class:Qe(["tabs-container",{useHeader:u(a)}])},[(b(!0),x(B,null,Yn(u(t),(p,m)=>{var y,g;return b(),x("div",{key:m,class:Qe(["tab",u((y=u(ct)[p])==null?void 0:y.classes)]),ref_for:!0,ref:`tab-${m}`,style:Ye(u((g=u(ct)[p])==null?void 0:g.style))},[m===0&&!u(a)?(b(),Y(Ra,{key:0})):T("",!0),f("div",rc,[u(l).includes(p)?(b(),Y(kr,cl({key:0},s(u(ct)[p]),{index:m,tab:()=>{var w;return(w=r.$refs[`tab-${m}`])==null?void 0:w[0]}}),null,16,["index","tab"])):(b(),Y(qe(p),{key:1,index:m},null,8,["index"]))])],6)}),128)),o(gt,{modelValue:u(J).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=p=>u(J).showLoreModal.value=p)},{header:K(()=>[f("h2",null,ce(u(J).loreTitle.value),1)]),body:K(()=>[u(i)?(b(),Y(qe(u(i)),{key:0})):T("",!0),u(J).loreScene.value!==-1?(b(),x("div",uc,[o(yr,{day:u(J).loreScene.value},null,8,["day"]),cc,dc,pc,mc,fc])):T("",!0)]),_:1},8,["modelValue"])],2))}});var gc=Se(hc,[["__scopeId","data-v-248e2ebb"]]);const Tl=e=>(zt("data-v-4a50ce42"),e=e(),Wt(),e),vc={class:"game-over-modal-header"},yc=["src","alt"],bc={class:"game-over-modal-title"},wc=Tl(()=>f("h2",null,"Congratulations!",-1)),kc={key:0},Cc=Tl(()=>f("br",null,null,-1)),_c=Tl(()=>f("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Sc=Tl(()=>f("br",null,null,-1)),Nc=["href"],Mc=Tl(()=>f("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),xc=le({__name:"GameOverScreen",setup(e){const{title:t,logo:l,discordName:a,discordLink:i,versionNumber:s,versionTitle:r}=Ae,c=k(()=>ln(Q.timePlayed)),p=k(()=>An.value&&!Q.keepGoing),m=Ft(Q,"autosave");function y(){Q.keepGoing=!0}function g(){rl(gl())}return(w,h)=>(b(),Y(gt,{"model-value":u(p)},{header:K(()=>[f("div",vc,[u(l)?(b(),x("img",{key:0,class:"game-over-modal-logo",src:u(l),alt:u(t)},null,8,yc)):T("",!0),f("div",bc,[wc,f("h4",null,"You've beaten "+ce(u(t))+" v"+ce(u(s))+": "+ce(u(r)),1)])])]),body:K(({shown:C})=>[C?(b(),x("div",kc,[f("div",null,"It took you "+ce(u(c))+" to beat the game.",1),Cc,_c,Sc,f("div",null,[f("a",{href:u(i),class:"game-over-modal-discord-link"},[Mc,d(" "+ce(u(a)),1)],8,Nc)]),o(Gt,{title:"Autosave",modelValue:u(m),"onUpdate:modelValue":h[0]||(h[0]=S=>Xe(m)?m.value=S:null)},null,8,["modelValue"])])):T("",!0)]),footer:K(()=>[f("div",{class:"game-over-footer"},[f("button",{onClick:y,class:"button"},"Keep Going"),f("button",{onClick:g,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Ac=Se(xc,[["__scopeId","data-v-4a50ce42"]]);const sn=e=>(zt("data-v-3de07c06"),e=e(),Wt(),e),Ec=sn(()=>f("div",{class:"nan-modal-header"},[f("h2",null,"NaN value detected!")],-1)),Ic={key:0},Bc=sn(()=>f("br",null,null,-1)),Pc=["href"],Dc=sn(()=>f("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Fc=sn(()=>f("br",null,null,-1)),Tc={class:"nan-footer"},$c=le({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:l}=Ae,a=Ft(Q,"autosave"),i=Ft(Ge,"hasNaN"),s=R(null),r=k(()=>{var h;return(h=Ge.NaNPath)==null?void 0:h.join(".")}),c=k(()=>{var h;return(h=Ge.NaNPath)==null?void 0:h.slice(-1)[0]}),p=k(()=>Ge.NaNReceiver&&c.value?Ge.NaNReceiver[c.value]:null),m=k({get(){return Q.devSpeed===0},set(h){Q.devSpeed=h?null:0}});function y(){Ge.NaNReceiver&&c.value&&(Ge.NaNReceiver[c.value]=new n(0),Ge.hasNaN=!1)}function g(){Ge.NaNReceiver&&c.value&&(Ge.NaNReceiver[c.value]=new n(1),Ge.hasNaN=!1)}function w(){Ge.NaNReceiver&&c.value&&(Ge.NaNReceiver[c.value]=new n(NaN),Ge.hasNaN=!1)}return(h,C)=>(b(),x(B,null,[o(gt,cl({modelValue:u(i),"onUpdate:modelValue":C[4]||(C[4]=S=>Xe(i)?i.value=S:null)},h.$attrs),{header:K(()=>[Ec]),body:K(()=>[f("div",null,[d(' Attempted to assign "'+ce(u(r))+'" to NaN',1),u(p)?(b(),x("span",Ic,ce(" ")+"(previously "+ce(u(ke)(u(p)))+")",1)):T("",!0),d(". Auto-saving has been "+ce(u(a)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Bc,f("div",null,[f("a",{href:u(l),class:"nan-modal-discord-link"},[Dc,d(" "+ce(u(t)),1)],8,Pc)]),Fc,o(Gt,{title:"Autosave",modelValue:u(a),"onUpdate:modelValue":C[0]||(C[0]=S=>Xe(a)?a.value=S:null)},null,8,["modelValue"]),u(Ae).enablePausing?(b(),Y(Gt,{key:0,title:"Pause game",modelValue:u(m),"onUpdate:modelValue":C[1]||(C[1]=S=>Xe(m)?m.value=S:null)},null,8,["modelValue"])):T("",!0)]),footer:K(()=>[f("div",Tc,[f("button",{onClick:C[2]||(C[2]=S=>{var N;return(N=s.value)==null?void 0:N.open()}),class:"button"},"Open Saves Manager"),f("button",{onClick:y,class:"button"},"Set to 0"),f("button",{onClick:g,class:"button"},"Set to 1"),u(p)&&u(n).neq(u(p),0)&&u(n).neq(u(p),1)?(b(),x("button",{key:0,onClick:C[3]||(C[3]=S=>i.value=!1),class:"button"}," Set to previous ")):T("",!0),f("button",{onClick:w,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),o(Oa,{ref_key:"savesManager",ref:s},null,512)],64))}});var Oc=Se($c,[["__scopeId","data-v-3de07c06"]]);const Rc={key:0,class:"tpsDisplay"},Uc={key:0,class:"low"},qc=le({__name:"TPS",setup(e){const t=k(()=>n.div(Ge.lastTenTicks.length,Ge.lastTenTicks.reduce((s,r)=>s+r,0))),l=R([]);_t(()=>{l.value.push(Math.round(t.value.toNumber())),l.value.length>10&&(l.value=l.value.slice(1))});const a=k(()=>l.value.reduce((s,r)=>n.max(s,r),0)),i=k(()=>n.sub(t.value,a.value).gt(1));return(s,r)=>u(t).isNan()?T("",!0):(b(),x("div",Rc,[d(" TPS: "+ce(u(he)(u(t)))+" ",1),o(en,{name:"fade"},{default:K(()=>[u(i)?(b(),x("span",Uc,ce(u(he)(u(a))),1)):T("",!0)]),_:1})]))}});var Hc=Se(qc,[["__scopeId","data-v-46a3ed5b"]]);var Vc=le({__name:"App",setup(e){const t=Ae.useHeader,l=k(()=>Pl[Le.theme].variables),a=Ft(Le,"showTPS"),i=k(()=>Ce(I(()=>o(B,null,[ko.map(ue)]))));return(s,r)=>(b(),x(B,null,[f("div",{id:"modal-root",style:Ye(u(l))},null,4),f("div",{class:Qe(["app",{useHeader:u(t)}]),style:Ye(u(l))},[u(t)?(b(),Y(Ra,{key:0})):T("",!0),o(gc),u(u(a))?(b(),Y(Hc,{key:1})):T("",!0),o(Ac),o(Oc),(b(),Y(qe(u(i))))],6)],64))}});var Lc=Se(Vc,[["__scopeId","data-v-580927bb"]]);function Gc(e={}){const{immediate:t=!1,onNeedRefresh:l,onOfflineReady:a,onRegistered:i,onRegisterError:s}=e;let r,c;const p=async(m=!0)=>{m&&(r==null||r.addEventListener("controlling",y=>{y.isUpdate&&window.location.reload()})),c&&c.waiting&&await li(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){r=new ti("./sw.js",{scope:"./",type:"classic"}),r.addEventListener("activated",m=>{m.isUpdate||a==null||a()});{const m=()=>{l==null||l()};r.addEventListener("waiting",m),r.addEventListener("externalwaiting",m)}r.register({immediate:t}).then(m=>{c=m,i==null||i(m)}).catch(m=>{s==null||s(m)})}return p}function Qc(e={}){const{immediate:t=!0,onNeedRefresh:l,onOfflineReady:a,onRegistered:i,onRegisterError:s}=e,r=R(!1),c=R(!1);return{updateServiceWorker:Gc({immediate:t,onNeedRefresh(){r.value=!0,l==null||l()},onOfflineReady(){c.value=!0,a==null||a()},onRegistered:i,onRegisterError:s}),offlineReady:c,needRefresh:r}}document.title=Ae.title;window.projInfo=Ae;if(Ae.id==="")throw"Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json";requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c
Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await go();const{globalBus:e}=await jl(()=>Promise.resolve().then(function(){return Yi}),void 0),{startGameLoop:t}=await jl(()=>import("./gameLoop.adcf9934.js"),["assets/gameLoop.adcf9934.js","assets/@fontsource.c175eac8.css","assets/vue.92681fcb.js","assets/lz-string.731cedc5.js","assets/@vue.4ce677c2.js","assets/nanoevents.1080beb7.js","assets/is-plain-object.906d88e8.js","assets/vue-next-select.a2bfab1d.js","assets/vue-next-select.9e6f4164.css","assets/vue-toastification.6f567382.js","assets/vue-toastification.4b5f8ac8.css","assets/vuedraggable.7949458c.js","assets/sortablejs.29100d8a.js","assets/vue-textarea-autosize.35804eaf.js","assets/workbox-window.8d14e8b7.js"]),l=window.vue=Ka(Lc);e.emit("setupVue",l),l.mount("#app"),ul(()=>{const a=ea(),{updateServiceWorker:i}=Qc({onNeedRefresh(){a.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){a.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(s.update,60*1e3)}})}),t()});export{n as D,jl as _,Ge as a,Ae as b,or as c,He as g,_n as l,Q as p,Le as s};