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