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