/* empty css */import"./vue.92681fcb.js";import{Z as P,u as Kt,q as ft,C as a,b1 as ge,aa as V,aE as g,a0 as k,a1 as d,aK as Me,G as ee,t as O,aC as _n,w as pe,b2 as $e,a8 as h,O as H,ao as es,I as te,ay as $t,ar as We,aG as gt,A as se,_ as q,b6 as x,b8 as Yt,bs as ts,aq as ze,bu as ut,bb as Ct,T as ns,a7 as C,j as ss,l as X,bv as dn,z as ke,J as A,aN as ie,$ as I,aH as Pe,aF as Te,al as bt,aL as He,H as is,aJ as bn,bn as rs,br as as,be as os}from"./@vue.4ce677c2.js";import{i as ls}from"./is-plain-object.906d88e8.js";import{c as Nn}from"./nanoevents.1080beb7.js";import{L as Le}from"./lz-string.731cedc5.js";import{Y as us}from"./vue-next-select.a2bfab1d.js";import{D as cs}from"./vuedraggable.7949458c.js";import{p as ds}from"./vue-textarea-autosize.35804eaf.js";import{s as fs,u as ms}from"./vue-toastification.6f567382.js";import{v as hs,n as ps}from"./workbox-window.8d14e8b7.js";import"./sortablejs.29100d8a.js";const gs=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerpolicy&&(r.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?r.credentials="include":i.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}};gs();const vs="modulepreload",fn={},ys="./",Nt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(s=>{if(s=`${ys}${s}`,s in fn)return;fn[s]=!0;const i=s.endsWith(".css"),r=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${r}`))return;const l=document.createElement("link");if(l.rel=i?"stylesheet":vs,i||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),i)return new Promise((o,c)=>{l.addEventListener("load",o),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())},_s="./projInfo-schema.json",bs="Advent Incremental",Ns="An incremental game you play a day at a time, leading up to Christmas!",ws="advent-incremental",ks="thepaperpilot",Ss="",Ms="",$s="0.1",Cs="Initial Commit",Ps=!0,Ts=!1,Is=2,Fs=!0,Os=null,xs="",Es=["main"],Ds=3600,Vs=1,Ls=!0,As="base64";var B={$schema:_s,title:bs,description:Ns,id:ws,author:ks,discordName:Ss,discordLink:Ms,versionNumber:$s,versionTitle:Cs,allowGoBack:Ps,defaultShowSmall:Ts,defaultDecimalsShown:Is,useHeader:Fs,banner:Os,logo:xs,initialTabs:Es,maxTickLength:Ds,offlineLimit:Vs,enablePausing:Ls,exportEncoding:As};const Bt=17,qs=9e15,Bs=Math.log10(9e15),Rs=1/9e15,Us=308,js=-324,mn=5,Gs=function(){const e=[];for(let n=js+1;n<=Us;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Re=[2,Math.E,3,4,5,6,7,8,9,10],Ws=[[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]],zs=[[-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]],f=function(t){return m.fromValue_noAlloc(t)},E=function(e,t,n){return m.fromComponents(e,t,n)},L=function(t,n,s){return m.fromComponents_noNormalize(t,n,s)},xe=function(t,n){const s=n+1,i=Math.ceil(Math.log10(Math.abs(t))),r=Math.round(t*Math.pow(10,s-i))*Math.pow(10,i-s);return parseFloat(r.toFixed(Math.max(s-i,0)))},Rt=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Hs=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 s=e*e;let i=e;return n=n+1/(12*i),i=i*s,n=n+1/(360*i),i=i*s,n=n+1/(1260*i),i=i*s,n=n+1/(1680*i),i=i*s,n=n+1/(1188*i),i=i*s,n=n+691/(360360*i),i=i*s,n=n+7/(1092*i),i=i*s,n=n+3617/(122400*i),Math.exp(n)/t},wn=.5671432904097838,hn=function(e,t=1e-10){let n,s;if(!Number.isFinite(e)||e===0)return e;if(e===1)return wn;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(s=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(s-n).5?1:-1;if(Math.random()*20<1)return L(t,0,1);const n=Math.floor(Math.random()*(e+1));let s=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(s=Math.trunc(s));let i=Math.pow(10,s);return Math.random()>.9&&(i=Math.trunc(i)),E(t,n,i)}static affordGeometricSeries_core(e,t,n,s){const i=t.mul(n.pow(s));return _.floor(e.div(i).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,s){return t.mul(n.pow(s)).mul(_.sub(1,n.pow(e))).div(_.sub(1,n))}static affordArithmeticSeries_core(e,t,n,s){const r=t.add(s.mul(n)).sub(n.div(2)),l=r.pow(2);return r.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,s){const i=t.add(s.mul(n));return e.div(2).mul(i.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=qs)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){e=e.replace(",","");const t=e.split("^^^");if(t.length===2){const y=parseFloat(t[0]),b=parseFloat(t[1]),N=t[1].split(";");let w=1;if(N.length===2&&(w=parseFloat(N[1]),isFinite(w)||(w=1)),isFinite(y)&&isFinite(b)){const F=_.pentate(y,b,w);return this.sign=F.sign,this.layer=F.layer,this.mag=F.mag,this}}const n=e.split("^^");if(n.length===2){const y=parseFloat(n[0]),b=parseFloat(n[1]),N=n[1].split(";");let w=1;if(N.length===2&&(w=parseFloat(N[1]),isFinite(w)||(w=1)),isFinite(y)&&isFinite(b)){const F=_.tetrate(y,b,w);return this.sign=F.sign,this.layer=F.layer,this.mag=F.mag,this}}const s=e.split("^");if(s.length===2){const y=parseFloat(s[0]),b=parseFloat(s[1]);if(isFinite(y)&&isFinite(b)){const N=_.pow(y,b);return this.sign=N.sign,this.layer=N.layer,this.mag=N.mag,this}}e=e.trim().toLowerCase();let i,r,l=e.split("pt");if(l.length===2){i=10,r=parseFloat(l[0]),l[1]=l[1].replace("(",""),l[1]=l[1].replace(")","");let y=parseFloat(l[1]);if(isFinite(y)||(y=1),isFinite(i)&&isFinite(r)){const b=_.tetrate(i,r,y);return this.sign=b.sign,this.layer=b.layer,this.mag=b.mag,this}}if(l=e.split("p"),l.length===2){i=10,r=parseFloat(l[0]),l[1]=l[1].replace("(",""),l[1]=l[1].replace(")","");let y=parseFloat(l[1]);if(isFinite(y)||(y=1),isFinite(i)&&isFinite(r)){const b=_.tetrate(i,r,y);return this.sign=b.sign,this.layer=b.layer,this.mag=b.mag,this}}const o=e.split("e"),c=o.length-1;if(c===0){const y=parseFloat(e);if(isFinite(y))return this.fromNumber(y)}else if(c===1){const y=parseFloat(e);if(isFinite(y)&&y!==0)return this.fromNumber(y)}const u=e.split("e^");if(u.length===2){this.sign=1,u[0].charAt(0)=="-"&&(this.sign=-1);let y="";for(let b=0;b=43&&N<=57||N===101)y+=u[1].charAt(b);else return this.layer=parseFloat(y),this.mag=parseFloat(u[1].substr(b+1)),this.normalize(),this}}if(c<1)return this.sign=0,this.layer=0,this.mag=0,this;const p=parseFloat(o[0]);if(p===0)return this.sign=0,this.layer=0,this.mag=0,this;let v=parseFloat(o[o.length-1]);if(c>=2){const y=parseFloat(o[o.length-2]);isFinite(y)&&(v*=Math.sign(y),v+=Rt(y))}if(!isFinite(p))this.sign=o[0]==="-"?-1:1,this.layer=c,this.mag=v;else if(c===1)this.sign=Math.sign(p),this.layer=1,this.mag=v+Math.log10(Math.abs(p));else if(this.sign=Math.sign(p),this.layer=c,c===2){const y=_.mul(E(1,2,v),f(p));return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,this}else this.mag=v;return this.normalize(),this}fromValue(e){return e instanceof _||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:xe(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:xe(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<=mn?(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):xe(this.m,e)+"e"+xe(this.e,e):this.layer===1?xe(this.m,e)+"e"+xe(this.e,e):this.layer<=mn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+xe(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+xe(this.mag,e)}abs(){return L(this.sign===0?0:1,this.layer,this.mag)}neg(){return L(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?_.dZero:this.layer===0?E(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=f(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 L(0,0,0);let n,s;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(_.cmpabs(this,t)>0?(n=this,s=t):(n=t,s=this),n.layer===0&&s.layer===0)return f(n.sign*n.mag+s.sign*s.mag);const i=n.layer*Math.sign(n.mag),r=s.layer*Math.sign(s.mag);if(i-r>=2)return n;if(i===0&&r===-1){if(Math.abs(s.mag-Math.log10(n.mag))>Bt)return n;{const l=Math.pow(10,Math.log10(n.mag)-s.mag),o=s.sign+n.sign*l;return E(Math.sign(o),1,s.mag+Math.log10(Math.abs(o)))}}if(i===1&&r===0){if(Math.abs(n.mag-Math.log10(s.mag))>Bt)return n;{const l=Math.pow(10,n.mag-Math.log10(s.mag)),o=s.sign+n.sign*l;return E(Math.sign(o),1,Math.log10(s.mag)+Math.log10(Math.abs(o)))}}if(Math.abs(n.mag-s.mag)>Bt)return n;{const l=Math.pow(10,n.mag-s.mag),o=s.sign+n.sign*l;return E(Math.sign(o),1,s.mag+Math.log10(Math.abs(o)))}}plus(e){return this.add(e)}sub(e){return this.add(f(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=f(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return L(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return L(this.sign*t.sign,0,1);let n,s;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,s=t):(n=t,s=this),n.layer===0&&s.layer===0)return f(n.sign*s.sign*n.mag*s.mag);if(n.layer>=3||n.layer-s.layer>=2)return E(n.sign*s.sign,n.layer,n.mag);if(n.layer===1&&s.layer===0)return E(n.sign*s.sign,1,n.mag+Math.log10(s.mag));if(n.layer===1&&s.layer===1)return E(n.sign*s.sign,1,n.mag+s.mag);if(n.layer===2&&s.layer===1){const i=E(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(E(Math.sign(s.mag),s.layer-1,Math.abs(s.mag)));return E(n.sign*s.sign,i.layer+1,i.sign*i.mag)}if(n.layer===2&&s.layer===2){const i=E(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(E(Math.sign(s.mag),s.layer-1,Math.abs(s.mag)));return E(n.sign*s.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=f(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?_.dNaN:this.layer===0?E(this.sign,0,1/this.mag):E(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=f(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,s=t.mag>0?t.layer:-t.layer;return n>s?1:nt.mag?1:this.mag0?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=f(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=f(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let s=this.mag,i=n.mag;return this.layer>n.layer&&(i=Rt(i)),this.layer0?E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):E(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?_.dNaN:this.layer>0?E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):E(this.sign,0,Math.log10(this.mag))}log(e){return e=f(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?_.dNaN:this.layer===0&&e.layer===0?E(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):_.div(this.log10(),e.log10())}log2(){return this.sign<=0?_.dNaN:this.layer===0?E(this.sign,0,Math.log2(this.mag)):this.layer===1?E(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?E(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?_.dNaN:this.layer===0?E(this.sign,0,Math.log(this.mag)):this.layer===1?E(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?E(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):E(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=f(e),n=this,s=t;if(n.sign===0)return s.eq(0)?L(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(s.sign===0)return L(1,0,1);if(s.sign===1&&s.layer===0&&s.mag===1)return n;const i=n.absLog10().mul(s).pow10();return this.sign===-1?Math.abs(s.toNumber()%2)%2===1?i.neg():Math.abs(s.toNumber()%2)%2===0?i:_.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return _.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return E(1,0,t);if(e.sign===0)return _.dOne;e=L(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?E(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?E(-e.sign,e.layer+1,-e.mag):_.dOne}pow_base(e){return f(e).pow(this)}root(e){const t=f(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(L(1,0,24)))return f(Hs(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 s=e,i=12*s,r=1/i,l=t+r;if(l===t||(t=l,s=s*n,i=360*s,r=1/i,l=t-r,l===t))return _.exp(t);t=l,s=s*n,i=1260*s;let o=1/i;return t=t+o,s=s*n,i=1680*s,o=1/i,t=t-o,_.exp(t)}else return this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?_.dOne:this.layer===0&&this.mag<=709.7?f(Math.exp(this.sign*this.mag)):this.layer===0?E(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?E(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):E(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return f(Math.sqrt(this.sign*this.mag));if(this.layer===1)return E(1,2,Math.log10(this.mag)-.3010299956639812);{const e=_.div(L(this.sign,this.layer-1,this.mag),L(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=L(1,0,1)){if(e===1)return _.pow(this,t);if(e===0)return new _(t);if(this.eq(_.dOne))return _.dOne;if(this.eq(-1))return _.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return new _(Math.E);const r=_.ln(this).neg();return r.lambertw().div(r)}else return i>1.444667861009766?new _(Number.POSITIVE_INFINITY):_.dNaN}if(this.eq(_.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),new _(i)}if(e<0)return _.iteratedlog(t,this,-e);t=f(t);const n=e;e=Math.trunc(e);const s=n-e;if(this.gt(_.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i3)return L(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=L(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return _.tetrate(e,-t,this);e=f(e);let n=f(this);const s=t;t=Math.trunc(t);const i=s-t;if(n.layer-e.layer>3){const r=Math.min(t,n.layer-e.layer-3);t-=r,n.layer-=r}for(let r=0;r1e4)return n}return i>0&&i<1&&(e.eq(10)?n=n.layeradd10(-i):n=n.layeradd(-i,e)),n}slog(e=10){if(e=f(e),e.lte(_.dZero)||e.eq(_.dOne))return _.dNaN;if(e.lt(_.dOne))return this.eq(_.dOne)?_.dZero:this.eq(_.dZero)?_.dNegOne:_.dNaN;if(this.mag<0||this.eq(_.dZero))return _.dNegOne;let t=0,n=f(this);if(n.layer-e.layer>3){const s=n.layer-e.layer-3;t+=s,n.layer-=s}for(let s=0;s<100;++s)if(n.lt(_.dZero))n=_.pow(e,n),t-=1;else{if(n.lte(_.dOne))return f(t+_.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=_.log(n,e)}return f(t)}static slog_critical(e,t){return e>10?t-1:_.critical_section(e,t,zs)}static tetrate_critical(e,t){return _.critical_section(e,t,Ws)}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 s=0,i=0;for(let o=0;oe){const c=(e-Re[o])/(Re[o+1]-Re[o]);s=n[o][Math.floor(t)]*(1-c)+n[o+1][Math.floor(t)]*c,i=n[o][Math.ceil(t)]*(1-c)+n[o+1][Math.ceil(t)]*c;break}const r=t-Math.floor(t);return s*(1-r)+i*r}layeradd10(e){e=_.fromValue_noAlloc(e).toNumber();const t=f(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 s=0;s<100;++s){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 s=this.slog(t).toNumber()+e;return s>=0?_.tetrate(t,s):Number.isFinite(s)?s>=-1?_.log(_.tetrate(t,s+1),t):_.log(_.log(_.tetrate(t,s+2),t),t):_.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return f(hn(this.toNumber()));if(this.layer===0)return f(hn(this.sign*this.mag));if(this.layer===1)return pn(this);if(this.layer===2)return pn(this);if(this.layer>=3)return L(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return L(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=L(1,0,1)){t=f(t);const n=e;e=Math.trunc(e);const s=n-e;s!==0&&(t.eq(_.dOne)?(++e,t=new _(s)):this.eq(10)?t=t.layeradd10(s):t=t.layeradd(s,this));for(let i=0;i10)return t}return t}sin(){return this.mag<0?this:this.layer===0?f(Math.sin(this.sign*this.mag)):L(0,0,0)}cos(){return this.mag<0?_.dOne:this.layer===0?f(Math.cos(this.sign*this.mag)):L(0,0,0)}tan(){return this.mag<0?this:this.layer===0?f(Math.tan(this.sign*this.mag)):L(0,0,0)}asin(){return this.mag<0?this:this.layer===0?f(Math.asin(this.sign*this.mag)):L(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?f(Math.acos(this.toNumber())):this.layer===0?f(Math.acos(this.sign*this.mag)):L(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?f(Math.atan(this.sign*this.mag)):f(Math.atan(this.sign*(1/0)))}sinh(){return this.exp().sub(this.negate().exp()).div(2)}cosh(){return this.exp().add(this.negate().exp()).div(2)}tanh(){return this.sinh().div(this.cosh())}asinh(){return _.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return _.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?L(Number.NaN,Number.NaN,Number.NaN):_.ln(this.add(1).div(f(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(_.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let m=_;m.dZero=L(0,0,0);m.dOne=L(1,0,1);m.dNegOne=L(-1,0,1);m.dTwo=L(1,0,2);m.dTen=L(1,0,10);m.dNaN=L(Number.NaN,Number.NaN,Number.NaN);m.dInf=L(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);m.dNegInf=L(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);m.dNumberMax=E(1,0,Number.MAX_VALUE);m.dNumberMin=E(1,0,Number.MIN_VALUE);const Ks=new m(1);function at(e,t,n=!0){let s=m.log10(e).floor(),i=m.div(e,m.pow(10,s));i.toStringWithDecimalPlaces(t)==="10"&&(i=Ks,s=s.add(1));const r=s.gte(1e9)?ce(s,Math.max(Math.max(t,3),B.defaultDecimalsShown)):s.gte(1e4)?wt(s,0):s.toStringWithDecimalPlaces(0);return n?i.toStringWithDecimalPlaces(t)+"e"+r:"e"+r}function wt(e,t){if(e==null)return"NaN";if(e=new m(e),e.mag<.001)return 0 .toFixed(t);const s=e.toStringWithDecimalPlaces(t).split(".");return s[0]=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),s.length==1?s[0]:s[0]+"."+s[1]}function kn(e,t){return e==null?"NaN":(e=new m(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),B.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ys=new m("eeee1000"),Zs=new m("e100000"),gn=new m("e1000"),Sn=new m(1e9),Js=new m(1e6),Xs=new m(1e3),Qs=new m(.98),ei=new m(.001),Mn=new m(0);function ce(e,t,n){if(t==null&&(t=B.defaultDecimalsShown),n=n!=null?n:B.defaultShowSmall,e=new m(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ce(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ys)){const s=e.slog();return s.gte(Js)?"F"+ce(s.floor()):m.pow(10,s.sub(s.floor())).toStringWithDecimalPlaces(3)+"F"+wt(s.floor(),0)}else{if(e.gte(Zs))return at(e,0,!1);if(e.gte(gn))return at(e,0);if(e.gte(Sn))return at(e,t);if(e.gte(Xs))return wt(e,0);if(e.gte(ei)||!n)return kn(e,t);if(e.eq(Mn))return 0 .toFixed(t)}return e=Cn(e),e.lt(gn)?at(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ce(e,t)+"\u207B\xB9"}function ue(e){return e=new m(e),e.sign<0?"-"+ue(e.neg()):e.gte(Sn)||e.lte(Qs)&&!e.eq(Mn)?ce(e):ce(e,0)}function $n(e){return m.lt(e,0)?"-"+$n(m.neg(e)):m.gt(e,2**51)?ce(m.div(e,31536e3))+"y":(e=new m(e).toNumber(),e<60?ce(e)+"s":e<3600?ue(Math.floor(e/60))+"m "+ce(e%60)+"s":e<86400?ue(Math.floor(e/3600))+"h "+ue(Math.floor(e/60)%60)+"m "+ue(e%60)+"s":e<31536e3?ue(Math.floor(e/84600)%365)+"d "+ue(Math.floor(e/3600)%24)+"h "+ue(Math.floor(e/60)%60)+"m":ue(Math.floor(e/31536e3))+"y "+ue(Math.floor(e/84600)%365)+"d "+ue(Math.floor(e/3600)%24)+"h")}function ti(e,t,n){e=new m(e);let s=e.toStringWithDecimalPlaces(t);return new m(s).gte(n)&&(s=m.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),s}function ni(e,t){return ce(e,t,!0)}function Cn(e){let t=m.log10(e).ceil();const n=m.div(e,m.pow(10,t));return t=t.neg(),e=new m(10).pow(t).times(n),e}var si=Object.freeze(Object.defineProperty({__proto__:null,default:m,exponentialFormat:at,commaFormat:wt,regularFormat:kn,format:ce,formatWhole:ue,formatTime:$n,toPlaces:ti,formatSmall:ni,invertOOM:Cn},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:ii,commaFormat:ri,regularFormat:ai,format:re,formatWhole:qe,formatTime:Pt,toPlaces:oi,formatSmall:li,invertOOM:ui}=si;window.Decimal=m;window.exponentialFormat=ii;window.commaFormat=ri;window.regularFormat=ai;window.format=re;window.formatWhole=qe;window.formatTime=Pt;window.toPlaces=oi;window.formatSmall=li;window.invertOOM=ui;function ci(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function zt(e){return typeof e=="function"}var U=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(U||{});const ct=Symbol("DoNotCache");function D(e,t){const n=e[t];zt(n)&&n.length===0&&!n[ct]?e[t]=P(n.bind(e)):zt(n)&&(e[t]=n.bind(e),e[t][ct]=!0)}function Ne(e){return zt(e)&&!e[ct]&&(e=P(e)),e}const Ke=Symbol("Component"),Ye=Symbol("GatherProps");let di=0;function Tt(e="feature-"){return e+di++}var ve=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ve||{});function z(e){return e[ct]=!0,e}function Ee(e,t=2){return e?0:t}function we(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}const Ue={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 Zt=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Zt||{}),It={classic:Ue,paper:{...Ue,variables:{...Ue.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:{...Ue,variables:{...Ue.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:{...Ue,variables:{...Ue.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const K=Symbol("ProxyState"),et=Symbol("ProxyPath");function Ie(e,t={}){const n=t;let s=!1;function i(){return s||(Object.assign(n,e(n)),s=!0),n}return new Proxy(n,{get(r,l){return l===K?i():i()[l]},set(r,l,o){return i()[l]=o,!0},has(r,l){return l===K?!0:Reflect.has(i(),l)},ownKeys(){return Reflect.ownKeys(i())},getOwnPropertyDescriptor(r,l){return s||(Object.assign(n,e(n)),s=!0),Object.getOwnPropertyDescriptor(r,l)}})}var G=window.state=Kt({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Pn=ft({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});function Tn(e){return JSON.stringify(e,(t,n)=>a(n))}const In={get(e,t){var s;if(t===K||t===et)return e[t];const n=e[K][t];if(t!=="value"&&(ls(n)||Array.isArray(n))){if(n!==((s=e[t])==null?void 0:s[K])){const i=[...e[et],t];e[t]=new Proxy({[K]:n,[et]:i},In)}return e[t]}return n},set(e,t,n,s){if(!G.hasNaN&&(typeof n=="number"&&isNaN(n)||n instanceof m&&(isNaN(n.sign)||isNaN(n.layer)||isNaN(n.mag)))){const i=e[K][t];if(!(typeof i=="number"&&isNaN(i)||i instanceof m&&(isNaN(i.sign)||isNaN(i.layer)||isNaN(i.mag))))throw Pn.autosave=!1,G.hasNaN=!0,G.NaNPath=[...e[et],t],G.NaNReceiver=s,console.error("Attempted to set NaN value",[...e[et],t],e[K]),"Attempted to set NaN value. See above for details"}return e[K][t]=n,!0},ownKeys(e){return Reflect.ownKeys(e[K])},has(e,t){return Reflect.has(e[K],t)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e[K],t)}};var M=window.player=new Proxy({[K]:Pn,[et]:["player"]},In);const ae=Nn();let tt=null,lt=null;function kt(){const e=Date.now();let t=(e-M.time)/1e3;M.time=e;const n=t;if(G.lastTenTicks.push(n),G.lastTenTicks.length>10&&(G.lastTenTicks=G.lastTenTicks.slice(1)),!((lt==null?void 0:lt.value)&&!M.keepGoing)&&!G.hasNaN&&(t=Math.max(t,0),M.devSpeed!==0)){if(M.offlineTime!=null){if(m.gt(M.offlineTime,B.offlineLimit*3600)&&(M.offlineTime=B.offlineLimit*3600),m.gt(M.offlineTime,0)&&M.devSpeed!==0){const s=Math.max(M.offlineTime/10,t);M.offlineTime=M.offlineTime-s,t+=s}else M.devSpeed===0&&(M.offlineTime+=t);(!M.offlineProd||m.lt(M.offlineTime,0))&&(M.offlineTime=null)}t=Math.min(t,B.maxTickLength),M.devSpeed!=null&&(t*=M.devSpeed),Number.isFinite(t)||(t=1e308),!m.eq(t,0)&&(M.timePlayed+=t,Number.isFinite(M.timePlayed)||(M.timePlayed=1e308),ae.emit("update",t,n),Z.unthrottled?(requestAnimationFrame(kt),tt!=null&&(clearInterval(tt),tt=null)):tt==null&&(tt=setInterval(kt,50)))}}async function fi(){lt=(await Nt(()=>Promise.resolve().then(function(){return Bn}),void 0)).hasWon,ge(lt,e=>{e&&ae.emit("gameWon")}),Z.unthrottled?requestAnimationFrame(kt):tt=setInterval(kt,50)}document.fonts.onloadingdone=()=>ae.emit("fontsLoaded");var mi=Object.freeze(Object.defineProperty({__proto__:null,globalBus:ae,startGameLoop:fi},Symbol.toStringTag,{value:"Module"}));function Fn(e={}){return Object.assign({id:`${B.id}-0`,name:"Default Save",tabs:B.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:B.id,modVersion:B.versionNumber,layers:{}},e)}function me(e){const t=Le.compressToUTF16(Tn(e!=null?e:M[K]));return localStorage.setItem((e!=null?e:M[K]).id,t),t}async function hi(){gi();try{let e=localStorage.getItem(Z.active);if(e==null){await Ge(nt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Le.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==B.id){await Ge(nt());return}t.id=Z.active,await Ge(t)}catch(e){console.error(`Failed to load save. Falling back to new save. `,e),await Ge(nt())}}function nt(){const e=yt(),t=Fn({id:e});return me(t),Z.saves.push(e),t}function yt(){let e,t=0;do e=`${B.id}-${t++}`;while(localStorage.getItem(e));return e}async function Ge(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:s}=await Nt(()=>Promise.resolve().then(function(){return Ai}),void 0),{fixOldSave:i,getInitialLayers:r}=await Nt(()=>Promise.resolve().then(function(){return Bn}),void 0);for(const l in t){const o=t[l];o&&n(o)}r(e).forEach(l=>s(l,e)),e=Fn(e),e.offlineProd&&e.time&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=(Date.now()-e.time)/1e3),e.time=Date.now(),e.modVersion!==B.versionNumber&&i(e.modVersion,e),Object.assign(M,e),Z.active=M.id,ae.emit("onLoad")}setInterval(()=>{M.autosave&&me()},1e3);window.onbeforeunload=()=>{M.autosave&&me()};window.save=me;const pi=window.hardReset=async()=>{await Ge(nt())},dt=ft({active:"",saves:[],showTPS:!0,theme:Zt.Nordic,unthrottled:!1});ge(dt,e=>{const t=Le.compressToUTF16(JSON.stringify(e));localStorage.setItem(B.id,t)},{deep:!0});var Z=window.settings=dt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Zt.Nordic};ae.emit("loadSettings",e),Object.assign(dt,e),pi()};function gi(){try{let e=localStorage.getItem(B.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Le.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(dt,t)}ae.emit("loadSettings",dt)}catch{}}const vi=ft([]),yi=ft([]),_i=ft([]),bi={class:"table"},Ni=V({__name:"Row",setup(e){const t=P(()=>It[Z.theme].mergeAdjacent);return(n,s)=>(g(),k("div",bi,[d("div",{class:ee(["row",{mergeAdjacent:a(t)}])},[Me(n.$slots,"default")],2)]))}});function wi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!es(e)}function W(e,t="span"){return typeof e=="function"?V({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),V({template:e})):V({render:()=>({})}):e}function Ae(e){if(it(e))return typeof e=="function"?e():W(e);const t=e[Ke];return h(t,e[Ye](),null)}function ot(...e){let t;return h(Ni,null,wi(t=e.map(Ae))?t:{default:()=>[t]})}function Ce(e){if(it(e))return typeof e=="function"?e():typeof e=="string"?h(H,null,[e]):h(e,null,null);const t=e[Ke];return h(t,e[Ye](),null)}function it(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[ct]===!0}function On(e,t,n){const s=O(null),i=O(void 0);function r(c){s.value||(s.value=setInterval(o,250)),i.value=c,n&&(n.value=!0)}function l(){s.value&&(clearInterval(s.value),s.value=null),n&&(n.value=!1)}function o(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return _n(l),{start:r,stop:l,handleHolding:o}}function Jt(e,t="div"){const n=pe();return $e(()=>{n.value=W(Q(e),t)}),n}function rt(e,t="div"){const n=pe(null);return $e(()=>{const s=Q(e);n.value=s==null?null:W(s,t)}),n}function ki(e){return P(()=>Q(e))}function Q(e){return a(a(e))}function T(...e){return e.includes(Object)||e.push(Object),e}const _t=V({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(g(),k("div",{style:te({width:e.width,height:e.height})},null,4))}});var j=(e,t)=>{const n=e.__vccOpts||e;for(const[s,i]of t)n[s]=i;return n};const Si=V({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var p;const n=O({}),s=new ResizeObserver(o),i=O(null);$t(()=>{const v=i.value;v!=null&&s.observe(v)});let r=!0,l=O((p=i.value)==null?void 0:p.getBoundingClientRect());function o(){r&&(r=!1,We(()=>{var v;l.value=(v=i.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),r=!0}))}ae.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};gt(Xt,(v,y)=>{const b=new MutationObserver(()=>u(v));b.observe(y,c),n.value[v]={element:y,observer:b,rect:y.getBoundingClientRect()},o()}),gt(Qt,v=>{var y;(y=n.value[v])==null||y.observer.disconnect(),n.value[v]=void 0,o()}),gt(en,n),gt(tn,l);function u(v){const y=n.value[v];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(v,y)=>(g(),k(H,null,[Me(v.$slots,"default",{},void 0,!0),d("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var xn=j(Si,[["__scopeId","data-v-2b1dc1bc"]]);const Mi=["onPointerdown"],$i={class:"modal-wrapper"},Ci={class:"modal-container"},Pi={class:"modal-header"},Ti=C(" default header "),Ii={class:"modal-body"},Fi=C(" default body "),Oi={class:"modal-footer"},xi=d("div",{class:"modal-default-flex-grow"},null,-1),Fe=V({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=se(e),r=P(()=>i.modelValue||o.value);function l(){n("update:modelValue",!1)}const o=O(!1),c=O(null),u=P(()=>{var p,v;return(v=(p=c.value)==null?void 0:p.nodes)!=null?v:null});return t({isOpen:r,nodes:u}),(p,v)=>(g(),q(ns,{to:"#modal-root"},[h(Ct,{name:"modal",onBeforeEnter:v[0]||(v[0]=y=>o.value=!0),onAfterLeave:v[1]||(v[1]=y=>o.value=!1)},{default:x(()=>[Yt(d("div",ze({class:"modal-mask",onPointerdown:ut(l,["self"])},p.$attrs),[d("div",$i,[d("div",Ci,[d("div",Pi,[Me(p.$slots,"header",{shown:a(r)},()=>[Ti])]),d("div",Ii,[h(xn,{ref_key:"contextRef",ref:c},{default:x(()=>[Me(p.$slots,"body",{shown:a(r)},()=>[Fi])]),_:3},512)]),d("div",Oi,[Me(p.$slots,"footer",{shown:a(r)},()=>[d("div",{class:"modal-default-footer"},[xi,d("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,Mi),[[ts,e.modelValue]])]),_:3})]))}}),Ht=Symbol("PersistentState"),St=Symbol("DefaultValue"),Mt=Symbol("StackTrace"),En=Symbol("Deleted");function Ei(){var e;return((e=new Error().stack)==null?void 0:e.split(` `).slice(3,5).map(t=>t.trim()).join(` `))||""}function Se(e){const t=X(e)?e:O(e);return t[Ht]=t,t[St]=X(e)?e.value:e,t[Mt]=Ei(),t[En]=!1,he.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,` Created at: `+t[Mt]):st[he[he.length-1]].add(t),t}ae.on("addLayer",(e,t)=>{const n=[],s=(i,r=[])=>{let l=!1;return Object.keys(i).forEach(o=>{const c=i[o];if(c&&typeof c=="object")if(Ht in c){if(l=!0,c[En]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` Created at: `+c[Mt]);return}st[e.id].delete(K in c?c[K]:c);const u=r.reduce((v,y)=>(y in v||(v[y]={}),v[y]),t),p=u[o];u[o]=c[Ht],ss(u)?p!=null?u[o]=p:u[o]=c[St]:p!=null?u[o].value=p:u[o].value=c[St]}else!(c instanceof m)&&!X(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),s(c,[...r,o])&&(dn(c)&&!dn(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",K in i?i[K]:i,o):l=!0))}),l};s(e),st[e.id].forEach(i=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,` Created at: `+i[Mt])}),st[e.id].clear()});const Xt=Symbol("RegisterNode"),Qt=Symbol("UnregisterNode"),en=Symbol("Nodes"),tn=Symbol("Bounds"),ne=Kt({});window.layers=ne;const st={},he=[];function nn(e,t){return Ie(()=>{const n={},s=n.emitter=Nn();if(n.on=s.on.bind(s),n.emit=s.emit.bind(s),n.nodes=O({}),n.id=e,he.push(e),st[e]=new Set,n.minimized=Se(!1),Object.assign(n,t.call(n)),he[he.length-1]==null||he[he.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen Stack: ${he} Trying to pop ${n.id}`;return he.pop(),D(n,"color"),D(n,"display"),D(n,"name"),we(n,"name",n.id),D(n,"minWidth"),we(n,"minWidth",600),D(n,"minimizable"),we(n,"minimizable",!0),n})}function Dn(e,t){if(console.info("Adding layer",e.id),ne[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ne[e.id]);return}we(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ne[e.id]=e,ae.emit("addLayer",e,t.layers[e.id])}function Di(e){return ne[e]}function Vn(e){console.info("Removing layer",e.id),ae.emit("removeLayer",e),ne[e.id]=void 0}function Vi(e){Vn(e),Dn(e,M)}function Li(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:z(()=>h(Fe,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>h("h2",null,[a(e.name)]),body:a(e.display)}))}}ae.on("update",function(t){Object.values(ne).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ne).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ne).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ai=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Xt,UnregisterNodeInjectionKey:Qt,NodesInjectionKey:en,BoundsInjectionKey:tn,layers:ne,persistentRefs:st,addingLayers:he,createLayer:nn,addLayer:Dn,getLayer:Di,removeLayer:Vn,reloadLayer:Vi,setupLayerModal:Li},Symbol.toStringTag,{value:"Module"}));const qi={},Bi={class:"notif"};function Ri(e,t){return g(),k("div",Bi,"!")}var vn=j(qi,[["render",Ri],["__scopeId","data-v-66323fd4"]]);const Ft=e=>(Pe("data-v-0aae340d"),e=e(),Te(),e),Ui={key:0,class:"day feature dontMerge opened"},ji={class:"date"},Gi=C("Dec"),Wi=Ft(()=>d("br",null,null,-1)),zi={class:"date"},Hi=C("Dec"),Ki=Ft(()=>d("br",null,null,-1)),Yi={key:0,class:"icon"},Zi=Ft(()=>d("div",{class:"doors"},null,-1)),Ji={class:"date"},Xi=C("Dec"),Qi=Ft(()=>d("br",null,null,-1)),er={key:0,class:"material-icons lock"},tr=V({__name:"Day",props:{day:null,symbol:null,opened:null,shouldNotify:null},emits:["openLore","openLayer","unlockLayer"],setup(e,{emit:t}){const n=e,s=Jt(ke(n,"symbol")),i=P(()=>m.gte(J.day.value,n.day)&&new Date().getMonth()===11&&new Date().getDate()>=n.day);function r(){i.value&&t("unlockLayer")}return(l,o)=>e.opened.value?(g(),k("div",Ui,[h(Ct,{appear:"",name:"door"},{default:x(()=>[d("div",{class:"doors",onClick:o[0]||(o[0]=c=>t("openLayer"))},[d("div",ji,[Gi,Wi,C(A(e.day),1)]),d("div",zi,[Hi,Ki,C(A(e.day),1)])])]),_:1}),a(s)?(g(),k("div",Yi,[(g(),q(ie(a(s))))])):I("",!0),d("div",{class:"lore",onClick:o[1]||(o[1]=c=>t("openLore"))},"?"),a(e.shouldNotify)?(g(),q(vn,{key:1})):I("",!0)])):(g(),k("div",{key:1,class:ee(["day feature dontMerge",{can:a(i),locked:!a(i),canOpen:a(i)}]),onClick:r},[Zi,d("div",Ji,[Xi,Qi,C(A(e.day),1)]),a(i)?I("",!0):(g(),k("div",er,"lock")),a(i)?(g(),q(vn,{key:1})):I("",!0)],2))}});var nr=j(tr,[["__scopeId","data-v-0aae340d"]]);const sr={key:0},ir={key:0,class:"mark star"},rr=["src"],ar=V({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(g(),k("div",sr,[e.mark===!0?(g(),k("div",ir)):(g(),k("img",{key:1,class:"mark",src:e.mark},null,8,rr))])):I("",!0)}});var Ot=j(ar,[["__scopeId","data-v-2207999f"]]);const or=V({__name:"Node",props:{id:null},setup(e){const n=se(e),s=bt(Xt,()=>{}),i=bt(Qt,()=>{}),r=pe(null),l=P(()=>r.value&&r.value.parentElement);return ge([l,n.id],([o,c],[u,p])=>{u&&i(a(p)),o&&s(c,o)}),_n(()=>i(a(n.id))),(o,c)=>(g(),k("div",{class:"node",ref_key:"node",ref:r},null,512))}});var xt=j(or,[["__scopeId","data-v-a48cb382"]]),lr=V({props:{display:{type:T(Object,String,Function),required:!0},visibility:{type:T(Number),required:!0},style:T(Object,String,Array),classes:T(Object),onClick:Function,onHold:Function,canClick:{type:T(Boolean),required:!0},small:Boolean,mark:T(Boolean,String),id:{type:String,required:!0},isHolding:Object},components:{Node:xt,MarkNode:Ot},setup(e){const{display:t,onClick:n,onHold:s}=se(e),i=pe("");$e(()=>{const o=Q(t);if(o==null){i.value="";return}if(it(o)){i.value=W(o);return}const c=W(o.title||"","h3"),u=W(o.description,"div");i.value=W(z(()=>h("span",null,[o.title?h("div",null,[h(c,null,null)]):null,h(u,null,null)])))});const{start:r,stop:l}=On(n,s,e.isHolding);return{start:r,stop:l,comp:i,Visibility:ve,unref:a}}});function ur(e,t,n,s,i,r){var c;const l=He("MarkNode"),o=He("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("button",{key:0,style:te([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...u)=>e.onClick&&e.onClick(...u)),onMousedown:t[1]||(t[1]=(...u)=>e.start&&e.start(...u)),onMouseleave:t[2]||(t[2]=(...u)=>e.stop&&e.stop(...u)),onMouseup:t[3]||(t[3]=(...u)=>e.stop&&e.stop(...u)),onTouchstartPassive:t[4]||(t[4]=(...u)=>e.start&&e.start(...u)),onTouchendPassive:t[5]||(t[5]=(...u)=>e.stop&&e.stop(...u)),onTouchcancelPassive:t[6]||(t[6]=(...u)=>e.stop&&e.stop(...u)),class:ee({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)?(g(),q(ie(e.unref(e.comp)),{key:0})):I("",!0),h(l,{mark:e.unref(e.mark)},null,8,["mark"]),h(o,{id:e.id},null,8,["id"])],38)):I("",!0)}var Ln=j(lr,[["render",ur],["__scopeId","data-v-8cedd7da"]]);const cr=Symbol("Clickable");function yn(e){return Ie(()=>{var n;const t=(n=e==null?void 0:e())!=null?n:{};if(t.id=Tt("clickable-"),t.type=cr,t[Ke]=Ln,t.isHolding=O(!1),D(t,"visibility"),we(t,"visibility",ve.Visible),D(t,"canClick"),we(t,"canClick",!0),D(t,"classes"),D(t,"style"),D(t,"mark"),D(t,"display"),t.onClick){const s=t.onClick.bind(t);t.onClick=function(i){a(t.canClick)&&s(i)}}if(t.onHold){const s=t.onHold.bind(t);t.onHold=function(){a(t.canClick)&&s()}}return t[Ye]=function(){const{display:s,visibility:i,style:r,classes:l,onClick:o,onHold:c,isHolding:u,canClick:p,small:v,mark:y,id:b}=this;return{display:s,visibility:i,style:a(r),classes:l,onClick:o,onHold:c,isHolding:u,canClick:p,small:v,mark:y,id:b}},t})}function Ut(e,t="points",n=0,s=void 0){const i=X(e)?e:Se(e);return i.displayName=t,i.precision=n,i.small=s,i}function dr(e){const t=Se(e.value);return ge(e,(n,s)=>{m.gt(n,s)&&(t.value=m.add(t.value,m.sub(n,s)))}),t}new m("10^^8");new m("1e100");function An(e,t){const n=t!=null?t:e.value;return m.eq(e.precision,0)?qe(n):re(n,e.precision,e.small)}const fr=["x1","y1","x2","y2"],mr=V({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=se(e),s=P(()=>{const r=n.startNode.value.rect,l=n.boundingRect.value,o=l?{x:r.x+r.width/2-l.x,y:r.y+r.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(o.x+=n.link.value.offsetStart.x,o.y+=n.link.value.offsetStart.y),o}),i=P(()=>{const r=n.endNode.value.rect,l=n.boundingRect.value,o=l?{x:r.x+r.width/2-l.x,y:r.y+r.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(o.x+=n.link.value.offsetEnd.x,o.y+=n.link.value.offsetEnd.y),o});return(r,l)=>(g(),k("line",ze({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(s).x,y1:a(s).y,x2:a(i).x,y2:a(i).y}),null,16,fr))}});const hr=V({__name:"Links",props:{links:null},setup(e){var c;const n=ke(e,"links"),s=O(null),i=bt(en,O({})),r=bt(tn,O(void 0)),l=O((c=s.value)==null?void 0:c.getBoundingClientRect());ge(r,()=>{var u;return l.value=(u=s.value)==null?void 0:u.getBoundingClientRect()}),$t(()=>{var u;return l.value=(u=s.value)==null?void 0:u.getBoundingClientRect()});const o=P(()=>{var p,v;const u=i.value;return(v=(p=n.value)==null?void 0:p.filter(y=>{var b,N;return((b=u[y.startNode.id])==null?void 0:b.rect)&&((N=u[y.startNode.id])==null?void 0:N.rect)}))!=null?v:[]});return(u,p)=>(g(),k(H,null,[a(o)?(g(),k("svg",is(ze({key:0},u.$attrs)),[(g(!0),k(H,null,bn(a(o),(v,y)=>(g(),q(mr,{key:y,link:v,boundingRect:l.value,startNode:a(i)[v.startNode.id],endNode:a(i)[v.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):I("",!0),d("div",{ref_key:"resizeListener",ref:s,class:"resize-listener"},null,512)],64))}});var pr=j(hr,[["__scopeId","data-v-063f6d6b"]]);V({props:{nodes:{type:T(Array),required:!0},leftSideNodes:T(Array),rightSideNodes:T(Array),branches:T(Array)},components:{Links:pr},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:s}=se(e),i=pe();$e(()=>{const o=Q(t);i.value=W(z(()=>h(H,null,[o.map(c=>h("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Ce)]))])))});const r=pe();$e(()=>{const o=Q(n);r.value=o?W(z(()=>h("span",{class:"left-side-nodes small"},[o.map(Ce)]))):""});const l=pe();return $e(()=>{const o=Q(s);l.value=o?W(z(()=>h("span",{class:"side-nodes small"},[o.map(Ce)]))):""}),{unref:a,nodesComp:i,leftNodesComp:r,rightNodesComp:l}}});V({props:{display:T(Object,String,Function),visibility:{type:T(Number),required:!0},style:T(String,Object,Array),classes:T(Object),onClick:Function,onHold:Function,color:T(String),glowColor:T(String),canClick:{type:T(Boolean),required:!0},mark:T(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Ot,Node:xt},setup(e){const{onClick:t,onHold:n,display:s}=se(e),i=rt(s),{start:r,stop:l}=On(t,n);return{start:r,stop:l,comp:i,unref:a,Visibility:ve,isCoercableComponent:it}}});function gr(e){const t=[],n={};let s=!1;function i(){return s||(t.push(...e()),n.base=t.map(o=>Ne(o.base)),n.baseText=t.map(o=>Ne(o.baseText)),n.visible=t.map(o=>Ne(o.visible)),s=!0),t}const r=Se({});return[z(()=>{const o=i();let c=!0;const u=o.map((p,v)=>{var w,F,de;if(a(n.visible[v])===!1)return null;const y=h("h3",{onClick:()=>r.value[v]=!r.value[v],style:"cursor: pointer"},[h("span",{class:"modifier-toggle"+(a(r.value[v])?" collapsed":"")},[C("\u25BC")]),p.title,p.subtitle?h("span",{class:"subtitle"},[C(" ("),p.subtitle,C(")")]):null]),b=a(r.value[v])?null:h(H,null,[h("div",{class:"modifier-container"},[h("span",{class:"modifier-amount"},[re((w=a(n.base[v]))!=null?w:1),p.unit]),h("span",{class:"modifier-description"},[Ce((F=a(n.baseText[v]))!=null?F:"Base")])]),Ce(a(p.modifier.description))]),N=!c;return c=!1,h(H,null,[N?h("br",null,null):null,h("div",null,[y,h("br",null,null),b,h("hr",null,null),C("Total: "),re(p.modifier.apply((de=a(n.base[v]))!=null?de:1)),p.unit])])});return h(H,null,[u])}),r]}const vr=V({props:{progress:{type:T(String,Object,Number),required:!0},width:{type:T(Number),required:!0},height:{type:T(Number),required:!0},direction:{type:T(String),required:!0},display:T(Object,String,Function),visibility:{type:T(Number),required:!0},style:T(Object,String,Array),classes:T(Object),borderStyle:T(Object,String,Array),textStyle:T(Object,String,Array),baseStyle:T(Object,String,Array),fillStyle:T(Object,String,Array),mark:T(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Ot,Node:xt},setup(e){const{progress:t,width:n,height:s,direction:i,display:r}=se(e),l=P(()=>{let u=t.value instanceof m?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(u,0),1))*100}),o=P(()=>{const u={width:Q(n)+.5+"px",height:Q(s)+.5+"px"};switch(a(i)){case U.Up:u.clipPath=`inset(${l.value}% 0% 0% 0%)`,u.width=Q(n)+1+"px";break;case U.Down:u.clipPath=`inset(0% 0% ${l.value}% 0%)`,u.width=Q(n)+1+"px";break;case U.Right:u.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case U.Left:u.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case U.Default:u.clipPath="inset(0% 50% 0% 0%)";break}return u}),c=rt(r);return{normalizedProgress:l,barStyle:o,component:c,unref:a,Visibility:ve}}});function yr(e,t,n,s,i,r){var c,u,p,v,y,b,N;const l=He("MarkNode"),o=He("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("div",{key:0,style:te([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:ee({bar:!0,...e.unref(e.classes)})},[d("div",{class:"overlayTextContainer border",style:te([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(u=e.unref(e.borderStyle))!=null?u:{}])},[e.component?(g(),k("span",{key:0,class:"overlayText",style:te(e.unref(e.textStyle))},[(g(),q(ie(e.component)))],4)):I("",!0)],4),d("div",{class:"border",style:te([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.style))!=null?p:{},(v=e.unref(e.baseStyle))!=null?v:{},(y=e.unref(e.borderStyle))!=null?y:{}])},[d("div",{class:"fill",style:te([e.barStyle,(b=e.unref(e.style))!=null?b:{},(N=e.unref(e.fillStyle))!=null?N:{}])},null,4)],4),h(l,{mark:e.unref(e.mark)},null,8,["mark"]),h(o,{id:e.id},null,8,["id"])],6)):I("",!0)}var _r=j(vr,[["render",yr],["__scopeId","data-v-02d0d7b2"]]);const br=Symbol("Bar");function jt(e){return Ie(()=>{const t=e();return t.id=Tt("bar-"),t.type=br,t[Ke]=_r,D(t,"visibility"),we(t,"visibility",ve.Visible),D(t,"width"),D(t,"height"),D(t,"direction"),D(t,"style"),D(t,"classes"),D(t,"borderStyle"),D(t,"baseStyle"),D(t,"textStyle"),D(t,"fillStyle"),D(t,"progress"),D(t,"display"),D(t,"mark"),t[Ye]=function(){const{progress:n,width:s,height:i,direction:r,display:l,visibility:o,style:c,classes:u,borderStyle:p,textStyle:v,baseStyle:y,fillStyle:b,mark:N,id:w}=this;return{progress:n,width:s,height:i,direction:r,display:l,visibility:o,style:a(c),classes:u,borderStyle:p,textStyle:v,baseStyle:y,fillStyle:b,mark:N,id:w}},t})}const Nr=Symbol("Buyable");function Gt(e){const t=Se(0);return Ie(()=>{var r,l,o;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=Tt("buyable-"),n.type=Nr,n[Ke]=Ln,n.amount=t,n.amount[St]=(r=n.initialValue)!=null?r:0,n.canAfford=P(()=>{const c=n,u=a(c.cost);return c.resource!=null&&u!=null&&m.gte(c.resource.value,u)}),n.canPurchase==null&&(n.canPurchase=P(()=>a(n.visibility)===ve.Visible&&a(n.canAfford)&&m.lt(n.amount.value,a(n.purchaseLimit)))),n.maxed=P(()=>m.gte(n.amount.value,a(n.purchaseLimit))),D(n,"classes");const s=n.classes;n.classes=P(()=>{const c=a(s)||{};return n.maxed.value&&(c.bought=!0),c}),D(n,"canPurchase"),n.canClick=n.canPurchase,n.onClick=n.purchase=(o=(l=n.onClick)!=null?l:n.purchase)!=null?o:function(){var p;const c=n;if(!a(c.canPurchase))return;const u=a(c.cost);c.cost!=null&&c.resource!=null&&(c.resource.value=m.sub(c.resource.value,u),c.amount.value=m.add(c.amount.value,1)),(p=c.onPurchase)==null||p.call(c,u)},D(n,"display");const i=n.display;return n.display=z(()=>{const c=a(i);if(it(c)){const u=W(c);return h(u,null,null)}if(c!=null&&n.cost!=null&&n.resource!=null){const u=n,p=W(c.title||"","h3"),v=W(c.description||""),y=W(c.effectDisplay||"");return h("span",null,[c.title?h("div",null,[h(p,null,null)]):null,c.description?h(v,null,null):null,c.showAmount===!1?null:h("div",null,[h("br",null,null),a(u.purchaseLimit)===m.dInf?h(H,null,[C("Amount: "),qe(u.amount.value)]):h(H,null,[C("Amount: "),qe(u.amount.value),C(" /")," ",qe(a(u.purchaseLimit))])]),c.effectDisplay?h("div",null,[h("br",null,null),C("Currently: "),h(y,null,null)]):null,u.cost&&!u.maxed.value?h("div",null,[h("br",null,null),C("Cost: "),re(a(u.cost)||0)," ",n.resource.displayName]):null])}return""}),D(n,"visibility"),we(n,"visibility",ve.Visible),D(n,"cost"),D(n,"resource"),D(n,"purchaseLimit"),we(n,"purchaseLimit",m.dInf),D(n,"style"),D(n,"mark"),D(n,"small"),n[Ye]=function(){const{display:c,visibility:u,style:p,classes:v,onClick:y,canClick:b,small:N,mark:w,id:F}=this;return{display:c,visibility:u,style:a(p),classes:v,onClick:y,canClick:b,small:N,mark:w,id:F}},n})}const wr=V({__name:"Sticky",setup(e){const t=O("0"),n=new ResizeObserver(i),s=pe(null);function i(){let r=s.value;if(r==null)return;let l=0;for(;r.previousSibling;){const o=r.previousSibling;o.dataset&&"vSticky"in o.dataset&&(l+=o.offsetHeight),r=o}t.value=l+"px"}return We(i),document.fonts.ready.then(i),$t(()=>{var l;const r=(l=s.value)==null?void 0:l.parentElement;r&&n.observe(r)}),(r,l)=>(g(),k("div",{class:"sticky",style:te({top:t.value}),ref_key:"element",ref:s,"data-v-sticky":""},[Me(r.$slots,"default",{},void 0,!0)],4))}});var kr=j(wr,[["__scopeId","data-v-cccac690"]]);const Sr=V({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=P(()=>An(t.resource));return(s,i)=>(g(),k("h2",{style:te({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},A(a(n)),5))}});const Mr={class:"main-display"},$r={key:0},Cr={key:1},Pr=C(", "),Wt=V({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=se(e),s=O(null),i=rt(n.effectDisplay),r=P(()=>m.lt(n.resource.value,"1e1000"));return(l,o)=>(g(),q(kr,null,{default:x(()=>{var c,u,p,v;return[d("div",{class:ee(["main-display-container",(c=e.classes)!=null?c:{}]),style:te([{height:`${((p=(u=s.value)==null?void 0:u.$el.clientHeight)!=null?p:0)+50}px`},(v=e.style)!=null?v:{}])},[d("div",Mr,[a(r)?(g(),k("span",$r,"You have ")):I("",!0),h(Sr,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),C(" "+A(e.resource.displayName),1),a(i)?(g(),k("span",Cr,[Pr,(g(),q(ie(a(i)),{ref_key:"effectRef",ref:s},null,512))])):I("",!0)])],6)]}),_:1}))}});var Tr=V({props:{display:{type:T(String,Object,Function),required:!0},visibility:{type:T(Number),required:!0},style:T(String,Object,Array),classes:T(Object),resource:Object,cost:T(String,Object,Number),canPurchase:{type:T(Boolean),required:!0},bought:{type:T(Boolean),required:!0},mark:T(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:xt,MarkNode:Ot},setup(e){const{display:t,cost:n}=se(e),s=pe("");return $e(()=>{const i=Q(t);if(i==null){s.value="";return}if(it(i)){s.value=W(i);return}const r=Q(n),l=W(i.title||"","h3"),o=W(i.description,"div"),c=W(i.effectDisplay||"");s.value=W(z(()=>{var u;return h("span",null,[i.title?h("div",null,[h(l,null,null)]):null,h(o,null,null),i.effectDisplay?h("div",null,[C("Currently: "),h(c,null,null)]):null,e.resource!=null?h(H,null,[h("br",null,null),C("Cost: "),e.resource&&An(e.resource,r)," ",(u=e.resource)==null?void 0:u.displayName]):null])}))}),{component:s,unref:a,Visibility:ve}}});const Ir=["disabled"];function Fr(e,t,n,s,i,r){var c;const l=He("MarkNode"),o=He("Node");return e.unref(e.visibility)!==e.Visibility.None?(g(),k("button",{key:0,style:te([{visibility:e.unref(e.visibility)===e.Visibility.Hidden?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...u)=>e.purchase&&e.purchase(...u)),class:ee({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)?(g(),q(ie(e.unref(e.component)),{key:0})):I("",!0),h(l,{mark:e.unref(e.mark)},null,8,["mark"]),h(o,{id:e.id},null,8,["id"])],14,Ir)):I("",!0)}var Or=j(Tr,[["render",Fr],["__scopeId","data-v-7742f590"]]);const xr=Symbol("Upgrade");function be(e){const t=Se(!1);return Ie(()=>{const n=e();return n.id=Tt("upgrade-"),n.type=xr,n[Ke]=Or,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=P(()=>{const s=n;return s.resource!=null&&s.cost!=null&&m.gte(s.resource.value,a(s.cost))}):D(n,"canAfford"),n.canPurchase=P(()=>a(n.visibility)===ve.Visible&&a(n.canAfford)&&!a(n.bought)),n.purchase=function(){var i;const s=n;!a(s.canPurchase)||(s.resource!=null&&s.cost!=null&&(s.resource.value=m.sub(s.resource.value,a(s.cost))),t.value=!0,(i=s.onPurchase)==null||i.call(s))},D(n,"visibility"),we(n,"visibility",ve.Visible),D(n,"classes"),D(n,"style"),D(n,"display"),D(n,"mark"),D(n,"cost"),D(n,"resource"),n[Ye]=function(){const{display:s,visibility:i,style:r,classes:l,resource:o,cost:c,canPurchase:u,bought:p,mark:v,id:y,purchase:b}=this;return{display:s,visibility:i,style:a(r),classes:l,resource:o,cost:c,canPurchase:u,bought:p,mark:v,id:y,purchase:b}},n})}function De(e){return Ie(()=>{const{addend:t,description:n,enabled:s}=e(),i=Ne(t),r=Ne(n),l=s==null?void 0:Ne(s);return{apply:o=>m.add(o,a(i)),revert:o=>m.sub(o,a(i)),enabled:l,description:n==null?void 0:z(()=>h("div",{class:"modifier-container"},[h("span",{class:"modifier-amount"},[m.gte(a(i),0)?"+":"",re(a(i))]),a(r)?h("span",{class:"modifier-description"},[Ce(a(r))]):null]))}})}function vt(e){return Ie(()=>{const{multiplier:t,description:n,enabled:s}=e(),i=Ne(t),r=Ne(n),l=s==null?void 0:Ne(s);return{apply:o=>m.times(o,a(i)),revert:o=>m.div(o,a(i)),enabled:l,description:n==null?void 0:z(()=>h("div",{class:"modifier-container"},[h("span",{class:"modifier-amount"},[C("x"),re(a(i))]),a(r)?h("span",{class:"modifier-description"},[Ce(a(r))]):null]))}})}function je(e){return Ie(()=>{const t=e();return{apply:n=>t.filter(s=>a(s.enabled)!==!1).reduce((s,i)=>i.apply(s),n),revert:t.every(n=>n.revert!=null)?n=>t.filter(s=>a(s.enabled)!==!1).reduceRight((s,i)=>i.revert(s),n):void 0,enabled:P(()=>t.filter(n=>a(n.enabled)!==!1).length>0),description:z(()=>h(H,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(Ce)]))}})}const Er="trees",Dr=nn(Er,function(){const e="Trees",t="#4BDC13",n=Ut(0,"logs"),s=dr(n),i=Ut(10,"trees"),r=Ut(0,"saplings"),l=be(()=>({resource:n,cost:10,display:{title:"Wooden Fingers",description:"Cut down an additional tree per click"}})),o=be(()=>({resource:n,cost:10,display:{title:"Leafy Fingers",description:"Plant an additional tree per click"}})),c=be(()=>({resource:n,cost:25,display:{title:"Automated Knives",description:"Cut down a tree every second"}})),u=be(()=>({resource:n,cost:25,display:{title:"Automated Spade",description:"Plant a tree every second"}})),p=be(()=>({resource:n,cost:100,display:{title:"Research I",description:"Trees give 25% more logs, and unlock more upgrades"}})),v=[l,o,c,u,p],y=be(()=>({resource:n,cost:100,visibility:()=>Ee(p.bought.value),display:{title:"Sharper Fingers",description:"Manually cut trees twice as often"}})),b=be(()=>({resource:n,cost:100,visibility:()=>Ee(p.bought.value),display:{title:"Greener Fingers",description:"Manually Plant trees twice as often"}})),N=be(()=>({resource:n,cost:300,visibility:()=>Ee(p.bought.value),display:{title:"Smart Knives",description:"Each time you manually chop trees, gain 1s of automatic tree chopping production"}})),w=be(()=>({resource:n,cost:300,visibility:()=>Ee(p.bought.value),display:{title:"Smart Spades",description:"Each time you manually plant trees, gain 1s of automatic tree planting production"}})),F=be(()=>({resource:n,cost:1e3,visibility:()=>Ee(p.bought.value),display:{title:"Research II",description:"Trees give 25% more logs, and unlock repeatable purchases"}})),de=[y,b,N,w,F],S=Gt(()=>({resource:n,cost(){return m.times(100,this.amount.value).add(200)},display:{title:"Generic Cutters",description:"Each cutter cuts down 1 tree/s"},visibility:()=>Ee(F.bought.value)})),$=Gt(()=>({resource:n,cost(){return m.times(100,this.amount.value).add(200)},display:{title:"Generic Planters",description:"Each planter plants 0.5 trees/s"},visibility:()=>Ee(F.bought.value)})),R=Gt(()=>({resource:n,cost(){return m.pow(m.add(this.amount.value,1),1.5).times(500)},display:{title:"Expand Forest",description:"Add 10 trees to the forest"},visibility:()=>Ee(F.bought.value),onPurchase(){i.value=m.add(i.value,10)}})),fe=[S,$,R],Be=jt(()=>({direction:U.Right,width:600,height:25,fillStyle:`color: ${t}`,progress:()=>m.log10(s.value).div(4)})),an=je(()=>[De(()=>({addend:1,description:"Wooden Fingers",enabled:l.bought})),De(()=>({addend:Je,description:"Smart Knives",enabled:N.bought}))]),Dt=P(()=>an.apply(1)),Hn=je(()=>[vt(()=>({multiplier:.5,description:"Sharper Fingers",enabled:y.bought}))]),Ze=P(()=>Hn.apply(1)),on=je(()=>[De(()=>({addend:1,description:"Automated Knives",enabled:c.bought})),De(()=>({addend:S.amount,description:"Generic Cutters",enabled:F.bought}))]),Je=P(()=>on.apply(0)),ln=je(()=>[De(()=>({addend:1,description:"Leafy Fingers",enabled:o.bought})),De(()=>({addend:Qe,description:"Smart Spades",enabled:w.bought}))]),Vt=P(()=>ln.apply(1)),Kn=je(()=>[vt(()=>({multiplier:.5,description:"Greener Fingers",enabled:b.bought}))]),Xe=P(()=>Kn.apply(1)),un=je(()=>[De(()=>({addend:1,description:"Automated Spade",enabled:u.bought})),De(()=>({addend:()=>m.div($.amount.value,2),description:"Generic Planters",enabled:F.bought}))]),Qe=P(()=>un.apply(0)),Lt=je(()=>[vt(()=>({multiplier:1.25,description:"Research I",enabled:p.bought})),vt(()=>({multiplier:1.25,description:"Research II",enabled:F.bought}))]),ye=Se(0),Yn=jt(()=>({direction:U.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>m.div(ye.value,Ze.value)})),ht=yn(()=>({display:{title:"Cut trees",description:z(()=>h(H,null,[C("Cut down up to "),re(Dt.value,1),C(" tree"),m.eq(Dt.value,1)?"":"s",C(" at once!"),h("br",null,null),Ae(Yn)]))},style:{minHeight:"80px"},canClick:()=>m.gt(i.value,0)&&m.gte(ye.value,Ze.value),onClick(){if(m.lt(ye.value,Ze.value))return;const oe=m.min(i.value,m.times(Dt.value,m.div(ye.value,Ze.value).floor()));i.value=m.sub(i.value,oe),n.value=m.add(n.value,Lt.apply(oe)),r.value=m.add(r.value,oe),ye.value=0}})),_e=Se(0),Zn=jt(()=>({direction:U.Right,width:100,height:10,style:"margin-top: 8px",baseStyle:"margin-top: 0",fillStyle:"margin-top: 0; transition-duration: 0s",progress:()=>m.div(_e.value,Xe.value)})),pt=yn(()=>({display:{title:"Plant trees",description:z(()=>h(H,null,[C("Plant up to "),re(Vt.value,1),C(" tree"),m.eq(Vt.value,1)?"":"s",C(" at once!"),h("br",null,null),Ae(Zn)]))},style:{minHeight:"80px"},canClick:()=>m.gt(r.value,0)&&m.gte(_e.value,Xe.value),onClick(){if(m.lt(_e.value,Xe.value))return;const oe=m.min(r.value,m.times(Vt.value,m.div(_e.value,Xe.value).floor()));i.value=m.add(i.value,oe),r.value=m.sub(r.value,oe),_e.value=0}})),[Jn,Xn]=gr(()=>[{title:"Log Gain",modifier:Lt,base:1,visible:p.bought},{title:"Manual Cutting Amount",modifier:an,base:1,visible:l.bought,unit:"/click"},{title:"Manual Planting Amount",modifier:ln,base:1,visible:o.bought,unit:"/click"},{title:"Auto Cutting Amount",modifier:on,visible:c.bought,unit:"/s"},{title:"Auto Planting Amount",modifier:un,visible:u.bought,unit:"/s"}]),At=O(!1),Qn=z(()=>h(Fe,{modelValue:At.value,"onUpdate:modelValue":oe=>At.value=oe},{header:()=>h("h2",null,[e,C(" Modifiers")]),body:Jn}));return ae.on("update",oe=>{if(m.lt(J.day.value,1))return;m.gte(ye.value,Ze.value)?ye.value=Ze.value:(ye.value=m.add(ye.value,oe),ht.isHolding.value&&ht.onClick()),m.gte(_e.value,Xe.value)?_e.value=Xe.value:(_e.value=m.add(_e.value,oe),pt.isHolding.value&&pt.onClick());const qt=m.min(i.value,m.times(Je.value,oe));i.value=m.sub(i.value,qt),n.value=m.add(n.value,Lt.apply(qt)),r.value=m.add(r.value,qt);const cn=m.min(r.value,m.times(Qe.value,oe));i.value=m.add(i.value,cn),r.value=m.sub(r.value,cn)}),$e(()=>{J.day.value===1&&m.gte(s.value,1e4)&&(J.loreTitle.value="Day complete!",J.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!",J.day.value=2,J.minimized.value=!1)}),{name:e,color:t,logs:n,totalLogs:s,trees:i,saplings:r,cutTree:ht,plantTree:pt,row1Upgrades:v,row2Upgrades:de,row1Buyables:fe,manualCutProgress:ye,manualPlantProgress:_e,generalTabCollapsed:Xn,minWidth:700,display:z(()=>h(H,null,[h("div",null,[J.day.value===1?`Reach ${qe(1e4)} ${n.displayName} to complete the day`:"Day Complete!"," ",C("-")," ",h("button",{class:"button",style:"display: inline-block;",onClick:()=>At.value=!0},[C("Check Modifiers")])]),Ae(Be),Ae(Qn),h(_t,null,null),h(Wt,{resource:n,color:t,style:"margin-bottom: 0",effectDisplay:m.gt(Je.value,0)?`+${re(Je.value)}/s`:void 0},null),h(Wt,{resource:r,color:"green",style:"margin-bottom: 0",effectDisplay:m.neq(m.sub(Je.value,Qe.value),0)?`+${re(m.sub(Je.value,Qe.value))}/s`:void 0},null),h(Wt,{resource:i,color:"green",style:"margin-bottom: 0",effectDisplay:m.gt(Qe.value,0)?`+${re(Qe.value)}/s`:void 0},null),h(_t,null,null),ot(ht,pt),h("div",null,[C("Tip: You can hold down on actions to perform them automatically")]),h(_t,null,null),ot(...v),ot(...de),ot(...fe)]))}}),J=nn("main",function(){const e=Se(1),t=O(""),n=O("");function s(r){const l=Se(!1);return Ie(()=>{const o=r(),c=Ne(o.shouldNotify);return{...o,opened:l,shouldNotify:c,[Ke]:nr,[Ye]:function(){const{day:u,layer:p,symbol:v,opened:y,shouldNotify:b,story:N}=this;return{day:u,symbol:v,opened:y,shouldNotify:b,onOpenLore(){var w,F;t.value=a((F=(w=ne[p!=null?p:"trees"])==null?void 0:w.name)!=null?F:""),n.value=N},onOpenLayer(){if(M.tabs.includes(p!=null?p:"trees")){const w=M.tabs.lastIndexOf(p!=null?p:"trees");M.tabs.splice(w,1)}else M.tabs.push(p!=null?p:"trees");J.minimized.value=!0},onUnlockLayer(){y.value=!0,setTimeout(()=>{var w,F;t.value=a((F=(w=ne[p!=null?p:"trees"])==null?void 0:w.name)!=null?F:""),n.value=N},1e3)}}}}})}const i=[s(()=>({day:1,shouldNotify:!1,layer:null,symbol:"\u{1F384}",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!"})),s(()=>({day:2,shouldNotify:!1,layer:null,symbol:"cabin",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!"})),s(()=>({day:3,shouldNotify:!1,layer:null,symbol:"\u{1F9DD}",story:"With this unbelievably large workshop complete, it's time to get the elves to work! But it appears they've forgotten how to make toys over the last 11 months - guess it's time to setup training sessions!"})),s(()=>({day:4,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:5,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:6,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:7,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:8,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:9,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:10,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:11,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:12,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:13,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:14,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:15,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:16,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:17,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:18,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:19,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:20,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:21,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:22,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:23,shouldNotify:!1,layer:null,symbol:"",story:""})),s(()=>({day:24,shouldNotify:!1,layer:null,symbol:"",story:""}))];return{name:"Calendar",days:i,day:e,loreTitle:t,loreBody:n,minWidth:710,display:z(()=>h(H,null,[M.devSpeed===0?h("div",null,[C("Game Paused")]):null,M.devSpeed&&M.devSpeed!==1?h("div",null,[C("Dev Speed: "),re(M.devSpeed),C("x")]):null,M.offlineTime?h("div",null,[C("Offline Time: "),Pt(M.offlineTime)]):null,h(_t,null,null),h("div",{class:"advent"},[i.reduce((r,l)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(l),r),[[]]).map(r=>ot(...r))])]))}}),Vr=e=>[J,Dr],qn=P(()=>!1);function Lr(e,t){var n,s;e==="0.0"&&(n=t.layers)!=null&&n.trees&&(t.layers.trees.trees=m.sub(10,(s=t.layers.trees.saplings)!=null?s:0))}var Bn=Object.freeze(Object.defineProperty({__proto__:null,main:J,getInitialLayers:Vr,hasWon:qn,fixOldSave:Lr},Symbol.toStringTag,{value:"Module"}));const Ar=V({components:{Context:xn},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:T(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:T(Number,String),required:!0},name:{type:T(String),required:!0},color:T(String),minimizable:T(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:s,minWidth:i,tab:r}=se(e),l=Jt(t),o=P(()=>B.allowGoBack&&n.value>0&&!s.value);function c(){M.tabs.splice(a(e.index),1/0)}We(()=>p(s.value,a(i.value))),ge([s,ki(i)],([v,y])=>p(v,y));function u(v){e.nodes.value=v}function p(v,y){const b=typeof y=="number"||Number.isNaN(parseInt(y))?y+"px":y,N=r.value();N!=null&&(v?(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=b,N.style.margin=""))}return{component:l,showGoBack:o,updateNodes:u,unref:a,goBack:c}}});function qr(e,t,n,s,i,r){const l=He("Context");return g(),k("div",{class:"layer-container",style:te({"--layer-color":e.unref(e.color)})},[e.showGoBack?(g(),k("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):I("",!0),e.minimized.value?(g(),k("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.minimized.value=!1)},[d("div",null,A(e.unref(e.name)),1)])):(g(),k("div",{key:2,class:ee(["layer-tab",{showGoBack:e.showGoBack}])},[h(l,{onUpdateNodes:e.updateNodes},{default:x(()=>[(g(),q(ie(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(g(),k("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.minimized.value=!0)}," \u25BC ")):I("",!0)],4)}var Br=j(Ar,[["render",qr],["__scopeId","data-v-614f946c"]]);const Rn=e=>(Pe("data-v-4b4bda40"),e=e(),Te(),e),Rr=Rn(()=>d("h2",null,"Changelog",-1)),Ur=Rn(()=>d("details",{open:""},[d("summary",null,[C("v0.0 Initial Commit - "),d("time",null,"2021-09-04")]),C(" This is the first release :D "),d("ul",null,[d("li",{class:"feature"},"Did everything"),d("li",{class:"fix"},"Had some fun"),d("li",{class:"breaking"},"Removed everything"),d("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),jr=V({__name:"Changelog",setup(e,{expose:t}){const n=O(!1);return t({open(){n.value=!0}}),(s,i)=>(g(),q(Fe,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r)},{header:x(()=>[Rr]),body:x(()=>[Ur]),_:1},8,["modelValue"]))}});var Gr=j(jr,[["__scopeId","data-v-4b4bda40"]]),Wr=V({props:{element:Object,display:{type:T(Object,String,Function),required:!0},style:T(Object,String,Array),classes:T(Object),direction:T(String),xoffset:T(String),yoffset:T(String),pinned:Object},setup(e){const{element:t,display:n,pinned:s}=se(e),i=O(!1),r=P(()=>(Q(s)||i.value)&&l.value),l=rt(n),o=pe(W(z(()=>{const p=Q(t);return p==null?"":Ce(p)})));function c(p){const v=s;p.shiftKey&&v&&(v.value=!v.value,p.stopPropagation(),p.preventDefault())}const u=P(()=>Q(s)&&It[Z.theme].showPin);return{Direction:U,isHovered:i,isShown:r,comp:l,elementComp:o,unref:a,togglePinned:c,showPin:u}}});const zr={key:0,class:"material-icons pinned"};function Hr(e,t,n,s,i,r){return g(),k("div",{class:ee(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=l=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...l)=>e.togglePinned&&e.togglePinned(...l))},[Me(e.$slots,"default",{},void 0,!0),e.elementComp?(g(),q(ie(e.elementComp),{key:0})):I("",!0),h(Ct,{name:"fade"},{default:x(()=>{var l;return[e.isShown?(g(),k("div",{key:0,class:ee(["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:te([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(g(),k("span",zr,"push_pin")):I("",!0),e.comp?(g(),q(ie(e.comp),{key:1})):I("",!0)],6)):I("",!0)]}),_:1})],34)}var Y=j(Wr,[["render",Hr],["__scopeId","data-v-6102fa3a"]]);const Kr={class:"info-modal-header"},Yr=["src","alt"],Zr={class:"info-modal-title"},Jr={key:0},Xr={key:0},Qr={key:0},ea=d("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1),ta=d("br",null,null,-1),na=d("br",null,null,-1),sa=["href"],ia=d("span",{class:"material-icons info-modal-discord"},"discord",-1),ra=d("div",null,[d("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[d("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Paper Pilot Community ")])],-1),aa=d("div",null,[d("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link"},[d("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Modding Tree ")])],-1),oa=d("br",null,null,-1);var la=V({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:s,logo:i,author:r,discordName:l,discordLink:o,versionNumber:c,versionTitle:u}=B,p=se(n),v=O(!1),y=P(()=>Pt(M.timePlayed)),b=P(()=>W(z(()=>h(H,null,[yi.map(Ae)]))));t({open(){v.value=!0}});function N(){var w;(w=a(p.changelog))==null||w.open()}return(w,F)=>(g(),q(Fe,{modelValue:v.value,"onUpdate:modelValue":F[0]||(F[0]=de=>v.value=de)},{header:x(()=>[d("div",Kr,[a(i)?(g(),k("img",{key:0,class:"info-modal-logo",src:a(i),alt:a(s)},null,8,Yr)):I("",!0),d("div",Zr,[d("h2",null,A(a(s)),1),d("h4",null,[C(" v"+A(a(c)),1),a(u)?(g(),k("span",Jr,": "+A(a(u)),1)):I("",!0)])])])]),body:x(({shown:de})=>[de?(g(),k("div",Xr,[a(r)?(g(),k("div",Qr,"By "+A(a(r)),1)):I("",!0),ea,ta,d("div",{class:"link",onClick:N},"Changelog"),na,d("div",null,[a(o)?(g(),k("a",{key:0,href:a(o),class:"info-modal-discord-link"},[ia,C(" "+A(a(l)),1)],8,sa)):I("",!0)]),ra,aa,oa,d("div",null,"Time Played: "+A(a(y)),1),(g(),q(ie(a(b))))])):I("",!0)]),_:1},8,["modelValue"]))}});const ua={class:"field"},ca={key:0,class:"field-title"},Un=V({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var l;const n=e,s=rt(ke(n,"title"),"span"),i=O((l=n.options.find(o=>o.value===n.modelValue))!=null?l:null);ge(ke(n,"modelValue"),o=>{var c;Q(i)!==o&&(i.value=(c=n.options.find(u=>u.value===o))!=null?c:null)});function r(o){t("update:modelValue",o.value)}return(o,c)=>(g(),k("div",ua,[a(s)?(g(),k("span",ca,[(g(),q(ie(a(s))))])):I("",!0),h(a(us),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[c[0]||(c[0]=u=>i.value=u),r],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const da={class:"field"},fa=V({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,s=P(()=>W(a(n.title)||"","span")),i=P({get(){return!!n.modelValue},set(r){t("update:modelValue",r)}});return(r,l)=>(g(),k("label",da,[Yt(d("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=o=>X(i)?i.value=o:null)},null,512),[[rs,a(i)]]),(g(),q(ie(a(s))))]))}});var Ve=j(fa,[["__scopeId","data-v-2b109500"]]);const jn=e=>(Pe("data-v-bc13791c"),e=e(),Te(),e),ma=jn(()=>d("div",{class:"header"},[d("h2",null,"Options")],-1)),ha=jn(()=>d("hr",null,null,-1));var pa=V({__name:"Options",setup(e,{expose:t}){const n=O(!1);t({open(){n.value=!0}});const s=Object.keys(It).map(N=>({label:ci(N),value:N})),i=P(()=>W(z(()=>h(H,null,[vi.map(Ae)])))),{showTPS:r,theme:l,unthrottled:o}=se(Z),{autosave:c,offlineProd:u}=se(M),p=P({get(){return M.devSpeed===0},set(N){M.devSpeed=N?0:null}}),v=z(()=>h("span",null,[C("Offline Production"),h(Y,{display:"Save-specific"},{default:()=>[C("*")]})])),y=z(()=>h("span",null,[C("Autosave"),h(Y,{display:"Save-specific"},{default:()=>[C("*")]})])),b=z(()=>h("span",null,[C("Pause game"),h(Y,{display:"Save-specific"},{default:()=>[C("*")]})]));return(N,w)=>(g(),q(Fe,{modelValue:n.value,"onUpdate:modelValue":w[6]||(w[6]=F=>n.value=F)},{header:x(()=>[ma]),body:x(()=>[h(Un,{title:"Theme",options:a(s),modelValue:a(l),"onUpdate:modelValue":w[0]||(w[0]=F=>X(l)?l.value=F:null)},null,8,["options","modelValue"]),(g(),q(ie(a(i)))),h(Ve,{title:"Show TPS",modelValue:a(r),"onUpdate:modelValue":w[1]||(w[1]=F=>X(r)?r.value=F:null)},null,8,["modelValue"]),ha,h(Ve,{title:"Unthrottled",modelValue:a(o),"onUpdate:modelValue":w[2]||(w[2]=F=>X(o)?o.value=F:null)},null,8,["modelValue"]),h(Ve,{title:a(v),modelValue:a(u),"onUpdate:modelValue":w[3]||(w[3]=F=>X(u)?u.value=F:null)},null,8,["title","modelValue"]),h(Ve,{title:a(y),modelValue:a(c),"onUpdate:modelValue":w[4]||(w[4]=F=>X(c)?c.value=F:null)},null,8,["title","modelValue"]),a(B).enablePausing?(g(),q(Ve,{key:0,title:a(b),modelValue:a(p),"onUpdate:modelValue":w[5]||(w[5]=F=>X(p)?p.value=F:null)},null,8,["title","modelValue"])):I("",!0)]),_:1},8,["modelValue"]))}});var ga=j(pa,[["__scopeId","data-v-bc13791c"]]);const va=["onSubmit"],ya={class:"field"},_a={key:0,class:"field-title"},ba=["placeholder"],Na=V({__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,s=rt(ke(n,"title"),"span"),i=pe(null);$t(()=>{var c;(c=i.value)==null||c.focus()});const r=P({get(){return a(n.modelValue)||""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function o(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,u)=>(g(),k("form",{onSubmit:ut(l,["prevent"])},[d("div",ya,[a(s)?(g(),k("span",_a,[(g(),q(ie(a(s))))])):I("",!0),e.textArea?(g(),q(a(ds),{key:1,modelValue:a(r),"onUpdate:modelValue":u[0]||(u[0]=p=>X(r)?r.value=p:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:o,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):Yt((g(),k("input",{key:2,type:"text","onUpdate:modelValue":u[1]||(u[1]=p=>X(r)?r.value=p:null),placeholder:e.placeholder,class:ee({fullWidth:!e.title}),onBlur:o,ref_key:"field",ref:i},null,42,ba)),[[as,a(r)]])])],40,va))}});var Gn=j(Na,[["__scopeId","data-v-67b44a54"]]);const wa={key:0},ka=["onClick","disabled"],Sa={key:0},Ma=["onClick"],$a=V({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const s=se(e),i=O(!1);ge(i,o=>{t("confirmingChanged",o)});function r(){if(a(s.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function l(){i.value=!1}return(o,c)=>(g(),k("span",{class:ee(["container",{confirming:i.value}])},[i.value?(g(),k("span",wa,"Are you sure?")):I("",!0),d("button",{onClick:ut(r,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(g(),k("span",Sa,"Yes")):Me(o.$slots,"default",{key:1},void 0,!0)],8,ka),i.value?(g(),k("button",{key:1,class:"button",onClick:ut(l,["stop"])},"No",8,Ma)):I("",!0)],2))}});var Ca=j($a,[["__scopeId","data-v-2f8ef34c"]]);const Pa=["onClick"],Ta=V({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=O(!1),s=O(null);function i(){t("click"),s.value&&clearTimeout(s.value),n.value=!1,We(()=>{n.value=!0,s.value=setTimeout(()=>n.value=!1,500)})}return(r,l)=>(g(),k("button",{onClick:ut(i,["stop"]),class:ee(["feedback",{activated:n.value,left:e.left}])},[Me(r.$slots,"default",{},void 0,!0)],10,Pa))}});var Ia=j(Ta,[["__scopeId","data-v-01a1b95c"]]);const Oe=e=>(Pe("data-v-5285ac49"),e=e(),Te(),e),Fa=Oe(()=>d("div",{class:"handle material-icons"},"drag_handle",-1)),Oa={key:0,class:"actions"},xa=Oe(()=>d("span",{class:"material-icons"},"content_paste",-1)),Ea=Oe(()=>d("span",{class:"material-icons"},"content_copy",-1)),Da=Oe(()=>d("span",{class:"material-icons"},"edit",-1)),Va=Oe(()=>d("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),La={key:1,class:"actions"},Aa=Oe(()=>d("span",{class:"material-icons"},"check",-1)),qa=Oe(()=>d("span",{class:"material-icons"},"close",-1)),Ba={key:2,class:"details"},Ra={class:"save-version"},Ua=Oe(()=>d("br",null,null,-1)),ja={key:0},Ga={key:1},Wa={key:3,class:"details"},za={key:4,class:"details error"},Ha=Oe(()=>d("br",null,null,-1)),Ka=V({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:s}=se(n),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),r=O(!1),l=O(!1),o=O("");ge(r,()=>o.value=s.value.name||"");const c=P(()=>s.value&&s.value.id===M.id),u=P(()=>c.value?M.time:s.value&&s.value.time||0),p=Jt(P(()=>{var y,b,N,w;return`Day ${(w=(N=(b=(y=s.value)==null?void 0:y.layers)==null?void 0:b.main)==null?void 0:N.day)!=null?w:1}`}));function v(){t("editName",o.value),r.value=!1}return(y,b)=>(g(),k("div",{class:ee(["save",{active:a(c)}])},[Fa,r.value?(g(),k("div",La,[d("button",{onClick:v,class:"button"},[h(Y,{display:"Save",direction:a(U).Left,class:"info"},{default:x(()=>[Aa]),_:1},8,["direction"])]),d("button",{onClick:b[5]||(b[5]=N=>r.value=!r.value),class:"button"},[h(Y,{display:"Cancel",direction:a(U).Left,class:"info"},{default:x(()=>[qa]),_:1},8,["direction"])])])):(g(),k("div",Oa,[a(s).error==null&&!l.value?(g(),q(Ia,{key:0,onClick:b[0]||(b[0]=N=>t("export")),class:"button",left:""},{default:x(()=>[h(Y,{display:"Export",direction:a(U).Left,class:"info"},{default:x(()=>[xa]),_:1},8,["direction"])]),_:1})):I("",!0),a(s).error==null&&!l.value?(g(),k("button",{key:1,onClick:b[1]||(b[1]=N=>t("duplicate")),class:"button"},[h(Y,{display:"Duplicate",direction:a(U).Left,class:"info"},{default:x(()=>[Ea]),_:1},8,["direction"])])):I("",!0),a(s).error==null&&!l.value?(g(),k("button",{key:2,onClick:b[2]||(b[2]=N=>r.value=!r.value),class:"button"},[h(Y,{display:"Edit Name",direction:a(U).Left,class:"info"},{default:x(()=>[Da]),_:1},8,["direction"])])):I("",!0),h(Ca,{disabled:a(c),onClick:b[3]||(b[3]=N=>t("delete")),onConfirmingChanged:b[4]||(b[4]=N=>l.value=N)},{default:x(()=>[h(Y,{display:"Delete",direction:a(U).Left,class:"info"},{default:x(()=>[Va]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(s).error==null&&!r.value?(g(),k("div",Ba,[d("button",{class:"button open",onClick:b[6]||(b[6]=N=>t("open"))},[d("h3",null,A(a(s).name),1)]),d("span",Ra,"v"+A(a(s).modVersion),1),Ua,a(u)?(g(),k("div",ja,"Last played "+A(a(i).format(a(u))),1)):I("",!0),a(p)?(g(),k("div",Ga,[(g(),q(ie(a(p))))])):I("",!0)])):a(s).error==null&&r.value?(g(),k("div",Wa,[h(Gn,{modelValue:o.value,"onUpdate:modelValue":b[7]||(b[7]=N=>o.value=N),class:"editname",onSubmit:v},null,8,["modelValue"])])):(g(),k("div",za,[C(" Error: Failed to load save with id "+A(a(s).id),1),Ha,C(A(a(s).error),1)]))],2))}});var Ya=j(Ka,[["__scopeId","data-v-5285ac49"]]);const sn=e=>(Pe("data-v-3b9991aa"),e=e(),Te(),e),Za=sn(()=>d("h2",null,"Saves Manager",-1)),Ja={class:"modal-footer"},Xa={class:"field"},Qa=sn(()=>d("span",{class:"field-title"},"Create Save",-1)),eo={class:"field-buttons"},to={class:"footer"},no=sn(()=>d("div",{style:{"flex-grow":"1"}},null,-1)),so=V({__name:"SavesManager",setup(e,{expose:t}){const n=O(!1),s=O(null);t({open(){n.value=!0}});const i=O(!1),r=O(""),l=O(null);ge(r,S=>{S?We(()=>{try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Le.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S),i.value=!0;return}const $=JSON.parse(S);if(typeof $!="object"){i.value=!0;return}const R=yt();$.id=R,me($),r.value="",i.value=!1,Z.saves.push(R)}catch{i.value=!0}}):i.value=!1});let o={},c=O(Object.keys(o).reduce((S,$)=>(S.push({label:$.split("/").slice(-1)[0].slice(0,-4),value:o[$]}),S),[]));const u=Kt({});function p(S){if(u[S]==null){let $=localStorage.getItem(S);if($==null)u[S]={error:"Save doesn't exist in localStorage",id:S};else if($==="dW5kZWZpbmVk")u[S]={error:"Save is undefined",id:S};else try{if($[0]!=="{")if($[0]==="e")$=decodeURIComponent(escape(atob($)));else if($[0]==="\u1BE1")$=Le.decompressFromUTF16($);else return console.warn("Unable to determine preset encoding",$),i.value=!0,u[S]={error:"Unable to determine preset encoding",id:S},u[S];u[S]={...JSON.parse($),id:S}}catch(R){u[S]={error:R,id:S},console.warn(`SavesManager: Failed to load info about save with id ${S}: ${R} ${$}`)}}return u[S]}ge(n,S=>{S&&Object.keys(u).forEach($=>delete u[$])});const v=P(()=>Z.saves.reduce((S,$)=>(S[$]=p($),S),{}));function y(S){let $;switch(M.id===S?$=Tn(M[K]):$=JSON.stringify(v.value[S]),B.exportEncoding){default:console.warn(`Unknown save encoding: ${B.exportEncoding}. Defaulting to lz`);case"lz":$=Le.compressToUTF16($);break;case"base64":$=btoa(unescape(encodeURIComponent($)));break;case"plain":break}const R=document.createElement("textarea");R.value=$,document.body.appendChild(R),R.select(),R.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(R)}function b(S){M.id===S&&me();const $={...v.value[S],id:yt()};me($),Z.saves.push($.id)}function N(S){Z.saves=Z.saves.filter($=>$!==S),localStorage.removeItem(S),u[S]=void 0}function w(S){v.value[M.id].time=M.time,me(),u[M.id]=void 0,Ge(v.value[S]),u[S]=void 0}function F(S){if(l.value=S,We(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Le.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const $=JSON.parse(S);$.id=yt(),me($),Z.saves.push($.id),w($.id)}function de(S,$){const R=v.value[S];R&&(R.name=$,M.id===S?(M.name=$,me()):(me(R),u[S]=void 0))}return(S,$)=>(g(),q(Fe,{modelValue:n.value,"onUpdate:modelValue":$[4]||($[4]=R=>n.value=R),ref_key:"modal",ref:s},{header:x(()=>[Za]),body:x(({shown:R})=>[R?(g(),q(a(cs),{key:0,list:a(Z).saves,handle:".handle",itemKey:fe=>fe},{item:x(({element:fe})=>[h(Ya,{save:a(v)[fe],onOpen:Be=>w(fe),onExport:Be=>y(fe),onEditName:Be=>de(fe,Be),onDuplicate:Be=>b(fe),onDelete:Be=>N(fe)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):I("",!0)]),footer:x(()=>[d("div",Ja,[h(Gn,{modelValue:r.value,"onUpdate:modelValue":$[0]||($[0]=R=>r.value=R),title:"Import Save",placeholder:"Paste your save here!",class:ee({importingFailed:i.value})},null,8,["modelValue","class"]),d("div",Xa,[Qa,d("div",eo,[d("button",{class:"button",onClick:$[1]||($[1]=R=>w(a(nt)().id))},"New Game"),Object.keys(a(c)).length>0?(g(),q(Un,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":$[2]||($[2]=R=>F(R)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):I("",!0)])]),d("div",to,[no,d("button",{class:"button modal-default-button",onClick:$[3]||($[3]=R=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Wn=j(so,[["__scopeId","data-v-3b9991aa"]]);const le=e=>(Pe("data-v-4a3f8425"),e=e(),Te(),e),io=["src","alt"],ro={key:1,class:"title"},ao=le(()=>d("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),oo={class:"discord"},lo={class:"discord-links"},uo={key:0},co=["href"],fo=le(()=>d("li",null,[d("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),mo=le(()=>d("li",null,[d("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),ho={href:"https://forums.moddingtree.com/",target:"_blank"},po=le(()=>d("span",{class:"material-icons"},"forum",-1)),go=le(()=>d("span",{class:"material-icons"},"info",-1)),vo=le(()=>d("span",{class:"material-icons"},"library_books",-1)),yo=le(()=>d("span",{class:"material-icons"},"settings",-1)),_o=le(()=>d("span",{class:"material-icons"},"library_books",-1)),bo=le(()=>d("span",{class:"material-icons"},"settings",-1)),No=le(()=>d("span",{class:"material-icons"},"info",-1)),wo={href:"https://forums.moddingtree.com/",target:"_blank"},ko=le(()=>d("span",{class:"material-icons"},"forum",-1)),So={class:"discord"},Mo={class:"discord-links"},$o={key:0},Co=["href"],Po=le(()=>d("li",null,[d("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),To=le(()=>d("li",null,[d("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Io=V({__name:"Nav",setup(e){const t=O(null),n=O(null),s=O(null),i=O(null),{useHeader:r,banner:l,title:o,discordName:c,discordLink:u,versionNumber:p}=B;function v(){window.open(u,"mywindow")}return(y,b)=>(g(),k(H,null,[a(r)?(g(),k("div",ze({key:0,class:"nav"},y.$attrs),[a(l)?(g(),k("img",{key:0,src:a(l),class:"banner",alt:a(o)},null,8,io)):(g(),k("div",ro,A(a(o)),1)),d("div",{onClick:b[0]||(b[0]=N=>{var w;return(w=i.value)==null?void 0:w.open()}),class:"version-container"},[h(Y,{display:"Changelog",direction:a(U).Down,class:"version"},{default:x(()=>[d("span",null,"v"+A(a(p)),1)]),_:1},8,["direction"])]),ao,d("div",oo,[d("span",{onClick:v,class:"material-icons"},"discord"),d("ul",lo,[a(u)?(g(),k("li",uo,[d("a",{href:a(u),target:"_blank"},A(a(c)),9,co)])):I("",!0),fo,mo])]),d("div",null,[d("a",ho,[h(Y,{display:"Forums",direction:a(U).Down,yoffset:"5px"},{default:x(()=>[po]),_:1},8,["direction"])])]),d("div",{onClick:b[1]||(b[1]=N=>{var w;return(w=t.value)==null?void 0:w.open()})},[h(Y,{display:"Info",direction:a(U).Down,class:"info"},{default:x(()=>[go]),_:1},8,["direction"])]),d("div",{onClick:b[2]||(b[2]=N=>{var w;return(w=n.value)==null?void 0:w.open()})},[h(Y,{display:"Saves",direction:a(U).Down,xoffset:"-20px"},{default:x(()=>[vo]),_:1},8,["direction"])]),d("div",{onClick:b[3]||(b[3]=N=>{var w;return(w=s.value)==null?void 0:w.open()})},[h(Y,{display:"Options",direction:a(U).Down,xoffset:"-66px"},{default:x(()=>[yo]),_:1},8,["direction"])])],16)):(g(),k("div",ze({key:1,class:"overlay-nav"},y.$attrs),[d("div",{onClick:b[4]||(b[4]=N=>{var w;return(w=i.value)==null?void 0:w.open()}),class:"version-container"},[h(Y,{display:"Changelog",direction:a(U).Right,xoffset:"25%",class:"version"},{default:x(()=>[d("span",null,"v"+A(a(p)),1)]),_:1},8,["direction"])]),d("div",{onClick:b[5]||(b[5]=N=>{var w;return(w=n.value)==null?void 0:w.open()})},[h(Y,{display:"Saves",direction:a(U).Right},{default:x(()=>[_o]),_:1},8,["direction"])]),d("div",{onClick:b[6]||(b[6]=N=>{var w;return(w=s.value)==null?void 0:w.open()})},[h(Y,{display:"Options",direction:a(U).Right},{default:x(()=>[bo]),_:1},8,["direction"])]),d("div",{onClick:b[7]||(b[7]=N=>{var w;return(w=t.value)==null?void 0:w.open()})},[h(Y,{display:"Info",direction:a(U).Right},{default:x(()=>[No]),_:1},8,["direction"])]),d("div",null,[d("a",wo,[h(Y,{display:"Forums",direction:a(U).Right,xoffset:"7px"},{default:x(()=>[ko]),_:1},8,["direction"])])]),d("div",So,[d("span",{onClick:v,class:"material-icons"},"discord"),d("ul",Mo,[a(u)?(g(),k("li",$o,[d("a",{href:a(u),target:"_blank"},A(a(c)),9,Co)])):I("",!0),Po,To])])],16)),h(la,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),h(Wn,{ref_key:"savesManager",ref:n},null,512),h(ga,{ref_key:"options",ref:s},null,512),h(Gr,{ref_key:"changelog",ref:i},null,512)],64))}});var zn=j(Io,[["__scopeId","data-v-4a3f8425"]]);const rn=e=>(Pe("data-v-62ae8bac"),e=e(),Te(),e),Fo={class:"inner-tab"},Oo={key:0},xo=rn(()=>d("br",null,null,-1)),Eo=C(" You can help continue the "),Do=rn(()=>d("i",null,"advent",-1)),Vo=C("ure at: "),Lo=rn(()=>d("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link"},[d("span",{class:"material-icons info-modal-discord"},"discord"),C(" The Paper Pilot Community ")],-1)),Ao=[xo,Eo,Do,Vo,Lo],qo=V({__name:"Game",setup(e){const t=ke(M,"tabs"),n=P(()=>Object.keys(ne)),s=B.useHeader;function i(r){const{display:l,minimized:o,minWidth:c,name:u,color:p,minimizable:v,nodes:y}=r;return{display:l,minimized:o,minWidth:c,name:u,color:p,minimizable:v,nodes:y}}return(r,l)=>(g(),k("div",{class:ee(["tabs-container",{useHeader:a(s)}])},[(g(!0),k(H,null,bn(a(t),(o,c)=>{var u,p;return g(),k("div",{key:c,class:ee(["tab",a((u=a(ne)[o])==null?void 0:u.classes)]),ref_for:!0,ref:`tab-${c}`,style:te(a((p=a(ne)[o])==null?void 0:p.style))},[c===0&&!a(s)?(g(),q(zn,{key:0})):I("",!0),d("div",Fo,[a(n).includes(o)?(g(),q(Br,ze({key:0},i(a(ne)[o]),{index:c,tab:()=>{var v;return(v=r.$refs[`tab-${c}`])==null?void 0:v[0]}}),null,16,["index","tab"])):(g(),q(ie(o),{key:1,index:c},null,8,["index"]))])],6)}),128)),h(Fe,{"model-value":a(J).loreBody.value!=="","onUpdate:modelValue":l[0]||(l[0]=()=>a(J).loreBody.value="")},{header:x(()=>[d("h2",null,A(a(J).loreTitle.value),1)]),body:x(()=>[C(A(a(J).loreBody.value)+" ",1),a(J).days[a(J).day.value-1].opened.value?I("",!0):(g(),k("div",Oo,Ao))]),_:1},8,["model-value"])],2))}});var Bo=j(qo,[["__scopeId","data-v-62ae8bac"]]);const mt=e=>(Pe("data-v-4a50ce42"),e=e(),Te(),e),Ro={class:"game-over-modal-header"},Uo=["src","alt"],jo={class:"game-over-modal-title"},Go=mt(()=>d("h2",null,"Congratulations!",-1)),Wo={key:0},zo=mt(()=>d("br",null,null,-1)),Ho=mt(()=>d("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Ko=mt(()=>d("br",null,null,-1)),Yo=["href"],Zo=mt(()=>d("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Jo=V({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:s,discordLink:i,versionNumber:r,versionTitle:l}=B,o=P(()=>Pt(M.timePlayed)),c=P(()=>qn.value&&!M.keepGoing),u=ke(M,"autosave");function p(){M.keepGoing=!0}function v(){Ge(nt())}return(y,b)=>(g(),q(Fe,{"model-value":a(c)},{header:x(()=>[d("div",Ro,[a(n)?(g(),k("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,Uo)):I("",!0),d("div",jo,[Go,d("h4",null,"You've beaten "+A(a(t))+" v"+A(a(r))+": "+A(a(l)),1)])])]),body:x(({shown:N})=>[N?(g(),k("div",Wo,[d("div",null,"It took you "+A(a(o))+" to beat the game.",1),zo,Ho,Ko,d("div",null,[d("a",{href:a(i),class:"game-over-modal-discord-link"},[Zo,C(" "+A(a(s)),1)],8,Yo)]),h(Ve,{title:"Autosave",modelValue:a(u),"onUpdate:modelValue":b[0]||(b[0]=w=>X(u)?u.value=w:null)},null,8,["modelValue"])])):I("",!0)]),footer:x(()=>[d("div",{class:"game-over-footer"},[d("button",{onClick:p,class:"button"},"Keep Going"),d("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Xo=j(Jo,[["__scopeId","data-v-4a50ce42"]]);const Et=e=>(Pe("data-v-3de07c06"),e=e(),Te(),e),Qo=Et(()=>d("div",{class:"nan-modal-header"},[d("h2",null,"NaN value detected!")],-1)),el={key:0},tl=Et(()=>d("br",null,null,-1)),nl=["href"],sl=Et(()=>d("span",{class:"material-icons nan-modal-discord"},"discord",-1)),il=Et(()=>d("br",null,null,-1)),rl={class:"nan-footer"},al=V({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=B,s=ke(M,"autosave"),i=ke(G,"hasNaN"),r=O(null),l=P(()=>{var b;return(b=G.NaNPath)==null?void 0:b.join(".")}),o=P(()=>{var b;return(b=G.NaNPath)==null?void 0:b.slice(-1)[0]}),c=P(()=>G.NaNReceiver&&o.value?G.NaNReceiver[o.value]:null),u=P({get(){return M.devSpeed===0},set(b){M.devSpeed=b?null:0}});function p(){G.NaNReceiver&&o.value&&(G.NaNReceiver[o.value]=new m(0),G.hasNaN=!1)}function v(){G.NaNReceiver&&o.value&&(G.NaNReceiver[o.value]=new m(1),G.hasNaN=!1)}function y(){G.NaNReceiver&&o.value&&(G.NaNReceiver[o.value]=new m(NaN),G.hasNaN=!1)}return(b,N)=>(g(),k(H,null,[h(Fe,ze({modelValue:a(i),"onUpdate:modelValue":N[4]||(N[4]=w=>X(i)?i.value=w:null)},b.$attrs),{header:x(()=>[Qo]),body:x(()=>[d("div",null,[C(' Attempted to assign "'+A(a(l))+'" to NaN',1),a(c)?(g(),k("span",el,A(" ")+"(previously "+A(a(re)(a(c)))+")",1)):I("",!0),C(". Auto-saving has been "+A(a(s)?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),tl,d("div",null,[d("a",{href:a(n),class:"nan-modal-discord-link"},[sl,C(" "+A(a(t)),1)],8,nl)]),il,h(Ve,{title:"Autosave",modelValue:a(s),"onUpdate:modelValue":N[0]||(N[0]=w=>X(s)?s.value=w:null)},null,8,["modelValue"]),a(B).enablePausing?(g(),q(Ve,{key:0,title:"Pause game",modelValue:a(u),"onUpdate:modelValue":N[1]||(N[1]=w=>X(u)?u.value=w:null)},null,8,["modelValue"])):I("",!0)]),footer:x(()=>[d("div",rl,[d("button",{onClick:N[2]||(N[2]=w=>{var F;return(F=r.value)==null?void 0:F.open()}),class:"button"},"Open Saves Manager"),d("button",{onClick:p,class:"button"},"Set to 0"),d("button",{onClick:v,class:"button"},"Set to 1"),a(c)&&a(m).neq(a(c),0)&&a(m).neq(a(c),1)?(g(),k("button",{key:0,onClick:N[3]||(N[3]=w=>i.value=!1),class:"button"}," Set to previous ")):I("",!0),d("button",{onClick:y,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),h(Wn,{ref_key:"savesManager",ref:r},null,512)],64))}});var ol=j(al,[["__scopeId","data-v-3de07c06"]]);const ll={key:0,class:"tpsDisplay"},ul={key:0,class:"low"},cl=V({__name:"TPS",setup(e){const t=P(()=>m.div(G.lastTenTicks.length,G.lastTenTicks.reduce((r,l)=>r+l,0))),n=O([]);$e(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const s=P(()=>n.value.reduce((r,l)=>m.max(r,l),0)),i=P(()=>m.sub(t.value,s.value).gt(1));return(r,l)=>a(t).isNan()?I("",!0):(g(),k("div",ll,[C(" TPS: "+A(a(qe)(a(t)))+" ",1),h(Ct,{name:"fade"},{default:x(()=>[a(i)?(g(),k("span",ul,A(a(qe)(a(s))),1)):I("",!0)]),_:1})]))}});var dl=j(cl,[["__scopeId","data-v-46a3ed5b"]]);var fl=V({__name:"App",setup(e){const t=B.useHeader,n=P(()=>It[Z.theme].variables),s=ke(Z,"showTPS"),i=P(()=>W(z(()=>h(H,null,[_i.map(Ae)]))));return(r,l)=>(g(),k(H,null,[d("div",{id:"modal-root",style:te(a(n))},null,4),d("div",{class:ee(["app",{useHeader:a(t)}]),style:te(a(n))},[a(t)?(g(),q(zn,{key:0})):I("",!0),h(Bo),a(a(s))?(g(),q(dl,{key:1})):I("",!0),h(Xo),h(ol),(g(),q(ie(a(i))))],6)],64))}});var ml=j(fl,[["__scopeId","data-v-7c41425b"]]);ae.on("setupVue",e=>e.use(fs));function hl(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:s,onRegistered:i,onRegisterError:r}=e;let l,o;const c=async(u=!0)=>{u&&(l==null||l.addEventListener("controlling",p=>{p.isUpdate&&window.location.reload()})),o&&o.waiting&&await ps(o.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){l=new hs("./sw.js",{scope:"./",type:"classic"}),l.addEventListener("activated",u=>{u.isUpdate||s==null||s()});{const u=()=>{n==null||n()};l.addEventListener("waiting",u),l.addEventListener("externalwaiting",u)}l.register({immediate:t}).then(u=>{o=u,i==null||i(u)}).catch(u=>{r==null||r(u)})}return c}function pl(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:s,onRegistered:i,onRegisterError:r}=e,l=O(!1),o=O(!1);return{updateServiceWorker:hl({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){o.value=!0,s==null||s()},onRegistered:i,onRegisterError:r}),offlineReady:o,needRefresh:l}}document.title=B.title;window.projInfo=B;if(B.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 hi();const{globalBus:e,startGameLoop:t}=await Nt(()=>Promise.resolve().then(function(){return mi}),void 0),n=window.vue=os(ml);e.emit("setupVue",n),n.mount("#app"),We(()=>{const s=ms(),{updateServiceWorker:i}=pl({onNeedRefresh(){s.info("New content available, click or reload to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){s.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(r){r&&setInterval(r.update,60*60*1e3)}})}),t()});