pages/advent/assets/index.be6d27b7.js

15 lines
144 KiB
JavaScript

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