Advent-Incremental/assets/index.9085606c.js

16 lines
168 KiB
JavaScript

/* empty css */import"./vue.92681fcb.js";import{Z as S,l as Fe,u as Sn,q as cn,C as o,b1 as lt,aa as L,aE as y,a0 as M,a1 as f,aK as ft,G as we,t as q,aC as fi,w as tt,b2 as Je,a8 as u,O as F,ao as rs,I as Me,ay as Mn,ar as Lt,aG as gn,A as Re,_ as G,b6 as U,b8 as In,bs as pi,aq as Gt,bu as sn,bb as An,T as us,a7 as h,j as cs,bv as ei,J as W,$ as B,aH as wt,aF as kt,z as ot,aN as ye,al as bn,aL as Et,H as ds,aJ as hi,bn as ms,br as fs,be as ps}from"./@vue.4ce677c2.js";import{i as hs}from"./is-plain-object.906d88e8.js";import{c as gi}from"./nanoevents.1080beb7.js";import{L as It}from"./lz-string.731cedc5.js";import{Y as gs}from"./vue-next-select.a2bfab1d.js";import{s as vs,u as vi}from"./vue-toastification.6f567382.js";import{D as ys}from"./vuedraggable.7949458c.js";import{p as bs}from"./vue-textarea-autosize.35804eaf.js";import{v as _s,n as ws}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const ks=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}};ks();const Cs="modulepreload",ti={},Ns="./",_n=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Ns}${i}`,i in ti)return;ti[i]=!0;const s=i.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${l}`))return;const r=document.createElement("link");if(r.rel=s?"stylesheet":Cs,s||(r.as="script",r.crossOrigin=""),r.href=i,document.head.appendChild(r),s)return new Promise((c,m)=>{r.addEventListener("load",c),r.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Ss="./projInfo-schema.json",Ms="Advent Incremental",Is="An incremental game you play a day at a time, leading up to Christmas!",As="advent-incremental",Es="thepaperpilot and friends",Bs="",xs="",Ps="0.3",Fs="Initial Commit",Ts=!0,Rs=!1,$s=2,Ds=!0,Os=null,qs="",Us=["main"],Vs=3600,Ls=0,Gs=!0,Hs="base64";var ee={$schema:Ss,title:Ms,description:Is,id:As,author:Es,discordName:Bs,discordLink:xs,versionNumber:Ps,versionTitle:Fs,allowGoBack:Ts,defaultShowSmall:Rs,defaultDecimalsShown:$s,useHeader:Ds,banner:Os,logo:qs,initialTabs:Us,maxTickLength:Vs,offlineLimit:Ls,enablePausing:Gs,exportEncoding:Hs};const $n=17,Qs=9e15,zs=Math.log10(9e15),js=1/9e15,Ks=308,Ws=-324,ni=5,Js=function(){const e=[];for(let n=Ws+1;n<=Ks;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Dt=[2,Math.E,3,4,5,6,7,8,9,10],Xs=[[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]],Ys=[[-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]],p=function(t){return a.fromValue_noAlloc(t)},V=function(e,t,n){return a.fromComponents(e,t,n)},z=function(t,n,i){return a.fromComponents_noNormalize(t,n,i)},Mt=function(t,n){const i=n+1,s=Math.ceil(Math.log10(Math.abs(t))),l=Math.round(t*Math.pow(10,i-s))*Math.pow(10,s-i);return parseFloat(l.toFixed(Math.max(i-s,0)))},Dn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Zs=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 n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let s=e;return n=n+1/(12*s),s=s*i,n=n+1/(360*s),s=s*i,n=n+1/(1260*s),s=s*i,n=n+1/(1680*s),s=s*i,n=n+1/(1188*s),s=s*i,n=n+691/(360360*s),s=s*i,n=n+7/(1092*s),s=s*i,n=n+3617/(122400*s),Math.exp(n)/t},yi=.5671432904097838,ii=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return yi;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let s=0;s<100;++s){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n)<t*Math.abs(i))return i;n=i}throw Error(`Iteration failed to converge: ${e.toString()}`)};function si(e,t=1e-10){let n,i,s,l;if(!Number.isFinite(e.mag)||e===a.dZero)return e;if(e===a.dOne)return p(yi);a.abs(e),n=a.ln(e);for(let r=0;r<100;++r){if(i=a.exp(-n),s=n.sub(e.mul(i)),l=n.sub(s.div(n.add(1).sub(n.add(2).mul(s).div(a.mul(2,n).add(2))))),a.abs(l.sub(n)).lt(a.abs(l).mul(t)))return l;n=l}throw Error(`Iteration failed to converge: ${e.toString()}`)}const k=class{constructor(e){this.sign=Number.NaN,this.mag=Number.NaN,this.layer=Number.NaN,e instanceof k||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/Js(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,n){return new k().fromComponents(e,t,n)}static fromComponents_noNormalize(e,t,n){return new k().fromComponents_noNormalize(e,t,n)}static fromMantissaExponent(e,t){return new k().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new k().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new k().fromDecimal(e)}static fromNumber(e){return new k().fromNumber(e)}static fromString(e){return new k().fromString(e)}static fromValue(e){return new k().fromValue(e)}static fromValue_noAlloc(e){return e instanceof k?e:new k(e)}static abs(e){return p(e).abs()}static neg(e){return p(e).neg()}static negate(e){return p(e).neg()}static negated(e){return p(e).neg()}static sign(e){return p(e).sign}static sgn(e){return p(e).sign}static round(e){return p(e).round()}static floor(e){return p(e).floor()}static ceil(e){return p(e).ceil()}static trunc(e){return p(e).trunc()}static add(e,t){return p(e).add(t)}static plus(e,t){return p(e).add(t)}static sub(e,t){return p(e).sub(t)}static subtract(e,t){return p(e).sub(t)}static minus(e,t){return p(e).sub(t)}static mul(e,t){return p(e).mul(t)}static multiply(e,t){return p(e).mul(t)}static times(e,t){return p(e).mul(t)}static div(e,t){return p(e).div(t)}static divide(e,t){return p(e).div(t)}static recip(e){return p(e).recip()}static reciprocal(e){return p(e).recip()}static reciprocate(e){return p(e).reciprocate()}static cmp(e,t){return p(e).cmp(t)}static cmpabs(e,t){return p(e).cmpabs(t)}static compare(e,t){return p(e).cmp(t)}static isNaN(e){return e=p(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=p(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return p(e).eq(t)}static equals(e,t){return p(e).eq(t)}static neq(e,t){return p(e).neq(t)}static notEquals(e,t){return p(e).notEquals(t)}static lt(e,t){return p(e).lt(t)}static lte(e,t){return p(e).lte(t)}static gt(e,t){return p(e).gt(t)}static gte(e,t){return p(e).gte(t)}static max(e,t){return p(e).max(t)}static min(e,t){return p(e).min(t)}static minabs(e,t){return p(e).minabs(t)}static maxabs(e,t){return p(e).maxabs(t)}static clamp(e,t,n){return p(e).clamp(t,n)}static clampMin(e,t){return p(e).clampMin(t)}static clampMax(e,t){return p(e).clampMax(t)}static cmp_tolerance(e,t,n){return p(e).cmp_tolerance(t,n)}static compare_tolerance(e,t,n){return p(e).cmp_tolerance(t,n)}static eq_tolerance(e,t,n){return p(e).eq_tolerance(t,n)}static equals_tolerance(e,t,n){return p(e).eq_tolerance(t,n)}static neq_tolerance(e,t,n){return p(e).neq_tolerance(t,n)}static notEquals_tolerance(e,t,n){return p(e).notEquals_tolerance(t,n)}static lt_tolerance(e,t,n){return p(e).lt_tolerance(t,n)}static lte_tolerance(e,t,n){return p(e).lte_tolerance(t,n)}static gt_tolerance(e,t,n){return p(e).gt_tolerance(t,n)}static gte_tolerance(e,t,n){return p(e).gte_tolerance(t,n)}static pLog10(e){return p(e).pLog10()}static absLog10(e){return p(e).absLog10()}static log10(e){return p(e).log10()}static log(e,t){return p(e).log(t)}static log2(e){return p(e).log2()}static ln(e){return p(e).ln()}static logarithm(e,t){return p(e).logarithm(t)}static pow(e,t){return p(e).pow(t)}static pow10(e){return p(e).pow10()}static root(e,t){return p(e).root(t)}static factorial(e,t){return p(e).factorial()}static gamma(e,t){return p(e).gamma()}static lngamma(e,t){return p(e).lngamma()}static exp(e){return p(e).exp()}static sqr(e){return p(e).sqr()}static sqrt(e){return p(e).sqrt()}static cube(e){return p(e).cube()}static cbrt(e){return p(e).cbrt()}static tetrate(e,t=2,n=z(1,0,1)){return p(e).tetrate(t,n)}static iteratedexp(e,t=2,n=z(1,0,1)){return p(e).iteratedexp(t,n)}static iteratedlog(e,t=10,n=1){return p(e).iteratedlog(t,n)}static layeradd10(e,t){return p(e).layeradd10(t)}static layeradd(e,t,n=10){return p(e).layeradd(t,n)}static slog(e,t=10){return p(e).slog(t)}static lambertw(e){return p(e).lambertw()}static ssqrt(e){return p(e).ssqrt()}static pentate(e,t=2,n=z(1,0,1)){return p(e).pentate(t,n)}static affordGeometricSeries(e,t,n,i){return this.affordGeometricSeries_core(p(e),p(t),p(n),i)}static sumGeometricSeries(e,t,n,i){return this.sumGeometricSeries_core(e,p(t),p(n),i)}static affordArithmeticSeries(e,t,n,i){return this.affordArithmeticSeries_core(p(e),p(t),p(n),p(i))}static sumArithmeticSeries(e,t,n,i){return this.sumArithmeticSeries_core(p(e),p(t),p(n),p(i))}static efficiencyOfPurchase(e,t,n){return this.efficiencyOfPurchase_core(p(e),p(t),p(n))}static randomDecimalForTesting(e){if(Math.random()*20<1)return z(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return z(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let s=Math.pow(10,i);return Math.random()>.9&&(s=Math.trunc(s)),V(t,n,s)}static affordGeometricSeries_core(e,t,n,i){const s=t.mul(n.pow(i));return k.floor(e.div(s).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(k.sub(1,n.pow(e))).div(k.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const l=t.add(i.mul(n)).sub(n.div(2)),r=l.pow(2);return l.neg().add(r.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n));return e.div(2).mul(s.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}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<js)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Qs)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<zs&&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,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,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 b=parseFloat(t[0]),v=parseFloat(t[1]),w=t[1].split(";");let C=1;if(w.length===2&&(C=parseFloat(w[1]),isFinite(C)||(C=1)),isFinite(b)&&isFinite(v)){const P=k.pentate(b,v,C);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,this}}const n=e.split("^^");if(n.length===2){const b=parseFloat(n[0]),v=parseFloat(n[1]),w=n[1].split(";");let C=1;if(w.length===2&&(C=parseFloat(w[1]),isFinite(C)||(C=1)),isFinite(b)&&isFinite(v)){const P=k.tetrate(b,v,C);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,this}}const i=e.split("^");if(i.length===2){const b=parseFloat(i[0]),v=parseFloat(i[1]);if(isFinite(b)&&isFinite(v)){const w=k.pow(b,v);return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,this}}e=e.trim().toLowerCase();let s,l,r=e.split("pt");if(r.length===2){s=10,l=parseFloat(r[0]),r[1]=r[1].replace("(",""),r[1]=r[1].replace(")","");let b=parseFloat(r[1]);if(isFinite(b)||(b=1),isFinite(s)&&isFinite(l)){const v=k.tetrate(s,l,b);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}if(r=e.split("p"),r.length===2){s=10,l=parseFloat(r[0]),r[1]=r[1].replace("(",""),r[1]=r[1].replace(")","");let b=parseFloat(r[1]);if(isFinite(b)||(b=1),isFinite(s)&&isFinite(l)){const v=k.tetrate(s,l,b);return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,this}}const c=e.split("e"),m=c.length-1;if(m===0){const b=parseFloat(e);if(isFinite(b))return this.fromNumber(b)}else if(m===1){const b=parseFloat(e);if(isFinite(b)&&b!==0)return this.fromNumber(b)}const d=e.split("e^");if(d.length===2){this.sign=1,d[0].charAt(0)=="-"&&(this.sign=-1);let b="";for(let v=0;v<d[1].length;++v){const w=d[1].charCodeAt(v);if(w>=43&&w<=57||w===101)b+=d[1].charAt(v);else return this.layer=parseFloat(b),this.mag=parseFloat(d[1].substr(v+1)),this.normalize(),this}}if(m<1)return this.sign=0,this.layer=0,this.mag=0,this;const g=parseFloat(c[0]);if(g===0)return this.sign=0,this.layer=0,this.mag=0,this;let _=parseFloat(c[c.length-1]);if(m>=2){const b=parseFloat(c[c.length-2]);isFinite(b)&&(_*=Math.sign(b),_+=Dn(b))}if(!isFinite(g))this.sign=c[0]==="-"?-1:1,this.layer=m,this.mag=_;else if(m===1)this.sign=Math.sign(g),this.layer=1,this.mag=_+Math.log10(Math.abs(g));else if(this.sign=Math.sign(g),this.layer=m,m===2){const b=k.mul(V(1,2,_),p(g));return this.sign=b.sign,this.layer=b.layer,this.mag=b.mag,this}else this.mag=_;return this.normalize(),this}fromValue(e){return e instanceof k||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:Mt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Mt(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<=ni?(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):Mt(this.m,e)+"e"+Mt(this.e,e):this.layer===1?Mt(this.m,e)+"e"+Mt(this.e,e):this.layer<=ni?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Mt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Mt(this.mag,e)}abs(){return z(this.sign===0?0:1,this.layer,this.mag)}neg(){return z(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?k.dZero:this.layer===0?V(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?k.dZero:this.layer===0?V(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?k.dZero:this.layer===0?V(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?k.dZero:this.layer===0?V(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=p(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 z(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(k.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return p(n.sign*n.mag+i.sign*i.mag);const s=n.layer*Math.sign(n.mag),l=i.layer*Math.sign(i.mag);if(s-l>=2)return n;if(s===0&&l===-1){if(Math.abs(i.mag-Math.log10(n.mag))>$n)return n;{const r=Math.pow(10,Math.log10(n.mag)-i.mag),c=i.sign+n.sign*r;return V(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}if(s===1&&l===0){if(Math.abs(n.mag-Math.log10(i.mag))>$n)return n;{const r=Math.pow(10,n.mag-Math.log10(i.mag)),c=i.sign+n.sign*r;return V(Math.sign(c),1,Math.log10(i.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(n.mag-i.mag)>$n)return n;{const r=Math.pow(10,n.mag-i.mag),c=i.sign+n.sign*r;return V(Math.sign(c),1,i.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(p(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=p(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return z(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return z(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return p(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return V(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return V(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return V(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const s=V(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(V(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return V(n.sign*i.sign,s.layer+1,s.sign*s.mag)}if(n.layer===2&&i.layer===2){const s=V(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(V(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return V(n.sign*i.sign,s.layer+1,s.sign*s.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=p(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?k.dNaN:this.layer===0?V(this.sign,0,1/this.mag):V(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=p(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=p(e),n=this.mag>0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:n<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=p(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=p(e);return this.lt(t)?t:this}min(e){const t=p(e);return this.gt(t)?t:this}maxabs(e){const t=p(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=p(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 n=p(e);return this.eq_tolerance(n,t)?0:this.cmp(n)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const n=p(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,s=n.mag;return this.layer>n.layer&&(s=Dn(s)),this.layer<n.layer&&(i=Dn(i)),Math.abs(i-s)<=t*Math.max(Math.abs(i),Math.abs(s))}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 n=p(e);return!this.eq_tolerance(n,t)&&this.lt(n)}lte_tolerance(e,t){const n=p(e);return this.eq_tolerance(n,t)||this.lt(n)}gt_tolerance(e,t){const n=p(e);return!this.eq_tolerance(n,t)&&this.gt(n)}gte_tolerance(e,t){const n=p(e);return this.eq_tolerance(n,t)||this.gt(n)}pLog10(){return this.lt(k.dZero)?k.dZero:this.log10()}absLog10(){return this.sign===0?k.dNaN:this.layer>0?V(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):V(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?k.dNaN:this.layer>0?V(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):V(this.sign,0,Math.log10(this.mag))}log(e){return e=p(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?k.dNaN:this.layer===0&&e.layer===0?V(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):k.div(this.log10(),e.log10())}log2(){return this.sign<=0?k.dNaN:this.layer===0?V(this.sign,0,Math.log2(this.mag)):this.layer===1?V(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?V(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):V(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?k.dNaN:this.layer===0?V(this.sign,0,Math.log(this.mag)):this.layer===1?V(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?V(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):V(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=p(e),n=this,i=t;if(n.sign===0)return i.eq(0)?z(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return z(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const s=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?s.neg():Math.abs(i.toNumber()%2)%2===0?s:k.dNaN:s}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return k.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 V(1,0,t);if(e.sign===0)return k.dOne;e=z(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?V(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?V(-e.sign,e.layer+1,-e.mag):k.dOne}pow_base(e){return p(e).pow(this)}root(e){const t=p(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?k.exp(k.mul(this,k.ln(this).sub(1))):k.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(z(1,0,24)))return p(Zs(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,s=12*i,l=1/s,r=t+l;if(r===t||(t=r,i=i*n,s=360*i,l=1/s,r=t-l,r===t))return k.exp(t);t=r,i=i*n,s=1260*i;let c=1/s;return t=t+c,i=i*n,s=1680*i,c=1/s,t=t-c,k.exp(t)}else return this.layer===1?k.exp(k.mul(this,k.ln(this).sub(1))):k.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?k.dOne:this.layer===0&&this.mag<=709.7?p(Math.exp(this.sign*this.mag)):this.layer===0?V(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?V(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):V(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return p(Math.sqrt(this.sign*this.mag));if(this.layer===1)return V(1,2,Math.log10(this.mag)-.3010299956639812);{const e=k.div(z(this.sign,this.layer-1,this.mag),z(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=z(1,0,1)){if(e===1)return k.pow(this,t);if(e===0)return new k(t);if(this.eq(k.dOne))return k.dOne;if(this.eq(-1))return k.pow(this,t);if(e===Number.POSITIVE_INFINITY){const s=this.toNumber();if(s<=1.444667861009766&&s>=.06598803584531254){if(s>1.444667861009099)return new k(Math.E);const l=k.ln(this).neg();return l.lambertw().div(l)}else return s>1.444667861009766?new k(Number.POSITIVE_INFINITY):k.dNaN}if(this.eq(k.dZero)){let s=Math.abs((e+1)%2);return s>1&&(s=2-s),new k(s)}if(e<0)return k.iteratedlog(t,this,-e);t=p(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(k.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let s=0;s<e;++s){const l=t;if(t=this.pow(t),l.eq(t))return t}if(i!=0){const s=this.pow(t);return t.mul(1-i).add(s.mul(i))}return t}i!==0&&(t.eq(k.dOne)?this.gt(10)?t=this.pow(i):(t=p(k.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 s=0;s<e;++s){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return z(t.sign,t.layer+(e-s-1),t.mag);if(s>1e4)return t}return t}iteratedexp(e=2,t=z(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return k.tetrate(e,-t,this);e=p(e);let n=p(this);const i=t;t=Math.trunc(t);const s=i-t;if(n.layer-e.layer>3){const l=Math.min(t,n.layer-e.layer-3);t-=l,n.layer-=l}for(let l=0;l<t;++l){if(n=n.log(e),!isFinite(n.layer)||!isFinite(n.mag))return n.normalize();if(l>1e4)return n}return s>0&&s<1&&(e.eq(10)?n=n.layeradd10(-s):n=n.layeradd(-s,e)),n}slog(e=10){if(e=p(e),e.lte(k.dZero)||e.eq(k.dOne))return k.dNaN;if(e.lt(k.dOne))return this.eq(k.dOne)?k.dZero:this.eq(k.dZero)?k.dNegOne:k.dNaN;if(this.mag<0||this.eq(k.dZero))return k.dNegOne;let t=0,n=p(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(k.dZero))n=k.pow(e,n),t-=1;else{if(n.lte(k.dOne))return p(t+k.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=k.log(n,e)}return p(t)}static slog_critical(e,t){return e>10?t-1:k.critical_section(e,t,Ys)}static tetrate_critical(e,t){return k.critical_section(e,t,Xs)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,s=0;for(let c=0;c<Dt.length;++c)if(Dt[c]==e){i=n[c][Math.floor(t)],s=n[c][Math.ceil(t)];break}else if(Dt[c]<e&&Dt[c+1]>e){const m=(e-Dt[c])/(Dt[c+1]-Dt[c]);i=n[c][Math.floor(t)]*(1-m)+n[c+1][Math.floor(t)]*m,s=n[c][Math.ceil(t)]*(1-m)+n[c+1][Math.ceil(t)]*m;break}const l=t-Math.floor(t);return i*(1-l)+s*l}layeradd10(e){e=k.fromValue_noAlloc(e).toNumber();const t=p(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 n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,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?k.tetrate(t,i):Number.isFinite(i)?i>=-1?k.log(k.tetrate(t,i+1),t):k.log(k.log(k.tetrate(t,i+2),t),t):k.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return p(ii(this.toNumber()));if(this.layer===0)return p(ii(this.sign*this.mag));if(this.layer===1)return si(this);if(this.layer===2)return si(this);if(this.layer>=3)return z(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return z(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=z(1,0,1)){t=p(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(k.dOne)?(++e,t=new k(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let s=0;s<e;++s){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(s>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?p(Math.sin(this.sign*this.mag)):z(0,0,0)}cos(){return this.mag<0?k.dOne:this.layer===0?p(Math.cos(this.sign*this.mag)):z(0,0,0)}tan(){return this.mag<0?this:this.layer===0?p(Math.tan(this.sign*this.mag)):z(0,0,0)}asin(){return this.mag<0?this:this.layer===0?p(Math.asin(this.sign*this.mag)):z(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?p(Math.acos(this.toNumber())):this.layer===0?p(Math.acos(this.sign*this.mag)):z(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?p(Math.atan(this.sign*this.mag)):p(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 k.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return k.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?z(Number.NaN,Number.NaN,Number.NaN):k.ln(this.add(1).div(p(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(k.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=k;a.dZero=z(0,0,0);a.dOne=z(1,0,1);a.dNegOne=z(-1,0,1);a.dTwo=z(1,0,2);a.dTen=z(1,0,10);a.dNaN=z(Number.NaN,Number.NaN,Number.NaN);a.dInf=z(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);a.dNegInf=z(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);a.dNumberMax=V(1,0,Number.MAX_VALUE);a.dNumberMin=V(1,0,Number.MIN_VALUE);const ea=new a(1);function tn(e,t,n=!0){let i=a.log10(e).floor(),s=a.div(e,a.pow(10,i));s.toStringWithDecimalPlaces(t)==="10"&&(s=ea,i=i.add(1));const l=i.gte(1e9)?Xe(i,Math.max(Math.max(t,3),ee.defaultDecimalsShown)):i.gte(1e4)?wn(i,0):i.toStringWithDecimalPlaces(0);return n?s.toStringWithDecimalPlaces(t)+"e"+l:"e"+l}function wn(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 bi(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()),ee.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const ta=new a("eeee1000"),na=new a("e100000"),ai=new a("e1000"),_i=new a(1e9),ia=new a(1e6),sa=new a(1e3),aa=new a(.98),la=new a(.001),wi=new a(0);function Xe(e,t,n){if(t==null&&(t=ee.defaultDecimalsShown),n=n!=null?n:ee.defaultShowSmall,e=new a(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Xe(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(ta)){const i=e.slog();return i.gte(ia)?"F"+Xe(i.floor()):a.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+wn(i.floor(),0)}else{if(e.gte(na))return tn(e,0,!1);if(e.gte(ai))return tn(e,0);if(e.gte(_i))return tn(e,t);if(e.gte(sa))return wn(e,0);if(e.gte(la)||!n)return bi(e,t);if(e.eq(wi))return 0 .toFixed(t)}return e=Ci(e),e.lt(ai)?tn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Xe(e,t)+"\u207B\xB9"}function Le(e){return e=new a(e),e.sign<0?"-"+Le(e.neg()):e.gte(_i)||e.lte(aa)&&!e.eq(wi)?Xe(e):Xe(e,0)}function ki(e){return a.lt(e,0)?"-"+ki(a.neg(e)):a.gt(e,2**51)?Xe(a.div(e,31536e3))+"y":(e=new a(e).toNumber(),e<60?Xe(e)+"s":e<3600?Le(Math.floor(e/60))+"m "+Xe(e%60)+"s":e<86400?Le(Math.floor(e/3600))+"h "+Le(Math.floor(e/60)%60)+"m "+Le(e%60)+"s":e<31536e3?Le(Math.floor(e/84600)%365)+"d "+Le(Math.floor(e/3600)%24)+"h "+Le(Math.floor(e/60)%60)+"m":Le(Math.floor(e/31536e3))+"y "+Le(Math.floor(e/84600)%365)+"d "+Le(Math.floor(e/3600)%24)+"h")}function oa(e,t,n){e=new a(e);let i=e.toStringWithDecimalPlaces(t);return new a(i).gte(n)&&(i=a.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function ra(e,t){return Xe(e,t,!0)}function Ci(e){let t=a.log10(e).ceil();const n=a.div(e,a.pow(10,t));return t=t.neg(),e=new a(10).pow(t).times(n),e}function ua(e,t){let n=e[0][0],i=e[0][1];for(let s=1;s<e.length;s++)a.lt(e[s][0],n)&&(n=e[s][0],i=e[s][1]);return Xe(n)+t+", limited by "+i}var ca=Object.freeze(Object.defineProperty({__proto__:null,default:a,exponentialFormat:tn,commaFormat:wn,regularFormat:bi,format:Xe,formatWhole:Le,formatTime:ki,toPlaces:oa,formatSmall:ra,invertOOM:Ci,formatLimit:ua},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:da,commaFormat:ma,regularFormat:fa,format:te,formatWhole:K,formatTime:En,toPlaces:pa,formatSmall:ha,formatLimit:Ni,invertOOM:ga}=ca;window.Decimal=a;window.exponentialFormat=da;window.commaFormat=ma;window.regularFormat=fa;window.format=te;window.formatWhole=K;window.formatTime=En;window.toPlaces=pa;window.formatSmall=ha;window.formatLimit=Ni;window.invertOOM=ga;function Si(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function On(e){return typeof e=="function"}var se=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(se||{});const an=Symbol("DoNotCache");function T(e,t){const n=e[t];On(n)&&n.length===0&&!n[an]?e[t]=S(n.bind(e)):On(n)&&(e[t]=n.bind(e),e[t][an]=!0)}function qe(e){return On(e)&&!e[an]&&(e=S(e)),e}const xt=Symbol("Component"),Pt=Symbol("GatherProps");let va=0;function Jt(e="feature-"){return e+va++}var Ie=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ie||{});function R(e){return e[an]=!0,e}function H(e,t=2){return e?0:t}function Te(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Mi(e,...t){const n=[],i=s=>{Object.keys(s).forEach(l=>{const r=s[l];r&&typeof r=="object"&&(t.includes(r.type)?n.push(r):!(r instanceof a)&&!Fe(r)&&i(r))})};return i(e),n}const Ot={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 Un=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Un||{}),dn={classic:Ot,paper:{...Ot,variables:{...Ot.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:{...Ot,variables:{...Ot.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:{...Ot,variables:{...Ot.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const ge=Symbol("ProxyState"),Qt=Symbol("ProxyPath");function Qe(e,t={}){const n=t;let i=!1;function s(){return i||(Object.assign(n,e(n)),i=!0),n}return new Proxy(n,{get(l,r){return r===ge?s():s()[r]},set(l,r,c){return s()[r]=c,!0},has(l,r){return r===ge?!0:Reflect.has(s(),r)},ownKeys(){return Reflect.ownKeys(s())},getOwnPropertyDescriptor(l,r){return i||(Object.assign(n,e(n)),i=!0),Object.getOwnPropertyDescriptor(l,r)}})}var le=window.state=Sn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Ii=cn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});function Ai(e){return JSON.stringify(e,(t,n)=>o(n))}const Ei={get(e,t){var i;if(t===ge||t===Qt)return e[t];const n=e[ge][t];if(t!=="value"&&(hs(n)||Array.isArray(n))){if(n!==((i=e[t])==null?void 0:i[ge])){const s=[...e[Qt],t];e[t]=new Proxy({[ge]:n,[Qt]:s},Ei)}return e[t]}return n},set(e,t,n,i){if(!le.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof a&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const s=e[ge][t];if(!(typeof s=="number"&&isNaN(s)||s instanceof a&&(isNaN(s.sign)||isNaN(s.layer)||isNaN(s.mag))))throw Ii.autosave=!1,le.hasNaN=!0,le.NaNPath=[...e[Qt],t],le.NaNReceiver=i,console.error("Attempted to set NaN value",[...e[Qt],t],e[ge]),"Attempted to set NaN value. See above for details"}return e[ge][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[ge])},has(e,t){return Reflect.has(e[ge],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[ge],t)}};var E=window.player=new Proxy({[ge]:Ii,[Qt]:["player"]},Ei);const pe=gi();let zt=null,nn=null;function kn(){const e=Date.now();let t=(e-E.time)/1e3;E.time=e;const n=t;if(le.lastTenTicks.push(n),le.lastTenTicks.length>10&&(le.lastTenTicks=le.lastTenTicks.slice(1)),!((nn==null?void 0:nn.value)&&!E.keepGoing)&&!le.hasNaN&&(t=Math.max(t,0),E.devSpeed!==0)){if(E.offlineTime!=null){if(a.gt(E.offlineTime,ee.offlineLimit*3600)&&(E.offlineTime=ee.offlineLimit*3600),a.gt(E.offlineTime,0)&&E.devSpeed!==0){const i=Math.max(E.offlineTime/10,t);E.offlineTime=E.offlineTime-i,t+=i}else E.devSpeed===0&&(E.offlineTime+=t);(!E.offlineProd||a.lt(E.offlineTime,0))&&(E.offlineTime=null)}t=Math.min(t,ee.maxTickLength),E.devSpeed!=null&&(t*=E.devSpeed),Number.isFinite(t)||(t=1e308),!a.eq(t,0)&&(E.timePlayed+=t,Number.isFinite(E.timePlayed)||(E.timePlayed=1e308),pe.emit("update",t,n),ue.unthrottled?(requestAnimationFrame(kn),zt!=null&&(clearInterval(zt),zt=null)):zt==null&&(zt=setInterval(kn,50)))}}async function ya(){nn=(await _n(()=>Promise.resolve().then(function(){return Xi}),void 0)).hasWon,lt(nn,e=>{e&&pe.emit("gameWon")}),ue.unthrottled?requestAnimationFrame(kn):zt=setInterval(kn,50)}document.fonts.onloadingdone=()=>pe.emit("fontsLoaded");var ba=Object.freeze(Object.defineProperty({__proto__:null,globalBus:pe,startGameLoop:ya},Symbol.toStringTag,{value:"Module"}));function Bi(e={}){return Object.assign({id:`${ee.id}-0`,name:"Default Save",tabs:ee.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ee.id,modVersion:ee.versionNumber,layers:{}},e)}function it(e){const t=It.compressToUTF16(Ai(e!=null?e:E[ge]));return localStorage.setItem((e!=null?e:E[ge]).id,t),t}async function _a(){ka();try{let e=localStorage.getItem(ue.active);if(e==null){await qt(jt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=It.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ee.id){await qt(jt());return}t.id=ue.active,await qt(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await qt(jt())}}function jt(){const e=yn(),t=Bi({id:e});return it(t),ue.saves.push(e),t}function yn(){let e,t=0;do e=`${ee.id}-${t++}`;while(localStorage.getItem(e));return e}async function qt(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:i}=await _n(()=>Promise.resolve().then(function(){return Qa}),void 0),{fixOldSave:s,getInitialLayers:l}=await _n(()=>Promise.resolve().then(function(){return Xi}),void 0);for(const r in t){const c=t[r];c&&n(c)}l(e).forEach(r=>i(r,e)),e=Bi(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,ee.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ee.versionNumber&&s(e.modVersion,e),Object.assign(E,e),ue.active=E.id,pe.emit("onLoad")}setInterval(()=>{E.autosave&&it()},1e3);window.onbeforeunload=()=>{E.autosave&&it()};window.save=it;const wa=window.hardReset=async()=>{await qt(jt())},ln=cn({active:"",saves:[],showTPS:!0,theme:Un.Nordic,unthrottled:!1});lt(ln,e=>{const t=It.compressToUTF16(JSON.stringify(e));localStorage.setItem(ee.id,t)},{deep:!0});var ue=window.settings=ln;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Un.Nordic};pe.emit("loadSettings",e),Object.assign(ln,e),wa()};function ka(){try{let e=localStorage.getItem(ee.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=It.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(ln,t)}pe.emit("loadSettings",ln)}catch{}}const xi=cn([]);function Ca(e){xi.push(e)}const Pi=cn([]);function Na(e){Pi.push(e)}const Sa=cn([]),Ma={class:"table"},Kt=L({__name:"Column",setup(e){const t=S(()=>dn[ue.theme].mergeAdjacent);return(n,i)=>(y(),M("div",Ma,[f("div",{class:we(["col",{mergeAdjacent:o(t)}])},[ft(n.$slots,"default")],2)]))}}),Ia={class:"table"},Fi=L({__name:"Row",setup(e){const t=S(()=>dn[ue.theme].mergeAdjacent);return(n,i)=>(y(),M("div",Ia,[f("div",{class:we(["row",{mergeAdjacent:o(t)}])},[ft(n.$slots,"default")],2)]))}});function Vn(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!rs(e)}function Z(e,t="span"){return typeof e=="function"?L({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),L({template:e})):L({render:()=>({})}):e}function me(e){if(_t(e))return typeof e=="function"?e():Z(e);const t=e[xt];return u(t,e[Pt](),null)}function De(...e){let t;return u(Fi,null,Vn(t=e.map(me))?t:{default:()=>[t]})}function Ti(...e){let t;return u(Kt,null,Vn(t=e.map(me))?t:{default:()=>[t]})}function at(e){if(_t(e))return typeof e=="function"?e():typeof e=="string"?u(F,null,[e]):u(e,null,null);const t=e[xt];return u(t,e[Pt](),null)}function Aa(...e){let t;return u(Kt,null,Vn(t=e.map(at))?t:{default:()=>[t]})}function _t(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[an]===!0}function Ri(e,t,n){const i=q(null),s=q(void 0);function l(m){i.value||(i.value=setInterval(c,250)),s.value=m,n&&(n.value=!0)}function r(){i.value&&(clearInterval(i.value),i.value=null),n&&(n.value=!1)}function c(){t&&t.value?t.value():e&&e.value&&e.value(s.value)}return fi(r),{start:l,stop:r,handleHolding:c}}function Ea(e,t){const n=S(()=>e.filter(i=>o(i.visibility)===Ie.Visible&&t(i)));return{firstFeature:S(()=>n.value[0]),collapsedContent:R(()=>Ti(...n.value.slice(1))),hasCollapsedContent:S(()=>n.value.length>1)}}function Cn(e,t="div"){const n=tt();return Je(()=>{n.value=Z(Ae(e),t)}),n}function Bt(e,t="div"){const n=tt(null);return Je(()=>{const i=Ae(e);n.value=i==null?null:Z(i,t)}),n}function Ba(e){return S(()=>Ae(e))}function Ae(e){return o(o(e))}function D(...e){return e.includes(Object)||e.push(Object),e}const ve=L({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(y(),M("div",{style:Me({width:e.width,height:e.height})},null,4))}});var ne=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n};const xa=L({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var g;const n=q({}),i=new ResizeObserver(c),s=q(null);Mn(()=>{const _=s.value;_!=null&&i.observe(_)});let l=!0,r=q((g=s.value)==null?void 0:g.getBoundingClientRect());function c(){l&&(l=!1,Lt(()=>{var _;r.value=(_=s.value)==null?void 0:_.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),l=!0}))}pe.on("fontsLoaded",c);const m={attributes:!1,childList:!0,subtree:!1};gn(Ln,(_,b)=>{const v=new MutationObserver(()=>d(_));v.observe(b,m),n.value[_]={element:b,observer:v,rect:b.getBoundingClientRect()},c()}),gn(Gn,_=>{var b;(b=n.value[_])==null||b.observer.disconnect(),n.value[_]=void 0,c()}),gn(Hn,n),gn(Qn,r);function d(_){const b=n.value[_];b!=null&&(b.rect=b.element.getBoundingClientRect(),t("updateNodes",n.value))}return(_,b)=>(y(),M(F,null,[ft(_.$slots,"default",{},void 0,!0),f("div",{ref_key:"resizeListener",ref:s,class:"resize-listener"},null,512)],64))}});var $i=ne(xa,[["__scopeId","data-v-2b1dc1bc"]]);const Pa=["onPointerdown"],Fa={class:"modal-wrapper"},Ta={class:"modal-container"},Ra={class:"modal-header"},$a=h(" default header "),Da={class:"modal-body"},Oa=h(" default body "),qa={class:"modal-footer"},Ua=f("div",{class:"modal-default-flex-grow"},null,-1),rt=L({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=Re(e),l=S(()=>s.modelValue||c.value);function r(){n("update:modelValue",!1)}const c=q(!1),m=q(null),d=S(()=>{var g,_;return(_=(g=m.value)==null?void 0:g.nodes)!=null?_:null});return t({isOpen:l,nodes:d}),(g,_)=>(y(),G(us,{to:"#modal-root"},[u(An,{name:"modal",onBeforeEnter:_[0]||(_[0]=b=>c.value=!0),onAfterLeave:_[1]||(_[1]=b=>c.value=!1)},{default:U(()=>[In(f("div",Gt({class:"modal-mask",onPointerdown:sn(r,["self"])},g.$attrs),[f("div",Fa,[f("div",Ta,[f("div",Ra,[ft(g.$slots,"header",{shown:o(l)},()=>[$a])]),f("div",Da,[u($i,{ref_key:"contextRef",ref:m},{default:U(()=>[ft(g.$slots,"body",{shown:o(l)},()=>[Oa])]),_:3},512)]),f("div",qa,[ft(g.$slots,"footer",{shown:o(l)},()=>[f("div",{class:"modal-default-footer"},[Ua,f("button",{class:"button modal-default-button",onClick:r}," Close ")])])])])])],16,Pa),[[pi,e.modelValue]])]),_:3})]))}}),on=Symbol("PersistentState"),rn=Symbol("DefaultValue"),Nn=Symbol("StackTrace"),Di=Symbol("Deleted");function Va(){var e;return((e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function Ee(e){const t=Fe(e)?e:q(e);return t[on]=t,t[rn]=Fe(e)?e.value:e,t[Nn]=Va(),t[Di]=!1,st.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[Nn]):Wt[st[st.length-1]].add(t),t}pe.on("addLayer",(e,t)=>{const n=[],i=(s,l=[])=>{let r=!1;return Object.keys(s).forEach(c=>{const m=s[c];if(m&&typeof m=="object")if(on in m){if(r=!0,m[Di]){console.warn("Deleted persistent ref present in returned object. Ignoring...",m,`
Created at:
`+m[Nn]);return}Wt[e.id].delete(ge in m?m[ge]:m);const d=l.reduce((_,b)=>(b in _||(_[b]={}),_[b]),t),g=d[c];d[c]=m[on],cs(d)?g!=null?d[c]=g:d[c]=m[rn]:g!=null?d[c].value=g:d[c].value=m[rn]}else!(m instanceof a)&&!Fe(m)&&!n.includes(m)&&(typeof m.type=="symbol"&&n.push(m),i(m,[...l,c])&&(ei(m)&&!ei(s)?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.",ge in s?s[ge]:s,c):r=!0))}),r};i(e),Wt[e.id].forEach(s=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,s,`
Created at:
`+s[Nn])}),Wt[e.id].clear()});const Ln=Symbol("RegisterNode"),Gn=Symbol("UnregisterNode"),Hn=Symbol("Nodes"),Qn=Symbol("Bounds"),Oe=Sn({});window.layers=Oe;const Wt={},st=[];function Ft(e,t){return Qe(()=>{const n={},i=n.emitter=gi();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=q({}),n.id=e,st.push(e),Wt[e]=new Set,n.minimized=Ee(!1),Object.assign(n,t.call(n)),st[st.length-1]==null||st[st.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${st}
Trying to pop ${n.id}`;return st.pop(),T(n,"color"),T(n,"display"),T(n,"name"),Te(n,"name",n.id),T(n,"minWidth"),Te(n,"minWidth",600),T(n,"minimizable"),Te(n,"minimizable",!0),n})}function Oi(e,t){if(console.info("Adding layer",e.id),Oe[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Oe[e.id]);return}Te(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Oe[e.id]=e,pe.emit("addLayer",e,t.layers[e.id])}function La(e){return Oe[e]}function qi(e){console.info("Removing layer",e.id),pe.emit("removeLayer",e),Oe[e.id]=void 0}function Ga(e){qi(e),Oi(e,E)}function Ha(e){const t=q(!1);return{openModal:()=>t.value=!0,modal:R(()=>u(rt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>u("h2",null,[o(e.name)]),body:o(e.display)}))}}pe.on("update",function(t){Object.values(Oe).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Oe).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Oe).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Qa=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Ln,UnregisterNodeInjectionKey:Gn,NodesInjectionKey:Hn,BoundsInjectionKey:Qn,layers:Oe,persistentRefs:Wt,addingLayers:st,createLayer:Ft,addLayer:Oi,getLayer:La,removeLayer:qi,reloadLayer:Ga,setupLayerModal:Ha},Symbol.toStringTag,{value:"Module"}));const za={},ja={class:"notif"};function Ka(e,t){return y(),M("div",ja,"!")}var li=ne(za,[["render",Ka],["__scopeId","data-v-66323fd4"]]);const Bn=e=>(wt("data-v-1a86f696"),e=e(),kt(),e),Wa={key:0,class:"day feature dontMerge opened"},Ja={class:"date"},Xa=h("Dec"),Ya=Bn(()=>f("br",null,null,-1)),Za={class:"date"},el=h("Dec"),tl=Bn(()=>f("br",null,null,-1)),nl=Bn(()=>f("div",{class:"doors"},null,-1)),il={class:"date"},sl=h("Dec"),al=Bn(()=>f("br",null,null,-1)),ll={key:0,class:"material-icons lock"},ol=L({__name:"Day",props:{day:null,symbol:null,opened:null,recentlyUpdated:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,i=S(()=>a.gte(Q.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function s(){i.value&&t("unlockLayer")}return(l,r)=>e.opened.value?(y(),M("div",Wa,[u(An,{appear:"",name:"door"},{default:U(()=>[f("div",{class:"doors",onClick:r[0]||(r[0]=c=>t("openLayer"))},[f("div",Ja,[Xa,Ya,h(W(e.day),1)]),f("div",Za,[el,tl,h(W(e.day),1)])])]),_:1}),f("div",{class:"icon",style:Me({backgroundImage:`url(${e.symbol})`})},null,4),f("div",{class:"lore",onClick:r[1]||(r[1]=c=>t("openLore"))},"?"),o(e.shouldNotify)?(y(),G(li,{key:0})):B("",!0)])):(y(),M("div",{key:1,class:we(["day feature dontMerge",{can:o(i),locked:!o(i),canOpen:o(i)}]),onClick:s},[nl,f("div",il,[sl,al,h(W(e.day),1)]),o(i)?B("",!0):(y(),M("div",ll,"lock")),o(i)?(y(),G(li,{key:1})):B("",!0)],2))}});var rl=ne(ol,[["__scopeId","data-v-1a86f696"]]);const ul=L({__name:"Collapsible",props:{collapsed:null,display:null,content:null},setup(e){const t=e,n=Cn(ot(t,"display")),i=Cn(ot(t,"content"));return(s,l)=>(y(),G(Kt,{class:"collapsible-container"},{default:U(()=>[f("button",{onClick:l[0]||(l[0]=r=>e.collapsed.value=!e.collapsed.value),class:"feature collapsible-toggle"},[(y(),G(ye(o(n))))]),e.collapsed.value?B("",!0):(y(),G(ye(o(i)),{key:0}))]),_:1}))}});var cl=ne(ul,[["__scopeId","data-v-a72c16aa"]]);const dl={key:0},ml={key:0,class:"mark star"},fl=["src"],pl=L({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(y(),M("div",dl,[e.mark===!0?(y(),M("div",ml)):(y(),M("img",{key:1,class:"mark",src:e.mark},null,8,fl))])):B("",!0)}});var xn=ne(pl,[["__scopeId","data-v-2207999f"]]);const hl=L({__name:"Node",props:{id:null},setup(e){const n=Re(e),i=bn(Ln,()=>{}),s=bn(Gn,()=>{}),l=tt(null),r=S(()=>l.value&&l.value.parentElement);return lt([r,n.id],([c,m],[d,g])=>{d&&s(o(g)),c&&i(m,c)}),fi(()=>s(o(n.id))),(c,m)=>(y(),M("div",{class:"node",ref_key:"node",ref:l},null,512))}});var mn=ne(hl,[["__scopeId","data-v-a48cb382"]]);const gl=L({props:{progress:{type:D(String,Object,Number),required:!0},width:{type:D(Number),required:!0},height:{type:D(Number),required:!0},direction:{type:D(String),required:!0},display:D(Object,String,Function),visibility:{type:D(Number),required:!0},style:D(Object,String,Array),classes:D(Object),borderStyle:D(Object,String,Array),textStyle:D(Object,String,Array),baseStyle:D(Object,String,Array),fillStyle:D(Object,String,Array),mark:D(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:xn,Node:mn},setup(e){const{progress:t,width:n,height:i,direction:s,display:l}=Re(e),r=S(()=>{let d=t.value instanceof a?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),c=S(()=>{const d={width:Ae(n)+.5+"px",height:Ae(i)+.5+"px"};switch(o(s)){case se.Up:d.clipPath=`inset(${r.value}% 0% 0% 0%)`,d.width=Ae(n)+1+"px";break;case se.Down:d.clipPath=`inset(0% 0% ${r.value}% 0%)`,d.width=Ae(n)+1+"px";break;case se.Right:d.clipPath=`inset(0% ${r.value}% 0% 0%)`;break;case se.Left:d.clipPath=`inset(0% 0% 0% ${r.value} + '%)`;break;case se.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),m=Bt(l);return{normalizedProgress:r,barStyle:c,component:m,unref:o,Visibility:Ie}}});function vl(e,t,n,i,s,l){var m,d,g,_,b,v,w;const r=Et("MarkNode"),c=Et("Node");return e.unref(e.visibility)!==e.Visibility.None?(y(),M("div",{key:0,style:Me([{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:we({bar:!0,...e.unref(e.classes)})},[f("div",{class:"overlayTextContainer border",style:Me([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(y(),M("span",{key:0,class:"overlayText",style:Me(e.unref(e.textStyle))},[(y(),G(ye(e.component)))],4)):B("",!0)],4),f("div",{class:"border",style:Me([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(g=e.unref(e.style))!=null?g:{},(_=e.unref(e.baseStyle))!=null?_:{},(b=e.unref(e.borderStyle))!=null?b:{}])},[f("div",{class:"fill",style:Me([e.barStyle,(v=e.unref(e.style))!=null?v:{},(w=e.unref(e.fillStyle))!=null?w:{}])},null,4)],4),u(r,{mark:e.unref(e.mark)},null,8,["mark"]),u(c,{id:e.id},null,8,["id"])],6)):B("",!0)}var yl=ne(gl,[["render",vl],["__scopeId","data-v-02d0d7b2"]]);const bl=Symbol("Bar");function un(e){return Qe(()=>{const t=e();return t.id=Jt("bar-"),t.type=bl,t[xt]=yl,T(t,"visibility"),Te(t,"visibility",Ie.Visible),T(t,"width"),T(t,"height"),T(t,"direction"),T(t,"style"),T(t,"classes"),T(t,"borderStyle"),T(t,"baseStyle"),T(t,"textStyle"),T(t,"fillStyle"),T(t,"progress"),T(t,"display"),T(t,"mark"),t[Pt]=function(){const{progress:n,width:i,height:s,direction:l,display:r,visibility:c,style:m,classes:d,borderStyle:g,textStyle:_,baseStyle:b,fillStyle:v,mark:w,id:C}=this;return{progress:n,width:i,height:s,direction:l,display:r,visibility:c,style:o(m),classes:d,borderStyle:g,textStyle:_,baseStyle:b,fillStyle:v,mark:w,id:C}},t})}var _l=L({props:{display:{type:D(Object,String,Function),required:!0},visibility:{type:D(Number),required:!0},style:D(Object,String,Array),classes:D(Object),onClick:Function,onHold:Function,canClick:{type:D(Boolean),required:!0},small:Boolean,mark:D(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:mn,MarkNode:xn},setup(e){const{display:t,onClick:n,onHold:i}=Re(e),s=tt("");Je(()=>{const c=Ae(t);if(c==null){s.value="";return}if(_t(c)){s.value=Z(c);return}const m=Z(c.title||"","h3"),d=Z(c.description,"div");s.value=Z(R(()=>u("span",null,[c.title?u("div",null,[u(m,null,null)]):null,u(d,null,null)])))});const{start:l,stop:r}=Ri(n,i,e.isHolding);return{start:l,stop:r,comp:s,Visibility:Ie,unref:o}}});function wl(e,t,n,i,s,l){var m;const r=Et("MarkNode"),c=Et("Node");return e.unref(e.visibility)!==e.Visibility.None?(y(),M("button",{key:0,style:Me([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:we({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)?(y(),G(ye(e.unref(e.comp)),{key:0})):B("",!0),u(r,{mark:e.unref(e.mark)},null,8,["mark"]),u(c,{id:e.id},null,8,["id"])],38)):B("",!0)}var Ui=ne(_l,[["render",wl],["__scopeId","data-v-8cedd7da"]]);const kl=Symbol("Clickable");function xe(e){return Qe(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=Jt("clickable-"),t.type=kl,t[xt]=Ui,t.isHolding=q(!1),T(t,"visibility"),Te(t,"visibility",Ie.Visible),T(t,"canClick"),Te(t,"canClick",!0),T(t,"classes"),T(t,"style"),T(t,"mark"),T(t,"display"),t.onClick){const i=t.onClick.bind(t);t.onClick=function(s){o(t.canClick)&&i(s)}}if(t.onHold){const i=t.onHold.bind(t);t.onHold=function(){o(t.canClick)&&i()}}return t[Pt]=function(){const{display:i,visibility:s,style:l,classes:r,onClick:c,onHold:m,isHolding:d,canClick:g,small:_,mark:b,id:v}=this;return{display:i,visibility:s,style:o(l),classes:r,onClick:c,onHold:m,isHolding:d,canClick:g,small:_,mark:b,id:v}},t})}function pt(e,t="points",n=0,i=void 0){const s=Fe(e)?e:Ee(e);return s.displayName=t,s.precision=n,s.small=i,s}function Cl(e){const t=Ee(e.value);return lt(e,(n,i)=>{a.gt(n,i)&&(t.value=a.add(t.value,a.sub(n,i)))}),t}new a("10^^8");new a("1e100");function fn(e,t){const n=t!=null?t:e.value;return a.eq(e.precision,0)?K(e.small?n:a.floor(n)):te(n,e.precision,e.small)}const Nl=["x1","y1","x2","y2"],Sl=L({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Re(e),i=S(()=>{const l=n.startNode.value.rect,r=n.boundingRect.value,c=r?{x:l.x+l.width/2-r.x,y:l.y+l.height/2-r.y}:{x:0,y:0};return n.link.value.offsetStart&&(c.x+=n.link.value.offsetStart.x,c.y+=n.link.value.offsetStart.y),c}),s=S(()=>{const l=n.endNode.value.rect,r=n.boundingRect.value,c=r?{x:l.x+l.width/2-r.x,y:l.y+l.height/2-r.y}:{x:0,y:0};return n.link.value.offsetEnd&&(c.x+=n.link.value.offsetEnd.x,c.y+=n.link.value.offsetEnd.y),c});return(l,r)=>(y(),M("line",Gt({"stroke-width":"15px",stroke:"white"},e.link,{x1:o(i).x,y1:o(i).y,x2:o(s).x,y2:o(s).y}),null,16,Nl))}});const Ml=L({__name:"Links",props:{links:null},setup(e){var m;const n=ot(e,"links"),i=q(null),s=bn(Hn,q({})),l=bn(Qn,q(void 0)),r=q((m=i.value)==null?void 0:m.getBoundingClientRect());lt(l,()=>{var d;return r.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),Mn(()=>{var d;return r.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const c=S(()=>{var g,_;const d=s.value;return(_=(g=n.value)==null?void 0:g.filter(b=>{var v,w;return((v=d[b.startNode.id])==null?void 0:v.rect)&&((w=d[b.startNode.id])==null?void 0:w.rect)}))!=null?_:[]});return(d,g)=>(y(),M(F,null,[o(c)?(y(),M("svg",ds(Gt({key:0},d.$attrs)),[(y(!0),M(F,null,hi(o(c),(_,b)=>(y(),G(Sl,{key:b,link:_,boundingRect:r.value,startNode:o(s)[_.startNode.id],endNode:o(s)[_.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),f("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Il=ne(Ml,[["__scopeId","data-v-063f6d6b"]]);L({props:{nodes:{type:D(Array),required:!0},leftSideNodes:D(Array),rightSideNodes:D(Array),branches:D(Array)},components:{Links:Il},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Re(e),s=tt();Je(()=>{const c=Ae(t);s.value=Z(R(()=>u(F,null,[c.map(m=>u("span",{class:"row tree-row",style:"margin: 50px auto;"},[m.map(at)]))])))});const l=tt();Je(()=>{const c=Ae(n);l.value=c?Z(R(()=>u("span",{class:"left-side-nodes small"},[c.map(at)]))):""});const r=tt();return Je(()=>{const c=Ae(i);r.value=c?Z(R(()=>u("span",{class:"side-nodes small"},[c.map(at)]))):""}),{unref:o,nodesComp:s,leftNodesComp:l,rightNodesComp:r}}});L({props:{display:D(Object,String,Function),visibility:{type:D(Number),required:!0},style:D(String,Object,Array),classes:D(Object),onClick:Function,onHold:Function,color:D(String),glowColor:D(String),canClick:{type:D(Boolean),required:!0},mark:D(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:xn,Node:mn},setup(e){const{onClick:t,onHold:n,display:i}=Re(e),s=Bt(i),{start:l,stop:r}=Ri(t,n);return{start:l,stop:r,comp:s,unref:o,Visibility:Ie,isCoercableComponent:_t}}});function zn(e){const t=[],n={};let i=!1;function s(){return i||(t.push(...e()),n.base=t.map(c=>qe(c.base)),n.baseText=t.map(c=>qe(c.baseText)),n.visible=t.map(c=>qe(c.visible)),i=!0),t}const l=Ee({});return[R(()=>{const c=s();let m=!0;const d=c.map((g,_)=>{var C,P,ae;if(o(n.visible[_])===!1)return null;const b=u("h3",{onClick:()=>l.value[_]=!l.value[_],style:"cursor: pointer"},[u("span",{class:"modifier-toggle"+(o(l.value[_])?" collapsed":"")},[h("\u25BC")]),g.title,g.subtitle?u("span",{class:"subtitle"},[h(" ("),g.subtitle,h(")")]):null]),v=o(l.value[_])?null:u(F,null,[u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[te((C=o(n.base[_]))!=null?C:1),g.unit]),u("span",{class:"modifier-description"},[at((P=o(n.baseText[_]))!=null?P:"Base")])]),at(o(g.modifier.description))]),w=!m;return m=!1,u(F,null,[w?u("br",null,null):null,u("div",null,[b,u("br",null,null),v,u("hr",null,null),h("Total: "),te(g.modifier.apply((ae=o(n.base[_]))!=null?ae:1)),g.unit])])});return u(F,null,[d])}),l]}function Vi(e){const t=Object.values(e).reverse(),n=Ee(!0),i=S(()=>t.filter(m=>m.earned.value===!1)),{firstFeature:s,collapsedContent:l,hasCollapsedContent:r}=Ea(t,m=>m.earned.value),c=R(()=>{const m=[...i.value];return s.value&&m.push(s.value),Aa(...m,R(()=>In(u(cl,{collapsed:n,content:l,display:n.value?"Show other completed milestones":"Hide other completed milestones"},null),[[pi,o(r)]])))});return{collapseMilestones:n,display:c}}function Pn(e){const t=Cl(e.resource),n=un(()=>({direction:se.Right,width:600,height:25,fillStyle:{backgroundColor:e.color},textStyle:e.textColor?{color:e.textColor}:void 0,progress:()=>Q.day.value===e.day?a.div(a.add(t.value,1).log10(),a.log10(e.goal)):1,display:R(()=>Q.day.value===e.day?u(F,null,[Le(t.value),h("/"),Le(e.goal)]):"")})),i=R(()=>u(F,null,[u("div",null,[Q.day.value===e.day?u(F,null,[h("Reach "),Le(e.goal),h(" total "),e.resource.displayName,h(" to complete the day")]):u(F,null,[e.name,h(" Complete!")]),e.modal?u(F,null,[h(" - "),u("button",{class:"button",style:"display: inline-block;",onClick:()=>e.modal.show.value=!0},[h("Check Modifiers")])]):void 0]),me(n),e.modal?me(e.modal.display):void 0]));return Je(()=>{Q.day.value===e.day&&a.gte(t.value,e.goal)&&Q.completeDay()}),{total:t,trackerDisplay:i}}const Al=Symbol("Buyable");function Ke(e){const t=Ee(0);return Qe(()=>{var l,r,c;const n=e();if(n.canPurchase==null&&(n.resource==null||n.cost==null))throw console.warn("Cannot create buyable without a canPurchase property or a resource and cost property",n),"Cannot create buyable without a canPurchase property or a resource and cost property";n.id=Jt("buyable-"),n.type=Al,n[xt]=Ui,n.amount=t,n.amount[rn]=(l=n.initialValue)!=null?l:0,n.canAfford=S(()=>{const m=n,d=o(m.cost);return m.resource!=null&&d!=null&&a.gte(m.resource.value,d)}),n.canPurchase==null&&(n.canPurchase=S(()=>o(n.visibility)===Ie.Visible&&o(n.canAfford)&&a.lt(n.amount.value,o(n.purchaseLimit)))),n.maxed=S(()=>a.gte(n.amount.value,o(n.purchaseLimit))),T(n,"classes");const i=n.classes;n.classes=S(()=>{const m=o(i)||{};return n.maxed.value&&(m.bought=!0),m}),T(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(c=(r=n.onClick)!=null?r:n.purchase)!=null?c:function(){var g;const m=n;if(!o(m.canPurchase))return;const d=o(m.cost);m.cost!=null&&m.resource!=null&&(m.resource.value=a.sub(m.resource.value,d),m.amount.value=a.add(m.amount.value,1)),(g=m.onPurchase)==null||g.call(m,d)},T(n,"display");const s=n.display;return n.display=R(()=>{const m=o(s);if(_t(m)){const d=Z(m);return u(d,null,null)}if(m!=null&&n.cost!=null&&n.resource!=null){const d=n,g=Z(m.title||"","h3"),_=Z(m.description||""),b=Z(m.effectDisplay||"");return u("span",null,[m.title?u("div",null,[u(g,null,null)]):null,m.description?u(_,null,null):null,m.showAmount===!1?null:u("div",null,[u("br",null,null),o(d.purchaseLimit)===a.dInf?u(F,null,[h("Amount: "),K(d.amount.value)]):u(F,null,[h("Amount: "),K(d.amount.value),h(" /")," ",K(o(d.purchaseLimit))])]),m.effectDisplay?u("div",null,[u("br",null,null),h("Currently: "),u(b,null,null)]):null,d.cost&&!d.maxed.value?u("div",null,[h("Cost: "),te(o(d.cost)||0)," ",n.resource.displayName]):null])}return""}),T(n,"visibility"),Te(n,"visibility",Ie.Visible),T(n,"cost"),T(n,"resource"),T(n,"purchaseLimit"),Te(n,"purchaseLimit",a.dInf),T(n,"style"),T(n,"mark"),T(n,"small"),n[Pt]=function(){const{display:m,visibility:d,style:g,classes:_,onClick:b,canClick:v,small:w,mark:C,id:P}=this;return{display:m,visibility:d,style:o(g),classes:_,onClick:b,canClick:v,small:w,mark:C,id:P}},n})}const Fn=Sn({}),jn=Symbol("Hotkey");function qn(e){return Qe(()=>{const t=e();return t.type=jn,T(t,"enabled"),Te(t,"enabled",!0),T(t,"description"),t})}pe.on("addLayer",e=>{Mi(e,jn).forEach(t=>{Fn[t.key]=t})});pe.on("removeLayer",e=>{Mi(e,jn).forEach(t=>{Fn[t.key]=void 0})});document.onkeydown=function(e){var i;if(((i=e.target)==null?void 0:i.tagName)==="INPUT"||Jn.value&&!E.keepGoing)return;let t=e.key;e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=Fn[t];n&&o(n.enabled)&&(e.preventDefault(),n.onPress())};Na(R(()=>{const e=Object.values(Fn).filter(t=>o(t==null?void 0:t.enabled));return e.length===0?"":u("div",null,[u("br",null,null),u("h4",null,[h("Hotkeys")]),e.map(t=>u("div",null,[t==null?void 0:t.key,h(": "),t==null?void 0:t.description]))])}));const El=L({__name:"Sticky",setup(e){const t=q("0"),n=new ResizeObserver(s),i=tt(null);function s(){let l=i.value;if(l==null)return;let r=0;for(;l.previousSibling;){const c=l.previousSibling;c.dataset&&"vSticky"in c.dataset&&(r+=c.offsetHeight),l=c}t.value=r+"px"}return Lt(s),document.fonts.ready.then(s),Mn(()=>{var r;const l=(r=i.value)==null?void 0:r.parentElement;l&&n.observe(l)}),(l,r)=>(y(),M("div",{class:"sticky",style:Me({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[ft(l.$slots,"default",{},void 0,!0)],4))}});var Bl=ne(El,[["__scopeId","data-v-cccac690"]]);const xl=L({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=S(()=>fn(t.resource));return(i,s)=>(y(),M("h2",{style:Me({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},W(o(n)),5))}});const Pl={class:"main-display"},Fl={key:0},Tl={key:1},Rl=h(", "),$l={key:2},Dl=f("br",null,null,-1),Ut=L({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null,productionDisplay:null},setup(e){const n=Re(e),i=q(null),s=Bt(n.effectDisplay),l=Bt(n.productionDisplay),r=S(()=>a.lt(n.resource.value,"1e1000"));return(c,m)=>(y(),G(Bl,null,{default:U(()=>{var d,g,_,b;return[f("div",{class:we(["main-display-container",(d=e.classes)!=null?d:{}]),style:Me([{height:`${((_=(g=i.value)==null?void 0:g.$el.clientHeight)!=null?_:0)+50}px`},(b=e.style)!=null?b:{}])},[f("div",Pl,[o(r)?(y(),M("span",Fl,"You have ")):B("",!0),u(xl,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),h(" "+W(e.resource.displayName),1),o(s)?(y(),M("span",Tl,[Rl,(y(),G(ye(o(s)),{ref_key:"effectRef",ref:i},null,512))])):B("",!0),o(l)?(y(),M("span",$l,[Dl,(y(),G(ye(o(l)),{ref_key:"effectRef",ref:i},null,512))])):B("",!0)])],6)]}),_:1}))}});var Ol=L({props:{display:{type:D(String,Object,Function),required:!0},visibility:{type:D(Number),required:!0},style:D(String,Object,Array),classes:D(Object),resource:Object,cost:D(String,Object,Number),canPurchase:{type:D(Boolean),required:!0},bought:{type:D(Boolean),required:!0},mark:D(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:mn,MarkNode:xn},setup(e){const{display:t,cost:n}=Re(e),i=tt("");return Je(()=>{const s=Ae(t);if(s==null){i.value="";return}if(_t(s)){i.value=Z(s);return}const l=Ae(n),r=Z(s.title||"","h3"),c=Z(s.description,"div"),m=Z(s.effectDisplay||"");i.value=Z(R(()=>{var d;return u("span",null,[s.title?u("div",null,[u(r,null,null)]):null,u(c,null,null),s.effectDisplay?u("div",null,[h("Currently: "),u(m,null,null)]):null,e.resource!=null&&s.showCost!==!1?u(F,null,[u("br",null,null),h("Cost: "),e.resource&&fn(e.resource,l)," ",(d=e.resource)==null?void 0:d.displayName]):null])}))}),{component:i,unref:o,Visibility:Ie}}});const ql=["disabled"];function Ul(e,t,n,i,s,l){var m;const r=Et("MarkNode"),c=Et("Node");return e.unref(e.visibility)!==e.Visibility.None?(y(),M("button",{key:0,style:Me([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(m=e.unref(e.style))!=null?m:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:we({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)?(y(),G(ye(e.unref(e.component)),{key:0})):B("",!0),u(r,{mark:e.unref(e.mark)},null,8,["mark"]),u(c,{id:e.id},null,8,["id"])],14,ql)):B("",!0)}var Vl=ne(Ol,[["render",Ul],["__scopeId","data-v-7f411ac8"]]);const Ll=Symbol("Upgrade");function de(e){const t=Ee(!1);return Qe(()=>{const n=e();return n.id=Jt("upgrade-"),n.type=Ll,n[xt]=Vl,n.canAfford==null&&(n.resource==null||n.cost==null)&&console.warn("Error: can't create upgrade without a canAfford property or a resource and cost property",n),n.bought=t,n.canAfford==null?n.canAfford=S(()=>{const i=n;return i.resource!=null&&i.cost!=null&&a.gte(i.resource.value,o(i.cost))}):T(n,"canAfford"),n.canPurchase=S(()=>o(n.visibility)===Ie.Visible&&o(n.canAfford)&&!o(n.bought)),n.purchase=function(){var s;const i=n;!o(i.canPurchase)||(i.resource!=null&&i.cost!=null&&(i.resource.value=a.sub(i.resource.value,o(i.cost))),t.value=!0,(s=i.onPurchase)==null||s.call(i))},T(n,"visibility"),Te(n,"visibility",Ie.Visible),T(n,"classes"),T(n,"style"),T(n,"display"),T(n,"mark"),T(n,"cost"),T(n,"resource"),n[Pt]=function(){const{display:i,visibility:s,style:l,classes:r,resource:c,cost:m,canPurchase:d,bought:g,mark:_,id:b,purchase:v}=this;return{display:i,visibility:s,style:o(l),classes:r,resource:c,cost:m,canPurchase:d,bought:g,mark:_,id:b,purchase:v}},n})}function oe(e){return Qe(()=>{const{addend:t,description:n,enabled:i}=e(),s=qe(t),l=qe(n),r=i==null?void 0:qe(i);return{apply:c=>a.add(c,o(s)),revert:c=>a.sub(c,o(s)),enabled:r,description:n==null?void 0:R(()=>u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[a.gte(o(s),0)?"+":"",te(o(s))]),o(l)?u("span",{class:"modifier-description"},[at(o(l))]):null]))}})}function O(e){return Qe(()=>{const{multiplier:t,description:n,enabled:i}=e(),s=qe(t),l=qe(n),r=i==null?void 0:qe(i);return{apply:c=>a.times(c,o(s)),revert:c=>a.div(c,o(s)),enabled:r,description:n==null?void 0:R(()=>u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[h("x"),te(o(s))]),o(l)?u("span",{class:"modifier-description"},[at(o(l))]):null]))}})}function Li(e){return Qe(()=>{const{exponent:t,description:n,enabled:i,supportLowNumbers:s}=e(),l=qe(t),r=qe(n),c=i==null?void 0:qe(i);return{apply:m=>{let d=m;return s&&(d=a.add(d,1)),d=a.pow(d,o(l)),s&&(d=a.sub(d,1)),d},revert:m=>{let d=m;return s&&(d=a.add(d,1)),d=a.root(d,o(l)),s&&(d=a.sub(d,1)),d},enabled:c,description:n==null?void 0:R(()=>u("div",{class:"modifier-container"},[u("span",{class:"modifier-amount"},[h("^"),te(o(l))]),o(r)?u("span",{class:"modifier-description"},[at(o(r)),s?" (+1 effective)":null]):null]))}})}function re(e){return Qe(()=>{const t=e();return{apply:n=>t.filter(i=>o(i.enabled)!==!1).reduce((i,s)=>s.apply(i),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(i=>o(i.enabled)!==!1).reduceRight((i,s)=>s.revert(i),n):void 0,enabled:S(()=>t.filter(n=>o(n.enabled)!==!1).length>0),description:R(()=>u(F,null,[t.filter(n=>o(n.enabled)!==!1).map(n=>o(n.description)).filter(n=>n).map(at)]))}})}function Gi(e){return Qe(()=>{const t=e();return t.currentGain==null&&(t.currentGain=S(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=a.floor(n).max(0),o(t.buyMax)||(n=n.min(1)),n})),t.actualGain==null&&(t.actualGain=t.currentGain),t.currentAt==null&&(t.currentAt=S(()=>{let n=t.scaling.currentAt(t);return t.roundUpCost&&(n=a.ceil(n)),n})),t.nextAt==null&&(t.nextAt=S(()=>{let n=t.scaling.nextAt(t);return t.roundUpCost&&(n=a.ceil(n)),n})),t.convert==null&&(t.convert=function(){var s;const n=o(t.currentGain),i=o(t.currentAt);t.gainResource.value=a.add(t.gainResource.value,n),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t.spend==null&&(t.spend=function(){t.baseResource.value=0}),T(t,"currentGain"),T(t,"actualGain"),T(t,"currentAt"),T(t,"nextAt"),T(t,"buyMax"),Te(t,"buyMax",!0),T(t,"roundUpCost"),Te(t,"roundUpCost",!0),t})}function Kn(e,t){const n=qe(e),i=qe(t);return{currentGain(s){let l=o(s.baseResource.value);if(s.costModifier&&(l=s.costModifier.apply(l)),a.lt(l,o(n)))return 0;const r=a.div(l,o(n)).pow(o(i));return r.isNan()?new a(0):r},currentAt(s){let l=o(s.currentGain);return s.gainModifier&&(l=s.gainModifier.revert(l)),l=a.max(0,l).root(o(i)).times(o(n)),s.costModifier&&(l=s.costModifier.revert(l)),l},nextAt(s){let l=a.add(o(s.currentGain),1).floor();return s.gainModifier&&(l=s.gainModifier.revert(l)),l=a.max(0,l).root(o(i)).times(o(n)).max(o(n)),s.costModifier&&(l=s.costModifier.revert(l)),l}}}function Hi(e){return Gi(e)}function Gl(e){return Gi(()=>{const t=e();return Te(t,"buyMax",!1),t.currentGain==null&&(t.currentGain=S(()=>{let n=t.gainModifier?t.gainModifier.apply(t.scaling.currentGain(t)):t.scaling.currentGain(t);return n=a.floor(n).max(t.gainResource.value),o(t.buyMax)||(n=n.min(a.add(t.gainResource.value,1))),n})),t.actualGain==null&&(t.actualGain=S(()=>{let n=a.sub(a.floor(t.scaling.currentGain(t)),t.gainResource.value).max(0);return o(t.buyMax)||(n=n.min(1)),n})),Te(t,"convert",function(){var s;const n=o(t.actualGain),i=o(t.currentAt);t.gainResource.value=t.gainModifier?t.gainModifier.apply(o(t.currentGain)):o(t.currentGain),t.spend(n,i),(s=t.onConvert)==null||s.call(t,n)}),t})}const Hl="boxes",oi=6,We=Ft(Hl,function(){const e="Boxes",t="#964B00",n=pt(0,"boxes"),i=Hi(()=>({scaling:Kn(1e10,1),baseResource:Y.logs,gainResource:n,roundUpCost:!0})),s=xe(()=>({display:R(()=>u(F,null,[u("span",{style:"font-size: large"},[h("Create "),K(i.currentGain.value),h(" "),n.displayName]),u("br",null,null),u("span",{style:"font-size: large"},[h("Cost:")," ",fn(Y.logs,a.gte(i.actualGain.value,1)?i.currentAt.value:i.nextAt.value)," ",Y.logs.displayName])])),canClick:()=>a.gte(i.actualGain.value,1),onClick(){!o(this.canClick)||i.convert()},style:"width: 600px; min-height: unset"})),l=de(()=>({display:{title:"Carry logs in boxes",description:"Double log gain and unlock a new elf for training"},onPurchase(){Q.days[3].recentlyUpdated.value=!0},resource:n,cost:100})),r=de(()=>({display:{title:"Carry ash in boxes",description:"Double ash gain and unlock a new elf for training"},onPurchase(){Q.days[3].recentlyUpdated.value=!0},resource:n,cost:1e3})),c=de(()=>({display:{title:"Carry coal in boxes",description:"Double coal gain and unlock a new elf for training"},onPurchase(){Q.days[3].recentlyUpdated.value=!0},resource:n,cost:4e3})),m={logsUpgrade:l,ashUpgrade:r,coalUpgrade:c},d=Ke(()=>({display:{title:"Carry more logs",description:"Use boxes to carry even more logs, boosting their gain",effectDisplay:R(()=>u(F,null,[te(a.div(d.amount.value,2).add(1)),h("x")]))},resource:n,cost(){return a.pow(3,d.amount.value).times(100)},visibility:()=>H(l.bought.value)})),g=Ke(()=>({display:{title:"Carry more ash",description:"Use boxes to carry even more ash, boosting its gain",effectDisplay:R(()=>u(F,null,[te(a.div(g.amount.value,2).add(1)),h("x")]))},resource:n,cost(){return a.pow(5,g.amount.value).times(1e3)},visibility:()=>H(r.bought.value)})),_=Ke(()=>({display:{title:"Carry more coal",description:"Use boxes to carry even more coal, boosting its gain",effectDisplay:R(()=>u(F,null,[te(a.div(_.amount.value,2).add(1)),h("x")]))},resource:n,cost(){return a.pow(7,_.amount.value).times(1e3)},visibility:()=>H(c.bought.value)})),b={logBoxesBuyable:d,ashBoxesBuyable:g,coalBoxesBuyable:_},{total:v,trackerDisplay:w}=Pn({resource:n,goal:5e4,name:e,day:oi,color:t});return{name:e,day:oi,color:t,boxes:n,totalBoxes:v,boxesConversion:i,upgrades:m,buyables:b,minWidth:700,display:R(()=>u(F,null,[me(w),u(ve,null,null),u(Ut,{resource:n,color:t,style:"margin-bottom: 0"},null),u(ve,null,null),me(s),u(ve,null,null),De(...Object.values(m)),De(...Object.values(b))]))}});const Ql={class:"field"},zl=L({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=S(()=>Z(o(n.title)||"<span></span>","span")),s=S({get(){return!!n.modelValue},set(l){t("update:modelValue",l)}});return(l,r)=>(y(),M("label",Ql,[In(f("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":r[0]||(r[0]=c=>Fe(s)?s.value=c:null)},null,512),[[ms,o(s)]]),(y(),G(ye(o(i))))]))}});var Vt=ne(zl,[["__scopeId","data-v-33d57459"]]);const jl={class:"field"},Kl={key:0,class:"field-title"},Wn=L({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var r;const n=e,i=Bt(ot(n,"title"),"span"),s=q((r=n.options.find(c=>c.value===n.modelValue))!=null?r:null);lt(ot(n,"modelValue"),c=>{var m;Ae(s)!==c&&(s.value=(m=n.options.find(d=>d.value===c))!=null?m:null)});function l(c){t("update:modelValue",c.value)}return(c,m)=>(y(),M("div",jl,[o(i)?(y(),M("span",Kl,[(y(),G(ye(o(i))))])):B("",!0),u(o(gs),{options:e.options,modelValue:s.value,"onUpdate:modelValue":[m[0]||(m[0]=d=>s.value=d),l],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});var Wl=L({props:{visibility:{type:D(Number),required:!0},display:{type:D(String,Object,Function),required:!0},style:D(String,Object,Array),classes:D(Object),earned:{type:D(Boolean),required:!0},id:{type:String,required:!0}},components:{Node:mn},setup(e){const{display:t}=Re(e),n=tt("");return Je(()=>{const i=Ae(t);if(i==null){n.value="";return}if(_t(i)){n.value=Z(i);return}const s=Z(i.requirement,"h3"),l=Z(i.effectDisplay||"","b"),r=Z(i.optionsDisplay||"","span");n.value=Z(R(()=>u("span",null,[u(s,null,null),i.effectDisplay?u("div",null,[u(l,null,null)]):null,i.optionsDisplay?u("div",{class:"equal-spaced"},[u(r,null,null)]):null])))}),{comp:n,unref:o,Visibility:Ie}}});function Jl(e,t,n,i,s,l){var c;const r=Et("Node");return e.unref(e.visibility)!==e.Visibility.None?(y(),M("div",{key:0,style:Me([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:we({feature:!0,milestone:!0,done:e.unref(e.earned),...e.unref(e.classes)})},[(y(),G(ye(e.unref(e.comp)))),u(r,{id:e.id},null,8,["id"])],6)):B("",!0)}var Xl=ne(Wl,[["render",Jl],["__scopeId","data-v-f4e8794e"]]);pe.on("setupVue",e=>e.use(vs));const ri=vi(),Yl=Symbol("Milestone");let At;(function(e){e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none"})(At||(At={}));function Pe(e){const t=Ee(!1);return Qe(()=>{var s;const n=(s=e==null?void 0:e())!=null?s:{};n.id=Jt("milestone-"),n.type=Yl,n[xt]=Xl,n.earned=t,n.complete=function(){var r;const l=n;if(t.value=!0,(r=l.onComplete)==null||r.call(l),l.display&&o(l.showPopups)===!0){const c=o(l.display),m=Z(_t(c)?c:c.requirement);ri(u(F,null,[u("h3",null,[h("Milestone earned!")]),u("div",null,[u(m,null,null)])]))}},T(n,"visibility"),Te(n,"visibility",Ie.Visible);const i=n.visibility;if(n.visibility=S(()=>{const l=o(n.display);switch(ue.msDisplay){default:case At.All:return o(i);case At.Configurable:return o(n.earned)&&!(l!=null&&typeof l=="object"&&"optionsDisplay"in l)?Ie.None:o(i);case At.Incomplete:return o(n.earned)?Ie.None:o(i);case At.None:return Ie.None}}),T(n,"style"),T(n,"classes"),T(n,"display"),T(n,"showPopups"),n[Pt]=function(){const{visibility:l,display:r,style:c,classes:m,earned:d,id:g}=this;return{visibility:l,display:r,style:o(c),classes:m,earned:d,id:g}},n.shouldEarn){const l=n;Je(()=>{var r,c;if(ue.active===E.id&&!l.earned.value&&o(l.visibility)===Ie.Visible&&((r=l.shouldEarn)==null?void 0:r.call(l))&&(l.earned.value=!0,(c=l.onComplete)==null||c.call(l),l.display&&o(l.showPopups)===!0)){const m=o(l.display),d=Z(_t(m)?m:m.requirement);ri(u(F,null,[u("h3",null,[h("Milestone earned!")]),u("div",null,[u(d,null,null)])]))}})}return n})}pe.on("loadSettings",e=>{Te(e,"msDisplay",At.All)});const Zl=Object.values(At).map(e=>({label:Si(e),value:e}));Ca(R(()=>u(Wn,{title:"Show Milestones",options:Zl,"onUpdate:modelValue":e=>ue.msDisplay=e,modelValue:ue.msDisplay},null)));const eo=Symbol("Reset");function to(e){return Qe(()=>{const t=e();return t.id=Jt("reset-"),t.type=eo,t.reset=function(){var i;const n=s=>{s&&typeof s=="object"&&(on in s?s[on].value=s[rn]:!(s instanceof a)&&!Fe(s)&&Object.values(s).forEach(l=>n(l)))};o(t.thingsToReset).forEach(n),pe.emit("reset",t),(i=t.onReset)==null||i.call(t)},T(t,"thingsToReset"),t})}const vn={};pe.on("removeLayer",e=>{var t;(t=vn[e.id])==null||t.call(vn),vn[e.id]=void 0});const no="paper",ui=5,ie=Ft(no,function(){const e="Paper",t="#E8DCB8",n=pt(0,"paper"),i=pt(S(()=>a.min(a.div(Y.logs.value,1e9),a.div(j.ash.value,1e6))),"pulp"),s=Hi(()=>({scaling:Kn(1,1.2),baseResource:i,gainResource:n,roundUpCost:!0,spend(N,$){Y.logs.value=a.sub(Y.logs.value,a.times($,1e9)),j.ash.value=a.sub(j.ash.value,a.times($,1e6))}})),l=xe(()=>({display:R(()=>{const N=a.gte(s.actualGain.value,1)?s.currentAt.value:s.nextAt.value;return u(F,null,[u("span",{style:"font-size: large"},[h("Create "),K(s.currentGain.value),h(" "),n.displayName]),u("br",null,null),u("span",{style:"font-size: large"},[h("Cost: "),fn(Y.logs,N),h(" "),i.displayName,h(" ("),K(a.times(N,1e9)),h(" "),Y.logs.displayName,h(";")," ",K(a.times(N,1e6)),h(" "),j.ash.displayName,h(")")])])}),canClick:()=>a.gte(s.actualGain.value,1),onClick(){!o(this.canClick)||s.convert()},style:"width: 600px; min-height: unset"}));function r(N){const $=Ke(()=>({...N,display:{title:N.name,description:`Print a copy of "${N.name}", which ${N.elfName} will use to improve their skills! Each copy printed will reduce the "${N.buyableName}" price scaling by 0.95x and make ${N.elfName} purchase +10% faster!`,effectDisplay:R(()=>u(F,null,[te(a.pow(.95,$.amount.value)),h("x price scaling,")," ",te(a.div($.amount.value,10).add(1)),h("x auto-purchase speed")])),showAmount:!1},resource:n,cost:()=>a.pow(5,$.amount.value).times(10),style:"width: 600px"}));return $}const c=r({name:"Now You're Logging!",elfName:"Holly",buyableName:"Generic Cutters"}),m=r({name:"The Man Who Planted Trees",elfName:"Ivy",buyableName:"Generic Planters"}),d=r({name:"Logjam",elfName:"Hope",buyableName:"Expand Forest"}),g=r({name:"Fahrenheit 451",elfName:"Jack",buyableName:"Heated Cutters"}),_=r({name:"Tillamook Burn Country",elfName:"Mary",buyableName:"Heated Planters"}),b=r({name:"The Garden Tree's Handbook",elfName:"Noel",buyableName:"Fertilized Soil"}),v=r({name:"Firestarter",elfName:"Joy",buyableName:"Small Fire",visibility:()=>H(_e.elves.smallFireElf.bought.value)}),w=r({name:"An Arsonist's Guide to Writer's Homes in New England",elfName:"Faith",buyableName:"Bonfire",visibility:()=>H(_e.elves.bonfireElf.bought.value)}),C=r({name:"Little Fires Everywhere",elfName:"Snowball",buyableName:"Kiln",visibility:()=>H(_e.elves.kilnElf.bought.value)}),P={cuttersBook:c,plantersBook:m,expandersBook:d,heatedCuttersBook:g,heatedPlantersBook:_,fertilizerBook:b,smallFireBook:v,bonfireBook:w,kilnBook:C},{total:ae,trackerDisplay:I}=Pn({resource:n,goal:5e3,name:e,day:ui,color:t,textColor:"var(--feature-foreground)"});return{name:e,day:ui,color:t,paper:n,totalPaper:ae,paperConversion:s,books:P,minWidth:700,display:R(()=>u(F,null,[me(I),u(ve,null,null),u(Ut,{resource:n,color:t,style:"margin-bottom: 0"},null),u(ve,null,null),me(l),u(ve,null,null),Ti(...Object.values(P))]))}}),io="workshop",Zt=2,Ve=Ft(io,function(){const e="Workshop",t="#D66B02",n="#D66B02",i=pt(0,"foundation progress"),s=Gl(()=>({scaling:Kn(250,1.5),baseResource:Y.logs,gainResource:i,roundUpCost:!0,buyMax:!1,spend($,fe){Y.logs.value=a.sub(Y.logs.value,fe)}})),l=xe(()=>({display:R(()=>u(F,null,[u("b",{style:"font-size: x-large"},[h("Build part of the foundation")]),u("br",null,null),u("br",null,null),u("span",{style:"font-size: large"},[h("Cost:")," ",fn(Y.logs,a.gte(s.actualGain.value,1)?s.currentAt.value:s.nextAt.value)," ",Y.logs.displayName])])),visibility:()=>H(a.lt(i.value,100)),canClick:()=>a.gte(s.actualGain.value,1)&&a.lt(i.value,100),onClick(){!o(this.canClick)||s.convert()},style:"width: 600px; min-height: unset"})),r=qn(()=>({key:"w",description:"Build part of the foundation.",onPress:()=>{l.canClick.value&&l.onClick()}})),c=S(()=>!_e.milestones[6].earned.value),m=Pe(()=>({display:{requirement:"1% Foundation Completed",effectDisplay:"Trees give 5% more logs for each % of foundation completed"},shouldEarn:()=>a.gte(i.value,1),showPopups:c})),d=Pe(()=>({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:()=>H(m.earned.value),showPopups:c})),g=Pe(()=>({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:()=>H(d.earned.value),showPopups:c})),_=Pe(()=>({display:{requirement:"30% Foundation Completed",effectDisplay:"All automatic tree cutting is doubled"},shouldEarn:()=>a.gte(i.value,30),visibility:()=>H(g.earned.value),showPopups:c})),b=Pe(()=>({display:{requirement:"40% Foundation Completed",effectDisplay:"All automatic tree planting is doubled"},shouldEarn:()=>a.gte(i.value,40),visibility:()=>H(_.earned.value),showPopups:c})),v=Pe(()=>({display:{requirement:"50% Foundation Completed",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(i.value,50),visibility:()=>H(b.earned.value),showPopups:c})),w=Pe(()=>({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:()=>H(v.earned.value),showPopups:c})),C=Pe(()=>({display:{requirement:"100% Foundation Completed",effectDisplay:"Log per tree is raised to the 1.2th power"},shouldEarn:()=>a.gte(i.value,100),visibility:()=>H(w.earned.value),showPopups:c})),P={logGainMilestone1:m,autoCutMilestone1:d,autoPlantMilestone1:g,autoCutMilestone2:_,autoPlantMilestone2:b,logGainMilestone2:v,morePlantsMilestone1:w,logGainMilestone3:C},{collapseMilestones:ae,display:I}=Vi(P),N=un(()=>({direction:se.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>Q.day.value===Zt?a.div(i.value,100):1,display:R(()=>Q.day.value===Zt?u(F,null,[K(i.value),h("%")]):"")}));return Je(()=>{Q.day.value===Zt&&a.gte(i.value,100)&&Q.completeDay()}),{name:e,day:Zt,color:t,foundationProgress:i,foundationConversion:s,milestones:P,collapseMilestones:ae,minWidth:700,buildFoundationHK:r,display:R(()=>u(F,null,[u("div",null,[Q.day.value===Zt?"Complete the foundation to complete the day":`${e} Complete!`]),me(N),u(ve,null,null),u("div",null,[u("span",null,[h("The foundation is ")]),u("h2",{style:`color: ${t}; text-shadow: 0 0 10px ${t}`},[K(i.value)]),h("% completed")]),a.lt(i.value,100)?u(ve,null,null):null,me(l),u(ve,null,null),I()]))}}),so="elves",en=4,_e=Ft(so,function(){const e="Elves",t="red",n="#911D21",s=un(()=>({direction:se.Right,width:600,height:25,fillStyle:`backgroundColor: ${n}`,progress:()=>Q.day.value===en?a.div(he.value,6).times(.8333333333333334).add(a.div(a.add(j.coal.value,1).log10(),a.log10(1e9)).clamp(0,1).div(6)):1,display:R(()=>Q.day.value===en?a.lt(he.value,6)?u(F,null,[K(he.value),h("/6 elves")]):u(F,null,[K(j.coal.value),h("/"),K(1e9),h(" coal")]):"")})),l=to(()=>({thingsToReset:[Y,Ve,j],onReset(){setTimeout(()=>{gt.earned.value?(Y.row1Upgrades.forEach(J=>J.bought.value=!0),Y.row2Upgrades.forEach(J=>J.bought.value=!0)):nt.earned.value&&(Y.row1Upgrades[4].bought.value=!0,Y.row2Upgrades[4].bought.value=!0),Ue.earned.value&&(Ve.foundationProgress.value=100)})}})),r=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.cuttersBook.amount.value,.1).add(1),description:"Now You're Logging!",enabled:()=>a.gt(ie.books.cuttersBook.amount.value,0)}))]),c=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.plantersBook.amount.value,.1).add(1),description:"The Man Who Planted Trees",enabled:()=>a.gt(ie.books.plantersBook.amount.value,0)}))]),m=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.expandersBook.amount.value,.1).add(1),description:"Logjam",enabled:()=>a.gt(ie.books.expandersBook.amount.value,0)}))]),d=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.heatedCuttersBook.amount.value,.1).add(1),description:"Fahrenheit 451",enabled:()=>a.gt(ie.books.heatedCuttersBook.amount.value,0)}))]),g=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.heatedPlantersBook.amount.value,.1).add(1),description:"Tillamook Burn Country",enabled:()=>a.gt(ie.books.heatedPlantersBook.amount.value,0)}))]),_=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.fertilizerBook.amount.value,.1).add(1),description:"The Garden Tree's Handbook",enabled:()=>a.gt(ie.books.fertilizerBook.amount.value,0)}))]),b=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.smallFireBook.amount.value,.1).add(1),description:"Firestarter",enabled:()=>a.gt(ie.books.smallFireBook.amount.value,0)}))]),v=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.bonfireBook.amount.value,.1).add(1),description:"An Arsonist's Guide to Writer's Homes in New England",enabled:()=>a.gt(ie.books.bonfireBook.amount.value,0)}))]),w=re(()=>[O(()=>({multiplier:2,description:"6 Elves Trained",enabled:Ne.earned})),O(()=>({multiplier:()=>a.times(ie.books.kilnBook.amount.value,.1).add(1),description:"Little Fires Everywhere",enabled:()=>a.gt(ie.books.kilnBook.amount.value,0)}))]),[C,P]=zn(()=>[{title:"Holly Auto-Buy Frequency",modifier:r,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:d,base:10,unit:"/s",visible:ke.heatedCuttersElf.bought},{title:"Mary Auto-Buy Frequency",modifier:g,base:10,unit:"/s",visible:ke.heatedPlantersElf.bought},{title:"Noel Auto-Buy Frequency",modifier:_,base:10,unit:"/s",visible:ke.fertilizerElf.bought},{title:"Joy Auto-Buy Frequency",modifier:b,base:10,unit:"/s",visible:ke.smallFireElf.bought},{title:"Faith Auto-Buy Frequency",modifier:v,base:10,unit:"/s",visible:ke.bonfireElf.bought},{title:"Snowball Auto-Buy Frequency",modifier:w,base:10,unit:"/s",visible:ke.kilnElf.bought}]),ae=q(!1),I=R(()=>u(rt,{modelValue:ae.value,"onUpdate:modelValue":J=>ae.value=J},{header:()=>u("h2",null,[e,h(" Modifiers")]),body:C}));function N(J){const vt=S(()=>a.pow(4,he.value).times(1e6)),He=Ee(0),Rt=J.hasToggle?Ee(!1):q(!0),$t=S(()=>J.cooldownModifier.apply(10));function Xt(x){var yt;if(mt.bought.value){He.value=a.add(He.value,x);const bt=a.recip($t.value);for(;a.gte(He.value,bt);)if(J.customCost==null?o(J.buyable.canPurchase):a.gte(J.buyable.resource.value,J.customCost(J.buyable.amount.value)))J.buyable.amount.value=a.add(J.buyable.amount.value,1),He.value=a.sub(He.value,bt),(yt=J.onAutoPurchase)==null||yt.call(J);else{He.value=bt;break}}}const mt=de(()=>({...J,toggle:Rt,buyProgress:He,update:Xt,resource:j.coal,cost:vt,computedAutoBuyCooldown:$t,display:()=>({title:J.name,description:R(()=>u(F,null,[J.description,mt.bought.value?null:u(F,null,[" ",h("Training this elf will require resetting all your progress from days 1-3.")]),mt.bought.value&&J.hasToggle===!0?u(F,null,[u(Vt,{title:J.toggleDesc,"onUpdate:modelValue":x=>Rt.value=x,modelValue:Rt.value},null)]):null])),showCost:!mt.bought.value}),style:"width: 190px",onPurchase(){var x;(x=J.onPurchase)==null||x.call(J),l.reset()}}));return mt}const $=N({name:"Holly",description:"Holly will automatically purchase cutters you can afford, without actually spending any logs.",buyable:Y.row1Buyables[0],cooldownModifier:r}),fe=N({name:"Ivy",description:"Ivy will automatically purchase planters you can afford, without actually spending any logs.",buyable:Y.row1Buyables[1],cooldownModifier:c}),ce=N({name:"Hope",description:"Hope will automatically purchase forest expanders you can afford, without actually spending any logs.",buyable:Y.row1Buyables[2],cooldownModifier:m}),Ze=[$,fe,ce],ut=N({name:"Jack",description:"Jack will automatically purchase heated cutters you can afford, without actually spending any coal.",buyable:j.heatedCutters,cooldownModifier:d}),X=N({name:"Mary",description:"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",buyable:j.heatedPlanters,cooldownModifier:g}),ht=N({name:"Noel",description:"Noel will automatically purchase fertilized soil you can afford, without actually spending any ash.",buyable:j.moreFertilizer,cooldownModifier:_}),Tt=[ut,X,ht],ze=N({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:j.buildFire,cooldownModifier:b,visibility:()=>H(We.upgrades.logsUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased small fires",onAutoPurchase(){ze.toggle.value&&(j.activeFires.value=a.add(j.activeFires.value,1))},onPurchase(){Q.days[4].recentlyUpdated.value=!0}}),Be=N({name:"Faith",description:"Faith will automatically purchase bonfires you can afford, without actually spending any small fires. You can toggle whether or not to enable the purchased bonfires automatically. Bonfires will start giving a boost to ash and coal gain.",buyable:j.buildBonfire,cooldownModifier:v,visibility:()=>H(We.upgrades.ashUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased bonfires",onAutoPurchase(){Be.toggle.value&&(j.activeBonfires.value=a.add(j.activeBonfires.value,1),j.buildFire.amount.value=a.sub(j.buildFire.amount.value,o(this.buyable.cost)),j.activeFires.value=a.sub(j.activeFires.value,o(this.buyable.cost)))},onPurchase(){Q.days[4].recentlyUpdated.value=!0}}),et=N({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:j.buildKiln,cooldownModifier:w,visibility:()=>H(We.upgrades.coalUpgrade.bought.value),hasToggle:!0,toggleDesc:"Activate auto-purchased kilns",onAutoPurchase(){et.toggle.value&&(j.activeKilns.value=a.add(j.activeKilns.value,1))},onPurchase(){Q.days[4].recentlyUpdated.value=!0}}),Ht=[ze,Be,et],ke={cuttersElf:$,plantersElf:fe,expandersElf:ce,heatedCuttersElf:ut,heatedPlantersElf:X,fertilizerElf:ht,smallFireElf:ze,bonfireElf:Be,kilnElf:et},he=S(()=>Object.values(ke).filter(J=>J.bought.value).length),Ge=Pe(()=>({display:{requirement:"1 Elf Trained",effectDisplay:"Manual cutting and planting can happen twice as often for each trained elf"},shouldEarn:()=>a.gte(he.value,1)})),nt=Pe(()=>({display:{requirement:"2 Elves Trained",effectDisplay:"Research I & II aren't reset after training"},shouldEarn:()=>a.gte(he.value,2),visibility:()=>H(Ge.earned.value)})),je=Pe(()=>({display:{requirement:"3 Elves Trained",effectDisplay:"Coal gain is raised to the 1.25"},shouldEarn:()=>a.gte(he.value,3),visibility:()=>H(nt.earned.value)})),Ce=Pe(()=>({display:{requirement:"4 Elves Trained",effectDisplay:"Trees give twice as many logs"},shouldEarn:()=>a.gte(he.value,4),visibility:()=>H(je.earned.value)})),$e=Pe(()=>({display:{requirement:"5 Elves Trained",effectDisplay:"Forest is twice as large"},shouldEarn:()=>a.gte(he.value,5),visibility:()=>H(Ce.earned.value)})),Ne=Pe(()=>({display:{requirement:"6 Elves Trained",effectDisplay:"Elves work twice as fast"},shouldEarn:()=>a.gte(he.value,6),visibility:()=>H($e.earned.value)})),Ue=Pe(()=>({display:{requirement:"7 Elves Trained",effectDisplay:"Workshop Foundation starts at 100% complete after training"},shouldEarn:()=>a.gte(he.value,7),visibility:()=>H(Ne.earned.value&&Q.day.value>5)})),Se=Pe(()=>({display:{requirement:"8 Elves Trained",effectDisplay:"Forest is twice as large (again)"},shouldEarn:()=>a.gte(he.value,8),visibility:()=>H(Ue.earned.value)})),gt=Pe(()=>({display:{requirement:"9 Elves Trained",effectDisplay:"Trees upgrades aren't reset after training"},shouldEarn:()=>a.gte(he.value,9),visibility:()=>H(Se.earned.value)})),ct=[Ge,nt,je,Ce,$e,Ne,Ue,Se,gt],Nt={manualMilestone:Ge,researchMilestone:nt,coalGainMilestone:je,logGainMilestone:Ce,forestMilestone:$e,elvesMilestone:Ne,foundationMilestone:Ue,forestMilestone2:Se,treeUpgradesMilestone:gt},{collapseMilestones:St,display:dt}=Vi(Nt);return pe.on("update",J=>{a.lt(Q.day.value,en)||Object.values(ke).forEach(vt=>vt.update(J))}),Je(()=>{Q.day.value===en&&a.gte(he.value,6)&&a.gte(j.coal.value,1e9)&&Q.completeDay()}),{name:e,color:t,elves:ke,totalElves:he,milestones:ct,collapseMilestones:St,generalTabCollapsed:P,minWidth:700,display:R(()=>u(F,null,[u("div",null,[Q.day.value===en?`Reach ${K(6)} trained elves and ${K(1e9)} ${j.coal.displayName} to complete the day`:`${e} Complete!`," ",h("-")," ",u("button",{class:"button",style:"display: inline-block;",onClick:()=>ae.value=!0},[h("Check Modifiers")])]),me(s),me(I),u(ve,null,null),u("div",{style:"width: 600px"},[De(...Ze),De(...Tt),De(...Ht)]),dt()]))}}),ao="coal",ci=3,j=Ft(ao,function(){const e="Coal",t="#151716",n="#B2BeB5",i="var(--foreground)",s=pt(0,"coal"),l=pt(0,"ash"),r=Ee(0),c=S(()=>a.times(r.value,1e3)),m=S(()=>a.times(r.value,.1)),d=S(()=>a.times(r.value,50)),g=Ke(()=>({resource:Y.logs,cost(){let A=a.times($.amount.value,o($.cost)).plus(this.amount.value);return a.gte(A,100)&&(A=a.pow(A,2).div(100)),a.gte(A,1e4)&&(A=a.pow(A,2).div(1e4)),A=a.pow(.95,ie.books.smallFireBook.amount.value).times(A),A.pow(1.5).times(1e4)},display:R(()=>u(F,null,[u("h3",null,[h("Small Fire")]),u("br",null,null),h("Burn 1000 logs for 0.1 coal and 50 ash"),u("br",null,null),u("br",null,null),h("Currently:"),u("br",null,null),h("-"),te(c.value),h(" logs/sec"),u("br",null,null),h("+"),te(m.value),h(" coal/sec"),u("br",null,null),h("+"),te(d.value),h(" ash/sec"),u("br",null,null),u("br",null,null),h("Cost: "),K(o(g.cost)),h(" "),g.resource.displayName])),onPurchase(){r.value=a.add(r.value,1)},style:{color:i,width:"160px"}})),_=xe(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(r.value,0)},onClick(){r.value=0}})),b=xe(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(r.value,0)},onClick(){r.value=a.sub(r.value,1)}})),v=xe(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(r.value,g.amount.value)},onClick(){r.value=a.add(r.value,1)}})),w=xe(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(r.value,g.amount.value)},onClick(){r.value=g.amount.value}})),C=pt(g.amount,"small fires"),P=Ee(0),ae=S(()=>a.times(P.value,1e4)),I=S(()=>a.times(P.value,10)),N=S(()=>a.times(P.value,1e3)),$=Ke(()=>({resource:C,cost(){return a.pow(.95,ie.books.bonfireBook.amount.value).times(10)},display:R(()=>u(F,null,[u("h3",null,[h("Bonfire")]),u("br",null,null),h("Burn 10,000 logs for 10 coal and 1000 ash"),u("br",null,null),u("br",null,null),h("Currently:"),u("br",null,null),h("-"),te(ae.value),h(" logs/sec"),u("br",null,null),h("+"),te(I.value),h(" coal/sec"),u("br",null,null),h("+"),te(N.value),h(" ash/sec"),u("br",null,null),u("br",null,null),h("Cost: "),K(o($.cost)),h(" "),$.resource.displayName])),onPurchase(A){r.value=a.sub(r.value,A).max(0),P.value=a.add(P.value,1)},style:{color:i,width:"160px"}})),fe=xe(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(P.value,0)},onClick(){P.value=0}})),ce=xe(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(P.value,0)},onClick(){P.value=a.sub(P.value,1)}})),Ze=xe(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(P.value,$.amount.value)},onClick(){P.value=a.add(P.value,1)}})),ut=xe(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(P.value,$.amount.value)},onClick(){P.value=$.amount.value}})),X=Ee(0),ht=S(()=>a.times(X.value,1e6)),Tt=S(()=>a.times(X.value,1e4)),ze=S(()=>a.times(X.value,1e4)),Be=Ke(()=>({resource:Y.logs,cost(){let A=this.amount.value;return a.gte(A,100)&&(A=a.pow(A,2).div(100)),a.gte(A,1e4)&&(A=a.pow(A,2).div(1e4)),A=a.pow(.95,ie.books.kilnBook.amount.value).times(A),a.pow(1.1,A).times(1e7)},display:R(()=>u(F,null,[u("h3",null,[h("Charcoal Kiln")]),u("br",null,null),h("Burn 1,000,000 logs for 10,000 coal and 10,000 ash"),u("br",null,null),u("br",null,null),h("Currently:"),u("br",null,null),h("-"),te(ht.value),h(" logs/sec"),u("br",null,null),h("+"),te(Tt.value),h(" coal/sec"),u("br",null,null),h("+"),te(ze.value),h(" ash/sec"),u("br",null,null),u("br",null,null),h("Cost: "),K(o(Be.cost)),h(" "),Be.resource.displayName])),onPurchase(){X.value=a.add(X.value,1)},style:{color:i,width:"160px"}})),et=xe(()=>({display:"0",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(X.value,0)},onClick(){X.value=0}})),Ht=xe(()=>({display:"-",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.gt(X.value,0)},onClick(){X.value=a.sub(X.value,1)}})),ke=xe(()=>({display:"+",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(X.value,Be.amount.value)},onClick(){X.value=a.add(X.value,1)}})),he=xe(()=>({display:"Max",style:{minHeight:"20px",width:"40px",color:i},canClick(){return a.lt(X.value,Be.amount.value)},onClick(){X.value=Be.amount.value}})),Ge=de(()=>({resource:s,cost:5,display:{title:"Warmer Cutters",description:"Cut down twice as many trees/s"},style:{color:i}})),nt=de(()=>({resource:s,cost:5,display:{title:"Warmer Planters",description:"Plant twice as many trees/s"},style:{color:i}})),je=de(()=>({resource:l,cost:5e3,display:{title:"Ashy Soil",description:"Trees give 25% more logs"},style:{color:i}})),Ce=de(()=>({resource:C,cost:10,display:{title:"Bigger Fires",description:"Put all those fires together into a larger blaze"},onPurchase(){C.value=a.add(C.value,this.cost)},style:{color:i}})),$e=[Ge,nt,je,Ce],Ne=de(()=>({resource:s,cost:250,display:{title:"Dedicated Cutter Heaters",description:"Double the bonus from Heated Cutters"},style:{color:i},visibility:()=>H(Ce.bought.value)})),Ue=de(()=>({resource:s,cost:250,display:{title:"Dedicated Planter Heaters",description:"Double the bonus from Heated Planters"},style:{color:i},visibility:()=>H(Ce.bought.value)})),Se=de(()=>({canAfford(){return a.gte(Y.logs.value,1e5)&&a.gte(l.value,1e5)},onPurchase(){Y.logs.value=a.sub(Y.logs.value,1e5),l.value=a.sub(l.value,1e5)},display:R(()=>u(F,null,[u("h3",null,[h("Mulched Soil")]),u("br",null,null),h("Double the bonus from Fertilized Soil"),u("br",null,null),u("br",null,null),h("Cost: "),K(1e5),h(" "),Y.logs.displayName,u("br",null,null),K(1e5),h(" "),l.displayName])),style:{color:i},visibility:()=>H(Ce.bought.value)})),gt=de(()=>({resource:Y.logs,cost:1e7,display:{title:"Efficient Fires",description:"Move the fires underground to keep the coal from turning to ash"},style:{color:i},visibility:()=>H(Ce.bought.value)})),ct=[Ne,Ue,Se,gt],Nt=Ke(()=>({resource:s,cost(){let A=this.amount.value;return a.gte(A,50)&&(A=a.pow(A,2).div(50)),a.gte(A,200)&&(A=a.pow(A,2).div(200)),a.gte(A,2e6)&&(A=a.pow(A,2).div(2e6)),A=a.pow(.95,ie.books.heatedCuttersBook.amount.value).times(A),a.add(A,1).pow(2.5).times(10)},display:{title:"Heated Cutters",description:"Even warmer cutters cut down trees faster",effectDisplay:R(()=>u(F,null,[h("Cutters cut down trees "),te(He.value),h("x faster")]))},style:{color:i},visibility:()=>H(Ge.bought.value)})),St=Ke(()=>({resource:s,cost(){let A=this.amount.value;return a.gte(A,50)&&(A=a.pow(A,2).div(50)),a.gte(A,200)&&(A=a.pow(A,2).div(200)),a.gte(A,2e6)&&(A=a.pow(A,2).div(2e6)),A=a.pow(.95,ie.books.heatedPlantersBook.amount.value).times(A),a.add(A,1).pow(2.5).times(10)},display:{title:"Heated Planters",description:"Even warmer planters plant trees faster",effectDisplay:R(()=>u(F,null,[h("Planters plant trees "),te($t.value),h("x faster")]))},style:{color:i},visibility:()=>H(nt.bought.value)})),dt=Ke(()=>({resource:l,cost(){let A=this.amount.value;return a.gte(A,50)&&(A=a.pow(A,2).div(50)),a.gte(A,200)&&(A=a.pow(A,2).div(200)),a.gte(A,2e6)&&(A=a.pow(A,2).div(2e6)),A=a.pow(.95,ie.books.fertilizerBook.amount.value).times(A),a.add(A,1).pow(1.5).times(5e4)},display:{title:"Fertilized Soil",description:"More fertilizer helps trees grow bigger",effectDisplay:R(()=>u(F,null,[h("Trees give "),te(mt.value),h("x more logs")]))},style:{color:i},visibility:()=>H(je.bought.value)})),J=[Nt,St,dt],vt=re(()=>[oe(()=>({addend(){return a.times(Nt.amount.value,.25)},description:"Heated Cutters",enabled(){return a.gt(Nt.amount.value,0)}})),O(()=>({multiplier:2,description:"Dedicated Cutter Heaters",enabled:Ne.bought}))]),He=S(()=>vt.apply(1)),Rt=re(()=>[oe(()=>({addend(){return a.times(St.amount.value,.25)},description:"Heated Planters",enabled(){return a.gt(St.amount.value,0)}})),O(()=>({multiplier:2,description:"Dedicated Planter Heaters",enabled:Ue.bought}))]),$t=S(()=>Rt.apply(1)),Xt=re(()=>[oe(()=>({addend(){return a.times(dt.amount.value,.25)},description:"Fertilized Soil",enabled(){return a.gt(dt.amount.value,0)}})),O(()=>({multiplier:2,description:"Mulched Soil",enabled:Se.bought}))]),mt=S(()=>Xt.apply(1)),x=re(()=>[oe(()=>({addend(){return m.value},description:"Small Fires",enabled(){return a.gt(r.value,0)}})),oe(()=>({addend(){return I.value},description:"Bonfires",enabled(){return a.gt(P.value,0)}})),oe(()=>({addend(){return Tt.value},description:"Charcoal Kilns",enabled(){return a.gt(X.value,0)}})),O(()=>({multiplier:2,description:"Carry coal in boxes",enabled:We.upgrades.coalUpgrade.bought})),O(()=>({multiplier:()=>a.div(We.buyables.coalBoxesBuyable.amount.value,2).add(1),description:"Carry more coal",enabled:We.upgrades.coalUpgrade.bought})),O(()=>({multiplier:()=>a.div(g.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:_e.elves.smallFireElf.bought})),O(()=>({multiplier:()=>a.div($.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:_e.elves.bonfireElf.bought})),O(()=>({multiplier:()=>a.div(Be.amount.value,100).add(1),description:"Kiln Synergy",enabled:_e.elves.kilnElf.bought})),Li(()=>({exponent:1.25,description:"3 Elves Trained",enabled:_e.milestones[2].earned,supportLowNumbers:!0}))]),yt=S(()=>x.apply(0)),bt=re(()=>[oe(()=>({addend(){return d.value},description:"Small Fires",enabled(){return a.gt(r.value,0)}})),oe(()=>({addend(){return N.value},description:"Bonfires",enabled(){return a.gt(P.value,0)}})),oe(()=>({addend(){return ze.value},description:"Charcoal Kilns",enabled(){return a.gt(X.value,0)}})),O(()=>({multiplier:2,description:"Carry ash in boxes",enabled:We.upgrades.ashUpgrade.bought})),O(()=>({multiplier:()=>a.div(We.buyables.ashBoxesBuyable.amount.value,2).add(1),description:"Carry more ash",enabled:We.upgrades.ashUpgrade.bought})),O(()=>({multiplier:()=>a.div(g.amount.value,1e4).add(1),description:"Small Fires Synergy",enabled:_e.elves.smallFireElf.bought})),O(()=>({multiplier:()=>a.div($.amount.value,1e3).add(1),description:"Bonfires Synergy",enabled:_e.elves.bonfireElf.bought})),O(()=>({multiplier:()=>a.div(Be.amount.value,100).add(1),description:"Kiln Synergy",enabled:_e.elves.kilnElf.bought}))]),Yt=S(()=>bt.apply(0)),hn=re(()=>[oe(()=>({addend(){return a.negate(c.value)},description:"Small Fires",enabled(){return a.gt(r.value,0)}})),oe(()=>({addend(){return a.negate(ae.value)},description:"Bonfires",enabled(){return a.gt(P.value,0)}})),oe(()=>({addend(){return a.negate(ht.value)},description:"Charcoal Kilns",enabled(){return a.gt(X.value,0)}}))]),Zn=S(()=>hn.apply(0)),[is,ss]=zn(()=>[{title:"Log Consumption",modifier:hn,base:0,visible(){return a.gt(r.value,0)||a.gt(P.value,0)||a.gt(X.value,0)}},{title:"Coal Gain",modifier:x,base:0,visible(){return a.gt(r.value,0)||a.gt(P.value,0)||a.gt(X.value,0)}},{title:"Ash Gain",modifier:bt,base:0,visible(){return a.gt(r.value,0)||a.gt(P.value,0)||a.gt(X.value,0)}}]),Rn=q(!1),as=R(()=>u(rt,{modelValue:Rn.value,"onUpdate:modelValue":A=>Rn.value=A},{header:()=>u("h2",null,[e,h(" Modifiers")]),body:is}));pe.on("update",A=>{a.lt(Q.day.value,ci)||a.times(A,Zn.value).negate().gt(Y.logs.value)||(Y.logs.value=a.times(A,Zn.value).plus(Y.logs.value),s.value=a.times(A,yt.value).plus(s.value),l.value=a.times(A,Yt.value).plus(l.value))});const{total:ls,trackerDisplay:os}=Pn({resource:s,goal:1e7,name:e,day:ci,color:t,modal:{show:Rn,display:as}});return{name:e,color:t,coal:s,totalCoal:ls,ash:l,activeFires:r,buildFire:g,activeBonfires:P,buildBonfire:$,activeKilns:X,buildKiln:Be,warmerCutters:Ge,warmerPlanters:nt,basicFertilizer:je,unlockBonfire:Ce,dedicatedCutters:Ne,dedicatedPlanters:Ue,betterFertilizer:Se,unlockKiln:gt,heatedCutters:Nt,heatedPlanters:St,moreFertilizer:dt,computedHeatedCutterEffect:He,computedHeatedPlanterEffect:$t,computedFertilizerEffect:mt,generalTabCollapsed:ss,minWidth:700,display:R(()=>u(F,null,[me(os),u(ve,null,null),u(Ut,{resource:s,color:t,style:"margin-bottom: 0",effectDisplay:a.gt(yt.value,0)?`+${te(yt.value)}/s`:void 0},null),u(ve,null,null),u(Ut,{resource:l,color:n,style:"margin-bottom: 0",effectDisplay:a.gt(Yt.value,0)?`+${te(Yt.value)}/s`:void 0},null),u(ve,null,null),u(Fi,null,{default:()=>[u(Kt,null,{default:()=>[me(g),u("div",null,[K(a.floor(r.value)),h("/"),K(a.floor(g.amount.value))]),De(_,b,v,w)]}),Ce.bought.value?u(F,null,[u(ve,null,null),u(Kt,null,{default:()=>[me($),u("div",null,[K(P.value),h("/"),K($.amount.value)]),De(fe,ce,Ze,ut)]})]):void 0,gt.bought.value?u(F,null,[u(ve,null,null),u(Kt,null,{default:()=>[me(Be),u("div",null,[K(X.value),h("/"),K(Be.amount.value)]),De(et,Ht,ke,he)]})]):void 0]}),u(ve,null,null),De(...$e),De(...ct),De(...J)]))}}),lo="trees",di=1,mi=.1,Y=Ft(lo,function(){const e="Trees",t="#4BDC13",n="green",i=pt(0,"logs"),s=pt(0,"saplings"),l=q(0),r=re(()=>[oe(()=>({addend:()=>a.times(Ze.amount.value,10),description:"Expand Forest",enabled:N.bought})),oe(()=>({addend:()=>a.div(Ve.foundationProgress.value,2),description:"75% Foundation Completed",enabled:Ve.milestones.morePlantsMilestone1.earned})),O(()=>({multiplier:2,description:"5 Elves Trained",enabled:_e.milestones[4].earned})),O(()=>({multiplier:2,description:"8 Elves Trained",enabled:_e.milestones[7].earned}))]),c=pt(S(()=>a.sub(r.apply(10),s.value)),"trees"),m=S(()=>r.apply(10)),d=de(()=>({resource:i,cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),g=de(()=>({resource:i,cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),_=de(()=>({resource:i,cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),b=de(()=>({resource:i,cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),v=de(()=>({resource:i,cost:40,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),w=[d,g,_,b,v],C=de(()=>({resource:i,cost:50,visibility:()=>H(v.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),P=de(()=>({resource:i,cost:50,visibility:()=>H(v.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),ae=de(()=>({resource:i,cost:150,visibility:()=>H(v.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),I=de(()=>({resource:i,cost:150,visibility:()=>H(v.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),N=de(()=>({resource:i,cost:300,visibility:()=>H(v.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),$=[C,P,ae,I,N],fe=Ke(()=>({resource:i,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,ie.books.cuttersBook.amount.value).times(x),a.times(100,x).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>H(N.bought.value)})),ce=Ke(()=>({resource:i,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,ie.books.plantersBook.amount.value).times(x),a.times(100,x).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>H(N.bought.value)})),Ze=Ke(()=>({resource:i,cost(){let x=this.amount.value;return a.gte(x,100)&&(x=a.pow(x,2).div(100)),a.gte(x,1e5)&&(x=a.pow(x,2).div(1e5)),x=a.pow(.95,ie.books.expandersBook.amount.value).times(x),a.pow(a.add(x,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>H(N.bought.value)})),ut=[fe,ce,Ze],X=re(()=>[oe(()=>({addend:1,description:"Wooden Fingers",enabled:d.bought})),oe(()=>({addend:et,description:"Smart Knives",enabled:ae.bought}))]),ht=S(()=>X.apply(1)),Tt=re(()=>[O(()=>({multiplier:.5,description:"Sharper Fingers",enabled:C.bought})),O(()=>({multiplier:()=>a.pow(.5,_e.totalElves.value),description:"1 Elf Trained",enabled:_e.milestones[0].earned}))]),ze=S(()=>Tt.apply(1)),Be=re(()=>[oe(()=>({addend:1,description:"Automated Knives",enabled:_.bought})),oe(()=>({addend:fe.amount,description:"Generic Cutters",enabled:N.bought})),oe(()=>({addend:()=>a.div(Ve.foundationProgress.value,5).floor(),description:"10% Foundation Completed",enabled:Ve.milestones.autoCutMilestone1.earned})),O(()=>({multiplier:2,description:"30% Foundation Completed",enabled:Ve.milestones.autoCutMilestone2.earned})),O(()=>({multiplier:2,description:"Warmer Cutters",enabled:j.warmerCutters.bought})),O(()=>({multiplier:j.computedHeatedCutterEffect,description:"Heated Cutters",enabled:()=>a.gt(j.heatedCutters.amount.value,0)}))]),et=S(()=>Be.apply(0)),Ht=re(()=>[oe(()=>({addend:1,description:"Leafy Fingers",enabled:g.bought})),oe(()=>({addend:je,description:"Smart Spades",enabled:I.bought}))]),ke=S(()=>Ht.apply(1)),he=re(()=>[O(()=>({multiplier:.5,description:"Greener Fingers",enabled:P.bought})),O(()=>({multiplier:()=>a.pow(.5,_e.totalElves.value),description:"1 Elf Trained",enabled:_e.milestones[0].earned}))]),Ge=S(()=>he.apply(1)),nt=re(()=>[oe(()=>({addend:1,description:"Automated Spade",enabled:b.bought})),oe(()=>({addend:()=>a.div(ce.amount.value,2),description:"Generic Planters",enabled:N.bought})),oe(()=>({addend:()=>a.div(Ve.foundationProgress.value,10).floor(),description:"20% Foundation Completed",enabled:Ve.milestones.autoPlantMilestone1.earned})),O(()=>({multiplier:2,description:"40% Foundation Completed",enabled:Ve.milestones.autoPlantMilestone2.earned})),O(()=>({multiplier:2,description:"Warmer Planters",enabled:j.warmerPlanters.bought})),O(()=>({multiplier:j.computedHeatedPlanterEffect,description:"Heated Planters",enabled:()=>a.gt(j.heatedPlanters.amount.value,0)}))]),je=S(()=>nt.apply(0)),Ce=re(()=>[O(()=>({multiplier:1.25,description:"Research I",enabled:v.bought})),O(()=>({multiplier:1.25,description:"Research II",enabled:N.bought})),O(()=>({multiplier:()=>a.div(Ve.foundationProgress.value,20).add(1),description:"1% Foundation Completed",enabled:Ve.milestones.logGainMilestone1.earned})),O(()=>({multiplier:2,description:"50% Foundation Completed",enabled:Ve.milestones.logGainMilestone2.earned})),O(()=>({multiplier:1.25,description:"Ashy Soil",enabled:j.basicFertilizer.bought})),O(()=>({multiplier:j.computedFertilizerEffect,description:"Fertilized Soil",enabled:()=>a.gt(j.moreFertilizer.amount.value,0)})),O(()=>({multiplier:2,description:"4 Elves Trained",enabled:_e.milestones[3].earned})),O(()=>({multiplier:2,description:"Carry logs in boxes",enabled:We.upgrades.logsUpgrade.bought})),O(()=>({multiplier:()=>a.div(We.buyables.logBoxesBuyable.amount.value,2).add(1),description:"Carry more logs",enabled:We.upgrades.logsUpgrade.bought})),Li(()=>({exponent:1.2,description:"100% Foundation Completed",enabled:Ve.milestones.logGainMilestone3.earned}))]),$e=Ee(0),Ne=un(()=>({direction:se.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div($e.value,ze.value)})),Ue=xe(()=>({display:{title:"Cut trees",description:R(()=>u(F,null,[h("Cut down up to "),K(a.floor(ht.value))," ",h("tree"),a.eq(ht.value,1)?"":"s",h(" at once!"),u("br",null,null),me(Ne)]))},style:{minHeight:"80px"},canClick:()=>a.gte(c.value,1)&&a.gte($e.value,ze.value),onClick(){if(a.lt($e.value,ze.value))return;const x=a.floor(a.min(c.value,a.times(ht.value,a.div($e.value,ze.value).floor())));i.value=a.add(i.value,Ce.apply(x)),s.value=a.add(s.value,x),$e.value=0}})),Se=Ee(0),gt=un(()=>({direction:se.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>a.div(Se.value,Ge.value)})),ct=xe(()=>({display:{title:"Plant trees",description:R(()=>u(F,null,[h("Plant up to "),K(a.floor(ke.value))," ",h("tree"),a.eq(ke.value,1)?"":"s",h(" at once!"),u("br",null,null),me(gt)]))},style:{minHeight:"80px"},canClick:()=>a.gte(s.value,1)&&a.gte(Se.value,Ge.value),onClick(){if(a.lt(Se.value,Ge.value))return;const x=a.floor(a.min(s.value,a.times(ke.value,a.div(Se.value,Ge.value).floor())));s.value=a.sub(s.value,x),Se.value=0}})),[Nt,St]=zn(()=>[{title:"Logs per Tree",modifier:Ce,base:1,visible:v.bought},{title:"Manual Cutting Amount",modifier:X,base:1,visible:d.bought,unit:"/click"},{title:"Manual Cutting Cooldown",modifier:Tt,base:1,visible:d.bought,unit:"s"},{title:"Manual Planting Amount",modifier:Ht,base:1,visible:g.bought,unit:"/click"},{title:"Manual Planting Cooldown",modifier:he,base:1,visible:g.bought,unit:"s"},{title:"Auto Cutting Amount",modifier:Be,base:0,visible:_.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:nt,base:0,visible:b.bought,unit:"/s"},{title:"Forest Size",modifier:r,base:10,visible:N.bought}]),dt=q(!1),J=R(()=>u(rt,{modelValue:dt.value,"onUpdate:modelValue":x=>dt.value=x},{header:()=>u("h2",null,[e,h(" Modifiers")]),body:Nt}));pe.on("update",x=>{if(a.lt(Q.day.value,di))return;a.gte($e.value,ze.value)?$e.value=ze.value:($e.value=a.add($e.value,x),Ue.isHolding.value&&Ue.onClick()),a.gte(Se.value,Ge.value)?Se.value=Ge.value:(Se.value=a.add(Se.value,x),ct.isHolding.value&&ct.onClick());const yt=a.min(c.value,a.times(et.value,x)),bt=a.mul(Ce.apply(1),yt),Yt=a.div(bt,x);l.value=a.mul(Yt,mi).add(a.mul(l.value,a.dOne.sub(mi))),i.value=a.add(i.value,bt),s.value=a.add(s.value,yt);const hn=a.min(s.value,a.times(je.value,x));s.value=a.sub(s.value,hn)});const vt=S(()=>a.sub(et.value,je.value)),He=S(()=>a.sub(je.value,et.value)),Rt=qn(()=>({key:"c",description:'Press the "Cut trees" button.',onPress:()=>{Ue.canClick.value&&Ue.onClick()}})),$t=qn(()=>({key:"p",description:'Press the "Plant trees" button.',onPress:()=>{ct.canClick.value&&ct.onClick()}})),{total:Xt,trackerDisplay:mt}=Pn({resource:i,goal:1e4,name:e,day:di,color:n,modal:{show:dt,display:J}});return{name:e,color:t,logs:i,totalLogs:Xt,trees:c,saplings:s,cutTree:Ue,plantTree:ct,cutTreeHK:Rt,plantTreeHK:$t,row1Upgrades:w,row2Upgrades:$,row1Buyables:ut,manualCutProgress:$e,manualPlantProgress:Se,generalTabCollapsed:St,minWidth:700,display:R(()=>u(F,null,[me(mt),u(ve,null,null),u(Ut,{resource:i,color:t,style:"margin-bottom: 0",productionDisplay:a.gt(et.value,0)?`+${te(l.value)}/s average<br/>equilibrium: +${Ni([[a.mul(Ce.apply(1),et.value),"cutting speed"],[a.mul(Ce.apply(1),je.value),"planting speed"],[a.mul(Ce.apply(1),a.mul(m.value,20)),"forest cap"]],"/s")}`:void 0},null),u(Ut,{resource:s,color:n,style:"margin-bottom: 0",productionDisplay:{[-1]:`${K(vt.value)}/s`,0:void 0,1:`+${K(vt.value)}/s`}[a.compare(vt.value,0)]},null),u(Ut,{resource:c,color:n,style:"margin-bottom: 0",productionDisplay:{[-1]:`${K(He.value)}/s`,0:void 0,1:`+${K(He.value)}/s`}[a.compare(He.value,0)]},null),u(ve,null,null),De(Ue,ct),u("div",null,[h("Tip: You can hold down on actions to perform them automatically")]),u(ve,null,null),De(...w),De(...$),De(...ut)]))}});var Qi="./assets/tree.35808197.png",zi="./assets/sws.714ad454.png",ji="data:image/png;base64,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",Ki="./assets/elf.9fbfa563.png",Wi="./assets/paperStacks.4c96ec8c.png",Ji="data:image/png;base64,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";const Q=Ft("main",function(){const e=Ee(1),t=q(!1),n=q(-1),i=q(""),s=q();function l(m){const d=Ee(!1),g=Ee(!1);return Qe(()=>{const _=m(),b=qe(_.shouldNotify),v=qe(()=>o(b)||o(g));return{..._,opened:d,shouldNotify:v,recentlyUpdated:g,[xt]:rl,[Pt]:function(){const{day:w,layer:C,symbol:P,opened:ae,shouldNotify:I,story:N,completedStory:$,recentlyUpdated:fe}=this;return{day:w,symbol:P,opened:ae,recentlyUpdated:fe,shouldNotify:I,onOpenLore(){var ut,X;const ce=Q.day.value>w;n.value=ce?w-1:-1;const Ze=o((X=(ut=Oe[C!=null?C:"trees"])==null?void 0:ut.name)!=null?X:"");i.value=ce?`${Ze} - Completed!`:Ze,s.value=ce?`${N}<hr style="
margin: 10px 0;"/>${$}`:N,t.value=!0},onOpenLayer(){if(fe.value=!1,window.matchMedia("(min-width: 1468px)").matches)if(E.tabs.includes(C!=null?C:"trees")){const ce=E.tabs.lastIndexOf(C!=null?C:"trees");E.tabs.splice(ce,1)}else E.tabs.push(C!=null?C:"trees"),Q.minimized.value=!0;else E.tabs.splice(1,1/0,C!=null?C:"trees")},onUnlockLayer(){ae.value=!0,setTimeout(()=>{var ce,Ze;n.value=-1,i.value=o((Ze=(ce=Oe[C!=null?C:"trees"])==null?void 0:ce.name)!=null?Ze:""),s.value=N,E.devSpeed=null,t.value=!0},1e3)}}}}})}const r=[l(()=>({day:1,shouldNotify:!1,layer:"trees",symbol:Qi,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!"})),l(()=>({day:2,shouldNotify:!1,layer:"workshop",symbol:zi,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!"})),l(()=>({day:3,shouldNotify:!1,layer:"coal",symbol:ji,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!"})),l(()=>({day:4,shouldNotify:!1,layer:"elves",symbol:Ki,story:"Alright, it seems you finally have enough things setup to start bringing in the elves! Unfortunately, it seems they'll need to be retrained on how to help, since they're out of practice by 11 months!",completedStory:"The workshop now hums with the bustling elves working everything. They can take it from here - you deserve a break after such a long day! Good Job!"})),l(()=>({day:5,shouldNotify:!1,layer:"paper",symbol:Wi,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 to 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!"})),l(()=>({day:6,shouldNotify:!1,layer:"boxes",symbol:Ji,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 of your list and start looking towards tomorrow. Good Job!"})),l(()=>({day:7,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""})),l(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:"",completedStory:""}))];function c(){n.value=e.value-1,i.value="Day Complete!",s.value=r[e.value-1].completedStory,t.value=!0,e.value++,Q.minimized.value=!1,E.devSpeed=0}return{name:"Calendar",days:r,day:e,loreScene:n,loreTitle:i,loreBody:s,showLoreModal:t,completeDay:c,minWidth:700,display:R(()=>u(F,null,[E.devSpeed===0?u("div",null,[h("Game Paused")]):null,E.devSpeed&&E.devSpeed!==1?u("div",null,[h("Dev Speed: "),te(E.devSpeed),h("x")]):null,E.offlineTime?u("div",null,[h("Offline Time: "),En(E.offlineTime)]):null,u(ve,null,null),u("div",{class:"advent"},[r.reduce((m,d)=>(m[m.length-1].length===4&&m.push([]),m[m.length-1].push(d),m),[[]]).map(m=>De(...m))])]))}}),oo=e=>[Q,Y,Ve,j,_e,ie,We],Jn=S(()=>!1);function ro(e,t){t.offlineProd=!1}var Xi=Object.freeze(Object.defineProperty({__proto__:null,main:Q,getInitialLayers:oo,hasWon:Jn,fixOldSave:ro},Symbol.toStringTag,{value:"Module"}));const uo={class:"scene"},co=["src"],mo=["src"],fo=["src"],po=["src"],ho={key:4,class:"scene-bubble",style:{left:"50%",bottom:"38%"}},go=["src"],vo=["src"],yo=L({__name:"Scene",props:{day:null},setup(e){return(t,n)=>(y(),M("div",uo,[e.day>=0?(y(),M("img",{key:0,src:o(Qi),class:"scene-item",style:{left:"10%",bottom:"10%"}},null,8,co)):B("",!0),e.day>=1?(y(),M("img",{key:1,src:o(zi),class:"scene-item",style:{left:"40%",bottom:"12%"}},null,8,mo)):B("",!0),e.day>=2?(y(),M("img",{key:2,src:o(ji),class:"scene-item",style:{left:"65%",bottom:"12%",width:"40px",height:"40px"}},null,8,fo)):B("",!0),e.day>=3?(y(),M("img",{key:3,src:o(Ki),class:"scene-item",style:{left:"52%",bottom:"12%"}},null,8,po)):B("",!0),e.day>=4?(y(),M("div",ho,[e.day>=4?(y(),M("img",{key:0,src:o(Wi),class:"scene-item"},null,8,go)):B("",!0),e.day>=5?(y(),M("img",{key:1,src:o(Ji),class:"scene-item"},null,8,vo)):B("",!0)])):B("",!0)]))}});var bo=ne(yo,[["__scopeId","data-v-36663c1c"]]);const _o=L({components:{Context:$i},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:D(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:D(Number,String),required:!0},name:{type:D(String),required:!0},color:D(String),minimizable:D(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:i,minWidth:s,tab:l}=Re(e),r=Cn(t),c=S(()=>ee.allowGoBack&&n.value>0&&!i.value);function m(){E.tabs.splice(o(e.index),1)}Lt(()=>g(i.value,o(s.value))),lt([i,Ba(s)],([_,b])=>g(_,b));function d(_){e.nodes.value=_}function g(_,b){const v=typeof b=="number"||Number.isNaN(parseInt(b))?b+"px":b,w=l.value();w!=null&&(_?(w.style.flexGrow="0",w.style.flexShrink="0",w.style.width="60px",w.style.minWidth=w.style.flexBasis="",w.style.margin="0"):(w.style.flexGrow="",w.style.flexShrink="",w.style.width="",w.style.minWidth=w.style.flexBasis=v,w.style.margin=""))}return{component:r,showGoBack:c,updateNodes:d,unref:o,goBack:m}}});function wo(e,t,n,i,s,l){const r=Et("Context");return y(),M("div",{class:"layer-container",style:Me({"--layer-color":e.unref(e.color)})},[e.showGoBack?(y(),M("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):B("",!0),e.minimized.value?(y(),M("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.minimized.value=!1)},[f("div",null,W(e.unref(e.name)),1)])):(y(),M("div",{key:2,class:we(["layer-tab",{showGoBack:e.showGoBack}])},[u(r,{onUpdateNodes:e.updateNodes},{default:U(()=>[(y(),G(ye(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(y(),M("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.minimized.value=!0)}," \u25BC ")):B("",!0)],4)}var ko=ne(_o,[["render",wo],["__scopeId","data-v-0158bec3"]]);const Yi=e=>(wt("data-v-4b4bda40"),e=e(),kt(),e),Co=Yi(()=>f("h2",null,"Changelog",-1)),No=Yi(()=>f("details",{open:""},[f("summary",null,[h("v0.0 Initial Commit - "),f("time",null,"2021-09-04")]),h(" This is the first release :D "),f("ul",null,[f("li",{class:"feature"},"Did everything"),f("li",{class:"fix"},"Had some fun"),f("li",{class:"breaking"},"Removed everything"),f("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),So=L({__name:"Changelog",setup(e,{expose:t}){const n=q(!1);return t({open(){n.value=!0}}),(i,s)=>(y(),G(rt,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l)},{header:U(()=>[Co]),body:U(()=>[No]),_:1},8,["modelValue"]))}});var Mo=ne(So,[["__scopeId","data-v-4b4bda40"]]),Io=L({props:{element:Object,display:{type:D(Object,String,Function),required:!0},style:D(Object,String,Array),classes:D(Object),direction:D(String),xoffset:D(String),yoffset:D(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Re(e),s=q(!1),l=S(()=>(Ae(i)||s.value)&&r.value),r=Bt(n),c=tt(Z(R(()=>{const g=Ae(t);return g==null?"":at(g)})));function m(g){const _=i;g.shiftKey&&_&&(_.value=!_.value,g.stopPropagation(),g.preventDefault())}const d=S(()=>Ae(i)&&dn[ue.theme].showPin);return{Direction:se,isHovered:s,isShown:l,comp:r,elementComp:c,unref:o,togglePinned:m,showPin:d}}});const Ao={key:0,class:"material-icons pinned"};function Eo(e,t,n,i,s,l){return y(),M("div",{class:we(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=r=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=r=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...r)=>e.togglePinned&&e.togglePinned(...r))},[ft(e.$slots,"default",{},void 0,!0),e.elementComp?(y(),G(ye(e.elementComp),{key:0})):B("",!0),u(An,{name:"fade"},{default:U(()=>{var r;return[e.isShown?(y(),M("div",{key:0,class:we(["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:Me([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(r=e.unref(e.style))!=null?r:{}])},[e.showPin?(y(),M("span",Ao,"push_pin")):B("",!0),e.comp?(y(),G(ye(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var be=ne(Io,[["render",Eo],["__scopeId","data-v-6102fa3a"]]);const Bo={class:"info-modal-header"},xo=["src","alt"],Po={class:"info-modal-title"},Fo={key:0},To={key:0},Ro={key:0},$o=f("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),Do=f("br",null,null,-1),Oo=f("br",null,null,-1),qo=["href"],Uo=f("span",{class:"material-icons info-modal-discord"},"discord",-1),Vo=f("div",null,[f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),h(" The Paper Pilot Community ")])],-1),Lo=f("div",null,[f("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),h(" The Modding Tree ")])],-1),Go=f("br",null,null,-1);var Ho=L({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:s,author:l,discordName:r,discordLink:c,versionNumber:m,versionTitle:d}=ee,g=Re(n),_=q(!1),b=S(()=>En(E.timePlayed)),v=S(()=>Z(R(()=>u(F,null,[Pi.map(me)]))));t({open(){_.value=!0}});function w(){var C;(C=o(g.changelog))==null||C.open()}return(C,P)=>(y(),G(rt,{modelValue:_.value,"onUpdate:modelValue":P[0]||(P[0]=ae=>_.value=ae)},{header:U(()=>[f("div",Bo,[o(s)?(y(),M("img",{key:0,class:"info-modal-logo",src:o(s),alt:o(i)},null,8,xo)):B("",!0),f("div",Po,[f("h2",null,W(o(i)),1),f("h4",null,[h(" v"+W(o(m)),1),o(d)?(y(),M("span",Fo,": "+W(o(d)),1)):B("",!0)])])])]),body:U(({shown:ae})=>[ae?(y(),M("div",To,[o(l)?(y(),M("div",Ro,"By "+W(o(l)),1)):B("",!0),$o,Do,f("div",{class:"link",onClick:w},"Changelog"),Oo,f("div",null,[o(c)?(y(),M("a",{key:0,href:o(c),class:"info-modal-discord-link",target:"_blank"},[Uo,h(" "+W(o(r)),1)],8,qo)):B("",!0)]),Vo,Lo,Go,f("div",null,"Time Played: "+W(o(b)),1),(y(),G(ye(o(v))))])):B("",!0)]),_:1},8,["modelValue"]))}});const Zi=e=>(wt("data-v-1975661c"),e=e(),kt(),e),Qo=Zi(()=>f("div",{class:"header"},[f("h2",null,"Options")],-1)),zo=Zi(()=>f("hr",null,null,-1));var jo=L({__name:"Options",setup(e,{expose:t}){const n=q(!1);t({open(){n.value=!0}});const i=Object.keys(dn).map(v=>({label:Si(v),value:v})),s=S(()=>Z(R(()=>u(F,null,[xi.map(me)])))),{showTPS:l,theme:r,unthrottled:c}=Re(ue),{autosave:m,offlineProd:d}=Re(E),g=S({get(){return E.devSpeed===0},set(v){E.devSpeed=v?0:null}});R(()=>u("span",null,[h("Offline Production"),u(be,{display:"Save-specific"},{default:()=>[h("*")]})]));const _=R(()=>u("span",null,[h("Autosave"),u(be,{display:"Save-specific"},{default:()=>[h("*")]})])),b=R(()=>u("span",null,[h("Pause game"),u(be,{display:"Save-specific"},{default:()=>[h("*")]})]));return(v,w)=>(y(),G(rt,{modelValue:n.value,"onUpdate:modelValue":w[4]||(w[4]=C=>n.value=C)},{header:U(()=>[Qo]),body:U(()=>[u(Wn,{title:"Theme",options:o(i),modelValue:o(r),"onUpdate:modelValue":w[0]||(w[0]=C=>Fe(r)?r.value=C:null)},null,8,["options","modelValue"]),(y(),G(ye(o(s)))),u(Vt,{title:"Show TPS",modelValue:o(l),"onUpdate:modelValue":w[1]||(w[1]=C=>Fe(l)?l.value=C:null)},null,8,["modelValue"]),zo,u(Vt,{title:o(_),modelValue:o(m),"onUpdate:modelValue":w[2]||(w[2]=C=>Fe(m)?m.value=C:null)},null,8,["title","modelValue"]),o(ee).enablePausing?(y(),G(Vt,{key:0,title:o(b),modelValue:o(g),"onUpdate:modelValue":w[3]||(w[3]=C=>Fe(g)?g.value=C:null)},null,8,["title","modelValue"])):B("",!0)]),_:1},8,["modelValue"]))}});var Ko=ne(jo,[["__scopeId","data-v-1975661c"]]);const Wo=["onSubmit"],Jo={class:"field"},Xo={key:0,class:"field-title"},Yo=["placeholder"],Zo=L({__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 n=e,i=Bt(ot(n,"title"),"span"),s=tt(null);Mn(()=>{var m;(m=s.value)==null||m.focus()});const l=S({get(){return o(n.modelValue)||""},set(m){t("update:modelValue",m)}});function r(){t("submit")}function c(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(m,d)=>(y(),M("form",{onSubmit:sn(r,["prevent"])},[f("div",Jo,[o(i)?(y(),M("span",Xo,[(y(),G(ye(o(i))))])):B("",!0),e.textArea?(y(),G(o(bs),{key:1,modelValue:o(l),"onUpdate:modelValue":d[0]||(d[0]=g=>Fe(l)?l.value=g:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:s},null,8,["modelValue","placeholder","maxHeight"])):In((y(),M("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=g=>Fe(l)?l.value=g:null),placeholder:e.placeholder,class:we({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:s},null,42,Yo)),[[fs,o(l)]])])],40,Wo))}});var es=ne(Zo,[["__scopeId","data-v-67b44a54"]]);const er={key:0},tr=["onClick","disabled"],nr={key:0},ir=["onClick"],sr=L({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Re(e),s=q(!1);lt(s,c=>{t("confirmingChanged",c)});function l(){if(o(i.skipConfirm)){t("click");return}s.value&&t("click"),s.value=!s.value}function r(){s.value=!1}return(c,m)=>(y(),M("span",{class:we(["container",{confirming:s.value}])},[s.value?(y(),M("span",er,"Are you sure?")):B("",!0),f("button",{onClick:sn(l,["stop"]),class:"button danger",disabled:e.disabled},[s.value?(y(),M("span",nr,"Yes")):ft(c.$slots,"default",{key:1},void 0,!0)],8,tr),s.value?(y(),M("button",{key:1,class:"button",onClick:sn(r,["stop"])},"No",8,ir)):B("",!0)],2))}});var ar=ne(sr,[["__scopeId","data-v-2f8ef34c"]]);const lr=["onClick"],or=L({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=q(!1),i=q(null);function s(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Lt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(l,r)=>(y(),M("button",{onClick:sn(s,["stop"]),class:we(["feedback",{activated:n.value,left:e.left}])},[ft(l.$slots,"default",{},void 0,!0)],10,lr))}});var rr=ne(or,[["__scopeId","data-v-01a1b95c"]]);const Ct=e=>(wt("data-v-5285ac49"),e=e(),kt(),e),ur=Ct(()=>f("div",{class:"handle material-icons"},"drag_handle",-1)),cr={key:0,class:"actions"},dr=Ct(()=>f("span",{class:"material-icons"},"content_paste",-1)),mr=Ct(()=>f("span",{class:"material-icons"},"content_copy",-1)),fr=Ct(()=>f("span",{class:"material-icons"},"edit",-1)),pr=Ct(()=>f("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),hr={key:1,class:"actions"},gr=Ct(()=>f("span",{class:"material-icons"},"check",-1)),vr=Ct(()=>f("span",{class:"material-icons"},"close",-1)),yr={key:2,class:"details"},br={class:"save-version"},_r=Ct(()=>f("br",null,null,-1)),wr={key:0},kr={key:1},Cr={key:3,class:"details"},Nr={key:4,class:"details error"},Sr=Ct(()=>f("br",null,null,-1)),Mr=L({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Re(n),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),l=q(!1),r=q(!1),c=q("");lt(l,()=>c.value=i.value.name||"");const m=S(()=>i.value&&i.value.id===E.id),d=S(()=>m.value?E.time:i.value&&i.value.time||0),g=Cn(S(()=>{var b,v,w,C;return`Day ${(C=(w=(v=(b=i.value)==null?void 0:b.layers)==null?void 0:v.main)==null?void 0:w.day)!=null?C:1}`}));function _(){t("editName",c.value),l.value=!1}return(b,v)=>(y(),M("div",{class:we(["save",{active:o(m)}])},[ur,l.value?(y(),M("div",hr,[f("button",{onClick:_,class:"button"},[u(be,{display:"Save",direction:o(se).Left,class:"info"},{default:U(()=>[gr]),_:1},8,["direction"])]),f("button",{onClick:v[5]||(v[5]=w=>l.value=!l.value),class:"button"},[u(be,{display:"Cancel",direction:o(se).Left,class:"info"},{default:U(()=>[vr]),_:1},8,["direction"])])])):(y(),M("div",cr,[o(i).error==null&&!r.value?(y(),G(rr,{key:0,onClick:v[0]||(v[0]=w=>t("export")),class:"button",left:""},{default:U(()=>[u(be,{display:"Export",direction:o(se).Left,class:"info"},{default:U(()=>[dr]),_:1},8,["direction"])]),_:1})):B("",!0),o(i).error==null&&!r.value?(y(),M("button",{key:1,onClick:v[1]||(v[1]=w=>t("duplicate")),class:"button"},[u(be,{display:"Duplicate",direction:o(se).Left,class:"info"},{default:U(()=>[mr]),_:1},8,["direction"])])):B("",!0),o(i).error==null&&!r.value?(y(),M("button",{key:2,onClick:v[2]||(v[2]=w=>l.value=!l.value),class:"button"},[u(be,{display:"Edit Name",direction:o(se).Left,class:"info"},{default:U(()=>[fr]),_:1},8,["direction"])])):B("",!0),u(ar,{disabled:o(m),onClick:v[3]||(v[3]=w=>t("delete")),onConfirmingChanged:v[4]||(v[4]=w=>r.value=w)},{default:U(()=>[u(be,{display:"Delete",direction:o(se).Left,class:"info"},{default:U(()=>[pr]),_:1},8,["direction"])]),_:1},8,["disabled"])])),o(i).error==null&&!l.value?(y(),M("div",yr,[f("button",{class:"button open",onClick:v[6]||(v[6]=w=>t("open"))},[f("h3",null,W(o(i).name),1)]),f("span",br,"v"+W(o(i).modVersion),1),_r,o(d)?(y(),M("div",wr,"Last played "+W(o(s).format(o(d))),1)):B("",!0),o(g)?(y(),M("div",kr,[(y(),G(ye(o(g))))])):B("",!0)])):o(i).error==null&&l.value?(y(),M("div",Cr,[u(es,{modelValue:c.value,"onUpdate:modelValue":v[7]||(v[7]=w=>c.value=w),class:"editname",onSubmit:_},null,8,["modelValue"])])):(y(),M("div",Nr,[h(" Error: Failed to load save with id "+W(o(i).id),1),Sr,h(W(o(i).error),1)]))],2))}});var Ir=ne(Mr,[["__scopeId","data-v-5285ac49"]]);const Xn=e=>(wt("data-v-3b9991aa"),e=e(),kt(),e),Ar=Xn(()=>f("h2",null,"Saves Manager",-1)),Er={class:"modal-footer"},Br={class:"field"},xr=Xn(()=>f("span",{class:"field-title"},"Create Save",-1)),Pr={class:"field-buttons"},Fr={class:"footer"},Tr=Xn(()=>f("div",{style:{"flex-grow":"1"}},null,-1)),Rr=L({__name:"SavesManager",setup(e,{expose:t}){const n=q(!1),i=q(null);t({open(){n.value=!0}});const s=q(!1),l=q(""),r=q(null);lt(l,I=>{I?Lt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=It.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),s.value=!0;return}const N=JSON.parse(I);if(typeof N!="object"){s.value=!0;return}const $=yn();N.id=$,it(N),l.value="",s.value=!1,ue.saves.push($)}catch{s.value=!0}}):s.value=!1});let c={},m=q(Object.keys(c).reduce((I,N)=>(I.push({label:N.split("/").slice(-1)[0].slice(0,-4),value:c[N]}),I),[]));const d=Sn({});function g(I){if(d[I]==null){let N=localStorage.getItem(I);if(N==null)d[I]={error:"Save doesn't exist in localStorage",id:I};else if(N==="dW5kZWZpbmVk")d[I]={error:"Save is undefined",id:I};else try{if(N[0]!=="{")if(N[0]==="e")N=decodeURIComponent(escape(atob(N)));else if(N[0]==="\u1BE1")N=It.decompressFromUTF16(N);else return console.warn("Unable to determine preset encoding",N),s.value=!0,d[I]={error:"Unable to determine preset encoding",id:I},d[I];d[I]={...JSON.parse(N),id:I}}catch($){d[I]={error:$,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}:
${$}
${N}`)}}return d[I]}lt(n,I=>{I&&Object.keys(d).forEach(N=>delete d[N])});const _=S(()=>ue.saves.reduce((I,N)=>(I[N]=g(N),I),{}));function b(I){let N;switch(E.id===I?N=Ai(E[ge]):N=JSON.stringify(_.value[I]),ee.exportEncoding){default:console.warn(`Unknown save encoding: ${ee.exportEncoding}. Defaulting to lz`);case"lz":N=It.compressToUTF16(N);break;case"base64":N=btoa(unescape(encodeURIComponent(N)));break;case"plain":break}const $=document.createElement("textarea");$.value=N,document.body.appendChild($),$.select(),$.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild($)}function v(I){E.id===I&&it();const N={..._.value[I],id:yn()};it(N),ue.saves.push(N.id)}function w(I){ue.saves=ue.saves.filter(N=>N!==I),localStorage.removeItem(I),d[I]=void 0}function C(I){_.value[E.id].time=E.time,it(),d[E.id]=void 0,qt(_.value[I]),d[I]=void 0}function P(I){if(r.value=I,Lt(()=>{r.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=It.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const N=JSON.parse(I);N.id=yn(),it(N),ue.saves.push(N.id),C(N.id)}function ae(I,N){const $=_.value[I];$&&($.name=N,E.id===I?(E.name=N,it()):(it($),d[I]=void 0))}return(I,N)=>(y(),G(rt,{modelValue:n.value,"onUpdate:modelValue":N[4]||(N[4]=$=>n.value=$),ref_key:"modal",ref:i},{header:U(()=>[Ar]),body:U(({shown:$})=>[$?(y(),G(o(ys),{key:0,list:o(ue).saves,handle:".handle",itemKey:fe=>fe},{item:U(({element:fe})=>[u(Ir,{save:o(_)[fe],onOpen:ce=>C(fe),onExport:ce=>b(fe),onEditName:ce=>ae(fe,ce),onDuplicate:ce=>v(fe),onDelete:ce=>w(fe)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:U(()=>[f("div",Er,[u(es,{modelValue:l.value,"onUpdate:modelValue":N[0]||(N[0]=$=>l.value=$),title:"Import Save",placeholder:"Paste your save here!",class:we({importingFailed:s.value})},null,8,["modelValue","class"]),f("div",Br,[xr,f("div",Pr,[f("button",{class:"button",onClick:N[1]||(N[1]=$=>C(o(jt)().id))},"New Game"),Object.keys(o(m)).length>0?(y(),G(Wn,{key:0,options:o(m),modelValue:r.value,"onUpdate:modelValue":N[2]||(N[2]=$=>P($)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),f("div",Fr,[Tr,f("button",{class:"button modal-default-button",onClick:N[3]||(N[3]=$=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ts=ne(Rr,[["__scopeId","data-v-3b9991aa"]]);const Ye=e=>(wt("data-v-4a3f8425"),e=e(),kt(),e),$r=["src","alt"],Dr={key:1,class:"title"},Or=Ye(()=>f("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),qr={class:"discord"},Ur={class:"discord-links"},Vr={key:0},Lr=["href"],Gr=Ye(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Hr=Ye(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Qr={href:"https://forums.moddingtree.com/",target:"_blank"},zr=Ye(()=>f("span",{class:"material-icons"},"forum",-1)),jr=Ye(()=>f("span",{class:"material-icons"},"info",-1)),Kr=Ye(()=>f("span",{class:"material-icons"},"library_books",-1)),Wr=Ye(()=>f("span",{class:"material-icons"},"settings",-1)),Jr=Ye(()=>f("span",{class:"material-icons"},"library_books",-1)),Xr=Ye(()=>f("span",{class:"material-icons"},"settings",-1)),Yr=Ye(()=>f("span",{class:"material-icons"},"info",-1)),Zr={href:"https://forums.moddingtree.com/",target:"_blank"},eu=Ye(()=>f("span",{class:"material-icons"},"forum",-1)),tu={class:"discord"},nu={class:"discord-links"},iu={key:0},su=["href"],au=Ye(()=>f("li",null,[f("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),lu=Ye(()=>f("li",null,[f("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ou=L({__name:"Nav",setup(e){const t=q(null),n=q(null),i=q(null),s=q(null),{useHeader:l,banner:r,title:c,discordName:m,discordLink:d,versionNumber:g}=ee;function _(){window.open(d,"mywindow")}return(b,v)=>(y(),M(F,null,[o(l)?(y(),M("div",Gt({key:0,class:"nav"},b.$attrs),[o(r)?(y(),M("img",{key:0,src:o(r),class:"banner",alt:o(c)},null,8,$r)):(y(),M("div",Dr,W(o(c)),1)),f("div",{onClick:v[0]||(v[0]=w=>{var C;return(C=s.value)==null?void 0:C.open()}),class:"version-container"},[u(be,{display:"Changelog",direction:o(se).Down,class:"version"},{default:U(()=>[f("span",null,"v"+W(o(g)),1)]),_:1},8,["direction"])]),Or,f("div",qr,[f("span",{onClick:_,class:"material-icons"},"discord"),f("ul",Ur,[o(d)?(y(),M("li",Vr,[f("a",{href:o(d),target:"_blank"},W(o(m)),9,Lr)])):B("",!0),Gr,Hr])]),f("div",null,[f("a",Qr,[u(be,{display:"Forums",direction:o(se).Down,yoffset:"5px"},{default:U(()=>[zr]),_:1},8,["direction"])])]),f("div",{onClick:v[1]||(v[1]=w=>{var C;return(C=t.value)==null?void 0:C.open()})},[u(be,{display:"Info",direction:o(se).Down,class:"info"},{default:U(()=>[jr]),_:1},8,["direction"])]),f("div",{onClick:v[2]||(v[2]=w=>{var C;return(C=n.value)==null?void 0:C.open()})},[u(be,{display:"Saves",direction:o(se).Down,xoffset:"-20px"},{default:U(()=>[Kr]),_:1},8,["direction"])]),f("div",{onClick:v[3]||(v[3]=w=>{var C;return(C=i.value)==null?void 0:C.open()})},[u(be,{display:"Options",direction:o(se).Down,xoffset:"-66px"},{default:U(()=>[Wr]),_:1},8,["direction"])])],16)):(y(),M("div",Gt({key:1,class:"overlay-nav"},b.$attrs),[f("div",{onClick:v[4]||(v[4]=w=>{var C;return(C=s.value)==null?void 0:C.open()}),class:"version-container"},[u(be,{display:"Changelog",direction:o(se).Right,xoffset:"25%",class:"version"},{default:U(()=>[f("span",null,"v"+W(o(g)),1)]),_:1},8,["direction"])]),f("div",{onClick:v[5]||(v[5]=w=>{var C;return(C=n.value)==null?void 0:C.open()})},[u(be,{display:"Saves",direction:o(se).Right},{default:U(()=>[Jr]),_:1},8,["direction"])]),f("div",{onClick:v[6]||(v[6]=w=>{var C;return(C=i.value)==null?void 0:C.open()})},[u(be,{display:"Options",direction:o(se).Right},{default:U(()=>[Xr]),_:1},8,["direction"])]),f("div",{onClick:v[7]||(v[7]=w=>{var C;return(C=t.value)==null?void 0:C.open()})},[u(be,{display:"Info",direction:o(se).Right},{default:U(()=>[Yr]),_:1},8,["direction"])]),f("div",null,[f("a",Zr,[u(be,{display:"Forums",direction:o(se).Right,xoffset:"7px"},{default:U(()=>[eu]),_:1},8,["direction"])])]),f("div",tu,[f("span",{onClick:_,class:"material-icons"},"discord"),f("ul",nu,[o(d)?(y(),M("li",iu,[f("a",{href:o(d),target:"_blank"},W(o(m)),9,su)])):B("",!0),au,lu])])],16)),u(Ho,{ref_key:"info",ref:t,changelog:s.value},null,8,["changelog"]),u(ts,{ref_key:"savesManager",ref:n},null,512),u(Ko,{ref_key:"options",ref:i},null,512),u(Mo,{ref_key:"changelog",ref:s},null,512)],64))}});var ns=ne(ou,[["__scopeId","data-v-4a3f8425"]]);const Yn=e=>(wt("data-v-b16e8c8e"),e=e(),kt(),e),ru={class:"inner-tab"},uu={key:1},cu=Yn(()=>f("br",null,null,-1)),du=h(" You can help continue the "),mu=Yn(()=>f("i",null,"advent",-1)),fu=h("ure at: "),pu=Yn(()=>f("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[f("span",{class:"material-icons info-modal-discord"},"discord"),h(" The Paper Pilot Community ")],-1)),hu=L({__name:"Game",setup(e){const t=ot(E,"tabs"),n=S(()=>Object.keys(Oe)),i=ee.useHeader,s=Bt(Q.loreBody);function l(r){const{display:c,minimized:m,minWidth:d,name:g,color:_,minimizable:b,nodes:v}=r;return{display:c,minimized:m,minWidth:d,name:g,color:_,minimizable:b,nodes:v}}return(r,c)=>(y(),M("div",{class:we(["tabs-container",{useHeader:o(i)}])},[(y(!0),M(F,null,hi(o(t),(m,d)=>{var g,_;return y(),M("div",{key:d,class:we(["tab",o((g=o(Oe)[m])==null?void 0:g.classes)]),ref_for:!0,ref:`tab-${d}`,style:Me(o((_=o(Oe)[m])==null?void 0:_.style))},[d===0&&!o(i)?(y(),G(ns,{key:0})):B("",!0),f("div",ru,[o(n).includes(m)?(y(),G(ko,Gt({key:0},l(o(Oe)[m]),{index:d,tab:()=>{var b;return(b=r.$refs[`tab-${d}`])==null?void 0:b[0]}}),null,16,["index","tab"])):(y(),G(ye(m),{key:1,index:d},null,8,["index"]))])],6)}),128)),u(rt,{modelValue:o(Q).showLoreModal.value,"onUpdate:modelValue":c[0]||(c[0]=m=>o(Q).showLoreModal.value=m)},{header:U(()=>[f("h2",null,W(o(Q).loreTitle.value),1)]),body:U(()=>[o(s)?(y(),G(ye(o(s)),{key:0})):B("",!0),o(Q).loreScene.value!==-1?(y(),M("div",uu,[u(bo,{day:o(Q).loreScene.value},null,8,["day"]),cu,du,mu,fu,pu])):B("",!0)]),_:1},8,["modelValue"])],2))}});var gu=ne(hu,[["__scopeId","data-v-b16e8c8e"]]);const pn=e=>(wt("data-v-4a50ce42"),e=e(),kt(),e),vu={class:"game-over-modal-header"},yu=["src","alt"],bu={class:"game-over-modal-title"},_u=pn(()=>f("h2",null,"Congratulations!",-1)),wu={key:0},ku=pn(()=>f("br",null,null,-1)),Cu=pn(()=>f("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Nu=pn(()=>f("br",null,null,-1)),Su=["href"],Mu=pn(()=>f("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Iu=L({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:s,versionNumber:l,versionTitle:r}=ee,c=S(()=>En(E.timePlayed)),m=S(()=>Jn.value&&!E.keepGoing),d=ot(E,"autosave");function g(){E.keepGoing=!0}function _(){qt(jt())}return(b,v)=>(y(),G(rt,{"model-value":o(m)},{header:U(()=>[f("div",vu,[o(n)?(y(),M("img",{key:0,class:"game-over-modal-logo",src:o(n),alt:o(t)},null,8,yu)):B("",!0),f("div",bu,[_u,f("h4",null,"You've beaten "+W(o(t))+" v"+W(o(l))+": "+W(o(r)),1)])])]),body:U(({shown:w})=>[w?(y(),M("div",wu,[f("div",null,"It took you "+W(o(c))+" to beat the game.",1),ku,Cu,Nu,f("div",null,[f("a",{href:o(s),class:"game-over-modal-discord-link"},[Mu,h(" "+W(o(i)),1)],8,Su)]),u(Vt,{title:"Autosave",modelValue:o(d),"onUpdate:modelValue":v[0]||(v[0]=C=>Fe(d)?d.value=C:null)},null,8,["modelValue"])])):B("",!0)]),footer:U(()=>[f("div",{class:"game-over-footer"},[f("button",{onClick:g,class:"button"},"Keep Going"),f("button",{onClick:_,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Au=ne(Iu,[["__scopeId","data-v-4a50ce42"]]);const Tn=e=>(wt("data-v-3de07c06"),e=e(),kt(),e),Eu=Tn(()=>f("div",{class:"nan-modal-header"},[f("h2",null,"NaN value detected!")],-1)),Bu={key:0},xu=Tn(()=>f("br",null,null,-1)),Pu=["href"],Fu=Tn(()=>f("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Tu=Tn(()=>f("br",null,null,-1)),Ru={class:"nan-footer"},$u=L({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ee,i=ot(E,"autosave"),s=ot(le,"hasNaN"),l=q(null),r=S(()=>{var v;return(v=le.NaNPath)==null?void 0:v.join(".")}),c=S(()=>{var v;return(v=le.NaNPath)==null?void 0:v.slice(-1)[0]}),m=S(()=>le.NaNReceiver&&c.value?le.NaNReceiver[c.value]:null),d=S({get(){return E.devSpeed===0},set(v){E.devSpeed=v?null:0}});function g(){le.NaNReceiver&&c.value&&(le.NaNReceiver[c.value]=new a(0),le.hasNaN=!1)}function _(){le.NaNReceiver&&c.value&&(le.NaNReceiver[c.value]=new a(1),le.hasNaN=!1)}function b(){le.NaNReceiver&&c.value&&(le.NaNReceiver[c.value]=new a(NaN),le.hasNaN=!1)}return(v,w)=>(y(),M(F,null,[u(rt,Gt({modelValue:o(s),"onUpdate:modelValue":w[4]||(w[4]=C=>Fe(s)?s.value=C:null)},v.$attrs),{header:U(()=>[Eu]),body:U(()=>[f("div",null,[h(' Attempted to assign "'+W(o(r))+'" to NaN',1),o(m)?(y(),M("span",Bu,W(" ")+"(previously "+W(o(te)(o(m)))+")",1)):B("",!0),h(". Auto-saving has been "+W(o(i)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),xu,f("div",null,[f("a",{href:o(n),class:"nan-modal-discord-link"},[Fu,h(" "+W(o(t)),1)],8,Pu)]),Tu,u(Vt,{title:"Autosave",modelValue:o(i),"onUpdate:modelValue":w[0]||(w[0]=C=>Fe(i)?i.value=C:null)},null,8,["modelValue"]),o(ee).enablePausing?(y(),G(Vt,{key:0,title:"Pause game",modelValue:o(d),"onUpdate:modelValue":w[1]||(w[1]=C=>Fe(d)?d.value=C:null)},null,8,["modelValue"])):B("",!0)]),footer:U(()=>[f("div",Ru,[f("button",{onClick:w[2]||(w[2]=C=>{var P;return(P=l.value)==null?void 0:P.open()}),class:"button"},"Open Saves Manager"),f("button",{onClick:g,class:"button"},"Set to 0"),f("button",{onClick:_,class:"button"},"Set to 1"),o(m)&&o(a).neq(o(m),0)&&o(a).neq(o(m),1)?(y(),M("button",{key:0,onClick:w[3]||(w[3]=C=>s.value=!1),class:"button"}," Set to previous ")):B("",!0),f("button",{onClick:b,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),u(ts,{ref_key:"savesManager",ref:l},null,512)],64))}});var Du=ne($u,[["__scopeId","data-v-3de07c06"]]);const Ou={key:0,class:"tpsDisplay"},qu={key:0,class:"low"},Uu=L({__name:"TPS",setup(e){const t=S(()=>a.div(le.lastTenTicks.length,le.lastTenTicks.reduce((l,r)=>l+r,0))),n=q([]);Je(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=S(()=>n.value.reduce((l,r)=>a.max(l,r),0)),s=S(()=>a.sub(t.value,i.value).gt(1));return(l,r)=>o(t).isNan()?B("",!0):(y(),M("div",Ou,[h(" TPS: "+W(o(K)(o(t)))+" ",1),u(An,{name:"fade"},{default:U(()=>[o(s)?(y(),M("span",qu,W(o(K)(o(i))),1)):B("",!0)]),_:1})]))}});var Vu=ne(Uu,[["__scopeId","data-v-46a3ed5b"]]);var Lu=L({__name:"App",setup(e){const t=ee.useHeader,n=S(()=>dn[ue.theme].variables),i=ot(ue,"showTPS"),s=S(()=>Z(R(()=>u(F,null,[Sa.map(me)]))));return(l,r)=>(y(),M(F,null,[f("div",{id:"modal-root",style:Me(o(n))},null,4),f("div",{class:we(["app",{useHeader:o(t)}]),style:Me(o(n))},[o(t)?(y(),G(ns,{key:0})):B("",!0),u(gu),o(o(i))?(y(),G(Vu,{key:1})):B("",!0),u(Au),u(Du),(y(),G(ye(o(s))))],6)],64))}});var Gu=ne(Lu,[["__scopeId","data-v-7c41425b"]]);function Hu(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:s,onRegisterError:l}=e;let r,c;const m=async(d=!0)=>{d&&(r==null||r.addEventListener("controlling",g=>{g.isUpdate&&window.location.reload()})),c&&c.waiting&&await ws(c.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){r=new _s("./sw.js",{scope:"./",type:"classic"}),r.addEventListener("activated",d=>{d.isUpdate||i==null||i()});{const d=()=>{n==null||n()};r.addEventListener("waiting",d),r.addEventListener("externalwaiting",d)}r.register({immediate:t}).then(d=>{c=d,s==null||s(d)}).catch(d=>{l==null||l(d)})}return m}function Qu(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:s,onRegisterError:l}=e,r=q(!1),c=q(!1);return{updateServiceWorker:Hu({immediate:t,onNeedRefresh(){r.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:s,onRegisterError:l}),offlineReady:c,needRefresh:r}}document.title=ee.title;window.projInfo=ee;if(ee.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 _a();const{globalBus:e,startGameLoop:t}=await _n(()=>Promise.resolve().then(function(){return ba}),void 0),n=window.vue=ps(Gu);e.emit("setupVue",n),n.mount("#app"),Lt(()=>{const i=vi(),{updateServiceWorker:s}=Qu({onNeedRefresh(){i.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){s()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(l){l&&setInterval(l.update,60*60*1e3)}})}),t()});