Advent-Incremental/assets/index.ae9651e9.js

19 lines
272 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as v,l as bt,aa as Ce,t as H,ay as ga,ar as Rl,aE as C,a0 as I,aK as Xt,a1 as h,O as M,aG as sa,A as Nt,_ as be,a8 as n,b6 as ge,b8 as ya,bs as ci,C as u,aq as Ol,bu as Xl,bb as ha,T as nn,a7 as s,u as ba,j as on,bv as Ia,q as la,b1 as jt,G as ht,aC as pi,w as Yt,b2 as Vt,ao as sn,I as wt,aN as pt,$ as G,J as Ie,aH as gl,aF as yl,z as ol,al as da,aL as Ml,H as rn,aJ as mi,bn as un,br as dn,be as cn}from"./@vue.4ce677c2.js";import{c as vi}from"./nanoevents.1080beb7.js";import{L as Cl}from"./lz-string.731cedc5.js";import{i as pn}from"./is-plain-object.906d88e8.js";import{Y as mn}from"./vue-next-select.a2bfab1d.js";import{s as vn,u as fi}from"./vue-toastification.6f567382.js";import{D as fn}from"./vuedraggable.7949458c.js";import{p as gn}from"./vue-textarea-autosize.35804eaf.js";import{v as yn,n as hn}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const bn=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const d of r.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function l(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=l(o);fetch(o.href,r)}};bn();const wn="modulepreload",za={},An="./",ca=function(t,l){return!l||l.length===0?t():Promise.all(l.map(i=>{if(i=`${An}${i}`,i in za)return;za[i]=!0;const o=i.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${r}`))return;const d=document.createElement("link");if(d.rel=o?"stylesheet":wn,o||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),o)return new Promise((c,m)=>{d.addEventListener("load",c),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},kn="./projInfo-schema.json",Cn="Advent Incremental",En="An incremental game you play a day at a time, leading up to Christmas!",_n="advent-incremental",Sn="thepaperpilot and friends",Mn="",Bn="",xn="0.5",Nn="Initial Commit",Dn=!0,In=!1,Tn=2,Pn=!0,Fn=null,Un="",Rn=["main"],On=3600,qn=0,Ln=!0,Gn="base64";var je={$schema:kn,title:Cn,description:En,id:_n,author:Sn,discordName:Mn,discordLink:Bn,versionNumber:xn,versionTitle:Nn,allowGoBack:Dn,defaultShowSmall:In,defaultDecimalsShown:Tn,useHeader:Pn,banner:Fn,logo:Un,initialTabs:Rn,maxTickLength:On,offlineLimit:qn,enablePausing:Ln,exportEncoding:Gn};const _a=17,Qn=9e15,$n=Math.log10(9e15),Hn=1/9e15,Vn=308,jn=-324,Ka=5,Jn=function(){const e=[];for(let l=jn+1;l<=Vn;l++)e.push(Number("1e"+l));const t=323;return function(l){return e[l+t]}}(),Pl=[2,Math.E,3,4,5,6,7,8,9,10],Wn=[[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]],zn=[[-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]],k=function(t){return a.fromValue_noAlloc(t)},Ae=function(e,t,l){return a.fromComponents(e,t,l)},Te=function(t,l,i){return a.fromComponents_noNormalize(t,l,i)},kl=function(t,l){const i=l+1,o=Math.ceil(Math.log10(Math.abs(t))),r=Math.round(t*Math.pow(10,i-o))*Math.pow(10,o-i);return parseFloat(r.toFixed(Math.max(i-o,0)))},Sa=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Kn=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 i=e*e;let o=e;return l=l+1/(12*o),o=o*i,l=l+1/(360*o),o=o*i,l=l+1/(1260*o),o=o*i,l=l+1/(1680*o),o=o*i,l=l+1/(1188*o),o=o*i,l=l+691/(360360*o),o=o*i,l=l+7/(1092*o),o=o*i,l=l+3617/(122400*o),Math.exp(l)/t},gi=.5671432904097838,Xa=function(e,t=1e-10){let l,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return gi;e<10?l=0:l=Math.log(e)-Math.log(Math.log(e));for(let o=0;o<100;++o){if(i=(e*Math.exp(-l)+l*l)/(l+1),Math.abs(i-l)<t*Math.abs(i))return i;l=i}throw Error(`Iteration failed to converge: ${e.toString()}`)};function Ya(e,t=1e-10){let l,i,o,r;if(!Number.isFinite(e.mag)||e===a.dZero)return e;if(e===a.dOne)return k(gi);a.abs(e),l=a.ln(e);for(let d=0;d<100;++d){if(i=a.exp(-l),o=l.sub(e.mul(i)),r=l.sub(o.div(l.add(1).sub(l.add(2).mul(o).div(a.mul(2,l).add(2))))),a.abs(r.sub(l)).lt(a.abs(r).mul(t)))return r;l=r}throw Error(`Iteration failed to converge: ${e.toString()}`)}const D=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof D||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/Jn(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 D().fromComponents(e,t,l)}static fromComponents_noNormalize(e,t,l){return new D().fromComponents_noNormalize(e,t,l)}static fromMantissaExponent(e,t){return new D().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new D().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new D().fromDecimal(e)}static fromNumber(e){return new D().fromNumber(e)}static fromString(e){return new D().fromString(e)}static fromValue(e){return new D().fromValue(e)}static fromValue_noAlloc(e){return e instanceof D?e:new D(e)}static abs(e){return k(e).abs()}static neg(e){return k(e).neg()}static negate(e){return k(e).neg()}static negated(e){return k(e).neg()}static sign(e){return k(e).sign}static sgn(e){return k(e).sign}static round(e){return k(e).round()}static floor(e){return k(e).floor()}static ceil(e){return k(e).ceil()}static trunc(e){return k(e).trunc()}static add(e,t){return k(e).add(t)}static plus(e,t){return k(e).add(t)}static sub(e,t){return k(e).sub(t)}static subtract(e,t){return k(e).sub(t)}static minus(e,t){return k(e).sub(t)}static mul(e,t){return k(e).mul(t)}static multiply(e,t){return k(e).mul(t)}static times(e,t){return k(e).mul(t)}static div(e,t){return k(e).div(t)}static divide(e,t){return k(e).div(t)}static recip(e){return k(e).recip()}static reciprocal(e){return k(e).recip()}static reciprocate(e){return k(e).reciprocate()}static cmp(e,t){return k(e).cmp(t)}static cmpabs(e,t){return k(e).cmpabs(t)}static compare(e,t){return k(e).cmp(t)}static isNaN(e){return e=k(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=k(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return k(e).eq(t)}static equals(e,t){return k(e).eq(t)}static neq(e,t){return k(e).neq(t)}static notEquals(e,t){return k(e).notEquals(t)}static lt(e,t){return k(e).lt(t)}static lte(e,t){return k(e).lte(t)}static gt(e,t){return k(e).gt(t)}static gte(e,t){return k(e).gte(t)}static max(e,t){return k(e).max(t)}static min(e,t){return k(e).min(t)}static minabs(e,t){return k(e).minabs(t)}static maxabs(e,t){return k(e).maxabs(t)}static clamp(e,t,l){return k(e).clamp(t,l)}static clampMin(e,t){return k(e).clampMin(t)}static clampMax(e,t){return k(e).clampMax(t)}static cmp_tolerance(e,t,l){return k(e).cmp_tolerance(t,l)}static compare_tolerance(e,t,l){return k(e).cmp_tolerance(t,l)}static eq_tolerance(e,t,l){return k(e).eq_tolerance(t,l)}static equals_tolerance(e,t,l){return k(e).eq_tolerance(t,l)}static neq_tolerance(e,t,l){return k(e).neq_tolerance(t,l)}static notEquals_tolerance(e,t,l){return k(e).notEquals_tolerance(t,l)}static lt_tolerance(e,t,l){return k(e).lt_tolerance(t,l)}static lte_tolerance(e,t,l){return k(e).lte_tolerance(t,l)}static gt_tolerance(e,t,l){return k(e).gt_tolerance(t,l)}static gte_tolerance(e,t,l){return k(e).gte_tolerance(t,l)}static pLog10(e){return k(e).pLog10()}static absLog10(e){return k(e).absLog10()}static log10(e){return k(e).log10()}static log(e,t){return k(e).log(t)}static log2(e){return k(e).log2()}static ln(e){return k(e).ln()}static logarithm(e,t){return k(e).logarithm(t)}static pow(e,t){return k(e).pow(t)}static pow10(e){return k(e).pow10()}static root(e,t){return k(e).root(t)}static factorial(e,t){return k(e).factorial()}static gamma(e,t){return k(e).gamma()}static lngamma(e,t){return k(e).lngamma()}static exp(e){return k(e).exp()}static sqr(e){return k(e).sqr()}static sqrt(e){return k(e).sqrt()}static cube(e){return k(e).cube()}static cbrt(e){return k(e).cbrt()}static tetrate(e,t=2,l=Te(1,0,1)){return k(e).tetrate(t,l)}static iteratedexp(e,t=2,l=Te(1,0,1)){return k(e).iteratedexp(t,l)}static iteratedlog(e,t=10,l=1){return k(e).iteratedlog(t,l)}static layeradd10(e,t){return k(e).layeradd10(t)}static layeradd(e,t,l=10){return k(e).layeradd(t,l)}static slog(e,t=10){return k(e).slog(t)}static lambertw(e){return k(e).lambertw()}static ssqrt(e){return k(e).ssqrt()}static pentate(e,t=2,l=Te(1,0,1)){return k(e).pentate(t,l)}static affordGeometricSeries(e,t,l,i){return this.affordGeometricSeries_core(k(e),k(t),k(l),i)}static sumGeometricSeries(e,t,l,i){return this.sumGeometricSeries_core(e,k(t),k(l),i)}static affordArithmeticSeries(e,t,l,i){return this.affordArithmeticSeries_core(k(e),k(t),k(l),k(i))}static sumArithmeticSeries(e,t,l,i){return this.sumArithmeticSeries_core(k(e),k(t),k(l),k(i))}static efficiencyOfPurchase(e,t,l){return this.efficiencyOfPurchase_core(k(e),k(t),k(l))}static randomDecimalForTesting(e){if(Math.random()*20<1)return Te(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return Te(t,0,1);const l=Math.floor(Math.random()*(e+1));let i=l===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let o=Math.pow(10,i);return Math.random()>.9&&(o=Math.trunc(o)),Ae(t,l,o)}static affordGeometricSeries_core(e,t,l,i){const o=t.mul(l.pow(i));return D.floor(e.div(o).mul(l.sub(1)).add(1).log10().div(l.log10()))}static sumGeometricSeries_core(e,t,l,i){return t.mul(l.pow(i)).mul(D.sub(1,l.pow(e))).div(D.sub(1,l))}static affordArithmeticSeries_core(e,t,l,i){const r=t.add(i.mul(l)).sub(l.div(2)),d=r.pow(2);return r.neg().add(d.add(l.mul(e).mul(2)).sqrt()).div(l).floor()}static sumArithmeticSeries_core(e,t,l,i){const o=t.add(i.mul(l));return e.div(2).mul(o.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<Hn)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Qn)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<$n&&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 A=parseFloat(t[0]),f=parseFloat(t[1]),_=t[1].split(";");let N=1;if(_.length===2&&(N=parseFloat(_[1]),isFinite(N)||(N=1)),isFinite(A)&&isFinite(f)){const T=D.pentate(A,f,N);return this.sign=T.sign,this.layer=T.layer,this.mag=T.mag,this}}const l=e.split("^^");if(l.length===2){const A=parseFloat(l[0]),f=parseFloat(l[1]),_=l[1].split(";");let N=1;if(_.length===2&&(N=parseFloat(_[1]),isFinite(N)||(N=1)),isFinite(A)&&isFinite(f)){const T=D.tetrate(A,f,N);return this.sign=T.sign,this.layer=T.layer,this.mag=T.mag,this}}const i=e.split("^");if(i.length===2){const A=parseFloat(i[0]),f=parseFloat(i[1]);if(isFinite(A)&&isFinite(f)){const _=D.pow(A,f);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,this}}e=e.trim().toLowerCase();let o,r,d=e.split("pt");if(d.length===2){o=10,r=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let A=parseFloat(d[1]);if(isFinite(A)||(A=1),isFinite(o)&&isFinite(r)){const f=D.tetrate(o,r,A);return this.sign=f.sign,this.layer=f.layer,this.mag=f.mag,this}}if(d=e.split("p"),d.length===2){o=10,r=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let A=parseFloat(d[1]);if(isFinite(A)||(A=1),isFinite(o)&&isFinite(r)){const f=D.tetrate(o,r,A);return this.sign=f.sign,this.layer=f.layer,this.mag=f.mag,this}}const c=e.split("e"),m=c.length-1;if(m===0){const A=parseFloat(e);if(isFinite(A))return this.fromNumber(A)}else if(m===1){const A=parseFloat(e);if(isFinite(A)&&A!==0)return this.fromNumber(A)}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let A="";for(let f=0;f<p[1].length;++f){const _=p[1].charCodeAt(f);if(_>=43&&_<=57||_===101)A+=p[1].charAt(f);else return this.layer=parseFloat(A),this.mag=parseFloat(p[1].substr(f+1)),this.normalize(),this}}if(m<1)return this.sign=0,this.layer=0,this.mag=0,this;const w=parseFloat(c[0]);if(w===0)return this.sign=0,this.layer=0,this.mag=0,this;let b=parseFloat(c[c.length-1]);if(m>=2){const A=parseFloat(c[c.length-2]);isFinite(A)&&(b*=Math.sign(A),b+=Sa(A))}if(!isFinite(w))this.sign=c[0]==="-"?-1:1,this.layer=m,this.mag=b;else if(m===1)this.sign=Math.sign(w),this.layer=1,this.mag=b+Math.log10(Math.abs(w));else if(this.sign=Math.sign(w),this.layer=m,m===2){const A=D.mul(Ae(1,2,b),k(w));return this.sign=A.sign,this.layer=A.layer,this.mag=A.mag,this}else this.mag=b;return this.normalize(),this}fromValue(e){return e instanceof D||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:kl(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:kl(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<=Ka?(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):kl(this.m,e)+"e"+kl(this.e,e):this.layer===1?kl(this.m,e)+"e"+kl(this.e,e):this.layer<=Ka?(this.sign===-1?"-":"")+"e".repeat(this.layer)+kl(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+kl(this.mag,e)}abs(){return Te(this.sign===0?0:1,this.layer,this.mag)}neg(){return Te(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?D.dZero:this.layer===0?Ae(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?D.dZero:this.layer===0?Ae(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?D.dZero:this.layer===0?Ae(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?D.dZero:this.layer===0?Ae(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=k(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 Te(0,0,0);let l,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(D.cmpabs(this,t)>0?(l=this,i=t):(l=t,i=this),l.layer===0&&i.layer===0)return k(l.sign*l.mag+i.sign*i.mag);const o=l.layer*Math.sign(l.mag),r=i.layer*Math.sign(i.mag);if(o-r>=2)return l;if(o===0&&r===-1){if(Math.abs(i.mag-Math.log10(l.mag))>_a)return l;{const d=Math.pow(10,Math.log10(l.mag)-i.mag),c=i.sign+l.sign*d;return Ae(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}if(o===1&&r===0){if(Math.abs(l.mag-Math.log10(i.mag))>_a)return l;{const d=Math.pow(10,l.mag-Math.log10(i.mag)),c=i.sign+l.sign*d;return Ae(Math.sign(c),1,Math.log10(i.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(l.mag-i.mag)>_a)return l;{const d=Math.pow(10,l.mag-i.mag),c=i.sign+l.sign*d;return Ae(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(k(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=k(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return Te(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return Te(this.sign*t.sign,0,1);let l,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(l=this,i=t):(l=t,i=this),l.layer===0&&i.layer===0)return k(l.sign*i.sign*l.mag*i.mag);if(l.layer>=3||l.layer-i.layer>=2)return Ae(l.sign*i.sign,l.layer,l.mag);if(l.layer===1&&i.layer===0)return Ae(l.sign*i.sign,1,l.mag+Math.log10(i.mag));if(l.layer===1&&i.layer===1)return Ae(l.sign*i.sign,1,l.mag+i.mag);if(l.layer===2&&i.layer===1){const o=Ae(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(Ae(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Ae(l.sign*i.sign,o.layer+1,o.sign*o.mag)}if(l.layer===2&&i.layer===2){const o=Ae(Math.sign(l.mag),l.layer-1,Math.abs(l.mag)).add(Ae(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Ae(l.sign*i.sign,o.layer+1,o.sign*o.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=k(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?D.dNaN:this.layer===0?Ae(this.sign,0,1/this.mag):Ae(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=k(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=k(e),l=this.mag>0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return l>i?1:l<i?-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=k(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=k(e);return this.lt(t)?t:this}min(e){const t=k(e);return this.gt(t)?t:this}maxabs(e){const t=k(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=k(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=k(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=k(e);if(t==null&&(t=1e-7),this.sign!==l.sign||Math.abs(this.layer-l.layer)>1)return!1;let i=this.mag,o=l.mag;return this.layer>l.layer&&(o=Sa(o)),this.layer<l.layer&&(i=Sa(i)),Math.abs(i-o)<=t*Math.max(Math.abs(i),Math.abs(o))}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=k(e);return!this.eq_tolerance(l,t)&&this.lt(l)}lte_tolerance(e,t){const l=k(e);return this.eq_tolerance(l,t)||this.lt(l)}gt_tolerance(e,t){const l=k(e);return!this.eq_tolerance(l,t)&&this.gt(l)}gte_tolerance(e,t){const l=k(e);return this.eq_tolerance(l,t)||this.gt(l)}pLog10(){return this.lt(D.dZero)?D.dZero:this.log10()}absLog10(){return this.sign===0?D.dNaN:this.layer>0?Ae(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Ae(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?D.dNaN:this.layer>0?Ae(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Ae(this.sign,0,Math.log10(this.mag))}log(e){return e=k(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?D.dNaN:this.layer===0&&e.layer===0?Ae(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):D.div(this.log10(),e.log10())}log2(){return this.sign<=0?D.dNaN:this.layer===0?Ae(this.sign,0,Math.log2(this.mag)):this.layer===1?Ae(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Ae(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Ae(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?D.dNaN:this.layer===0?Ae(this.sign,0,Math.log(this.mag)):this.layer===1?Ae(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Ae(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Ae(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=k(e),l=this,i=t;if(l.sign===0)return i.eq(0)?Te(1,0,1):l;if(l.sign===1&&l.layer===0&&l.mag===1)return l;if(i.sign===0)return Te(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return l;const o=l.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?o.neg():Math.abs(i.toNumber()%2)%2===0?o:D.dNaN:o}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return D.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 Ae(1,0,t);if(e.sign===0)return D.dOne;e=Te(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Ae(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Ae(-e.sign,e.layer+1,-e.mag):D.dOne}pow_base(e){return k(e).pow(this)}root(e){const t=k(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?D.exp(D.mul(this,D.ln(this).sub(1))):D.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(Te(1,0,24)))return k(Kn(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 i=e,o=12*i,r=1/o,d=t+r;if(d===t||(t=d,i=i*l,o=360*i,r=1/o,d=t-r,d===t))return D.exp(t);t=d,i=i*l,o=1260*i;let c=1/o;return t=t+c,i=i*l,o=1680*i,c=1/o,t=t-c,D.exp(t)}else return this.layer===1?D.exp(D.mul(this,D.ln(this).sub(1))):D.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?D.dOne:this.layer===0&&this.mag<=709.7?k(Math.exp(this.sign*this.mag)):this.layer===0?Ae(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Ae(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Ae(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return k(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Ae(1,2,Math.log10(this.mag)-.3010299956639812);{const e=D.div(Te(this.sign,this.layer-1,this.mag),Te(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=Te(1,0,1)){if(e===1)return D.pow(this,t);if(e===0)return new D(t);if(this.eq(D.dOne))return D.dOne;if(this.eq(-1))return D.pow(this,t);if(e===Number.POSITIVE_INFINITY){const o=this.toNumber();if(o<=1.444667861009766&&o>=.06598803584531254){if(o>1.444667861009099)return new D(Math.E);const r=D.ln(this).neg();return r.lambertw().div(r)}else return o>1.444667861009766?new D(Number.POSITIVE_INFINITY):D.dNaN}if(this.eq(D.dZero)){let o=Math.abs((e+1)%2);return o>1&&(o=2-o),new D(o)}if(e<0)return D.iteratedlog(t,this,-e);t=k(t);const l=e;e=Math.trunc(e);const i=l-e;if(this.gt(D.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let o=0;o<e;++o){const r=t;if(t=this.pow(t),r.eq(t))return t}if(i!=0){const o=this.pow(t);return t.mul(1-i).add(o.mul(i))}return t}i!==0&&(t.eq(D.dOne)?this.gt(10)?t=this.pow(i):(t=k(D.tetrate_critical(this.toNumber(),i)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let o=0;o<e;++o){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return Te(t.sign,t.layer+(e-o-1),t.mag);if(o>1e4)return t}return t}iteratedexp(e=2,t=Te(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return D.tetrate(e,-t,this);e=k(e);let l=k(this);const i=t;t=Math.trunc(t);const o=i-t;if(l.layer-e.layer>3){const r=Math.min(t,l.layer-e.layer-3);t-=r,l.layer-=r}for(let r=0;r<t;++r){if(l=l.log(e),!isFinite(l.layer)||!isFinite(l.mag))return l.normalize();if(r>1e4)return l}return o>0&&o<1&&(e.eq(10)?l=l.layeradd10(-o):l=l.layeradd(-o,e)),l}slog(e=10){if(e=k(e),e.lte(D.dZero)||e.eq(D.dOne))return D.dNaN;if(e.lt(D.dOne))return this.eq(D.dOne)?D.dZero:this.eq(D.dZero)?D.dNegOne:D.dNaN;if(this.mag<0||this.eq(D.dZero))return D.dNegOne;let t=0,l=k(this);if(l.layer-e.layer>3){const i=l.layer-e.layer-3;t+=i,l.layer-=i}for(let i=0;i<100;++i)if(l.lt(D.dZero))l=D.pow(e,l),t-=1;else{if(l.lte(D.dOne))return k(t+D.slog_critical(e.toNumber(),l.toNumber()));t+=1,l=D.log(l,e)}return k(t)}static slog_critical(e,t){return e>10?t-1:D.critical_section(e,t,zn)}static tetrate_critical(e,t){return D.critical_section(e,t,Wn)}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 i=0,o=0;for(let c=0;c<Pl.length;++c)if(Pl[c]==e){i=l[c][Math.floor(t)],o=l[c][Math.ceil(t)];break}else if(Pl[c]<e&&Pl[c+1]>e){const m=(e-Pl[c])/(Pl[c+1]-Pl[c]);i=l[c][Math.floor(t)]*(1-m)+l[c+1][Math.floor(t)]*m,o=l[c][Math.ceil(t)]*(1-m)+l[c+1][Math.ceil(t)]*m;break}const r=t-Math.floor(t);return i*(1-r)+o*r}layeradd10(e){e=D.fromValue_noAlloc(e).toNumber();const t=k(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 i=0;i<100;++i){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 i=this.slog(t).toNumber()+e;return i>=0?D.tetrate(t,i):Number.isFinite(i)?i>=-1?D.log(D.tetrate(t,i+1),t):D.log(D.log(D.tetrate(t,i+2),t),t):D.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return k(Xa(this.toNumber()));if(this.layer===0)return k(Xa(this.sign*this.mag));if(this.layer===1)return Ya(this);if(this.layer===2)return Ya(this);if(this.layer>=3)return Te(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return Te(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=Te(1,0,1)){t=k(t);const l=e;e=Math.trunc(e);const i=l-e;i!==0&&(t.eq(D.dOne)?(++e,t=new D(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let o=0;o<e;++o){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(o>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?k(Math.sin(this.sign*this.mag)):Te(0,0,0)}cos(){return this.mag<0?D.dOne:this.layer===0?k(Math.cos(this.sign*this.mag)):Te(0,0,0)}tan(){return this.mag<0?this:this.layer===0?k(Math.tan(this.sign*this.mag)):Te(0,0,0)}asin(){return this.mag<0?this:this.layer===0?k(Math.asin(this.sign*this.mag)):Te(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?k(Math.acos(this.toNumber())):this.layer===0?k(Math.acos(this.sign*this.mag)):Te(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?k(Math.atan(this.sign*this.mag)):k(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 D.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return D.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?Te(Number.NaN,Number.NaN,Number.NaN):D.ln(this.add(1).div(k(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(D.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 a=D;a.dZero=Te(0,0,0);a.dOne=Te(1,0,1);a.dNegOne=Te(-1,0,1);a.dTwo=Te(1,0,2);a.dTen=Te(1,0,10);a.dNaN=Te(Number.NaN,Number.NaN,Number.NaN);a.dInf=Te(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);a.dNegInf=Te(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);a.dNumberMax=Ae(1,0,Number.MAX_VALUE);a.dNumberMin=Ae(1,0,Number.MIN_VALUE);const Xn=new a(1);function zl(e,t,l=!0){let i=a.log10(e).floor(),o=a.div(e,a.pow(10,i));o.toStringWithDecimalPlaces(t)==="10"&&(o=Xn,i=i.add(1));const r=i.gte(1e9)?Ee(i,Math.max(Math.max(t,3),je.defaultDecimalsShown)):i.gte(1e4)?pa(i,0):i.toStringWithDecimalPlaces(0);return l?o.toStringWithDecimalPlaces(t)+"e"+r:"e"+r}function pa(e,t){if(e==null)return"NaN";if(e=new a(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function yi(e,t){return e==null?"NaN":(e=new a(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),je.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Yn=new a("eeee1000"),Zn=new a("e100000"),Za=new a("e1000"),hi=new a(1e9),eo=new a(1e6),to=new a(1e3),lo=new a(.98),ao=new a(.001),bi=new a(0);function Ee(e,t,l){if(t==null&&(t=je.defaultDecimalsShown),l=l!=null?l:je.defaultShowSmall,e=new a(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ee(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Yn)){const i=e.slog();return i.gte(eo)?"F"+Ee(i.floor()):a.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+pa(i.floor(),0)}else{if(e.gte(Zn))return zl(e,0,!1);if(e.gte(Za))return zl(e,0);if(e.gte(hi))return zl(e,t);if(e.gte(to))return pa(e,0);if(e.gte(ao)||!l)return yi(e,t);if(e.eq(bi))return 0 .toFixed(t)}return e=wi(e),e.lt(Za)?zl(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ee(e,t)+"\u207B\xB9"}function ke(e){return e=new a(e),e.sign<0?"-"+ke(e.neg()):e.gte(hi)||e.lte(lo)&&!e.eq(bi)?Ee(e):Ee(e,0)}function Pa(e,t){return t==null&&(t=je.defaultDecimalsShown),a.lt(e,0)?"-"+Pa(a.neg(e),t):a.gt(e,2**51)?Ee(a.div(e,31536e3))+"y":(e=new a(e).toNumber(),e<60?Ee(e)+"s":e<3600?ke(Math.floor(e/60))+"m "+Ee(e%60,t)+"s":e<86400?ke(Math.floor(e/3600))+"h "+ke(Math.floor(e/60)%60)+"m "+ke(e%60)+"s":e<31536e3?ke(Math.floor(e/84600)%365)+"d "+ke(Math.floor(e/3600)%24)+"h "+ke(Math.floor(e/60)%60)+"m":ke(Math.floor(e/31536e3))+"y "+ke(Math.floor(e/84600)%365)+"d "+ke(Math.floor(e/3600)%24)+"h")}function io(e,t,l){e=new a(e);let i=e.toStringWithDecimalPlaces(t);return new a(i).gte(l)&&(i=a.sub(l,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function no(e,t){return Ee(e,t,!0)}function wi(e){let t=a.log10(e).ceil();const l=a.div(e,a.pow(10,t));return t=t.neg(),e=new a(10).pow(t).times(l),e}function Ai(e,t,l=a.dOne){let i=e[0][0],o=e[0][1];for(let r=1;r<e.length;r++)a.lt(e[r][0],i)&&(i=e[r][0],o=e[r][1]);return Ee(a.times(i,l))+t+", limited by "+o}function ki(e){return{[-1]:`${Ee(e)}/s`,0:"",1:`+${Ee(e)}/s`}[a.compare(e,0)]}var oo=Object.freeze(Object.defineProperty({__proto__:null,default:a,exponentialFormat:zl,commaFormat:pa,regularFormat:yi,format:Ee,formatWhole:ke,formatTime:Pa,toPlaces:io,formatSmall:no,invertOOM:wi,formatLimit:Ai,formatGain:ki},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:so,commaFormat:ro,regularFormat:uo,format:j,formatWhole:X,formatTime:aa,toPlaces:co,formatSmall:po,formatLimit:Ci,invertOOM:mo,formatGain:ma}=oo;window.Decimal=a;window.exponentialFormat=so;window.commaFormat=ro;window.regularFormat=uo;window.format=j;window.formatWhole=X;window.formatTime=aa;window.toPlaces=co;window.formatSmall=po;window.formatLimit=Ci;window.invertOOM=mo;window.formatGain=ma;function Ei(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Ta(e){return typeof e=="function"}var Fe=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(Fe||{});const Yl=Symbol("DoNotCache");function z(e,t){const l=e[t];Ta(l)&&l.length===0&&!l[Yl]?e[t]=v(l.bind(e)):Ta(l)&&(e[t]=l.bind(e),e[t][Yl]=!0)}function kt(e){return Ta(e)&&!e[Yl]&&(e=v(e)),e}const xl=Symbol("Component"),Nl=Symbol("GatherProps");let vo=0;function Hl(e="feature-"){return e+vo++}var At=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(At||{});function S(e){return e[Yl]=!0,e}function y(e,t=2){return e?0:t}function xt(e,t,l){e[t]===void 0&&l!=null&&(e[t]=l)}function _i(e,...t){const l=[],i=o=>{Object.keys(o).forEach(r=>{const d=o[r];d&&typeof d=="object"&&(t.includes(d.type)?l.push(d):!(d instanceof a)&&!bt(d)&&i(d))})};return i(e),l}const Fl={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 Fa=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Fa||{}),Vl={classic:Fl,paper:{...Fl,variables:{...Fl.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:{...Fl,variables:{...Fl.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:{...Fl,variables:{...Fl.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const et=vi();document.fonts.onloadingdone=()=>et.emit("fontsLoaded");var fo=Object.freeze(Object.defineProperty({__proto__:null,globalBus:et},Symbol.toStringTag,{value:"Module"}));var Ve=(e,t)=>{const l=e.__vccOpts||e;for(const[i,o]of t)l[i]=o;return l};const go=Ce({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var w;const l=H({}),i=new ResizeObserver(c),o=H(null);ga(()=>{const b=o.value;b!=null&&i.observe(b)});let r=!0,d=H((w=o.value)==null?void 0:w.getBoundingClientRect());function c(){r&&(r=!1,Rl(()=>{var b;d.value=(b=o.value)==null?void 0:b.getBoundingClientRect(),Object.values(l.value).filter(A=>A).forEach(A=>A.rect=A.element.getBoundingClientRect()),t("updateNodes",l.value),r=!0}))}et.on("fontsLoaded",c);const m={attributes:!1,childList:!0,subtree:!1};sa(Ua,(b,A)=>{const f=new MutationObserver(()=>p(b));f.observe(A,m),l.value[b]={element:A,observer:f,rect:A.getBoundingClientRect()},c()}),sa(Ra,b=>{var A;(A=l.value[b])==null||A.observer.disconnect(),l.value[b]=void 0,c()}),sa(Oa,l),sa(qa,d);function p(b){const A=l.value[b];A!=null&&(A.rect=A.element.getBoundingClientRect(),t("updateNodes",l.value))}return(b,A)=>(C(),I(M,null,[Xt(b.$slots,"default",{},void 0,!0),h("div",{ref_key:"resizeListener",ref:o,class:"resize-listener"},null,512)],64))}});var Si=Ve(go,[["__scopeId","data-v-2b1dc1bc"]]);const yo=["onPointerdown"],ho={class:"modal-wrapper"},bo={class:"modal-container"},wo={class:"modal-header"},Ao=s(" default header "),ko={class:"modal-body"},Co=s(" default body "),Eo={class:"modal-footer"},_o=h("div",{class:"modal-default-flex-grow"},null,-1),Ct=Ce({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:l}){const o=Nt(e),r=v(()=>o.modelValue||c.value);function d(){l("update:modelValue",!1)}const c=H(!1),m=H(null),p=v(()=>{var w,b;return(b=(w=m.value)==null?void 0:w.nodes)!=null?b:null});return t({isOpen:r,nodes:p}),(w,b)=>(C(),be(nn,{to:"#modal-root"},[n(ha,{name:"modal",onBeforeEnter:b[0]||(b[0]=A=>c.value=!0),onAfterLeave:b[1]||(b[1]=A=>c.value=!1)},{default:ge(()=>[ya(h("div",Ol({class:"modal-mask",onPointerdown:Xl(d,["self"])},w.$attrs),[h("div",ho,[h("div",bo,[h("div",wo,[Xt(w.$slots,"header",{shown:u(r)},()=>[Ao])]),h("div",ko,[n(Si,{ref_key:"contextRef",ref:m},{default:ge(()=>[Xt(w.$slots,"body",{shown:u(r)},()=>[Co])]),_:3},512)]),h("div",Eo,[Xt(w.$slots,"footer",{shown:u(r)},()=>[h("div",{class:"modal-default-footer"},[_o,h("button",{class:"button modal-default-button",onClick:d}," Close ")])])])])])],16,yo),[[ci,e.modelValue]])]),_:3})]))}}),Ua=Symbol("RegisterNode"),Ra=Symbol("UnregisterNode"),Oa=Symbol("Nodes"),qa=Symbol("Bounds"),Bt=ba({});window.layers=Bt;const Ll={},ll=[];function $t(e,t){return Ht(()=>{const l={},i=l.emitter=vi();if(l.on=i.on.bind(i),l.emit=i.emit.bind(i),l.nodes=H({}),l.id=e,ll.push(e),Ll[e]=new Set,l.minimized=Me(!1),Object.assign(l,t.call(l)),ll[ll.length-1]==null||ll[ll.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${ll}
Trying to pop ${l.id}`;return ll.pop(),z(l,"color"),z(l,"display"),z(l,"name"),xt(l,"name",l.id),z(l,"minWidth"),xt(l,"minWidth",600),z(l,"minimizable"),xt(l,"minimizable",!0),l})}function Mi(e,t){if(console.info("Adding layer",e.id),Bt[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Bt[e.id]);return}xt(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Bt[e.id]=e,et.emit("addLayer",e,t.layers[e.id])}function So(e){return Bt[e]}function Bi(e){console.info("Removing layer",e.id),et.emit("removeLayer",e),Bt[e.id]=void 0}function Mo(e){Bi(e),Mi(e,me)}function Bo(e){const t=H(!1);return{openModal:()=>t.value=!0,modal:S(()=>n(Ct,{modelValue:t.value,"onUpdate:modelValue":l=>t.value=l},{header:()=>n("h2",null,[u(e.name)]),body:u(e.display)}))}}et.on("update",function(t){Object.values(Bt).forEach(l=>{l==null||l.emit("preUpdate",t)}),Object.values(Bt).forEach(l=>{l==null||l.emit("update",t)}),Object.values(Bt).forEach(l=>{l==null||l.emit("postUpdate",t)})});var xo=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Ua,UnregisterNodeInjectionKey:Ra,NodesInjectionKey:Oa,BoundsInjectionKey:qa,layers:Bt,persistentRefs:Ll,addingLayers:ll,createLayer:$t,addLayer:Mi,getLayer:So,removeLayer:Bi,reloadLayer:Mo,setupLayerModal:Bo},Symbol.toStringTag,{value:"Module"}));const La=Symbol("PersistentState"),_l=Symbol("DefaultValue"),va=Symbol("StackTrace"),xi=Symbol("Deleted"),Zl=Symbol("NonPersistent"),Kl=Symbol("SaveDataPath");function No(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function Me(e){const t=bt(e)?e:H(e);t[La]=t,t[_l]=bt(e)?e.value:e,t[va]=No(),t[xi]=!1;const l=v({get(){return t.value},set(i){t.value=i}});return l[_l]=t[_l],t[Zl]=l,t[Kl]=void 0,ll.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[va]):Ll[ll[ll.length-1]].add(t),t}function Do(e){return e&&typeof e=="object"&&La in e}function R(e){return e[Zl]}et.on("addLayer",(e,t)=>{const l=[],i=(o,r=[])=>{let d=!1;return Object.keys(o).forEach(c=>{let m=o[c];if(m&&typeof m=="object")if(mt in m&&(m=m[mt]),Do(m)){if(d=!0,m[xi]){console.warn("Deleted persistent ref present in returned object. Ignoring...",m,`
Created at:
`+m[va]);return}Ll[e.id].delete(m);const p=[e.id,...r,c];m[Kl]!=null&&JSON.stringify(p)!==JSON.stringify(m[Kl])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${m[Kl].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,m),m[Kl]=p;const w=r.reduce((A,f)=>(f in A||(A[f]={}),A[f]),t),b=w[c];w[c]=m[La],on(w)?b!=null?w[c]=b:w[c]=m[_l]:b!=null?w[c].value=b:w[c].value=m[_l]}else!(m instanceof a)&&!bt(m)&&!l.includes(m)&&(typeof m.type=="symbol"&&l.push(m),i(m,[...r,c])&&(Ia(m)&&!Ia(o)?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.",mt in o?o[mt]:o,c):d=!0))}),d};i(e[mt]),Ll[e.id].forEach(o=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,o,`
Created at:
`+o[va])}),Ll[e.id].clear()});const mt=Symbol("ProxyState"),ql=Symbol("ProxyPath");function Ht(e,t={}){const l=t;let i=!1;function o(){return i||(Object.assign(l,e(l)),i=!0),l}return new Proxy(l,{get(r,d){if(d===mt)return o();const c=o()[d];return c&&typeof c=="object"&&Zl in c?c[Zl]:c},set(r,d,c){return o()[d]=c,!0},has(r,d){return d===mt?!0:Reflect.has(o(),d)},ownKeys(){return Reflect.ownKeys(o())},getOwnPropertyDescriptor(r,d){return i||(Object.assign(l,e(l)),i=!0),Object.getOwnPropertyDescriptor(r,d)}})}var ft=window.state=ba({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Ni=la({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{},usingLog:!1});function Di(e){return JSON.stringify(e,(t,l)=>u(l))}const Ii={get(e,t){var i;if(t===mt||t===ql)return e[t];const l=e[mt][t];if(t!=="value"&&(pn(l)||Array.isArray(l))){if(l!==((i=e[t])==null?void 0:i[mt])){const o=[...e[ql],t];e[t]=new Proxy({[mt]:l,[ql]:o},Ii)}return e[t]}return l},set(e,t,l,i){if(!ft.hasNaN&&(typeof l=="number"&&isNaN(l)||l instanceof a&&(isNaN(l.sign)||isNaN(l.layer)||isNaN(l.mag)))){const o=e[mt][t];if(!(typeof o=="number"&&isNaN(o)||o instanceof a&&(isNaN(o.sign)||isNaN(o.layer)||isNaN(o.mag))))throw Ni.autosave=!1,ft.hasNaN=!0,ft.NaNPath=[...e[ql],t],ft.NaNReceiver=i,console.error("Attempted to set NaN value",[...e[ql],t],e[mt]),"Attempted to set NaN value. See above for details"}return e[mt][t]=l,!0},ownKeys(e){return Reflect.ownKeys(e[mt])},has(e,t){return Reflect.has(e[mt],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[mt],t)}};var me=window.player=new Proxy({[mt]:Ni,[ql]:["player"]},Ii);function Ti(e={}){return Object.assign({id:`${je.id}-0`,name:"Default Save",tabs:je.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:je.id,modVersion:je.versionNumber,layers:{}},e)}function al(e){const t=Cl.compressToUTF16(Di(e!=null?e:me[mt]));return localStorage.setItem((e!=null?e:me[mt]).id,t),t}async function Io(){Po();try{let e=localStorage.getItem(ct.active);if(e==null){await Ul(Gl());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Cl.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==je.id){await Ul(Gl());return}t.id=ct.active,await Ul(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await Ul(Gl())}}function Gl(){const e=ua(),t=Ti({id:e});return al(t),ct.saves.push(e),t}function ua(){let e,t=0;do e=`${je.id}-${t++}`;while(localStorage.getItem(e));return e}const Ga=H(!1);async function Ul(e){console.info("Loading save",e),Ga.value=!0;const{layers:t,removeLayer:l,addLayer:i}=await ca(()=>Promise.resolve().then(function(){return xo}),void 0),{fixOldSave:o,getInitialLayers:r}=await ca(()=>Promise.resolve().then(function(){return Ir}),void 0);for(const d in t){const c=t[d];c&&l(c)}r(e).forEach(d=>i(d,e)),e=Ti(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,je.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==je.versionNumber&&(o(e.modVersion,e),e.modVersion=je.versionNumber),Object.assign(me,e),ct.active=me.id,et.emit("onLoad")}setInterval(()=>{me.autosave&&al()},1e3);window.onbeforeunload=()=>{me.autosave&&al()};window.save=al;const To=window.hardReset=async()=>{await Ul(Gl())},ea=la({active:"",saves:[],showTPS:!0,theme:Fa.Nordic,unthrottled:!1});jt(ea,e=>{const t=Cl.compressToUTF16(JSON.stringify(e));localStorage.setItem(je.id,t)},{deep:!0});var ct=window.settings=ea;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Fa.Nordic};et.emit("loadSettings",e),Object.assign(ea,e),To()};function Po(){try{let e=localStorage.getItem(je.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Cl.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(ea,t)}et.emit("loadSettings",ea)}catch{}}const Pi=la([]);function Fo(e){Pi.push(e)}const Fi=la([]);function Uo(e){Fi.push(e)}const Ro=la([]),Oo={class:"table"},Qt=Ce({__name:"Column",setup(e){const t=v(()=>Vl[ct.theme].mergeAdjacent);return(l,i)=>(C(),I("div",Oo,[h("div",{class:ht(["col",{mergeAdjacent:u(t)}])},[Xt(l.$slots,"default")],2)]))}}),qo={class:"table"},$l=Ce({__name:"Row",setup(e){const t=v(()=>Vl[ct.theme].mergeAdjacent);return(l,i)=>(C(),I("div",qo,[h("div",{class:ht(["row",{mergeAdjacent:u(t)}])},[Xt(l.$slots,"default")],2)]))}});function Qa(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!sn(e)}function He(e,t="span"){return typeof e=="function"?Ce({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),Ce({template:e})):Ce({render:()=>({})}):e}function ce(e){if(fl(e))return typeof e=="function"?e():He(e);const t=e[xl];return n(t,e[Nl](),null)}function at(...e){let t;return n($l,null,Qa(t=e.map(ce))?t:{default:()=>[t]})}function Zt(...e){let t;return n(Qt,null,Qa(t=e.map(ce))?t:{default:()=>[t]})}function Sl(...e){return n("div",{class:"table-grid"},[e.map(t=>n("div",{class:{["row-grid"]:!0,mergeAdjacent:Vl[ct.theme].mergeAdjacent}},[t.map(ce)]))])}function nl(e){if(fl(e))return typeof e=="function"?e():typeof e=="string"?n(M,null,[e]):n(e,null,null);const t=e[xl];return n(t,e[Nl](),null)}function Lo(...e){let t;return n(Qt,null,Qa(t=e.map(nl))?t:{default:()=>[t]})}function fl(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Yl]===!0}function Ui(e,t,l){const i=H(null),o=H(void 0);function r(m){i.value||(i.value=setInterval(c,250)),o.value=m,l&&(l.value=!0)}function d(){i.value&&(clearInterval(i.value),i.value=null),l&&(l.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(o.value)}return pi(d),{start:r,stop:d,handleHolding:c}}function Go(e,t){const l=v(()=>e.filter(i=>u(i.visibility)===At.Visible&&t(i)));return{firstFeature:v(()=>l.value[0]),collapsedContent:S(()=>Zt(...l.value.slice(1))),hasCollapsedContent:v(()=>l.value.length>1)}}function fa(e,t="div"){const l=Yt();return Vt(()=>{l.value=He(_t(e),t)}),l}function Bl(e,t="div"){const l=Yt(null);return Vt(()=>{const i=_t(e);l.value=i==null?null:He(i,t)}),l}function Qo(e){return v(()=>_t(e))}function _t(e){return u(u(e))}function Y(...e){return e.includes(Object)||e.push(Object),e}const _e=Ce({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,l)=>(C(),I("div",{style:wt({width:e.width,height:e.height})},null,4))}});const $o={},Ho={class:"notif"};function Vo(e,t){return C(),I("div",Ho,"!")}var ei=Ve($o,[["render",Vo],["__scopeId","data-v-66323fd4"]]),jo=Ce({props:{element:Object,display:{type:Y(Object,String,Function),required:!0},style:Y(Object,String,Array),classes:Y(Object),direction:Y(String),xoffset:Y(String),yoffset:Y(String),pinned:Object},setup(e){const{element:t,display:l,pinned:i}=Nt(e),o=H(!1),r=v(()=>(_t(i)||o.value)&&d.value),d=Bl(l),c=Yt(He(S(()=>{const w=_t(t);return w==null?"":nl(w)})));function m(w){const b=i;w.shiftKey&&b&&(b.value=!b.value,w.stopPropagation(),w.preventDefault())}const p=v(()=>_t(i)&&Vl[ct.theme].showPin);return{Direction:Fe,isHovered:o,isShown:r,comp:d,elementComp:c,unref:u,togglePinned:m,showPin:p}}});const Jo={key:0,class:"material-icons pinned"};function Wo(e,t,l,i,o,r){return C(),I("div",{class:ht(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=d=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=d=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...d)=>e.togglePinned&&e.togglePinned(...d))},[Xt(e.$slots,"default",{},void 0,!0),e.elementComp?(C(),be(pt(e.elementComp),{key:0})):G("",!0),n(ha,{name:"fade"},{default:ge(()=>{var d;return[e.isShown?(C(),I("div",{key:0,class:ht(["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:wt([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(d=e.unref(e.style))!=null?d:{}])},[e.showPin?(C(),I("span",Jo,"push_pin")):G("",!0),e.comp?(C(),be(pt(e.comp),{key:1})):G("",!0)],6)):G("",!0)]}),_:1})],34)}var gt=Ve(jo,[["render",Wo],["__scopeId","data-v-6102fa3a"]]);const wa=e=>(gl("data-v-14ecc7bd"),e=e(),yl(),e),zo={key:0,class:"day feature dontMerge opened"},Ko={class:"date"},Xo=s("Dec"),Yo=wa(()=>h("br",null,null,-1)),Zo={class:"date"},es=s("Dec"),ts=wa(()=>h("br",null,null,-1)),ls=wa(()=>h("div",{class:"doors"},null,-1)),as={class:"date"},is=s("Dec"),ns=wa(()=>h("br",null,null,-1)),os={key:0,class:"material-icons lock"},ss={key:1,class:"timer"},rs=Ce({__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,i=v(()=>l.layer&&a.gte(O.day.value,l.day)&&new Date().getMonth()===11&&new Date().getDate()>=l.day);function o(){i.value&&t("unlockLayer")}return(r,d)=>{var c,m,p;return e.opened.value?(C(),I("div",zo,[n(gt,{display:(p=(m=u(Bt)[(c=e.layer)!=null?c:""])==null?void 0:m.name)!=null?p:"",direction:u(Fe).Up,yoffset:"5px"},{default:ge(()=>[n(ha,{appear:"",name:"door"},{default:ge(()=>[h("div",{class:"doors",onClick:d[0]||(d[0]=w=>t("openLayer"))},[h("div",Ko,[Xo,Yo,s(Ie(e.day),1)]),h("div",Zo,[es,ts,s(Ie(e.day),1)])])]),_:1}),h("div",{class:"icon",onClick:d[1]||(d[1]=w=>t("openLayer")),style:wt({backgroundImage:`url(${e.symbol})`})},null,4),h("div",{class:"lore",onClick:d[2]||(d[2]=w=>t("openLore"))},"?"),u(e.shouldNotify)?(C(),be(ei,{key:0})):G("",!0)]),_:1},8,["display","direction"])])):(C(),I("div",{key:1,class:ht(["day feature dontMerge",{can:u(i),locked:!u(i),canOpen:u(i)}]),onClick:o},[ls,h("div",as,[is,ns,s(Ie(e.day),1)]),u(i)?G("",!0):(C(),I("div",os,"lock")),u(O).day.value===e.day&&!u(i)?(C(),I("div",ss,Ie(u(O).timeUntilNewDay.value<0?"NYI, sorry":u(Pa)(u(O).timeUntilNewDay.value,0)),1)):G("",!0),u(i)?(C(),be(ei,{key:2})):G("",!0)],2))}}});var us=Ve(rs,[["__scopeId","data-v-14ecc7bd"]]);const ds=Ce({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,l=fa(ol(t,"display")),i=fa(ol(t,"content"));return(o,r)=>(C(),be(Qt,{class:"collapsible-container"},{default:ge(()=>[h("button",{onClick:r[0]||(r[0]=d=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(C(),be(pt(u(l))))]),e.collapsed.value?G("",!0):(C(),be(pt(u(i)),{key:0}))]),_:1}))}});var cs=Ve(ds,[["__scopeId","data-v-a72c16aa"]]);const ps={key:0},ms={key:0,class:"mark star"},vs=["src"],fs=Ce({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,l)=>e.mark?(C(),I("div",ps,[e.mark===!0?(C(),I("div",ms)):(C(),I("img",{key:1,class:"mark",src:e.mark},null,8,vs))])):G("",!0)}});var Aa=Ve(fs,[["__scopeId","data-v-2207999f"]]);const gs=Ce({__name:"Node",props:{id:null},setup(e){const l=Nt(e),i=da(Ua,()=>{}),o=da(Ra,()=>{}),r=Yt(null),d=v(()=>r.value&&r.value.parentElement);return jt([d,l.id],([c,m],[p,w])=>{p&&o(u(w)),c&&i(m,c)}),pi(()=>o(u(l.id))),(c,m)=>(C(),I("div",{class:"node",ref_key:"node",ref:r},null,512))}});var ia=Ve(gs,[["__scopeId","data-v-a48cb382"]]);const ys=Ce({props:{progress:{type:Y(String,Object,Number),required:!0},width:{type:Y(Number),required:!0},height:{type:Y(Number),required:!0},direction:{type:Y(String),required:!0},display:Y(Object,String,Function),visibility:{type:Y(Number),required:!0},style:Y(Object,String,Array),classes:Y(Object),borderStyle:Y(Object,String,Array),textStyle:Y(Object,String,Array),baseStyle:Y(Object,String,Array),fillStyle:Y(Object,String,Array),mark:Y(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Aa,Node:ia},setup(e){const{progress:t,width:l,height:i,direction:o,display:r}=Nt(e),d=v(()=>{let p=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(p,0),1))*100}),c=v(()=>{const p={width:_t(l)+.5+"px",height:_t(i)+.5+"px"};switch(u(o)){case Fe.Up:p.clipPath=`inset(${d.value}% -2px -2px -2px)`,p.width=_t(l)+2+"px";break;case Fe.Down:p.clipPath=`inset(-2px -2px ${d.value}% -2px)`,p.width=_t(l)+2+"px";break;case Fe.Right:p.clipPath=`inset(-2px ${d.value}% -2px -2px)`;break;case Fe.Left:p.clipPath=`inset(-2px -2px -2px ${d.value} + '%)`;break;case Fe.Default:p.clipPath="inset(-2px 50% -2px -2px)";break}return p}),m=Bl(r);return{normalizedProgress:d,barStyle:c,component:m,unref:u,Visibility:At}}});function hs(e,t,l,i,o,r){var m,p,w,b,A,f,_;const d=Ml("MarkNode"),c=Ml("Node");return e.unref(e.visibility)!==e.Visibility.None?(C(),I("div",{key:0,style:wt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),class:ht({bar:!0,...e.unref(e.classes)})},[h("div",{class:"overlayTextContainer border",style:wt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.borderStyle))!=null?p:{}])},[e.component?(C(),I("span",{key:0,class:"overlayText",style:wt(e.unref(e.textStyle))},[(C(),be(pt(e.component)))],4)):G("",!0)],4),h("div",{class:"border",style:wt([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(w=e.unref(e.style))!=null?w:{},(b=e.unref(e.baseStyle))!=null?b:{},(A=e.unref(e.borderStyle))!=null?A:{}])},[h("div",{class:"fill",style:wt([e.barStyle,(f=e.unref(e.style))!=null?f:{},(_=e.unref(e.fillStyle))!=null?_:{}])},null,4)],4),n(d,{mark:e.unref(e.mark)},null,8,["mark"]),n(c,{id:e.id},null,8,["id"])],6)):G("",!0)}var bs=Ve(ys,[["render",hs],["__scopeId","data-v-730cc7a0"]]);const ws=Symbol("Bar");function el(e){return Ht(()=>{const t=e();return t.id=Hl("bar-"),t.type=ws,t[xl]=bs,z(t,"visibility"),xt(t,"visibility",At.Visible),z(t,"width"),z(t,"height"),z(t,"direction"),z(t,"style"),z(t,"classes"),z(t,"borderStyle"),z(t,"baseStyle"),z(t,"textStyle"),z(t,"fillStyle"),z(t,"progress"),z(t,"display"),z(t,"mark"),t[Nl]=function(){const{progress:l,width:i,height:o,direction:r,display:d,visibility:c,style:m,classes:p,borderStyle:w,textStyle:b,baseStyle:A,fillStyle:f,mark:_,id:N}=this;return{progress:l,width:i,height:o,direction:r,display:d,visibility:c,style:u(m),classes:p,borderStyle:w,textStyle:b,baseStyle:A,fillStyle:f,mark:_,id:N}},t})}var As=Ce({props:{display:{type:Y(Object,String,Function),required:!0},visibility:{type:Y(Number),required:!0},style:Y(Object,String,Array),classes:Y(Object),onClick:Function,onHold:Function,canClick:{type:Y(Boolean),required:!0},small:Boolean,mark:Y(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:ia,MarkNode:Aa},setup(e){const{display:t,onClick:l,onHold:i}=Nt(e),o=Yt("");Vt(()=>{const c=_t(t);if(c==null){o.value="";return}if(fl(c)){o.value=He(c);return}const m=He(c.title||"","h3"),p=He(c.description,"div");o.value=He(S(()=>n("span",null,[c.title?n("div",null,[n(m,null,null)]):null,n(p,null,null)])))});const{start:r,stop:d}=Ui(l,i,e.isHolding);return{start:r,stop:d,comp:o,Visibility:At,unref:u}}});function ks(e,t,l,i,o,r){var m;const d=Ml("MarkNode"),c=Ml("Node");return e.unref(e.visibility)!==e.Visibility.None?(C(),I("button",{key:0,style:wt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:[]]),onClick:t[0]||(t[0]=(...p)=>e.onClick&&e.onClick(...p)),onMousedown:t[1]||(t[1]=(...p)=>e.start&&e.start(...p)),onMouseleave:t[2]||(t[2]=(...p)=>e.stop&&e.stop(...p)),onMouseup:t[3]||(t[3]=(...p)=>e.stop&&e.stop(...p)),onTouchstartPassive:t[4]||(t[4]=(...p)=>e.start&&e.start(...p)),onTouchendPassive:t[5]||(t[5]=(...p)=>e.stop&&e.stop(...p)),onTouchcancelPassive:t[6]||(t[6]=(...p)=>e.stop&&e.stop(...p)),class:ht({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)?(C(),be(pt(e.unref(e.comp)),{key:0})):G("",!0),n(d,{mark:e.unref(e.mark)},null,8,["mark"]),n(c,{id:e.id},null,8,["id"])],38)):G("",!0)}var Ri=Ve(As,[["render",ks],["__scopeId","data-v-8cedd7da"]]);const Cs=Symbol("Clickable");function qt(e){return Ht(()=>{var l;const t=(l=e==null?void 0:e())!=null?l:{};if(t.id=Hl("clickable-"),t.type=Cs,t[xl]=Ri,t.isHolding=H(!1),z(t,"visibility"),xt(t,"visibility",At.Visible),z(t,"canClick"),xt(t,"canClick",!0),z(t,"classes"),z(t,"style"),z(t,"mark"),z(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(o){u(t.canClick)&&i(o)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){u(t.canClick)&&i()}}return t[Nl]=function(){const{display:i,visibility:o,style:r,classes:d,onClick:c,onHold:m,isHolding:p,canClick:w,small:b,mark:A,id:f}=this;return{display:i,visibility:o,style:u(r),classes:d,onClick:c,onHold:m,isHolding:p,canClick:w,small:b,mark:A,id:f}},t})}function yt(e,t="points",l=0,i=void 0){const o=bt(e)?e:Me(e);if(o.displayName=t,o.precision=l,o.small=i,!bt(e)){const r=o[Zl];r.displayName=t,r.precision=l,r.small=i}return o}function ti(e){const t=Me(e.value);return jt(e,l=>{Ga.value||a.gt(l,t.value)&&(t.value=l)}),t}function Es(e){const t=Me(e.value);return jt(e,(l,i)=>{Ga.value||a.gt(l,i)&&(t.value=a.add(t.value,a.sub(l,i)))}),t}new a("10^^8");new a("1e100");function na(e,t){const l=t!=null?t:e.value;return a.eq(e.precision,0)?X(e.small?l:a.floor(l)):j(l,e.precision,e.small)}const _s=["x1","y1","x2","y2"],Ss=Ce({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const l=Nt(e),i=v(()=>{const r=l.startNode.value.rect,d=l.boundingRect.value,c=d?{x:r.x+r.width/2-d.x,y:r.y+r.height/2-d.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}),o=v(()=>{const r=l.endNode.value.rect,d=l.boundingRect.value,c=d?{x:r.x+r.width/2-d.x,y:r.y+r.height/2-d.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(r,d)=>(C(),I("line",Ol({"stroke-width":"15px",stroke:"white"},e.link,{x1:u(i).x,y1:u(i).y,x2:u(o).x,y2:u(o).y}),null,16,_s))}});const Ms=Ce({__name:"Links",props:{links:null},setup(e){var m;const l=ol(e,"links"),i=H(null),o=da(Oa,H({})),r=da(qa,H(void 0)),d=H((m=i.value)==null?void 0:m.getBoundingClientRect());jt(r,()=>{var p;return d.value=(p=i.value)==null?void 0:p.getBoundingClientRect()}),ga(()=>{var p;return d.value=(p=i.value)==null?void 0:p.getBoundingClientRect()});const c=v(()=>{var w,b;const p=o.value;return(b=(w=l.value)==null?void 0:w.filter(A=>{var f,_;return((f=p[A.startNode.id])==null?void 0:f.rect)&&((_=p[A.startNode.id])==null?void 0:_.rect)}))!=null?b:[]});return(p,w)=>(C(),I(M,null,[u(c)?(C(),I("svg",rn(Ol({key:0},p.$attrs)),[(C(!0),I(M,null,mi(u(c),(b,A)=>(C(),be(Ss,{key:A,link:b,boundingRect:d.value,startNode:u(o)[b.startNode.id],endNode:u(o)[b.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):G("",!0),h("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Bs=Ve(Ms,[["__scopeId","data-v-063f6d6b"]]);Ce({props:{nodes:{type:Y(Array),required:!0},leftSideNodes:Y(Array),rightSideNodes:Y(Array),branches:Y(Array)},components:{Links:Bs},setup(e){const{nodes:t,leftSideNodes:l,rightSideNodes:i}=Nt(e),o=Yt();Vt(()=>{const c=_t(t);o.value=He(S(()=>n(M,null,[c.map(m=>n("span",{class:"row tree-row",style:"margin: 50px auto;"},[m.map(nl)]))])))});const r=Yt();Vt(()=>{const c=_t(l);r.value=c?He(S(()=>n("span",{class:"left-side-nodes small"},[c.map(nl)]))):""});const d=Yt();return Vt(()=>{const c=_t(i);d.value=c?He(S(()=>n("span",{class:"side-nodes small"},[c.map(nl)]))):""}),{unref:u,nodesComp:o,leftNodesComp:r,rightNodesComp:d}}});Ce({props:{display:Y(Object,String,Function),visibility:{type:Y(Number),required:!0},style:Y(String,Object,Array),classes:Y(Object),onClick:Function,onHold:Function,color:Y(String),glowColor:Y(String),canClick:{type:Y(Boolean),required:!0},mark:Y(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Aa,Node:ia},setup(e){const{onClick:t,onHold:l,display:i}=Nt(e),o=Bl(i),{start:r,stop:d}=Ui(t,l);return{start:r,stop:d,comp:o,unref:u,Visibility:At,isCoercableComponent:fl}}});function sl(e){const t=[],l={};let i=!1;function o(){return i||(t.push(...e()),l.base=t.map(c=>kt(c.base)),l.baseText=t.map(c=>kt(c.baseText)),l.visible=t.map(c=>kt(c.visible)),i=!0),t}const r=Me({});return[S(()=>{const c=o();let m=!0;const p=c.map((w,b)=>{var N,T,J;if(u(l.visible[b])===!1)return null;const A=n("h3",{onClick:()=>r.value[b]=!r.value[b],style:"cursor: pointer"},[n("span",{class:"modifier-toggle"+(u(r.value[b])?" collapsed":"")},[s("\u25BC")]),w.title,w.subtitle?n("span",{class:"subtitle"},[s(" ("),w.subtitle,s(")")]):null]),f=u(r.value[b])?null:n(M,null,[n("div",{class:"modifier-container"},[n("span",{class:"modifier-description"},[nl((N=u(l.baseText[b]))!=null?N:"Base")]),n("span",{class:"modifier-amount"},[j((T=u(l.base[b]))!=null?T:1),w.unit])]),nl(u(w.modifier.description))]),_=!m;return m=!1,n(M,null,[_?n("br",null,null):null,n("div",null,[A,n("br",null,null),f,n("hr",null,null),n("div",{class:"modifier-container"},[n("span",{class:"modifier-description"},[s("Total")]),n("span",{class:"modifier-amount"},[j(w.modifier.apply((J=u(l.base[b]))!=null?J:1)),w.unit])])])])});return n(M,null,[p])}),r]}function ta(e){const t=Object.values(e).reverse(),l=Me(!0),i=v(()=>t.filter(m=>m.earned.value===!1)),{firstFeature:o,collapsedContent:r,hasCollapsedContent:d}=Go(t,m=>m.earned.value),c=S(()=>{const m=[...i.value];return o.value&&m.push(o.value),Lo(...m,S(()=>ya(n(cs,{collapsed:l,content:r,display:l.value?"Show other completed milestones":"Hide other completed milestones"},null),[[ci,u(d)]])))});return{collapseMilestones:l,display:c}}function hl(e){const t=e.ignoreTotal?e.resource:Es(e.resource),l=()=>{var c,m;if(O.day.value!==e.day)return 1;let r=a.add(t.value,1),d=e.goal;return((m=(c=e.usingLog)==null?void 0:c.value)!=null?m:me.usingLog)&&(r=r.log10(),d=a.log10(d)),a.div(r,d)},i=el(()=>({direction:Fe.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:l,display:S(()=>O.day.value===e.day?n(M,null,[ke(t.value),s("/"),ke(e.goal)]):"")})),o=S(()=>n(M,null,[n("div",null,[O.day.value===e.day?n(M,null,[s("Reach "),ke(e.goal),s(" "),e.ignoreTotal?"":"total ",e.resource.displayName,s(" to complete the day")]):n(M,null,[e.name,s(" Complete!")]),e.modal?n(M,null,[" ",s("-")," ",n("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[s("Check Modifiers")])]):void 0]),ce(i),e.modal?ce(e.modal.display):void 0]));return Vt(()=>{O.day.value===e.day&&a.gte(t.value,e.goal)&&O.completeDay()}),{total:t,trackerDisplay:o}}function il(e){var d;const t=(d=e.style)!=null?d:{minHeight:"20px",width:"40px",color:"var(--foreground)"},l=qt(()=>({display:"0",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=0}})),i=qt(()=>({display:"-",style:t,canClick(){return a.gt(e.active.value,0)},onClick(){e.active.value=a.sub(e.active.value,1)}})),o=qt(()=>({display:"+",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=a.add(e.active.value,1)}})),r=qt(()=>({display:"Max",style:t,canClick(){return a.lt(e.active.value,e.buyable.amount.value)},onClick(){e.active.value=e.buyable.amount.value}}));return{min:l,remove:i,add:o,max:r}}const xs=Symbol("Buyable");function Le(e){const t=Me(0);return Ht(()=>{var r,d,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=Hl("buyable-"),l.type=xs,l[xl]=Ri,l.amount=t,l.amount[_l]=(r=l.initialValue)!=null?r:0,l.canAfford=v(()=>{const m=l,p=u(m.cost);return m.resource!=null&&p!=null&&a.gte(m.resource.value,p)}),l.canPurchase==null&&(l.canPurchase=v(()=>u(l.visibility)===At.Visible&&u(l.canAfford)&&a.lt(l.amount.value,u(l.purchaseLimit)))),l.maxed=v(()=>a.gte(l.amount.value,u(l.purchaseLimit))),z(l,"classes");const i=l.classes;l.classes=v(()=>{const m=u(i)||{};return l.maxed.value&&(m.bought=!0),m}),z(l,"canPurchase"),l.canClick=l.canPurchase,l.onClick=l.purchase=(c=(d=l.onClick)!=null?d:l.purchase)!=null?c:function(){var w;const m=l;if(!u(m.canPurchase))return;const p=u(m.cost);m.cost!=null&&m.resource!=null&&(m.resource.value=a.sub(m.resource.value,p),m.amount.value=a.add(m.amount.value,1)),(w=m.onPurchase)==null||w.call(m,p)},z(l,"display");const o=l.display;return l.display=S(()=>{const m=u(o);if(fl(m)){const p=He(m);return n(p,null,null)}if(m!=null&&l.cost!=null&&l.resource!=null){const p=l,w=He(m.title||"","h3"),b=He(m.description||""),A=He(m.effectDisplay||"");return n("span",null,[m.title?n("div",null,[n(w,null,null)]):null,m.description?n(b,null,null):null,m.showAmount===!1?null:n("div",null,[n("br",null,null),u(p.purchaseLimit)===a.dInf?n(M,null,[s("Amount: "),X(p.amount.value)]):n(M,null,[s("Amount: "),X(p.amount.value),s(" /")," ",X(u(p.purchaseLimit))])]),m.effectDisplay?n("div",null,[n("br",null,null),s("Currently: "),n(A,null,null)]):null,p.cost&&!p.maxed.value?n("div",null,[s("Cost: "),j(u(p.cost)||0)," ",l.resource.displayName]):null])}return""}),z(l,"visibility"),xt(l,"visibility",At.Visible),z(l,"cost"),z(l,"resource"),z(l,"purchaseLimit"),xt(l,"purchaseLimit",a.dInf),z(l,"style"),z(l,"mark"),z(l,"small"),l[Nl]=function(){const{display:m,visibility:p,style:w,classes:b,onClick:A,canClick:f,small:_,mark:N,id:T}=this;return{display:m,visibility:p,style:u(w),classes:b,onClick:A,canClick:f,small:_,mark:N,id:T}},l})}const ka=ba({}),$a=Symbol("Hotkey");function Ql(e){return Ht(()=>{const t=e();return t.type=$a,z(t,"enabled"),xt(t,"enabled",!0),z(t,"description"),t})}et.on("addLayer",e=>{_i(e,$a).forEach(t=>{ka[t.key]=t})});et.on("removeLayer",e=>{_i(e,$a).forEach(t=>{ka[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||ja.value&&!me.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const l=ka[t];l&&u(l.enabled)&&(e.preventDefault(),l.onPress())};Uo(S(()=>{const e=Object.values(ka).filter(t=>u(t==null?void 0:t.enabled));return e.length===0?"":n("div",null,[n("br",null,null),n("h4",null,[s("Hotkeys")]),e.map(t=>n("div",null,[t==null?void 0:t.key,s(": "),t==null?void 0:t.description]))])}));const Ns=Ce({__name:"Sticky",setup(e){const t=H("0"),l=new ResizeObserver(o),i=Yt(null);function o(){let r=i.value;if(r==null)return;let d=0;for(;r.previousSibling;){const c=r.previousSibling;c.dataset&&"vSticky"in c.dataset&&(d+=c.offsetHeight),r=c}t.value=d+"px"}return Rl(o),document.fonts.ready.then(o),ga(()=>{var d;const r=(d=i.value)==null?void 0:d.parentElement;r&&l.observe(r)}),(r,d)=>(C(),I("div",{class:"sticky",style:wt({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Xt(r.$slots,"default",{},void 0,!0)],4))}});var Ds=Ve(Ns,[["__scopeId","data-v-cccac690"]]);const li=Ce({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,l=v(()=>na(t.resource));return(i,o)=>(C(),I("h2",{style:wt({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},Ie(u(l)),5))}});const Is={class:"main-display"},Ts={key:0},Ps={key:1},Fs=s(", "),Us={key:2},Rs=h("br",null,null,-1),Os={class:"main-display"},qs={key:0},Ls={key:1},Gs=s(", "),Qs={key:2},$s=h("br",null,null,-1),Lt=Ce({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null,sticky:{type:Boolean,default:!0}},setup(e){const l=Nt(e),i=H(null),o=Bl(l.effectDisplay),r=H(null),d=Bl(l.productionDisplay),c=v(()=>a.lt(l.resource.value,"1e1000"));return(m,p)=>{var w,b;return e.sticky?(C(),be(Ds,{key:0},{default:ge(()=>{var A,f,_,N;return[h("div",{class:ht(["main-display-container",(A=e.classes)!=null?A:{}]),style:wt([{"min-height":`${((_=(f=i.value)==null?void 0:f.$el.clientHeight)!=null?_:0)+50}px`},(N=e.style)!=null?N:{}])},[h("div",Is,[u(c)?(C(),I("span",Ts,"You have ")):G("",!0),n(li,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),s(" "+Ie(e.resource.displayName),1),u(o)?(C(),I("span",Ps,[Fs,(C(),be(pt(u(o)),{ref_key:"effectRef",ref:i},null,512))])):G("",!0),u(d)?(C(),I("span",Us,[Rs,(C(),be(pt(u(d)),{ref_key:"productionRef",ref:r},null,512))])):G("",!0)])],6)]}),_:1})):(C(),I("div",{key:1,class:ht(["main-display-container",(w=e.classes)!=null?w:{}]),style:wt([{"min-height":"50px"},(b=e.style)!=null?b:{}])},[h("div",Os,[u(c)?(C(),I("span",qs,"You have ")):G("",!0),n(li,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),s(" "+Ie(e.resource.displayName),1),u(o)?(C(),I("span",Ls,[Gs,(C(),be(pt(u(o)),{ref_key:"effectRef",ref:i},null,512))])):G("",!0),u(d)?(C(),I("span",Qs,[$s,(C(),be(pt(u(d)),{ref_key:"productionRef",ref:r},null,512))])):G("",!0)])],6))}}});var Hs=Ce({props:{display:{type:Y(String,Object,Function),required:!0},visibility:{type:Y(Number),required:!0},style:Y(String,Object,Array),classes:Y(Object),resource:Object,cost:Y(String,Object,Number),canPurchase:{type:Y(Boolean),required:!0},bought:{type:Y(Boolean),required:!0},mark:Y(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:ia,MarkNode:Aa},setup(e){const{display:t,cost:l}=Nt(e),i=Yt("");return Vt(()=>{const o=_t(t);if(o==null){i.value="";return}if(fl(o)){i.value=He(o);return}const r=_t(l),d=He(o.title||"","h3"),c=He(o.description,"div"),m=He(o.effectDisplay||"");i.value=He(S(()=>{var p;return n("span",null,[o.title?n("div",null,[n(d,null,null)]):null,n(c,null,null),o.effectDisplay?n("div",null,[s("Currently: "),n(m,null,null)]):null,e.resource!=null&&o.showCost!==!1?n(M,null,[n("br",null,null),s("Cost: "),e.resource&&na(e.resource,r)," ",(p=e.resource)==null?void 0:p.displayName]):null])}))}),{component:i,unref:u,Visibility:At}}});const Vs=["disabled"];function js(e,t,l,i,o,r){var m;const d=Ml("MarkNode"),c=Ml("Node");return e.unref(e.visibility)!==e.Visibility.None?(C(),I("button",{key:0,style:wt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),onClick:t[0]||(t[0]=(...p)=>e.purchase&&e.purchase(...p)),class:ht({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)?(C(),be(pt(e.unref(e.component)),{key:0})):G("",!0),n(d,{mark:e.unref(e.mark)},null,8,["mark"]),n(c,{id:e.id},null,8,["id"])],14,Vs)):G("",!0)}var Js=Ve(Hs,[["render",js],["__scopeId","data-v-7f411ac8"]]);const Ws=Symbol("Upgrade");function q(e){const t=Me(!1);return Ht(()=>{const l=e();return l.id=Hl("upgrade-"),l.type=Ws,l[xl]=Js,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=v(()=>{const i=l;return i.resource!=null&&i.cost!=null&&a.gte(i.resource.value,u(i.cost))}):z(l,"canAfford"),l.canPurchase=v(()=>u(l.visibility)===At.Visible&&u(l.canAfford)&&!u(l.bought)),l.purchase=function(){var o;const i=l;!u(i.canPurchase)||(i.resource!=null&&i.cost!=null&&(i.resource.value=a.sub(i.resource.value,u(i.cost))),t.value=!0,(o=i.onPurchase)==null||o.call(i))},z(l,"visibility"),xt(l,"visibility",At.Visible),z(l,"classes"),z(l,"style"),z(l,"display"),z(l,"mark"),z(l,"cost"),z(l,"resource"),l[Nl]=function(){const{display:i,visibility:o,style:r,classes:d,resource:c,cost:m,canPurchase:p,bought:w,mark:b,id:A,purchase:f}=this;return{display:i,visibility:o,style:u(r),classes:d,resource:c,cost:m,canPurchase:p,bought:w,mark:b,id:A,purchase:f}},l})}function ae(e){return Ht(()=>{const{addend:t,description:l,enabled:i}=e(),o=kt(t),r=kt(l),d=i==null?void 0:kt(i);return{apply:c=>a.add(c,u(o)),revert:c=>a.sub(c,u(o)),enabled:d,description:l==null?void 0:S(()=>n("div",{class:"modifier-container"},[u(r)?n("span",{class:"modifier-description"},[nl(u(r))]):null,n("span",{class:"modifier-amount"},[a.gte(u(o),0)?"+":"",j(u(o))])]))}})}function g(e){return Ht(()=>{const{multiplier:t,description:l,enabled:i}=e(),o=kt(t),r=kt(l),d=i==null?void 0:kt(i);return{apply:c=>a.times(c,u(o)),revert:c=>a.div(c,u(o)),enabled:d,description:l==null?void 0:S(()=>n("div",{class:"modifier-container"},[u(r)?n("span",{class:"modifier-description"},[nl(u(r))]):null,n("span",{class:"modifier-amount"},[s("\xD7"),j(u(o))])]))}})}function ml(e){return Ht(()=>{const{exponent:t,description:l,enabled:i,supportLowNumbers:o}=e(),r=kt(t),d=kt(l),c=i==null?void 0:kt(i);return{apply:m=>{let p=m;return o&&(p=a.add(p,1)),p=a.pow(p,u(r)),o&&(p=a.sub(p,1)),p},revert:m=>{let p=m;return o&&(p=a.add(p,1)),p=a.root(p,u(r)),o&&(p=a.sub(p,1)),p},enabled:c,description:l==null?void 0:S(()=>n("div",{class:"modifier-container"},[u(d)?n("span",{class:"modifier-description"},[nl(u(d)),o?" (+1 effective)":null]):null,n("span",{class:"modifier-amount"},[s("^"),j(u(r))])]))}})}function W(e){return Ht(()=>{const t=e();return{apply:l=>t.filter(i=>u(i.enabled)!==!1).reduce((i,o)=>o.apply(i),l),revert:t.every(l=>l.revert!=null)?l=>t.filter(i=>u(i.enabled)!==!1).reduceRight((i,o)=>o.revert(i),l):void 0,enabled:v(()=>t.filter(l=>u(l.enabled)!==!1).length>0),description:S(()=>n(M,null,[t.filter(l=>u(l.enabled)!==!1).map(l=>u(l.description)).filter(l=>l).map(nl)]))}})}function Oi(e){return Ht(()=>{const t=e();return t.currentGain==null&&(t.currentGain=v(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=a.floor(l).max(0),u(t.buyMax)||(l=l.min(1)),l})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=v(()=>{let l=t.scaling.currentAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.nextAt==null&&(t.nextAt=v(()=>{let l=t.scaling.nextAt(t);return t.roundUpCost&&(l=a.ceil(l)),l})),t.convert==null&&(t.convert=function(){var o;const l=u(t.currentGain),i=u(t.currentAt);t.gainResource.value=a.add(t.gainResource.value,l),t.spend(l,i),(o=t.onConvert)==null||o.call(t,l)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),z(t,"currentGain"),z(t,"actualGain"),z(t,"currentAt"),z(t,"nextAt"),z(t,"buyMax"),xt(t,"buyMax",!0),z(t,"roundUpCost"),xt(t,"roundUpCost",!0),t})}function Ha(e,t){const l=kt(e),i=kt(t);return{currentGain(o){let r=u(o.baseResource.value);if(o.costModifier&&(r=o.costModifier.apply(r)),a.lt(r,u(l)))return 0;const d=a.div(r,u(l)).pow(u(i));return d.isNan()?new a(0):d},currentAt(o){let r=u(o.currentGain);return o.gainModifier&&(r=o.gainModifier.revert(r)),r=a.max(0,r).root(u(i)).times(u(l)),o.costModifier&&(r=o.costModifier.revert(r)),r},nextAt(o){let r=a.add(u(o.currentGain),1).floor();return o.gainModifier&&(r=o.gainModifier.revert(r)),r=a.max(0,r).root(u(i)).times(u(l)).max(u(l)),o.costModifier&&(r=o.costModifier.revert(r)),r}}}function qi(e){return Oi(e)}function zs(e){return Oi(()=>{const t=e();return xt(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=v(()=>{let l=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return l=a.floor(l).max(t.gainResource.value),u(t.buyMax)||(l=l.min(a.add(t.gainResource.value,1))),l})),t.actualGain==null&&(t.actualGain=v(()=>{let l=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return u(t.buyMax)||(l=l.min(1)),l})),xt(t,"convert",function(){var o;const l=u(t.actualGain),i=u(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(u(t.currentGain)):u(t.currentGain),t.spend(l,i),(o=t.onConvert)==null||o.call(t,l)}),t})}function Ma(e,t,l=.5){return a.lte(e,t)?e:a.pow(e,l).times(a.pow(t,a.sub(1,l)))}function ai(e,t,l=.5){return{...e,currentAt:i=>Ma(e.currentAt(i),u(t),a.recip(u(l))),nextAt:i=>Ma(e.nextAt(i),u(t),a.recip(u(l))),currentGain:i=>Ma(e.currentGain(i),u(t),u(l))}}const Ks={},Xs={style:{"white-space":"nowrap"}},Ys=h("span",{style:{"font-size":"larger","font-family":"initial"}},"\u221A",-1),Zs={style:{display:"inline-block","border-top":"1px solid","padding-left":".2em"}};function er(e,t){return C(),I("span",Xs,[Ys,h("div",Zs,[Xt(e.$slots,"default")])])}var cl=Ve(Ks,[["render",er]]);const tr={},lr={class:"fraction"};function ar(e,t){return C(),I("div",lr,[Xt(e.$slots,"default")])}var ir=Ve(tr,[["render",ar]]);const nr={class:"field"},or={key:0,class:"field-title"},Va=Ce({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var d;const l=e,i=Bl(ol(l,"title"),"span"),o=H((d=l.options.find(c=>c.value===l.modelValue))!=null?d:null);jt(ol(l,"modelValue"),c=>{var m;_t(o)!==c&&(o.value=(m=l.options.find(p=>p.value===c))!=null?m:null)});function r(c){t("update:modelValue",c.value)}return(c,m)=>(C(),I("div",nr,[u(i)?(C(),I("span",or,[(C(),be(pt(u(i))))])):G("",!0),n(u(mn),{options:e.options,modelValue:o.value,"onUpdate:modelValue":[m[0]||(m[0]=p=>o.value=p),r],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var sr=Ce({props:{visibility:{type:Y(Number),required:!0},display:{type:Y(String,Object,Function),required:!0},style:Y(String,Object,Array),classes:Y(Object),earned:{type:Y(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:ia},setup(e){const{display:t}=Nt(e),l=Yt("");return Vt(()=>{const i=_t(t);if(i==null){l.value="";return}if(fl(i)){l.value=He(i);return}const o=He(i.requirement,"h3"),r=He(i.effectDisplay||"","b"),d=He(i.optionsDisplay||"","span");l.value=He(S(()=>n("span",null,[n(o,null,null),i.effectDisplay?n("div",null,[n(r,null,null)]):null,i.optionsDisplay?n("div",{class:"equal-spaced"},[n(d,null,null)]):null])))}),{comp:l,unref:u,Visibility:At}}});function rr(e,t,l,i,o,r){var c;const d=Ml("Node");return e.unref(e.visibility)!==e.Visibility.None?(C(),I("div",{key:0,style:wt([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:ht({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(C(),be(pt(e.unref(e.comp)))),n(d,{id:e.id},null,8,["id"])],6)):G("",!0)}var ur=Ve(sr,[["render",rr],["__scopeId","data-v-f4e8794e"]]);et.on("setupVue",e=>e.use(vn));const ii=fi(),dr=Symbol("Milestone");let El;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(El||(El={}));function P(e){const t=Me(!1);return Ht(()=>{var o;const l=(o=e==null?void 0:e())!=null?o:{};l.id=Hl("milestone-"),l.type=dr,l[xl]=ur,l.earned=t,l.complete=function(){var d;const r=l;if(t.value=!0,(d=r.onComplete)==null||d.call(r),r.display&&u(r.showPopups)===!0){const c=u(r.display),m=He(fl(c)?c:c.requirement);ii(n(M,null,[n("h3",null,[s("Milestone earned!")]),n("div",null,[n(m,null,null)])]))}},z(l,"visibility"),xt(l,"visibility",At.Visible);const i=l.visibility;if(l.visibility=v(()=>{const r=u(l.display);switch(ct.msDisplay){default:case El.All:return u(i);case El.Configurable:return u(l.earned)&&!(r!=null&&typeof r=="object"&&"optionsDisplay"in r)?At.None:u(i);case El.Incomplete:return u(l.earned)?At.None:u(i);case El.None:return At.None}}),z(l,"style"),z(l,"classes"),z(l,"display"),z(l,"showPopups"),l[Nl]=function(){const{visibility:r,display:d,style:c,classes:m,earned:p,id:w}=this;return{visibility:r,display:d,style:u(c),classes:m,earned:p,id:w}},l.shouldEarn){const r=l;Vt(()=>{var d,c;if(ct.active===me.id&&!r.earned.value&&u(r.visibility)===At.Visible&&((d=r.shouldEarn)==null?void 0:d.call(r))&&(r.earned.value=!0,(c=r.onComplete)==null||c.call(r),r.display&&u(r.showPopups)===!0)){const m=u(r.display),p=He(fl(m)?m:m.requirement);ii(n(M,null,[n("h3",null,[s("Milestone earned!")]),n("div",null,[n(p,null,null)])]))}})}return l})}et.on("loadSettings",e=>{xt(e,"msDisplay",El.All)});const cr=Object.values(El).map(e=>({label:Ei(e),value:e}));Fo(S(()=>n(Va,{title:"Show Milestones",options:cr,"onUpdate:modelValue":e=>ct.msDisplay=e,modelValue:ct.msDisplay},null)));const pr={class:"field"},mr=Ce({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const l=e,i=v(()=>He(u(l.title)||"<span></span>","span")),o=v({get(){return!!l.modelValue},set(r){t("update:modelValue",r)}});return(r,d)=>(C(),I("label",pr,[ya(h("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":d[0]||(d[0]=c=>bt(o)?o.value=c:null)},null,512),[[un,u(o)]]),(C(),be(pt(u(i))))]))}});var vl=Ve(mr,[["__scopeId","data-v-33d57459"]]);const vr=Symbol("Reset");function fr(e){return Ht(()=>{const t=e();return t.id=Hl("reset-"),t.type=vr,t.reset=function(){var i;const l=o=>{if(o&&typeof o=="object")if(_l in o){const r=o;r.value=r[_l]}else!(o instanceof a)&&!bt(o)&&Object.values(o).forEach(r=>l(r))};u(t.thingsToReset).forEach(l),et.emit("reset",t),(i=t.onReset)==null||i.call(t)},z(t,"thingsToReset"),t})}const ra={};et.on("removeLayer",e=>{var t;(t=ra[e.id])==null||t.call(ra),ra[e.id]=void 0});const gr="plastic",ni=10,Ye=$t(gr,function(){const e="Plastic",t="#DCD9CD",l=yt(0,"plastic"),[i,o]=sl(()=>[{title:"Plastic Gain",modifier:ye,base:0}]),r=H(!1),d=S(()=>n(Ct,{modelValue:r.value,"onUpdate:modelValue":De=>r.value=De},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:i})),c=Me(0),m=v(()=>a.times(c.value,100)),p=Le(()=>({resource:lt.metal,cost(){const De=new a(this.amount.value);let Se=a.pow(1.2,De).times(1e7);return U.elfTraining.fertilizerElfTraining.milestones[3].earned.value&&(Se=a.sub(Se,a.pow(l.value,2)).max(0)),Se},display:S(()=>n(M,null,[n("h3",null,[s("Refinery")]),n("br",null,null),s("Refines oil into plastic pellets"),n("br",null,null),s("Consumes 100 oil/s to create 1 plastic/s"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),j(m.value),s(" oil/sec"),n("br",null,null),s("+"),j(c.value),s(" plastic/sec"),n("br",null,null),n("br",null,null),s("Cost: "),X(u(p.cost))," ",p.resource.displayName])),onPurchase(){c.value=a.add(c.value,1)},style:{width:"300px"}})),{min:w,max:b,add:A,remove:f}=il({buyable:p,active:c,style:{minHeight:"20px",width:"40px",color:"var(--feature-foreground)"}}),_=v(()=>a.pow(5,a.add([...Object.values(B),...Object.values(ie)].filter(De=>De.bought.value).length,2))),N=q(()=>({resource:R(l),cost:_,display:()=>({title:"Plastic Scissors",description:"Unlock paper upgrades",showCost:!N.bought.value})})),T=q(()=>({resource:R(l),cost:_,display:()=>({title:"Plastic Level",description:"Unlock box upgrades",showCost:!T.bought.value})})),J=q(()=>({resource:R(l),cost:_,display:()=>({title:"Plastic Cane",description:"Unlock cloth upgrades",showCost:!J.bought.value})})),B={paperTools:N,boxTools:T,clothTools:J},E=q(()=>({resource:R(l),cost:_,visibility:()=>y(N.bought.value),display:()=>({title:"Paper Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!E.bought.value})})),F=q(()=>({resource:R(l),cost:_,visibility:()=>y(T.bought.value),display:()=>({title:"Box Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!F.bought.value})})),Z=q(()=>({resource:R(l),cost:_,visibility:()=>y(J.bought.value),display:()=>({title:"Cloth Elf Recruitment",description:"Double plastic gain and unlock a new elf for training",showCost:!Z.bought.value})})),ie={paperElf:E,boxElf:F,clothElf:Z},oe=Le(()=>({resource:R(l),cost(){const De=this.amount.value;return a.pow(1.3,De).times(100)},visibility:()=>y(E.bought.value),display:{title:"Plastic Printing Press",description:"Gain +1% of your paper gain per second",effectDisplay:S(()=>n(M,null,[X(oe.amount.value),s("%")])),showAmount:!1}})),ve=Le(()=>({resource:R(l),cost(){const De=this.amount.value;return a.pow(1.3,De).times(100)},visibility:()=>y(F.bought.value),display:{title:"Plastic Box Folder",description:"Gain +1% of your box gain per second",effectDisplay:S(()=>n(M,null,[X(ve.amount.value),s("%")])),showAmount:!1}})),ne=Le(()=>({resource:R(l),cost(){const De=this.amount.value;return a.pow(1.3,De).times(100)},visibility:()=>y(Z.bought.value),display:{title:"Plastic Shepherd",description:"All cloth actions are +10% more efficient",effectDisplay:S(()=>n(M,null,[X(a.times(ne.amount.value,10)),s("%")])),showAmount:!1}})),Be={passivePaper:oe,passiveBoxes:ve,clothGains:ne},ye=W(()=>[ae(()=>({addend:c,description:"Oil Refinery",enabled:()=>a.gt(c.value,0)})),g(()=>({multiplier:2,description:"Paper Elf Recruitment",enabled:E.bought})),g(()=>({multiplier:2,description:"Box Elf Recruitment",enabled:F.bought})),g(()=>({multiplier:2,description:"Cloth Elf Recruitment",enabled:Z.bought})),g(()=>({multiplier:2,description:"Carry plastic in boxes",enabled:it.row2Upgrades.plasticUpgrade.bought})),g(()=>({multiplier:()=>ue.oilEffectiveness.value,description:"Effectiveness",enabled:()=>a.lt(ue.oilEffectiveness.value,1)})),g(()=>({multiplier:We.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(We.dyes.yellow.amount.value,1)}))]),ee=v(()=>ye.apply(0));et.on("update",De=>{a.lt(O.day.value,ni)||(l.value=a.times(De,ee.value).add(l.value))});const{total:te,trackerDisplay:Ue}=hl({resource:l,goal:25e4,name:e,day:ni,color:t,textColor:"var(--feature-foreground)",modal:{show:r,display:d}});return{name:e,color:t,plastic:l,totalPlastic:te,buildRefinery:p,activeRefinery:c,oilCost:m,upgrades:B,elfUpgrades:ie,buyables:Be,generalTabCollapsed:o,minWidth:700,display:S(()=>n(M,null,[ce(Ue),n(_e,null,null),n(Lt,{resource:l,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(ee.value,0)?`+${j(ee.value)}/s`:void 0},null),n(_e,null,null),n(Qt,null,{default:()=>[ce(p),n("div",null,[X(a.floor(c.value)),s("/"),X(a.floor(p.amount.value))]),at(w,f,A,b)]}),n($l,null,{default:()=>[Zt(N,E,oe),Zt(T,F,ve),Zt(J,Z,ne)]})]))}}),yr="paper",Ba=5,V=$t(yr,function(){const e="Paper",t="#E8DCB8",l=yt(0,"paper"),i=yt(v(()=>a.min(a.div(de.logs.value,1e9),a.div(L.ash.value,De.value))),"pulp"),o=qi(()=>({scaling:Ha(1,1.2),baseResource:i,gainResource:R(l),roundUpCost:!0,spend(pe,Ze){de.logs.value=a.sub(de.logs.value,a.times(Ze,1e9)),L.ash.value=a.sub(L.ash.value,a.times(Ze,De.value))},gainModifier:te})),r=qt(()=>({display:S(()=>{const pe=a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value;return n(M,null,[n("span",{style:"font-size: large"},[s("Create "),X(o.currentGain.value),s(" "),l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost: "),na(de.logs,pe),s(" "),i.displayName,s(" ("),X(a.times(pe,1e9)),s(" "),de.logs.displayName,s(";")," ",X(a.times(pe,De.value))," ",L.ash.displayName,s(")")])])}),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"}));function d(pe){const Ze=Le(()=>({...pe,display:{title:pe.name,description:`Print a copy of "${pe.name}", which ${pe.elfName} will use to improve their skills! Each copy printed will reduce the "${pe.buyableName}" price scaling by 0.95x and make ${pe.elfName} purchase +10% faster!`,effectDisplay:S(()=>n(M,null,[j(a.pow(.95,Ze.amount.value)),s("x price scaling,")," ",j(a.div(Ze.amount.value,10).add(1)),s("x auto-purchase speed")])),showAmount:!1},resource:R(l),cost(){let K=this.amount.value;(pe.elfName==="Star"||pe.elfName==="Bell")&&(K=a.pow(K,2)),a.gte(K,100)&&(K=a.pow(K,2).div(100)),a.gte(K,1e4)&&(K=a.pow(K,2).div(1e4)),K=a.pow(.95,T.amount.value).times(K);let st=5;U.elfTraining.paperElfTraining.milestones[0].earned.value&&st--;let ze=a.pow(st,K).times(10);return U.elfTraining.paperElfTraining.milestones[0].earned.value&&(ze=a.div(ze,ve.value.max(1))),ze},style:"width: 600px"}));return Ze}const c=d({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),m=d({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),p=d({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),w=d({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),b=d({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),A=d({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),f=d({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>y(Pe.elves.smallFireElf.bought.value)}),_=d({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>y(Pe.elves.bonfireElf.bought.value)}),N=d({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>y(Pe.elves.kilnElf.bought.value)}),T=d({name:"The Book Thief",elfName:"Star",buyableName:"Paper Buyables",visibility:()=>y(Pe.elves.paperElf.bought.value)}),J=d({name:"Not a box",elfName:"Bell",buyableName:"Box Buyables",visibility:()=>y(Pe.elves.boxElf.bought.value)}),B=d({name:"Fuzzy Bee and Friends",elfName:"Gingersnap",buyableName:"Cloth Buyables",visibility:()=>y(Pe.elves.clothElf.bought.value)}),E=d({name:"Drills and Mills",elfName:"Peppermint",buyableName:"Mining Drill",visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[3].earned.value)}),F=d({name:"Deep in the Earth",elfName:"Frosty",buyableName:"Oil Drills",visibility:()=>y(U.elfTraining.fertilizerElfTraining.milestones[4].earned.value)}),Z=d({name:"Burning the Midnight Oil",elfName:"Cocoa",buyableName:"Oil-Consuming Machines",visibility:()=>y(U.elfTraining.heatedCutterElfTraining.milestones[4].earned.value)}),ie=d({name:"Physical Metallurgy",elfName:"Twinkle",buyableName:"Metal Buyables",visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[4].earned.value)}),oe={cuttersBook:c,plantersBook:m,expandersBook:p,heatedCuttersBook:w,heatedPlantersBook:b,fertilizerBook:A,smallFireBook:f,bonfireBook:_,kilnBook:N,paperBook:T,boxBook:J,clothBook:B,miningDrillBook:E,heavyDrillBook:F,oilBook:Z,metalBook:ie},ve=v(()=>Object.values(oe).reduce((pe,Ze)=>pe.add(Ze.amount.value),new a(0))),ne=q(()=>({resource:R(l),cost:1e8,visibility:()=>y(Ye.upgrades.paperTools.bought.value),display:{title:"Shepherding for Dummies",description:"Double effectiveness of all cloth actions"}})),Be=q(()=>({resource:R(l),cost:1e9,visibility:()=>y(Ye.upgrades.paperTools.bought.value),display:{title:"Guide to drilling",description:"Double drilling power"}})),ye=q(()=>({resource:R(l),cost:1e10,visibility:()=>y(Ye.upgrades.paperTools.bought.value),display:{title:"Oil and where to find it",description:"Double oil gain"}})),ee={clothUpgrade:ne,drillingUpgrade:Be,oilUpgrade:ye},te=W(()=>[g(()=>({multiplier:2,description:"Scholar's shoes",enabled:vt.paperUpgrades.paperUpgrade1.bought})),g(()=>({multiplier:2,description:"Scholar's slacks",enabled:vt.paperUpgrades.paperUpgrade2.bought})),g(()=>({multiplier:2,description:"Scholar's jacket",enabled:vt.paperUpgrades.paperUpgrade3.bought})),g(()=>({multiplier:10,description:"Felt Elbow Pads",enabled:vt.paperUpgrades.paperUpgrade4.bought})),g(()=>({multiplier:We.boosts.yellow1,description:"Yellow Dye Boost 1",enabled:()=>a.gte(We.dyes.yellow.amount.value,1)}))]),Ue=W(()=>[g(()=>({multiplier:.1,description:"Star Level 2",enabled:U.elfTraining.paperElfTraining.milestones[1].earned}))]),De=v(()=>Ue.apply(1e6)),[Se,Re]=sl(()=>[{title:"Paper Gain",modifier:te,base:1},{title:"Ash Cost",modifier:Ue,base:1e6,unit:" ash/pulp"}]),fe=H(!1),Oe=S(()=>n(Ct,{modelValue:fe.value,"onUpdate:modelValue":pe=>fe.value=pe},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:Se}));et.on("update",pe=>{a.lt(O.day.value,Ba)||(l.value=a.times(pe,Ye.buyables.passivePaper.amount.value).times(o.currentGain.value).div(100).add(l.value))});const{total:xe,trackerDisplay:qe}=hl({resource:l,goal:5e3,name:e,day:Ba,color:t,textColor:"var(--feature-foreground)",modal:{show:fe,display:Oe}});return{name:e,day:Ba,color:t,paper:l,totalPaper:xe,paperConversion:o,books:oe,upgrades:ee,generalTabCollapsed:Re,minWidth:700,display:S(()=>n(M,null,[ce(qe),n(_e,null,null),n(Lt,{resource:l,color:t,style:"margin-bottom: 0"},null),n(_e,null,null),ce(r),n(_e,null,null),at(...Object.values(ee)),n(_e,null,null),Zt(...Object.values(oe))]))}}),hr="oil",xa=9,ue=$t(hr,function(){const e="Oil",t="#000000",l="var(--foreground)",i=yt(0,"oil"),o=yt(0,"depth"),r=Me(0),d=v(()=>a.lt(o.value,990)?a.add(10,o.value):a.pow(1.001,a.sub(o.value,990)).mul(1e3));function c(){if(a.lt(o.value,990)){const Xe=a.min(a.affordArithmeticSeries(r.value,10,1,o.value),a.sub(990,o.value)),Rt=a.sumArithmeticSeries(Xe,10,1,o.value);r.value=a.sub(r.value,Rt),o.value=a.add(o.value,Xe)}if(a.gte(o.value,990)){const Xe=a.affordGeometricSeries(r.value,1e3,1.001,a.sub(o.value,990)),Rt=a.sumGeometricSeries(Xe,1e3,1.001,a.sub(o.value,990));r.value=a.sub(r.value,Rt),o.value=a.add(o.value,Xe)}}const m=Me(0),p=v(()=>a.times(a.pow(m.value,J.value).pow(2),1e14)),w=v(()=>a.times(a.pow(m.value,J.value),1)),b=Le(()=>({resource:lt.metal,cost(){const Xe=new a(this.amount.value);return a.pow(1.3,Xe).times(25e3)},display:S(()=>n(M,null,[n("h3",null,[s("Heavy Drill")]),n("br",null,null),s("A large drill specialized at deep mining."),n("br",null,null),s("Consumes 1e14*(Heavy Drills amount)"),n("sup",null,[s("2")]),s(" coal/sec for (Heavy Drills amount) drill power."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),Ee(p.value),s(" coal/sec"),n("br",null,null),s("+"),Ee(w.value),s(" drill power"),n("br",null,null),n("br",null,null),s("Cost: "),ke(u(b.cost)),s(" "),b.resource.displayName])),onPurchase(){m.value=a.add(m.value,1)},style:{color:l,width:"160px"}})),{min:A,max:f,add:_,remove:N}=il({buyable:b,active:m}),T=Me(0),J=v(()=>a.add(T.value,Math.E).ln()),B=Le(()=>({resource:lt.metal,cost(){const Xe=new a(this.amount.value);return a.pow(2,Xe).times(1e5)},display:S(()=>n(M,null,[n("h3",null,[s("Heavy Drill Drill")]),n("br",null,null),s("Attach extra drills to Heavy Drills to make them faster"),n("br",null,null),s("Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e)."),n("br",null,null),s("(also affects coal consumption)."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("^"),Ee(J.value),s(" Heavy Drill amount"),n("br",null,null),n("br",null,null),s("Cost: "),ke(u(B.cost)),s(" "),B.resource.displayName])),onPurchase(){T.value=a.add(T.value,1)},style:{color:l,width:"160px"}})),{min:E,max:F,add:Z,remove:ie}=il({buyable:B,active:T}),oe=Me(0),ve=v(()=>a.pow(1/3,oe.value)),ne=v(()=>a.pow(2,oe.value)),Be=v(()=>a.pow(1.2,oe.value)),ye=Le(()=>({resource:lt.metal,cost(){const Xe=new a(this.amount.value);return a.pow(8,Xe).times(2e5)},display:S(()=>n(M,null,[n("h3",null,[s("Heavy Extractor")]),n("br",null,null),s("Attach extractors to the drill to mine coal and ore, but with a price."),n("br",null,null),s("Divides drill power by 3 to multiply coal gain by 2 and ore gain by 1.2."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("\xD7"),Ee(ve.value),s(" drill power"),n("br",null,null),s("\xD7"),Ee(ne.value),s(" coal/sec"),n("br",null,null),s("\xD7"),Ee(Be.value),s(" ore/sec"),n("br",null,null),n("br",null,null),s("Cost: "),ke(u(ye.cost))," ",ye.resource.displayName])),onPurchase(){oe.value=a.add(oe.value,1)},style:{color:l,width:"160px"}})),{min:ee,max:te,add:Ue,remove:De}=il({buyable:ye,active:oe}),Se=Me(0),Re=v(()=>a.pow(Pt[3].bought.value?4:5,Se.value)),fe=v(()=>a.add(Se.value,Kt.value).pow(2).mul(m.value).mul(a.add(T.value,1)).mul(oe.value).mul(o.value).div(1e5)),Oe=Le(()=>({resource:lt.metal,cost(){const Xe=new a(this.amount.value);let Rt=a.pow(16,Xe).times(2e6);return Pt[4].bought.value&&(Rt=Rt.div(a.add(Tl.value,1).root(6))),Rt},display:S(()=>n(M,null,[n("h3",null,[s("Oil Pump")]),n("br",null,null),s("Pump that oil from the ground."),n("br",null,null),s("Gain oil based on the number of Heavy buildings active and well depth, but coal usage is multiplied by "),Pt[3].bought.value?4:5,s("\xD7."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("\xD7"),Ee(Re.value),s(" coal usage"),n("br",null,null),s("+"),Ee(fe.value),s(" oil/sec"),n("br",null,null),n("br",null,null),s("Cost: "),ke(u(Oe.cost)),s(" "),Oe.resource.displayName])),onPurchase(){Se.value=a.add(Se.value,1)},style:{color:l,width:"160px"}})),{max:xe,min:qe,add:pe,remove:Ze}=il({buyable:Oe,active:Se}),K=Me(0),st=v(()=>a.pow(K.value,2)),ze=v(()=>a.pow(K.value,3).mul(1e19)),Je=v(()=>a.add(K.value,1)),se=Le(()=>({resource:R(i),cost(){const Xe=new a(this.amount.value);return a.pow(2,Xe).times(50)},display:S(()=>n(M,null,[n("h3",null,[s("Oil Burner")]),n("br",null,null),s("Burn oil as fuel."),n("br",null,null),s("(Oil Burner Amount)"),n("sup",null,[s("2")]),s(" unit of oil can give 1e19*(Oil Burner Amount)"),n("sup",null,[s("3")]),s(" units of coal."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),Ee(st.value),s(" oil/sec"),n("br",null,null),s("-"),Ee(ze.value),s(" coal consumption"),Pt[2].bought.value?n(M,null,[n("br",null,null),s("\xD7"),Ee(Je.value),s(" to auto smelting multi")]):"",n("br",null,null),n("br",null,null),s("Cost: "),ke(u(se.cost)),s(" "),se.resource.displayName])),onPurchase(){K.value=a.add(K.value,1)},style:{color:l,width:"160px"}})),{max:$e,min:rt,add:St,remove:nt}=il({buyable:se,active:K}),ut=Me(0),Ke=v(()=>a.pow(ut.value,2).mul(100)),Ge=v(()=>a.add(ut.value,1)),Et=Le(()=>({resource:lt.metal,cost(){const Xe=new a(this.amount.value);let Rt=a.pow(10,Xe).times(1e7);return Pt[4].bought.value&&(Rt=Rt.div(a.add(Tl.value,1).root(6))),Rt},display:S(()=>n(M,null,[n("h3",null,[s("Oil Smelter")]),n("br",null,null),s("Use oil as a crucible fuel."),n("br",null,null),s("Burn 100*(Oil Smelter amount)"),n("sup",null,[s("2")]),s(" oil to smelt +100% faster."),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),Ee(Ke.value),s(" oil/sec"),n("br",null,null),s("\xD7"),Ee(Ge.value),s(" smelting speed"),n("br",null,null),n("br",null,null),s("Cost: "),ke(u(Et.cost)),s(" "),Et.resource.displayName])),onPurchase(){ut.value=a.add(ut.value,1)},style:{color:l,width:"160px"}})),{max:Mt,min:Dt,add:re,remove:Q}=il({buyable:Et,active:ut}),he=[P(()=>({display:{requirement:"5m Well Depth",effectDisplay:"Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."},shouldEarn:()=>a.gte(o.value,5)})),P(()=>({display:{requirement:"10m Well Depth",effectDisplay:"Drill too slow? Unlock some drill upgrades!"},shouldEarn:()=>a.gte(o.value,10),visibility:()=>y(he[0].earned.value)})),P(()=>({display:{requirement:"25m Well Depth",effectDisplay:"Gain 5% more ore for each metre of well depth."},shouldEarn:()=>a.gte(o.value,25),visibility:()=>y(he[1].earned.value)})),P(()=>({display:{requirement:"60m Well Depth",effectDisplay:"Drill still too slow? Try unlocking another drill!"},shouldEarn:()=>a.gte(o.value,60),visibility:()=>y(he[2].earned.value)})),P(()=>({display:{requirement:"150m Well Depth",effectDisplay:"It appears that coal and metal appear a lot more when you go this deep! Unlock an upgrade apiece for coal and metal!"},shouldEarn:()=>a.gte(o.value,150),visibility:()=>y(he[3].earned.value)})),P(()=>({display:{requirement:"350m Well Depth",effectDisplay:"There is 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:()=>a.gte(o.value,350),visibility:()=>y(he[4].earned.value)})),P(()=>({display:{requirement:"1,000m Well Depth",effectDisplay:"You've finally found oil! Maybe it's time to make those oil useful! Unfortunately extracting them would use more coal, and also it's becoming much harder to mine deeper due to the thermal heat and pressure."},shouldEarn:()=>a.gte(o.value,1e3),visibility:()=>y(a.gte(o.value,1e3))})),P(()=>({display:{requirement:"3,000m Well Depth",effectDisplay:"You found a large oil spot! Double oil gain!"},shouldEarn:()=>a.gte(o.value,3e3),visibility:()=>y(a.gte(o.value,2e3))}))],{collapseMilestones:Tt,display:Wt}=ta(he),we=[P(()=>({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:()=>a.gte(Tl.value,100)})),P(()=>({display:{requirement:"500 total oil",effectDisplay:"Unlocks oil upgrades! These can be bought with oil."},shouldEarn:()=>a.gte(Tl.value,500),visibility:()=>y(we[0].earned.value)})),P(()=>({display:{requirement:"10,000 total oil",effectDisplay:"Wow, this is really bright when you burn it. Maybe it can be helpful to use them to smelt metal?"},shouldEarn:()=>a.gte(Tl.value,1e4),visibility:()=>y(we[1].earned.value)}))],{collapseMilestones:Ne,display:dt}=ta(we),It=[q(()=>({resource:L.coal,cost:1e18,display:{title:"Coal Drill Synergy",description:"Increase drill power by +4% per coal Mining Drill owned.",effectDisplay:S(()=>n(M,null,[s("x"),Ee(ot[0].value)]))},style:{color:l}})),q(()=>({resource:lt.metal,cost:15e4,display:{title:"Metal Drill Synergy",description:"Increase drill power by +4% per ore Mining Drill owned.",effectDisplay:S(()=>n(M,null,[s("x"),Ee(ot[1].value)]))},style:{color:l}})),q(()=>({resource:L.coal,cost:1e20,display:{title:"Coal Drill Upgrade",description:"Increase drill power by +6% per OoM of coal owned.",effectDisplay:S(()=>n(M,null,[s("x"),Ee(ot[2].value)]))},style:{color:l}})),q(()=>({resource:lt.metal,cost:15e5,display:{title:"Metal Drill Upgrade",description:"Increase drill power by +10% per OoM of metal ingot owned.",effectDisplay:S(()=>n(M,null,[s("x"),Ee(ot[3].value)]))},style:{color:l}})),q(()=>({resource:R(i),cost:100,display:{title:"Drill Oil",description:"Increase previous upgrades' effect by +0.1% per Heavy Drill owned.",effectDisplay:S(()=>n(M,null,[s("+"),Ee(a.mul(ot[4].value,100)),s("%")]))},style:{color:l}}))],ot=[v(()=>a.mul(L.buildDrill.amount.value,a.add(.04,tt.value)).add(1)),v(()=>a.mul(lt.oreDrill.amount.value,a.add(.04,tt.value)).add(1)),v(()=>a.mul(a.max(L.coal.value,1).log10().floor(),a.add(.06,tt.value)).add(1)),v(()=>a.mul(a.max(lt.metal.value,1).log10().floor(),a.add(.1,tt.value)).add(1)),v(()=>a.mul(b.amount.value,.001))],Pt=[q(()=>({resource:R(i),cost:100,display:{title:"Oil the Oil Pump",description:"Double oil gain."},style:{color:l}})),q(()=>({resource:R(i),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}})),q(()=>({resource:R(i),cost:1500,display:{title:"Blaster Burner",description:"The Oil Burner can now increase your metal gain."},style:{color:l}})),q(()=>({resource:R(i),cost:25e3,display:{title:"Oil Integration",description:"Reduce Oil Pump's coal consumption multipler from 5 to 4"},style:{color:l}})),q(()=>({resource:R(i),cost:5e4,display:{title:"Be One with the Oil",description:S(()=>n(M,null,[s("Divide metal ingot prices of oil buildings by "),n("sup",null,[s("6")]),n(cl,null,{default:()=>[s("total oil + 1")]})]))},style:{color:l}}))],rl=W(()=>[ae(()=>({addend:()=>a.negate(p.value),description:"Heavy Drill",enabled:()=>a.gt(m.value,0)})),g(()=>({multiplier:Re,description:"Oil Pump",enabled:()=>a.gt(Se.value,0)})),ae(()=>({addend:wl,description:"Oil to Coal Substitution",enabled:()=>a.gt(wl.value,0)}))]),ul=v(()=>rl.apply(0)),le=W(()=>[ae(()=>({addend:w,description:"Heavy Drill",enabled:()=>a.gt(m.value,0)})),g(()=>({multiplier:ve,description:"Heavy Extractor",enabled:()=>a.gt(oe.value,0)})),g(()=>({multiplier:ot[0],description:"Coal Drill Synergy",enabled:It[0].bought})),g(()=>({multiplier:ot[1],description:"Metal Drill Synergy",enabled:It[1].bought})),g(()=>({multiplier:ot[2],description:"Coal Drill Upgrade",enabled:It[2].bought})),g(()=>({multiplier:ot[3],description:"Metal Drill Upgrade",enabled:It[3].bought})),g(()=>({multiplier:2,description:"Guide to drilling",enabled:V.upgrades.drillingUpgrade.bought})),g(()=>({multiplier:()=>dl.value,description:"Effectiveness",enabled:()=>a.lt(dl.value,1)}))]),$=v(()=>le.apply(0)),Qe=W(()=>[ae(()=>({addend:ot[4],description:"Drill Oil",enabled:It[4].bought}))]),tt=v(()=>Qe.apply(0)),Gt=W(()=>[ae(()=>({addend:fe,description:"Oil Pump",enabled:()=>a.gt(Se.value,0)})),g(()=>({multiplier:2,description:"Oil the Oil Pump",enabled:Pt[0].bought})),g(()=>({multiplier:2,description:"3000m Well Depth",enabled:he[7].earned})),g(()=>({multiplier:2,description:"Oil and where to find it",enabled:V.upgrades.oilUpgrade.bought})),g(()=>({multiplier:()=>dl.value,description:"Effectiveness",enabled:()=>a.lt(dl.value,1)})),g(()=>({multiplier:()=>a.sqrt(U.totalElfLevels.value),description:"Jack Level 4",enabled:U.elfTraining.heatedCutterElfTraining.milestones[3].earned}))]),Ft=v(()=>Gt.apply(0)),zt=W(()=>[ae(()=>({addend:()=>a.negate(st.value),description:"Oil Burner",enabled:()=>a.gt(K.value,0)})),ae(()=>({addend:()=>a.negate(Ke.value),description:"Oil Smelter",enabled:()=>a.gt(ut.value,0)})),ae(()=>({addend:()=>a.negate(Ye.oilCost.value),description:"Oil Refinery",enabled:()=>a.gt(Ye.activeRefinery.value,0)}))]),x=v(()=>zt.apply(0)),Ut=W(()=>[ae(()=>({addend:ze,description:"Oil Burner",enabled:()=>a.gt(K.value,0)})),g(()=>({multiplier:()=>Al.value,description:"Effectiveness",enabled:()=>a.lt(Al.value,1)}))]),wl=v(()=>Ut.apply(0)),Dl=W(()=>[ae(()=>({addend:We.boosts.red1,description:"Red Dye Boost 1",enabled:()=>a.gte(We.dyes.red.amount.value,1)}))]),Kt=v(()=>Dl.apply(0)),[pl,tl]=sl(()=>[{title:"Coal Consumption",modifier:rl,unit:"/s",base:0},{title:"Drill Power",modifier:le,base:0},{title:"Upgrade Bonus",modifier:Qe,base:0,visible(){return a.gt(tt.value,0)}},{title:"Oil Speed",modifier:Gt,unit:"/s",base:0,visible(){return a.gt(Ft.value,0)}},{title:"Oil Consumption",modifier:zt,unit:"/s",base:0,visible(){return a.lt(x.value,0)}},{title:"Oil to Coal Substitution",modifier:Ut,unit:"/s",base:0,visible(){return a.gt(wl.value,0)}},{title:"Extra Oil Pumps",modifier:Dl,base:0,visible(){return a.gt(Kt.value,0)}}]),Il=H(!1),ln=S(()=>n(Ct,{modelValue:Il.value,"onUpdate:modelValue":Xe=>Il.value=Xe},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:pl})),dl=H(a.dOne),Al=H(a.dOne);et.on("update",Xe=>{if(a.lt(O.day.value,xa))return;const Rt=a.negate(ul.value);a.gt(Rt,0)?(dl.value=a.min(a.div(L.coal.value,Rt),1),L.coal.value=a.sub(L.coal.value,a.mul(Rt,dl.value).mul(Xe))):dl.value=a.dOne,r.value=a.add(r.value,a.mul($.value,Xe)),i.value=a.add(i.value,a.mul(Ft.value,Xe)),c();const Ea=a.negate(x.value);a.gt(Ea,0)?(Al.value=a.min(a.div(i.value,Ea),1),i.value=a.sub(i.value,a.mul(Ea,Al.value).mul(Xe)).max(0)):Al.value=a.dOne});const{total:Tl,trackerDisplay:an}=hl({resource:i,goal:25e4,name:e,day:xa,color:t,modal:{show:Il,display:ln}});return{name:e,day:xa,color:t,oil:i,totalOil:Tl,depth:o,drillProgress:r,activeHeavy:m,buildHeavy:b,activeHeavy2:T,buildHeavy2:B,activeExtractor:oe,buildExtractor:ye,activePump:Se,buildPump:Oe,activeBurner:K,buildBurner:se,activeSmelter:ut,buildSmelter:Et,extractorCoal:ne,extractorOre:Be,coalEffectiveness:dl,oilEffectiveness:Al,depthMilestones:he,collapsedDepthMilestones:Tt,row1Upgrades:It,row2Upgrades:Pt,minWidth:700,oilMilestones:we,collapsedOilMilestones:Ne,generalTabCollapsed:tl,display:S(()=>{const Xe=[];return he[1].earned.value&&Xe.push(It),we[1].earned.value&&Xe.push(Pt),n(M,null,[ce(an),n(_e,null,null),a.lt(dl.value,1)?n("div",null,[s("Coal efficiency: "),Ee(a.mul(dl.value,100)),s("%")]):null,a.lt(Al.value,1)?n("div",null,[s("Oil efficiency: "),Ee(a.mul(Al.value,100)),s("%")]):null,n(Lt,{resource:i,color:t,sticky:!0,productionDisplay:S(()=>n(M,null,[a.lt(o.value,1e3)?"Reach 1000m to start gaining oil":n(M,null,[ma(a.add(Ft.value,x.value))])]))},null),a.eq(Ft.value,0)?n(M,null,[s("(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)"),n("br",null,null)]):"",n($l,null,{default:()=>[he[6].earned.value?n(Qt,null,{default:()=>[ce(Oe),n("div",null,[ke(a.floor(Se.value)),s("/"),ke(a.floor(Oe.amount.value))]),at(qe,Ze,pe,xe)]}):null,we[0].earned.value?n(Qt,null,{default:()=>[ce(se),n("div",null,[ke(a.floor(K.value)),s("/"),ke(a.floor(se.amount.value))]),at(rt,nt,St,$e)]}):null,we[2].earned.value?n(Qt,null,{default:()=>[ce(Et),n("div",null,[ke(a.floor(ut.value)),s("/"),ke(a.floor(Et.amount.value))]),at(Dt,Q,re,Mt)]}):null]}),n("br",null,null),n("div",null,[n("span",null,[s("The well is ")]),n("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[ke(o.value)]),s("m deep"),n("br",null,null),s("Next at "),Ee(a.sub(d.value,r.value))," ",s("drill power seconds")]),n("div",null,[n("span",null,[s("Your drill power is ")]),n("h2",{style:"color: #6f767f; text-shadow: 0 0 10px #6f767f"},[Ee($.value)])]),n(_e,null,null),n($l,null,{default:()=>[n(Qt,null,{default:()=>[ce(b),n("div",null,[ke(a.floor(m.value)),s("/"),ke(a.floor(b.amount.value))]),at(A,N,_,f)]}),he[3].earned.value?n(Qt,null,{default:()=>[ce(B),n("div",null,[ke(a.floor(T.value)),s("/"),ke(a.floor(B.amount.value))]),at(E,ie,Z,F)]}):null,he[5].earned.value?n(Qt,null,{default:()=>[ce(ye),n("div",null,[ke(a.floor(oe.value)),s("/"),ke(a.floor(ye.amount.value))]),at(ee,De,Ue,te)]}):null]}),n(_e,null,null),Sl(...Xe),n(_e,null,null),Wt(),a.gte(Tl.value,50)?dt():""])})}}),br="metal",oi=7,lt=$t(br,function(){const e="Metal",t="#888B8D",l=yt(0,"metal ingots",void 0,!0),i=ti(l),o=yt(0,"ore"),r=ti(o),d=W(()=>[g(()=>({multiplier:5,description:"Crucible",enabled:te.bought})),g(()=>({multiplier:1.5,description:"Industrial Crucible",enabled:()=>a.gte(fe.amount.value,1)})),g(()=>({multiplier:2,description:"Industrial Furnace",enabled:De.bought})),g(()=>({multiplier:()=>a.add(qe.value,1),description:"Hotter Forges",enabled:()=>a.gte(xe.amount.value,1)})),g(()=>({multiplier:2,description:"Carry metal in boxes",enabled:it.row2Upgrades.metalUpgrade.bought})),g(()=>({multiplier:We.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(We.dyes.purple.amount.value,1)})),g(()=>({multiplier:()=>a.add(vt.cloth.value,1).log10().plus(1),description:"Glistening Paint",enabled:We.upgrades.redDyeUpg.bought})),ml(()=>({exponent:1.1,description:"Mary Level 4",enabled:U.elfTraining.heatedPlanterElfTraining.milestones[3].earned}))]),c=v(()=>d.apply(.1)),m=W(()=>[ae(()=>({addend:()=>a.times(fe.amount.value,10),description:"Industrial Crucibles",enabled:()=>a.gte(fe.amount.value,1)})),g(()=>({multiplier:2,description:"Efficient Crucibles",enabled:L.efficientSmelther.bought})),g(()=>({multiplier:()=>a.mul(ue.activeSmelter.value,ue.oilEffectiveness.value).add(1),description:"Oil Smelter",enabled:()=>a.gt(ue.activeSmelter.value,0)})),g(()=>({multiplier:We.boosts.purple2,description:"Purple Dye Boost 2",enabled:()=>a.gte(We.dyes.purple.amount.value,1)})),g(()=>({multiplier:()=>a.add(Ye.activeRefinery.value,1).sqrt(),description:"De Louvre",enabled:We.upgrades.redDyeUpg2.bought})),g(()=>({multiplier:()=>a.div(U.totalElfExp.value,1e3).add(1).sqrt(),description:"Mary Level 5",enabled:U.elfTraining.heatedPlanterElfTraining.milestones[4].earned}))]),p=v(()=>m.apply(0)),w=W(()=>[g(()=>({multiplier:3,description:"Efficient Crucibles",enabled:L.efficientSmelther.bought})),g(()=>({multiplier:()=>a.add(ue.activeBurner.value,1).mul(ue.oilEffectiveness.value),description:"Blaster Burner",enabled:ue.row2Upgrades[2].bought}))]),b=v(()=>w.apply(1)),A=1e10,f=v(()=>a.min(o.value,a.div(L.coal.value,A)).floor().max(0)),_=qt(()=>({display:S(()=>{const se=a.gte(f.value,1)?f.value:a.add(f.value,1);return n(M,null,[n("span",{style:"font-size: large"},[s("Smelt "),Ee(a.times(f.value,c.value))," ",l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost: "),ke(se),s(" "),o.displayName,s(";")," ",ke(a.times(se,A)),s(" "),L.coal.displayName])])}),canClick:()=>a.gte(f.value,1),onClick(){!u(this.canClick)||N(f.value)},style:{width:"600px",minHeight:"unset"}}));function N(se,$e=1){const[rt,St,nt]=[a.times(se,c.value).times($e),se,a.times(se,A)];l.value=a.add(l.value,rt),o.value=a.sub(o.value,St),L.coal.value=a.sub(L.coal.value,nt)}const T=W(()=>[ae(()=>({addend:()=>Re.amount.value,description:"Mining Drills",enabled:()=>a.gte(Re.amount.value,1)})),g(()=>({multiplier:()=>a.mul(ue.depth.value,.05).add(1),description:"25m Well Depth",enabled:ue.depthMilestones[2].earned})),g(()=>({multiplier:ue.extractorOre,description:"Heavy Extractor",enabled:()=>a.gt(ue.activeExtractor.value,0)})),g(()=>({multiplier:2,description:"Carry ore in boxes",enabled:it.row2Upgrades.oreUpgrade.bought}))]),J=v(()=>T.apply(1)),B=W(()=>[g(()=>({multiplier:2,description:"A Simple Pickaxe",enabled:ye.bought})),g(()=>({multiplier:2,description:"Double Pickaxe",enabled:ee.bought})),g(()=>({multiplier:2.5,description:"Mining Drills",enabled:()=>a.gte(Re.amount.value,1)})),g(()=>({multiplier:2,description:"Efficient Drills",enabled:Se.bought})),g(()=>({multiplier:2,description:"Oil the Mining Drills",enabled:ue.row2Upgrades[1].bought}))]),E=v(()=>B.apply(a.recip(Z))),F=Me(0),Z=10,ie=el(()=>({width:400,height:25,direction:Fe.Right,fillStyle:{backgroundColor:t},progress:()=>F.value})),oe=W(()=>[ae(()=>({addend:J})),g(()=>({multiplier:E}))]),ve=v(()=>oe.apply(0)),ne=W(()=>[ae(()=>({addend:ve})),ae(()=>({addend:()=>a.negate(p.value),enabled:Oe}))]),Be=v(()=>ne.apply(0)),ye=q(()=>({resource:R(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"}})),ee=q(()=>({resource:R(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:()=>y(ee.bought.value)})),te=q(()=>({resource:R(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:()=>y(te.bought.value||a.div(r.value,c.value).plus(i.value).gte(1))})),Ue=q(()=>({resource:R(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:()=>y(a.gte(Re.amount.value,1)&&(Ue.bought.value||O.days[7].opened.value||a.lt(L.computedCoalGain.value,a.times(J.value,E.value).times(A)))),onPurchase(){O.days[2].recentlyUpdated.value=!0}})),De=q(()=>({canAfford(){return a.gte(l.value,50)&&a.gte(L.coal.value,1e11)},onPurchase(){l.value=a.sub(l.value,50),L.coal.value=a.sub(L.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/>${Ee(1e11)} ${L.coal.displayName}`}})),Se=q(()=>({resource:R(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."},visibility:()=>y(ue.depthMilestones[4].earned.value)})),Re=Le(()=>({resource:R(l),cost(){return a.pow(1.15,this.amount.value).times(10)},display:{title:"Mining Drill",description:"An automated machine to help you mine more ore, faster",effectDisplay:S(()=>n(M,null,[s("Mine 2.5x faster. Increase ore mining amount by")," ",ke(Re.amount.value),s(" ore per operation")]))},visibility:()=>y(a.gte(Re.amount.value,1)||a.div(r.value,c.value).plus(i.value).gte(10)),style:{width:"200px"}})),fe=Le(()=>({resource:R(l),cost(){return a.pow(1.15,a.times(this.amount.value,10)).times(10)},display:{title:"Industrial Crucible",description:"A giant automated crucible furnace, letting you smelt ore faster",effectDisplay:S(()=>n(M,null,[s("Automatically smelts")," ",ke(a.times(fe.amount.value,10)),s(" ore per second")]))},visibility:()=>y(a.gte(fe.amount.value,1)||a.gte(Re.amount.value,4)||a.gte(r.value,50)),style:{width:"200px"}})),Oe=Me(!0),xe=Le(()=>({resource:L.coal,cost(){return a.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:S(()=>n(M,null,[s("Gain "),ke(a.times(qe.value,100)),s("% more metal per ore")]))},visibility:()=>y(a.gte(xe.amount.value,1)||De.bought.value),style:{width:"200px"}})),qe=v(()=>a.times(xe.amount.value,.25));et.on("update",se=>{F.value=a.times(se,E.value).plus(F.value);const $e=F.value.trunc();F.value=F.value.minus($e),o.value=a.add(o.value,a.times($e,J.value)),Oe.value&&N(a.min(f.value,a.times(p.value,se)),b.value)});const[pe,Ze]=sl(()=>[{title:"Auto Smelt Speed",modifier:m,base:0,unit:"/s",visible(){return a.gt(fe.amount.value,0)}},{title:"Auto Smelt Multiplier",modifier:w,base:1,visible(){return a.gt(b.value,1)}},{title:"Metal per Ore",modifier:d,base:.1},{title:"Ore per Mining Operation",modifier:T,base:1},{title:"Mining Speed",modifier:B,base:.1,unit:"/s"}]),K=H(!1),st=S(()=>n(Ct,{modelValue:K.value,"onUpdate:modelValue":se=>K.value=se},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:pe})),{total:ze,trackerDisplay:Je}=hl({resource:l,goal:25e3,name:e,day:oi,color:t,modal:{show:K,display:st}});return{name:e,day:oi,color:t,ore:o,bestOre:r,oreProgress:F,metal:l,bestMetal:i,totalMetal:ze,simplePickaxe:ye,doublePickaxe:ee,crucible:te,coalDrill:Ue,industrialFurnace:De,efficientDrill:Se,oreDrill:Re,industrialCrucible:fe,autoSmeltEnabled:Oe,hotterForge:xe,generalTabCollapsed:Ze,minWidth:700,display:S(()=>n(M,null,[ce(Je),n(_e,null,null),n(Lt,{resource:l,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:S(()=>n(M,null,[Oe.value&&a.gte(fe.amount.value,1)?`+${Ai([[p.value,"smelting speed"],[ve.value,"ore gain"],[a.div(L.computedCoalGain.value,A),"coal gain"]],"/s",a.mul(c.value,b.value))}`:void 0]))},null),n(_e,null,null),ce(_),a.gte(fe.amount.value,1)?n("div",{style:{width:"150px"}},[n(vl,{title:"Auto Smelt",modelValue:Oe.value,"onUpdate:modelValue":se=>Oe.value=se},null)]):void 0,n(_e,null,null),n(Lt,{resource:o,color:t,style:"margin-bottom: 0",sticky:!1,productionDisplay:S(()=>n(M,null,[ki(Be.value)]))},null),n(_e,null,null),n("div",null,[s("Currently mining "),Ee(J.value),s(" ore every")," ",Ee(a.recip(E.value)),s(" seconds")]),ce(ie),n(_e,null,null),at(ye,ee,te,Ue,De,Se),at(Re,fe,xe)]))}}),wr="coal",si=3,L=$t(wr,function(){const e="Coal",t="#151716",l="#B2BeB5",i="var(--foreground)",o=yt(0,"coal"),r=yt(0,"ash"),d=Me(0),c=v(()=>a.times(d.value,1e3)),m=v(()=>{let x=a.times(d.value,.1);return U.elfTraining.smallfireElfTraining.milestones[0].earned.value&&(x=x.times(5)),x}),p=v(()=>{let x=a.times(d.value,50);return U.elfTraining.smallfireElfTraining.milestones[0].earned.value&&(x=x.times(5)),x}),w=Le(()=>({resource:de.logs,cost(){let x=a.times(F.amount.value,u(F.cost)).plus(this.amount.value);return a.gte(x,100)&&(x=a.pow(x,2).div(100)),a.gte(x,1e4)&&(x=a.pow(x,2).div(1e4)),x=a.pow(.95,V.books.smallFireBook.amount.value).times(x),x.pow(1.5).times(1e4)},display:S(()=>n(M,null,[n("h3",null,[s("Small Fire")]),n("br",null,null),s("Burn 1000 logs for 0.1 coal and 50 ash"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),j(c.value),s(" logs/sec"),n("br",null,null),s("+"),j(m.value),s(" coal/sec"),n("br",null,null),s("+"),j(p.value),s(" ash/sec"),n("br",null,null),n("br",null,null),s("Cost: "),X(u(w.cost)),s(" "),w.resource.displayName])),onPurchase(){d.value=a.add(d.value,1)},style:{color:i,width:"160px"}})),{min:b,max:A,add:f,remove:_}=il({active:d,buyable:w}),N=yt(w.amount,"small fires"),T=Me(0),J=v(()=>a.times(T.value,1e4)),B=v(()=>{let x=a.times(T.value,10);return U.elfTraining.bonfireElfTraining.milestones[0].earned.value&&(x=x.times(5)),x}),E=v(()=>{let x=a.times(T.value,1e3);return U.elfTraining.bonfireElfTraining.milestones[0].earned.value&&(x=x.times(5)),x}),F=Le(()=>({resource:N,cost(){return a.pow(.95,V.books.bonfireBook.amount.value).times(10)},display:S(()=>n(M,null,[n("h3",null,[s("Bonfire")]),n("br",null,null),s("Burn 10,000 logs for 10 coal and 1000 ash"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),j(J.value),s(" logs/sec"),n("br",null,null),s("+"),j(B.value),s(" coal/sec"),n("br",null,null),s("+"),j(E.value),s(" ash/sec"),n("br",null,null),n("br",null,null),s("Cost: "),X(u(F.cost)),s(" "),F.resource.displayName])),onPurchase(x){d.value=a.sub(d.value,x).max(0),T.value=a.add(T.value,1)},style:{color:i,width:"160px"},visibility:()=>y(se.bought.value)})),{min:Z,max:ie,add:oe,remove:ve}=il({buyable:F,active:T}),ne=Me(0),Be=v(()=>a.times(ne.value,1e6)),ye=v(()=>{let x=a.times(ne.value,1e4);return U.elfTraining.kilnElfTraining.milestones[0].earned.value&&(x=x.times(5)),x}),ee=v(()=>{let x=a.times(ne.value,1e4);return U.elfTraining.kilnElfTraining.milestones[0].earned.value&&(x=x.times(5)),x}),te=Le(()=>({resource:de.logs,cost(){let x=this.amount.value;return a.gte(x,100)&&(x=a.pow(x,2).div(100)),a.gte(x,1e4)&&(x=a.pow(x,2).div(1e4)),x=a.pow(.95,V.books.kilnBook.amount.value).times(x),a.pow(1.1,x).times(1e7)},display:S(()=>n(M,null,[n("h3",null,[s("Charcoal Kiln")]),n("br",null,null),s("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("-"),j(Be.value),s(" logs/sec"),n("br",null,null),s("+"),j(ye.value),s(" coal/sec"),n("br",null,null),s("+"),j(ee.value),s(" ash/sec"),n("br",null,null),n("br",null,null),s("Cost: "),X(u(te.cost)),s(" "),te.resource.displayName])),onPurchase(){ne.value=a.add(ne.value,1)},style:{color:i,width:"160px"},visibility:()=>y(ut.bought.value)})),{min:Ue,max:De,add:Se,remove:Re}=il({buyable:te,active:ne}),fe=Me(0),Oe=v(()=>a.times(a.pow(fe.value,ue.row2Upgrades[1].bought.value?2:1),5e7).times(lt.efficientDrill.bought.value?2:1).times(U.elfTraining.smallfireElfTraining.milestones[2].earned.value?2:1).times(U.elfTraining.bonfireElfTraining.milestones[2].earned.value?2:1).times(U.elfTraining.kilnElfTraining.milestones[2].earned.value?2:1)),xe=Le(()=>({resource:lt.metal,cost(){let x=this.amount.value;a.gte(x,100)&&(x=a.pow(x,2).div(100)),a.gte(x,1e4)&&(x=a.pow(x,2).div(1e4));let Ut=a.pow(1.15,x).times(10);return U.elfTraining.fertilizerElfTraining.milestones[2].earned.value&&(Ut=Ut.div(a.add(de.totalLogs.value,Math.E).ln())),Ut},display:S(()=>n(M,null,[n("h3",null,[s("Mining Drill")]),n("br",null,null),s("Dig through the ground to find 50,000,000 coal"),n("br",null,null),n("br",null,null),s("Currently:"),n("br",null,null),s("+"),j(Oe.value),s(" coal/sec"),n("br",null,null),n("br",null,null),s("Cost: "),X(u(xe.cost)),s(" "),xe.resource.displayName])),onPurchase(){fe.value=a.add(fe.value,1)},style:{color:i,width:"160px"},visibility:()=>y(lt.coalDrill.bought.value)})),{max:qe,min:pe,add:Ze,remove:K}=il({buyable:xe,active:fe}),st=q(()=>({resource:R(o),cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),ze=q(()=>({resource:R(o),cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),Je=q(()=>({resource:R(r),cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),se=q(()=>({resource:N,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){N.value=a.add(N.value,this.cost)},style:{color:i}})),$e=[st,ze,Je,se],rt=q(()=>({resource:R(o),cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>y(se.bought.value)})),St=q(()=>({resource:R(o),cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>y(se.bought.value)})),nt=q(()=>({canAfford(){return a.gte(de.logs.value,1e5)&&a.gte(r.value,1e5)},onPurchase(){de.logs.value=a.sub(de.logs.value,1e5),r.value=a.sub(r.value,1e5)},display:S(()=>n(M,null,[n("h3",null,[s("Mulched Soil")]),n("br",null,null),s("Double the bonus from Fertilized Soil"),n("br",null,null),n("br",null,null),s("Cost: "),X(1e5),s(" "),de.logs.displayName,n("br",null,null),X(1e5),s(" "),r.displayName])),style:{color:i},visibility:()=>y(se.bought.value)})),ut=q(()=>({resource:de.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>y(se.bought.value)})),Ke=[rt,St,nt,ut],Ge=q(()=>({resource:R(o),cost:1e19,display:{title:"Efficient Crucibles",description:"Double auto smelting speed and triple metal gain from auto smelting"},style:{color:i},visibility:()=>y(ue.depthMilestones[4].earned.value)})),Et=[Ge],Mt=Le(()=>({resource:R(o),cost(){let x=this.amount.value;return a.gte(x,50)&&(x=a.pow(x,2).div(50)),a.gte(x,200)&&(x=a.pow(x,2).div(200)),a.gte(x,2e6)&&(x=a.pow(x,2).div(2e6)),x=a.pow(.95,V.books.heatedCuttersBook.amount.value).times(x),U.elfTraining.heatedCutterElfTraining.milestones[0].earned.value&&(x=a.pow(.95,V.books.heatedCuttersBook.amount.value).times(x)),a.add(x,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:S(()=>n(M,null,[s("Cutters cut down trees "),j(Tt.value),s("x faster")]))},style:{color:i},visibility:()=>y(st.bought.value)})),Dt=Le(()=>({resource:R(o),cost(){let x=this.amount.value;return a.gte(x,50)&&(x=a.pow(x,2).div(50)),a.gte(x,200)&&(x=a.pow(x,2).div(200)),a.gte(x,2e6)&&(x=a.pow(x,2).div(2e6)),x=a.pow(.95,V.books.heatedPlantersBook.amount.value).times(x),U.elfTraining.heatedPlanterElfTraining.milestones[0].earned.value&&(x=a.pow(.95,V.books.heatedPlantersBook.amount.value).times(x)),a.add(x,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:S(()=>n(M,null,[s("Planters plant trees "),j(we.value),s("x faster")]))},style:{color:i},visibility:()=>y(ze.bought.value)})),re=Le(()=>({resource:R(r),cost(){let x=this.amount.value;return a.gte(x,50)&&(x=a.pow(x,2).div(50)),a.gte(x,200)&&(x=a.pow(x,2).div(200)),a.gte(x,2e6)&&(x=a.pow(x,2).div(2e6)),x=a.pow(.95,V.books.fertilizerBook.amount.value).times(x),U.elfTraining.fertilizerElfTraining.milestones[1].earned.value&&(x=a.pow(.95,V.books.fertilizerBook.amount.value).times(x)),a.add(x,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:S(()=>n(M,null,[s("Trees give "),j(dt.value),s("x more logs")]))},style:{color:i},visibility:()=>y(Je.bought.value)})),Q=[Mt,Dt,re],he=W(()=>[ae(()=>({addend(){return a.times(Mt.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt(Mt.amount.value,0)}})),g(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:rt.bought}))]),Tt=v(()=>he.apply(1)),Wt=W(()=>[ae(()=>({addend(){return a.times(Dt.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt(Dt.amount.value,0)}})),g(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:St.bought}))]),we=v(()=>Wt.apply(1)),Ne=W(()=>[ae(()=>({addend(){return a.times(re.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(re.amount.value,0)}})),g(()=>({multiplier:2,description:"Mulched Soil",enabled:nt.bought}))]),dt=v(()=>Ne.apply(1)),It=W(()=>[ae(()=>({addend(){return m.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ae(()=>({addend(){return B.value},description:"Bonfires",enabled(){return a.gt(T.value,0)}})),ae(()=>({addend(){return ye.value},description:"Charcoal Kilns",enabled(){return a.gt(ne.value,0)}})),ae(()=>({addend(){return Oe.value},description:"Mining Drills",enabled(){return a.gt(fe.value,0)}})),g(()=>({multiplier:2,description:"Carry coal in boxes",enabled:it.upgrades.coalUpgrade.bought})),g(()=>({multiplier:()=>a.div(it.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:it.upgrades.coalUpgrade.bought})),g(()=>({multiplier:()=>a.div(w.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:Pe.elves.smallFireElf.bought})),g(()=>({multiplier:()=>a.div(F.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Pe.elves.bonfireElf.bought})),g(()=>({multiplier:()=>a.div(te.amount.value,100).times(We.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Pe.elves.kilnElf.bought})),g(()=>({multiplier:2,description:"Mining overalls",enabled:vt.metalUpgrades.metalUpgrade2.bought})),g(()=>({multiplier:3,description:"Mining helmet",enabled:vt.metalUpgrades.metalUpgrade3.bought})),g(()=>({multiplier:4,description:"Felt-Gripped Pick",enabled:vt.metalUpgrades.metalUpgrade4.bought})),g(()=>({multiplier:2,description:"12 Elves Trained",enabled:Pe.milestones[11].earned})),ml(()=>({exponent:1.25,description:"3 Elves Trained",enabled:Pe.milestones[2].earned,supportLowNumbers:!0})),g(()=>({multiplier:()=>a.mul(ue.depth.value,.25).add(1),description:"5m Well Depth",enabled:ue.depthMilestones[0].earned})),g(()=>({multiplier:ue.extractorCoal,description:"Heavy Extractor",enabled:()=>a.gt(ue.activeExtractor.value,0)})),ml(()=>({exponent:1.05,description:"Jack Level 2",enabled:U.elfTraining.heatedCutterElfTraining.milestones[1].earned}))]),ot=v(()=>It.apply(0)),Pt=W(()=>[ae(()=>({addend(){return p.value},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ae(()=>({addend(){return E.value},description:"Bonfires",enabled(){return a.gt(T.value,0)}})),ae(()=>({addend(){return ee.value},description:"Charcoal Kilns",enabled(){return a.gt(ne.value,0)}})),g(()=>({multiplier:2,description:"Carry ash in boxes",enabled:it.upgrades.ashUpgrade.bought})),g(()=>({multiplier:()=>a.div(it.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:it.upgrades.ashUpgrade.bought})),g(()=>({multiplier:()=>a.div(w.amount.value,1e3).add(1),description:"Small Fires Synergy",enabled:Pe.elves.smallFireElf.bought})),g(()=>({multiplier:()=>a.div(F.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:Pe.elves.bonfireElf.bought})),g(()=>({multiplier:()=>a.div(te.amount.value,100).times(We.boosts.green2.value).add(1),description:"Kiln Synergy",enabled:Pe.elves.kilnElf.bought})),g(()=>({multiplier:4,description:"Mining boots",enabled:vt.metalUpgrades.metalUpgrade1.bought})),ml(()=>({exponent:1.1,description:"Joy Level 2",enabled:U.elfTraining.smallfireElfTraining.milestones[1].earned})),ml(()=>({exponent:1.1,description:"Faith Level 2",enabled:U.elfTraining.bonfireElfTraining.milestones[1].earned})),ml(()=>({exponent:1.1,description:"Snowball Level 2",enabled:U.elfTraining.kilnElfTraining.milestones[1].earned}))]),rl=v(()=>Pt.apply(0)),ul=W(()=>[ae(()=>({addend(){return a.negate(c.value)},description:"Small Fires",enabled(){return a.gt(d.value,0)}})),ae(()=>({addend(){return a.negate(J.value)},description:"Bonfires",enabled(){return a.gt(T.value,0)}})),ae(()=>({addend(){return a.negate(Be.value)},description:"Charcoal Kilns",enabled(){return a.gt(ne.value,0)}}))]),le=v(()=>ul.apply(0)),[$,Qe]=sl(()=>[{title:"Log Consumption",modifier:ul,base:0,visible(){return a.gt(d.value,0)||a.gt(T.value,0)||a.gt(ne.value,0)}},{title:"Coal Gain",modifier:It,base:0,visible(){return a.gt(d.value,0)||a.gt(T.value,0)||a.gt(ne.value,0)}},{title:"Ash Gain",modifier:Pt,base:0,visible(){return a.gt(d.value,0)||a.gt(T.value,0)||a.gt(ne.value,0)}}]),tt=H(!1),Gt=S(()=>n(Ct,{modelValue:tt.value,"onUpdate:modelValue":x=>tt.value=x},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:$}));et.on("update",x=>{a.lt(O.day.value,si)||a.times(x,le.value).negate().gt(de.logs.value)||(de.logs.value=a.times(x,le.value).plus(de.logs.value),o.value=a.times(x,ot.value).plus(o.value),r.value=a.times(x,rl.value).plus(r.value),d.value=a.max(d.value,0))});const{total:Ft,trackerDisplay:zt}=hl({resource:o,goal:1e7,name:e,day:si,color:t,modal:{show:tt,display:Gt}});return{name:e,color:t,coal:o,totalCoal:Ft,computedCoalGain:ot,ash:r,activeFires:d,buildFire:w,activeBonfires:T,buildBonfire:F,activeKilns:ne,buildKiln:te,activeDrills:fe,buildDrill:xe,warmerCutters:st,warmerPlanters:ze,basicFertilizer:Je,unlockBonfire:se,dedicatedCutters:rt,dedicatedPlanters:St,betterFertilizer:nt,unlockKiln:ut,efficientSmelther:Ge,heatedCutters:Mt,heatedPlanters:Dt,moreFertilizer:re,computedHeatedCutterEffect:Tt,computedHeatedPlanterEffect:we,computedFertilizerEffect:dt,generalTabCollapsed:Qe,minWidth:700,display:S(()=>n(M,null,[ce(zt),n(_e,null,null),n(Lt,{resource:o,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(ot.value,0)?`+${j(ot.value)}/s`:void 0},null),n(_e,null,null),n(Lt,{resource:r,color:l,style:"margin-bottom: 0",effectDisplay:a.gt(rl.value,0)?`+${j(rl.value)}/s`:void 0},null),n(_e,null,null),n($l,null,{default:()=>[n(Qt,null,{default:()=>[ce(w),n("div",null,[X(a.floor(d.value)),s("/"),X(a.floor(w.amount.value))]),at(b,_,f,A)]}),se.bought.value?n(M,null,[n(_e,null,null),n(Qt,null,{default:()=>[ce(F),n("div",null,[X(T.value),s("/"),X(F.amount.value)]),at(Z,ve,oe,ie)]})]):void 0,ut.bought.value?n(M,null,[n(_e,null,null),n(Qt,null,{default:()=>[ce(te),n("div",null,[X(ne.value),s("/"),X(te.amount.value)]),at(Ue,Re,Se,De)]})]):void 0,lt.coalDrill.bought.value?n(M,null,[n(_e,null,null),n(Qt,null,{default:()=>[ce(xe),n("div",null,[X(fe.value),s("/"),X(xe.amount.value)]),at(pe,K,Ze,qe)]})]):void 0]}),n(_e,null,null),Sl($e,Ke,Et),at(...Q)]))}}),Ar="workshop",jl=2,Ot=$t(Ar,function(){const e="Workshop",t="#D66B02",l="#D66B02",i=yt(0,"foundation progress"),o=zs(()=>({scaling:ai(ai(Ha(250,1.5),5387,1/1e10),1e20,1e9),baseResource:de.logs,gainResource:R(i),roundUpCost:!0,buyMax:U.elfTraining.heatedCutterElfTraining.milestones[2].earned,spend(ne,Be){de.logs.value=a.sub(de.logs.value,Be)},costModifier:W(()=>[ml(()=>({exponent:.95,description:"Holly Level 5",enabled:U.elfTraining.cutterElfTraining.milestones[4].earned}))])})),r=qt(()=>({display:S(()=>n(M,null,[n("b",{style:"font-size: x-large"},[s("Build part of the foundation")]),n("br",null,null),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost:")," ",na(de.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",de.logs.displayName])])),visibility:()=>y(a.lt(i.value,100)||U.elfTraining.expandersElfTraining.milestones[2].earned.value),canClick:()=>a.gte(o.actualGain.value,1)&&(a.lt(i.value,100)||U.elfTraining.expandersElfTraining.milestones[2].earned.value),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),d=Ql(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{r.canClick.value&&r.onClick()}})),c=v(()=>!Pe.milestones[6].earned.value),m=P(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(i.value,1),showPopups:c})),p=P(()=>({display:{requirement:"10% Foundation Completed",effectDisplay:"Cut an additional tree per second for each 5% of foundation completed"},shouldEarn:()=>a.gte(i.value,10),visibility:()=>y(m.earned.value),showPopups:c})),w=P(()=>({display:{requirement:"20% Foundation Completed",effectDisplay:"Plant an additional tree per second for each 10% of foundation completed"},shouldEarn:()=>a.gte(i.value,20),visibility:()=>y(p.earned.value),showPopups:c})),b=P(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(i.value,30),visibility:()=>y(w.earned.value),showPopups:c})),A=P(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(i.value,40),visibility:()=>y(b.earned.value),showPopups:c})),f=P(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(i.value,50),visibility:()=>y(A.earned.value),showPopups:c})),_=P(()=>({display:{requirement:"75% Foundation Completed",effectDisplay:"The forest gains an extra tree for every 2% of foundation completed"},shouldEarn:()=>a.gte(i.value,75),visibility:()=>y(f.earned.value),showPopups:c})),N=P(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>a.gte(i.value,100),visibility:()=>y(_.earned.value),showPopups:c})),T=P(()=>({display:{requirement:"200% Foundation Completed",effectDisplay:"The 1% milestone is now +2% and multiplicative"},shouldEarn:()=>a.gte(i.value,200),visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),J=P(()=>({display:{requirement:"400% Foundation Completed",effectDisplay:"Gain +10% metal for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,400),visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),B=P(()=>({display:{requirement:"600% Foundation Completed",effectDisplay:"Gain +10% oil for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,600),visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),E=P(()=>({display:{requirement:"800% Foundation Completed",effectDisplay:"Gain +10% plastic for every 10% foundation completed"},shouldEarn:()=>a.gte(i.value,800),visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),F=P(()=>({display:{requirement:"1000% Foundation Completed",effectDisplay:"Double paper, boxes, and all cloth actions"},shouldEarn:()=>a.gte(i.value,1e3),visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[2].earned.value),showPopups:c})),Z={logGainMilestone1:m,autoCutMilestone1:p,autoPlantMilestone1:w,autoCutMilestone2:b,autoPlantMilestone2:A,logGainMilestone2:f,morePlantsMilestone1:_,logGainMilestone3:N,extraExpansionMilestone1:T,extraExpansionMilestone2:J,extraExpansionMilestone3:B,extraExpansionMilestone4:E,extraExpansionMilestone5:F},{collapseMilestones:ie,display:oe}=ta(Z),ve=el(()=>({direction:Fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>O.day.value===jl?a.div(i.value,100):1,display:S(()=>O.day.value===jl?n(M,null,[X(i.value),s("%")]):"")}));return Vt(()=>{O.day.value===jl&&a.gte(i.value,100)&&O.completeDay()}),{name:e,day:jl,color:t,foundationProgress:i,foundationConversion:o,milestones:Z,collapseMilestones:ie,minWidth:700,buildFoundationHK:d,display:S(()=>n(M,null,[n("div",null,[O.day.value===jl?"Complete the foundation to complete the day":`${e} Complete!`]),ce(ve),n(_e,null,null),n("div",null,[n("span",null,[s("The foundation is ")]),n("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[X(i.value)]),s("% completed")]),a.lt(i.value,100)||U.elfTraining.expandersElfTraining.milestones[2].earned.value?n(_e,null,null):null,ce(r),n(_e,null,null),oe()]))}}),kr="elves",Jl=4,Pe=$t(kr,function(){const e="Elves",t="red",l="#911D21",o=el(()=>({direction:Fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${l}`,progress:()=>O.day.value===Jl?a.div(Ge.value,6).times(.8333333333333334).add(a.div(a.add(L.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:S(()=>O.day.value===Jl?a.lt(Ge.value,6)?n(M,null,[X(Ge.value),s("/6 elves")]):n(M,null,[X(L.coal.value),s("/"),X(1e9),s(" coal")]):"")})),r=fr(()=>({thingsToReset:[de,Ot,L],onReset(){setTimeout(()=>{we.earned.value?(de.row1Upgrades.forEach(le=>le.bought.value=!0),de.row2Upgrades.forEach(le=>le.bought.value=!0)):Mt.earned.value&&(de.row1Upgrades[4].bought.value=!0,de.row2Upgrades[4].bought.value=!0),Tt.earned.value&&(Ot.foundationProgress.value=100),dt.earned.value&&(L.warmerCutters.bought.value=!0,L.warmerPlanters.bought.value=!0,L.basicFertilizer.bought.value=!0,L.unlockBonfire.bought.value=!0,L.dedicatedCutters.bought.value=!0,L.dedicatedPlanters.bought.value=!0,L.betterFertilizer.bought.value=!0,L.unlockKiln.bought.value=!0,L.efficientSmelther.bought.value=!0)})}})),d=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>a.gt(V.books.cuttersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),c=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>a.gt(V.books.plantersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),m=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>a.gt(V.books.expandersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),p=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>a.gt(V.books.heatedCuttersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),w=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>a.gt(V.books.heatedPlantersBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),b=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>a.gt(V.books.fertilizerBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),A=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>a.gt(V.books.smallFireBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),f=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>a.gt(V.books.bonfireBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),_=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>a.gt(V.books.kilnBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),N=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.paperBook.amount.value,.1).add(1),description:"The Book Thief",enabled:()=>a.gt(V.books.paperBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),T=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.boxBook.amount.value,.1).add(1),description:"Not a box",enabled:()=>a.gt(V.books.boxBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),J=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.clothBook.amount.value,.1).add(1),description:"Fuzzy Bee and Friends",enabled:()=>a.gt(V.books.clothBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),B=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.miningDrillBook.amount.value,.1).add(1),description:"Drills and Mills",enabled:()=>a.gt(V.books.miningDrillBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),E=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.heavyDrillBook.amount.value,.1).add(1),description:"Deep in the Earth",enabled:()=>a.gt(V.books.heavyDrillBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),F=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.oilBook.amount.value,.1).add(1),description:"Burning the Midnight Oil",enabled:()=>a.gt(V.books.oilBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),Z=W(()=>[g(()=>({multiplier:2,description:"6 Elves Trained",enabled:he.earned})),g(()=>({multiplier:()=>a.times(V.books.metalBook.amount.value,.1).add(1),description:"Physical Metallurgy",enabled:()=>a.gt(V.books.metalBook.amount.value,0)})),g(()=>({multiplier:2,description:"10 Elves Trained",enabled:Ne.earned}))]),[ie,oe]=sl(()=>[{title:"Holly Auto-Buy Frequency",modifier:d,base:10,unit:"/s",visible:Ke.cuttersElf.bought},{title:"Ivy Auto-Buy Frequency",modifier:c,base:10,unit:"/s",visible:Ke.plantersElf.bought},{title:"Hope Auto-Buy Frequency",modifier:m,base:10,unit:"/s",visible:Ke.expandersElf.bought},{title:"Jack Auto-Buy Frequency",modifier:p,base:10,unit:"/s",visible:Ke.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:Ke.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:b,base:10,unit:"/s",visible:Ke.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:A,base:10,unit:"/s",visible:Ke.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:f,base:10,unit:"/s",visible:Ke.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:_,base:10,unit:"/s",visible:Ke.kilnElf.bought},{title:"Star Auto-Buy Frequency",modifier:N,base:10,unit:"/s",visible:Ke.paperElf.bought},{title:"Bell Auto-Buy Frequency",modifier:T,base:10,unit:"/s",visible:Ke.boxElf.bought},{title:"Gingersnap Auto-Buy Frequency",modifier:J,base:10,unit:"/s",visible:Ke.clothElf.bought},{title:"Peppermint Auto-Buy Frequency",modifier:B,base:10,unit:"/s",visible:U.elfTraining.expandersElfTraining.milestones[3].earned},{title:"Frosty Auto-Buy Frequency",modifier:E,base:10,unit:"/s",visible:U.elfTraining.fertilizerElfTraining.milestones[4].earned.value},{title:"Cocoa Auto-Buy Frequency",modifier:F,base:10,unit:"/s",visible:U.elfTraining.heatedCutterElfTraining.milestones[4].earned.value},{title:"Twinkle Auto-Buy Frequency",modifier:Z,base:10,unit:"/s",visible:U.elfTraining.expandersElfTraining.milestones[4].earned}]),ve=H(!1),ne=S(()=>n(Ct,{modelValue:ve.value,"onUpdate:modelValue":le=>ve.value=le},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:ie})),Be=v(()=>{let le=a.pow(4,Ge.value).times(1e6);return a.gte(Ge.value,9)&&(le=a.times(le,1e15)),le});function ye(le){var wl,Dl;const $=Me(0),Qe=Me(0),tt=le.hasToggle?Me(!1):H(!0),Gt=v(()=>le.cooldownModifier.apply(10)),Ft=kt((wl=le.canBuy)!=null?wl:!0),zt=kt((Dl=le.buyMax)!=null?Dl:!1);function x(Kt){if(Ut.bought.value&&u(Ft)){$.value=a.add($.value,Kt);const pl=a.recip(Gt.value);Qe.value+=Kt/pl.toNumber(),(Ia(le.buyable)?le.buyable:[le.buyable]).forEach(tl=>{var Il;for(;zt||a.gte($.value,pl);)if(le.customCost==null?u(tl.canPurchase):a.gte(tl.resource.value,le.customCost(tl.amount.value)))tl.amount.value=a.add(tl.amount.value,1),$.value=a.sub($.value,pl),(Il=le.onAutoPurchase)==null||Il.call(le,tl);else{$.value=pl;break}})}}const Ut=q(()=>({...le,buyable:void 0,toggle:tt,buyProgress:$,update:x,resource:L.coal,cost:Be,computedAutoBuyCooldown:Gt,amountOfTimesDone:Qe,name:le.name,display:()=>({title:le.name,description:S(()=>n(M,null,[le.description,Ut.bought.value?null:n(M,null,[" ",s("Training this elf will require resetting all your progress from days 1-3.")]),Ut.bought.value&&le.hasToggle===!0?n(M,null,[n(vl,{title:le.toggleDesc,"onUpdate:modelValue":Kt=>tt.value=Kt,modelValue:tt.value},null)]):null])),showCost:!Ut.bought.value}),style:"width: 190px",onPurchase(){var Kt;(Kt=le.onPurchase)==null||Kt.call(le),r.reset()}}));return Ut}const ee=ye({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:de.row1Buyables[0],cooldownModifier:d,buyMax:()=>U.elfTraining.cutterElfTraining.milestones[1].earned.value}),te=ye({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:de.row1Buyables[1],cooldownModifier:c,buyMax:()=>U.elfTraining.planterElfTraining.milestones[1].earned.value}),Ue=ye({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:de.row1Buyables[2],cooldownModifier:m,buyMax:()=>U.elfTraining.expandersElfTraining.milestones[1].earned.value}),De=[ee,te,Ue],Se=ye({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:L.heatedCutters,cooldownModifier:p,buyMax:()=>U.elfTraining.heatedCutterElfTraining.milestones[2].earned.value}),Re=ye({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:L.heatedPlanters,cooldownModifier:w,buyMax:()=>U.elfTraining.heatedPlanterElfTraining.milestones[2].earned.value}),fe=ye({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:L.moreFertilizer,cooldownModifier:b}),Oe=[Se,Re,fe],xe=ye({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:L.buildFire,cooldownModifier:A,visibility:()=>y(it.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){xe.toggle.value&&(L.activeFires.value=a.add(L.activeFires.value,1))},onPurchase(){O.days[4].recentlyUpdated.value=!0}}),qe=ye({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:L.buildBonfire,cooldownModifier:f,visibility:()=>y(it.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){const le=u(this.buyable.cost);L.activeFires.value=a.sub(L.activeFires.value,le).max(0),L.buildFire.amount.value=a.sub(L.buildFire.amount.value,le).max(0),qe.toggle.value&&(L.activeBonfires.value=a.add(L.activeBonfires.value,1))},onPurchase(){O.days[4].recentlyUpdated.value=!0},canBuy:L.unlockBonfire.bought}),pe=ye({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:L.buildKiln,cooldownModifier:_,visibility:()=>y(it.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){pe.toggle.value&&(L.activeKilns.value=a.add(L.activeKilns.value,1))},onPurchase(){O.days[4].recentlyUpdated.value=!0},canBuy:L.unlockKiln.bought}),Ze=[xe,qe,pe],K=ye({name:"Star",description:"Star will automatically purchase all books you can afford, without actually spending any paper.",buyable:Object.values(V.books),cooldownModifier:N,visibility:()=>y(Ye.elfUpgrades.paperElf.bought.value)}),st=ye({name:"Bell",description:"Bell will automatically purchase all box buyables you can afford, without actually spending any boxes.",buyable:Object.values(it.buyables),cooldownModifier:T,visibility:()=>y(Ye.elfUpgrades.boxElf.bought.value)}),ze=ye({name:"Gingersnap",description:"Gingersnap will automatically purchase all cloth buyables you can afford, without actually spending any resources.",buyable:[vt.buildPens,vt.betterShears,vt.fasterSpinning],cooldownModifier:J,visibility:()=>y(Ye.elfUpgrades.clothElf.bought.value)}),Je=[K,st,ze],se=ye({name:"Peppermint",description:"Peppermint will automatically purchase all mining drills you can afford, without actually spending any resources.",buyable:L.buildDrill,cooldownModifier:B,visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[3].earned.value),hasToggle:!0,toggleDesc:"Activate auto-purchased mining drills",onAutoPurchase(){se.toggle.value&&(L.activeDrills.value=a.add(L.activeDrills.value,1))}}),$e=ye({name:"Frosty",description:"Frosty will automatically purchase all drill types in the oil section, without actually spending any resources.",buyable:[ue.buildHeavy,ue.buildHeavy2,ue.buildExtractor],cooldownModifier:E,visibility:()=>y(U.elfTraining.fertilizerElfTraining.milestones[4].earned.value),hasToggle:!0,toggleDesc:"Activate auto-purchased oil drills",onAutoPurchase(le){$e.toggle.value&&(le===ue.buildHeavy||le===ue.buildHeavy||le===ue.buildHeavy)&&(ue.activeHeavy.value=a.add(ue.activeHeavy.value,1))}}),rt=ye({name:"Cocoa",description:"Cocoa will automatically purchase all oil-using machines you can afford, without actually spending any resources.",buyable:[ue.buildPump,ue.buildBurner,ue.buildSmelter],cooldownModifier:F,visibility:()=>y(U.elfTraining.heatedCutterElfTraining.milestones[4].earned.value),hasToggle:!0,toggleDesc:"Activate auto-purchased oil-using machines",onAutoPurchase(le){$e.toggle.value&&(le===ue.buildPump?ue.activePump.value=a.add(ue.activePump.value,1):le===ue.buildBurner?ue.activeBurner.value=a.add(ue.activeBurner.value,1):le===ue.buildSmelter&&(ue.activeSmelter.value=a.add(ue.activeSmelter.value,1)))}}),St=[se,$e,rt],nt=ye({name:"Twinkle",description:"Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.",buyable:[lt.oreDrill,lt.industrialCrucible,lt.hotterForge],cooldownModifier:Z,visibility:()=>y(U.elfTraining.expandersElfTraining.milestones[4].earned.value)}),ut=[nt],Ke={cuttersElf:ee,plantersElf:te,expandersElf:Ue,heatedCuttersElf:Se,heatedPlantersElf:Re,fertilizerElf:fe,smallFireElf:xe,bonfireElf:qe,kilnElf:pe,paperElf:K,boxElf:st,clothElf:ze,miningDrillElf:se,heavyDrillElf:$e,oilElf:rt,metalElf:nt},Ge=v(()=>Object.values(Ke).filter(le=>le.bought.value).length),Et=P(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(Ge.value,1)})),Mt=P(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>a.gte(Ge.value,2),visibility:()=>y(Et.earned.value)})),Dt=P(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(Ge.value,3),visibility:()=>y(Mt.earned.value)})),re=P(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(Ge.value,4),visibility:()=>y(Dt.earned.value)})),Q=P(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(Ge.value,5),visibility:()=>y(re.earned.value)})),he=P(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(Ge.value,6),visibility:()=>y(Q.earned.value)})),Tt=P(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>a.gte(Ge.value,7),visibility:()=>y(he.earned.value&&O.day.value>5)})),Wt=P(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>a.gte(Ge.value,8),visibility:()=>y(Tt.earned.value)})),we=P(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>a.gte(Ge.value,9),visibility:()=>y(Wt.earned.value)})),Ne=P(()=>({display:{requirement:"10 Elves Trained",effectDisplay:"Elves work twice as fast (again)"},shouldEarn:()=>a.gte(Ge.value,10),visibility:()=>y(O.day.value>=10)})),dt=P(()=>({display:{requirement:"11 Elves Trained",effectDisplay:"Coal upgrades aren't reset after training"},shouldEarn:()=>a.gte(Ge.value,11),visibility:()=>y(Ne.earned.value)})),It=P(()=>({display:{requirement:"12 Elves Trained",effectDisplay:"Double coal gain"},shouldEarn:()=>a.gte(Ge.value,12),visibility:()=>y(dt.earned.value)})),ot=[Et,Mt,Dt,re,Q,he,Tt,Wt,we,Ne,dt,It],Pt={manualMilestone:Et,researchMilestone:Mt,coalGainMilestone:Dt,logGainMilestone:re,forestMilestone:Q,elvesMilestone:he,foundationMilestone:Tt,forestMilestone2:Wt,treeUpgradesMilestone:we,elvesMilestone2:Ne,coalUpgradesMilestone:dt,coalGainMilestone2:It},{collapseMilestones:rl,display:ul}=ta(Pt);return et.on("update",le=>{a.lt(O.day.value,Jl)||Object.values(Ke).forEach($=>$.update(le))}),Vt(()=>{O.day.value===Jl&&a.gte(Ge.value,6)&&a.gte(L.coal.value,1e9)&&O.completeDay()}),{name:e,color:t,elves:Ke,totalElves:Ge,milestones:ot,collapseMilestones:rl,generalTabCollapsed:oe,minWidth:700,display:S(()=>n(M,null,[n("div",null,[O.day.value===Jl?`Reach ${X(6)} trained elves and ${X(1e9)} ${L.coal.displayName} to complete the day`:`${e} Complete!`," ",s("-")," ",n("button",{class:"button",style:"display: inline-block;",onClick:()=>ve.value=!0},[s("Check Modifiers")])]),ce(o),ce(ne),n(_e,null,null),n("div",{style:"width: 600px"},[Sl(De,Oe,Ze,Je,St,ut)]),ul()]))}}),Cr="management",Wl=12,Na=13,U=$t(Cr,()=>{const e="Management",t="green",l=el(()=>({direction:Fe.Right,width:600,height:25,fillStyle:`backgroundColor: ${t}`,progress:()=>O.day.value===Wl?st.reduce(($,Qe)=>$+Math.min(1,Qe.level.value/3),0)/st.length:O.day.value===Na?ze.reduce(($,Qe)=>$+Math.min(1,Qe.level.value/5),0)/ze.length:1,display:S(()=>O.day.value===Wl?n(M,null,[X(i.value),s("/"),X(Pe.totalElves.value*5)," ",s("elf levels")]):"")})),i=v(()=>{let $=0;for(const Qe of Object.values(K))$+=Qe.level.value;return $}),o=v(()=>Object.values(K).reduce(($,Qe)=>$.add(Qe.exp.value),new a(0))),r=q(()=>({display:{title:"Teach the Elves",description:"The Elves probably need to be taught if they're to do better. Maybe you'll build a school so you can teach them?"},resource:de.logs,cost:1e21})),d=q(()=>({display:{title:"Add a Classroom?",description:"Yay, you have a school. Too bad it has pretty much nothing in it. Maybe you could add some classrooms to make it less boring and more enticing to the Elves?"},visibility:()=>y(r.bought.value),resource:it.boxes,style:"width: 150px",cost:1e13})),c=W(()=>[g(()=>({multiplier:It,description:"Classroom Effect",enabled:d.bought}))]),m=v(()=>c.apply(1));function p($,Qe,...tt){const Gt=Me(0);let Ft=["Holly","Ivy","Hope","Jack","Mary","Noel","Joy","Faith","Snowball","Star","Bell","Gingersnap"].indexOf($.name)+1;($.name=="Star"||$.name=="Bell")&&(Ft/=3);const zt=v(()=>a.pow(10,x.value).mul(4e3).mul(Ft)),x=v(()=>a.min(a.mul(9,Gt.value).div(4e3).div(Ft).add(1).log10().floor(),Ne.amount.value).toNumber()),Ut=v(()=>a.sub(Gt.value,a.pow(10,x.value).sub(1).div(9).mul(4e3))),wl=el(()=>({direction:Fe.Right,width:160,height:12,style:()=>({"margin-top":"8px","box-shadow":se.value[$.name]?"0 0 12px "+(ie.value==$.name?"black":"white"):""}),baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",borderStyle:()=>a.gte(x.value,Ne.amount.value)?"border-color: red":"",progress:()=>a.div(Ut.value,zt.value),display:S(()=>a.gte(x.value,Ne.amount.value)?n(M,null,[s("Limit reached")]):n(M,null,[j(Ut.value),s("/"),j(zt.value),s(" XP")]))})),{collapseMilestones:Dl,display:Kt}=ta(Qe),pl=W(()=>[g(()=>({multiplier:m,description:"Global XP Multiplier"})),g(()=>({multiplier:Je,description:"Focus Multiplier",enabled:()=>a.gt(rt.value,0)&&se.value[$.name]==!0})),...tt]),tl=v(()=>pl.apply(.1));return qt(()=>({display:{title:$.name,description:S(()=>n(M,null,[$.name,s(" is currently at level "),X(x.value),s(", and achieved a total of "),j(Gt.value),s(" XP. They buy buyables")," ",X($.computedAutoBuyCooldown.value),s(" times per second, gaining")," ",a.gte(x.value,Ne.amount.value)?0:j(a.mul(tl.value,$.computedAutoBuyCooldown.value))," ",s("XP/sec."),ce(wl)]))},style:()=>({width:"190px",background:ie.value==$.name?"var(--foreground)":""}),onClick(){ie.value=$.name},canClick(){return ie.value!==$.name},name:$.name,state:Dl,displayMilestone:Kt,level:x,exp:Gt,milestones:Qe,timeForExp:$.computedAutoBuyCooldown,amountOfTimesDone:$.amountOfTimesDone,elfXPGainComputed:tl,elfXPGain:pl}))}const w=[P(()=>({display:{requirement:"Holly Level 1",effectDisplay:S(()=>n(M,null,[s("Multiply log gain by "),n("sup",null,[s("9")]),n(cl,null,{default:()=>[s("Cutter amount")]}),s(".")]))},shouldEarn:()=>ve.level.value>=1})),P(()=>({display:{requirement:"Holly Level 2",effectDisplay:"Holly now buys max."},visibility:()=>y(w[0].earned.value),shouldEarn:()=>ve.level.value>=2})),P(()=>({display:{requirement:"Holly Level 3",effectDisplay:S(()=>n(M,null,[s("Multiply all cloth actions' effectiveness by "),n("sup",null,[s("9")]),n(cl,null,{default:()=>[s("Cutter amount")]}),s(".")]))},visibility:()=>y(w[1].earned.value),shouldEarn:()=>ve.level.value>=3})),P(()=>({display:{requirement:"Holly Level 4",effectDisplay:"Multiply auto cutting amount by 1.1 per day completed"},visibility:()=>y(w[2].earned.value&&O.day.value>=13),shouldEarn:()=>ve.level.value>=4})),P(()=>({display:{requirement:"Holly Level 5",effectDisplay:"Raise workshop expansion cost by 0.95"},visibility:()=>y(w[3].earned.value&&O.day.value>=13),shouldEarn:()=>ve.level.value>=5}))],b=[P(()=>({display:{requirement:"Ivy Level 1",effectDisplay:"Planters are now twice as efficent."},shouldEarn:()=>ne.level.value>=1})),P(()=>({display:{requirement:"Ivy Level 2",effectDisplay:"Ivy now buys max."},visibility:()=>y(b[0].earned.value),shouldEarn:()=>ne.level.value>=2})),P(()=>({display:{requirement:"Ivy Level 3",effectDisplay:S(()=>n(M,null,[s("Auto planting speed is multiplied by 2"),n("sup",null,[s("(log"),n("sub",null,[s("10")]),s("(logs)"),n("sup",null,[s("0.2")]),s(")")])]))},visibility:()=>y(b[1].earned.value),shouldEarn:()=>ne.level.value>=3})),P(()=>({display:{requirement:"Ivy Level 4",effectDisplay:"Divide planter cost by 10"},visibility:()=>y(b[2].earned.value&&O.day.value>=13),shouldEarn:()=>ne.level.value>=4})),P(()=>({display:{requirement:"Ivy Level 5",effectDisplay:"The lesser of auto planting and cutting amounts is increased to match the greater"},visibility:()=>y(b[3].earned.value&&O.day.value>=13),shouldEarn:()=>ne.level.value>=5}))],A=[P(()=>({display:{requirement:"Hope Level 1",effectDisplay:"Forest size grows by trees planted per second raised to ^0.99"},shouldEarn:()=>Be.level.value>=1})),P(()=>({display:{requirement:"Hope Level 2",effectDisplay:"Hope now buys max."},visibility:()=>y(A[0].earned.value),shouldEarn:()=>Be.level.value>=2})),P(()=>({display:{requirement:"Hope Level 3",effectDisplay:"The workshop can be expanded past 100%, but costs scale faster. It also buys max now."},visibility:()=>y(A[1].earned.value),shouldEarn:()=>Be.level.value>=3})),P(()=>({display:{requirement:"Hope Level 4",effectDisplay:"Unlock an elf that autobuys mining drills."},visibility:()=>y(A[2].earned.value&&O.day.value>=13),shouldEarn:()=>Be.level.value>=4})),P(()=>({display:{requirement:"Hope Level 5",effectDisplay:"Unlock an elf that autobuys metal buyables."},visibility:()=>y(A[3].earned.value&&O.day.value>=13),shouldEarn:()=>Be.level.value>=5}))],f=[P(()=>({display:{requirement:"Jack Level 1",effectDisplay:'"Fahrenheit 451" affects "Heated Cutters" twice.'},shouldEarn:()=>ee.level.value>=1})),P(()=>({display:{requirement:"Jack Level 2",effectDisplay:"Coal gain is raised to the ^1.05"},visibility:()=>y(f[0].earned.value),shouldEarn:()=>ee.level.value>=2})),P(()=>({display:{requirement:"Jack Level 3",effectDisplay:"Jack now buys max."},visibility:()=>y(f[1].earned.value),shouldEarn:()=>ee.level.value>=3})),P(()=>({display:{requirement:"Jack Level 4",effectDisplay:S(()=>n(M,null,[s("Oil gain is multiplied by "),n(cl,null,{default:()=>[s("total elf levels")]}),s(".")]))},visibility:()=>y(f[2].earned.value&&O.day.value>=13),shouldEarn:()=>ee.level.value>=4})),P(()=>({display:{requirement:"Jack Level 5",effectDisplay:"Unlock an elf that autobuys oil-using machines."},visibility:()=>y(f[3].earned.value&&O.day.value>=13),shouldEarn:()=>ee.level.value>=5}))],_=[P(()=>({display:{requirement:"Mary Level 1",effectDisplay:'"Tillamook Burn Country" affects "Heated Planters" twice.'},shouldEarn:()=>te.level.value>=1})),P(()=>({display:{requirement:"Mary Level 2",effectDisplay:"Double automatic tree planting speed"},visibility:()=>y(_[0].earned.value),shouldEarn:()=>te.level.value>=2})),P(()=>({display:{requirement:"Mary Level 3",effectDisplay:"Mary now buys max."},visibility:()=>y(_[1].earned.value),shouldEarn:()=>te.level.value>=3})),P(()=>({display:{requirement:"Mary Level 4",effectDisplay:"Metal gain is raised to the 1.1."},visibility:()=>y(_[2].earned.value&&O.day.value>=13),shouldEarn:()=>te.level.value>=4})),P(()=>({display:{requirement:"Mary Level 5",effectDisplay:S(()=>n(M,null,[s("Auto smelting speed is multiplied by "),n(cl,null,{default:()=>[s("total XP/1000")]}),s(".")]))},visibility:()=>y(_[3].earned.value&&O.day.value>=13),shouldEarn:()=>te.level.value>=5}))],N=[P(()=>({display:{requirement:"Noel Level 1",effectDisplay:S(()=>n(M,null,[s("Log gain is multiplied by "),n(cl,null,{default:()=>[s("total elf levels")]}),s(".")]))},shouldEarn:()=>te.level.value>=1})),P(()=>({display:{requirement:"Noel Level 2",effectDisplay:`"The Garden Tree's Handbook" affects "Fertilized Soil" twice`},visibility:()=>y(N[0].earned.value),shouldEarn:()=>te.level.value>=2})),P(()=>({display:{requirement:"Noel Level 3",effectDisplay:"Divide the mining drill cost by ln(Total logs + e)"},visibility:()=>y(N[1].earned.value),shouldEarn:()=>te.level.value>=3})),P(()=>({display:{requirement:"Noel Level 4",effectDisplay:S(()=>n(M,null,[s("Reduce oil refinery cost by (Plastic amount)"),n("sup",null,[s("2")])]))},visibility:()=>y(N[2].earned.value&&O.day.value>=13),shouldEarn:()=>te.level.value>=4})),P(()=>({display:{requirement:"Noel Level 5",effectDisplay:"Unlock an elf that autobuys drills and extractors"},visibility:()=>y(N[3].earned.value&&O.day.value>=13),shouldEarn:()=>te.level.value>=5}))],T=[P(()=>({display:{requirement:"Joy Level 1",effectDisplay:"Multiply small fire efficiency by 5."},shouldEarn:()=>Se.level.value>=1})),P(()=>({display:{requirement:"Joy Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>y(T[0].earned.value),shouldEarn:()=>Se.level.value>=2})),P(()=>({display:{requirement:"Joy Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>y(T[1].earned.value),shouldEarn:()=>Se.level.value>=3})),P(()=>({display:{requirement:"Joy Level 4",effectDisplay:"Metal gain is boosted by heavy drills"},visibility:()=>y(T[2].earned.value&&O.day.value>=13),shouldEarn:()=>Se.level.value>=4})),P(()=>({display:{requirement:"Joy Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>y(T[3].earned.value&&O.day.value>=13),shouldEarn:()=>Se.level.value>=5}))],J=[P(()=>({display:{requirement:"Faith Level 1",effectDisplay:"Multiply bonfire efficiency by 5."},shouldEarn:()=>Re.level.value>=1})),P(()=>({display:{requirement:"Faith Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>y(J[0].earned.value),shouldEarn:()=>Re.level.value>=2})),P(()=>({display:{requirement:"Faith Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>y(J[1].earned.value),shouldEarn:()=>Re.level.value>=3})),P(()=>({display:{requirement:"Faith Level 4",effectDisplay:"Oil gain is boosted by heavy drill drills"},visibility:()=>y(J[2].earned.value&&O.day.value>=13),shouldEarn:()=>Re.level.value>=4})),P(()=>({display:{requirement:"Faith Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>y(J[3].earned.value&&O.day.value>=13),shouldEarn:()=>Re.level.value>=5}))],B=[P(()=>({display:{requirement:"Snowball Level 1",effectDisplay:"Multiply kiln efficiency by 5."},shouldEarn:()=>fe.level.value>=1})),P(()=>({display:{requirement:"Snowball Level 2",effectDisplay:"Raise ash gain to the 1.1"},visibility:()=>y(B[0].earned.value),shouldEarn:()=>fe.level.value>=2})),P(()=>({display:{requirement:"Snowball Level 3",effectDisplay:"Mining drill is 2x more powerful"},visibility:()=>y(B[1].earned.value),shouldEarn:()=>fe.level.value>=3})),P(()=>({display:{requirement:"Snowball Level 4",effectDisplay:"Plastic gain is boosted by heavy extractors"},visibility:()=>y(B[2].earned.value&&O.day.value>=13),shouldEarn:()=>fe.level.value>=4})),P(()=>({display:{requirement:"Snowball Level 5",effectDisplay:"Raise Industrial Crucible's effect to the 1.1"},visibility:()=>y(B[3].earned.value&&O.day.value>=13),shouldEarn:()=>fe.level.value>=5}))],E=[P(()=>({display:{requirement:"Star Level 1",effectDisplay:"Book cost is divided by total books bought."},shouldEarn:()=>xe.level.value>=1})),P(()=>({display:{requirement:"Star Level 2",effectDisplay:"Pulp requires 10x less ash"},visibility:()=>y(E[0].earned.value),shouldEarn:()=>xe.level.value>=2})),P(()=>({display:{requirement:"Star Level 3",effectDisplay:"Book cost scaling 5x -> 4x"},visibility:()=>y(E[1].earned.value),shouldEarn:()=>xe.level.value>=3})),P(()=>({display:{requirement:"Star Level 4",effectDisplay:S(()=>n(M,null,[s("Multiply XP requirements by 0.95"),n("sup",null,[s("(total books)")])]))},visibility:()=>y(E[2].earned.value&&O.day.value>=13),shouldEarn:()=>xe.level.value>=4})),P(()=>({display:{requirement:"Star Level 5",effectDisplay:"Gain 5 free books for all elves that are at level 5 or above."},visibility:()=>y(E[3].earned.value&&O.day.value>=13),shouldEarn:()=>xe.level.value>=5}))],F=[P(()=>({display:{requirement:"Bell Level 1",effectDisplay:S(()=>n(M,null,[s("Every box buyable adds "),n(cl,null,{default:()=>[s("level")]}),s(" levels to same-row box buyables.")]))},shouldEarn:()=>qe.level.value>=1})),P(()=>({display:{requirement:"Bell Level 2",effectDisplay:"Box gain ^1.1"},visibility:()=>y(F[0].earned.value),shouldEarn:()=>qe.level.value>=2})),P(()=>({display:{requirement:"Bell Level 3",effectDisplay:"All box buyables scaling bases -1"},visibility:()=>y(F[1].earned.value),shouldEarn:()=>qe.level.value>=3})),P(()=>({display:{requirement:"Bell Level 4",effectDisplay:"Unlock a second row of box buyables"},visibility:()=>y(F[2].earned.value&&O.day.value>=13),shouldEarn:()=>qe.level.value>=4})),P(()=>({display:{requirement:"Bell Level 5",effectDisplay:"Unlock another row of box upgrades"},visibility:()=>y(F[3].earned.value&&O.day.value>=13),shouldEarn:()=>qe.level.value>=5}))],Z=[P(()=>({display:{requirement:"Gingersnap Level 1",effectDisplay:"Multiply all primary dye colors by ln(cloth + e)."},shouldEarn:()=>pe.level.value>=1})),P(()=>({display:{requirement:"Gingersnap Level 2",effectDisplay:S(()=>n(M,null,[s("Multiply all cloth actions' effectiveness by log"),n("sub",null,[s("10")]),s("(dye sum + 10)")]))},visibility:()=>y(Z[0].earned.value),shouldEarn:()=>pe.level.value>=2})),P(()=>({display:{requirement:"Gingersnap Level 3",effectDisplay:"Double all dye colors and cloth actions, but reset all dyes."},visibility:()=>y(Z[1].earned.value),shouldEarn:()=>pe.level.value>=3,onComplete(){["red","yellow","blue","orange","green","purple"].forEach($=>{We.dyes[$].amount.value=0,We.dyes[$].buyable.amount.value=0})}})),P(()=>({display:{requirement:"Gingersnap Level 4",effectDisplay:S(()=>n(M,null,[s("Multiply ALL dye gain by")," ",n(ir,null,{default:()=>[n("div",null,[n(cl,null,{default:()=>[s("classrooms")]})]),n("div",null,[s("2")])]}),s("+1, but reset all dyes.")]))},visibility:()=>y(Z[2].earned.value&&O.day.value>=13),shouldEarn:()=>pe.level.value>=4,onComplete(){["red","yellow","blue","orange","green","purple"].forEach($=>{We.dyes[$].amount.value=0,We.dyes[$].buyable.amount.value=0})}})),P(()=>({display:{requirement:"Gingersnap Level 5",effectDisplay:"Well depth divides metal machine costs"},visibility:()=>y(Z[3].earned.value&&O.day.value>=13),shouldEarn:()=>pe.level.value>=5}))],ie=Me("Holly"),oe=S(()=>{const $=Object.values(K).find(Qe=>Qe.name===ie.value);return $==null?(console.warn("This should not happen.",ie.value),""):n(M,null,[ie.value,s("'s milestones: "),$.displayMilestone()])}),ve=p(Pe.elves.cuttersElf,w),ne=p(Pe.elves.plantersElf,b),Be=p(Pe.elves.expandersElf,A),ye=[ve,ne,Be],ee=p(Pe.elves.heatedCuttersElf,f),te=p(Pe.elves.heatedPlantersElf,_),Ue=p(Pe.elves.fertilizerElf,N),De=[ee,te,Ue],Se=p(Pe.elves.smallFireElf,T),Re=p(Pe.elves.bonfireElf,J),fe=p(Pe.elves.kilnElf,B),Oe=[Se,Re,fe],xe=p(Pe.elves.paperElf,E),qe=p(Pe.elves.boxElf,F),pe=p(Pe.elves.clothElf,Z),Ze=[xe,qe,pe],K={cutterElfTraining:ve,planterElfTraining:ne,expandersElfTraining:Be,heatedCutterElfTraining:ee,heatedPlanterElfTraining:te,fertilizerElfTraining:Ue,smallfireElfTraining:Se,bonfireElfTraining:Re,kilnElfTraining:fe,paperElfTraining:xe,boxElfTraining:qe,clothElfTraining:pe},st=[ve,ne,Be,ee,te,Ue,Se,Re,fe,xe,qe,pe],ze=[ve,ne,Be,ee,te,Ue,Se,Re,fe,xe,qe,pe];et.on("update",$=>{if(!(O.day.value<Wl)){for(const Qe of Object.values(K)){const tt=Math.floor(Qe.amountOfTimesDone.value);tt>=1&&(Qe.amountOfTimesDone.value-=tt,a.lt(Qe.level.value,Ne.amount.value)&&(Qe.exp.value=a.mul(Qe.elfXPGainComputed.value,tt).add(Qe.exp.value)))}rt.value=a.sub(rt.value,$).max(0),$e.value=a.sub($e.value,$).max(0),a.eq(rt.value,0)&&(Je.value=a.pow(Ke.value,1-Math.abs(Math.sin(Date.now()/1e3*2))))}});const Je=Me(1),se=Me({}),$e=Me(0),rt=Me(0),St=W(()=>[g(()=>({multiplier:2,description:"Focus Upgrade 1",enabled:Q.bought}))]),nt=W(()=>[ae(()=>({addend:1,description:"Focus Upgrade 2",enabled:he.bought}))]),ut=W(()=>[ae(()=>({addend:-5,description:"Focus Upgrade 3",enabled:Tt.bought}))]),Ke=v(()=>St.apply(10)),Ge=v(()=>nt.apply(3)),Et=v(()=>Number(ut.apply(15))),Mt=el(()=>({direction:Fe.Right,width:566,height:25,style:"border-radius: 4px 4px 0 0",borderStyle:"border-radius: 4px 4px 0 0",fillStyle:`background: ${t}; transition: none`,progress:()=>a.sub(Je.value,1).div(a.sub(Ke.value,1)).toNumber(),display:S(()=>n(M,null,[j(Je.value),s("x")]))})),Dt=qt(()=>({display:{title:"Focus",description:S(()=>n(M,null,[s("Motivate elves to focus, multiplying 3 random elves' XP gain by up to")," ",j(Ke.value),s("x, equal to the focus bars' effect."),a.gte($e.value,0)?n(M,null,[n("br",null,null),s("Reroll cooldown: "),aa($e.value)]):""]))},style:{width:"300px"},canClick:()=>a.eq($e.value,0),onClick(){$e.value=Et.value,rt.value=10,re(12,Ge.value)}}));function re($,Qe){var Ft,zt;let tt=0;se.value={};const Gt=a.min(Qe,$);for(;Gt.gt(tt);){const x=(zt=(Ft=Object.values(K)[Math.floor(Math.random()*$)])==null?void 0:Ft.name)!=null?zt:"";se.value[x]||(se.value[x]=!0,tt++)}}const Q=q(()=>({display:{title:"Focus Booster",description:"Multiplies the maximum experience multiplier from focus by 2"},resource:de.logs,cost:1e30})),he=q(()=>({display:{title:"Focus Buffer",description:"Increase elves affected by focus by 1"},resource:de.logs,cost:1e40})),Tt=q(()=>({display:{title:"Focus Upgrader",description:"Focus can now be rerolled every 10 seconds"},resource:de.logs,cost:1e50})),Wt=[Q,he,Tt],we=v(()=>{const $=a.pow(10,Ne.amount.value),Qe=a.pow(2e4,Ne.amount.value),tt=a.pow(2e3,Ne.amount.value);return{wood:Qe.mul(1e21),coal:tt.mul(1e32),paper:tt.mul(1e18),boxes:Qe.mul(1e13),metalIngots:$.mul(1e12),cloth:$.mul(1e4),plastic:$.mul(1e6),dye:a.add(Ne.amount.value,1).mul(1e4)}}),Ne=Le(()=>({display:S(()=>n(M,null,[n("h3",null,[s("Build a School")]),n("div",null,[s("You gotta start somewhere, right? Each school increases the maximum level for elves by 1, up to 5.")]),n("div",null,[s("You have "),X(Ne.amount.value),s(" schools, which are currently letting elves learn up to level "),X(Ne.amount.value),s(".")]),n("div",null,[s("Costs "),j(we.value.wood),s(" logs, "),j(we.value.coal)," ",s("coal, "),j(we.value.paper),s(" paper, "),j(we.value.boxes)," ",s("boxes, "),j(we.value.metalIngots),s(" metal ingots,")," ",j(we.value.cloth),s(" cloth, "),j(we.value.plastic)," ",s("plastic, and requires "),j(we.value.dye),s(" of red, yellow, and blue dye")])])),canPurchase(){return we.value.wood.lte(de.logs.value)&&we.value.coal.lte(L.coal.value)&&we.value.paper.lte(V.paper.value)&&we.value.boxes.lte(it.boxes.value)&&we.value.metalIngots.lte(lt.metal.value)&&we.value.cloth.lte(vt.cloth.value)&&we.value.plastic.lte(Ye.plastic.value)&&we.value.dye.lte(We.dyes.blue.amount.value)&&we.value.dye.lte(We.dyes.red.amount.value)&&we.value.dye.lte(We.dyes.yellow.amount.value)},onPurchase(){de.logs.value=a.sub(de.logs.value,we.value.wood),L.coal.value=a.sub(L.coal.value,we.value.coal),V.paper.value=a.sub(V.paper.value,we.value.paper),it.boxes.value=a.sub(it.boxes.value,we.value.boxes),lt.metal.value=a.sub(lt.metal.value,we.value.metalIngots),vt.cloth.value=a.sub(vt.cloth.value,we.value.cloth),Ye.plastic.value=a.sub(Ye.plastic.value,we.value.plastic),this.amount.value=a.add(this.amount.value,1)},purchaseLimit:5,visibility:v(()=>y(r.bought.value)),style:"width: 600px"})),dt=v(()=>{const $=a.add(ot.amount.value,1).pow(1.5);return{wood:$.mul(1e21),paper:$.mul(1e18),boxes:$.mul(1e13),metalIngots:$.mul(1e12)}}),It=v(()=>a.add(ot.amount.value,1).sqrt()),ot=Le(()=>({display:S(()=>n(M,null,[n("h3",null,[s("Build a Classroom")]),n("div",null,[s("Hopefully it makes the school a bit less boring. Multiplies elves' XP gain by")," ",n(cl,null,{default:()=>[s("Classrooms + 1")]}),s(".")]),n("div",null,[s("You have "),X(ot.amount.value),s(" classrooms, which are currently multiplying elves' XP gain by "),j(It.value)]),n("div",null,[s("Costs "),j(dt.value.wood),s(" logs,"),j(dt.value.paper),s(" paper, "),j(dt.value.boxes)," ",s("boxes, "),j(dt.value.metalIngots),s(" metal ingots")])])),canPurchase(){return dt.value.wood.lte(de.logs.value)&&dt.value.paper.lte(V.paper.value)&&dt.value.boxes.lte(it.boxes.value)&&dt.value.metalIngots.lte(lt.metal.value)},onPurchase(){de.logs.value=a.sub(de.logs.value,dt.value.wood),V.paper.value=a.sub(V.paper.value,dt.value.paper),it.boxes.value=a.sub(it.boxes.value,dt.value.boxes),lt.metal.value=a.sub(lt.metal.value,dt.value.metalIngots),this.amount.value=a.add(this.amount.value,1)},visibility:v(()=>y(d.bought.value)),style:"width: 600px"})),[Pt,rl]=sl(()=>[{title:"Elves affected by Focus",modifier:nt,base:3},{title:"Maximum Focus Effect",modifier:St,base:10},{title:"Focus Cooldown",modifier:ut,unit:" secs",base:15},{title:"Global XP Gain",modifier:c,unit:" XP"},{title:"Holly XP Gain per Action",modifier:ve.elfXPGain,base:.1,unit:" XP"},{title:"Ivy XP Gain per Action",modifier:ne.elfXPGain,base:.1,unit:" XP"},{title:"Hope XP Gain per Action",modifier:Be.elfXPGain,base:.1,unit:" XP"},{title:"Jack XP Gain per Action",modifier:ee.elfXPGain,base:.1,unit:" XP"},{title:"Mary XP Gain per Action",modifier:te.elfXPGain,base:.1,unit:" XP"},{title:"Noel XP Gain per Action",modifier:Ue.elfXPGain,base:.1,unit:" XP"},{title:"Joy XP Gain per Action",modifier:Se.elfXPGain,base:.1,unit:" XP"},{title:"Faith XP Gain per Action",modifier:Re.elfXPGain,base:.1,unit:" XP"},{title:"Snowball XP Gain per Action",modifier:fe.elfXPGain,base:.1,unit:" XP"},{title:"Star XP Gain per Action",modifier:xe.elfXPGain,base:.1,unit:" XP"},{title:"Bell XP Gain per Action",modifier:qe.elfXPGain,base:.1,unit:" XP"},{title:"Gingersnap XP Gain per Action",modifier:pe.elfXPGain,base:.1,unit:" XP"}]),ul=H(!1),le=S(()=>n(Ct,{modelValue:ul.value,"onUpdate:modelValue":$=>ul.value=$},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:Pt}));return{name:e,day:Wl,color:t,minWidth:700,elfTraining:K,totalElfLevels:i,totalElfExp:o,currentShown:ie,generalTabCollapsed:rl,teaching:r,schools:Ne,classrooms:ot,classroomUpgrade:d,focusMultiplier:Je,upgrades:Wt,focusTargets:se,focusCooldown:$e,focusTime:rt,display:S(()=>n(M,null,[O.day.value===Wl?"Get all elves to level 3.":O.day.value===Na&&O.days[Na-1].opened.value?"Get all elves to level 5.":`${e} Complete!`," ",s("-"),n("button",{class:"button",style:"display: inline-block;",onClick:()=>ul.value=!0},[s("Check Modifiers")]),ce(le),ce(l),n("br",null,null),Zt(Ne,ot),s(" "),Sl([r,d])," ",Sl(Wt),a.gt(Ne.amount.value,0)?n(M,null,[n("br",null,null),s("Click on an elf to see their milestones."),n("br",null,null),n("br",null,null),ce(Dt),n("br",null,null),Sl([Mt],ye,De,Oe,Ze),n(_e,null,null),oe()]):""]))}}),Er="cloth",ri=8,vt=$t(Er,function(){const e="Cloth",t="white",l=yt(0,"cloth"),i=yt(0,"wool"),o=yt(10,"sheep"),r=Me(0),d=el(()=>({direction:Fe.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:()=>a.div(r.value,K.value)})),c=qt(()=>({display:{title:"Breed sheep",description:S(()=>n(M,null,[s("Breed "),ke(a.floor(pe.value)),s(" sheep"),n("br",null,null),ce(d)]))},style:{minHeight:"80px"},canClick:()=>a.gte(r.value,K.value),onClick(){if(a.lt(r.value,K.value))return;const re=a.floor(pe.value);o.value=a.add(o.value,re),r.value=0}})),m=Me(0),p=el(()=>({direction:Fe.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:()=>a.div(m.value,se.value)})),w=qt(()=>({display:{title:"Shear sheep",description:S(()=>n(M,null,[s("Shear up to "),ke(a.floor(ze.value)),s(" sheep"),n("br",null,null),ce(p)]))},style:{minHeight:"80px"},canClick:()=>a.gte(m.value,se.value),onClick(){if(a.lt(m.value,se.value))return;const re=a.min(o.value,ze.value).floor();i.value=a.add(i.value,re),m.value=0}})),b=Me(0),A=el(()=>({direction:Fe.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:()=>a.div(b.value,nt.value)})),f=qt(()=>({display:{title:"Spinning wool",description:S(()=>n(M,null,[s("Spin "),ke(a.floor(rt.value)),s(" wool"),n("br",null,null),ce(A)]))},style:{minHeight:"80px"},canClick:()=>a.gte(b.value,nt.value),onClick(){if(a.lt(b.value,nt.value))return;const re=a.min(i.value,rt.value).floor();l.value=a.add(l.value,re),i.value=a.sub(i.value,re),b.value=0}})),_=Ql(()=>({key:"b",description:'Press the "Breed Sheep" button',onPress:()=>{c.canClick.value&&c.onClick()}})),N=Ql(()=>({key:"h",description:'Press the "Shear Sheep" button',onPress:()=>{w.canClick.value&&w.onClick()}})),T=Ql(()=>({key:"s",description:'Press the "Spin Wool" button',onPress:()=>{f.canClick.value&&f.onClick()}})),J=Le(()=>({resource:de.logs,cost(){let re=this.amount.value;return a.gte(re,100)&&(re=a.pow(re,2).div(100)),re=a.pow(.95,V.books.clothBook.amount.value).times(re),a.pow(1.5,re).times(1e14)},display:{title:"Build more pens",description:"Breed +1 sheep at once"}})),B=Le(()=>({resource:lt.metal,cost(){let re=this.amount.value;return a.gte(re,100)&&(re=a.pow(re,2).div(100)),re=a.pow(.95,V.books.clothBook.amount.value).times(re),a.pow(1.4,re).times(1e4)},display:{title:"Make stronger shears",description:"Shear +1 sheep at once"}})),E=Le(()=>({resource:V.paper,cost(){let re=this.amount.value;return a.gte(re,100)&&(re=a.pow(re,2).div(100)),re=a.pow(.95,V.books.clothBook.amount.value).times(re),a.pow(1.3,re).times(1e6)},display:{title:"Learn how to spin",description:"Spin +1 wool at once"}})),F=q(()=>({resource:R(l),cost:100,display:{title:"Lumberjack Boots",description:"Quadruple log gain"}})),Z=q(()=>({resource:R(i),cost:150,visibility:()=>y(F.bought.value),display:{title:"Lumberjack Jeans",description:"Quadruple trees cut"}})),ie=q(()=>({resource:R(o),cost:200,visibility:()=>y(Z.bought.value),display:{title:"Lumberjack Plaid",description:"Quadruple trees planted"}})),ve={treesUpgrade4:q(()=>({resource:R(l),cost:1e3,visibility:()=>y(Ye.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Axe",description:"10x log gain"}})),treesUpgrade3:ie,treesUpgrade2:Z,treesUpgrade1:F},ne=q(()=>({resource:R(l),cost:150,display:{title:"Mining boots",description:"Quadruple ash gain"}})),Be=q(()=>({resource:R(i),cost:225,visibility:()=>y(ne.bought.value),display:{title:"Mining overalls",description:"Double coal gain"}})),ye=q(()=>({resource:R(o),cost:300,visibility:()=>y(Be.bought.value),display:{title:"Mining helmet",description:"Triple coal gain"}})),te={metalUpgrade4:q(()=>({resource:R(l),cost:2e3,visibility:()=>y(Ye.upgrades.clothTools.bought.value),display:{title:"Felt-Gripped Pick",description:"Quadruple coal gain"}})),metalUpgrade3:ye,metalUpgrade2:Be,metalUpgrade1:ne},Ue=q(()=>({resource:R(l),cost:200,display:{title:"Scholar's shoes",description:"Double paper gain"}})),De=q(()=>({resource:R(i),cost:200,visibility:()=>y(Ue.bought.value),display:{title:"Scholar's slacks",description:"Double paper gain"}})),Se=q(()=>({resource:R(o),cost:400,visibility:()=>y(De.bought.value),display:{title:"Scholar's jacket",description:"Double paper gain"}})),fe={paperUpgrade4:q(()=>({resource:R(l),cost:4e3,visibility:()=>y(Ye.upgrades.clothTools.bought.value),display:{title:"Felt Elbow Pads",description:"10x paper gain"}})),paperUpgrade3:Se,paperUpgrade2:De,paperUpgrade1:Ue},Oe=v(()=>a.add(de.computedAutoCuttingAmount.value,1).root(3)),xe=v(()=>a.add(We.dyeSum.value,10).log10()),qe=W(()=>[ae(()=>({addend:J.amount,description:"Build more pens"})),g(()=>({multiplier:()=>a.div(Ye.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(Ye.buyables.clothGains.amount.value,1)})),g(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:V.upgrades.clothUpgrade.bought})),g(()=>({multiplier:xe,description:"Gingersnap Level 2",enabled:U.elfTraining.clothElfTraining.milestones[1].earned})),g(()=>({multiplier:Oe,description:"Holly Level 3",enabled:U.elfTraining.cutterElfTraining.milestones[2].earned}))]),pe=v(()=>qe.apply(1)),Ze=W(()=>[]),K=v(()=>Ze.apply(1)),st=W(()=>[ae(()=>({addend:B.amount,description:"Make stronger shears"})),g(()=>({multiplier:()=>a.div(Ye.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(Ye.buyables.clothGains.amount.value,1)})),g(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:V.upgrades.clothUpgrade.bought})),g(()=>({multiplier:xe,description:"Gingersnap Level 2",enabled:U.elfTraining.clothElfTraining.milestones[1].earned})),g(()=>({multiplier:Oe,description:"Holly Level 3",enabled:U.elfTraining.cutterElfTraining.milestones[2].earned}))]),ze=v(()=>st.apply(1)),Je=W(()=>[]),se=v(()=>Je.apply(1)),$e=W(()=>[ae(()=>({addend:E.amount,description:"Learn how to spin"})),g(()=>({multiplier:()=>a.div(Ye.buyables.clothGains.amount.value,10).add(1),description:"Plastic Shepherd",enabled:()=>a.gte(Ye.buyables.clothGains.amount.value,1)})),g(()=>({multiplier:2,description:"Shepherding for Dummies",enabled:V.upgrades.clothUpgrade.bought})),g(()=>({multiplier:xe,description:"Gingersnap Level 2",enabled:U.elfTraining.clothElfTraining.milestones[1].earned})),g(()=>({multiplier:Oe,description:"Holly Level 3",enabled:U.elfTraining.cutterElfTraining.milestones[2].earned}))]),rt=v(()=>$e.apply(1)),St=W(()=>[]),nt=v(()=>St.apply(1)),[ut,Ke]=sl(()=>[{title:"Sheep Gain",modifier:qe,base:1},{title:"Sheep Breeding Cooldown",modifier:Ze,base:1,visible:!1,unit:"s"},{title:"Shearing Amount",modifier:st,base:1},{title:"Shearing Cooldown",modifier:Je,base:1,visible:!1,unit:"s"},{title:"Spinning Amount",modifier:$e,base:1},{title:"Spinning Cooldown",modifier:St,base:1,visible:!1,unit:"s"}]),Ge=H(!1),Et=S(()=>n(Ct,{modelValue:Ge.value,"onUpdate:modelValue":re=>Ge.value=re},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:ut}));et.on("update",re=>{a.lt(O.day.value,ri)||(a.gte(r.value,K.value)?r.value=K.value:(r.value=a.add(r.value,re),c.isHolding.value&&c.onClick()),a.gte(m.value,se.value)?m.value=se.value:(m.value=a.add(m.value,re),w.isHolding.value&&w.onClick()),a.gte(b.value,nt.value)?b.value=nt.value:(b.value=a.add(b.value,re),f.isHolding.value&&f.onClick()))});const{total:Mt,trackerDisplay:Dt}=hl({resource:l,goal:1e3,name:e,day:ri,color:t,textColor:"var(--feature-foreground)",modal:{show:Ge,display:Et}});return{name:e,color:t,cloth:l,totalCloth:Mt,wool:i,sheep:o,buildPens:J,betterShears:B,fasterSpinning:E,treesUpgrades:ve,metalUpgrades:te,paperUpgrades:fe,generalTabCollapsed:Ke,breedingProgress:r,shearingProgress:m,spinningProgress:b,breedSheepHK:_,shearSheepHK:N,spinWoolHK:T,minWidth:700,display:S(()=>n(M,null,[ce(Dt),n(_e,null,null),n(Lt,{resource:l,style:"margin-bottom: 0"},null),n(Lt,{resource:i,style:"margin-bottom: 0"},null),n(Lt,{resource:o,style:"margin-bottom: 0"},null),at(c,w,f),at(J,B,E),n(_e,null,null),n($l,null,{default:()=>[Zt(...Object.values(ve)),Zt(...Object.values(te)),Zt(...Object.values(fe))]})]))}}),_r="dyes",Sr=11,We=$t(_r,function(){const e="Dyes",t="#D4D4F4";function l(f){const _=yt(0,f.name),N=W(()=>{const B=[ae(()=>({addend:()=>a.add(J.amount.value,1),description:`${f.name} Chambers`}))];return(f.color==="red"||f.color==="yellow")&&B.push(g(()=>({multiplier:o.orange1,description:"Orange Dye Boost 1"}))),(f.color=="yellow"||f.color=="blue")&&B.push(g(()=>({multiplier:o.green1,description:"Green Dye Boost 1"}))),(f.color=="red"||f.color=="blue")&&B.push(g(()=>({multiplier:o.purple1,description:"Purple Dye Boost 1"}))),(f.color=="red"||f.color=="yellow"||f.color=="blue")&&(B.push(g(()=>({multiplier:2,description:"Wetter Dyes",enabled:c.yellowDyeUpg.bought}))),B.push(g(()=>({multiplier:()=>a.add(vt.cloth.value,Math.E).ln(),description:"Gingersnap Level 1",enabled:U.elfTraining.clothElfTraining.milestones[0].earned})))),B.push(g(()=>({multiplier:2,description:"Gingersnap Level 3",enabled:U.elfTraining.clothElfTraining.milestones[2].earned}))),B}),T=v(()=>N.apply(0)),J=Le(()=>{const B=kt(f.costs);return{...f,style:()=>({backgroundColor:u(J.canPurchase)?t:"#545454",minWidth:"200px"}),display:S(()=>n("span",null,[n("h3",null,[f.name,s(" Chambers")]),n("br",null,null),s("Create "),j(T.value),s(" "),f.name,f.dyesToReset.length>0?", but reset "+f.dyesToReset.map(E=>E.name).join(", "):"",s("."),n("br",null,null),n("br",null,null),n("span",{class:"white-space: pre-wrap"},[s("Currently:")," ",f.listedBoosts.filter(E=>u(E.visible)).map(E=>ce(S(()=>n("div",null,[u(E.desc)]))))]),n("br",null,null),n("div",null,[s("Cost:")," ",u(B).map(E=>ce(S(()=>{var F,Z;return n("div",null,[j(u(a.pow((F=u(J.cost))!=null?F:a.dInf,u((Z=E.root)!=null?Z:1)).times(u(E.base))))," ",E.res.displayName,n("br",null,null)])})))])])),cost(){let E=J.amount.value;return a.gte(E,25)&&(E=a.pow(E,2).div(20)),a.gte(E,10)&&(E=a.pow(E,2).div(5)),a.div(E,10).plus(1)},canPurchase:v(E=>{var Z;if(u(J.visibility)!=At.Visible)return!1;const F=(Z=E!=null?E:u(J.cost))!=null?Z:a.dInf;return u(B).every(ie=>{var oe;return a.div(ie.res.value,u(ie.base)).root(u((oe=ie.root)!=null?oe:1)).gte(F)})}),onPurchase(E){var Z;const F=(Z=E!=null?E:u(J.cost))!=null?Z:a.dInf;u(B).forEach(ie=>{var oe;ie.res.value=a.sub(ie.res.value,a.pow(F,u((oe=ie.root)!=null?oe:1)).times(u(ie.base)))}),_.value=a.add(_.value,T.value),J.amount.value=a.add(J.amount.value,1),f.dyesToReset.forEach(ie=>ie.reset())}}});return{name:f.name,amount:_,buyable:J,toGenerate:N,computedToGenerate:T,display:S(()=>n(Lt,{resource:_,color:f.color,style:"margin: 0; width: 200px; width: 180px; padding: 10px;",sticky:!1},null))}}const i={red:l({name:"Red Dye",color:"red",costs:()=>[{base:"2e18",root:5,res:de.logs},{base:v(()=>c.yellowDyeUpg2.bought.value?"2.5e5":"5e5"),root:2,res:ue.oil}],listedBoosts:[{visible:!0,desc:v(()=>`+${j(o.red1.value)} effective Oil Pumps (does not impact coal consumption)`)}],dyesToReset:[]}),yellow:l({name:"Yellow Dye",color:"yellow",costs:()=>[{base:"1e18",root:5,res:de.logs},{base:v(()=>c.yellowDyeUpg2.bought.value?"5e5":"1e6"),root:2,res:ue.oil}],listedBoosts:[{visible:!0,desc:v(()=>`x${j(o.yellow1.value)} Paper & Plastic gain`)}],dyesToReset:[]}),blue:l({name:"Blue Dye",color:"blue",costs:()=>[{base:"5e17",root:5,res:de.logs},{base:v(()=>c.yellowDyeUpg2.bought.value?"1e6":"2e6"),root:2,res:ue.oil}],listedBoosts:[{visible:!0,desc:v(()=>`+${X(o.blue1.value)} forest size (after all other modifiers).`)}],dyesToReset:[]}),orange:l({name:"Orange Dye",color:"orange",costs:()=>[{base:15,root:2,res:i.red.amount},{base:10,root:2,res:i.yellow.amount}],listedBoosts:[{visible:!0,desc:v(()=>`x${j(o.orange1.value)} Red and Yellow Dye gain`)},{visible:!0,desc:v(()=>`/${j(o.orange2.value)} Box buyable costs.`)}],dyesToReset:[{name:"Red Dye",reset(){i.red.amount.value=0,i.red.buyable.amount.value=0}},{name:"Yellow Dye",reset(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}}]}),green:l({name:"Green Dye",color:"green",costs:()=>[{base:15,root:2,res:i.yellow.amount},{base:10,root:2,res:i.blue.amount}],listedBoosts:[{visible:!0,desc:v(()=>`x${j(o.green1.value)} Yellow and Blue Dye gain`)},{visible:!0,desc:v(()=>`+${X(a.sub(o.green2.value,1).times(100))}% Kiln synergy effect.`)}],dyesToReset:[{name:"Yellow Dye",reset(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}},{name:"Blue Dye",reset(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}}]}),purple:l({name:"Purple Dye",color:"purple",costs:()=>[{base:15,root:2,res:i.blue.amount},{base:10,root:2,res:i.red.amount}],listedBoosts:[{visible:!0,desc:v(()=>`x${j(o.purple1.value)} Red and Blue Dye gain`)},{visible:!0,desc:v(()=>`x${j(o.purple2.value)} Smelting Speed and Ore Purity`)}],dyesToReset:[{name:"Blue Dye",reset(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}},{name:"Red Dye",reset(){i.red.amount.value=0,i.red.buyable.amount.value=0}}]})},o={red1:v(()=>a.pow(a.add(i.red.amount.value,1).log2().plus(1).log2().div(2),c.blueDyeUpg2.bought.value?1.5:1)),yellow1:v(()=>a.add(i.yellow.amount.value,1).log2().plus(1)),blue1:v(()=>a.add(i.blue.amount.value,1).log2().sqrt().times(5e6)),orange1:v(()=>a.pow(2,a.add(i.orange.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),orange2:v(()=>a.add(i.orange.amount.value,1).log2().plus(1)),green1:v(()=>a.pow(2,a.add(i.green.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),green2:v(()=>a.add(i.green.amount.value,1).log2().plus(1).pow(c.coalUpg.bought.value?2:1)),purple1:v(()=>a.pow(2,a.add(i.purple.amount.value,1).log2().sqrt()).pow(c.coalUpg.bought.value?1.2:1)),purple2:v(()=>a.add(i.purple.amount.value,1).log2().plus(1))},[r,d]=sl(()=>[{title:"Red Dye Creation",modifier:i.red.toGenerate,base:0},{title:"Yellow Dye Creation",modifier:i.yellow.toGenerate,base:0},{title:"Blue Dye Creation",modifier:i.blue.toGenerate,base:0},{title:"Orange Dye Creation",modifier:i.orange.toGenerate,base:0},{title:"Green Dye Creation",modifier:i.green.toGenerate,base:0},{title:"Purple Dye Creation",modifier:i.purple.toGenerate,base:0}]),c={blueDyeUpg:q(()=>({visibility:()=>y(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(1)||c.blueDyeUpg.bought.value),display:{title:"Is Blue Dye just Water?",description:S(()=>n(M,null,[s("Multiply Log gain by log"),n("sub",null,[s("10")]),s("(Auto Cutting Amount)+1.")]))},cost:1e3,resource:R(i.blue.amount),onPurchase(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),redDyeUpg:q(()=>({visibility:()=>y(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(10)||c.redDyeUpg.bought.value),display:{title:"Glistening Paint",description:S(()=>n(M,null,[s("Multiply Ore Purity by log"),n("sub",null,[s("10")]),s("(Cloth)+1.")]))},cost:1500,resource:R(i.red.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0}})),yellowDyeUpg:q(()=>({visibility:()=>y(a.add(i.orange.amount.value,i.green.amount.value).add(i.purple.amount.value).gte(100)||c.yellowDyeUpg.bought.value),display:{title:"Wetter Dyes",description:"Double Red, Yellow, and Blue Dye gain, but reset their amounts."},cost:2e3,resource:R(i.yellow.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0,i.yellow.amount.value=0,i.yellow.buyable.amount.value=0,i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),yellowDyeUpg2:q(()=>({visibility:()=>y(c.yellowDyeUpg.bought.value),display:{title:"Golden Wash",description:"Halve the Oil cost of Red, Yellow, and Blue Dyes."},cost:5e3,resource:R(i.yellow.amount),onPurchase(){i.yellow.amount.value=0,i.yellow.buyable.amount.value=0}})),redDyeUpg2:q(()=>({visibility:()=>y(c.redDyeUpg.bought.value),display:{title:"De Louvre",description:S(()=>n(M,null,[s("Multiply Smelting Speed by "),n(cl,null,{default:()=>[s("Refineries+1")]}),s(".")]))},cost:6e3,resource:R(i.red.amount),onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0}})),blueDyeUpg2:q(()=>({visibility:()=>y(c.blueDyeUpg.bought.value),display:{title:"Hydrophobia",description:"Raise Red Dye's effect ^1.5."},cost:7500,resource:R(i.blue.amount),onPurchase(){i.blue.amount.value=0,i.blue.buyable.amount.value=0}})),coalUpg:q(()=>({visibility:()=>y(c.blueDyeUpg2.bought.value&&c.redDyeUpg2.bought.value&&c.yellowDyeUpg2.bought.value),display:{title:"Denser Spectrum",description:"Orange, Green, and Purple Dyes' first effect is raised ^1.2, and Green Dye's second effect is squared. Buying this resets Red, Yellow, and Blue Dyes."},cost:"5e30",resource:L.coal,onPurchase(){i.red.amount.value=0,i.red.buyable.amount.value=0,i.yellow.amount.value=0,i.yellow.buyable.amount.value=0,i.blue.amount.value=0,i.blue.buyable.amount.value=0}}))},m=H(!1),p=S(()=>n(Ct,{modelValue:m.value,"onUpdate:modelValue":f=>m.value=f},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:r})),w=yt(v(()=>Object.values(i).reduce((f,_)=>a.add(f,_.amount.value),0)),"Sum of Dyes"),{total:b,trackerDisplay:A}=hl({resource:w,goal:6e4,name:e,day:Sr,color:t,textColor:"var(--feature-foreground)",modal:{show:m,display:p},ignoreTotal:!0});return{name:e,color:t,dyes:i,dyeSum:w,boosts:o,totalDyeSum:b,minWidth:700,generalTabCollapsed:d,upgrades:c,display:S(()=>n(M,null,[ce(A),n(_e,null,null),n("div",{style:"width: 620px"},[at(i.red.display,i.yellow.display,i.blue.display),at(i.red.buyable,i.yellow.buyable,i.blue.buyable),n(_e,null,null),at(i.orange.display,i.green.display,i.purple.display),at(i.orange.buyable,i.green.buyable,i.purple.buyable)]),n(_e,null,null),n("div",{class:"row",style:"vertical-align: top"},[Zt(c.redDyeUpg,c.redDyeUpg2),Zt(c.yellowDyeUpg,c.yellowDyeUpg2),Zt(c.blueDyeUpg,c.blueDyeUpg2)]),ce(c.coalUpg)]))}}),Mr="boxes",Da=6,it=$t(Mr,function(){const e="Boxes",t="#964B00",l=yt(0,"boxes"),i=W(()=>[ml(()=>({exponent:1.1,description:"Bell Level 2",enabled:U.elfTraining.boxElfTraining.milestones[1].earned}))]),o=qi(()=>({scaling:Ha(1e10,1),baseResource:de.logs,gainResource:R(l),roundUpCost:!0,gainModifier:i})),r=qt(()=>({display:S(()=>n(M,null,[n("span",{style:"font-size: large"},[s("Create "),X(o.currentGain.value),s(" "),l.displayName]),n("br",null,null),n("span",{style:"font-size: large"},[s("Cost:")," ",na(de.logs,a.gte(o.actualGain.value,1)?o.currentAt.value:o.nextAt.value)," ",de.logs.displayName])])),canClick:()=>a.gte(o.actualGain.value,1),onClick(){!u(this.canClick)||o.convert()},style:"width: 600px; min-height: unset"})),d=q(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){O.days[3].recentlyUpdated.value=!0},resource:R(l),cost:100})),c=q(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){O.days[3].recentlyUpdated.value=!0},resource:R(l),cost:1e3})),m=q(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){O.days[3].recentlyUpdated.value=!0},resource:R(l),cost:4e3})),p={logsUpgrade:d,ashUpgrade:c,coalUpgrade:m},w=q(()=>({resource:R(l),cost:1e8,visibility:()=>y(Ye.upgrades.boxTools.bought.value),display:{title:"Carry ore in boxes",description:"Double ore per mining op"}})),b=q(()=>({resource:R(l),cost:1e9,visibility:()=>y(Ye.upgrades.boxTools.bought.value),display:{title:"Carry metal in boxes",description:"Double ore purity"}})),A=q(()=>({resource:R(l),cost:1e10,visibility:()=>y(Ye.upgrades.boxTools.bought.value),display:{title:"Carry plastic in boxes",description:"Double plastic gain"}})),f={oreUpgrade:w,metalUpgrade:b,plasticUpgrade:A},_=q(()=>({resource:R(l),cost:1e16,visibility:()=>y(U.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry cloth in boxes",description:"Double all cloth actions"}})),N=q(()=>({resource:R(l),cost:1e17,visibility:()=>y(U.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry dye in boxes",description:"Double all dye gain"}})),T=q(()=>({resource:R(l),cost:1e18,visibility:()=>y(U.elfTraining.boxElfTraining.milestones[4].earned.value),display:{title:"Carry experience in boxes???",description:"Double xp gain"}})),J={clothUpgrade:_,dyeUpgrade:N,xpUpgrade:T},B=Le(()=>({display:{title:"Carry more logs",description:S(()=>n(M,null,[s("Use boxes to carry even more logs, boosting their gain"),n("br",null,null),n("br",null,null),n("div",null,[s("Amount: "),X(B.amount.value),a.gt(B.freeLevels.value,0)?n(M,null,[s(" (+"),X(B.freeLevels.value),s(")")]):null])])),effectDisplay:S(()=>n(M,null,[j(a.div(B.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:R(l),cost(){let ee=this.amount.value;ee=a.pow(.95,V.books.boxBook.amount.value).times(ee);let te=3;return U.elfTraining.boxElfTraining.milestones[2].earned.value&&te--,a.pow(te,ee).times(100).div(We.boosts.orange2.value)},visibility:()=>y(d.bought.value),freeLevels:v(()=>U.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(E.amount.value,1).sqrt().floor().add(a.max(F.amount.value,1).sqrt().floor()):0),totalAmount:v(()=>a.add(B.amount.value,B.freeLevels.value))})),E=Le(()=>({display:{title:"Carry more ash",description:S(()=>n(M,null,[s("Use boxes to carry even more ash, boosting its gain"),n("br",null,null),n("br",null,null),n("div",null,[s("Amount: "),X(E.amount.value),a.gt(E.freeLevels.value,0)?n(M,null,[s(" (+"),X(E.freeLevels.value),s(")")]):null])])),effectDisplay:S(()=>n(M,null,[j(a.div(E.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:R(l),cost(){let ee=this.amount.value;ee=a.pow(.95,V.books.boxBook.amount.value).times(ee);let te=5;return U.elfTraining.boxElfTraining.milestones[2].earned.value&&te--,a.pow(te,ee).times(1e3).div(We.boosts.orange2.value)},visibility:()=>y(c.bought.value),freeLevels:v(()=>U.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(B.amount.value,1).sqrt().floor().add(a.max(F.amount.value,1).sqrt().floor()):0),totalAmount:v(()=>a.add(E.amount.value,E.freeLevels.value))})),F=Le(()=>({display:{title:"Carry more coal",description:S(()=>n(M,null,[s("Use boxes to carry even more coal, boosting its gain"),n("br",null,null),n("br",null,null),n("div",null,[s("Amount: "),X(F.amount.value),a.gt(F.freeLevels.value,0)?n(M,null,[s(" (+"),X(F.freeLevels.value),s(")")]):null])])),effectDisplay:S(()=>n(M,null,[j(a.div(F.totalAmount.value,2).add(1)),s("x")])),showAmount:!1},resource:R(l),cost(){let ee=this.amount.value;ee=a.pow(.95,V.books.boxBook.amount.value).times(ee);let te=7;return U.elfTraining.boxElfTraining.milestones[2].earned.value&&te--,a.pow(te,ee).times(1e3).div(We.boosts.orange2.value)},visibility:()=>y(m.bought.value),freeLevels:v(()=>U.elfTraining.boxElfTraining.milestones[0].earned.value?a.max(B.amount.value,1).sqrt().floor().add(a.max(E.amount.value,1).sqrt().floor()):0),totalAmount:v(()=>a.add(F.amount.value,F.freeLevels.value))})),Z={logBoxesBuyable:B,ashBoxesBuyable:E,coalBoxesBuyable:F};et.on("update",ee=>{a.lt(O.day.value,Da)||(l.value=a.times(ee,Ye.buyables.passiveBoxes.amount.value).times(o.currentGain.value).div(100).add(l.value))});const[ie,oe]=sl(()=>[{title:"Boxes Gain",modifier:i,base:1}]),ve=H(!1),ne=S(()=>n(Ct,{modelValue:ve.value,"onUpdate:modelValue":ee=>ve.value=ee},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:ie})),{total:Be,trackerDisplay:ye}=hl({resource:l,goal:5e4,name:e,day:Da,color:t,modal:{display:ne,show:ve}});return{name:e,day:Da,color:t,boxes:l,totalBoxes:Be,boxesConversion:o,upgrades:p,row2Upgrades:f,row3Upgrades:J,buyables:Z,minWidth:700,generalTabCollapsed:oe,display:S(()=>n(M,null,[ce(ye),n(_e,null,null),n(Lt,{resource:l,color:t,style:"margin-bottom: 0"},null),n(_e,null,null),ce(r),n(_e,null,null),Sl(Object.values(p),Object.values(f),Object.values(J)),n(_e,null,null),at(...Object.values(Z))]))}}),Br="trees",ui=1,di=.1,de=$t(Br,function(){const e="Trees",t="#4BDC13",l="green",i=yt(0,"logs"),o=yt(0,"saplings"),r=H(0),d=W(()=>[ae(()=>({addend:()=>a.times(oe.amount.value,10),description:"Expand Forest",enabled:E.bought})),ae(()=>({addend:()=>a.div(Ot.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Ot.milestones.morePlantsMilestone1.earned})),g(()=>({multiplier:2,description:"5 Elves Trained",enabled:Pe.milestones[4].earned})),g(()=>({multiplier:2,description:"8 Elves Trained",enabled:Pe.milestones[7].earned})),g(()=>({multiplier:4,description:"Lumberjack Boots",enabled:vt.treesUpgrades.treesUpgrade1.bought})),ae(()=>({addend:We.boosts.blue1,description:"Blue Dye Boost 1",enabled:()=>a.gte(We.dyes.blue.amount.value,1)})),ae(()=>({addend:()=>a.pow(Be.value,.99),description:"Hope Level 1",enabled:U.elfTraining.expandersElfTraining.milestones[0].earned}))]),c=yt(v(()=>a.sub(d.apply(10),o.value)),"trees"),m=v(()=>d.apply(10)),p=q(()=>({resource:R(i),cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),w=q(()=>({resource:R(i),cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),b=q(()=>({resource:R(i),cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),A=q(()=>({resource:R(i),cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),f=q(()=>({resource:R(i),cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),_=[p,w,b,A,f],N=q(()=>({resource:R(i),cost:50,visibility:()=>y(f.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),T=q(()=>({resource:R(i),cost:50,visibility:()=>y(f.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),J=q(()=>({resource:R(i),cost:150,visibility:()=>y(f.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),B=q(()=>({resource:R(i),cost:150,visibility:()=>y(f.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),E=q(()=>({resource:R(i),cost:300,visibility:()=>y(f.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),F=[N,T,J,B,E],Z=Le(()=>({resource:R(i),cost(){let Q=this.amount.value;return a.gte(Q,50)&&(Q=a.pow(Q,2).div(50)),a.gte(Q,200)&&(Q=a.pow(Q,2).div(200)),a.gte(Q,2e6)&&(Q=a.pow(Q,2).div(2e6)),Q=a.pow(.95,V.books.cuttersBook.amount.value).times(Q),a.times(100,Q).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>y(E.bought.value)})),ie=Le(()=>({resource:R(i),cost(){let Q=this.amount.value;a.gte(Q,50)&&(Q=a.pow(Q,2).div(50)),a.gte(Q,200)&&(Q=a.pow(Q,2).div(200)),a.gte(Q,2e6)&&(Q=a.pow(Q,2).div(2e6)),Q=a.pow(.95,V.books.plantersBook.amount.value).times(Q);let he=a.times(100,Q).add(200);return U.elfTraining.planterElfTraining.milestones[3].earned.value&&(he=a.div(he,10)),he},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>y(E.bought.value)})),oe=Le(()=>({resource:R(i),cost(){let Q=this.amount.value;return a.gte(Q,100)&&(Q=a.pow(Q,2).div(100)),a.gte(Q,1e5)&&(Q=a.pow(Q,2).div(1e5)),a.gte(Q,1e15)&&(Q=a.pow(Q,10).div(1e135)),Q=a.pow(.95,V.books.expandersBook.amount.value).times(Q),a.pow(a.add(Q,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>y(E.bought.value)})),ve=[Z,ie,oe],ne=W(()=>[ae(()=>({addend:1,description:"Wooden Fingers",enabled:p.bought})),ae(()=>({addend:Ue,description:"Smart Knives",enabled:J.bought}))]),Be=v(()=>ne.apply(1)),ye=W(()=>[g(()=>({multiplier:.5,description:"Sharper Fingers",enabled:N.bought})),g(()=>({multiplier:()=>a.pow(.5,Pe.totalElves.value),description:"1 Elf Trained",enabled:Pe.milestones[0].earned}))]),ee=v(()=>ye.apply(1)),te=W(()=>[ae(()=>({addend:1,description:"Automated Knives",enabled:b.bought})),ae(()=>({addend:Z.amount,description:"Generic Cutters",enabled:E.bought})),ae(()=>({addend:()=>a.div(Ot.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Ot.milestones.autoCutMilestone1.earned})),g(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Ot.milestones.autoCutMilestone2.earned})),g(()=>({multiplier:2,description:"Warmer Cutters",enabled:L.warmerCutters.bought})),g(()=>({multiplier:L.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(L.heatedCutters.amount.value,0)})),g(()=>({multiplier:4,description:"Lumberjack Jeans",enabled:vt.treesUpgrades.treesUpgrade2.bought})),g(()=>({multiplier:()=>a.pow(1.1,O.day.value),description:"Holly Level 4",enabled:U.elfTraining.cutterElfTraining.milestones[3].earned})),ae(()=>({addend:()=>a.sub(De.value,pe.value).max(0),description:"Ivy Level 5",enabled:U.elfTraining.planterElfTraining.milestones[4].earned}))]),Ue=v(()=>te.apply(0)),De=H(0);setInterval(()=>jt(Ue,Q=>{De.value=Q}),0);const Se=W(()=>[ae(()=>({addend:1,description:"Leafy Fingers",enabled:w.bought})),ae(()=>({addend:qe,description:"Smart Spades",enabled:B.bought}))]),Re=v(()=>Se.apply(1)),fe=W(()=>[g(()=>({multiplier:.5,description:"Greener Fingers",enabled:T.bought})),g(()=>({multiplier:()=>a.pow(.5,Pe.totalElves.value),description:"1 Elf Trained",enabled:Pe.milestones[0].earned}))]),Oe=v(()=>fe.apply(1)),xe=W(()=>[ae(()=>({addend:1,description:"Automated Spade",enabled:A.bought})),ae(()=>({addend:()=>a.div(ie.amount.value,2),description:"Generic Planters",enabled:E.bought})),ae(()=>({addend:()=>a.div(Ot.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Ot.milestones.autoPlantMilestone1.earned})),g(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Ot.milestones.autoPlantMilestone2.earned})),g(()=>({multiplier:2,description:"Warmer Planters",enabled:L.warmerPlanters.bought})),g(()=>({multiplier:L.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(L.heatedPlanters.amount.value,0)})),g(()=>({multiplier:4,description:"Lumberjack Plaid",enabled:vt.treesUpgrades.treesUpgrade3.bought})),g(()=>({multiplier:2,description:"Ivy Level 1",enabled:U.elfTraining.planterElfTraining.milestones[0].earned})),g(()=>({multiplier:2,description:"Mary Level 2",enabled:U.elfTraining.heatedPlanterElfTraining.milestones[1].earned})),g(()=>({multiplier:()=>a.pow(c.value,.2).log10().pow_base(2),description:"Ivy Level 3",enabled:U.elfTraining.planterElfTraining.milestones[2].earned})),ae(()=>({addend:()=>a.sub(pe.value,De.value).max(0),description:"Ivy Level 5",enabled:U.elfTraining.planterElfTraining.milestones[4].earned}))]),qe=v(()=>xe.apply(0)),pe=H(0);setInterval(()=>jt(qe,Q=>{pe.value=Q}),0);const Ze=W(()=>[g(()=>({multiplier:1.25,description:"Research I",enabled:f.bought})),g(()=>({multiplier:1.25,description:"Research II",enabled:E.bought})),g(()=>({multiplier:()=>a.div(Ot.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Ot.milestones.logGainMilestone1.earned})),g(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Ot.milestones.logGainMilestone2.earned})),g(()=>({multiplier:1.25,description:"Ashy Soil",enabled:L.basicFertilizer.bought})),g(()=>({multiplier:L.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(L.moreFertilizer.amount.value,0)})),g(()=>({multiplier:2,description:"4 Elves Trained",enabled:Pe.milestones[3].earned})),g(()=>({multiplier:2,description:"Carry logs in boxes",enabled:it.upgrades.logsUpgrade.bought})),g(()=>({multiplier:()=>a.div(it.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:it.upgrades.logsUpgrade.bought})),g(()=>({multiplier:10,description:"Felt-Gripped Axe",enabled:vt.treesUpgrades.treesUpgrade4.bought})),g(()=>({multiplier:v(()=>a.add(Ue.value,1).log10().plus(1)),description:"Is Blue Dye just Water?",enabled:We.upgrades.blueDyeUpg.bought})),g(()=>({multiplier:v(()=>a.add(Ue.value,1).root(9)),description:"Holly Level 1",enabled:U.elfTraining.cutterElfTraining.milestones[0].earned})),g(()=>({multiplier:()=>a.sqrt(U.totalElfLevels.value),description:"Noel Level 1",enabled:U.elfTraining.fertilizerElfTraining.milestones[0].earned})),ml(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:Ot.milestones.logGainMilestone3.earned}))]),K=Me(0),st=el(()=>({direction:Fe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(K.value,ee.value)})),ze=qt(()=>({display:{title:"Cut trees",description:S(()=>n(M,null,[s("Cut down up to "),X(a.floor(Be.value))," ",s("tree"),a.eq(Be.value,1)?"":"s",s(" at once!"),n("br",null,null),ce(st)]))},style:{minHeight:"80px"},canClick:()=>a.gte(c.value,1)&&a.gte(K.value,ee.value),onClick(){if(a.lt(K.value,ee.value))return;const Q=a.floor(a.min(c.value,a.times(Be.value,a.div(K.value,ee.value).floor())));i.value=a.add(i.value,a.times(Ze.apply(1),Q)),o.value=a.add(o.value,Q),K.value=0}})),Je=Me(0),se=el(()=>({direction:Fe.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Je.value,Oe.value)})),$e=qt(()=>({display:{title:"Plant trees",description:S(()=>n(M,null,[s("Plant up to "),X(a.floor(Re.value))," ",s("tree"),a.eq(Re.value,1)?"":"s",s(" at once!"),n("br",null,null),ce(se)]))},style:{minHeight:"80px"},canClick:()=>a.gte(o.value,1)&&a.gte(Je.value,Oe.value),onClick(){if(a.lt(Je.value,Oe.value))return;const Q=a.floor(a.min(o.value,a.times(Re.value,a.div(Je.value,Oe.value).floor())));o.value=a.sub(o.value,Q),Je.value=0}})),[rt,St]=sl(()=>[{title:"Logs per Tree",modifier:Ze,base:1,visible:f.bought},{title:"Manual Cutting Amount",modifier:ne,base:1,visible:p.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:ye,base:1,visible:p.bought,unit:"s"},{title:"Manual Planting Amount",modifier:Se,base:1,visible:w.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:fe,base:1,visible:w.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:te,base:0,visible:b.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:xe,base:0,visible:A.bought,unit:"/s"},{title:"Forest Size",modifier:d,base:10,visible:E.bought}]),nt=H(!1),ut=S(()=>n(Ct,{modelValue:nt.value,"onUpdate:modelValue":Q=>nt.value=Q},{header:()=>n("h2",null,[e,s(" Modifiers")]),body:rt}));et.on("update",Q=>{if(a.lt(O.day.value,ui))return;a.gte(K.value,ee.value)?K.value=ee.value:(K.value=a.add(K.value,Q),ze.isHolding.value&&ze.onClick()),a.gte(Je.value,Oe.value)?Je.value=Oe.value:(Je.value=a.add(Je.value,Q),$e.isHolding.value&&$e.onClick());const he=a.min(c.value,a.times(Ue.value,Q)),Tt=a.mul(Ze.apply(1),he),Wt=a.div(Tt,Q);r.value=a.mul(Wt,di).add(a.mul(r.value,a.dOne.sub(di))),i.value=a.add(i.value,Tt),o.value=a.add(o.value,he);const we=a.min(o.value,a.times(qe.value,Q));o.value=a.sub(o.value,we)});const Ke=v(()=>a.sub(Ue.value,qe.value)),Ge=v(()=>a.sub(qe.value,Ue.value)),Et=Ql(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{ze.canClick.value&&ze.onClick()}})),Mt=Ql(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{$e.canClick.value&&$e.onClick()}})),{total:Dt,trackerDisplay:re}=hl({resource:i,goal:1e4,name:e,day:ui,color:l,modal:{show:nt,display:ut}});return{name:e,color:t,logs:i,totalLogs:Dt,trees:c,saplings:o,cutTree:ze,plantTree:$e,cutTreeHK:Et,plantTreeHK:Mt,row1Upgrades:_,row2Upgrades:F,row1Buyables:ve,manualCutProgress:K,manualPlantProgress:Je,generalTabCollapsed:St,computedAutoCuttingAmount:Ue,minWidth:700,display:S(()=>n(M,null,[ce(re),n(_e,null,null),n(Lt,{resource:i,color:t,style:"margin-bottom: 0",productionDisplay:a.gt(Ue.value,0)?`+${j(r.value)}/s average<br/>equilibrium: +${Ci([[Ue.value,"cutting speed"],[qe.value,"planting speed"],[a.mul(m.value,20),"forest cap"]],"/s",Ze.apply(1))}`:void 0},null),n(Lt,{resource:o,color:l,style:"margin-bottom: 0",productionDisplay:ma(Ke.value)},null),n(Lt,{resource:c,color:l,style:"margin-bottom: 0",productionDisplay:ma(Ge.value)},null),n(_e,null,null),at(ze,$e),n("div",null,[s("Tip: You can hold down on actions to perform them automatically")]),n(_e,null,null),Sl(_,F),n(_e,null,null),at(...ve)]))}});var Li="./assets/tree.35808197.png",Gi="./assets/sws.714ad454.png",Qi="data:image/png;base64,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",$i="./assets/elf.9fbfa563.png",Hi="./assets/paperStacks.4c96ec8c.png",Vi="data:image/png;base64,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",ji="./assets/metal.7407f5d1.png",Ji="./assets/cloth.7bcd7f37.png",Wi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAFxGAABcRgEUlENBAAAAG3RFWHRTb2Z0d2FyZQBDZWxzeXMgU3R1ZGlvIFRvb2zBp+F8AAAE/ElEQVR42u3dW3baMBRAURhzO4x2zO5P25WPPAhIuq99JhAsayNwbHG/rusm6f3ugEiASIBIgEiASIBIgEiASIBIgNQ+mPv9/8Fc13V3ejUeyFsUnwWMRgF5FAYoGgXkWRiQqD2QFThAUUsgq3FAIkAgESCQCJDtQCARIJAIEEAECCQCJArISSQfHRekgIxG4h4yQCBZdAyQADLi+0jlGyw/e+2dAY+7mzdqgr76ek9OQjeENgBSDUl2IO51awjkJJRXTnTWd2T/WxoCJDOSla9r1UQ7faGjMpKWmzZk+riQCUgEjOpIWu9qsmNCfOckZ3nAKxpGZSRjtv2JeCePXj0ywQBkEJZHTnLk6pERBiDDsHx1oqOAZMZREYmdFZ+YYBlXkAowABmAJuqd/LO/WwkHIDqGoxoM30F0DEhFHIBoO5CqMADRFiBwAALIA5MKDkCWTbTIk7Hj41V1HIAknmCnT06HyQxHUiDVd0+EoxeOVEA6PKMASC8caYBkmFjVn7WAoymQrBPr7ZfjTvdBwVEISPVbJcDojQMQwQGI4ABEcAAiMAARMIAAAgwggKg8FEAECSACBBBB0gsIJIAAAogAgUS+gwAiQCARHAmBQAIIIJCoGKCU+2JBAgwgkKgAFiuIQPElXZAUBgKGsiJxq4kgyQgEDFVAEgIEDlVBchwIHAIEDDVBcgQIHAIEDgEChwABRJDsBgKHAIFDgAAiQOAQIIAIEEAECCASIBIgUk4cgAgQQAQHIAKkBhBI1AXHNiCgqAOO7UAgUWUcR4DAooowQoAAo0o4woFAoqwwrCACAxCBURQIHMoMIxQIHLKCAKIGWGxeLVCyAIFD1ZAAIlAyAInG8dXgwgvJWCDfHVRYIDkKJGLCrRhEUABpB2T14EEyG0mr50F2DRokgJQHsn13C0hGImnxyO2RgSoI5N+4dMUNSLblNvlEm3a1rjSQbjiyT6iJV+0ASQYk8yRaOQ5VoACSEMjfY/t1u91+JJknv6/r+ukNoRCQDpd2AckNBRBAUgHJhgWQpDgSvpseBxI9FuVvNekOJNEqEooj4ryXv5u3+8crQOLmQYvnQSasHoCcnxdtth4FpAaQj85T0EWPK9O5BaTPl/WngDzyujPvVQVIkZMXDGT56gELIIC88NonQgFkKBBImgLJdoICkSy5gvXs658Cpdw/CgFZC+TVY+gOpRSQlJsbNwACCSDdgGz5ByEkh4DsmDhZT0AnIJAcBLJyAmUf+AAkKYF0RAIIIJBEApmwbAPSF0nqnz+oMsiAAHJ08CsO7uG7e0ts1NABSaqfga48oAeBbH8GZOWKWB1JKJBOdQEy5fI8IH2/h5RaQcp/MgAEkN3HAYhOfsyyggACSCcglZEAAggggAACCCCAAAIIIDV3cwdEp5AAAgggnYC4zKt2QFYiAUQtgaxA4l4stQbyChK3u2sEkGeRAKIxQL4DxTPpikSS5kdz3sNiVxMB8g4UG8cJkInnEhBABAggAgQQAQIIIIAAAgggkAACCCCAACJAABEggAgQAQKIAAFEgAAiQACBBBBAAAEEEEAAESCACBBABAggRqEeEEgAAQQQQAABBBBAAAFEp4FAAggggAACCCCAAAIJIAIEECXCAQgggEACCCCAAAIIIIAoAggkgAACCCBwAAIIIJAAAggggCgZEEgAgQMQQACBBBBAAAEEDkgK9wfV+oLa+LwMvQAAAABJRU5ErkJggg==",zi="./assets/plastic.b8ac74ff.png",Ki="data:image/png;base64,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",xr="./assets/elfManagement.436c8744.png";const O=$t("main",function(){const e=Me(1),t=v(()=>(+new Date(new Date().getFullYear(),11,e.value)-me.time)/1e3),l=H(!1),i=H(-1),o=H(""),r=H();function d(p){const w=Me(!1),b=Me(!1);return Ht(()=>{const A=p(),f=kt(A.shouldNotify),_=kt(()=>u(f)||u(b));return{...A,opened:w,shouldNotify:_,recentlyUpdated:b,[xl]:us,[Nl]:function(){const{day:N,layer:T,symbol:J,opened:B,shouldNotify:E,story:F,completedStory:Z,recentlyUpdated:ie}=this;return{day:N,symbol:J,layer:T,opened:B,recentlyUpdated:ie,shouldNotify:E,onOpenLore(){var ne,Be;const oe=O.day.value>N;i.value=oe?N-1:-1;const ve=u((Be=(ne=Bt[T!=null?T:"trees"])==null?void 0:ne.name)!=null?Be:"");o.value=oe?`${ve} - Completed!`:ve,r.value=oe?`${F}<hr style="
margin: 10px 0;"/>${Z}`:F,l.value=!0},onOpenLayer(){if(ie.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(me.tabs.includes(T!=null?T:"trees")){const oe=me.tabs.lastIndexOf(T!=null?T:"trees");me.tabs.splice(oe,1)}else me.tabs.push(T!=null?T:"trees"),O.minimized.value=!0;else me.tabs.splice(1,1/0,T!=null?T:"trees")},onUnlockLayer(){T&&(B.value=!0,setTimeout(()=>{var oe,ve;i.value=-1,o.value=u((ve=(oe=Bt[T!=null?T:"trees"])==null?void 0:oe.name)!=null?ve:""),r.value=F,me.devSpeed=null,l.value=!0},1e3))}}}}})}const c=[d(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Li,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!"})),d(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:Gi,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!"})),d(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:Qi,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!"})),d(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:$i,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!"})),d(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:Hi,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!"})),d(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Vi,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!"})),d(()=>({day:7,shouldNotify:!1,layer:"metal",symbol:ji,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!"})),d(()=>({day:8,shouldNotify:!1,layer:"cloth",symbol:Ji,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!"})),d(()=>({day:9,shouldNotify:!1,layer:"oil",symbol:Wi,story:"Looks like you just need one more thing before the toy factory can start 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, but unfortunately you'll need to mine much deeper that you're currently doing, 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 this digging work - tomorrow will be a busy day! Good Job!"})),d(()=>({day:10,shouldNotify:!1,layer:"plastic",symbol:zi,story:"Now that plenty of oil has been prepared, it's time to start refining it into plastic! This should be incredibly useful not only for toys, but making tools and other items!",completedStory:"You've started refining massive amounts of oil into slightly less massive amounts of plastic. You have a slight pang of regret thinking of the environmental impact, but ultimately decide Christmas is worth it. Good Job!"})),d(()=>({day:11,shouldNotify:!1,layer:"dyes",symbol:Ki,story:"To make toys, we're going to need some color to make them look nice and enticing! We can't just give kids clear toys after all! To add some color to our toys, we'll need some dyes!",completedStory:"After all that effort, you finally have a rainbow of dyes to choose from! Now the children won't be able to resist the toys you have to offer, once you get them made of course..."})),d(()=>({day:12,shouldNotify:!1,layer:"management",symbol:xr,story:"You watch as the elves work, and you realize that they could probably be trained to help out better. Just then, Santa comes over to check on your progress. You reply that you're doing fine, except that the elves may need a bit of behavior management. Santa offers to help, saying that he doesn't want to leave you to do everything. Unfortunately for you, the behavior problems won't fix themselves, so let's get to work!",completedStory:"Woo! You are exhausted - this layer felt really long to you. It's great seeing the elves so productive, although you worry a bit about your own job security now! Good Job!"})),d(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"So after a good night's rest you decide that maybe making these elves able to do all the work for you isn't something to be scared of, but rather encouraged. Let's spend another day continuing to train them up and really get this place spinning. They are Santa's elves after all, they're supposed to be able to run everything without you!",completedStory:"The elves are doing an incredible job, and Santa does not seem keen on firing you - Score! Now you can get to work on guiding this properly trained highly functional group of hard workers to make Christmas as great as possible. Good Job!"})),d(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),d(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function m(){i.value=e.value-1,o.value="Day Complete!",r.value=c[e.value-1].completedStory,l.value=!0,e.value++,O.minimized.value=!1,me.devSpeed=0}return{name:"Calendar",days:c,day:e,timeUntilNewDay:t,loreScene:i,loreTitle:o,loreBody:r,showLoreModal:l,completeDay:m,minWidth:700,display:S(()=>n(M,null,[me.devSpeed===0?n("div",null,[s("Game Paused")]):null,me.devSpeed&&me.devSpeed!==1?n("div",null,[s("Dev Speed: "),j(me.devSpeed),s("x")]):null,me.offlineTime?n("div",null,[s("Offline Time: "),aa(me.offlineTime)]):null,n(_e,null,null),n("div",{class:"advent"},[c.reduce((p,w)=>(p[p.length-1].length===4&&p.push([]),p[p.length-1].push(w),p),[[]]).map(p=>at(...p))])]))}}),Nr=e=>[O,de,Ot,L,Pe,V,it,lt,vt,ue,Ye,We,U],ja=v(()=>!1);function Dr(e,t){["0.0","0.1","0.2","0.3","0.4"].includes(e!=null?e:"")}var Ir=Object.freeze(Object.defineProperty({__proto__:null,main:O,getInitialLayers:Nr,hasWon:ja,fixOldSave:Dr},Symbol.toStringTag,{value:"Module"}));const Tr={class:"scene"},Pr=["src"],Fr=["src"],Ur=["src"],Rr=["src"],Or=["src"],qr=["src"],Lr=["src"],Gr={key:7,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},Qr=["src"],$r=["src"],Hr=["src"],Vr=["src"],jr=Ce({__name:"Scene",props:{day:null},setup(e){return(t,l)=>(C(),I("div",Tr,[e.day>=7?(C(),I("img",{key:0,src:u(Ji),class:"scene-item",style:{left:"4%",bottom:"3%",width:"40px",height:"40px"}},null,8,Pr)):G("",!0),e.day>=0?(C(),I("img",{key:1,src:u(Li),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,Fr)):G("",!0),e.day>=1?(C(),I("img",{key:2,src:u(Gi),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,Ur)):G("",!0),e.day>=2?(C(),I("img",{key:3,src:u(Qi),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,Rr)):G("",!0),e.day>=6?(C(),I("img",{key:4,src:u(ji),class:"scene-item",style:{left:"72%",bottom:"8%",width:"40px",height:"40px"}},null,8,Or)):G("",!0),e.day>=8?(C(),I("img",{key:5,src:u(Wi),class:"scene-item",style:{left:"80%",bottom:"6%"}},null,8,qr)):G("",!0),e.day>=3?(C(),I("img",{key:6,src:u($i),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,Lr)):G("",!0),e.day>=4?(C(),I("div",Gr,[e.day>=4?(C(),I("img",{key:0,src:u(Hi),class:"scene-item"},null,8,Qr)):G("",!0),e.day>=5?(C(),I("img",{key:1,src:u(Vi),class:"scene-item"},null,8,$r)):G("",!0),e.day>=9?(C(),I("img",{key:2,src:u(zi),class:"scene-item"},null,8,Hr)):G("",!0),e.day>=10?(C(),I("img",{key:3,src:u(Ki),class:"scene-item"},null,8,Vr)):G("",!0)])):G("",!0)]))}});var Jr=Ve(jr,[["__scopeId","data-v-47b4d886"]]);const Wr=Ce({components:{Context:Si},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:Y(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:Y(Number,String),required:!0},name:{type:Y(String),required:!0},color:Y(String),minimizable:Y(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:l,minimized:i,minWidth:o,tab:r}=Nt(e),d=fa(t),c=v(()=>je.allowGoBack&&l.value>0&&!i.value);function m(){me.tabs.splice(u(e.index),1)}Rl(()=>w(i.value,u(o.value))),jt([i,Qo(o)],([b,A])=>w(b,A));function p(b){e.nodes.value=b}function w(b,A){const f=typeof A=="number"||Number.isNaN(parseInt(A))?A+"px":A,_=r.value();_!=null&&(b?(_.style.flexGrow="0",_.style.flexShrink="0",_.style.width="60px",_.style.minWidth=_.style.flexBasis="",_.style.margin="0"):(_.style.flexGrow="",_.style.flexShrink="",_.style.width="",_.style.minWidth=_.style.flexBasis=f,_.style.margin=""))}return{component:d,showGoBack:c,updateNodes:p,unref:u,goBack:m}}});function zr(e,t,l,i,o,r){const d=Ml("Context");return C(),I("div",{class:"layer-container",style:wt({"--layer-color":e.unref(e.color)})},[e.showGoBack?(C(),I("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):G("",!0),e.minimized.value?(C(),I("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[h("div",null,Ie(e.unref(e.name)),1)])):(C(),I("div",{key:2,class:ht(["layer-tab",{showGoBack:e.showGoBack}])},[n(d,{onUpdateNodes:e.updateNodes},{default:ge(()=>[(C(),be(pt(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(C(),I("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):G("",!0)],4)}var Kr=Ve(Wr,[["render",zr],["__scopeId","data-v-0158bec3"]]);const Xi=e=>(gl("data-v-4b4bda40"),e=e(),yl(),e),Xr=Xi(()=>h("h2",null,"Changelog",-1)),Yr=Xi(()=>h("details",{open:""},[h("summary",null,[s("v0.0 Initial Commit - "),h("time",null,"2021-09-04")]),s(" This is the first release :D "),h("ul",null,[h("li",{class:"feature"},"Did everything"),h("li",{class:"fix"},"Had some fun"),h("li",{class:"breaking"},"Removed everything"),h("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Zr=Ce({__name:"Changelog",setup(e,{expose:t}){const l=H(!1);return t({open(){l.value=!0}}),(i,o)=>(C(),be(Ct,{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=r=>l.value=r)},{header:ge(()=>[Xr]),body:ge(()=>[Yr]),_:1},8,["modelValue"]))}});var eu=Ve(Zr,[["__scopeId","data-v-4b4bda40"]]);const tu={class:"info-modal-header"},lu=["src","alt"],au={class:"info-modal-title"},iu={key:0},nu=s(" - "),ou={key:0},su={key:0},ru=h("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),uu=h("br",null,null,-1),du=h("br",null,null,-1),cu=["href"],pu=h("span",{class:"material-icons info-modal-discord"},"discord",-1),mu=h("div",null,[h("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[h("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Paper Pilot Community ")])],-1),vu=h("div",null,[h("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[h("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Modding Tree ")])],-1),fu=h("br",null,null,-1);var gu=Ce({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const l=e,{title:i,logo:o,author:r,discordName:d,discordLink:c,versionNumber:m,versionTitle:p}=je,w=Nt(l),b=H(!1),A=v(()=>aa(me.timePlayed)),f=v(()=>He(S(()=>n(M,null,[Fi.map(ce)]))));t({open(){b.value=!0}});function _(){var N;(N=u(w.changelog))==null||N.open()}return(N,T)=>(C(),be(Ct,{class:"info-modal",modelValue:b.value,"onUpdate:modelValue":T[0]||(T[0]=J=>b.value=J)},{header:ge(()=>[h("div",tu,[u(o)?(C(),I("img",{key:0,class:"info-modal-logo",src:u(o),alt:u(i)},null,8,lu)):G("",!0),h("div",au,[h("h2",null,"- "+Ie(u(i))+" -",1),h("h4",null,[s(" - v"+Ie(u(m)),1),u(p)?(C(),I("span",iu,": "+Ie(u(p)),1)):G("",!0),nu])])])]),body:ge(({shown:J})=>[J?(C(),I("div",ou,[u(r)?(C(),I("div",su,"By "+Ie(u(r)),1)):G("",!0),ru,uu,h("div",{class:"link",onClick:_},"Changelog"),du,h("div",null,[u(c)?(C(),I("a",{key:0,href:u(c),class:"info-modal-discord-link",target:"_blank"},[pu,s(" "+Ie(u(d)),1)],8,cu)):G("",!0)]),mu,vu,fu,h("div",null,"Time Played: "+Ie(u(A)),1),(C(),be(pt(u(f))))])):G("",!0)]),_:1},8,["modelValue"]))}});const Yi=e=>(gl("data-v-0d685451"),e=e(),yl(),e),yu=Yi(()=>h("h2",null,"Options",-1)),hu=Yi(()=>h("hr",null,null,-1));var bu=Ce({__name:"Options",setup(e,{expose:t}){const l=H(!1);t({open(){l.value=!0}});const i=Object.keys(Vl).map(f=>({label:Ei(f),value:f})),o=v(()=>He(S(()=>n(M,null,[Pi.map(ce)])))),{showTPS:r,theme:d}=Nt(ct),{autosave:c,usingLog:m}=Nt(me),p=v({get(){return me.devSpeed===0},set(f){me.devSpeed=f?0:null}}),w=S(()=>n("span",null,[s("Autosave"),n(gt,{display:"Save-specific"},{default:()=>[s("*")]})])),b=S(()=>n("span",null,[s("Pause game"),n(gt,{display:"Save-specific"},{default:()=>[s("*")]})])),A=S(()=>n("span",null,[s("Use log for progress bar"),n(gt,{display:"Save-specific"},{default:()=>[s("*")]})]));return(f,_)=>(C(),be(Ct,{modelValue:l.value,"onUpdate:modelValue":_[5]||(_[5]=N=>l.value=N)},{header:ge(()=>[yu]),body:ge(()=>[n(Va,{title:"Theme",options:u(i),modelValue:u(d),"onUpdate:modelValue":_[0]||(_[0]=N=>bt(d)?d.value=N:null)},null,8,["options","modelValue"]),(C(),be(pt(u(o)))),n(vl,{title:"Show TPS",modelValue:u(r),"onUpdate:modelValue":_[1]||(_[1]=N=>bt(r)?r.value=N:null)},null,8,["modelValue"]),hu,n(vl,{title:u(w),modelValue:u(c),"onUpdate:modelValue":_[2]||(_[2]=N=>bt(c)?c.value=N:null)},null,8,["title","modelValue"]),u(je).enablePausing?(C(),be(vl,{key:0,title:u(b),modelValue:u(p),"onUpdate:modelValue":_[3]||(_[3]=N=>bt(p)?p.value=N:null)},null,8,["title","modelValue"])):G("",!0),n(vl,{title:u(A),modelValue:u(m),"onUpdate:modelValue":_[4]||(_[4]=N=>bt(m)?m.value=N:null)},null,8,["title","modelValue"])]),_:1},8,["modelValue"]))}});var wu=Ve(bu,[["__scopeId","data-v-0d685451"]]);const Au=["onSubmit"],ku={class:"field"},Cu={key:0,class:"field-title"},Eu=["placeholder"],_u=Ce({__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,i=Bl(ol(l,"title"),"span"),o=Yt(null);ga(()=>{var m;(m=o.value)==null||m.focus()});const r=v({get(){return u(l.modelValue)||""},set(m){t("update:modelValue",m)}});function d(){t("submit")}function c(){l.submitOnBlur!==!1?t("submit"):t("cancel")}return(m,p)=>(C(),I("form",{onSubmit:Xl(d,["prevent"])},[h("div",ku,[u(i)?(C(),I("span",Cu,[(C(),be(pt(u(i))))])):G("",!0),e.textArea?(C(),be(u(gn),{key:1,modelValue:u(r),"onUpdate:modelValue":p[0]||(p[0]=w=>bt(r)?r.value=w:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:o},null,8,["modelValue","placeholder","maxHeight"])):ya((C(),I("input",{key:2,type:"text","onUpdate:modelValue":p[1]||(p[1]=w=>bt(r)?r.value=w:null),placeholder:e.placeholder,class:ht({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:o},null,42,Eu)),[[dn,u(r)]])])],40,Au))}});var Zi=Ve(_u,[["__scopeId","data-v-67b44a54"]]);const Su={key:0},Mu=["onClick","disabled"],Bu={key:0},xu=["onClick"],Nu=Ce({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Nt(e),o=H(!1);jt(o,c=>{t("confirmingChanged",c)});function r(){if(u(i.skipConfirm)){t("click");return}o.value&&t("click"),o.value=!o.value}function d(){o.value=!1}return(c,m)=>(C(),I("span",{class:ht(["container",{confirming:o.value}])},[o.value?(C(),I("span",Su,"Are you sure?")):G("",!0),h("button",{onClick:Xl(r,["stop"]),class:"button danger",disabled:e.disabled},[o.value?(C(),I("span",Bu,"Yes")):Xt(c.$slots,"default",{key:1},void 0,!0)],8,Mu),o.value?(C(),I("button",{key:1,class:"button",onClick:Xl(d,["stop"])},"No",8,xu)):G("",!0)],2))}});var Du=Ve(Nu,[["__scopeId","data-v-2f8ef34c"]]);const Iu=["onClick"],Tu=Ce({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const l=H(!1),i=H(null);function o(){t("click"),i.value&&clearTimeout(i.value),l.value=!1,Rl(()=>{l.value=!0,i.value=setTimeout(()=>l.value=!1,500)})}return(r,d)=>(C(),I("button",{onClick:Xl(o,["stop"]),class:ht(["feedback",{activated:l.value,left:e.left}])},[Xt(r.$slots,"default",{},void 0,!0)],10,Iu))}});var Pu=Ve(Tu,[["__scopeId","data-v-01a1b95c"]]);const bl=e=>(gl("data-v-5285ac49"),e=e(),yl(),e),Fu=bl(()=>h("div",{class:"handle material-icons"},"drag_handle",-1)),Uu={key:0,class:"actions"},Ru=bl(()=>h("span",{class:"material-icons"},"content_paste",-1)),Ou=bl(()=>h("span",{class:"material-icons"},"content_copy",-1)),qu=bl(()=>h("span",{class:"material-icons"},"edit",-1)),Lu=bl(()=>h("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Gu={key:1,class:"actions"},Qu=bl(()=>h("span",{class:"material-icons"},"check",-1)),$u=bl(()=>h("span",{class:"material-icons"},"close",-1)),Hu={key:2,class:"details"},Vu={class:"save-version"},ju=bl(()=>h("br",null,null,-1)),Ju={key:0},Wu={key:1},zu={key:3,class:"details"},Ku={key:4,class:"details error"},Xu=bl(()=>h("br",null,null,-1)),Yu=Ce({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const l=e,{save:i}=Nt(l),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),r=H(!1),d=H(!1),c=H("");jt(r,()=>c.value=i.value.name||"");const m=v(()=>i.value&&i.value.id===me.id),p=v(()=>m.value?me.time:i.value&&i.value.time||0),w=fa(v(()=>{var A,f,_,N;return`Day ${(N=(_=(f=(A=i.value)==null?void 0:A.layers)==null?void 0:f.main)==null?void 0:_.day)!=null?N:1}`}));function b(){t("editName",c.value),r.value=!1}return(A,f)=>(C(),I("div",{class:ht(["save",{active:u(m)}])},[Fu,r.value?(C(),I("div",Gu,[h("button",{onClick:b,class:"button"},[n(gt,{display:"Save",direction:u(Fe).Left,class:"info"},{default:ge(()=>[Qu]),_:1},8,["direction"])]),h("button",{onClick:f[5]||(f[5]=_=>r.value=!r.value),class:"button"},[n(gt,{display:"Cancel",direction:u(Fe).Left,class:"info"},{default:ge(()=>[$u]),_:1},8,["direction"])])])):(C(),I("div",Uu,[u(i).error==null&&!d.value?(C(),be(Pu,{key:0,onClick:f[0]||(f[0]=_=>t("export")),class:"button",left:""},{default:ge(()=>[n(gt,{display:"Export",direction:u(Fe).Left,class:"info"},{default:ge(()=>[Ru]),_:1},8,["direction"])]),_:1})):G("",!0),u(i).error==null&&!d.value?(C(),I("button",{key:1,onClick:f[1]||(f[1]=_=>t("duplicate")),class:"button"},[n(gt,{display:"Duplicate",direction:u(Fe).Left,class:"info"},{default:ge(()=>[Ou]),_:1},8,["direction"])])):G("",!0),u(i).error==null&&!d.value?(C(),I("button",{key:2,onClick:f[2]||(f[2]=_=>r.value=!r.value),class:"button"},[n(gt,{display:"Edit Name",direction:u(Fe).Left,class:"info"},{default:ge(()=>[qu]),_:1},8,["direction"])])):G("",!0),n(Du,{disabled:u(m),onClick:f[3]||(f[3]=_=>t("delete")),onConfirmingChanged:f[4]||(f[4]=_=>d.value=_)},{default:ge(()=>[n(gt,{display:"Delete",direction:u(Fe).Left,class:"info"},{default:ge(()=>[Lu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(i).error==null&&!r.value?(C(),I("div",Hu,[h("button",{class:"button open",onClick:f[6]||(f[6]=_=>t("open"))},[h("h3",null,Ie(u(i).name),1)]),h("span",Vu,"v"+Ie(u(i).modVersion),1),ju,u(p)?(C(),I("div",Ju,"Last played "+Ie(u(o).format(u(p))),1)):G("",!0),u(w)?(C(),I("div",Wu,[(C(),be(pt(u(w))))])):G("",!0)])):u(i).error==null&&r.value?(C(),I("div",zu,[n(Zi,{modelValue:c.value,"onUpdate:modelValue":f[7]||(f[7]=_=>c.value=_),class:"editname",onSubmit:b},null,8,["modelValue"])])):(C(),I("div",Ku,[s(" Error: Failed to load save with id "+Ie(u(i).id),1),Xu,s(Ie(u(i).error),1)]))],2))}});var Zu=Ve(Yu,[["__scopeId","data-v-5285ac49"]]);const Ja=e=>(gl("data-v-3b9991aa"),e=e(),yl(),e),ed=Ja(()=>h("h2",null,"Saves Manager",-1)),td={class:"modal-footer"},ld={class:"field"},ad=Ja(()=>h("span",{class:"field-title"},"Create Save",-1)),id={class:"field-buttons"},nd={class:"footer"},od=Ja(()=>h("div",{style:{"flex-grow":"1"}},null,-1)),sd=Ce({__name:"SavesManager",setup(e,{expose:t}){const l=H(!1),i=H(null);t({open(){l.value=!0}});const o=H(!1),r=H(""),d=H(null);jt(r,B=>{B?Rl(()=>{try{if(B[0]!=="{")if(B[0]==="e")B=decodeURIComponent(escape(atob(B)));else if(B[0]==="\u1BE1")B=Cl.decompressFromUTF16(B);else{console.warn("Unable to determine preset encoding",B),o.value=!0;return}const E=JSON.parse(B);if(typeof E!="object"){o.value=!0;return}const F=ua();E.id=F,al(E),r.value="",o.value=!1,ct.saves.push(F)}catch{o.value=!0}}):o.value=!1});let c={},m=H(Object.keys(c).reduce((B,E)=>(B.push({label:E.split("/").slice(-1)[0].slice(0,-4),value:c[E]}),B),[]));const p=ba({});function w(B){if(p[B]==null){let E=localStorage.getItem(B);if(E==null)p[B]={error:"Save doesn't exist in localStorage",id:B};else if(E==="dW5kZWZpbmVk")p[B]={error:"Save is undefined",id:B};else try{if(E[0]!=="{")if(E[0]==="e")E=decodeURIComponent(escape(atob(E)));else if(E[0]==="\u1BE1")E=Cl.decompressFromUTF16(E);else return console.warn("Unable to determine preset encoding",E),o.value=!0,p[B]={error:"Unable to determine preset encoding",id:B},p[B];p[B]={...JSON.parse(E),id:B}}catch(F){p[B]={error:F,id:B},console.warn(`SavesManager: Failed to load info about save with id ${B}:
${F}
${E}`)}}return p[B]}jt(l,B=>{B&&Object.keys(p).forEach(E=>delete p[E])});const b=v(()=>ct.saves.reduce((B,E)=>(B[E]=w(E),B),{}));function A(B){let E;switch(me.id===B?E=Di(me[mt]):E=JSON.stringify(b.value[B]),je.exportEncoding){default:console.warn(`Unknown save encoding: ${je.exportEncoding}. Defaulting to lz`);case"lz":E=Cl.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const F=document.createElement("textarea");F.value=E,document.body.appendChild(F),F.select(),F.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(F)}function f(B){me.id===B&&al();const E={...b.value[B],id:ua()};al(E),ct.saves.push(E.id)}function _(B){ct.saves=ct.saves.filter(E=>E!==B),localStorage.removeItem(B),p[B]=void 0}function N(B){b.value[me.id].time=me.time,al(),p[me.id]=void 0,Ul(b.value[B]),p[B]=void 0}function T(B){if(d.value=B,Rl(()=>{d.value=null}),B[0]!=="{")if(B[0]==="e")B=decodeURIComponent(escape(atob(B)));else if(B[0]==="\u1BE1")B=Cl.decompressFromUTF16(B);else{console.warn("Unable to determine preset encoding",B);return}const E=JSON.parse(B);E.id=ua(),al(E),ct.saves.push(E.id),N(E.id)}function J(B,E){const F=b.value[B];F&&(F.name=E,me.id===B?(me.name=E,al()):(al(F),p[B]=void 0))}return(B,E)=>(C(),be(Ct,{modelValue:l.value,"onUpdate:modelValue":E[4]||(E[4]=F=>l.value=F),ref_key:"modal",ref:i},{header:ge(()=>[ed]),body:ge(({shown:F})=>[F?(C(),be(u(fn),{key:0,list:u(ct).saves,handle:".handle",itemKey:Z=>Z},{item:ge(({element:Z})=>[n(Zu,{save:u(b)[Z],onOpen:ie=>N(Z),onExport:ie=>A(Z),onEditName:ie=>J(Z,ie),onDuplicate:ie=>f(Z),onDelete:ie=>_(Z)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):G("",!0)]),footer:ge(()=>[h("div",td,[n(Zi,{modelValue:r.value,"onUpdate:modelValue":E[0]||(E[0]=F=>r.value=F),title:"Import Save",placeholder:"Paste your save here!",class:ht({importingFailed:o.value})},null,8,["modelValue","class"]),h("div",ld,[ad,h("div",id,[h("button",{class:"button",onClick:E[1]||(E[1]=F=>N(u(Gl)().id))},"New Game"),Object.keys(u(m)).length>0?(C(),be(Va,{key:0,options:u(m),modelValue:d.value,"onUpdate:modelValue":E[2]||(E[2]=F=>T(F)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):G("",!0)])]),h("div",nd,[od,h("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=F=>l.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var en=Ve(sd,[["__scopeId","data-v-3b9991aa"]]);const Jt=e=>(gl("data-v-8495e562"),e=e(),yl(),e),rd=["src","alt"],ud={key:1,class:"title"},dd=Jt(()=>h("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),cd={class:"discord"},pd={class:"discord-links"},md={key:0},vd=["href"],fd=Jt(()=>h("li",null,[h("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),gd=Jt(()=>h("li",null,[h("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),yd={href:"https://forums.moddingtree.com/",target:"_blank"},hd=Jt(()=>h("span",{class:"material-icons"},"forum",-1)),bd=Jt(()=>h("span",{class:"material-icons"},"info",-1)),wd=Jt(()=>h("span",{class:"material-icons"},"library_books",-1)),Ad=Jt(()=>h("span",{class:"material-icons"},"settings",-1)),kd=Jt(()=>h("span",{class:"material-icons"},"library_books",-1)),Cd=Jt(()=>h("span",{class:"material-icons"},"settings",-1)),Ed=Jt(()=>h("span",{class:"material-icons"},"info",-1)),_d={href:"https://forums.moddingtree.com/",target:"_blank"},Sd=Jt(()=>h("span",{class:"material-icons"},"forum",-1)),Md={class:"discord"},Bd={class:"discord-links"},xd={key:0},Nd=["href"],Dd=Jt(()=>h("li",null,[h("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Id=Jt(()=>h("li",null,[h("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Td=Ce({__name:"Nav",setup(e){const t=H(null),l=H(null),i=H(null),o=H(null),{useHeader:r,banner:d,title:c,discordName:m,discordLink:p,versionNumber:w}=je;function b(){window.open(p,"mywindow")}return(A,f)=>(C(),I(M,null,[u(r)?(C(),I("div",Ol({key:0,class:"nav"},A.$attrs),[u(d)?(C(),I("img",{key:0,src:u(d),class:"banner",alt:u(c)},null,8,rd)):(C(),I("div",ud,Ie(u(c)),1)),h("div",{onClick:f[0]||(f[0]=_=>{var N;return(N=o.value)==null?void 0:N.open()}),class:"version-container"},[n(gt,{display:"Changelog",direction:u(Fe).Down,class:"version"},{default:ge(()=>[h("span",null,"v"+Ie(u(w)),1)]),_:1},8,["direction"])]),dd,h("div",cd,[h("span",{onClick:b,class:"material-icons"},"discord"),h("ul",pd,[u(p)?(C(),I("li",md,[h("a",{href:u(p),target:"_blank"},Ie(u(m)),9,vd)])):G("",!0),fd,gd])]),h("div",null,[h("a",yd,[n(gt,{display:"Forums",direction:u(Fe).Down,yoffset:"5px"},{default:ge(()=>[hd]),_:1},8,["direction"])])]),h("div",{onClick:f[1]||(f[1]=_=>{var N;return(N=t.value)==null?void 0:N.open()})},[n(gt,{display:"Info",direction:u(Fe).Down,class:"info"},{default:ge(()=>[bd]),_:1},8,["direction"])]),h("div",{onClick:f[2]||(f[2]=_=>{var N;return(N=l.value)==null?void 0:N.open()})},[n(gt,{display:"Saves",direction:u(Fe).Down,xoffset:"-20px"},{default:ge(()=>[wd]),_:1},8,["direction"])]),h("div",{onClick:f[3]||(f[3]=_=>{var N;return(N=i.value)==null?void 0:N.open()})},[n(gt,{display:"Options",direction:u(Fe).Down,xoffset:"-66px"},{default:ge(()=>[Ad]),_:1},8,["direction"])])],16)):(C(),I("div",Ol({key:1,class:"overlay-nav"},A.$attrs),[h("div",{onClick:f[4]||(f[4]=_=>{var N;return(N=o.value)==null?void 0:N.open()}),class:"version-container"},[n(gt,{display:"Changelog",direction:u(Fe).Right,xoffset:"25%",class:"version"},{default:ge(()=>[h("span",null,"v"+Ie(u(w)),1)]),_:1},8,["direction"])]),h("div",{onClick:f[5]||(f[5]=_=>{var N;return(N=l.value)==null?void 0:N.open()})},[n(gt,{display:"Saves",direction:u(Fe).Right},{default:ge(()=>[kd]),_:1},8,["direction"])]),h("div",{onClick:f[6]||(f[6]=_=>{var N;return(N=i.value)==null?void 0:N.open()})},[n(gt,{display:"Options",direction:u(Fe).Right},{default:ge(()=>[Cd]),_:1},8,["direction"])]),h("div",{onClick:f[7]||(f[7]=_=>{var N;return(N=t.value)==null?void 0:N.open()})},[n(gt,{display:"Info",direction:u(Fe).Right},{default:ge(()=>[Ed]),_:1},8,["direction"])]),h("div",null,[h("a",_d,[n(gt,{display:"Forums",direction:u(Fe).Right,xoffset:"7px"},{default:ge(()=>[Sd]),_:1},8,["direction"])])]),h("div",Md,[h("span",{onClick:b,class:"material-icons"},"discord"),h("ul",Bd,[u(p)?(C(),I("li",xd,[h("a",{href:u(p),target:"_blank"},Ie(u(m)),9,Nd)])):G("",!0),Dd,Id])])],16)),n(gu,{ref_key:"info",ref:t,changelog:o.value},null,8,["changelog"]),n(en,{ref_key:"savesManager",ref:l},null,512),n(wu,{ref_key:"options",ref:i},null,512),n(eu,{ref_key:"changelog",ref:o},null,512)],64))}});var tn=Ve(Td,[["__scopeId","data-v-8495e562"]]);const Wa=e=>(gl("data-v-248e2ebb"),e=e(),yl(),e),Pd={class:"inner-tab"},Fd={key:1},Ud=Wa(()=>h("br",null,null,-1)),Rd=s(" You can help continue the "),Od=Wa(()=>h("i",null,"advent",-1)),qd=s("ure at: "),Ld=Wa(()=>h("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[h("span",{class:"material-icons info-modal-discord"},"discord"),s(" The Paper Pilot Community ")],-1)),Gd=Ce({__name:"Game",setup(e){const t=ol(me,"tabs"),l=v(()=>Object.keys(Bt)),i=je.useHeader,o=Bl(O.loreBody);function r(d){const{display:c,minimized:m,minWidth:p,name:w,color:b,minimizable:A,nodes:f}=d;return{display:c,minimized:m,minWidth:p,name:w,color:b,minimizable:A,nodes:f}}return(d,c)=>(C(),I("div",{class:ht(["tabs-container",{useHeader:u(i)}])},[(C(!0),I(M,null,mi(u(t),(m,p)=>{var w,b;return C(),I("div",{key:p,class:ht(["tab",u((w=u(Bt)[m])==null?void 0:w.classes)]),ref_for:!0,ref:`tab-${p}`,style:wt(u((b=u(Bt)[m])==null?void 0:b.style))},[p===0&&!u(i)?(C(),be(tn,{key:0})):G("",!0),h("div",Pd,[u(l).includes(m)?(C(),be(Kr,Ol({key:0},r(u(Bt)[m]),{index:p,tab:()=>{var A;return(A=d.$refs[`tab-${p}`])==null?void 0:A[0]}}),null,16,["index","tab"])):(C(),be(pt(m),{key:1,index:p},null,8,["index"]))])],6)}),128)),n(Ct,{modelValue:u(O).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=m=>u(O).showLoreModal.value=m)},{header:ge(()=>[h("h2",null,Ie(u(O).loreTitle.value),1)]),body:ge(()=>[u(o)?(C(),be(pt(u(o)),{key:0})):G("",!0),u(O).loreScene.value!==-1?(C(),I("div",Fd,[n(Jr,{day:u(O).loreScene.value},null,8,["day"]),Ud,Rd,Od,qd,Ld])):G("",!0)]),_:1},8,["modelValue"])],2))}});var Qd=Ve(Gd,[["__scopeId","data-v-248e2ebb"]]);const oa=e=>(gl("data-v-4a50ce42"),e=e(),yl(),e),$d={class:"game-over-modal-header"},Hd=["src","alt"],Vd={class:"game-over-modal-title"},jd=oa(()=>h("h2",null,"Congratulations!",-1)),Jd={key:0},Wd=oa(()=>h("br",null,null,-1)),zd=oa(()=>h("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Kd=oa(()=>h("br",null,null,-1)),Xd=["href"],Yd=oa(()=>h("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Zd=Ce({__name:"GameOverScreen",setup(e){const{title:t,logo:l,discordName:i,discordLink:o,versionNumber:r,versionTitle:d}=je,c=v(()=>aa(me.timePlayed)),m=v(()=>ja.value&&!me.keepGoing),p=ol(me,"autosave");function w(){me.keepGoing=!0}function b(){Ul(Gl())}return(A,f)=>(C(),be(Ct,{"model-value":u(m)},{header:ge(()=>[h("div",$d,[u(l)?(C(),I("img",{key:0,class:"game-over-modal-logo",src:u(l),alt:u(t)},null,8,Hd)):G("",!0),h("div",Vd,[jd,h("h4",null,"You've beaten "+Ie(u(t))+" v"+Ie(u(r))+": "+Ie(u(d)),1)])])]),body:ge(({shown:_})=>[_?(C(),I("div",Jd,[h("div",null,"It took you "+Ie(u(c))+" to beat the game.",1),Wd,zd,Kd,h("div",null,[h("a",{href:u(o),class:"game-over-modal-discord-link"},[Yd,s(" "+Ie(u(i)),1)],8,Xd)]),n(vl,{title:"Autosave",modelValue:u(p),"onUpdate:modelValue":f[0]||(f[0]=N=>bt(p)?p.value=N:null)},null,8,["modelValue"])])):G("",!0)]),footer:ge(()=>[h("div",{class:"game-over-footer"},[h("button",{onClick:w,class:"button"},"Keep Going"),h("button",{onClick:b,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var ec=Ve(Zd,[["__scopeId","data-v-4a50ce42"]]);const Ca=e=>(gl("data-v-3de07c06"),e=e(),yl(),e),tc=Ca(()=>h("div",{class:"nan-modal-header"},[h("h2",null,"NaN value detected!")],-1)),lc={key:0},ac=Ca(()=>h("br",null,null,-1)),ic=["href"],nc=Ca(()=>h("span",{class:"material-icons nan-modal-discord"},"discord",-1)),oc=Ca(()=>h("br",null,null,-1)),sc={class:"nan-footer"},rc=Ce({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:l}=je,i=ol(me,"autosave"),o=ol(ft,"hasNaN"),r=H(null),d=v(()=>{var f;return(f=ft.NaNPath)==null?void 0:f.join(".")}),c=v(()=>{var f;return(f=ft.NaNPath)==null?void 0:f.slice(-1)[0]}),m=v(()=>ft.NaNReceiver&&c.value?ft.NaNReceiver[c.value]:null),p=v({get(){return me.devSpeed===0},set(f){me.devSpeed=f?null:0}});function w(){ft.NaNReceiver&&c.value&&(ft.NaNReceiver[c.value]=new a(0),ft.hasNaN=!1)}function b(){ft.NaNReceiver&&c.value&&(ft.NaNReceiver[c.value]=new a(1),ft.hasNaN=!1)}function A(){ft.NaNReceiver&&c.value&&(ft.NaNReceiver[c.value]=new a(NaN),ft.hasNaN=!1)}return(f,_)=>(C(),I(M,null,[n(Ct,Ol({modelValue:u(o),"onUpdate:modelValue":_[4]||(_[4]=N=>bt(o)?o.value=N:null)},f.$attrs),{header:ge(()=>[tc]),body:ge(()=>[h("div",null,[s(' Attempted to assign "'+Ie(u(d))+'" to NaN',1),u(m)?(C(),I("span",lc,Ie(" ")+"(previously "+Ie(u(j)(u(m)))+")",1)):G("",!0),s(". Auto-saving has been "+Ie(u(i)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),ac,h("div",null,[h("a",{href:u(l),class:"nan-modal-discord-link"},[nc,s(" "+Ie(u(t)),1)],8,ic)]),oc,n(vl,{title:"Autosave",modelValue:u(i),"onUpdate:modelValue":_[0]||(_[0]=N=>bt(i)?i.value=N:null)},null,8,["modelValue"]),u(je).enablePausing?(C(),be(vl,{key:0,title:"Pause game",modelValue:u(p),"onUpdate:modelValue":_[1]||(_[1]=N=>bt(p)?p.value=N:null)},null,8,["modelValue"])):G("",!0)]),footer:ge(()=>[h("div",sc,[h("button",{onClick:_[2]||(_[2]=N=>{var T;return(T=r.value)==null?void 0:T.open()}),class:"button"},"Open Saves Manager"),h("button",{onClick:w,class:"button"},"Set to 0"),h("button",{onClick:b,class:"button"},"Set to 1"),u(m)&&u(a).neq(u(m),0)&&u(a).neq(u(m),1)?(C(),I("button",{key:0,onClick:_[3]||(_[3]=N=>o.value=!1),class:"button"}," Set to previous ")):G("",!0),h("button",{onClick:A,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),n(en,{ref_key:"savesManager",ref:r},null,512)],64))}});var uc=Ve(rc,[["__scopeId","data-v-3de07c06"]]);const dc={key:0,class:"tpsDisplay"},cc={key:0,class:"low"},pc=Ce({__name:"TPS",setup(e){const t=v(()=>a.div(ft.lastTenTicks.length,ft.lastTenTicks.reduce((r,d)=>r+d,0))),l=H([]);Vt(()=>{l.value.push(Math.round(t.value.toNumber())),l.value.length>10&&(l.value=l.value.slice(1))});const i=v(()=>l.value.reduce((r,d)=>a.max(r,d),0)),o=v(()=>a.sub(t.value,i.value).gt(1));return(r,d)=>u(t).isNan()?G("",!0):(C(),I("div",dc,[s(" TPS: "+Ie(u(X)(u(t)))+" ",1),n(ha,{name:"fade"},{default:ge(()=>[u(o)?(C(),I("span",cc,Ie(u(X)(u(i))),1)):G("",!0)]),_:1})]))}});var mc=Ve(pc,[["__scopeId","data-v-46a3ed5b"]]);var vc=Ce({__name:"App",setup(e){const t=je.useHeader,l=v(()=>Vl[ct.theme].variables),i=ol(ct,"showTPS"),o=v(()=>He(S(()=>n(M,null,[Ro.map(ce)]))));return(r,d)=>(C(),I(M,null,[h("div",{id:"modal-root",style:wt(u(l))},null,4),h("div",{class:ht(["app",{useHeader:u(t)}]),style:wt(u(l))},[u(t)?(C(),be(tn,{key:0})):G("",!0),n(Qd),u(u(i))?(C(),be(mc,{key:1})):G("",!0),n(ec),n(uc),(C(),be(pt(u(o))))],6)],64))}});var fc=Ve(vc,[["__scopeId","data-v-580927bb"]]);function gc(e={}){const{immediate:t=!1,onNeedRefresh:l,onOfflineReady:i,onRegistered:o,onRegisterError:r}=e;let d,c;const m=async(p=!0)=>{p&&(d==null||d.addEventListener("controlling",w=>{w.isUpdate&&window.location.reload()})),c&&c.waiting&&await hn(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){d=new yn("./sw.js",{scope:"./",type:"classic"}),d.addEventListener("activated",p=>{p.isUpdate||i==null||i()});{const p=()=>{l==null||l()};d.addEventListener("waiting",p),d.addEventListener("externalwaiting",p)}d.register({immediate:t}).then(p=>{c=p,o==null||o(p)}).catch(p=>{r==null||r(p)})}return m}function yc(e={}){const{immediate:t=!0,onNeedRefresh:l,onOfflineReady:i,onRegistered:o,onRegisterError:r}=e,d=H(!1),c=H(!1);return{updateServiceWorker:gc({immediate:t,onNeedRefresh(){d.value=!0,l==null||l()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:o,onRegisterError:r}),offlineReady:c,needRefresh:d}}document.title=je.title;window.projInfo=je;if(je.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 Io();const{globalBus:e}=await ca(()=>Promise.resolve().then(function(){return fo}),void 0),{startGameLoop:t}=await ca(()=>import("./gameLoop.a132ef13.js"),["assets/gameLoop.a132ef13.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=cn(fc);e.emit("setupVue",l),l.mount("#app"),Rl(()=>{const i=fi(),{updateServiceWorker:o}=yc({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){o()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(()=>r.update(),60*60*1e3)}})}),t()});export{a as D,ca as _,ft as a,je as b,Ir as c,et as g,Ga as l,me as p,ct as s};