diff --git a/assets/gameLoop.d83eb23f.js b/assets/gameLoop.c337231a.js similarity index 92% rename from assets/gameLoop.d83eb23f.js rename to assets/gameLoop.c337231a.js index 31b418c..6b0f77c 100644 --- a/assets/gameLoop.d83eb23f.js +++ b/assets/gameLoop.c337231a.js @@ -1 +1 @@ -import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.675cbad0.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.675cbad0.js").then(function(t){return t.c}),["assets/index.675cbad0.js","assets/index.6d27cf3a.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; +import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.7712ec78.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.7712ec78.js").then(function(t){return t.c}),["assets/index.7712ec78.js","assets/index.6d27cf3a.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; diff --git a/assets/index.675cbad0.js b/assets/index.675cbad0.js deleted file mode 100644 index d2ff0cc..0000000 --- a/assets/index.675cbad0.js +++ /dev/null @@ -1,18 +0,0 @@ -/* empty css */import"./vue.c16a309b.js";import{_ as C,C as s,l as Ee,q as Qt,t as V,b2 as it,ab as Y,aF as k,a1 as E,a2 as _,aL as Dt,G as ge,aD as lr,w as rt,b3 as ct,a9 as p,O as ie,ap as Xr,az as ii,as as At,aH as jn,A as Ne,$ as ee,b7 as W,b9 as Ei,ar as Ot,bv as mn,a8 as T,bt as Jr,bc as vn,T as Kr,u as Pi,j as Qr,bw as St,aM as ft,a0 as B,aO as qe,J as re,I as Pe,aI as tn,aG as nn,z as Gt,bo as ea,bs as ta,aK as hn,bd as Hi,am as Xn,H as na,bx as ia,bf as ra}from"./@vue.6b211d3c.js";import{c as ur}from"./nanoevents.1080beb7.js";import{L as jt}from"./lz-string.dccec454.js";import{Y as aa}from"./vue-next-select.ded54c4a.js";import{D as sa}from"./vuedraggable.1879de79.js";import{p as oa}from"./vue-textarea-autosize.35804eaf.js";import{P as la}from"./vue-panzoom.8ce6f9b1.js";import{s as ua,u as ri}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const ca=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};ca();const da="modulepreload",Zi={},fa="./",Dn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${fa}${i}`,i in Zi)return;Zi[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":da,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},pa="./projInfo-schema.json",ga="Planar Pioneers",ma="A game about controlling and exploiting planes!",va="planar-pioneers",ha="thepaperpilot",ba="",ya="",wa="0.0",_a="Initial Commit",Na=!1,Ca=!1,ka=2,Ma=!0,Sa=null,Ia="",$a=["main"],xa=3600,Ea=0,Pa=!0,Ta="base64";var pe={$schema:pa,title:ga,description:ma,id:va,author:ha,discordName:ba,discordLink:ya,versionNumber:wa,versionTitle:_a,allowGoBack:Na,defaultShowSmall:Ca,defaultDecimalsShown:ka,useHeader:Ma,banner:Sa,logo:Ia,initialTabs:$a,maxTickLength:xa,offlineLimit:Ea,enablePausing:Pa,exportEncoding:Ta};class Da{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Fa(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Fa{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const wi=17,Aa=9e15,Oa=Math.log10(9e15),qa=1/9e15,Ra=308,Va=-324,Yi=5,Ba=(1<<10)-1,La=function(){const e=[];for(let n=Va+1;n<=Ra;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Wt=[2,Math.E,3,4,5,6,7,8,9,10],ja=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,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.1840100246247336,1.4061375836156955,1.6802272208863964,2.026757028388619,2.4770056063449646,3.080525271755482,3.9191964192627284,5.135152840833187,6.989961179534715,10]],za=[[-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]];let N=function(t){return o.fromValue_noAlloc(t)},Z=function(e,t,n){return o.fromComponents(e,t,n)},te=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Bt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},_i=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Ua=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},cr=.5671432904097838,Xi=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return cr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return te(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),Z(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return b.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(b.sub(1,n.pow(e))).div(b.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),l=a.pow(2);return a.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.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=Aa)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){const t=e,n=b.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const v=parseFloat(i[0]),y=parseFloat(i[1]),I=i[1].split(";");let A=1;if(I.length===2&&(A=parseFloat(I[1]),isFinite(A)||(A=1)),isFinite(v)&&isFinite(y)){const S=b.pentate(v,y,A);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const v=parseFloat(r[0]),y=parseFloat(r[1]),I=r[1].split(";");let A=1;if(I.length===2&&(A=parseFloat(I[1]),isFinite(A)||(A=1)),isFinite(v)&&isFinite(y)){const S=b.tetrate(v,y,A);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const v=parseFloat(a[0]),y=parseFloat(a[1]);if(isFinite(v)&&isFinite(y)){const I=b.pow(v,y);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,u,c=e.split("pt");if(c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let v=parseFloat(c[1]);if(isFinite(v)||(v=1),isFinite(l)&&isFinite(u)){const y=b.tetrate(l,u,v);return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let v=parseFloat(c[1]);if(isFinite(v)||(v=1),isFinite(l)&&isFinite(u)){const y=b.tetrate(l,u,v);return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const d=e.split("e"),g=d.length-1;if(g===0){const v=parseFloat(e);if(isFinite(v))return this.fromNumber(v),b.fromStringCache.size>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else if(g===1){const v=parseFloat(e);if(isFinite(v)&&v!==0)return this.fromNumber(v),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}const f=e.split("e^");if(f.length===2){this.sign=1,f[0].charAt(0)=="-"&&(this.sign=-1);let v="";for(let y=0;y=43&&I<=57||I===101)v+=f[1].charAt(y);else return this.layer=parseFloat(v),this.mag=parseFloat(f[1].substr(y+1)),this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(g<1)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;const h=parseFloat(d[0]);if(h===0)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;let w=parseFloat(d[d.length-1]);if(g>=2){const v=parseFloat(d[d.length-2]);isFinite(v)&&(w*=Math.sign(v),w+=_i(v))}if(!isFinite(h))this.sign=d[0]==="-"?-1:1,this.layer=g,this.mag=w;else if(g===1)this.sign=Math.sign(h),this.layer=1,this.mag=w+Math.log10(Math.abs(h));else if(this.sign=Math.sign(h),this.layer=g,g===2){const v=b.mul(Z(1,2,w),N(h));return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else this.mag=w;return this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}fromValue(e){return e instanceof b?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:Bt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Bt(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<=Yi?(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):Bt(this.m,e)+"e"+Bt(this.e,e):this.layer===1?Bt(this.m,e)+"e"+Bt(this.e,e):this.layer<=Yi?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Bt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Bt(this.mag,e)}abs(){return te(this.sign===0?0:1,this.layer,this.mag)}neg(){return te(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=N(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 te(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(b.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>wi)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*l;return Z(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>wi)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*l;return Z(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>wi)return n;{const l=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*l;return Z(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(N(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=N(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return te(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return te(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return Z(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return Z(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return Z(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=Z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Z(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=Z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Z(n.sign*i.sign,r.layer+1,r.sign*r.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=N(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?b.dNaN:this.layer===0?Z(this.sign,0,1/this.mag):Z(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=N(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?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=N(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=N(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=_i(r)),this.layer0?Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Z(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?b.dNaN:this.layer>0?Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Z(this.sign,0,Math.log10(this.mag))}log(e){return e=N(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?b.dNaN:this.layer===0&&e.layer===0?Z(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):b.div(this.log10(),e.log10())}log2(){return this.sign<=0?b.dNaN:this.layer===0?Z(this.sign,0,Math.log2(this.mag)):this.layer===1?Z(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Z(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?b.dNaN:this.layer===0?Z(this.sign,0,Math.log(this.mag)):this.layer===1?Z(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Z(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=N(e),n=this,i=t;if(n.sign===0)return i.eq(0)?te(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return te(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:b.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return b.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 Z(1,0,t);if(e.sign===0)return b.dOne;e=te(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Z(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Z(-e.sign,e.layer+1,-e.mag):b.dOne}pow_base(e){return N(e).pow(this)}root(e){const t=N(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?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(te(1,0,24)))return b.fromNumber(Ua(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,l=t+a;if(l===t||(t=l,i=i*n,r=360*i,a=1/r,l=t-a,l===t))return b.exp(t);t=l,i=i*n,r=1260*i;let u=1/r;return t=t+u,i=i*n,r=1680*i,u=1/r,t=t-u,b.exp(t)}else return this.layer===1?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?b.dOne:this.layer===0&&this.mag<=709.7?b.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Z(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Z(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Z(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return b.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Z(1,2,Math.log10(this.mag)-.3010299956639812);{const e=b.div(te(this.sign,this.layer-1,this.mag),te(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=te(1,0,1)){if(e===1)return b.pow(this,t);if(e===0)return new b(t);if(this.eq(b.dOne))return b.dOne;if(this.eq(-1))return b.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return b.fromNumber(Math.E);const a=b.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?b.fromNumber(Number.POSITIVE_INFINITY):b.dNaN}if(this.eq(b.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),b.fromNumber(r)}if(e<0)return b.iteratedlog(t,this,-e);t=N(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(b.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return te(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=te(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return b.tetrate(e,-t,this);e=N(e);let n=b.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let l=1;l1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return b.fromNumber(a)}slog_internal(e=10){if(e=N(e),e.lte(b.dZero)||e.eq(b.dOne))return b.dNaN;if(e.lt(b.dOne))return this.eq(b.dOne)?b.dZero:this.eq(b.dZero)?b.dNegOne:b.dNaN;if(this.mag<0||this.eq(b.dZero))return b.dNegOne;let t=0,n=b.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(b.dZero))n=b.pow(e,n),t-=1;else{if(n.lte(b.dOne))return b.fromNumber(t+b.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=b.log(n,e)}return b.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:b.critical_section(e,t,za)}static tetrate_critical(e,t){return b.critical_section(e,t,ja)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let l=0;le){const u=(e-Wt[l])/(Wt[l+1]-Wt[l]);i=n[l][Math.floor(t)]*(1-u)+n[l+1][Math.floor(t)]*u,r=n[l][Math.ceil(t)]*(1-u)+n[l+1][Math.ceil(t)]*u;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=b.fromValue_noAlloc(e).toNumber();const t=b.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?b.tetrate(t,i):Number.isFinite(i)?i>=-1?b.log(b.tetrate(t,i+1),t):b.log(b.log(b.tetrate(t,i+2),t),t):b.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return b.fromNumber(Xi(this.toNumber()));if(this.layer===0)return b.fromNumber(Xi(this.sign*this.mag));if(this.layer===1)return Ji(this);if(this.layer===2)return Ji(this);if(this.layer>=3)return te(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return te(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=te(1,0,1)){t=N(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(b.dOne)?(++e,t=b.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.sin(this.sign*this.mag)):te(0,0,0)}cos(){return this.mag<0?b.dOne:this.layer===0?b.fromNumber(Math.cos(this.sign*this.mag)):te(0,0,0)}tan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.tan(this.sign*this.mag)):te(0,0,0)}asin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.asin(this.sign*this.mag)):te(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?b.fromNumber(Math.acos(this.toNumber())):this.layer===0?b.fromNumber(Math.acos(this.sign*this.mag)):te(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.atan(this.sign*this.mag)):b.fromNumber(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 b.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return b.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?te(Number.NaN,Number.NaN,Number.NaN):b.ln(this.add(1).div(b.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(b.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 o=b;o.fromStringCache=new Da(Ba);o.dZero=te(0,0,0);o.dOne=te(1,0,1);o.dNegOne=te(-1,0,1);o.dTwo=te(1,0,2);o.dTen=te(1,0,10);o.dNaN=te(Number.NaN,Number.NaN,Number.NaN);o.dInf=te(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=te(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Z(1,0,Number.MAX_VALUE);o.dNumberMin=Z(1,0,Number.MIN_VALUE);N=o.fromValue_noAlloc;Z=o.fromComponents;te=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const Ga=new o(1);function $n(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Ga,i=i.add(1));const a=i.gte(1e9)?fe(i,Math.max(Math.max(t,3),pe.defaultDecimalsShown)):i.gte(1e4)?Jn(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function Jn(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function dr(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),pe.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Wa=new o("eeee1000"),Ha=new o("e100000"),Ki=new o("e1000"),fr=new o(1e9),Za=new o(1e6),Ya=new o(1e3),Xa=new o(.98),Ja=new o(.001),pr=new o(0);function fe(e,t,n){if(t==null&&(t=pe.defaultDecimalsShown),n=n!=null?n:pe.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+fe(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Wa)){const i=e.slog();return i.gte(Za)?"F"+fe(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+Jn(i.floor(),0)}else{if(e.gte(Ha))return $n(e,0,!1);if(e.gte(Ki))return $n(e,0);if(e.gte(fr))return $n(e,t);if(e.gte(Ya))return Jn(e,0);if(e.gte(Ja)||!n)return dr(e,t);if(e.eq(pr))return 0 .toFixed(t)}return e=mr(e),e.lt(Ki)?$n(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):fe(e,t)+"\u207B\xB9"}function Ae(e){return e=new o(e),e.sign<0?"-"+Ae(e.neg()):e.gte(fr)||e.lte(Xa)&&!e.eq(pr)?fe(e):fe(e,0)}function gr(e){return o.lt(e,0)?"-"+gr(o.neg(e)):o.gt(e,2**51)?fe(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?fe(e)+"s":e<3600?Ae(Math.floor(e/60))+"m "+fe(e%60)+"s":e<86400?Ae(Math.floor(e/3600))+"h "+Ae(Math.floor(e/60)%60)+"m "+Ae(e%60)+"s":e<31536e3?Ae(Math.floor(e/84600)%365)+"d "+Ae(Math.floor(e/3600)%24)+"h "+Ae(Math.floor(e/60)%60)+"m":Ae(Math.floor(e/31536e3))+"y "+Ae(Math.floor(e/84600)%365)+"d "+Ae(Math.floor(e/3600)%24)+"h")}function Ka(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function Qa(e,t){return fe(e,t,!0)}function mr(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var es=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:$n,commaFormat:Jn,regularFormat:dr,format:fe,formatWhole:Ae,formatTime:gr,toPlaces:Ka,formatSmall:Qa,invertOOM:mr},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:ts,commaFormat:ns,regularFormat:is,format:bn,formatWhole:bt,formatTime:ai,toPlaces:rs,formatSmall:zt,invertOOM:as}=es;window.Decimal=o;window.exponentialFormat=ts;window.commaFormat=ns;window.regularFormat=is;window.format=bn;window.formatWhole=bt;window.formatTime=ai;window.toPlaces=rs;window.formatSmall=zt;window.invertOOM=as;function Ge(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Kn(e){return typeof e=="function"}var U=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(U||{});const Fn=Symbol("DoNotCache");function $(e,t){const n=e[t];Kn(n)&&n.length===0&&!n[Fn]?e[t]=C(n.bind(e)):Kn(n)&&(e[t]=n.bind(e),e[t][Fn]=!0)}function me(e){return Kn(e)&&!e[Fn]&&(e=C(e)),e}const at=Symbol("Component"),Je=Symbol("GatherProps");let ss=0;function rn(e="feature-"){return e+ss++}var ve=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ve||{});function Oe(e){const t=s(e);return t!==2&&t!==!1}function an(e){return s(e)===1}function K(e){return e[Fn]=!0,e}function ne(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Ii(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const l=r[a];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof o)&&!Ee(l)&&i(l))})};return i(e),n}const Ht={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 Ti=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Ti||{}),ht={classic:Ht,paper:{...Ht,variables:{...Ht.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:{...Ht,variables:{...Ht.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:{...Ht,variables:{...Ht.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const We=ur();"fonts"in document&&(document.fonts.onloadingdone=()=>We.emit("fontsLoaded"));var os=Object.freeze(Object.defineProperty({__proto__:null,globalBus:We},Symbol.toStringTag,{value:"Module"}));const ls=Qt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var X=window.player=ls;function vr(e){return JSON.stringify(e,(t,n)=>s(n))}function hr(e={}){return Object.assign({id:`${pe.id}-0`,name:"Default Save",tabs:pe.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:pe.id,modVersion:pe.versionNumber,layers:{}},e)}function tt(e){const t=jt.compressToUTF16(vr(e!=null?e:X));return localStorage.setItem((e!=null?e:X).id,t),t}async function us(){fs();try{let e=localStorage.getItem(se.active);if(e==null){await Yt(gn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=jt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==pe.id){await Yt(gn());return}t.id=se.active,await Yt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await Yt(gn())}}function gn(){const e=Zn(),t=hr({id:e});return tt(t),se.saves.push(e),t}function Zn(){let e,t=0;do e=`${pe.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const cs=V(!1);async function Yt(e){console.info("Loading save",e),cs.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Dn(()=>Promise.resolve().then(function(){return Ds}),void 0),{fixOldSave:r,getInitialLayers:a}=await Dn(()=>Promise.resolve().then(function(){return tf}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=hr(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,pe.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==pe.versionNumber&&(r(e.modVersion,e),e.modVersion=pe.versionNumber),Object.assign(X,e),se.active=X.id,We.emit("onLoad")}setInterval(()=>{X.autosave&&tt()},1e3);window.onbeforeunload=()=>{X.autosave&&tt()};window.save=tt;const ds=window.hardReset=async()=>{await Yt(gn())};window.deleteLowerSaves=()=>{const e=Object.values(se.saves).indexOf(X.id)+1;Object.values(se.saves).slice(e).forEach(t=>localStorage.removeItem(t)),se.saves=se.saves.slice(0,e)};const An=Qt({active:"",saves:[],showTPS:!0,theme:Ti.Nordic,unthrottled:!1,alignUnits:!1});it(An,e=>{const t=jt.compressToUTF16(JSON.stringify(e));localStorage.setItem(pe.id,t)},{deep:!0});var se=window.settings=An;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Ti.Nordic,alignUnits:!1};We.emit("loadSettings",e),Object.assign(An,e),ds()};function fs(){try{let e=localStorage.getItem(pe.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=jt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(An,t)}We.emit("loadSettings",An)}catch{}}const br=Qt([]);function ps(e){br.push(e)}const gs=Qt([]),ms=Qt([]),vs={class:"table"},hs=Y({__name:"Row",setup(e){const t=C(()=>ht[se.theme].mergeAdjacent);return(n,i)=>(k(),E("div",vs,[_("div",{class:ge(["row",{mergeAdjacent:s(t)}])},[Dt(n.$slots,"default")],2)]))}});function bs(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Xr(e)}function oe(e,t="span"){return typeof e=="function"?Y({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),Y({template:e})):Y({render:()=>({})}):e}function Xe(e){if(yt(e))return typeof e=="function"?e():oe(e);const t=e[at];return p(t,e[Je](),null)}function Ni(...e){let t;return p(hs,null,bs(t=e.map(Xe))?t:{default:()=>[t]})}function dt(e){if(yt(e))return typeof e=="function"?e():typeof e=="string"?p(ie,null,[e]):p(e,null,null);const t=e[at];return p(t,e[Je](),null)}function Qi(e,t){return e.reduce((n,i)=>p(ie,null,[n,t,i]))}function yt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Fn]===!0}function yr(e,t){const n=V(null),i=V(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return lr(a),{start:r,stop:a,handleHolding:l}}function wr(e,t="div"){const n=rt();return ct(()=>{n.value=oe(we(e),t)}),n}function wn(e,t="div"){const n=rt(null);return ct(()=>{const i=we(e);n.value=i==""||i==null?null:oe(i,t)}),n}function we(e){return s(s(e))}function O(...e){return e.includes(Object)||e.push(Object),e}function ys(e){const t=V(!1),n=e[Je].bind(e);return e[Je]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var ce=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const ws=Y({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var g;const n=V({}),i=new ResizeObserver(u),r=V(null);ii(()=>{const f=r.value;f!=null&&i.observe(f)});let a=!0,l=V((g=r.value)==null?void 0:g.getBoundingClientRect());function u(){a&&(a=!1,At(()=>{var f;l.value=(f=r.value)==null?void 0:f.getBoundingClientRect(),Object.values(n.value).filter(h=>h).forEach(h=>h.rect=h.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}We.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};jn(Di,(f,h)=>{const w=new MutationObserver(()=>d(f));w.observe(h,c),n.value[f]={element:h,observer:w,rect:h.getBoundingClientRect()},u()}),jn(Fi,f=>{var h;(h=n.value[f])==null||h.observer.disconnect(),n.value[f]=void 0,u()}),jn(Ai,n),jn(Oi,l);function d(f){const h=n.value[f];h!=null&&(h.rect=h.element.getBoundingClientRect(),t("updateNodes",n.value))}return(f,h)=>(k(),E(ie,null,[Dt(f.$slots,"default",{},void 0,!0),_("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var _r=ce(ws,[["__scopeId","data-v-2b1dc1bc"]]);const _s=["onPointerdown"],Ns={class:"modal-wrapper"},Cs={class:"modal-container"},ks={class:"modal-header"},Ms={class:"modal-body"},Ss={class:"modal-footer"},Is=_("div",{class:"modal-default-flex-grow"},null,-1),qt=Y({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Ne(e),a=C(()=>s(r.modelValue)||u.value);function l(){n("update:modelValue",!1)}const u=V(!1),c=V(null),d=C(()=>{var g,f;return(f=(g=c.value)==null?void 0:g.nodes)!=null?f:null});return t({isOpen:a,nodes:d}),(g,f)=>(k(),ee(Kr,{to:"#modal-root"},[p(vn,{name:"modal",onBeforeEnter:f[0]||(f[0]=h=>u.value=!0),onAfterLeave:f[1]||(f[1]=h=>u.value=!1)},{default:W(()=>[Ei(_("div",Ot({class:"modal-mask",onPointerdown:mn(l,["self"])},g.$attrs),[_("div",Ns,[_("div",Cs,[_("div",ks,[Dt(g.$slots,"header",{shown:s(a)},()=>[T(" default header ")])]),_("div",Ms,[p(_r,{ref_key:"contextRef",ref:c},{default:W(()=>[Dt(g.$slots,"body",{shown:s(a)},()=>[T(" default body ")])]),_:3},512)]),_("div",Ss,[Dt(g.$slots,"footer",{shown:s(a)},()=>[_("div",{class:"modal-default-footer"},[Is,_("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,_s),[[Jr,e.modelValue]])]),_:3})]))}}),Lt=Symbol("ProxyState");function Le(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,l){if(l===Lt)return r();const u=r()[l];return u!=null&&typeof u=="object"&&Mt in u?u[Mt]:u},set(a,l,u){return r()[l]=u,!0},has(a,l){return l===Lt?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,l)}})}var Te=window.state=Pi({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Ut=Symbol("PersistentState"),yn=Symbol("DefaultValue"),Qn=Symbol("StackTrace"),ei=Symbol("Deleted"),Mt=Symbol("NonPersistent"),Xt=Symbol("SaveDataPath"),$i=Symbol("SkipPersistence");function $s(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(` -`).slice(3,5).map(n=>n.trim()).join(` -`))!=null?t:""}function er(e,t){var n;if(o.isNaN(t))throw Te.hasNaN||(X.autosave=!1,Te.hasNaN=!0,Te.NaNPath=e[Xt],Te.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[Xt])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Ut].value=t}function nt(e,t=!0){const n=Ee(e)?e:V(e);Ee(e)&&(e=e.value);const i=C({get(){return n.value},set(a){t?er(r,a):r[Ut].value=a}});i[yn]=e;const r={get value(){return n.value},set value(a){t?er(r,a):r[Ut].value=a},__v_isRef:!0,[Ut]:n,[yn]:e,[Qn]:$s(),[ei]:!1,[Mt]:i,[Xt]:void 0};return Ye.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` -Created at: -`+r[Qn]):Kt[Ye[Ye.length-1]].add(r),r}function xs(e){return e!=null&&typeof e=="object"&&Ut in e}function zn(e){return!(Lt in e)&&Mt in e?e[Mt]:new Proxy(e,{get(t,n){if(n!==Ut)return n===$i?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Ut?!1:n==$i?!0:Reflect.has(t,n)}})}function Nr(e){Ye.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):Kt[Ye[Ye.length-1]].delete(e),e[ei]=!0}We.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[$i]===!0)return;if(Lt in c&&(c=c[Lt]),xs(c)){if(l=!0,c[ei]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` -Created at: -`+c[Qn]);return}Kt[e.id].delete(c);const d=[e.id,...a,u];c[Xt]!=null&&JSON.stringify(d)!==JSON.stringify(c[Xt])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[Xt].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[Xt]=d;const g=a.reduce((h,w)=>(w in h||(h[w]={}),h[w]),t),f=g[u];g[u]=c[Ut],Qr(g)?f!=null?g[u]=f:g[u]=c[yn]:f!=null?g[u].value=f:g[u].value=c[yn]}else!(c instanceof o)&&!Ee(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(St(c)&&!St(r)?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.",Lt in r?r[Lt]:r,u):l=!0))}}),l};i(e[Lt]),Kt[e.id].forEach(r=>{r[ei]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` -Created at: -`+r[Qn])}),Kt[e.id].clear()});const Di=Symbol("RegisterNode"),Fi=Symbol("UnregisterNode"),Ai=Symbol("Nodes"),Oi=Symbol("Bounds"),ye=Pi({});window.layers=ye;const Kt={},Ye=[];function qi(e,t){return Le(()=>{const n={},i=n.emitter=ur();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=V({}),n.id=e,Ye.push(e),Kt[e]=new Set,n.minimized=nt(!1,!1),Object.assign(n,t.call(n,n)),Ye[Ye.length-1]==null||Ye[Ye.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen -Stack: ${Ye} -Trying to pop ${n.id}`;Ye.pop(),$(n,"color"),$(n,"display"),$(n,"classes"),$(n,"style"),$(n,"name"),ne(n,"name",n.id),$(n,"minWidth"),ne(n,"minWidth",600),$(n,"minimizable"),ne(n,"minimizable",!0),$(n,"minimizedDisplay");const r=n.style;return n.style=C(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Ri(e,t){if(console.info("Adding layer",e.id),ye[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ye[e.id]);return}ne(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ye[e.id]=e,We.emit("addLayer",e,t.layers[e.id])}function Es(e){return ye[e]}function Cr(e){console.info("Removing layer",e.id),We.emit("removeLayer",e),ye[e.id]=void 0}function Ps(e){Cr(e),Ri(e,X)}function Ts(e){const t=V(!1);return{openModal:()=>t.value=!0,modal:K(()=>p(qt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(e.display)}))}}We.on("update",function(t){Object.values(ye).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ye).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ye).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ds=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Di,UnregisterNodeInjectionKey:Fi,NodesInjectionKey:Ai,BoundsInjectionKey:Oi,layers:ye,persistentRefs:Kt,addingLayers:Ye,createLayer:qi,addLayer:Ri,getLayer:Es,removeLayer:Cr,reloadLayer:Ps,setupLayerModal:Ts},Symbol.toStringTag,{value:"Module"}));const Fs=Y({components:{Context:_r},props:{index:{type:Number,required:!0},display:{type:O(Object,String,Function),required:!0},minimizedDisplay:O(Object,String,Function),minimized:{type:Object,required:!0},name:{type:O(String),required:!0},color:O(String),minimizable:O(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Ne(e),a=wr(t),l=wn(r),u=C(()=>pe.allowGoBack&&n.value>0&&!we(i));function c(){X.tabs.splice(s(e.index),1/0)}function d(g){e.nodes.value=g}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:d,unref:s,goBack:c}}}),As={key:1};function Os(e,t,n,i,r,a){const l=ft("Context");return k(),E("div",{class:"layer-container",style:Pe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(k(),E("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):B("",!0),e.unref(e.minimized)?(k(),E("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(k(),ee(qe(e.minimizedComponent),{key:0})):(k(),E("div",As,re(e.unref(e.name)),1))])):(k(),E("div",{key:2,class:ge(["layer-tab",{showGoBack:e.showGoBack}])},[p(l,{onUpdateNodes:e.updateNodes},{default:W(()=>[(k(),ee(qe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(k(),E("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],4)}var qs=ce(Fs,[["render",Os],["__scopeId","data-v-72dd78b1"]]);const kr=e=>(tn("data-v-4b4bda40"),e=e(),nn(),e),Rs=kr(()=>_("h2",null,"Changelog",-1)),Vs=kr(()=>_("details",{open:""},[_("summary",null,[T("v0.0 Initial Commit - "),_("time",null,"2021-09-04")]),T(" This is the first release :D "),_("ul",null,[_("li",{class:"feature"},"Did everything"),_("li",{class:"fix"},"Had some fun"),_("li",{class:"breaking"},"Removed everything"),_("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Bs=Y({__name:"Changelog",setup(e,{expose:t}){const n=V(!1);return t({open(){n.value=!0}}),(i,r)=>(k(),ee(qt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:W(()=>[Rs]),body:W(()=>[Vs]),_:1},8,["modelValue"]))}});var Ls=ce(Bs,[["__scopeId","data-v-4b4bda40"]]),js=Y({props:{element:Object,display:{type:O(Object,String,Function),required:!0},style:O(Object,String,Array),classes:O(Object),direction:O(String),xoffset:O(String),yoffset:O(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Ne(e),r=V(!1),a=C(()=>(we(i)||r.value)&&l.value),l=wn(n),u=rt(oe(K(()=>{const g=we(t);return g==null?"":dt(g)})));function c(g){const f=i;g.shiftKey&&f&&(f.value=!f.value,g.stopPropagation(),g.preventDefault())}const d=C(()=>we(i)&&ht[se.theme].showPin);return{Direction:U,isHovered:r,isShown:a,comp:l,elementComp:u,unref:s,togglePinned:c,showPin:d}}});const zs={key:0,class:"material-icons pinned"};function Us(e,t,n,i,r,a){return k(),E("div",{class:ge(["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))},[Dt(e.$slots,"default",{},void 0,!0),e.elementComp?(k(),ee(qe(e.elementComp),{key:0})):B("",!0),p(vn,{name:"fade"},{default:W(()=>{var l;return[e.isShown?(k(),E("div",{key:0,class:ge(["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:Pe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(k(),E("span",zs,"push_pin")):B("",!0),e.comp?(k(),ee(qe(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var Ce=ce(js,[["render",Us],["__scopeId","data-v-6102fa3a"]]);const sn=e=>(tn("data-v-4f97aa40"),e=e(),nn(),e),Gs={class:"info-modal-header"},Ws=["src","alt"],Hs={class:"info-modal-title"},Zs={key:0},Ys={key:0},Xs={key:0},Js=sn(()=>_("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),Ks=sn(()=>_("br",null,null,-1)),Qs=sn(()=>_("br",null,null,-1)),eo=["href"],to=sn(()=>_("span",{class:"material-icons info-modal-discord"},"discord",-1)),no=sn(()=>_("div",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[_("span",{class:"material-icons info-modal-discord"},"discord"),T(" The Paper Pilot Community ")])],-1)),io=sn(()=>_("div",null,[_("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[_("span",{class:"material-icons info-modal-discord"},"discord"),T(" The Modding Tree ")])],-1)),ro=sn(()=>_("br",null,null,-1));var ao=Y({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:l,discordLink:u,versionNumber:c,versionTitle:d}=pe,g=Ne(n),f=V(!1),h=C(()=>ai(X.timePlayed)),w=C(()=>oe(K(()=>p(ie,null,[gs.map(Xe)]))));t({open(){f.value=!0}});function v(){var y;(y=s(g.changelog))==null||y.open()}return(y,I)=>(k(),ee(qt,{modelValue:f.value,"onUpdate:modelValue":I[0]||(I[0]=A=>f.value=A)},{header:W(()=>[_("div",Gs,[s(r)?(k(),E("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,Ws)):B("",!0),_("div",Hs,[_("h2",null,re(s(i)),1),_("h4",null,[T(" v"+re(s(c)),1),s(d)?(k(),E("span",Zs,": "+re(s(d)),1)):B("",!0)])])])]),body:W(({shown:A})=>[A?(k(),E("div",Ys,[s(a)?(k(),E("div",Xs,"By "+re(s(a)),1)):B("",!0),Js,Ks,_("div",{class:"link",onClick:v},"Changelog"),Qs,_("div",null,[s(u)?(k(),E("a",{key:0,href:s(u),class:"info-modal-discord-link",target:"_blank"},[to,T(" "+re(s(l)),1)],8,eo)):B("",!0)]),no,io,ro,_("div",null,"Time Played: "+re(s(h)),1),(k(),ee(qe(s(w))))])):B("",!0)]),_:1},8,["modelValue"]))}});var so=ce(ao,[["__scopeId","data-v-4f97aa40"]]);const oo={class:"field"},lo={key:0,class:"field-title"},Vi=Y({__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,i=wn(Gt(n,"title"),"span"),r=V((l=n.options.find(u=>u.value===n.modelValue))!=null?l:null);it(Gt(n,"modelValue"),u=>{var c;we(r)!==u&&(r.value=(c=n.options.find(d=>d.value===u))!=null?c:null)});function a(u){t("update:modelValue",u.value)}return(u,c)=>(k(),E("div",oo,[s(i)?(k(),E("span",lo,[(k(),ee(qe(s(i))))])):B("",!0),p(s(aa),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>r.value=d),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const uo={class:"field"},co=Y({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=C(()=>{var a;return oe((a=s(n.title))!=null?a:"","span")}),r=C({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,l)=>(k(),E("label",uo,[Ei(_("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=u=>Ee(r)?r.value=u:null)},null,512),[[ea,s(r)]]),(k(),ee(qe(s(i))))]))}});var Tt=ce(co,[["__scopeId","data-v-11046116"]]);const fo=["onClick"],po=Y({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=V(!1),i=V(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,At(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,l)=>(k(),E("button",{onClick:mn(r,["stop"]),class:ge(["feedback",{activated:n.value,left:e.left}])},[Dt(a.$slots,"default",{},void 0,!0)],10,fo))}});var Mr=ce(po,[["__scopeId","data-v-01a1b95c"]]);const go={class:"header"},mo=_("h2",null,"Settings",-1),vo={class:"option-tabs"},ho={key:0},bo={key:1};var yo=Y({__name:"Options",setup(e,{expose:t}){const n=V(!1),i=V("behaviour");function r(Q){return Q==i.value}function a(Q){i.value=Q}t({isTab:r,setTab:a,save:tt,open(){n.value=!0}});const l=Object.keys(ht).map(Q=>({label:Ge(Q),value:Q})),u=C(()=>oe(K(()=>p(ie,null,[br.map(Xe)])))),{showTPS:c,theme:d,unthrottled:g,alignUnits:f}=Ne(se),{autosave:h,offlineProd:w}=Ne(X),v=C({get(){return X.devSpeed===0},set(Q){X.devSpeed=Q?0:null}}),y=K(()=>p("span",{class:"option-title"},[T("Unthrottled"),p("desc",null,[T("Allow the game to run as fast as possible. Not battery friendly.")])])),I=K(()=>p("span",{class:"option-title"},[T("Offline Production"),p(Ce,{display:"Save-specific",direction:U.Right},{default:()=>[T("*")]}),p("desc",null,[T("Simulate production that occurs while the game is closed.")])])),A=K(()=>p("span",{class:"option-title"},[T("Autosave"),p(Ce,{display:"Save-specific",direction:U.Right},{default:()=>[T("*")]}),p("desc",null,[T("Automatically save the game every second or when the game is closed.")])])),S=K(()=>p("span",{class:"option-title"},[T("Pause game"),p(Ce,{display:"Save-specific",direction:U.Right},{default:()=>[T("*")]}),p("desc",null,[T("Stop everything from moving.")])])),x=K(()=>p("span",{class:"option-title"},[T("Theme"),p("desc",null,[T("How the game looks.")])])),j=K(()=>p("span",{class:"option-title"},[T("Show TPS"),p("desc",null,[T("Show TPS meter at the bottom-left corner of the page.")])])),le=K(()=>p("span",{class:"option-title"},[T("Align modifier units"),p("desc",null,[T("Align numbers to the beginning of the unit in modifier view.")])]));return(Q,G)=>(k(),ee(qt,{modelValue:n.value,"onUpdate:modelValue":G[10]||(G[10]=H=>n.value=H)},{header:W(()=>[_("div",go,[mo,_("div",vo,[_("button",{class:ge({selected:r("behaviour")}),onClick:G[0]||(G[0]=H=>a("behaviour"))},"Behaviour",2),_("button",{class:ge({selected:r("appearance")}),onClick:G[1]||(G[1]=H=>a("appearance"))},"Appearance",2)])])]),body:W(()=>[r("behaviour")?(k(),E("div",ho,[p(Tt,{title:s(y),modelValue:s(g),"onUpdate:modelValue":G[2]||(G[2]=H=>Ee(g)?g.value=H:null)},null,8,["title","modelValue"]),s(pe).enablePausing?(k(),ee(Tt,{key:0,title:s(S),modelValue:s(v),"onUpdate:modelValue":G[3]||(G[3]=H=>Ee(v)?v.value=H:null)},null,8,["title","modelValue"])):B("",!0),p(Tt,{title:s(I),modelValue:s(w),"onUpdate:modelValue":G[4]||(G[4]=H=>Ee(w)?w.value=H:null)},null,8,["title","modelValue"]),p(Tt,{title:s(A),modelValue:s(h),"onUpdate:modelValue":G[5]||(G[5]=H=>Ee(h)?h.value=H:null)},null,8,["title","modelValue"]),s(h)?B("",!0):(k(),ee(Mr,{key:1,class:"button save-button",onClick:G[6]||(G[6]=H=>s(tt)())},{default:W(()=>[T("Manually save")]),_:1}))])):B("",!0),r("appearance")?(k(),E("div",bo,[p(Vi,{title:s(x),options:s(l),modelValue:s(d),"onUpdate:modelValue":G[7]||(G[7]=H=>Ee(d)?d.value=H:null)},null,8,["title","options","modelValue"]),(k(),ee(qe(s(u)))),p(Tt,{title:s(j),modelValue:s(c),"onUpdate:modelValue":G[8]||(G[8]=H=>Ee(c)?c.value=H:null)},null,8,["title","modelValue"]),p(Tt,{title:s(le),modelValue:s(f),"onUpdate:modelValue":G[9]||(G[9]=H=>Ee(f)?f.value=H:null)},null,8,["title","modelValue"])])):B("",!0)]),_:1},8,["modelValue"]))}});const wo=["onSubmit"],_o={class:"field"},No={key:0,class:"field-title"},Co=["placeholder"],ko=Y({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=wn(Gt(n,"title"),"span"),r=rt(null);ii(()=>{var c;(c=r.value)==null||c.focus()});const a=C({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(k(),E("form",{onSubmit:mn(l,["prevent"])},[_("div",_o,[s(i)?(k(),E("span",No,[(k(),ee(qe(s(i))))])):B("",!0),e.textArea?(k(),ee(s(oa),{key:1,modelValue:s(a),"onUpdate:modelValue":d[0]||(d[0]=g=>Ee(a)?a.value=g:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Ei((k(),E("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=g=>Ee(a)?a.value=g:null),placeholder:e.placeholder,class:ge({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:r},null,42,Co)),[[ta,s(a)]])])],40,wo))}});var Sr=ce(ko,[["__scopeId","data-v-90bd4994"]]);const Mo={key:0},So=["onClick","disabled"],Io={key:0},$o=["onClick"],xo=Y({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Ne(e),r=V(!1);it(r,u=>{t("confirmingChanged",u)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(u,c)=>(k(),E("span",{class:ge(["container",{confirming:r.value}])},[r.value?(k(),E("span",Mo,"Are you sure?")):B("",!0),_("button",{onClick:mn(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(k(),E("span",Io,"Yes")):Dt(u.$slots,"default",{key:1},void 0,!0)],8,So),r.value?(k(),E("button",{key:1,class:"button",onClick:mn(l,["stop"])},"No",8,$o)):B("",!0)],2))}});var Eo=ce(xo,[["__scopeId","data-v-2f8ef34c"]]);const Rt=e=>(tn("data-v-32313015"),e=e(),nn(),e),Po=Rt(()=>_("div",{class:"handle material-icons"},"drag_handle",-1)),To={key:0,class:"actions"},Do=Rt(()=>_("span",{class:"material-icons"},"content_paste",-1)),Fo=Rt(()=>_("span",{class:"material-icons"},"content_copy",-1)),Ao=Rt(()=>_("span",{class:"material-icons"},"edit",-1)),Oo=Rt(()=>_("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),qo={key:1,class:"actions"},Ro=Rt(()=>_("span",{class:"material-icons"},"check",-1)),Vo=Rt(()=>_("span",{class:"material-icons"},"close",-1)),Bo={key:2,class:"details"},Lo={class:"save-version"},jo=Rt(()=>_("br",null,null,-1)),zo={key:0},Uo={key:3,class:"details"},Go={key:4,class:"details error"},Wo=Rt(()=>_("br",null,null,-1)),Ho=Y({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Ne(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=V(!1),l=V(!1),u=V("");it(a,()=>{var f;return u.value=(f=i.value.name)!=null?f:""});const c=C(()=>i.value!=null&&i.value.id===X.id),d=C(()=>{var f;return c.value?X.time:(f=i.value!=null&&i.value.time)!=null?f:0});function g(){t("editName",u.value),a.value=!1}return(f,h)=>(k(),E("div",{class:ge(["save",{active:s(c)}])},[Po,a.value?(k(),E("div",qo,[_("button",{onClick:g,class:"button"},[p(Ce,{display:"Save",direction:s(U).Left,class:"info"},{default:W(()=>[Ro]),_:1},8,["direction"])]),_("button",{onClick:h[5]||(h[5]=w=>a.value=!a.value),class:"button"},[p(Ce,{display:"Cancel",direction:s(U).Left,class:"info"},{default:W(()=>[Vo]),_:1},8,["direction"])])])):(k(),E("div",To,[s(i).error==null&&!l.value?(k(),ee(Mr,{key:0,onClick:h[0]||(h[0]=w=>t("export")),class:"button",left:""},{default:W(()=>[p(Ce,{display:"Export",direction:s(U).Left,class:"info"},{default:W(()=>[Do]),_:1},8,["direction"])]),_:1})):B("",!0),s(i).error==null&&!l.value?(k(),E("button",{key:1,onClick:h[1]||(h[1]=w=>t("duplicate")),class:"button"},[p(Ce,{display:"Duplicate",direction:s(U).Left,class:"info"},{default:W(()=>[Fo]),_:1},8,["direction"])])):B("",!0),s(i).error==null&&!l.value?(k(),E("button",{key:2,onClick:h[2]||(h[2]=w=>a.value=!a.value),class:"button"},[p(Ce,{display:"Edit Name",direction:s(U).Left,class:"info"},{default:W(()=>[Ao]),_:1},8,["direction"])])):B("",!0),p(Eo,{disabled:s(c),onClick:h[3]||(h[3]=w=>t("delete")),onConfirmingChanged:h[4]||(h[4]=w=>l.value=w)},{default:W(()=>[p(Ce,{display:"Delete",direction:s(U).Left,class:"info"},{default:W(()=>[Oo]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(k(),E("div",Bo,[_("button",{class:"button open",onClick:h[6]||(h[6]=w=>t("open"))},[_("h3",null,re(s(i).name),1)]),_("span",Lo,"v"+re(s(i).modVersion),1),jo,s(d)?(k(),E("div",zo,"Last played "+re(s(r).format(s(d))),1)):B("",!0)])):s(i).error==null&&a.value?(k(),E("div",Uo,[p(Sr,{modelValue:u.value,"onUpdate:modelValue":h[7]||(h[7]=w=>u.value=w),class:"editname",onSubmit:g},null,8,["modelValue"])])):(k(),E("div",Go,[T(" Error: Failed to load save with id "+re(s(i).id),1),Wo,T(re(s(i).error),1)]))],2))}});var Zo=ce(Ho,[["__scopeId","data-v-32313015"]]);const Bi=e=>(tn("data-v-2a4275be"),e=e(),nn(),e),Yo=Bi(()=>_("h2",null,"Saves Manager",-1)),Xo={class:"modal-footer"},Jo={class:"field"},Ko=Bi(()=>_("span",{class:"field-title"},"Create Save",-1)),Qo={class:"field-buttons"},el={class:"footer"},tl=Bi(()=>_("div",{style:{"flex-grow":"1"}},null,-1)),nl=Y({__name:"SavesManager",setup(e,{expose:t}){const n=V(!1),i=V(null);t({open(){n.value=!0}});const r=V(!1),a=V(""),l=V(null);it(a,S=>{S?At(()=>{try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=jt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S),r.value=!0;return}const x=JSON.parse(S);if(typeof x!="object"){r.value=!0;return}const j=Zn();x.id=j,tt(x),a.value="",r.value=!1,se.saves.push(j)}catch{r.value=!0}}):r.value=!1});let u={},c=V(Object.keys(u).reduce((S,x)=>(S.push({label:x.split("/").slice(-1)[0].slice(0,-4),value:u[x]}),S),[]));const d=Pi({});function g(S){if(d[S]==null){let x=localStorage.getItem(S);if(x==null)d[S]={error:"Save doesn't exist in localStorage",id:S};else if(x==="dW5kZWZpbmVk")d[S]={error:"Save is undefined",id:S};else try{if(x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=jt.decompressFromUTF16(x);else return console.warn("Unable to determine preset encoding",x),r.value=!0,d[S]={error:"Unable to determine preset encoding",id:S},d[S];d[S]={...JSON.parse(x),id:S}}catch(j){d[S]={error:j,id:S},console.warn(`SavesManager: Failed to load info about save with id ${S}: -${j} -${x}`)}}return d[S]}it(n,S=>{S&&Object.keys(d).forEach(x=>delete d[x])});const f=C(()=>se.saves.reduce((S,x)=>(S[x]=g(x),S),{}));function h(S){let x;switch(X.id===S?x=vr(X):x=JSON.stringify(f.value[S]),pe.exportEncoding){default:console.warn(`Unknown save encoding: ${pe.exportEncoding}. Defaulting to lz`);case"lz":x=jt.compressToUTF16(x);break;case"base64":x=btoa(unescape(encodeURIComponent(x)));break;case"plain":break}const j=document.createElement("textarea");j.value=x,document.body.appendChild(j),j.select(),j.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(j)}function w(S){X.id===S&&tt();const x={...f.value[S],id:Zn()};tt(x),se.saves.push(x.id)}function v(S){se.saves=se.saves.filter(x=>x!==S),localStorage.removeItem(S),d[S]=void 0}function y(S){f.value[X.id].time=X.time,tt(),d[X.id]=void 0,Yt(f.value[S]),d[S]=void 0}function I(S){if(l.value=S,At(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=jt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const x=JSON.parse(S);x.id=Zn(),tt(x),se.saves.push(x.id),y(x.id)}function A(S,x){const j=f.value[S];j!=null&&(j.name=x,X.id===S?(X.name=x,tt()):(tt(j),d[S]=void 0))}return(S,x)=>(k(),ee(qt,{modelValue:n.value,"onUpdate:modelValue":x[4]||(x[4]=j=>n.value=j),ref_key:"modal",ref:i},{header:W(()=>[Yo]),body:W(({shown:j})=>[j?(k(),ee(s(sa),{key:0,list:s(se).saves,handle:".handle",itemKey:le=>le},{item:W(({element:le})=>[p(Zo,{save:s(f)[le],onOpen:Q=>y(le),onExport:Q=>h(le),onEditName:Q=>A(le,Q),onDuplicate:Q=>w(le),onDelete:Q=>v(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:W(()=>[_("div",Xo,[p(Sr,{modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=j=>a.value=j),title:"Import Save",placeholder:"Paste your save here!",class:ge({importingFailed:r.value})},null,8,["modelValue","class"]),_("div",Jo,[Ko,_("div",Qo,[_("button",{class:"button",onClick:x[1]||(x[1]=j=>y(s(gn)().id))},"New Game"),Object.keys(s(c)).length>0?(k(),ee(Vi,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":x[2]||(x[2]=j=>I(j)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),_("div",el,[tl,_("button",{class:"button modal-default-button",onClick:x[3]||(x[3]=j=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Ir=ce(nl,[["__scopeId","data-v-2a4275be"]]);const st=e=>(tn("data-v-318a1c31"),e=e(),nn(),e),il=["src","alt"],rl={key:1,class:"title"},al=st(()=>_("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),sl={class:"discord"},ol={class:"discord-links"},ll={key:0},ul=["href"],cl=st(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),dl=st(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),fl={href:"https://forums.moddingtree.com/",target:"_blank"},pl=st(()=>_("span",{class:"material-icons"},"forum",-1)),gl=st(()=>_("span",{class:"material-icons"},"info",-1)),ml=st(()=>_("span",{class:"material-icons"},"library_books",-1)),vl=st(()=>_("span",{class:"material-icons"},"settings",-1)),hl=st(()=>_("span",{class:"material-icons"},"library_books",-1)),bl=st(()=>_("span",{class:"material-icons"},"settings",-1)),yl=st(()=>_("span",{class:"material-icons"},"info",-1)),wl={href:"https://forums.moddingtree.com/",target:"_blank"},_l=st(()=>_("span",{class:"material-icons"},"forum",-1)),Nl={class:"discord"},Cl={class:"discord-links"},kl={key:0},Ml=["href"],Sl=st(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Il=st(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),$l=Y({__name:"Nav",setup(e){const t=V(null),n=V(null),i=V(null),r=V(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:d,versionNumber:g}=pe;function f(){window.open(d,"mywindow")}return(h,w)=>(k(),E(ie,null,[s(a)?(k(),E("div",Ot({key:0,class:"nav"},h.$attrs),[s(l)?(k(),E("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,il)):(k(),E("div",rl,re(s(u)),1)),_("div",{onClick:w[0]||(w[0]=v=>{var y;return(y=r.value)==null?void 0:y.open()}),class:"version-container"},[p(Ce,{display:"Changelog",direction:s(U).Down,class:"version"},{default:W(()=>[_("span",null,"v"+re(s(g)),1)]),_:1},8,["direction"])]),al,_("div",sl,[_("span",{onClick:f,class:"material-icons"},"discord"),_("ul",ol,[s(d)?(k(),E("li",ll,[_("a",{href:s(d),target:"_blank"},re(s(c)),9,ul)])):B("",!0),cl,dl])]),_("div",null,[_("a",fl,[p(Ce,{display:"Forums",direction:s(U).Down,yoffset:"5px"},{default:W(()=>[pl]),_:1},8,["direction"])])]),_("div",{onClick:w[1]||(w[1]=v=>{var y;return(y=t.value)==null?void 0:y.open()})},[p(Ce,{display:"Info",direction:s(U).Down,class:"info"},{default:W(()=>[gl]),_:1},8,["direction"])]),_("div",{onClick:w[2]||(w[2]=v=>{var y;return(y=n.value)==null?void 0:y.open()})},[p(Ce,{display:"Saves",direction:s(U).Down,xoffset:"-20px"},{default:W(()=>[ml]),_:1},8,["direction"])]),_("div",{onClick:w[3]||(w[3]=v=>{var y;return(y=i.value)==null?void 0:y.open()})},[p(Ce,{display:"Settings",direction:s(U).Down,xoffset:"-66px"},{default:W(()=>[vl]),_:1},8,["direction"])])],16)):(k(),E("div",Ot({key:1,class:"overlay-nav"},h.$attrs),[_("div",{onClick:w[4]||(w[4]=v=>{var y;return(y=r.value)==null?void 0:y.open()}),class:"version-container"},[p(Ce,{display:"Changelog",direction:s(U).Right,xoffset:"25%",class:"version"},{default:W(()=>[_("span",null,"v"+re(s(g)),1)]),_:1},8,["direction"])]),_("div",{onClick:w[5]||(w[5]=v=>{var y;return(y=n.value)==null?void 0:y.open()})},[p(Ce,{display:"Saves",direction:s(U).Right},{default:W(()=>[hl]),_:1},8,["direction"])]),_("div",{onClick:w[6]||(w[6]=v=>{var y;return(y=i.value)==null?void 0:y.open()})},[p(Ce,{display:"Settings",direction:s(U).Right},{default:W(()=>[bl]),_:1},8,["direction"])]),_("div",{onClick:w[7]||(w[7]=v=>{var y;return(y=t.value)==null?void 0:y.open()})},[p(Ce,{display:"Info",direction:s(U).Right},{default:W(()=>[yl]),_:1},8,["direction"])]),_("div",null,[_("a",wl,[p(Ce,{display:"Forums",direction:s(U).Right,xoffset:"7px"},{default:W(()=>[_l]),_:1},8,["direction"])])]),_("div",Nl,[_("span",{onClick:f,class:"material-icons"},"discord"),_("ul",Cl,[s(d)?(k(),E("li",kl,[_("a",{href:s(d),target:"_blank"},re(s(c)),9,Ml)])):B("",!0),Sl,Il])])],16)),p(so,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(Ir,{ref_key:"savesManager",ref:n},null,512),p(yo,{ref_key:"options",ref:i},null,512),p(Ls,{ref_key:"changelog",ref:r},null,512)],64))}});var $r=ce($l,[["__scopeId","data-v-318a1c31"]]);const xl={class:"inner-tab"},El=Y({__name:"Game",setup(e){const t=Gt(X,"tabs"),n=C(()=>Object.keys(ye)),i=pe.useHeader;function r(a){const{display:l,minimized:u,name:c,color:d,minimizable:g,nodes:f,minimizedDisplay:h}=a;return{display:l,minimized:u,name:c,color:d,minimizable:g,nodes:f,minimizedDisplay:h}}return(a,l)=>(k(),E("div",{class:ge(["tabs-container",{useHeader:s(i)}])},[(k(!0),E(ie,null,hn(s(t),(u,c)=>{var d,g;return k(),E("div",{key:c,class:ge(["tab",s((d=s(ye)[u])==null?void 0:d.classes)]),style:Pe(s((g=s(ye)[u])==null?void 0:g.style))},[c===0&&!s(i)?(k(),ee($r,{key:0})):B("",!0),_("div",xl,[s(n).includes(u)?(k(),ee(qs,Ot({key:0},r(s(ye)[u]),{index:c,onSetMinimized:f=>s(ye)[u].minimized.value=f}),null,16,["index","onSetMinimized"])):(k(),ee(qe(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Pl=ce(El,[["__scopeId","data-v-dcd207b4"]]);const Tl=Y({__name:"Sticky",setup(e){const t=V("0"),n=new ResizeObserver(r),i=rt(null);function r(){let a=i.value;if(a==null)return;let l=0;for(;a.previousSibling;){const u=a.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),a=u}t.value=l+"px"}return At(r),document.fonts.ready.then(r),ii(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(k(),E("div",{class:"sticky",style:Pe({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Dt(a.$slots,"default",{},void 0,!0)],4))}});var ti=ce(Tl,[["__scopeId","data-v-cccac690"]]);const Dl=["x1","y1","x2","y2"],Fl=Y({__name:"BoardLink",props:{link:null},setup(e){const n=Ne(e),i=C(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=C(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,l)=>(k(),E("line",Ot({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Dl))}});var Al=ce(Fl,[["__scopeId","data-v-57c4970a"]]);const Ol={key:0},ql=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Rl=["fill","stroke-width","stroke"],Vl=["fill"],Bl=Y({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Ne(e),r=C(()=>de(i.nodeType.value.size,s(i.node))),a=C(()=>{var g;return(g=de(i.nodeType.value.outlineColor,s(i.node)))!=null?g:ht[se.theme].variables["--outline"]}),l=C(()=>{var g;return(g=de(i.nodeType.value.titleColor,s(i.node)))!=null?g:ht[se.theme].variables["--foreground"]}),u=C(()=>de(i.nodeType.value.actionDistance,s(i.node)));function c(g,f){t("clickAction",f.id),g.preventDefault(),g.stopPropagation()}function d(g,f){var h;((h=s(i.selectedAction))==null?void 0:h.id)===f.id&&(g.preventDefault(),g.stopPropagation())}return(g,f)=>(k(),ee(vn,{name:"actions",appear:""},{default:W(()=>[e.isSelected&&e.actions?(k(),E("g",Ol,[(k(!0),E(ie,null,hn(e.actions,(h,w)=>{var v,y;return k(),E("g",{key:h.id,class:ge(["action",{selected:((v=e.selectedAction)==null?void 0:v.id)===h.id}]),transform:`translate( - ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-w)*s(u))}, - ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-w)*s(u))} - )`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:mn(I=>d(I,h),["stop"])},[_("circle",{fill:s(de)(h.fillColor,e.node),r:"20","stroke-width":((y=e.selectedAction)==null?void 0:y.id)===h.id?4:0,stroke:s(a)},null,8,Rl),_("text",{fill:s(l),class:"material-icons"},re(s(de)(h.icon,e.node)),9,Vl)],42,ql)}),128))])):B("",!0)]),_:1}))}});var Ll=ce(Bl,[["__scopeId","data-v-9efb2a56"]]);const jl=["transform"],zl={key:0},Ul=["r","fill","stroke"],Gl=["r","fill","stroke"],Wl=["r","fill"],Hl=["r","stroke-dasharray","stroke-dashoffset","stroke"],Zl={key:1,transform:"rotate(45, 0, 0)"},Yl=["width","height","transform","fill","stroke"],Xl=["width","height","transform","fill","stroke"],Jl=["width","height","transform","fill"],Kl=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Ql=["fill","y"],eu=["fill"],tu={key:0},nu=["fill","y"],iu=["fill","y"],ru=Y({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Ne(n),a=C(()=>s(r.selectedNode)===s(r.node)),l=C(()=>de(r.nodeType.value.draggable,s(r.node)));it(l,J=>{const be=s(r.node);s(r.dragging)===be&&!J&&t("endDragging",be)});const u=C(()=>{var be;const J=s(r.node);return(be=de(r.nodeType.value.actions,J))==null?void 0:be.filter(He=>Oe(de(He.visibility,J)))}),c=C(()=>{var be;const J=s(r.node);if(de(r.nodeType.value.draggable,J)&&((be=s(r.dragging))==null?void 0:be.id)===J.id&&s(r.dragged)!=null){const{x:He,y:Ke}=s(r.dragged);return{x:J.position.x+Math.round(He/25)*25,y:J.position.y+Math.round(Ke/25)*25}}return J.position}),d=C(()=>de(r.nodeType.value.shape,s(r.node))),g=C(()=>de(r.nodeType.value.title,s(r.node))),f=C(()=>de(r.nodeType.value.subtitle,s(r.node))),h=C(()=>{var J;return(J=a.value?s(r.selectedAction)&&de(s(r.selectedAction).tooltip,s(r.node)):null)!=null?J:de(r.nodeType.value.label,s(r.node))}),w=C(()=>{var J,be;return de((be=(J=s(r.selectedAction))==null?void 0:J.confirmationLabel)!=null?be:{text:"Tap again to confirm"},s(r.node))}),v=C(()=>de(r.nodeType.value.size,s(r.node))),y=C(()=>{var J;return(J=de(r.nodeType.value.progress,s(r.node)))!=null?J:0}),I=C(()=>ht[se.theme].variables["--background"]),A=C(()=>{var J;return(J=de(r.nodeType.value.outlineColor,s(r.node)))!=null?J:ht[se.theme].variables["--outline"]}),S=C(()=>{var J;return(J=de(r.nodeType.value.fillColor,s(r.node)))!=null?J:ht[se.theme].variables["--raised-background"]}),x=C(()=>de(r.nodeType.value.progressColor,s(r.node))),j=C(()=>{var J;return(J=de(r.nodeType.value.titleColor,s(r.node)))!=null?J:ht[se.theme].variables["--foreground"]}),le=C(()=>de(r.nodeType.value.progressDisplay,s(r.node))),Q=C(()=>r.dragging.value!=null&&s(r.hasDragged)&&de(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),G=C(()=>de(r.nodeType.value.style,s(r.node))),H=C(()=>de(r.nodeType.value.classes,s(r.node)));function Re(J){t("mouseDown",J,r.node.value,l.value)}function ot(J){var be,He,Ke;(be=r.hasDragged)!=null&&be.value||(t("endDragging",r.node.value),(Ke=(He=r.nodeType.value).onClick)==null||Ke.call(He,r.node.value),J.stopPropagation())}return(J,be)=>{var He,Ke,pt;return k(),E("g",{class:ge(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(H)}]),style:Pe([{opacity:((He=e.dragging)==null?void 0:He.id)===e.node.id&&e.hasDragged?.5:1},(Ke=s(G))!=null?Ke:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(Ll,{actions:(pt=s(u))!=null?pt:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:be[0]||(be[0]=Ve=>t("clickAction",Ve))},null,8,["actions","is-selected","node","node-type","selected-action"]),_("g",{class:"node-container",onMousedown:Re,onTouchstartPassive:Re,onMouseup:ot,onTouchendPassive:ot},[s(d)===s(Be).Circle?(k(),E("g",zl,[s(Q)?(k(),E("circle",{key:0,class:"receiver",r:s(v)+8,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Ul)):B("",!0),_("circle",{class:"body",r:s(v),fill:s(S),stroke:s(A),"stroke-width":4},null,8,Gl),s(le)===s(en).Fill?(k(),E("circle",{key:1,class:"progress progressFill",r:Math.max(s(v)*s(y)-2,0),fill:s(x)},null,8,Wl)):(k(),E("circle",{key:2,r:s(v)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(v)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(v)+4.5)*2*Math.PI-s(y)*(s(v)+4.5)*2*Math.PI,stroke:s(x)},null,8,Hl))])):s(d)===s(Be).Diamond?(k(),E("g",Zl,[s(Q)?(k(),E("rect",{key:0,class:"receiver",width:s(v)*s(i)+16,height:s(v)*s(i)+16,transform:`translate(${-(s(v)*s(i)+16)/2}, ${-(s(v)*s(i)+16)/2})`,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Yl)):B("",!0),_("rect",{class:"body",width:s(v)*s(i),height:s(v)*s(i),transform:`translate(${-s(v)*s(i)/2}, ${-s(v)*s(i)/2})`,fill:s(S),stroke:s(A),"stroke-width":4},null,8,Xl),s(le)===s(en).Fill?(k(),E("rect",{key:1,class:"progress progressFill",width:Math.max(s(v)*s(i)*s(y)-2,0),height:Math.max(s(v)*s(i)*s(y)-2,0),transform:`translate(${-Math.max(s(v)*s(i)*s(y)-2,0)/2}, ${-Math.max(s(v)*s(i)*s(y)-2,0)/2})`,fill:s(x)},null,8,Jl)):(k(),E("rect",{key:2,class:"progress progressDiamond",width:s(v)*s(i)+9,height:s(v)*s(i)+9,transform:`translate(${-(s(v)*s(i)+9)/2}, ${-(s(v)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(v)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(v)*s(i)+9)*4-s(y)*(s(v)*s(i)+9)*4,stroke:s(x)},null,8,Kl))])):B("",!0),_("text",{fill:s(j),class:"node-title",y:s(f)?10:0},re(s(g)),9,Ql),s(f)?(k(),E("text",{key:2,fill:s(j),class:"node-subtitle",y:"-15"},re(s(f)),9,eu)):B("",!0)],32),p(vn,{name:"fade",appear:""},{default:W(()=>{var Ve;return[s(h)?(k(),E("g",tu,[_("text",{fill:(Ve=s(h).color)!=null?Ve:s(j),class:ge(["node-title",{pulsing:s(h).pulsing}]),y:-s(v)-20},re(s(h).text),11,nu)])):B("",!0)]}),_:1}),p(vn,{name:"fade",appear:""},{default:W(()=>{var Ve;return[s(a)&&e.selectedAction?(k(),E("text",{key:0,fill:(Ve=s(w).color)!=null?Ve:s(j),class:ge(["node-title",{pulsing:s(w).pulsing}]),y:s(v)+75},re(s(w).text),11,iu)):B("",!0)]}),_:1})],14,jl)}}});var au=ce(ru,[["__scopeId","data-v-4654be02"]]);const su={class:"stage",width:"100%",height:"100%"},ou={class:"g1"},lu=Y({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Ne(e),i=V({x:0,y:0}),r=V({x:0,y:0}),a=V(!1),l=V(null),u=C(()=>{const w=n.nodes.value.slice();if(n.draggingNode.value){const v=w.splice(w.indexOf(n.draggingNode.value),1)[0];w.push(v)}return w});ct(()=>{const w=n.draggingNode.value;if(w==null)return null;const v={x:w.position.x+r.value.x,y:w.position.y+r.value.y};let y=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,A)=>{if(A.id===w.id)return I;const S=n.types.value[A.type];if(!de(S.canAccept,A,w))return I;const j=Math.pow(v.x-A.position.x,2)+Math.pow(v.y-A.position.y,2);let le=de(S.size,A);return j>y||j>le*le?I:(y=j,A)},null))});function c(w){w.setTransformOrigin(null),w.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(w,v=null,y=!1){if(n.draggingNode.value==null){w.preventDefault(),w.stopPropagation();let I,A;if("touches"in w)if(w.touches.length===1)I=w.touches[0].clientX,A=w.touches[0].clientY;else return;else I=w.clientX,A=w.clientY;i.value={x:I,y:A},r.value={x:0,y:0},a.value=!1,y&&n.setDraggingNode.value(v)}v!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function g(w){const{x:v,y,scale:I}=l.value.panZoomInstance.getTransform();let A,S;if("touches"in w)if(w.touches.length===1)A=w.touches[0].clientX,S=w.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else A=w.clientX,S=w.clientY;n.mousePosition.value={x:(A-v)/I,y:(S-y)/I},r.value={x:r.value.x+(A-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:A,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(w.preventDefault(),w.stopPropagation())}function f(w,v=!1){var y,I;if(n.draggingNode.value!=null&&n.draggingNode.value===w){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const A=n.nodes.value;A.push(A.splice(A.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(y=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(y,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!v&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(w,v){n.state.value.selectedAction===v?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:v}}return(w,v)=>{const y=ft("panZoom");return s(Oe)(e.visibility)?(k(),ee(y,{key:0,style:Pe([{width:e.width,height:e.height},e.style]),class:ge(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:g,onTouchmove:g,onMousedown:v[0]||(v[0]=I=>d(I)),onTouchstart:v[1]||(v[1]=I=>d(I)),onMouseup:v[2]||(v[2]=()=>f(s(e.draggingNode))),onTouchendPassive:v[3]||(v[3]=()=>f(s(e.draggingNode))),onMouseleave:v[4]||(v[4]=()=>f(s(e.draggingNode),!0))},{default:W(()=>[(k(),E("svg",su,[_("g",ou,[p(Hi,{name:"link",appear:""},{default:W(()=>[(k(!0),E(ie,null,hn(s(e.links)||[],I=>(k(),E("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(Al,{link:I},null,8,["link"])]))),128))]),_:1}),p(Hi,{name:"grow",duration:500,appear:""},{default:W(()=>[(k(!0),E(ie,null,hn(s(u),I=>{var A;return k(),E("g",{key:I.id,style:{"transition-duration":"0s"}},[p(au,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:a.value,receivingNode:((A=s(e.receivingNode))==null?void 0:A.id)===I.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:d,onEndDragging:f,onClickAction:S=>h(I,S)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});We.on("setupVue",e=>la.install(e));const xr=Symbol("Board");var en=(e=>(e.Outline="Outline",e.Fill="Fill",e))(en||{}),Be=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Be||{});function uu(e){const t=nt({nodes:[],selectedNode:null,selectedAction:null},!1);return Le(n=>{const i=e.call(n,n);i.id=rn("board-"),i.type=xr,i[at]=lu,i.state?(Nr(t),$(i,"state")):(t[yn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=C(()=>s(l.state).nodes),i.selectedNode=C({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;Ee(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=C({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;Ee(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=V(null),i.links?$(i,"links"):i.links=C(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?de(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=V(null),i.receivingNode=V(null),$(i,"visibility"),ne(i,"visibility",ve.Visible),$(i,"width"),ne(i,"width","100%"),$(i,"height"),ne(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),ne(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),ne(c,"draggable",!1),$(c,"shape"),ne(c,"shape","Circle"),$(c,"canAccept"),ne(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),ne(c,"progressDisplay","Fill"),$(c,"progressColor"),ne(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),ne(c,"actionDistance",Math.PI/6),c.nodes=C(()=>s(l.state).nodes.filter(d=>d.type===u)),ne(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),ne(d,"visibility",ve.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),ne(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=U.Right){const g=l.nodes.value.slice().filter(f=>f===u||(d===U.Down||d===U.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===U.Left||d===U.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===U.Right&&f.position.xu.position.x+c||d===U.Up&&f.position.y>u.position.y+c||d===U.Down&&f.position.yf.position.x-h.position.x:d===U.Left?(f,h)=>h.position.x-f.position.x:d===U.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f0&&w>c)break}},i[Je]=function(){const{nodes:u,types:c,state:d,visibility:g,width:f,height:h,style:w,classes:v,links:y,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:x,receivingNode:j}=this;return{nodes:u,types:c,state:d,visibility:g,width:f,height:h,style:s(w),classes:v,links:y,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:x,receivingNode:j,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function de(e,t,...n){return Kn(e)?e(t,...n):s(e)}function On(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const xn={};We.on("addLayer",e=>{const t=Ii(e,xr);xn[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});We.on("removeLayer",e=>{var t;(t=xn[e.id])==null||t.call(xn),xn[e.id]=void 0});function Yn(e,t="points",n=0,i=void 0){const r=Ee(e)?e:nt(e);if(r.displayName=t,r.precision=n,r.small=i,!Ee(e)){const a=r[Mt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function ni(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?bt(e.small?n:o.floor(n)):bn(n,e.precision,e.small)}We.on("setupVue",e=>e.use(ua));function cu(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const du=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:{type:O(Object,String,Function),required:!0},style:O(String,Object,Array),classes:O(Object),glowColor:O(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Ne(e),a=wr(n),l=C(()=>{const c=we(i);return c==null||c===""?{}:s(r)?cu(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:ve,isVisible:Oe,isHidden:an}}});function fu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(k(),E("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:ge(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(k(),ee(qe(e.component)))],6)):B("",!0)}var Er=ce(du,[["render",fu],["__scopeId","data-v-21427abb"]]);const pu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},activeTab:{type:O(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:O(Object),required:!0},style:O(String,Object,Array),classes:O(Object),buttonContainerStyle:O(String,Object,Array),buttonContainerClasses:O(Object)},components:{Sticky:ti,TabButton:Er},setup(e){const{activeTab:t}=Ne(e),n=C(()=>ht[se.theme].floatingTabs),i=rt("");ct(()=>{const u=we(t);if(u==null){i.value="";return}if(yt(u)){i.value=oe(u);return}i.value=oe(s(u.display))});const r=C(()=>{const u=we(t);return yt(u)||!u?void 0:s(u.classes)}),a=C(()=>{const u=we(t);return yt(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:g,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:g,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:ve,component:i,gatherButtonProps:l,unref:s,isVisible:Oe,isHidden:an}}});function gu(e,t,n,i,r,a){var c,d;const l=ft("TabButton"),u=ft("Sticky");return e.isVisible(e.visibility)?(k(),E("div",{key:0,class:ge(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:ge(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Pe(e.unref(e.buttonContainerStyle))},{default:W(()=>[_("div",{class:ge(["tab-buttons",{floating:e.floating}])},[(k(!0),E(ie,null,hn(e.unref(e.tabs),(g,f)=>(k(),ee(l,Ot({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(g.tab)===e.unref(e.activeTab)},e.gatherButtonProps(g)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(k(),ee(qe(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var mu=ce(pu,[["render",gu],["__scopeId","data-v-58dbf83a"]]);const vu=Symbol("TabButton"),hu=Symbol("TabFamily");function bu(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=nt(Object.keys(e)[0],!1);return Le(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=rn("tabFamily-"),r.type=hu,r[at]=mu,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=vu,d[at]=Er,$(d,"visibility"),ne(d,"visibility",ve.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=C(()=>{const u=s(a.tabs);if(n.value in u&&Oe(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(d=>Oe(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),ne(r,"visibility",ve.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[Je]=function(){const{visibility:u,activeTab:c,selected:d,tabs:g,style:f,classes:h,buttonContainerClasses:w,buttonContainerStyle:v}=this;return{visibility:u,activeTab:c,selected:d,tabs:g,style:s(f),classes:h,buttonContainerClasses:w,buttonContainerStyle:v}};const a=r;return a})}const Pr=o.ln(10);function En(e){return e}function yu(e,t){if(F(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function wu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function _u(e){return m.neg(e)}function Nu(e,t,n){if(F(t))return t.invert(o.sub(e,he(n)));if(F(n))return n.invert(o.sub(e,he(t)));throw new Error("Could not invert due to no input being a variable")}function Cu(e,t,n){var i,r;if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function ku(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Mu(e,t,n){if(F(t))return t.invert(o.add(e,he(n)));if(F(n))return n.invert(o.sub(he(t),e));throw new Error("Could not invert due to no input being a variable")}function Su(e,t,n){var i,r;if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Iu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function $u(e,t,n){if(F(t))return t.invert(o.div(e,he(n)));if(F(n))return n.invert(o.div(e,he(t)));throw new Error("Could not invert due to no input being a variable")}function xu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Eu(e,t,n){if(F(t))return m.div(e,n);if(F(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Pu(e,t,n){if(F(t))return t.invert(o.mul(e,he(n)));if(F(n))return n.invert(o.div(he(t),e));throw new Error("Could not invert due to no input being a variable")}function Tu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Du(e,t,n){if(F(t))return m.mul(e,n);if(F(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Fu(e,t){if(F(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Au(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Ou(e,t){if(F(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function qu(e){return o.ln(e).sub(1).times(e).div(Pr)}function Ru(e,t){if(F(t)){const n=Pr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Vu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:qu,invert:Ru})}throw new Error("Could not integrate due to no input being a variable")}function Bu(e,t,n){if(F(t))return t.invert(o.pow(he(n),e));if(F(n))return n.invert(o.root(he(t),e));throw new Error("Could not invert due to no input being a variable")}function Lu(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function ju(e,t,n){if(F(t)){const i=o.ln(he(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function zu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:Lu,invert:ju})}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t){if(F(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function Gu(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function Wu(e,t){if(F(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Hu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Gu,invert:Wu})}throw new Error("Could not integrate due to no input being a variable")}function Zu(e,t){if(F(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function Yu(e){return o.ln(e).sub(1).times(e)}function Xu(e,t){if(F(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function Ju(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:Yu,invert:Xu})}throw new Error("Could not integrate due to no input being a variable")}function Ku(e,t,n){if(F(t))return t.invert(o.root(e,he(n)));if(F(n))return n.invert(o.ln(e).div(o.ln(he(t))));throw new Error("Could not invert due to no input being a variable")}function Qu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function ec(e,t){if(F(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function tc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function nc(e,t,n){if(F(t))return t.invert(o.ln(e).div(he(n)));if(F(n))return n.invert(o.root(he(t),e));throw new Error("Could not invert due to no input being a variable")}function ic(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function rc(e,t,n){if(F(t))return t.invert(o.root(e,o.recip(he(n))));if(F(n))return n.invert(o.ln(he(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function ac(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function sc(e,t){if(F(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function oc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function lc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function uc(e,t,n,i){if(F(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function cc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function dc(e,t,n,i){if(F(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,he(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function fc(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function pc(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function gc(e,t,n){if(F(t))return t.invert(o.tetrate(e,o.minabs(1e308,he(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function mc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function vc(e,t,n,i){if(F(t))return t.invert(o.layeradd(e,o.minabs(1e308,he(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function hc(e,t){if(F(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function bc(e,t){if(F(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function yc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function wc(e,t){if(F(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function _c(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Nc(e,t){if(F(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function Cc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function kc(e,t){if(F(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Mc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Sc(e,t){if(F(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Ic(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function $c(e,t){if(F(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function xc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Ec(e,t){if(F(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Pc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Tc(e,t){if(F(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Dc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Fc(e,t){if(F(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Ac(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Oc(e,t){if(F(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function qc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Rc(e,t){if(F(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Vc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Bc(e,t){if(F(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Lc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function jc(e,t){if(F(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function zc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function _n(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:En})}function F(e){return e instanceof _e&&e.hasVariable()}function he(e,t){return e instanceof _e?e.evaluate(t):s(e)}function Uc(){return m.pow(this,2).div(2)}function Gc(){return this}const Me=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Mt in n?n[Mt]:n)),"variable"in e?(typeof e.variable=="object"&&Mt in e.variable&&(e.variable=e.variable[Mt]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:Uc,internalIntegrateInner:Gc,applySubstitution:En}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var h,w;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((v,y)=>v+(y instanceof Me?y.internalVariables:0),0),c=t.find(v=>v instanceof Me&&v.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,g=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(w=c==null?void 0:c.isIntegrable())!=null?w:!1;return{inputs:t,internalEvaluate:n,internalInvert:g?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>he(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:he(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Me&&e.inputs[n]instanceof Me?t.equals(e.inputs[n]):!(t instanceof Me)&&!(e.inputs[n]instanceof Me)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=V(0),r=n(m.variable(i)),a=me(t);function l(c){return o.lt(c,s(a))?c:(i.value=o.sub(c,s(a)),o.add(r.evaluate(),s(a)))}function u(c,d){if(F(d)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),d.invert(c);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:l,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,i){const r=V(0),a=m.variable(r),l=n(a),u=i==null?void 0:i(a),c=me(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function g(f,h){if(!F(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new m({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?g:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:yu,applySubstitution:_u,integrate:wu})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:Nu,integrate:Cu,integrateInner:ku,applySubstitution:En})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Mu,integrate:Su,integrateInner:Iu,applySubstitution:En})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:$u,integrate:xu,applySubstitution:Eu})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:Pu,integrate:Tu,applySubstitution:Du})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Fu,integrate:Au})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:En})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:Ou,integrate:Vu})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:Bu,integrate:zu})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:Uu,integrate:Hu})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:Zu,integrate:Ju})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:Ku,integrate:Qu})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:ec,integrate:tc})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:nc,integrate:ic})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:rc,integrate:ac})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:sc,integrate:oc})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:lc,invert:uc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:cc,invert:dc})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:fc})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:pc,invert:gc})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:mc,invert:vc})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:hc})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:bc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:yc})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Sc,integrate:_c})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:$c,integrate:Cc})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Ec,integrate:Mc})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:wc,integrate:Ic})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Nc,integrate:xc})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:kc,integrate:Pc})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:Rc,integrate:Dc})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:Bc,integrate:Ac})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:jc,integrate:qc})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Tc,integrate:Vc})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Fc,integrate:Lc})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:Oc,integrate:zc})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let _e=Me;_e.negate=Me.neg;_e.negated=Me.neg;_e.sgn=Me.sign;_e.plus=Me.add;_e.subtract=Me.sub;_e.minus=Me.sub;_e.multiply=Me.mul;_e.times=Me.mul;_e.divide=Me.div;_e.divideBy=Me.div;_e.dividedBy=Me.div;_e.reciprocal=Me.recip;_e.reciprocate=Me.recip;_e.max=_n(o.max);_e.min=_n(o.min);_e.minabs=_n(o.minabs);_e.maxabs=_n(o.maxabs);_e.clampMin=_n(o.clampMin);_e.clampMax=_n(o.clampMax);_e.logarithm=Me.log;class m extends _e{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Tr(e,t,n=!0,i,r=o.dInf){const a=me(n),l=me(i),u=me(r);return C(()=>{var h,w,v,y;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),g=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,g)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((w=s(e.innermostVariable))!=null?w:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),g>0){f=o.sub(f,g).clampMin(0);let I;for(d?I=Ft(e,f,!0,0):I=e.evaluate(o.add((v=s(e.innermostVariable))!=null?v:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER);){const A=e.evaluate(f.add((y=s(e.innermostVariable))!=null?y:0));if(o.add(I,A).lte(t.value))f=f.add(1),I=o.add(I,A);else break}}return f})}function Ft(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)))}else if(u=e.evaluate(a),a=a.add(1),l.gt(1e308))return o.sub(l,a).add(1).times(u)}for(let d=a.toNumber();d{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=me(n),u=me(i),c=r==null?void 0:me(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>m.add(d,l),enabled:c,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[dt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",zt(s(l))])]))}})}function Fe(e){return Le(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=me(n),u=me(i),c=r==null?void 0:me(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>m.times(d,l),enabled:c,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[dt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[T("\xD7"),zt(s(l))])]))}})}function tr(e){return Le(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=me(n),c=me(i),d=r==null?void 0:me(r);return{apply:g=>{let f=g;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:g=>{let f=g;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:g=>a?m.add(g,1).pow(u).sub(1):m.pow(g,u),enabled:d,description:i==null?void 0:K(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[dt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[T("^"),zt(s(u))])]))}})}function kt(e){return Le(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?C(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?K(()=>p(ie,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(dt)])):void 0}})}const Tn=m.variable(0).add(1),si={id:"deselect",icon:"close",tooltip:e=>({text:"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},on={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${bt(M.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},M.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function oi(e,t=1/0){const n=e(m.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${bt(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(M.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(M.energy.value,r)&&(M.energy.value=o.sub(M.energy.value,r)),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},M.board.selectedAction.value=null},visibility:i=>o.add(i.state.maxConnections,M.computedBonusConnectionsModifier.value).lt(t)}}function Dr(e,t){var n,i;if(((n=M.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=M.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,M.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Wc(e,t){var n,i;if(((n=M.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=M.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,M.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Hc(e,t){var n,i;if(((n=M.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=M.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,M.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Fr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,M.computedBonusConnectionsModifier.value).lte(r.length)}function Ar(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},M.board.selectedNode.value=e}function Zc(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,M.computedBonusConnectionsModifier.value).lte(r.length)}function Yc(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},M.board.selectedNode.value=e}function Xc(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,M.computedBonusConnectionsModifier.value).lte(r.length)}function Jc(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},M.board.selectedNode.value=e}function xe(e){return e===M.board.selectedNode.value||e.state.powered}function et(e){return M.empowerer.value!=null&&xe(M.empowerer.value)&&M.empowerer.value.state.tools.includes(e)}function Kc(e){var a,l,u;const t=(u=(l=(a=M.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=M.resourceLevels.value[e],i=Ft(Tn,n,!0),r=Ft(Tn,o.add(n,1),!0);return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function Un(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.lt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const Qc={key:0},ed={key:0,class:"mark star"},td=["src"],nd=Y({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(k(),E("div",Qc,[e.mark===!0?(k(),E("div",ed)):(k(),E("img",{key:1,class:"mark",src:e.mark},null,8,td))])):B("",!0)}});var qn=ce(nd,[["__scopeId","data-v-2207999f"]]);const id=Y({__name:"Node",props:{id:null},setup(e){const n=Ne(e),i=Xn(Di,()=>{}),r=Xn(Fi,()=>{}),a=rt(null),l=C(()=>a.value&&a.value.parentElement);return it([l,n.id],([u,c],[d,g])=>{d&&r(s(g)),u&&i(c,u)}),lr(()=>r(s(n.id))),(u,c)=>(k(),E("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Rn=ce(id,[["__scopeId","data-v-a48cb382"]]),rd=Y({props:{display:{type:O(Object,String,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),onClick:Function,onHold:Function,canClick:{type:O(Boolean),required:!0},small:Boolean,mark:O(Boolean,String),id:{type:String,required:!0}},components:{Node:Rn,MarkNode:qn},setup(e){const{display:t,onClick:n,onHold:i}=Ne(e),r=rt("");ct(()=>{var g;const u=we(t);if(u==null){r.value="";return}if(yt(u)){r.value=oe(u);return}const c=oe((g=u.title)!=null?g:"","h3"),d=oe(u.description,"div");r.value=oe(K(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=yr(n,i);return{start:a,stop:l,comp:r,Visibility:ve,isVisible:Oe,isHidden:an,unref:s}}});function ad(e,t,n,i,r,a){var c;const l=ft("MarkNode"),u=ft("Node");return e.isVisible(e.visibility)?(k(),E("button",{key:0,style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:ge({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)?(k(),ee(qe(e.unref(e.comp)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):B("",!0)}var Or=ce(rd,[["render",ad],["__scopeId","data-v-211328c0"]]);const sd=Symbol("Clickable");function od(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Le(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=rn("clickable-"),r.type=sd,r[at]=Or;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),ne(r,"visibility",ve.Visible),$(r,"canClick"),ne(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(g){s(r.canClick)!==!1&&d(g)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,g)=>{var f;return Object.assign(d,(f=g.getGatheredProps)==null?void 0:f.call(g,r))},{});return r[Je]=function(){const{display:d,visibility:g,style:f,classes:h,onClick:w,onHold:v,canClick:y,small:I,mark:A,id:S}=this;return{display:d,visibility:g,style:s(f),classes:h,onClick:w,onHold:v,canClick:y,small:I,mark:A,id:S,...a}},r})}const ld=["x1","y1","x2","y2"],ud=Y({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Ne(e),i=C(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=C(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(k(),E("line",Ot({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,ld))}});const cd=Y({__name:"Links",props:{links:null},setup(e){var c;const n=Gt(e,"links"),i=V(null),r=Xn(Ai,V({})),a=Xn(Oi,V(void 0)),l=V((c=i.value)==null?void 0:c.getBoundingClientRect());it(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),ii(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=C(()=>{var g,f;const d=r.value;return(f=(g=n.value)==null?void 0:g.filter(h=>{var w,v;return((w=d[h.startNode.id])==null?void 0:w.rect)&&((v=d[h.startNode.id])==null?void 0:v.rect)}))!=null?f:[]});return(d,g)=>(k(),E(ie,null,[s(u)?(k(),E("svg",na(Ot({key:0},d.$attrs)),[(k(!0),E(ie,null,hn(s(u),(f,h)=>(k(),ee(ud,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),_("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var dd=ce(cd,[["__scopeId","data-v-063f6d6b"]]);Y({props:{nodes:{type:O(Array),required:!0},leftSideNodes:O(Array),rightSideNodes:O(Array),branches:O(Array)},components:{Links:dd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Ne(e),r=rt();ct(()=>{const u=we(t);r.value=oe(K(()=>p(ie,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(dt)]))])))});const a=rt();ct(()=>{const u=we(n);a.value=u?oe(K(()=>p("span",{class:"left-side-nodes small"},[u.map(dt)]))):""});const l=rt();return ct(()=>{const u=we(i);l.value=u?oe(K(()=>p("span",{class:"side-nodes small"},[u.map(dt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});Y({props:{display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),onClick:Function,onHold:Function,color:O(String),glowColor:O(String),canClick:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:qn,Node:Rn},setup(e){const{onClick:t,onHold:n,display:i}=Ne(e),r=wn(i),{start:a,stop:l}=yr(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:ve,isCoercableComponent:yt,isVisible:Oe,isHidden:an}}});function Pn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>me(u.base)),n.baseText=t.map(u=>me(u.baseText)),n.visible=t.map(u=>me(u.visible)),n.title=t.map(u=>me(u.title)),n.subtitle=t.map(u=>me(u.subtitle)),i=!0),t}const a=nt({},!1);return[K(()=>{const u=r();let c=!0;const d=u.map((g,f)=>{var A,S,x;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[T("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[T(" ("),s(n.subtitle[f]),T(")")]):null]),w=s(a.value[f])?null:p(ie,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[dt((A=s(n.baseText[f]))!=null?A:"Base")]),p("span",{class:"modifier-amount"},[bn((S=s(n.base[f]))!=null?S:1),g.unit])]),g.modifier.description==null?null:dt(s(g.modifier.description))]),v=!c;c=!1;const y=(x=s(n.base[f]))!=null?x:1,I=g.modifier.apply(y);return p(ie,null,[v?p("br",null,null):null,p("div",{style:{"--unit":se.alignUnits&&g.unit!=null?"'"+g.unit+"'":""}},[h,p("br",null,null),w,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[T("Total")]),p("span",{class:"modifier-amount",style:(g.smallerIsBetter===!0?o.gt(I,y!=null?y:1):o.lt(I,y!=null?y:1))?"color: var(--danger)":""},[zt(I),g.unit])])])])});return p(ie,null,[d])}),a]}function nr(e,t,n){const i=me(t),r=me(n);return C(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":ai(o.sub(l,e.value).div(a))})}function fn(e,t,n=1){const i=me(t),r=me(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return K(()=>{var a;if(s(i)){const l=zt(e.evaluate()),u=zt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(ie,null,[p("b",null,[p("i",null,[l,T(" \u2192 "),u])])])}return p(ie,null,[zt(e.evaluate())])})}const vt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Zt=Object.keys(vt),ke={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},xi={dirt:"Replicator",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"BOGO Coupon",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},fd={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 20% stronger":"Material level is 10% stronger"},silver:{description:e=>e?"Doubles each plane's resource gain":"Quadruples each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"Upgrades apply thrice":"Upgrades apply twice"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase":"+1% plane's resource gain per repeatable purchase"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},coalRelic:{description:e=>e?"(Treasures)^2 boost planar speed":"Treasures boost planar speed"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give triple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Power machines)^2 boost ore dropped":"Power machines boost ore dropped"},goldRelic:{description:e=>e?"Each treasure quadruples XP gain":"Each treasure doubles XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs a third the energy":"Creating portals costs half the energy"},platinumRelic:{description:e=>e?"Triple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"ln(energy) boosts planar speed":"log(energy) boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Pt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},Ci=m.variable(0).add(8).times(2).pow10();const pd=Y({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(k(),E("div",{style:Pe({width:e.width,height:e.height})},null,4))}});function ki(e){return Le(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[ni(n.resource,n.cost instanceof m?Ft(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",ni(n.resource,n.cost instanceof m?Ft(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),ne(n,"visibility",ve.Visible),$(n,"cost"),$(n,"requiresPay"),ne(n,"requiresPay",!0),$(n,"cumulativeCost"),ne(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),ne(n,"maxBulkAmount",1),$(n,"directSum"),ne(n,"pay",function(r){const a=n.cost instanceof m?Ft(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=C(()=>{var u;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),l=(u=s(n.directSum))!=null?u:a?10:0;return o.lte(r,l)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=Tr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=C(()=>o.gte(n.resource.value,s(n.cost))),n})}function Li(e){return Le(()=>({requirementMet:C(()=>Oe(e.visibility)),visibility:ve.None,requiresPay:!1}))}function gd(e,t){return Le(()=>({requirementMet:me(e),partialDisplay:t==null?void 0:K(()=>dt(t)),display:t==null?void 0:K(()=>p(ie,null,[T("Req: "),dt(t)])),visibility:t==null?ve.None:ve.Visible,requiresPay:!1}))}function li(e){if(St(e))return e.every(li);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function qr(e){if(St(e))return e.map(qr).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function ui(e,t=1){var n,i;if(St(e)&&(e=e.filter(r=>Oe(r.visibility)),e.length===1&&(e=e[0])),St(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(ie,null,[r.length>0?p("div",null,[T("Costs:")," ",Qi(r.map(l=>l.partialDisplay(t)),p(ie,null,[T(", ")]))]):null,a.length>0?p("div",null,[T("Requires:")," ",Qi(a.map(l=>l.partialDisplay(t)),p(ie,null,[T(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(ie,null,null)}function Rr(e,t=1){var n;St(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var md=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:O(Object,String,Function),earned:{type:O(Boolean),required:!0},requirements:O(Object,Array),image:O(String),style:O(String,Object,Array),classes:O(Object),mark:O(Boolean,String),small:O(Boolean),id:{type:String,required:!0}},components:{Node:Rn,MarkNode:qn},setup(e){const{display:t,requirements:n,earned:i}=Ne(e),r=rt("");return ct(()=>{const a=we(t);if(a==null){r.value="";return}if(yt(a)){r.value=oe(a);return}const l=oe(a.requirement?a.requirement:K(()=>{var d;return ui((d=we(n))!=null?d:[])}),"h3"),u=oe(a.effectDisplay||"","b"),c=we(i)?oe(a.optionsDisplay||"","span"):"";r.value=oe(K(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:ve,isVisible:Oe,isHidden:an}}});function vd(e,t,n,i,r,a){var c;const l=ft("MarkNode"),u=ft("Node");return e.isVisible(e.visibility)?(k(),E("div",{key:0,style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:ge({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(k(),ee(qe(e.comp),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var hd=ce(md,[["render",vd],["__scopeId","data-v-5673325a"]]);const bd=ri(),yd=Symbol("Achievement");let pn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function wd(e,...t){const n=nt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Le(r=>{var c,d,g;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=rn("achievement-"),a.type=yd,a[at]=hd;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,w;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const v=s(f.display);let y;yt(v)?y=oe(v):v.requirement!=null?y=oe(v.requirement):y=ui((w=f.requirements)!=null?w:[]),bd.info(p("div",null,[p("h3",null,[T("Achievement earned!")]),p("div",null,[p(y,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),ne(a,"visibility",ve.Visible);const l=a.visibility;a.visibility=ia(()=>{const f=s(a.display);switch(se.msDisplay){default:case pn.All:return s(l);case pn.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?ve.None:s(l);case pn.Incomplete:return s(a.earned)?ve.None:s(l);case pn.None:return ve.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),ne(a,"showPopups",!0);for(const f of t)(g=f.postConstruct)==null||g.call(f,a);const u=t.reduce((f,h)=>{var w;return Object.assign(f,(w=h.getGatheredProps)==null?void 0:w.call(h,a))},{});if(a[Je]=function(){const{visibility:f,display:h,requirements:w,earned:v,image:y,style:I,classes:A,mark:S,small:x,id:j}=this;return{visibility:f,display:h,requirements:w,earned:v,image:y,style:s(I),classes:A,mark:S,small:x,id:j,...u}},a.requirements){const f=a,h=[Li(f),gd(()=>!f.earned.value),...St(a.requirements)?a.requirements:[a.requirements]];ct(()=>{se.active===X.id&&li(h)&&f.complete()})}return a})}We.on("loadSettings",e=>{ne(e,"msDisplay",pn.All)});const _d=Object.values(pn).map(e=>({label:Ge(e),value:e}));ps(K(()=>p(Vi,{title:K(()=>p("span",{class:"option-title"},[T("Show achievements"),p("desc",null,[T("Select which achievements to display based on criterias.")])])),options:_d,"onUpdate:modelValue":e=>se.msDisplay=e,modelValue:se.msDisplay},null)));const Nd=Y({props:{progress:{type:O(String,Object,Number),required:!0},width:{type:O(Number),required:!0},height:{type:O(Number),required:!0},direction:{type:O(String),required:!0},display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),borderStyle:O(Object,String,Array),textStyle:O(Object,String,Array),baseStyle:O(Object,String,Array),fillStyle:O(Object,String,Array),mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:qn,Node:Rn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=Ne(e),l=C(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=C(()=>{const d={width:we(n)+.5+"px",height:we(i)+.5+"px"};switch(s(r)){case U.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=we(n)+1+"px";break;case U.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=we(n)+1+"px";break;case U.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case U.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case U.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=wn(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:ve,isVisible:Oe,isHidden:an}}});function Cd(e,t,n,i,r,a){var c,d,g,f,h,w,v;const l=ft("MarkNode"),u=ft("Node");return e.isVisible(e.visibility)?(k(),E("div",{key:0,style:Pe([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:ge({bar:!0,...e.unref(e.classes)})},[_("div",{class:"overlayTextContainer border",style:Pe([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(k(),E("span",{key:0,class:"overlayText",style:Pe(e.unref(e.textStyle))},[(k(),ee(qe(e.component)))],4)):B("",!0)],4),_("div",{class:"border",style:Pe([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(g=e.unref(e.style))!=null?g:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[_("div",{class:"fill",style:Pe([e.barStyle,(w=e.unref(e.style))!=null?w:{},(v=e.unref(e.fillStyle))!=null?v:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var kd=ce(Nd,[["render",Cd],["__scopeId","data-v-6bd06b56"]]);const Md=Symbol("Bar");function Sd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Le(i=>{var l,u;const r=e.call(i,i);r.id=rn("bar-"),r.type=Md,r[at]=kd;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),ne(r,"visibility",ve.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var g;return Object.assign(c,(g=d.getGatheredProps)==null?void 0:g.call(d,r))},{});return r[Je]=function(){const{progress:c,width:d,height:g,direction:f,display:h,visibility:w,style:v,classes:y,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:x,mark:j,id:le}=this;return{progress:c,width:d,height:g,direction:f,display:h,visibility:w,style:s(v),classes:y,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:x,mark:j,id:le,...a}},r})}function Id(e,...t){return Le(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=C(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=C(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=C(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),ne(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function $d(e){return Id(e)}const Vr=Symbol("Repeatable");function xd(e,...t){const n=nt(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Le(r=>{var h,w,v;const a=e.call(r,r);a.id=rn("repeatable-"),a.type=Vr,a[at]=Or;for(const y of t)(h=y.preConstruct)==null||h.call(y,a);a.amount=n,a.amount[yn]=(w=a.initialAmount)!=null?w:0,Object.assign(a,i);const l={requirementMet:C(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:ve.None},u=Li(a);St(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=C(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=C(()=>{const y=s(c)||{};return a.maxed.value&&(y.bought=!0),y}),a.amountToIncrease=C(()=>o.clampMin(qr(a.requirements),1)),a.canClick=C(()=>li(a.requirements));const d=a.onClick;a.onClick=function(y){const I=a;!s(I.canClick)||(Rr(a.requirements,s(a.amountToIncrease)),I.amount.value=o.add(I.amount.value,1),d==null||d(y))},$(a,"display");const g=a.display;a.display=K(()=>{var I,A,S;const y=s(g);if(yt(y)){const x=oe(y);return p(x,null,null)}if(y!=null){const x=a,j=oe((I=y.title)!=null?I:"","h3"),le=oe((A=y.description)!=null?A:""),Q=oe((S=y.effectDisplay)!=null?S:"");return p("span",null,[y.title==null?null:p("div",null,[p(j,null,null)]),y.description==null?null:p(le,null,null),y.showAmount===!1?null:p("div",null,[p("br",null,null),p(ie,null,[T("Amount: "),bt(x.amount.value)]),o.isFinite(s(x.limit))?p(ie,null,[T(" / "),bt(s(x.limit))]):void 0]),y.effectDisplay==null?null:p("div",null,[p("br",null,null),T("Currently: "),p(Q,null,null)]),x.maxed.value?null:p("div",null,[p("br",null,null),ui(x.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),ne(a,"visibility",ve.Visible),$(a,"limit"),ne(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const y of t)(v=y.postConstruct)==null||v.call(y,a);const f=t.reduce((y,I)=>{var A;return Object.assign(y,(A=I.getGatheredProps)==null?void 0:A.call(I,a))},{});return a[Je]=function(){const{display:y,visibility:I,style:A,classes:S,onClick:x,canClick:j,small:le,mark:Q,id:G}=this;return{display:y,visibility:I,style:s(A),classes:S,onClick:x,canClick:j,small:le,mark:Q,id:G,...f}},a})}function ir(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),ne(t,"direction",U.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=nt(!1,!1)),At(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Nr(t.pinned)):e.pinned=t.pinned);const n=e[at];e[at]=Ce;const i=e[Je].bind(e);e[Je]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:g,pinned:f}=this;return{element:{[at]:n,[Je]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:g,pinned:f}}.bind(t)}),t}var Ed=Y({props:{display:{type:O(String,Object,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),requirements:{type:Object,required:!0},canPurchase:{type:O(Boolean),required:!0},bought:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Rn,MarkNode:qn},setup(e){const{display:t,requirements:n,bought:i}=Ne(e),r=rt("");return ct(()=>{const a=we(t);if(a==null){r.value="";return}if(yt(a)){r.value=oe(a);return}const l=oe(a.title||"","h3"),u=oe(a.description,"div"),c=oe(a.effectDisplay||"");r.value=oe(K(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[T("Currently: "),p(c,null,null)]):null,i.value?null:p(ie,null,[p("br",null,null),ui(n.value)])])))}),{component:r,unref:s,Visibility:ve,isVisible:Oe,isHidden:an}}});const Pd=["disabled"];function Td(e,t,n,i,r,a){var c;const l=ft("MarkNode"),u=ft("Node");return e.isVisible(e.visibility)?(k(),E("button",{key:0,style:Pe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:ge({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)?(k(),ee(qe(e.unref(e.component)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Pd)):B("",!0)}var Dd=ce(Ed,[["render",Td],["__scopeId","data-v-9be6bac0"]]);const Br=Symbol("Upgrade");function Fd(e,...t){const n=nt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Le(r=>{var c,d;const a=e.call(r,r);a.id=rn("upgrade-"),a.type=Br,a[at]=Dd;for(const g of t)(c=g.preConstruct)==null||c.call(g,a);a.bought=n,Object.assign(a,i),a.canPurchase=C(()=>!n.value&&li(a.requirements)),a.purchase=function(){var f;const g=a;!s(g.canPurchase)||(Rr(a.requirements),n.value=!0,(f=g.onPurchase)==null||f.call(g))};const l=Li(a);St(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),ne(a,"visibility",ve.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const g of t)(d=g.postConstruct)==null||d.call(g,a);const u=t.reduce((g,f)=>{var h;return Object.assign(g,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[Je]=function(){const{display:g,visibility:f,style:h,classes:w,requirements:v,canPurchase:y,bought:I,mark:A,id:S,purchase:x}=this;return{display:g,visibility:f,style:s(h),classes:w,requirements:v,canPurchase:y,bought:I,mark:A,id:S,purchase:x,...u}},a})}function Ad(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const Od={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},rr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Mi(e){const t=rr[Math.floor(e()*rr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const sr=ri();function Lr(e,t,n,i){return qi(e,function(){const r=Ad(0,n>>0,n>>32,1);for(let R=0;R<12;R++)r();const a=Mi(r),l=Wn([.64,.75,.55],r),u=Wn([.18,.2,.25],r),c=Yn(0,Mi(r)),d=nt(0),g=Zt.indexOf(t);let f=r();const h=i.reduce((R,L)=>(R[L.type]=L.data,R),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const w=f+g+1,v="increaseRewards"in h?w+1:w;let y="relic"in h?g+2:Math.ceil(r()*(g+2));"increaseLength"in h&&y++;const I=[],A=kt(()=>[...I,Fe(()=>({multiplier:()=>M.isEmpowered("silver")?4:2,description:()=>(M.isEmpowered("silver")?"Empowered ":"")+ke.silver.name,enabled:()=>M.toolNodes.value.silver!=null})),Fe(()=>({multiplier:()=>(M.isEmpowered("diamond")?2:1)*He.filter(R=>R.bought.value).length/10,description:()=>(M.isEmpowered("diamond")?"Empowered ":"")+ke.diamond.name,enabled:()=>M.toolNodes.value.diamond!=null})),Fe(()=>({multiplier:()=>o.div(d.value,6e3).times(M.isEmpowered("emerald")?2:1),description:()=>(M.isEmpowered("emerald")?"Empowered ":"")+ke.emerald.name,enabled:()=>M.toolNodes.value.emerald!=null}))]),S=C(()=>A.apply(0)),x=[],j={};function le({feature:R,canClick:L,modifier:Se,cost:wt,previewModifier:ln,showETA:je,previewCost:P}){L=me(L),je=me(je);const D=ys(R);x.push({shouldShowPreview:C(()=>s(L)&&D.value),modifier:kt(()=>{const ae=I.slice();return ae.splice(ae.indexOf(Se),1,ln),ae}),cost:P!=null?P:wt}),I.push(Se);const q=nr(c,S,()=>he(wt)),z=ir(R,{display:je==null?q:()=>s(je)?q.value:"",direction:U.Down});return{isHovering:D,eta:q,tooltip:z}}const Q=[],G=V(0);let H=m.variable(G).times(0);const Re={};let ot=!0;const J=C(()=>o.add(w,r()-.5).pow_base(2).times(10).times(H.evaluate())),be=[];for(let R=0;R({addend:$e,description:Nt,enabled:Ue.bought})),lt=Jt(()=>({addend:$e}));break}case"mult":{const $e=r()*5+1;Ct=`Multiply previous ${c.displayName} gain by x${fe($e)}.`,H=H.add(o.sub($e,1).times(Re[ut-1])),mt=Fe(()=>({multiplier:$e,description:Nt,enabled:Ue.bought})),lt=Fe(()=>({multiplier:$e}));break}case"pow":{const $e=r()/5+1.1;Ct=`Raise previous ${c.displayName} gain to the ^${fe($e)}`,H=H.add(o.pow(Re[ut-1],$e)).sub(Re[ut-1]),mt=tr(()=>({exponent:$e,description:Nt,enabled:Ue.bought})),lt=tr(()=>({exponent:$e}))}}Re[G.value]=H.evaluate(),G.value++;const Vt=ot,Ue=Fd(()=>({requirements:ki(()=>({resource:zn(c),cost:_t})),display:{title:Nt,description:Ct},visibility:Vt}));le({feature:Ue,canClick:()=>Ue.canPurchase.value,modifier:mt,cost:_t,showETA:()=>!Ue.bought.value,previewModifier:lt}),Sn.push(Ue)}Q.push(Sn);break;case"repeatables":const $t=[];for(let ze=0;ze<3;ze++){const dn=Hn({add:1.5,mult:3},r),_t=G.value,Nt=J.value,Ct=Gn(r);let mt="",lt,ut,Vt,Ue;const $e=m.variable(C(()=>Ze.amount.value)).times(2);switch(dn){case"add":{const De=o.add(Nt,10).times(r()+.5);mt=`Gain ${fe(De)} ${c.displayName}/s`,Ue=$e.add(1).times(Nt),H=H.add(C(()=>o.sub(G.value,_t).add(1).times(5).times(De))),lt=C(()=>fe(o.times(De,Ze.amount.value))+"/s"),ut=Jt(()=>({addend:()=>o.times(De,Ze.amount.value),description:Ct,enabled:()=>o.gt(Ze.amount.value,0)})),Vt=Jt(()=>({addend:()=>o.add(Ze.amount.value,1).times(De)}));break}case"mult":{const De=r()*.75+1.25;mt=`Multiply previous ${c.displayName} gain by x${fe(De)}.`,Ue=$e.pow_base(De).times(Nt),H=H.add(C(()=>o.sub(G.value,_t).add(1).times(5).pow_base(De).sub(1).times(Re[_t-1]))),lt=C(()=>"x"+fe(o.pow(De,Ze.amount.value))),ut=Fe(()=>({multiplier:()=>o.pow(De,Ze.amount.value),description:Ct,enabled:()=>o.gt(Ze.amount.value,0)})),Vt=Fe(()=>({multiplier:()=>o.add(Ze.amount.value,1).pow_base(De)}));break}}Re[G.value]=H.evaluate(),G.value++;const bi=ot,Ze=xd(()=>({requirements:ki(()=>({resource:zn(c),cost:Ue})),display:()=>({title:Ct,description:mt,effectDisplay:s(lt)}),visibility:bi}));le({feature:Ze,canClick:()=>s(Ze.canClick),modifier:ut,cost:Ue,previewModifier:Vt}),$t.push(Ze)}Q.push($t);break;case"conversion":const Ie=Yn(0,Mi(r)),xt=Wn([.64,.75,.55],r),In=J.value,jr=r()/2+.25,zi=r()/2+.25,Ui=G.value;H=H.add(C(()=>o.sub(G.value,Ui).add(1).pow_base(5).pow(zi).times(Re[Ui-1])));const Et=$d(()=>({baseResource:zn(c),gainResource:Ie,formula:ze=>ze.div(In).pow(jr),spend(){c.value=0}}));Re[G.value]=H.evaluate(),G.value+=2;const zr=ot,Gi=Gn(r),vi=m.variable(Ie).pow(zi).add(1),Ur=Fe(()=>({multiplier:()=>vi.evaluate(),description:Gi,enabled:()=>o.gt(Ie.value,0)})),Gr=Fe(()=>({multiplier:()=>vi.evaluate(o.add(Ie.value,Et.actualGain.value))})),cn=od(()=>({display:{title:Gi,description:K(()=>p("span",null,[T("Reset "),c.displayName,T(" for")," ",ni(Ie,o.clampMin(Et.actualGain.value,1))," ",Ie.displayName,p("br",null,null),p("div",null,[T("Next:")," ",ni(c,o.lt(Et.actualGain.value,1)?Et.currentAt.value:Et.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(Et.actualGain.value,1),prestigeResource:Ie,onClick:Et.convert,visibility:zr})),{isHovering:Wr}=le({feature:cn,canClick:()=>s(cn.canClick),modifier:Ur,cost:In,previewCost:c,previewModifier:Gr}),Wi=C(()=>Wr.value&&cn.canClick.value);Q.push([cn]);const Hr=fn(m.variable(Ie),Wi,Et.actualGain),Zr=fn(vi,Wi,Et.actualGain);j[R*2]=K(()=>p(ie,null,[Oe(cn.visibility)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:xt,textShadow:`0px 0px 10px ${xt}`}},[Hr()])," ",Ie.displayName,T(","),p("br",null,null),T("providing a "),Zr(),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,Ni(cn)]));break;case"xp":{const ze=Yn(0),hi=ot,dn=G.value,_t=Gn(r),Nt=o.add(w,r()-.5).pow_base(2).times(10),Ct=r()/4+1.125,mt=r()/2+1.25,lt=m.variable(0).pow(Ct).times(Nt),ut=Tr(lt,ze,!0,10,o.dInf),Vt=C(()=>Ft(lt,ut.value,!0,10)),Ue=C(()=>Ft(lt,o.add(ut.value,1),!0,10)),$e=C(()=>o.pow(mt,ut.value)),bi=Fe(()=>({multiplier:$e,description:_t,enabled:()=>Oe(De.visibility)}));H=H.add(C(()=>o.sub(G.value,dn).add(1).sqrt().times(3).pow(mt).times(Re[dn-1]))),Re[G.value]=H.evaluate(),G.value+=2;const Ze=Wn([.18,.2,.25],r),De=Sd(()=>({direction:U.Right,width:300,height:20,progress:()=>o.sub(ze.value,Vt.value).div(o.sub(Ue.value,Vt.value)).toNumber(),visibility:hi,xp:ze,display:K(()=>p("span",null,[fe(ze.value),T("/"),fe(Ue.value)])),fillStyle:`background-color: ${Ze}`}));this.on("preUpdate",Yr=>{if(M.activePortals.value.some(yi=>yi.state.id===e)&&Oe(De.visibility)){const yi=o.times(pt.value,Yr);ze.value=o.add(yi,ze.value)}}),I.push(bi),Q.push([De]),j[R*2]=K(()=>p(ie,null,[Oe(De.visibility)?p("div",{style:"margin: 10px"},[T("You have "),p("h3",null,[_t]),T(" Lv. "),Ae(ut.value),T(","),p("br",null,null),T("providing a "),fe($e.value),T("x multiplier to previous")," ",c.displayName,T(" gain"),p("br",null,null)]):null,Ni(De)]));break}}const wt={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(M.influenceNodes.value).length+be.length===Object.keys(Pt).length?0:"increaseInfluences"in h?20:2,relic:0};let ln=Hn(wt,r);R===y-1&&"relic"in h&&(ln="relic");let je="",P,D,q,z,ae,ue;switch(ln){case"cache":z=Si(r,i),je=`Gain ${fe(v)}x your current ${z}.`,D=()=>{var Ie,xt,In;return M.grantResource(z,o.times((In=(xt=(Ie=M.resourceNodes.value[z])==null?void 0:Ie.state)==null?void 0:xt.amount)!=null?In:0,v))};break;case"generation":z=Si(r,i);const Sn=o.div(v,120).times(vt[z]);je=`Gain ${fe(Sn)} ${z}/s while plane is active.`,P=Ie=>M.grantResource(z,o.times(Ie,Sn)),q=C(()=>M.resourceNodes.value[z]);break;case"resourceMulti":ae=z=Si(r,i),ue=o.div(v,17).pow_base(2),je=`Gain ${fe(ue)}x ${z} while plane is active.`;break;case"energyMulti":ae="energy",ue=o.div(v,17).add(1),je=`Gain ${fe(ue)}x energy while plane is active.`;break;case"influences":const $t=Object.keys(Pt)[Math.floor(r()*Object.keys(Pt).length)];be.push($t),je=`Gain a new portal influence (${Pt[$t].display})`,D=()=>{if($t in M.influenceNodes.value){sr.warning(`Error: ignoring duplicate portal influence (${Pt[$t].display})`);return}const Ie={id:On(M.board),position:{...M.board.types.portal.nodes.value.find(xt=>xt.state.id===e).position},type:"influence",state:{type:$t,data:Pt[$t].initialData}};M.board.placeInAvailableSpace(Ie),M.board.nodes.value.push(Ie)};break;case"relic":je=`Gain the ${t}-tier planar relic (${xi[t]})`,D=()=>{if(t==="ultimatum"){ji.value=!0;return}if(`${t}Relic`in M.toolNodes.value)sr.warning(`Error: ignoring duplicate relic (${xi[t]})`);else{const Ie={id:On(M.board),position:{...M.board.types.portal.nodes.value.find(xt=>xt.state.id===e).position},type:"passive",state:`${t}Relic`};M.board.placeInAvailableSpace(Ie),M.board.nodes.value.push(Ie)}}}const un=ot,It=J.value,gt=wd(()=>({requirements:ki(()=>({resource:zn(c),cost:It})),visibility:un,display:{requirement:`${fe(It)} ${c.displayName}`,effectDisplay:je},style:"width: 100%",classes:{final:R===y-1},update:P,onComplete:D,link:q,effectedResource:ae,resourceMulti:ue})),Mn=nr(c,S,It);ir(gt,{display:()=>gt.earned.value?"":Mn.value,direction:U.Down}),Q.push([gt]),ot=gt.earned}const He=Ii(Q,Br);Ii(Q,Vr);const Ke=kt(()=>[Fe(()=>({multiplier:()=>{var R,L,Se;return o.add((Se=(L=(R=M.board.types.booster.nodes.value[0])==null?void 0:R.state)==null?void 0:L.level)!=null?Se:0,1)},description:"Booster",enabled:()=>{var R,L,Se;return(Se=(L=(R=M.board.types.booster.nodes.value[0])==null?void 0:R.state)==null?void 0:L.portals.includes(e))!=null?Se:!1}}))]),pt=C(()=>Ke.apply(1)),[Ve,Nn]=Pn(()=>[{title:`${Ge(c.displayName)} Gain`,modifier:A,base:0,unit:"/s"},{title:`${Ge(c.displayName)} Time Speed`,modifier:Ke,base:1,visible:()=>o.gt(pt.value,1)}]),Cn=V(!1),di=K(()=>p(qt,{modelValue:Cn.value,"onUpdate:modelValue":R=>Cn.value=R},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>Xe(Ve)}));this.on("preUpdate",R=>{if(!M.activePortals.value.some(Se=>Se.state.id===e))return;const L=o.times(pt.value,R);d.value=o.add(d.value,L),c.value=o.times(S.value,L).add(c.value),Qe.value.forEach(Se=>{var wt;(wt=Se.update)==null||wt.call(Se,L)})});const Bn=C(()=>{const R=x.find(L=>L.shouldShowPreview.value);return R?o.neg(he(R.cost)):0}),Ln=C(()=>{const R=x.find(L=>L.shouldShowPreview.value);return R?o.sub(R.modifier.apply(0),S.value):0}),fi=fn(m.variable(0).add(c),()=>o.neq(Bn.value,0),Bn),pi=fn(m.variable(0).add(S),()=>o.neq(Ln.value,0),Ln),gi=C(()=>{const R=[];return Qe.value.forEach(L=>{L.link&&R.push(L.link)}),R}),mi=C(()=>{const R={};return Qe.value.forEach(L=>{L.effectedResource!=null&&L.resourceMulti!=null&&(R[L.effectedResource]!=null?R[L.effectedResource]=o.times(R[L.effectedResource],L.resourceMulti):R[L.effectedResource]=L.resourceMulti)}),R}),Qe=C(()=>{const R=[];for(let L=1;Lo.lt(Qe.value.length,y)&&Q.some(R=>R.some(L=>"earned"in L&&s(L.earned)||"bought"in L&&s(L.bought)?!1:("canClick"in L&&s(L.canClick)||"canPurchase"in L&&s(L.canPurchase),!0))));return{tier:nt(t),seed:nt(n),influences:nt(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:Q,resourceTabCollapsed:Nn,links:gi,resourceMultis:mi,earnedTreasures:Qe,showNotif:kn,timeActive:d,display:K(()=>p(ie,null,[p(ti,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,T("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Ce,{display:i.map(R=>{const L=Pt[R.type].description;return typeof L=="function"?L(R):L}).join("
"),direction:U.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,T(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>Cn.value=!0},[T("modifiers")])])]}),p(ti,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[Xe(fi)])," ",c.displayName]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(S.value,0)?"+":"",Xe(pi)]),T("/s)")]),o.neq(pt.value,1)?p("span",{class:"nav-segment"},[T("Speed: "),fe(pt.value),T("x")]):null]}),p(pd,{height:"60px"},null),Q.map((R,L)=>L in j?Xe(j[L]):Ni(...R)),Xe(di)])),minimizedDisplay:K(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",Qe.value.length,T("/"),y,T(" treasures")])]))}})}function Si(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(vt).reduce((u,c)=>{let d=vt[c];return t.filter(g=>g.data===c).forEach(g=>{g.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(vt),r=Math.floor(e()*n);let a=0,l;for(let u=0;uu+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;ue===M.board.selectedNode.value?{text:"Mining"}:Object.keys(M.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[on],progress:e=>xe(e)?new o(e.state.progress).toNumber():0,progressDisplay:en.Outline,progressColor:"var(--accent2)",classes:e=>({running:xe(e)}),draggable:!0},Ld={shape:Be.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===M.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(M.energy.value,100)&&(e.type="factory",M.energy.value=o.sub(M.energy.value,100))},confirmationLabel:()=>o.gte(M.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},jd={shape:Be.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===M.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${ke[e.state].name}`};if(((t=M.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=M.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":ke[i].name,a=e.state===i||o.gte(M.energy.value,ke[i].cost)&&M.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${ke[e.state].name} - ${Ae(ke[e.state].cost)} energy`}),onClick(e){const t=ke[e.state];if(o.gte(M.energy.value,t.cost)&&M.toolNodes.value[e.state]==null){M.energy.value=o.sub(M.energy.value,t.cost);const n={id:On(M.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};M.board.placeInAvailableSpace(n),M.board.nodes.value.push(n),M.board.selectedAction.value=null,M.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(M.energy.value,ke[e.state].cost)&&M.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(M.energy.value,ke[e.state].cost)?M.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||M.toolNodes.value[e.state]!=null?0:o.div(M.energy.value,ke[e.state].cost).clampMax(1).toNumber(),progressDisplay:en.Fill,progressColor:e=>e.state!=null&&o.gte(M.energy.value,ke[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,M.board.selectedNode.value=e},draggable:!0},zd={shape:Be.Circle,size:50,title:e=>Ge(e.state.type),subtitle:e=>Ae(e.state.amount),progress:e=>Kc(e.state.type),onClick(){},progressDisplay:en.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":M.dowsing.value!=null&&xe(M.dowsing.value)&&M.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=M.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},Ud={shape:Be.Circle,size:50,title:e=>ke[e.state].name,label:e=>e===M.board.selectedNode.value?{text:fd[e.state].description(et(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":et(e.state)}),draggable:!0},Gd={shape:Be.Diamond,size:50,title:"\u{1F962}",label:e=>e===M.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:Dr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[si,oi(e=>e.add(2).pow_base(100),16),on],classes:e=>({running:xe(e)}),canAccept:Fr,onDrop:Ar,draggable:!0},Wd={shape:Be.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===M.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:Dr(e,t=>`Gather ${fe(o.div(M.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[si,oi(e=>e.add(2).pow_base(1e4),16),on],progress:e=>xe(e)?o.eq(M.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(M.quarryProgressRequired.value).toNumber():0,progressDisplay:en.Outline,progressColor:"var(--accent2)",canAccept:Fr,onDrop:Ar,classes:e=>({running:xe(e)}),draggable:!0},Hd={shape:Be.Diamond,size:50,title:"\u{1F50C}",label:e=>e===M.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:Wc(e,t=>t.includes("Relic")?`Double ${xi[t.slice(0,-5)]}'s effect`:`Double ${ke[t].name}'s effect`),actionDistance:Math.PI/4,actions:[si,oi(e=>e.add(3).pow_base(1e3),16),on],canAccept:Zc,onDrop:Yc,classes:e=>({running:xe(e)}),draggable:!0},Zd={shape:Be.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===M.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=M.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${Ge(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal`}),onClick(e){let t=0;for(;`portal-${t}`in ye;)t++;const{tier:n,influences:i}=e.state;Ri(Lr(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>M.influenceNodes.value[a].state)),X);const r={id:On(M.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};M.board.placeInAvailableSpace(r),M.board.nodes.value.push(r),M.board.selectedAction.value=null,M.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}M.board.selectedNode.value=e},draggable:!0},Yd={shape:Be.Diamond,size:50,title:"\u{1F300}",label:e=>e===M.board.selectedNode.value?{text:`Portal to ${ye[e.state.id].name}`,color:ye[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[on],classes:e=>({running:xe(e),showNotif:ye[e.state.id].showNotif.value}),outlineColor:e=>ye[e.state.id].background,draggable:!0},Xd={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?Be.Diamond:Be.Circle,size:50,title:e=>Pt[e.state.type].display,label:e=>{if(e===M.board.selectedNode.value){const n=e.state,i=Pt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=M.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${Ge(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${Ge(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[si],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},M.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},Jd={shape:Be.Diamond,size:50,title:"\u231B",label:e=>e===M.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ae(o.add(1,e.state.level))}x (${e.state.tools.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:Hc(e,t=>`Boost ${ye[t].name}'s speed`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(e){e.state={...e.state,portals:[]},M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>{var t,n;return(n=(t=e.state)==null?void 0:t.portals.length)!=null?n:0>0}},oi(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ae(Ci.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(M.energy.value,Ci.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=Ci.evaluate(e.state.level);o.gte(M.energy.value,t)&&(M.energy.value=o.sub(M.energy.value,t)),e.state={...e.state,level:o.add(e.state.level,1)},M.board.selectedAction.value=null}},on],canAccept:Xc,onDrop:Jc,classes:e=>({running:xe(e)}),draggable:!0},or=ri(),Kd={mine:Bd,brokenFactory:Ld,factory:jd,resource:zd,passive:Ud,dowsing:Gd,quarry:Wd,empowerer:Hd,portalGenerator:Zd,portal:Yd,influence:Xd,booster:Jd},M=qi("main",function(){const e=Yn(0,"energy"),t=C(()=>g.types.resource.nodes.value.reduce((P,D)=>(P[D.state.type]=D,P),{})),n=C(()=>({...g.types.passive.nodes.value.reduce((P,D)=>(P[D.state]=D,P),{}),sand:g.types.dowsing.nodes.value[0],wood:g.types.quarry.nodes.value[0],coal:g.types.empowerer.nodes.value[0],iron:g.types.portalGenerator.nodes.value[0],gold:g.types.booster.nodes.value[0]})),i=C(()=>({...g.types.influence.nodes.value.reduce((P,D)=>(P[D.state.type]=D,P),{})})),r=C(()=>Zt.reduce((P,D)=>{var ue,un,It;const q=(It=(un=(ue=t.value[D])==null?void 0:ue.state)==null?void 0:un.amount)!=null?It:0;let z=o.floor(Tn.invertIntegral(q)).sub(10).clampMin(0),ae=Ft(Tn,z,!0,0);for(;;){const gt=Tn.evaluate(z);if(o.add(ae,gt).lte(q))z=z.add(1),ae=o.add(ae,gt);else break}return P[D]=z,P},{})),a=Qt({}),l=Qt({});At(()=>{Zt.forEach(P=>{it(()=>r.value[P],(D,q)=>{o.gt(D,q)&&se.active===X.id&&o.lte(D,100)&&or.info(p("div",null,[p("h3",null,[o.eq(D,1)?`${Ge(P)} discovered`:`${Ge(P)} is now Level ${bt(D)}`,T("!")]),p("div",null,[T("Energy gain is now 1.01x higher.")])]))})})});const u=C(()=>S.filter(P=>{var D,q;return(q=(D=P.value)==null?void 0:D.state)==null?void 0:q.powered}).length+g.types.portal.nodes.value.filter(P=>P.state.powered).length),c=C(()=>o.eq(u.value,0)?10:o.add(u.value,1).pow_base(100).div(10).times(.99)),d=C(()=>v.value==null?0:v.value.state.resources.reduce((D,q)=>o.div(100,Ve[q].computedModifier.value).add(D),o.dZero)),g=uu(P=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:Kd,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const D=[];if(D.push(...Object.keys(a).map(q=>({startNode:f.value,endNode:t.value[q],stroke:"var(--accent3)",strokeWidth:5}))),h.value!=null&&h.value.state!=null&&D.push({startNode:h.value,endNode:t.value[h.value.state],stroke:"var(--foreground)",strokeWidth:4}),w.value!=null&&w.value.state.resources.forEach(q=>{D.push({startNode:w.value,endNode:t.value[q],stroke:xe(w.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),v.value!=null&&v.value.state.resources.forEach(q=>{D.push({startNode:v.value,endNode:t.value[q],stroke:"var(--foreground)",strokeWidth:4})}),D.push(...Object.keys(l).map(q=>({startNode:v.value,endNode:t.value[q],stroke:"var(--accent3)",strokeWidth:5}))),y.value!=null&&y.value.state.tools.forEach(q=>{D.push({startNode:y.value,endNode:n.value[q],stroke:xe(y.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),I.value!=null){const q=I.value.state;q.tier!=null&&D.push({startNode:I.value,endNode:t.value[q.tier],stroke:"var(--foreground)",strokeWidth:4}),q.influences.forEach(z=>{D.push({startNode:I.value,endNode:i.value[z],stroke:"var(--foreground)",strokeWidth:4})}),P.types.portal.nodes.value.forEach(z=>{const ae=ye[z.state.id];return ae.links.value.forEach(ue=>{ue.value!=null&&D.push({startNode:z,endNode:ue.value,stroke:xe(z)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(ae.resourceMultis.value).forEach(ue=>{ue!=="energy"&&ue in t.value&&D.push({startNode:z,endNode:t.value[ue],stroke:xe(z)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D})}return A.value!=null&&A.value.state.portals.forEach(q=>{D.push({startNode:A.value,endNode:P.types.portal.nodes.value.find(z=>z.state.id===q),stroke:xe(A.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Object.values(i.value).forEach(q=>{const z=q.state;(z.type==="increaseResources"||z.type==="decreaseResources")&&z.data.forEach(ae=>{D.push({startNode:q,endNode:t.value[ae],stroke:"var(--foreground)",strokeWidth:4})})}),D}})),f=C(()=>g.types.mine.nodes.value[0]),h=C(()=>g.types.factory.nodes.value[0]),w=C(()=>n.value.sand),v=C(()=>n.value.wood),y=C(()=>n.value.coal),I=C(()=>n.value.iron),A=C(()=>n.value.gold),S=[f,w,v,y,A];function x(P,D){let q=t.value[P];if(D=o.times(D,Nn[P].computedModifier.value),q==null)q={id:On(g),position:{...f.value.position},type:"resource",state:{type:P,amount:D}},g.placeInAvailableSpace(q),g.nodes.value.push(q);else{const z=q.state;q.state={...z,amount:o.add(z.amount,D)}}}const j=C(()=>Object.keys(vt).reduce((P,D)=>P+new o(Ve[D].computedModifier.value).toNumber(),0)),le=C(()=>{const P={};return g.types.portal.nodes.value.forEach(D=>{if(!xe(D))return;const z=ye[D.state.id].resourceMultis.value;Object.keys(z).forEach(ae=>{P[ae]!=null?P[ae]=o.times(P[ae],z[ae]):P[ae]=z[ae]})}),P}),Q=kt(()=>[...Zt.map(P=>Fe(()=>({description:()=>`${Ge(P)} (Lv. ${bt(r.value[P])}) (${bn(pt.value)}x per level)`,multiplier:()=>o.pow(pt.value,r.value[P]),enabled:()=>{var D,q;return P in t.value&&o.gt((q=(D=t.value[P].state)==null?void 0:D.amount)!=null?q:0,0)}}))),Fe(()=>({multiplier:()=>et("stone")?4:2,description:()=>(et("stone")?"Empowered ":"")+ke.stone.name,enabled:()=>n.value.stone!=null})),Fe(()=>({multiplier:()=>{var P;return(P=le.value.energy)!=null?P:1},description:"Planar Treasures",enabled:()=>{var P;return o.neq((P=le.value.energy)!=null?P:1,1)}})),Jt(()=>({addend:()=>o.pow(100,u.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(u.value,0)}))]),G=C(()=>Q.apply(1)),H=kt(()=>[Jt(()=>({addend:()=>et("unobtainium")?2:1,description:()=>(et("unobtainium")?"Empowered ":"")+ke.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),Re=C(()=>H.apply(0)),ot=kt(()=>[Fe(()=>({multiplier:()=>et("dirt")?4:2,description:()=>(et("dirt")?"Empowered ":"")+ke.dirt.name,enabled:()=>n.value.dirt!=null}))]),J=C(()=>ot.apply(1)),be=kt(()=>[Fe(()=>({multiplier:()=>et("gravel")?4:2,description:()=>(et("gravel")?"Empowered ":"")+ke.gravel.name,enabled:()=>n.value.gravel!=null}))]),He=C(()=>be.apply(1)),Ke=kt(()=>[Jt(()=>({addend:()=>et("copper")?.002:.001,description:()=>(et("copper")?"Empowered ":"")+ke.copper.name,enabled:()=>n.value.copper!=null}))]),pt=C(()=>Ke.apply(1.01)),Ve=Object.keys(vt).reduce((P,D)=>{const q=kt(()=>[Fe(()=>({multiplier:2,description:"Dowsing",enabled:()=>w.value!=null&&xe(w.value)&&w.value.state.resources.includes(D)}))]),z=C(()=>q.apply(vt[D])),ae={title:`${Ge(D)} Drop Rate`,modifier:q,base:vt[D]};return P[D]={modifier:q,computedModifier:z,section:ae},P},{}),Nn=Object.keys(vt).reduce((P,D)=>{const q=kt(()=>[Fe(()=>({multiplier:()=>{var ue;return(ue=le.value[D])!=null?ue:1},description:"Planar Treasures",enabled:()=>{var ue;return o.neq((ue=le.value[D])!=null?ue:1,1)}}))]),z=C(()=>q.apply(1)),ae={title:`${Ge(D)} Gain`,modifier:q};return P[D]={modifier:q,computedModifier:z,section:ae},P},{}),[Cn,di]=Pn(()=>[{title:"Energy Gain",modifier:Q,base:1,unit:"/s"},{title:"Bonus Connections",modifier:H,base:0}]),[Bn,Ln]=Pn(()=>[{title:"Mining Speed",modifier:ot,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:be,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:Ke,base:1.01,visible:()=>n.value.copper!=null}]),[fi,pi]=Pn(()=>Object.values(Ve).map(P=>P.section)),[gi,mi]=Pn(()=>Object.values(Nn).map(P=>P.section)),Qe=bu({general:()=>({display:"General",glowColor(){return Qe.activeTab.value===this.tab?"white":""},tab:Cn,energyTabCollapsed:di}),mining:()=>({display:"Mine",glowColor(){return Qe.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Bn,miningTabCollapsed:Ln}),resources:()=>({display:"Mine Rates",glowColor(){return Qe.activeTab.value===this.tab?"white":""},visibility:()=>w.value!=null,tab:fi,resourcesCollapsed:pi}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return Qe.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(Nn).some(P=>o.neq(P.computedModifier.value,1)),tab:gi,resourceGainCollapsed:mi})}),kn=V(!1),R=K(()=>p(qt,{modelValue:kn.value,"onUpdate:modelValue":P=>kn.value=P},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>Xe(Qe)}));this.on("preUpdate",P=>{if(Object.keys(a).forEach(D=>{a[D]-=P,a[D]<=0&&delete a[D]}),Object.keys(l).forEach(D=>{l[D]-=P,l[D]<=0&&delete l[D]}),xe(f.value)){const D=o.add(f.value.state.progress,o.times(J.value,P)),q=D.floor();f.value.state={...f.value.state,progress:o.sub(D,q)};const z=q.div(j.value).floor();z.gt(0)&&Zt.forEach(ue=>{x(ue,o.times(new o(Ve[ue].computedModifier.value).toNumber(),z).times(He.value)),a[ue]=.3});const ae=o.sub(q,z).toNumber();for(let ue=0;ue0){let z=o.add(D,P);const ae=o.div(D,d.value).floor();z=o.sub(z,o.times(ae,d.value)),v.value.state={...v.value.state,progress:z},o.gt(ae,0)&&q.forEach(ue=>{x(ue,ae),l[ue]=.3})}}e.value=o.add(e.value,o.times(G.value,P)),o.lt(e.value,0)&&(e.value=0,f.value.state={...f.value.state,powered:!1},or.warning(p("div",null,[p("h3",null,[T("Ran out of energy!")]),p("div",null,[T("All machines have been turned off.")])])))});const L=C(()=>{var P,D;return g.selectedAction.value===g.types.brokenFactory.actions[0]?-100:g.selectedAction.value===g.types.factory.actions[1]?o.neg(ke[g.selectedNode.value.state].cost):((P=g.selectedAction.value)==null?void 0:P.id)==="moreConnections"?o.neg(g.selectedAction.value.formula.evaluate(((D=g.selectedNode.value)==null?void 0:D.state).maxConnections)):0}),Se=fn(m.variable(0).add(e),()=>o.neq(L.value,0),L),wt=C(()=>{var P;return g.selectedAction.value===on?((P=g.selectedNode.value)==null?void 0:P.state).powered?o.eq(u.value,1)?10:o.pow(100,u.value).div(10).times(.99):o.neg(c.value):0}),ln=fn(m.variable(0).add(G),()=>o.neq(wt.value,0),wt),je=C(()=>g.types.portal.nodes.value.filter(P=>xe(P)));return it(je,P=>{At(()=>{X.tabs=["main",...P.map(D=>D.state.id)]})}),it(Re,(P,D)=>{o.lt(P,D)&&(Un(P,w,"resources"),Un(P,v,"resources"),Un(P,y,"tools"),Un(P,A,"portals"))}),{name:"World",board:g,energy:e,modifierTabs:Qe,resourceNodes:t,toolNodes:n,influenceNodes:i,grantResource:x,activePortals:je,isEmpowered:et,nextPowerCost:c,computedBonusConnectionsModifier:Re,quarryProgressRequired:d,dropRates:Ve,dowsing:w,empowerer:y,resourceLevels:r,planarMultis:le,display:K(()=>p(ie,null,[p(ti,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Xe(Se)])," ",T("energy")]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(G.value,0)?"+":"",Xe(ln)]),T("/s)")]),o.gt(u.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[bt(u.value)])," ",T("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>kn.value=!0},[T("modifiers")])]),X.devSpeed===0?p("span",{class:"nav-segment"},[T("Game Paused")]):X.devSpeed!=null&&X.devSpeed!==1?p("span",{class:"nav-segment"},[T("Dev Speed: "),bn(X.devSpeed),T("x")]):null]}),Xe(g),Xe(R)]))}}),Qd=e=>{var i,r,a,l,u;const t=[M];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(Lr(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},ji=V(!1);function ef(e,t){}var tf=Object.freeze(Object.defineProperty({__proto__:null,main:M,getInitialLayers:Qd,hasWon:ji,fixOldSave:ef},Symbol.toStringTag,{value:"Module"}));const Vn=e=>(tn("data-v-4a50ce42"),e=e(),nn(),e),nf={class:"game-over-modal-header"},rf=["src","alt"],af={class:"game-over-modal-title"},sf=Vn(()=>_("h2",null,"Congratulations!",-1)),of={key:0},lf=Vn(()=>_("br",null,null,-1)),uf=Vn(()=>_("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),cf=Vn(()=>_("br",null,null,-1)),df=["href"],ff=Vn(()=>_("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),pf=Y({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=pe,u=C(()=>ai(X.timePlayed)),c=C(()=>ji.value&&!X.keepGoing),d=Gt(X,"autosave");function g(){X.keepGoing=!0}function f(){Yt(gn())}return(h,w)=>(k(),ee(qt,{"model-value":s(c)},{header:W(()=>[_("div",nf,[s(n)?(k(),E("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,rf)):B("",!0),_("div",af,[sf,_("h4",null,"You've beaten "+re(s(t))+" v"+re(s(a))+": "+re(s(l)),1)])])]),body:W(({shown:v})=>[v?(k(),E("div",of,[_("div",null,"It took you "+re(s(u))+" to beat the game.",1),lf,uf,cf,_("div",null,[_("a",{href:s(r),class:"game-over-modal-discord-link"},[ff,T(" "+re(s(i)),1)],8,df)]),p(Tt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":w[0]||(w[0]=y=>Ee(d)?d.value=y:null)},null,8,["modelValue"])])):B("",!0)]),footer:W(()=>[_("div",{class:"game-over-footer"},[_("button",{onClick:g,class:"button"},"Keep Going"),_("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var gf=ce(pf,[["__scopeId","data-v-4a50ce42"]]);const ci=e=>(tn("data-v-2776d67d"),e=e(),nn(),e),mf=ci(()=>_("div",{class:"nan-modal-header"},[_("h2",null,"NaN value detected!")],-1)),vf={key:0},hf=ci(()=>_("br",null,null,-1)),bf=["href"],yf=ci(()=>_("span",{class:"material-icons nan-modal-discord"},"discord",-1)),wf=ci(()=>_("br",null,null,-1)),_f={class:"nan-footer"},Nf=Y({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=pe,i=V(!0),r=V(!0),a=Gt(Te,"hasNaN"),l=V(null);it(a,h=>{h?(i.value=X.autosave,r.value=X.devSpeed===0):(X.autosave=i.value,X.devSpeed=r.value?0:null)});const u=C(()=>{var h;return(h=Te.NaNPath)==null?void 0:h.join(".")}),c=C(()=>Te.NaNPersistent!=null?Te.NaNPersistent.value:null);function d(){Te.NaNPersistent!=null&&(Te.NaNPersistent.value=new o(0),Te.hasNaN=!1)}function g(){Te.NaNPersistent&&(Te.NaNPersistent.value=new o(1),Te.hasNaN=!1)}function f(){Te.NaNPersistent&&(Te.NaNPersistent.value=new o(NaN),Te.hasNaN=!1)}return(h,w)=>(k(),E(ie,null,[p(qt,Ot({modelValue:s(a),"onUpdate:modelValue":w[4]||(w[4]=v=>Ee(a)?a.value=v:null)},h.$attrs),{header:W(()=>[mf]),body:W(()=>[_("div",null,[T(' Attempted to assign "'+re(s(u))+'" to NaN',1),s(c)?(k(),E("span",vf,re(" ")+"(previously "+re(s(bn)(s(c)))+")",1)):B("",!0),T(". Auto-saving has been "+re(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),hf,_("div",null,[_("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[yf,T(" "+re(s(t)||"The Paper Pilot Community"),1)],8,bf)]),wf,p(Tt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v)},null,8,["modelValue"]),s(pe).enablePausing?(k(),ee(Tt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":w[1]||(w[1]=v=>r.value=v)},null,8,["modelValue"])):B("",!0)]),footer:W(()=>[_("div",_f,[_("button",{onClick:w[2]||(w[2]=v=>{var y;return(y=l.value)==null?void 0:y.open()}),class:"button"},"Open Saves Manager"),_("button",{onClick:d,class:"button"},"Set to 0"),_("button",{onClick:g,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(k(),E("button",{key:0,onClick:w[3]||(w[3]=v=>a.value=!1),class:"button"}," Set to previous ")):B("",!0),_("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(Ir,{ref_key:"savesManager",ref:l},null,512)],64))}});var Cf=ce(Nf,[["__scopeId","data-v-2776d67d"]]);const kf={key:0,class:"tpsDisplay"},Mf={key:0,class:"low"},Sf=Y({__name:"TPS",setup(e){const t=C(()=>o.div(Te.lastTenTicks.length,Te.lastTenTicks.reduce((a,l)=>a+l,0))),n=V([]);ct(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=C(()=>n.value.reduce((a,l)=>o.max(a,l),0)),r=C(()=>o.sub(t.value,i.value).gt(1));return(a,l)=>s(t).isNan()?B("",!0):(k(),E("div",kf,[T(" TPS: "+re(s(bt)(s(t)))+" ",1),p(vn,{name:"fade"},{default:W(()=>[s(r)?(k(),E("span",Mf,re(s(bt)(s(i))),1)):B("",!0)]),_:1})]))}});var If=ce(Sf,[["__scopeId","data-v-46a3ed5b"]]);var $f=Y({__name:"App",setup(e){const t=pe.useHeader,n=C(()=>ht[se.theme].variables),i=Gt(se,"showTPS"),r=C(()=>oe(K(()=>p(ie,null,[ms.map(Xe)]))));return(a,l)=>(k(),E(ie,null,[_("div",{id:"modal-root",style:Pe(s(n))},null,4),_("div",{class:ge(["app",{useHeader:s(t)}]),style:Pe(s(n))},[s(t)?(k(),ee($r,{key:0})):B("",!0),p(Pl),s(s(i))?(k(),ee(If,{key:1})):B("",!0),p(gf),p(Cf),(k(),ee(qe(s(r))))],6)],64))}});var xf=ce($f,[["__scopeId","data-v-41d15e5e"]]);function Ef(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,g;const f=async(w=!0)=>{await d,w&&(u==null||u.addEventListener("controlling",v=>{v.isUpdate&&window.location.reload()})),await(g==null?void 0:g())};async function h(){if("serviceWorker"in navigator){const{Workbox:w,messageSW:v}=await Dn(()=>import("./workbox-window.4a8794bb.js"),[]);g=async()=>{c&&c.waiting&&await v(c.waiting,{type:"SKIP_WAITING"})},u=new w("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",y=>{y.isUpdate||i==null||i()});{const y=()=>{n==null||n()};u.addEventListener("waiting",y),u.addEventListener("externalwaiting",y)}u.register({immediate:t}).then(y=>{c=y,a?a("./sw.js",y):r==null||r(y)}).catch(y=>{l==null||l(y)})}}return d=h(),f}function Pf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=V(!1),c=V(!1);return{updateServiceWorker:Ef({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=pe.title;window.projInfo=pe;if(pe.id==="")throw new Error("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 us();const{globalBus:e}=await Dn(()=>Promise.resolve().then(function(){return os}),void 0),{startGameLoop:t}=await Dn(()=>import("./gameLoop.d83eb23f.js"),["assets/gameLoop.d83eb23f.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=ra(xf);e.emit("setupVue",n),n.mount("#app"),At(()=>{const i=ri(),{updateServiceWorker:r}=Pf({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Dn as _,Te as a,pe as b,tf as c,We as g,cs as l,X as p,se as s}; diff --git a/assets/index.7712ec78.js b/assets/index.7712ec78.js new file mode 100644 index 0000000..91a5dcf --- /dev/null +++ b/assets/index.7712ec78.js @@ -0,0 +1,18 @@ +/* empty css */import"./vue.c16a309b.js";import{_ as N,C as s,l as Pe,q as on,t as V,b2 as pt,ab as Y,aF as k,a1 as P,a2 as _,aL as Et,G as me,aD as mr,w as gt,b3 as wt,a9 as p,O as ne,ap as oa,az as li,as as Bt,aH as Xn,A as Ie,$ as ee,b7 as H,b9 as Ai,ar as Lt,bv as Nn,a8 as x,bt as la,bc as Cn,T as ua,u as Oi,j as ca,bw as Pt,aM as Nt,a0 as B,aO as Ge,J as ae,I as Re,aI as un,aG as cn,z as Yt,bo as da,bs as fa,aK as kn,bd as er,am as ti,H as pa,bx as ga,bf as ma}from"./@vue.6b211d3c.js";import{c as vr}from"./nanoevents.1080beb7.js";import{L as Wt}from"./lz-string.dccec454.js";import{Y as va}from"./vue-next-select.ded54c4a.js";import{D as ha}from"./vuedraggable.1879de79.js";import{p as ba}from"./vue-textarea-autosize.35804eaf.js";import{P as ya}from"./vue-panzoom.8ce6f9b1.js";import{s as wa,u as ui}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const _a=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};_a();const Na="modulepreload",tr={},Ca="./",Ln=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Ca}${i}`,i in tr)return;tr[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":Na,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ka="./projInfo-schema.json",Ma="Planar Pioneers",Sa="A game about controlling and exploiting planes!",Ia="planar-pioneers",$a="thepaperpilot",xa="",Ea="",Pa="0.0",Ta="Initial Commit",Da=!1,Fa=!1,Aa=2,Oa=!0,Ra=null,qa="",Va=["main"],Ba=3600,La=0,ja=!0,za="base64";var ge={$schema:ka,title:Ma,description:Sa,id:Ia,author:$a,discordName:xa,discordLink:Ea,versionNumber:Pa,versionTitle:Ta,allowGoBack:Da,defaultShowSmall:Fa,defaultDecimalsShown:Aa,useHeader:Oa,banner:Ra,logo:qa,initialTabs:Va,maxTickLength:Ba,offlineLimit:La,enablePausing:ja,exportEncoding:za};class Ua{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Ga(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Ga{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Ci=17,Wa=9e15,Ha=Math.log10(9e15),Za=1/9e15,Ya=308,Xa=-324,nr=5,Ja=(1<<10)-1,Ka=function(){const e=[];for(let n=Xa+1;n<=Ya;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Kt=[2,Math.E,3,4,5,6,7,8,9,10],Qa=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,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.1840100246247336,1.4061375836156955,1.6802272208863964,2.026757028388619,2.4770056063449646,3.080525271755482,3.9191964192627284,5.135152840833187,6.989961179534715,10]],es=[[-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]];let C=function(t){return o.fromValue_noAlloc(t)},Z=function(e,t,n){return o.fromComponents(e,t,n)},te=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Ut=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},ki=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},ts=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},hr=.5671432904097838,ir=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return hr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n).5?1:-1;if(Math.random()*20<1)return te(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),Z(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return b.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(b.sub(1,n.pow(e))).div(b.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),l=a.pow(2);return a.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.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=Wa)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){const t=e,n=b.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const v=parseFloat(i[0]),y=parseFloat(i[1]),I=i[1].split(";");let A=1;if(I.length===2&&(A=parseFloat(I[1]),isFinite(A)||(A=1)),isFinite(v)&&isFinite(y)){const S=b.pentate(v,y,A);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const v=parseFloat(r[0]),y=parseFloat(r[1]),I=r[1].split(";");let A=1;if(I.length===2&&(A=parseFloat(I[1]),isFinite(A)||(A=1)),isFinite(v)&&isFinite(y)){const S=b.tetrate(v,y,A);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const v=parseFloat(a[0]),y=parseFloat(a[1]);if(isFinite(v)&&isFinite(y)){const I=b.pow(v,y);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,u,c=e.split("pt");if(c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let v=parseFloat(c[1]);if(isFinite(v)||(v=1),isFinite(l)&&isFinite(u)){const y=b.tetrate(l,u,v);return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let v=parseFloat(c[1]);if(isFinite(v)||(v=1),isFinite(l)&&isFinite(u)){const y=b.tetrate(l,u,v);return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const d=e.split("e"),m=d.length-1;if(m===0){const v=parseFloat(e);if(isFinite(v))return this.fromNumber(v),b.fromStringCache.size>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else if(m===1){const v=parseFloat(e);if(isFinite(v)&&v!==0)return this.fromNumber(v),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}const f=e.split("e^");if(f.length===2){this.sign=1,f[0].charAt(0)=="-"&&(this.sign=-1);let v="";for(let y=0;y=43&&I<=57||I===101)v+=f[1].charAt(y);else return this.layer=parseFloat(v),this.mag=parseFloat(f[1].substr(y+1)),this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(m<1)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;const h=parseFloat(d[0]);if(h===0)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;let w=parseFloat(d[d.length-1]);if(m>=2){const v=parseFloat(d[d.length-2]);isFinite(v)&&(w*=Math.sign(v),w+=ki(v))}if(!isFinite(h))this.sign=d[0]==="-"?-1:1,this.layer=m,this.mag=w;else if(m===1)this.sign=Math.sign(h),this.layer=1,this.mag=w+Math.log10(Math.abs(h));else if(this.sign=Math.sign(h),this.layer=m,m===2){const v=b.mul(Z(1,2,w),C(h));return this.sign=v.sign,this.layer=v.layer,this.mag=v.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else this.mag=w;return this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}fromValue(e){return e instanceof b?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:Ut(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Ut(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<=nr?(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):Ut(this.m,e)+"e"+Ut(this.e,e):this.layer===1?Ut(this.m,e)+"e"+Ut(this.e,e):this.layer<=nr?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Ut(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Ut(this.mag,e)}abs(){return te(this.sign===0?0:1,this.layer,this.mag)}neg(){return te(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?b.dZero:this.layer===0?Z(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=C(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 te(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(b.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>Ci)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*l;return Z(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>Ci)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*l;return Z(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>Ci)return n;{const l=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*l;return Z(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(C(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=C(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return te(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return te(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return Z(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return Z(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return Z(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=Z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Z(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=Z(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Z(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return Z(n.sign*i.sign,r.layer+1,r.sign*r.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=C(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?b.dNaN:this.layer===0?Z(this.sign,0,1/this.mag):Z(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=C(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?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=C(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=C(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=ki(r)),this.layer0?Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Z(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?b.dNaN:this.layer>0?Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Z(this.sign,0,Math.log10(this.mag))}log(e){return e=C(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?b.dNaN:this.layer===0&&e.layer===0?Z(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):b.div(this.log10(),e.log10())}log2(){return this.sign<=0?b.dNaN:this.layer===0?Z(this.sign,0,Math.log2(this.mag)):this.layer===1?Z(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Z(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?b.dNaN:this.layer===0?Z(this.sign,0,Math.log(this.mag)):this.layer===1?Z(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Z(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Z(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=C(e),n=this,i=t;if(n.sign===0)return i.eq(0)?te(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return te(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:b.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return b.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 Z(1,0,t);if(e.sign===0)return b.dOne;e=te(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Z(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Z(-e.sign,e.layer+1,-e.mag):b.dOne}pow_base(e){return C(e).pow(this)}root(e){const t=C(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?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(te(1,0,24)))return b.fromNumber(ts(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,l=t+a;if(l===t||(t=l,i=i*n,r=360*i,a=1/r,l=t-a,l===t))return b.exp(t);t=l,i=i*n,r=1260*i;let u=1/r;return t=t+u,i=i*n,r=1680*i,u=1/r,t=t-u,b.exp(t)}else return this.layer===1?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?b.dOne:this.layer===0&&this.mag<=709.7?b.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Z(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Z(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Z(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return b.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Z(1,2,Math.log10(this.mag)-.3010299956639812);{const e=b.div(te(this.sign,this.layer-1,this.mag),te(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=te(1,0,1)){if(e===1)return b.pow(this,t);if(e===0)return new b(t);if(this.eq(b.dOne))return b.dOne;if(this.eq(-1))return b.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return b.fromNumber(Math.E);const a=b.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?b.fromNumber(Number.POSITIVE_INFINITY):b.dNaN}if(this.eq(b.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),b.fromNumber(r)}if(e<0)return b.iteratedlog(t,this,-e);t=C(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(b.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return te(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=te(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return b.tetrate(e,-t,this);e=C(e);let n=b.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let l=1;l1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return b.fromNumber(a)}slog_internal(e=10){if(e=C(e),e.lte(b.dZero)||e.eq(b.dOne))return b.dNaN;if(e.lt(b.dOne))return this.eq(b.dOne)?b.dZero:this.eq(b.dZero)?b.dNegOne:b.dNaN;if(this.mag<0||this.eq(b.dZero))return b.dNegOne;let t=0,n=b.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(b.dZero))n=b.pow(e,n),t-=1;else{if(n.lte(b.dOne))return b.fromNumber(t+b.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=b.log(n,e)}return b.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:b.critical_section(e,t,es)}static tetrate_critical(e,t){return b.critical_section(e,t,Qa)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let l=0;le){const u=(e-Kt[l])/(Kt[l+1]-Kt[l]);i=n[l][Math.floor(t)]*(1-u)+n[l+1][Math.floor(t)]*u,r=n[l][Math.ceil(t)]*(1-u)+n[l+1][Math.ceil(t)]*u;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=b.fromValue_noAlloc(e).toNumber();const t=b.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?b.tetrate(t,i):Number.isFinite(i)?i>=-1?b.log(b.tetrate(t,i+1),t):b.log(b.log(b.tetrate(t,i+2),t),t):b.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return b.fromNumber(ir(this.toNumber()));if(this.layer===0)return b.fromNumber(ir(this.sign*this.mag));if(this.layer===1)return rr(this);if(this.layer===2)return rr(this);if(this.layer>=3)return te(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return te(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=te(1,0,1)){t=C(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(b.dOne)?(++e,t=b.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r10)return t}return t}sin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.sin(this.sign*this.mag)):te(0,0,0)}cos(){return this.mag<0?b.dOne:this.layer===0?b.fromNumber(Math.cos(this.sign*this.mag)):te(0,0,0)}tan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.tan(this.sign*this.mag)):te(0,0,0)}asin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.asin(this.sign*this.mag)):te(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?b.fromNumber(Math.acos(this.toNumber())):this.layer===0?b.fromNumber(Math.acos(this.sign*this.mag)):te(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.atan(this.sign*this.mag)):b.fromNumber(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 b.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return b.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?te(Number.NaN,Number.NaN,Number.NaN):b.ln(this.add(1).div(b.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(b.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 o=b;o.fromStringCache=new Ua(Ja);o.dZero=te(0,0,0);o.dOne=te(1,0,1);o.dNegOne=te(-1,0,1);o.dTwo=te(1,0,2);o.dTen=te(1,0,10);o.dNaN=te(Number.NaN,Number.NaN,Number.NaN);o.dInf=te(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=te(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Z(1,0,Number.MAX_VALUE);o.dNumberMin=Z(1,0,Number.MIN_VALUE);C=o.fromValue_noAlloc;Z=o.fromComponents;te=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const ns=new o(1);function On(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=ns,i=i.add(1));const a=i.gte(1e9)?le(i,Math.max(Math.max(t,3),ge.defaultDecimalsShown)):i.gte(1e4)?ni(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function ni(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function br(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ge.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const is=new o("eeee1000"),rs=new o("e100000"),ar=new o("e1000"),yr=new o(1e9),as=new o(1e6),ss=new o(1e3),os=new o(.98),ls=new o(.001),wr=new o(0);function le(e,t,n){if(t==null&&(t=ge.defaultDecimalsShown),n=n!=null?n:ge.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+le(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(is)){const i=e.slog();return i.gte(as)?"F"+le(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+ni(i.floor(),0)}else{if(e.gte(rs))return On(e,0,!1);if(e.gte(ar))return On(e,0);if(e.gte(yr))return On(e,t);if(e.gte(ss))return ni(e,0);if(e.gte(ls)||!n)return br(e,t);if(e.eq(wr))return 0 .toFixed(t)}return e=Nr(e),e.lt(ar)?On(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):le(e,t)+"\u207B\xB9"}function ze(e){return e=new o(e),e.sign<0?"-"+ze(e.neg()):e.gte(yr)||e.lte(os)&&!e.eq(wr)?le(e):le(e,0)}function _r(e){return o.lt(e,0)?"-"+_r(o.neg(e)):o.gt(e,2**51)?le(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?le(e)+"s":e<3600?ze(Math.floor(e/60))+"m "+le(e%60)+"s":e<86400?ze(Math.floor(e/3600))+"h "+ze(Math.floor(e/60)%60)+"m "+ze(e%60)+"s":e<31536e3?ze(Math.floor(e/84600)%365)+"d "+ze(Math.floor(e/3600)%24)+"h "+ze(Math.floor(e/60)%60)+"m":ze(Math.floor(e/31536e3))+"y "+ze(Math.floor(e/84600)%365)+"d "+ze(Math.floor(e/3600)%24)+"h")}function us(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function cs(e,t){return le(e,t,!0)}function Nr(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var ds=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:On,commaFormat:ni,regularFormat:br,format:le,formatWhole:ze,formatTime:_r,toPlaces:us,formatSmall:cs,invertOOM:Nr},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:fs,commaFormat:ps,regularFormat:gs,format:Mn,formatWhole:Mt,formatTime:ci,toPlaces:ms,formatSmall:Ht,invertOOM:vs}=ds;window.Decimal=o;window.exponentialFormat=fs;window.commaFormat=ps;window.regularFormat=gs;window.format=Mn;window.formatWhole=Mt;window.formatTime=ci;window.toPlaces=ms;window.formatSmall=Ht;window.invertOOM=vs;function Qe(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function ii(e){return typeof e=="function"}var G=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(G||{});const jn=Symbol("DoNotCache");function $(e,t){const n=e[t];ii(n)&&n.length===0&&!n[jn]?e[t]=N(n.bind(e)):ii(n)&&(e[t]=n.bind(e),e[t][jn]=!0)}function ve(e){return ii(e)&&!e[jn]&&(e=N(e)),e}const mt=Symbol("Component"),st=Symbol("GatherProps");let hs=0;function Jt(e="feature-"){return e+hs++}var he=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(he||{});function Le(e){const t=s(e);return t!==2&&t!==!1}function dn(e){return s(e)===1}function J(e){return e[jn]=!0,e}function ie(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Ti(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const l=r[a];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof o)&&!Pe(l)&&i(l))})};return i(e),n}const Qt={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 Ri=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Ri||{}),yt={classic:Qt,paper:{...Qt,variables:{...Qt.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:{...Qt,variables:{...Qt.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:{...Qt,variables:{...Qt.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const We=vr();"fonts"in document&&(document.fonts.onloadingdone=()=>We.emit("fontsLoaded"));var bs=Object.freeze(Object.defineProperty({__proto__:null,globalBus:We},Symbol.toStringTag,{value:"Module"}));const ys=on({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Q=window.player=ys;function Cr(e){return JSON.stringify(e,(t,n)=>s(n))}function kr(e={}){return Object.assign({id:`${ge.id}-0`,name:"Default Save",tabs:ge.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ge.id,modVersion:ge.versionNumber,layers:{}},e)}function dt(e){const t=Wt.compressToUTF16(Cr(e!=null?e:Q));return localStorage.setItem((e!=null?e:Q).id,t),t}async function ws(){Cs();try{let e=localStorage.getItem(re.active);if(e==null){await nn(_n());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Wt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ge.id){await nn(_n());return}t.id=re.active,await nn(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await nn(_n())}}function _n(){const e=ei(),t=kr({id:e});return dt(t),re.saves.push(e),t}function ei(){let e,t=0;do e=`${ge.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const _s=V(!1);async function nn(e){console.info("Loading save",e),_s.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Ln(()=>Promise.resolve().then(function(){return Gs}),void 0),{fixOldSave:r,getInitialLayers:a}=await Ln(()=>Promise.resolve().then(function(){return gf}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=kr(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,ge.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ge.versionNumber&&(r(e.modVersion,e),e.modVersion=ge.versionNumber),Object.assign(Q,e),re.active=Q.id,We.emit("onLoad")}setInterval(()=>{Q.autosave&&dt()},1e3);window.onbeforeunload=()=>{Q.autosave&&dt()};window.save=dt;const Ns=window.hardReset=async()=>{await nn(_n())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(Q.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const zn=on({active:"",saves:[],showTPS:!0,theme:Ri.Nordic,unthrottled:!1,alignUnits:!1});pt(zn,e=>{const t=Wt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ge.id,t)},{deep:!0});var re=window.settings=zn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Ri.Nordic,alignUnits:!1};We.emit("loadSettings",e),Object.assign(zn,e),Ns()};function Cs(){try{let e=localStorage.getItem(ge.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Wt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(zn,t)}We.emit("loadSettings",zn)}catch{}}const Mr=on([]);function ks(e){Mr.push(e)}const Ms=on([]),Ss=on([]),Is={class:"table"},$s=Y({__name:"Column",setup(e){const t=N(()=>yt[re.theme].mergeAdjacent);return(n,i)=>(k(),P("div",Is,[_("div",{class:me(["col",{mergeAdjacent:s(t)}])},[Et(n.$slots,"default")],2)]))}}),xs={class:"table"},Es=Y({__name:"Row",setup(e){const t=N(()=>yt[re.theme].mergeAdjacent);return(n,i)=>(k(),P("div",xs,[_("div",{class:me(["row",{mergeAdjacent:s(t)}])},[Et(n.$slots,"default")],2)]))}});function Sr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!oa(e)}function ue(e,t="span"){return typeof e=="function"?Y({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),Y({template:e})):Y({render:()=>({})}):e}function et(e){if(St(e))return typeof e=="function"?e():ue(e);const t=e[mt];return p(t,e[st](),null)}function Mi(...e){let t;return p(Es,null,Sr(t=e.map(et))?t:{default:()=>[t]})}function Ps(...e){let t;return p($s,null,Sr(t=e.map(et))?t:{default:()=>[t]})}function _t(e){if(St(e))return typeof e=="function"?e():typeof e=="string"?p(ne,null,[e]):p(e,null,null);const t=e[mt];return p(t,e[st](),null)}function sr(e,t){return e.reduce((n,i)=>p(ne,null,[n,t,i]))}function St(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[jn]===!0}function Ir(e,t){const n=V(null),i=V(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return mr(a),{start:r,stop:a,handleHolding:l}}function $r(e,t="div"){const n=gt();return wt(()=>{n.value=ue(Ce(e),t)}),n}function Sn(e,t="div"){const n=gt(null);return wt(()=>{const i=Ce(e);n.value=i==""||i==null?null:ue(i,t)}),n}function Ce(e){return s(s(e))}function O(...e){return e.includes(Object)||e.push(Object),e}function or(e){const t=V(!1),n=e[st].bind(e);return e[st]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var fe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Ts=Y({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var m;const n=V({}),i=new ResizeObserver(u),r=V(null);li(()=>{const f=r.value;f!=null&&i.observe(f)});let a=!0,l=V((m=r.value)==null?void 0:m.getBoundingClientRect());function u(){a&&(a=!1,Bt(()=>{var f;l.value=(f=r.value)==null?void 0:f.getBoundingClientRect(),Object.values(n.value).filter(h=>h).forEach(h=>h.rect=h.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}We.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};Xn(qi,(f,h)=>{const w=new MutationObserver(()=>d(f));w.observe(h,c),n.value[f]={element:h,observer:w,rect:h.getBoundingClientRect()},u()}),Xn(Vi,f=>{var h;(h=n.value[f])==null||h.observer.disconnect(),n.value[f]=void 0,u()}),Xn(Bi,n),Xn(Li,l);function d(f){const h=n.value[f];h!=null&&(h.rect=h.element.getBoundingClientRect(),t("updateNodes",n.value))}return(f,h)=>(k(),P(ne,null,[Et(f.$slots,"default",{},void 0,!0),_("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var xr=fe(Ts,[["__scopeId","data-v-2b1dc1bc"]]);const Ds=["onPointerdown"],Fs={class:"modal-wrapper"},As={class:"modal-container"},Os={class:"modal-header"},Rs={class:"modal-body"},qs={class:"modal-footer"},Vs=_("div",{class:"modal-default-flex-grow"},null,-1),jt=Y({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Ie(e),a=N(()=>s(r.modelValue)||u.value);function l(){n("update:modelValue",!1)}const u=V(!1),c=V(null),d=N(()=>{var m,f;return(f=(m=c.value)==null?void 0:m.nodes)!=null?f:null});return t({isOpen:a,nodes:d}),(m,f)=>(k(),ee(ua,{to:"#modal-root"},[p(Cn,{name:"modal",onBeforeEnter:f[0]||(f[0]=h=>u.value=!0),onAfterLeave:f[1]||(f[1]=h=>u.value=!1)},{default:H(()=>[Ai(_("div",Lt({class:"modal-mask",onPointerdown:Nn(l,["self"])},m.$attrs),[_("div",Fs,[_("div",As,[_("div",Os,[Et(m.$slots,"header",{shown:s(a)},()=>[x(" default header ")])]),_("div",Rs,[p(xr,{ref_key:"contextRef",ref:c},{default:H(()=>[Et(m.$slots,"body",{shown:s(a)},()=>[x(" default body ")])]),_:3},512)]),_("div",qs,[Et(m.$slots,"footer",{shown:s(a)},()=>[_("div",{class:"modal-default-footer"},[Vs,_("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,Ds),[[la,e.modelValue]])]),_:3})]))}}),Gt=Symbol("ProxyState");function He(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,l){if(l===Gt)return r();const u=r()[l];return u!=null&&typeof u=="object"&&xt in u?u[xt]:u},set(a,l,u){return r()[l]=u,!0},has(a,l){return l===Gt?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,l)}})}var Be=window.state=Oi({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Zt=Symbol("PersistentState"),Xt=Symbol("DefaultValue"),ri=Symbol("StackTrace"),ai=Symbol("Deleted"),xt=Symbol("NonPersistent"),rn=Symbol("SaveDataPath"),Di=Symbol("SkipPersistence");function Bs(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(` +`).slice(3,5).map(n=>n.trim()).join(` +`))!=null?t:""}function lr(e,t){var n;if(o.isNaN(t))throw Be.hasNaN||(Q.autosave=!1,Be.hasNaN=!0,Be.NaNPath=e[rn],Be.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[rn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Zt].value=t}function ft(e,t=!0){const n=Pe(e)?e:V(e);Pe(e)&&(e=e.value);const i=N({get(){return n.value},set(a){t?lr(r,a):r[Zt].value=a}});i[Xt]=e;const r={get value(){return n.value},set value(a){t?lr(r,a):r[Zt].value=a},__v_isRef:!0,[Zt]:n,[Xt]:e,[ri]:Bs(),[ai]:!1,[xt]:i,[rn]:void 0};return at.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` +Created at: +`+r[ri]):sn[at[at.length-1]].add(r),r}function Ls(e){return e!=null&&typeof e=="object"&&Zt in e}function hn(e){return!(Gt in e)&&xt in e?e[xt]:new Proxy(e,{get(t,n){if(n!==Zt)return n===Di?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Zt?!1:n==Di?!0:Reflect.has(t,n)}})}function Er(e){at.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):sn[at[at.length-1]].delete(e),e[ai]=!0}We.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[Di]===!0)return;if(Gt in c&&(c=c[Gt]),Ls(c)){if(l=!0,c[ai]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +Created at: +`+c[ri]);return}sn[e.id].delete(c);const d=[e.id,...a,u];c[rn]!=null&&JSON.stringify(d)!==JSON.stringify(c[rn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[rn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[rn]=d;const m=a.reduce((h,w)=>(w in h||(h[w]={}),h[w]),t),f=m[u];m[u]=c[Zt],ca(m)?f!=null?m[u]=f:m[u]=c[Xt]:f!=null?m[u].value=f:m[u].value=c[Xt]}else!(c instanceof o)&&!Pe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(Pt(c)&&!Pt(r)?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.",Gt in r?r[Gt]:r,u):l=!0))}}),l};i(e[Gt]),sn[e.id].forEach(r=>{r[ai]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,` +Created at: +`+r[ri])}),sn[e.id].clear()});const qi=Symbol("RegisterNode"),Vi=Symbol("UnregisterNode"),Bi=Symbol("Nodes"),Li=Symbol("Bounds"),Ne=Oi({});window.layers=Ne;const sn={},at=[];function ji(e,t){return He(()=>{const n={},i=n.emitter=vr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=V({}),n.id=e,at.push(e),sn[e]=new Set,n.minimized=ft(!1,!1),Object.assign(n,t.call(n,n)),at[at.length-1]==null||at[at.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen +Stack: ${at} +Trying to pop ${n.id}`;at.pop(),$(n,"color"),$(n,"display"),$(n,"classes"),$(n,"style"),$(n,"name"),ie(n,"name",n.id),$(n,"minWidth"),ie(n,"minWidth",600),$(n,"minimizable"),ie(n,"minimizable",!0),$(n,"minimizedDisplay");const r=n.style;return n.style=N(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function zi(e,t){if(console.info("Adding layer",e.id),Ne[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Ne[e.id]);return}ie(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Ne[e.id]=e,We.emit("addLayer",e,t.layers[e.id])}function js(e){return Ne[e]}function Pr(e){console.info("Removing layer",e.id),We.emit("removeLayer",e),Ne[e.id]=void 0}function zs(e){Pr(e),zi(e,Q)}function Us(e){const t=V(!1);return{openModal:()=>t.value=!0,modal:J(()=>p(jt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(e.display)}))}}We.on("update",function(t){Object.values(Ne).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Ne).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Ne).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Gs=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:qi,UnregisterNodeInjectionKey:Vi,NodesInjectionKey:Bi,BoundsInjectionKey:Li,layers:Ne,persistentRefs:sn,addingLayers:at,createLayer:ji,addLayer:zi,getLayer:js,removeLayer:Pr,reloadLayer:zs,setupLayerModal:Us},Symbol.toStringTag,{value:"Module"}));const Ws=Y({components:{Context:xr},props:{index:{type:Number,required:!0},display:{type:O(Object,String,Function),required:!0},minimizedDisplay:O(Object,String,Function),minimized:{type:Object,required:!0},name:{type:O(String),required:!0},color:O(String),minimizable:O(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Ie(e),a=$r(t),l=Sn(r),u=N(()=>ge.allowGoBack&&n.value>0&&!Ce(i));function c(){Q.tabs.splice(s(e.index),1/0)}function d(m){e.nodes.value=m}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:d,unref:s,goBack:c}}}),Hs={key:1};function Zs(e,t,n,i,r,a){const l=Nt("Context");return k(),P("div",{class:"layer-container",style:Re({"--layer-color":e.unref(e.color)})},[e.showGoBack?(k(),P("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):B("",!0),e.unref(e.minimized)?(k(),P("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(k(),ee(Ge(e.minimizedComponent),{key:0})):(k(),P("div",Hs,ae(e.unref(e.name)),1))])):(k(),P("div",{key:2,class:me(["layer-tab",{showGoBack:e.showGoBack}])},[p(l,{onUpdateNodes:e.updateNodes},{default:H(()=>[(k(),ee(Ge(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(k(),P("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],4)}var Ys=fe(Ws,[["render",Zs],["__scopeId","data-v-72dd78b1"]]);const Tr=e=>(un("data-v-4b4bda40"),e=e(),cn(),e),Xs=Tr(()=>_("h2",null,"Changelog",-1)),Js=Tr(()=>_("details",{open:""},[_("summary",null,[x("v0.0 Initial Commit - "),_("time",null,"2021-09-04")]),x(" This is the first release :D "),_("ul",null,[_("li",{class:"feature"},"Did everything"),_("li",{class:"fix"},"Had some fun"),_("li",{class:"breaking"},"Removed everything"),_("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ks=Y({__name:"Changelog",setup(e,{expose:t}){const n=V(!1);return t({open(){n.value=!0}}),(i,r)=>(k(),ee(jt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:H(()=>[Xs]),body:H(()=>[Js]),_:1},8,["modelValue"]))}});var Qs=fe(Ks,[["__scopeId","data-v-4b4bda40"]]),eo=Y({props:{element:Object,display:{type:O(Object,String,Function),required:!0},style:O(Object,String,Array),classes:O(Object),direction:O(String),xoffset:O(String),yoffset:O(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Ie(e),r=V(!1),a=N(()=>(Ce(i)||r.value)&&l.value),l=Sn(n),u=gt(ue(J(()=>{const m=Ce(t);return m==null?"":_t(m)})));function c(m){const f=i;m.shiftKey&&f&&(f.value=!f.value,m.stopPropagation(),m.preventDefault())}const d=N(()=>Ce(i)&&yt[re.theme].showPin);return{Direction:G,isHovered:r,isShown:a,comp:l,elementComp:u,unref:s,togglePinned:c,showPin:d}}});const to={key:0,class:"material-icons pinned"};function no(e,t,n,i,r,a){return k(),P("div",{class:me(["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))},[Et(e.$slots,"default",{},void 0,!0),e.elementComp?(k(),ee(Ge(e.elementComp),{key:0})):B("",!0),p(Cn,{name:"fade"},{default:H(()=>{var l;return[e.isShown?(k(),P("div",{key:0,class:me(["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:Re([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(k(),P("span",to,"push_pin")):B("",!0),e.comp?(k(),ee(Ge(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var xe=fe(eo,[["render",no],["__scopeId","data-v-6102fa3a"]]);const fn=e=>(un("data-v-4f97aa40"),e=e(),cn(),e),io={class:"info-modal-header"},ro=["src","alt"],ao={class:"info-modal-title"},so={key:0},oo={key:0},lo={key:0},uo=fn(()=>_("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),co=fn(()=>_("br",null,null,-1)),fo=fn(()=>_("br",null,null,-1)),po=["href"],go=fn(()=>_("span",{class:"material-icons info-modal-discord"},"discord",-1)),mo=fn(()=>_("div",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[_("span",{class:"material-icons info-modal-discord"},"discord"),x(" The Paper Pilot Community ")])],-1)),vo=fn(()=>_("div",null,[_("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[_("span",{class:"material-icons info-modal-discord"},"discord"),x(" The Modding Tree ")])],-1)),ho=fn(()=>_("br",null,null,-1));var bo=Y({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:l,discordLink:u,versionNumber:c,versionTitle:d}=ge,m=Ie(n),f=V(!1),h=N(()=>ci(Q.timePlayed)),w=N(()=>ue(J(()=>p(ne,null,[Ms.map(et)]))));t({open(){f.value=!0}});function v(){var y;(y=s(m.changelog))==null||y.open()}return(y,I)=>(k(),ee(jt,{modelValue:f.value,"onUpdate:modelValue":I[0]||(I[0]=A=>f.value=A)},{header:H(()=>[_("div",io,[s(r)?(k(),P("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,ro)):B("",!0),_("div",ao,[_("h2",null,ae(s(i)),1),_("h4",null,[x(" v"+ae(s(c)),1),s(d)?(k(),P("span",so,": "+ae(s(d)),1)):B("",!0)])])])]),body:H(({shown:A})=>[A?(k(),P("div",oo,[s(a)?(k(),P("div",lo,"By "+ae(s(a)),1)):B("",!0),uo,co,_("div",{class:"link",onClick:v},"Changelog"),fo,_("div",null,[s(u)?(k(),P("a",{key:0,href:s(u),class:"info-modal-discord-link",target:"_blank"},[go,x(" "+ae(s(l)),1)],8,po)):B("",!0)]),mo,vo,ho,_("div",null,"Time Played: "+ae(s(h)),1),(k(),ee(Ge(s(w))))])):B("",!0)]),_:1},8,["modelValue"]))}});var yo=fe(bo,[["__scopeId","data-v-4f97aa40"]]);const wo={class:"field"},_o={key:0,class:"field-title"},Ui=Y({__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,i=Sn(Yt(n,"title"),"span"),r=V((l=n.options.find(u=>u.value===n.modelValue))!=null?l:null);pt(Yt(n,"modelValue"),u=>{var c;Ce(r)!==u&&(r.value=(c=n.options.find(d=>d.value===u))!=null?c:null)});function a(u){t("update:modelValue",u.value)}return(u,c)=>(k(),P("div",wo,[s(i)?(k(),P("span",_o,[(k(),ee(Ge(s(i))))])):B("",!0),p(s(va),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>r.value=d),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const No={class:"field"},Co=Y({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=N(()=>{var a;return ue((a=s(n.title))!=null?a:"","span")}),r=N({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,l)=>(k(),P("label",No,[Ai(_("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=u=>Pe(r)?r.value=u:null)},null,512),[[da,s(r)]]),(k(),ee(Ge(s(i))))]))}});var qt=fe(Co,[["__scopeId","data-v-11046116"]]);const ko=["onClick"],Mo=Y({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=V(!1),i=V(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Bt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,l)=>(k(),P("button",{onClick:Nn(r,["stop"]),class:me(["feedback",{activated:n.value,left:e.left}])},[Et(a.$slots,"default",{},void 0,!0)],10,ko))}});var Dr=fe(Mo,[["__scopeId","data-v-01a1b95c"]]);const So={class:"header"},Io=_("h2",null,"Settings",-1),$o={class:"option-tabs"},xo={key:0},Eo={key:1};var Po=Y({__name:"Options",setup(e,{expose:t}){const n=V(!1),i=V("behaviour");function r(K){return K==i.value}function a(K){i.value=K}t({isTab:r,setTab:a,save:dt,open(){n.value=!0}});const l=Object.keys(yt).map(K=>({label:Qe(K),value:K})),u=N(()=>ue(J(()=>p(ne,null,[Mr.map(et)])))),{showTPS:c,theme:d,unthrottled:m,alignUnits:f}=Ie(re),{autosave:h,offlineProd:w}=Ie(Q),v=N({get(){return Q.devSpeed===0},set(K){Q.devSpeed=K?0:null}}),y=J(()=>p("span",{class:"option-title"},[x("Unthrottled"),p("desc",null,[x("Allow the game to run as fast as possible. Not battery friendly.")])])),I=J(()=>p("span",{class:"option-title"},[x("Offline Production"),p(xe,{display:"Save-specific",direction:G.Right},{default:()=>[x("*")]}),p("desc",null,[x("Simulate production that occurs while the game is closed.")])])),A=J(()=>p("span",{class:"option-title"},[x("Autosave"),p(xe,{display:"Save-specific",direction:G.Right},{default:()=>[x("*")]}),p("desc",null,[x("Automatically save the game every second or when the game is closed.")])])),S=J(()=>p("span",{class:"option-title"},[x("Pause game"),p(xe,{display:"Save-specific",direction:G.Right},{default:()=>[x("*")]}),p("desc",null,[x("Stop everything from moving.")])])),E=J(()=>p("span",{class:"option-title"},[x("Theme"),p("desc",null,[x("How the game looks.")])])),j=J(()=>p("span",{class:"option-title"},[x("Show TPS"),p("desc",null,[x("Show TPS meter at the bottom-left corner of the page.")])])),se=J(()=>p("span",{class:"option-title"},[x("Align modifier units"),p("desc",null,[x("Align numbers to the beginning of the unit in modifier view.")])]));return(K,z)=>(k(),ee(jt,{modelValue:n.value,"onUpdate:modelValue":z[10]||(z[10]=W=>n.value=W)},{header:H(()=>[_("div",So,[Io,_("div",$o,[_("button",{class:me({selected:r("behaviour")}),onClick:z[0]||(z[0]=W=>a("behaviour"))},"Behaviour",2),_("button",{class:me({selected:r("appearance")}),onClick:z[1]||(z[1]=W=>a("appearance"))},"Appearance",2)])])]),body:H(()=>[r("behaviour")?(k(),P("div",xo,[p(qt,{title:s(y),modelValue:s(m),"onUpdate:modelValue":z[2]||(z[2]=W=>Pe(m)?m.value=W:null)},null,8,["title","modelValue"]),s(ge).enablePausing?(k(),ee(qt,{key:0,title:s(S),modelValue:s(v),"onUpdate:modelValue":z[3]||(z[3]=W=>Pe(v)?v.value=W:null)},null,8,["title","modelValue"])):B("",!0),p(qt,{title:s(I),modelValue:s(w),"onUpdate:modelValue":z[4]||(z[4]=W=>Pe(w)?w.value=W:null)},null,8,["title","modelValue"]),p(qt,{title:s(A),modelValue:s(h),"onUpdate:modelValue":z[5]||(z[5]=W=>Pe(h)?h.value=W:null)},null,8,["title","modelValue"]),s(h)?B("",!0):(k(),ee(Dr,{key:1,class:"button save-button",onClick:z[6]||(z[6]=W=>s(dt)())},{default:H(()=>[x("Manually save")]),_:1}))])):B("",!0),r("appearance")?(k(),P("div",Eo,[p(Ui,{title:s(E),options:s(l),modelValue:s(d),"onUpdate:modelValue":z[7]||(z[7]=W=>Pe(d)?d.value=W:null)},null,8,["title","options","modelValue"]),(k(),ee(Ge(s(u)))),p(qt,{title:s(j),modelValue:s(c),"onUpdate:modelValue":z[8]||(z[8]=W=>Pe(c)?c.value=W:null)},null,8,["title","modelValue"]),p(qt,{title:s(se),modelValue:s(f),"onUpdate:modelValue":z[9]||(z[9]=W=>Pe(f)?f.value=W:null)},null,8,["title","modelValue"])])):B("",!0)]),_:1},8,["modelValue"]))}});const To=["onSubmit"],Do={class:"field"},Fo={key:0,class:"field-title"},Ao=["placeholder"],Oo=Y({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=Sn(Yt(n,"title"),"span"),r=gt(null);li(()=>{var c;(c=r.value)==null||c.focus()});const a=N({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(k(),P("form",{onSubmit:Nn(l,["prevent"])},[_("div",Do,[s(i)?(k(),P("span",Fo,[(k(),ee(Ge(s(i))))])):B("",!0),e.textArea?(k(),ee(s(ba),{key:1,modelValue:s(a),"onUpdate:modelValue":d[0]||(d[0]=m=>Pe(a)?a.value=m:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Ai((k(),P("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=m=>Pe(a)?a.value=m:null),placeholder:e.placeholder,class:me({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:r},null,42,Ao)),[[fa,s(a)]])])],40,To))}});var Fr=fe(Oo,[["__scopeId","data-v-90bd4994"]]);const Ro={key:0},qo=["onClick","disabled"],Vo={key:0},Bo=["onClick"],Lo=Y({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Ie(e),r=V(!1);pt(r,u=>{t("confirmingChanged",u)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(u,c)=>(k(),P("span",{class:me(["container",{confirming:r.value}])},[r.value?(k(),P("span",Ro,"Are you sure?")):B("",!0),_("button",{onClick:Nn(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(k(),P("span",Vo,"Yes")):Et(u.$slots,"default",{key:1},void 0,!0)],8,qo),r.value?(k(),P("button",{key:1,class:"button",onClick:Nn(l,["stop"])},"No",8,Bo)):B("",!0)],2))}});var jo=fe(Lo,[["__scopeId","data-v-2f8ef34c"]]);const zt=e=>(un("data-v-32313015"),e=e(),cn(),e),zo=zt(()=>_("div",{class:"handle material-icons"},"drag_handle",-1)),Uo={key:0,class:"actions"},Go=zt(()=>_("span",{class:"material-icons"},"content_paste",-1)),Wo=zt(()=>_("span",{class:"material-icons"},"content_copy",-1)),Ho=zt(()=>_("span",{class:"material-icons"},"edit",-1)),Zo=zt(()=>_("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Yo={key:1,class:"actions"},Xo=zt(()=>_("span",{class:"material-icons"},"check",-1)),Jo=zt(()=>_("span",{class:"material-icons"},"close",-1)),Ko={key:2,class:"details"},Qo={class:"save-version"},el=zt(()=>_("br",null,null,-1)),tl={key:0},nl={key:3,class:"details"},il={key:4,class:"details error"},rl=zt(()=>_("br",null,null,-1)),al=Y({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Ie(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=V(!1),l=V(!1),u=V("");pt(a,()=>{var f;return u.value=(f=i.value.name)!=null?f:""});const c=N(()=>i.value!=null&&i.value.id===Q.id),d=N(()=>{var f;return c.value?Q.time:(f=i.value!=null&&i.value.time)!=null?f:0});function m(){t("editName",u.value),a.value=!1}return(f,h)=>(k(),P("div",{class:me(["save",{active:s(c)}])},[zo,a.value?(k(),P("div",Yo,[_("button",{onClick:m,class:"button"},[p(xe,{display:"Save",direction:s(G).Left,class:"info"},{default:H(()=>[Xo]),_:1},8,["direction"])]),_("button",{onClick:h[5]||(h[5]=w=>a.value=!a.value),class:"button"},[p(xe,{display:"Cancel",direction:s(G).Left,class:"info"},{default:H(()=>[Jo]),_:1},8,["direction"])])])):(k(),P("div",Uo,[s(i).error==null&&!l.value?(k(),ee(Dr,{key:0,onClick:h[0]||(h[0]=w=>t("export")),class:"button",left:""},{default:H(()=>[p(xe,{display:"Export",direction:s(G).Left,class:"info"},{default:H(()=>[Go]),_:1},8,["direction"])]),_:1})):B("",!0),s(i).error==null&&!l.value?(k(),P("button",{key:1,onClick:h[1]||(h[1]=w=>t("duplicate")),class:"button"},[p(xe,{display:"Duplicate",direction:s(G).Left,class:"info"},{default:H(()=>[Wo]),_:1},8,["direction"])])):B("",!0),s(i).error==null&&!l.value?(k(),P("button",{key:2,onClick:h[2]||(h[2]=w=>a.value=!a.value),class:"button"},[p(xe,{display:"Edit Name",direction:s(G).Left,class:"info"},{default:H(()=>[Ho]),_:1},8,["direction"])])):B("",!0),p(jo,{disabled:s(c),onClick:h[3]||(h[3]=w=>t("delete")),onConfirmingChanged:h[4]||(h[4]=w=>l.value=w)},{default:H(()=>[p(xe,{display:"Delete",direction:s(G).Left,class:"info"},{default:H(()=>[Zo]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(k(),P("div",Ko,[_("button",{class:"button open",onClick:h[6]||(h[6]=w=>t("open"))},[_("h3",null,ae(s(i).name),1)]),_("span",Qo,"v"+ae(s(i).modVersion),1),el,s(d)?(k(),P("div",tl,"Last played "+ae(s(r).format(s(d))),1)):B("",!0)])):s(i).error==null&&a.value?(k(),P("div",nl,[p(Fr,{modelValue:u.value,"onUpdate:modelValue":h[7]||(h[7]=w=>u.value=w),class:"editname",onSubmit:m},null,8,["modelValue"])])):(k(),P("div",il,[x(" Error: Failed to load save with id "+ae(s(i).id),1),rl,x(ae(s(i).error),1)]))],2))}});var sl=fe(al,[["__scopeId","data-v-32313015"]]);const Gi=e=>(un("data-v-2a4275be"),e=e(),cn(),e),ol=Gi(()=>_("h2",null,"Saves Manager",-1)),ll={class:"modal-footer"},ul={class:"field"},cl=Gi(()=>_("span",{class:"field-title"},"Create Save",-1)),dl={class:"field-buttons"},fl={class:"footer"},pl=Gi(()=>_("div",{style:{"flex-grow":"1"}},null,-1)),gl=Y({__name:"SavesManager",setup(e,{expose:t}){const n=V(!1),i=V(null);t({open(){n.value=!0}});const r=V(!1),a=V(""),l=V(null);pt(a,S=>{S?Bt(()=>{try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Wt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S),r.value=!0;return}const E=JSON.parse(S);if(typeof E!="object"){r.value=!0;return}const j=ei();E.id=j,dt(E),a.value="",r.value=!1,re.saves.push(j)}catch{r.value=!0}}):r.value=!1});let u={},c=V(Object.keys(u).reduce((S,E)=>(S.push({label:E.split("/").slice(-1)[0].slice(0,-4),value:u[E]}),S),[]));const d=Oi({});function m(S){if(d[S]==null){let E=localStorage.getItem(S);if(E==null)d[S]={error:"Save doesn't exist in localStorage",id:S};else if(E==="dW5kZWZpbmVk")d[S]={error:"Save is undefined",id:S};else try{if(E[0]!=="{")if(E[0]==="e")E=decodeURIComponent(escape(atob(E)));else if(E[0]==="\u1BE1")E=Wt.decompressFromUTF16(E);else return console.warn("Unable to determine preset encoding",E),r.value=!0,d[S]={error:"Unable to determine preset encoding",id:S},d[S];d[S]={...JSON.parse(E),id:S}}catch(j){d[S]={error:j,id:S},console.warn(`SavesManager: Failed to load info about save with id ${S}: +${j} +${E}`)}}return d[S]}pt(n,S=>{S&&Object.keys(d).forEach(E=>delete d[E])});const f=N(()=>re.saves.reduce((S,E)=>(S[E]=m(E),S),{}));function h(S){let E;switch(Q.id===S?E=Cr(Q):E=JSON.stringify(f.value[S]),ge.exportEncoding){default:console.warn(`Unknown save encoding: ${ge.exportEncoding}. Defaulting to lz`);case"lz":E=Wt.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const j=document.createElement("textarea");j.value=E,document.body.appendChild(j),j.select(),j.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(j)}function w(S){Q.id===S&&dt();const E={...f.value[S],id:ei()};dt(E),re.saves.push(E.id)}function v(S){re.saves=re.saves.filter(E=>E!==S),localStorage.removeItem(S),d[S]=void 0}function y(S){f.value[Q.id].time=Q.time,dt(),d[Q.id]=void 0,nn(f.value[S]),d[S]=void 0}function I(S){if(l.value=S,Bt(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Wt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const E=JSON.parse(S);E.id=ei(),dt(E),re.saves.push(E.id),y(E.id)}function A(S,E){const j=f.value[S];j!=null&&(j.name=E,Q.id===S?(Q.name=E,dt()):(dt(j),d[S]=void 0))}return(S,E)=>(k(),ee(jt,{modelValue:n.value,"onUpdate:modelValue":E[4]||(E[4]=j=>n.value=j),ref_key:"modal",ref:i},{header:H(()=>[ol]),body:H(({shown:j})=>[j?(k(),ee(s(ha),{key:0,list:s(re).saves,handle:".handle",itemKey:se=>se},{item:H(({element:se})=>[p(sl,{save:s(f)[se],onOpen:K=>y(se),onExport:K=>h(se),onEditName:K=>A(se,K),onDuplicate:K=>w(se),onDelete:K=>v(se)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[_("div",ll,[p(Fr,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=j=>a.value=j),title:"Import Save",placeholder:"Paste your save here!",class:me({importingFailed:r.value})},null,8,["modelValue","class"]),_("div",ul,[cl,_("div",dl,[_("button",{class:"button",onClick:E[1]||(E[1]=j=>y(s(_n)().id))},"New Game"),Object.keys(s(c)).length>0?(k(),ee(Ui,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":E[2]||(E[2]=j=>I(j)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),_("div",fl,[pl,_("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=j=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Ar=fe(gl,[["__scopeId","data-v-2a4275be"]]);const vt=e=>(un("data-v-318a1c31"),e=e(),cn(),e),ml=["src","alt"],vl={key:1,class:"title"},hl=vt(()=>_("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),bl={class:"discord"},yl={class:"discord-links"},wl={key:0},_l=["href"],Nl=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Cl=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),kl={href:"https://forums.moddingtree.com/",target:"_blank"},Ml=vt(()=>_("span",{class:"material-icons"},"forum",-1)),Sl=vt(()=>_("span",{class:"material-icons"},"info",-1)),Il=vt(()=>_("span",{class:"material-icons"},"library_books",-1)),$l=vt(()=>_("span",{class:"material-icons"},"settings",-1)),xl=vt(()=>_("span",{class:"material-icons"},"library_books",-1)),El=vt(()=>_("span",{class:"material-icons"},"settings",-1)),Pl=vt(()=>_("span",{class:"material-icons"},"info",-1)),Tl={href:"https://forums.moddingtree.com/",target:"_blank"},Dl=vt(()=>_("span",{class:"material-icons"},"forum",-1)),Fl={class:"discord"},Al={class:"discord-links"},Ol={key:0},Rl=["href"],ql=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Vl=vt(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Bl=Y({__name:"Nav",setup(e){const t=V(null),n=V(null),i=V(null),r=V(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:d,versionNumber:m}=ge;function f(){window.open(d,"mywindow")}return(h,w)=>(k(),P(ne,null,[s(a)?(k(),P("div",Lt({key:0,class:"nav"},h.$attrs),[s(l)?(k(),P("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,ml)):(k(),P("div",vl,ae(s(u)),1)),_("div",{onClick:w[0]||(w[0]=v=>{var y;return(y=r.value)==null?void 0:y.open()}),class:"version-container"},[p(xe,{display:"Changelog",direction:s(G).Down,class:"version"},{default:H(()=>[_("span",null,"v"+ae(s(m)),1)]),_:1},8,["direction"])]),hl,_("div",bl,[_("span",{onClick:f,class:"material-icons"},"discord"),_("ul",yl,[s(d)?(k(),P("li",wl,[_("a",{href:s(d),target:"_blank"},ae(s(c)),9,_l)])):B("",!0),Nl,Cl])]),_("div",null,[_("a",kl,[p(xe,{display:"Forums",direction:s(G).Down,yoffset:"5px"},{default:H(()=>[Ml]),_:1},8,["direction"])])]),_("div",{onClick:w[1]||(w[1]=v=>{var y;return(y=t.value)==null?void 0:y.open()})},[p(xe,{display:"Info",direction:s(G).Down,class:"info"},{default:H(()=>[Sl]),_:1},8,["direction"])]),_("div",{onClick:w[2]||(w[2]=v=>{var y;return(y=n.value)==null?void 0:y.open()})},[p(xe,{display:"Saves",direction:s(G).Down,xoffset:"-20px"},{default:H(()=>[Il]),_:1},8,["direction"])]),_("div",{onClick:w[3]||(w[3]=v=>{var y;return(y=i.value)==null?void 0:y.open()})},[p(xe,{display:"Settings",direction:s(G).Down,xoffset:"-66px"},{default:H(()=>[$l]),_:1},8,["direction"])])],16)):(k(),P("div",Lt({key:1,class:"overlay-nav"},h.$attrs),[_("div",{onClick:w[4]||(w[4]=v=>{var y;return(y=r.value)==null?void 0:y.open()}),class:"version-container"},[p(xe,{display:"Changelog",direction:s(G).Right,xoffset:"25%",class:"version"},{default:H(()=>[_("span",null,"v"+ae(s(m)),1)]),_:1},8,["direction"])]),_("div",{onClick:w[5]||(w[5]=v=>{var y;return(y=n.value)==null?void 0:y.open()})},[p(xe,{display:"Saves",direction:s(G).Right},{default:H(()=>[xl]),_:1},8,["direction"])]),_("div",{onClick:w[6]||(w[6]=v=>{var y;return(y=i.value)==null?void 0:y.open()})},[p(xe,{display:"Settings",direction:s(G).Right},{default:H(()=>[El]),_:1},8,["direction"])]),_("div",{onClick:w[7]||(w[7]=v=>{var y;return(y=t.value)==null?void 0:y.open()})},[p(xe,{display:"Info",direction:s(G).Right},{default:H(()=>[Pl]),_:1},8,["direction"])]),_("div",null,[_("a",Tl,[p(xe,{display:"Forums",direction:s(G).Right,xoffset:"7px"},{default:H(()=>[Dl]),_:1},8,["direction"])])]),_("div",Fl,[_("span",{onClick:f,class:"material-icons"},"discord"),_("ul",Al,[s(d)?(k(),P("li",Ol,[_("a",{href:s(d),target:"_blank"},ae(s(c)),9,Rl)])):B("",!0),ql,Vl])])],16)),p(yo,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(Ar,{ref_key:"savesManager",ref:n},null,512),p(Po,{ref_key:"options",ref:i},null,512),p(Qs,{ref_key:"changelog",ref:r},null,512)],64))}});var Or=fe(Bl,[["__scopeId","data-v-318a1c31"]]);const Ll={class:"inner-tab"},jl=Y({__name:"Game",setup(e){const t=Yt(Q,"tabs"),n=N(()=>Object.keys(Ne)),i=ge.useHeader;function r(a){const{display:l,minimized:u,name:c,color:d,minimizable:m,nodes:f,minimizedDisplay:h}=a;return{display:l,minimized:u,name:c,color:d,minimizable:m,nodes:f,minimizedDisplay:h}}return(a,l)=>(k(),P("div",{class:me(["tabs-container",{useHeader:s(i)}])},[(k(!0),P(ne,null,kn(s(t),(u,c)=>{var d,m;return k(),P("div",{key:c,class:me(["tab",s((d=s(Ne)[u])==null?void 0:d.classes)]),style:Re(s((m=s(Ne)[u])==null?void 0:m.style))},[c===0&&!s(i)?(k(),ee(Or,{key:0})):B("",!0),_("div",Ll,[s(n).includes(u)?(k(),ee(Ys,Lt({key:0},r(s(Ne)[u]),{index:c,onSetMinimized:f=>s(Ne)[u].minimized.value=f}),null,16,["index","onSetMinimized"])):(k(),ee(Ge(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var zl=fe(jl,[["__scopeId","data-v-dcd207b4"]]);const Ul=Y({__name:"Sticky",setup(e){const t=V("0"),n=new ResizeObserver(r),i=gt(null);function r(){let a=i.value;if(a==null)return;let l=0;for(;a.previousSibling;){const u=a.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),a=u}t.value=l+"px"}return Bt(r),document.fonts.ready.then(r),li(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(k(),P("div",{class:"sticky",style:Re({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[Et(a.$slots,"default",{},void 0,!0)],4))}});var si=fe(Ul,[["__scopeId","data-v-cccac690"]]);const Gl=["x1","y1","x2","y2"],Wl=Y({__name:"BoardLink",props:{link:null},setup(e){const n=Ie(e),i=N(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=N(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,l)=>(k(),P("line",Lt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Gl))}});var Hl=fe(Wl,[["__scopeId","data-v-57c4970a"]]);const Zl={key:0},Yl=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Xl=["fill","stroke-width","stroke"],Jl=["fill"],Kl=Y({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Ie(e),r=N(()=>pe(i.nodeType.value.size,s(i.node))),a=N(()=>{var m;return(m=pe(i.nodeType.value.outlineColor,s(i.node)))!=null?m:yt[re.theme].variables["--outline"]}),l=N(()=>{var m;return(m=pe(i.nodeType.value.titleColor,s(i.node)))!=null?m:yt[re.theme].variables["--foreground"]}),u=N(()=>pe(i.nodeType.value.actionDistance,s(i.node)));function c(m,f){t("clickAction",f.id),m.preventDefault(),m.stopPropagation()}function d(m,f){var h;((h=s(i.selectedAction))==null?void 0:h.id)===f.id&&(m.preventDefault(),m.stopPropagation())}return(m,f)=>(k(),ee(Cn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(k(),P("g",Zl,[(k(!0),P(ne,null,kn(e.actions,(h,w)=>{var v,y;return k(),P("g",{key:h.id,class:me(["action",{selected:((v=e.selectedAction)==null?void 0:v.id)===h.id}]),transform:`translate( + ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-w)*s(u))}, + ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-w)*s(u))} + )`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:Nn(I=>d(I,h),["stop"])},[_("circle",{fill:s(pe)(h.fillColor,e.node),r:"20","stroke-width":((y=e.selectedAction)==null?void 0:y.id)===h.id?4:0,stroke:s(a)},null,8,Xl),_("text",{fill:s(l),class:"material-icons"},ae(s(pe)(h.icon,e.node)),9,Jl)],42,Yl)}),128))])):B("",!0)]),_:1}))}});var Ql=fe(Kl,[["__scopeId","data-v-9efb2a56"]]);const eu=["transform"],tu={key:0},nu=["r","fill","stroke"],iu=["r","fill","stroke"],ru=["r","fill"],au=["r","stroke-dasharray","stroke-dashoffset","stroke"],su={key:1,transform:"rotate(45, 0, 0)"},ou=["width","height","transform","fill","stroke"],lu=["width","height","transform","fill","stroke"],uu=["width","height","transform","fill"],cu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],du=["fill","y"],fu=["fill"],pu={key:0},gu=["fill","y"],mu=["fill","y"],vu=Y({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Ie(n),a=N(()=>s(r.selectedNode)===s(r.node)),l=N(()=>pe(r.nodeType.value.draggable,s(r.node)));pt(l,X=>{const we=s(r.node);s(r.dragging)===we&&!X&&t("endDragging",we)});const u=N(()=>{var we;const X=s(r.node);return(we=pe(r.nodeType.value.actions,X))==null?void 0:we.filter(nt=>Le(pe(nt.visibility,X)))}),c=N(()=>{var we;const X=s(r.node);if(pe(r.nodeType.value.draggable,X)&&((we=s(r.dragging))==null?void 0:we.id)===X.id&&s(r.dragged)!=null){const{x:nt,y:ot}=s(r.dragged);return{x:X.position.x+Math.round(nt/25)*25,y:X.position.y+Math.round(ot/25)*25}}return X.position}),d=N(()=>pe(r.nodeType.value.shape,s(r.node))),m=N(()=>pe(r.nodeType.value.title,s(r.node))),f=N(()=>pe(r.nodeType.value.subtitle,s(r.node))),h=N(()=>{var X;return(X=a.value?s(r.selectedAction)&&pe(s(r.selectedAction).tooltip,s(r.node)):null)!=null?X:pe(r.nodeType.value.label,s(r.node))}),w=N(()=>{var X,we;return pe((we=(X=s(r.selectedAction))==null?void 0:X.confirmationLabel)!=null?we:{text:"Tap again to confirm"},s(r.node))}),v=N(()=>pe(r.nodeType.value.size,s(r.node))),y=N(()=>{var X;return(X=pe(r.nodeType.value.progress,s(r.node)))!=null?X:0}),I=N(()=>yt[re.theme].variables["--background"]),A=N(()=>{var X;return(X=pe(r.nodeType.value.outlineColor,s(r.node)))!=null?X:yt[re.theme].variables["--outline"]}),S=N(()=>{var X;return(X=pe(r.nodeType.value.fillColor,s(r.node)))!=null?X:yt[re.theme].variables["--raised-background"]}),E=N(()=>pe(r.nodeType.value.progressColor,s(r.node))),j=N(()=>{var X;return(X=pe(r.nodeType.value.titleColor,s(r.node)))!=null?X:yt[re.theme].variables["--foreground"]}),se=N(()=>pe(r.nodeType.value.progressDisplay,s(r.node))),K=N(()=>r.dragging.value!=null&&s(r.hasDragged)&&pe(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),z=N(()=>pe(r.nodeType.value.style,s(r.node))),W=N(()=>pe(r.nodeType.value.classes,s(r.node)));function qe(X){t("mouseDown",X,r.node.value,l.value)}function tt(X){var we,nt,ot;(we=r.hasDragged)!=null&&we.value||(t("endDragging",r.node.value),(ot=(nt=r.nodeType.value).onClick)==null||ot.call(nt,r.node.value),X.stopPropagation())}return(X,we)=>{var nt,ot,ht;return k(),P("g",{class:me(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(W)}]),style:Re([{opacity:((nt=e.dragging)==null?void 0:nt.id)===e.node.id&&e.hasDragged?.5:1},(ot=s(z))!=null?ot:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(Ql,{actions:(ht=s(u))!=null?ht:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:we[0]||(we[0]=Ze=>t("clickAction",Ze))},null,8,["actions","is-selected","node","node-type","selected-action"]),_("g",{class:"node-container",onMousedown:qe,onTouchstartPassive:qe,onMouseup:tt,onTouchendPassive:tt},[s(d)===s(Xe).Circle?(k(),P("g",tu,[s(K)?(k(),P("circle",{key:0,class:"receiver",r:s(v)+8,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,nu)):B("",!0),_("circle",{class:"body",r:s(v),fill:s(S),stroke:s(A),"stroke-width":4},null,8,iu),s(se)===s(ln).Fill?(k(),P("circle",{key:1,class:"progress progressFill",r:Math.max(s(v)*s(y)-2,0),fill:s(E)},null,8,ru)):(k(),P("circle",{key:2,r:s(v)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(v)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(v)+4.5)*2*Math.PI-s(y)*(s(v)+4.5)*2*Math.PI,stroke:s(E)},null,8,au))])):s(d)===s(Xe).Diamond?(k(),P("g",su,[s(K)?(k(),P("rect",{key:0,class:"receiver",width:s(v)*s(i)+16,height:s(v)*s(i)+16,transform:`translate(${-(s(v)*s(i)+16)/2}, ${-(s(v)*s(i)+16)/2})`,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ou)):B("",!0),_("rect",{class:"body",width:s(v)*s(i),height:s(v)*s(i),transform:`translate(${-s(v)*s(i)/2}, ${-s(v)*s(i)/2})`,fill:s(S),stroke:s(A),"stroke-width":4},null,8,lu),s(se)===s(ln).Fill?(k(),P("rect",{key:1,class:"progress progressFill",width:Math.max(s(v)*s(i)*s(y)-2,0),height:Math.max(s(v)*s(i)*s(y)-2,0),transform:`translate(${-Math.max(s(v)*s(i)*s(y)-2,0)/2}, ${-Math.max(s(v)*s(i)*s(y)-2,0)/2})`,fill:s(E)},null,8,uu)):(k(),P("rect",{key:2,class:"progress progressDiamond",width:s(v)*s(i)+9,height:s(v)*s(i)+9,transform:`translate(${-(s(v)*s(i)+9)/2}, ${-(s(v)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(v)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(v)*s(i)+9)*4-s(y)*(s(v)*s(i)+9)*4,stroke:s(E)},null,8,cu))])):B("",!0),_("text",{fill:s(j),class:"node-title",y:s(f)?10:0},ae(s(m)),9,du),s(f)?(k(),P("text",{key:2,fill:s(j),class:"node-subtitle",y:"-15"},ae(s(f)),9,fu)):B("",!0)],32),p(Cn,{name:"fade",appear:""},{default:H(()=>{var Ze;return[s(h)?(k(),P("g",pu,[_("text",{fill:(Ze=s(h).color)!=null?Ze:s(j),class:me(["node-title",{pulsing:s(h).pulsing}]),y:-s(v)-20},ae(s(h).text),11,gu)])):B("",!0)]}),_:1}),p(Cn,{name:"fade",appear:""},{default:H(()=>{var Ze;return[s(a)&&e.selectedAction?(k(),P("text",{key:0,fill:(Ze=s(w).color)!=null?Ze:s(j),class:me(["node-title",{pulsing:s(w).pulsing}]),y:s(v)+75},ae(s(w).text),11,mu)):B("",!0)]}),_:1})],14,eu)}}});var hu=fe(vu,[["__scopeId","data-v-4654be02"]]);const bu={class:"stage",width:"100%",height:"100%"},yu={class:"g1"},wu=Y({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Ie(e),i=V({x:0,y:0}),r=V({x:0,y:0}),a=V(!1),l=V(null),u=N(()=>{const w=n.nodes.value.slice();if(n.draggingNode.value){const v=w.splice(w.indexOf(n.draggingNode.value),1)[0];w.push(v)}return w});wt(()=>{const w=n.draggingNode.value;if(w==null)return null;const v={x:w.position.x+r.value.x,y:w.position.y+r.value.y};let y=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,A)=>{if(A.id===w.id)return I;const S=n.types.value[A.type];if(!pe(S.canAccept,A,w))return I;const j=Math.pow(v.x-A.position.x,2)+Math.pow(v.y-A.position.y,2);let se=pe(S.size,A);return j>y||j>se*se?I:(y=j,A)},null))});function c(w){w.setTransformOrigin(null),w.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(w,v=null,y=!1){if(n.draggingNode.value==null){w.preventDefault(),w.stopPropagation();let I,A;if("touches"in w)if(w.touches.length===1)I=w.touches[0].clientX,A=w.touches[0].clientY;else return;else I=w.clientX,A=w.clientY;i.value={x:I,y:A},r.value={x:0,y:0},a.value=!1,y&&n.setDraggingNode.value(v)}v!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function m(w){const{x:v,y,scale:I}=l.value.panZoomInstance.getTransform();let A,S;if("touches"in w)if(w.touches.length===1)A=w.touches[0].clientX,S=w.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else A=w.clientX,S=w.clientY;n.mousePosition.value={x:(A-v)/I,y:(S-y)/I},r.value={x:r.value.x+(A-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:A,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(w.preventDefault(),w.stopPropagation())}function f(w,v=!1){var y,I;if(n.draggingNode.value!=null&&n.draggingNode.value===w){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const A=n.nodes.value;A.push(A.splice(A.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(y=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(y,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!v&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(w,v){n.state.value.selectedAction===v?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:v}}return(w,v)=>{const y=Nt("panZoom");return s(Le)(e.visibility)?(k(),ee(y,{key:0,style:Re([{width:e.width,height:e.height},e.style]),class:me(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:m,onTouchmove:m,onMousedown:v[0]||(v[0]=I=>d(I)),onTouchstart:v[1]||(v[1]=I=>d(I)),onMouseup:v[2]||(v[2]=()=>f(s(e.draggingNode))),onTouchendPassive:v[3]||(v[3]=()=>f(s(e.draggingNode))),onMouseleave:v[4]||(v[4]=()=>f(s(e.draggingNode),!0))},{default:H(()=>[(k(),P("svg",bu,[_("g",yu,[p(er,{name:"link",appear:""},{default:H(()=>[(k(!0),P(ne,null,kn(s(e.links)||[],I=>(k(),P("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(Hl,{link:I},null,8,["link"])]))),128))]),_:1}),p(er,{name:"grow",duration:500,appear:""},{default:H(()=>[(k(!0),P(ne,null,kn(s(u),I=>{var A;return k(),P("g",{key:I.id,style:{"transition-duration":"0s"}},[p(hu,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:a.value,receivingNode:((A=s(e.receivingNode))==null?void 0:A.id)===I.id,selectedNode:s(e.selectedNode),selectedAction:s(e.selectedAction),onMouseDown:d,onEndDragging:f,onClickAction:S=>h(I,S)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});We.on("setupVue",e=>ya.install(e));const Rr=Symbol("Board");var ln=(e=>(e.Outline="Outline",e.Fill="Fill",e))(ln||{}),Xe=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Xe||{});function _u(e){const t=ft({nodes:[],selectedNode:null,selectedAction:null},!1);return He(n=>{const i=e.call(n,n);i.id=Jt("board-"),i.type=Rr,i[mt]=wu,i.state?(Er(t),$(i,"state")):(t[Xt]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=N(()=>s(l.state).nodes),i.selectedNode=N({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;Pe(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=N({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;Pe(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=V(null),i.links?$(i,"links"):i.links=N(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?pe(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=V(null),i.receivingNode=V(null),$(i,"visibility"),ie(i,"visibility",he.Visible),$(i,"width"),ie(i,"width","100%"),$(i,"height"),ie(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),ie(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),ie(c,"draggable",!1),$(c,"shape"),ie(c,"shape","Circle"),$(c,"canAccept"),ie(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),ie(c,"progressDisplay","Fill"),$(c,"progressColor"),ie(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),ie(c,"actionDistance",Math.PI/6),c.nodes=N(()=>s(l.state).nodes.filter(d=>d.type===u)),ie(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),ie(d,"visibility",he.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),ie(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=G.Right){const m=l.nodes.value.slice().filter(f=>f===u||(d===G.Down||d===G.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===G.Left||d===G.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===G.Right&&f.position.xu.position.x+c||d===G.Up&&f.position.y>u.position.y+c||d===G.Down&&f.position.yf.position.x-h.position.x:d===G.Left?(f,h)=>h.position.x-f.position.x:d===G.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f0&&w>c)break}},i[st]=function(){const{nodes:u,types:c,state:d,visibility:m,width:f,height:h,style:w,classes:v,links:y,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:E,receivingNode:j}=this;return{nodes:u,types:c,state:d,visibility:m,width:f,height:h,style:s(w),classes:v,links:y,selectedAction:I,selectedNode:A,mousePosition:S,draggingNode:E,receivingNode:j,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function pe(e,t,...n){return ii(e)?e(t,...n):s(e)}function Un(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Rn={};We.on("addLayer",e=>{const t=Ti(e,Rr);Rn[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});We.on("removeLayer",e=>{var t;(t=Rn[e.id])==null||t.call(Rn),Rn[e.id]=void 0});function yn(e,t="points",n=0,i=void 0){const r=Pe(e)?e:ft(e);if(r.displayName=t,r.precision=n,r.small=i,!Pe(e)){const a=r[xt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function oi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?Mt(e.small?n:o.floor(n)):Mn(n,e.precision,e.small)}We.on("setupVue",e=>e.use(wa));function Nu(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const Cu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:{type:O(Object,String,Function),required:!0},style:O(String,Object,Array),classes:O(Object),glowColor:O(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Ie(e),a=$r(n),l=N(()=>{const c=Ce(i);return c==null||c===""?{}:s(r)?Nu(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:he,isVisible:Le,isHidden:dn}}});function ku(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(k(),P("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:me(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(k(),ee(Ge(e.component)))],6)):B("",!0)}var qr=fe(Cu,[["render",ku],["__scopeId","data-v-21427abb"]]);const Mu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},activeTab:{type:O(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:O(Object),required:!0},style:O(String,Object,Array),classes:O(Object),buttonContainerStyle:O(String,Object,Array),buttonContainerClasses:O(Object)},components:{Sticky:si,TabButton:qr},setup(e){const{activeTab:t}=Ie(e),n=N(()=>yt[re.theme].floatingTabs),i=gt("");wt(()=>{const u=Ce(t);if(u==null){i.value="";return}if(St(u)){i.value=ue(u);return}i.value=ue(s(u.display))});const r=N(()=>{const u=Ce(t);return St(u)||!u?void 0:s(u.classes)}),a=N(()=>{const u=Ce(t);return St(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:m,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:m,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:he,component:i,gatherButtonProps:l,unref:s,isVisible:Le,isHidden:dn}}});function Su(e,t,n,i,r,a){var c,d;const l=Nt("TabButton"),u=Nt("Sticky");return e.isVisible(e.visibility)?(k(),P("div",{key:0,class:me(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:me(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Re(e.unref(e.buttonContainerStyle))},{default:H(()=>[_("div",{class:me(["tab-buttons",{floating:e.floating}])},[(k(!0),P(ne,null,kn(e.unref(e.tabs),(m,f)=>(k(),ee(l,Lt({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(m.tab)===e.unref(e.activeTab)},e.gatherButtonProps(m)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(k(),ee(Ge(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var Iu=fe(Mu,[["render",Su],["__scopeId","data-v-58dbf83a"]]);const $u=Symbol("TabButton"),xu=Symbol("TabFamily");function Eu(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=ft(Object.keys(e)[0],!1);return He(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=Jt("tabFamily-"),r.type=xu,r[mt]=Iu,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=$u,d[mt]=qr,$(d,"visibility"),ie(d,"visibility",he.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=N(()=>{const u=s(a.tabs);if(n.value in u&&Le(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(d=>Le(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[st]=function(){const{visibility:u,activeTab:c,selected:d,tabs:m,style:f,classes:h,buttonContainerClasses:w,buttonContainerStyle:v}=this;return{visibility:u,activeTab:c,selected:d,tabs:m,style:s(f),classes:h,buttonContainerClasses:w,buttonContainerStyle:v}};const a=r;return a})}const Vr=o.ln(10);function qn(e){return e}function Pu(e,t){if(F(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Tu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return g.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Du(e){return g.neg(e)}function Fu(e,t,n){if(F(t))return t.invert(o.sub(e,be(n)));if(F(n))return n.invert(o.sub(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function Au(e,t,n){var i,r;if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return g.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return g.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function Ou(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.add(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Ru(e,t,n){if(F(t))return t.invert(o.add(e,be(n)));if(F(n))return n.invert(o.sub(be(t),e));throw new Error("Could not invert due to no input being a variable")}function qu(e,t,n){var i,r;if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return g.sub(a,g.times(n,(i=t.innermostVariable)!=null?i:0))}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return g.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Vu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.sub(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Bu(e,t,n){if(F(t))return t.invert(o.div(e,be(n)));if(F(n))return n.invert(o.div(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function Lu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.times(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function ju(e,t,n){if(F(t))return g.div(e,n);if(F(n))return g.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function zu(e,t,n){if(F(t))return t.invert(o.mul(e,be(n)));if(F(n))return n.invert(o.div(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Uu(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.div(i,n)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Gu(e,t,n){if(F(t))return g.mul(e,n);if(F(n))return g.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Wu(e,t){if(F(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function Hu(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Zu(e,t){if(F(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Yu(e){return o.ln(e).sub(1).times(e).div(Vr)}function Xu(e,t){if(F(t)){const n=Vr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function Ju(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Yu,invert:Xu})}throw new Error("Could not integrate due to no input being a variable")}function Ku(e,t,n){if(F(t))return t.invert(o.pow(be(n),e));if(F(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Qu(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function ec(e,t,n){if(F(t)){const i=o.ln(be(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function tc(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e),n],evaluate:Qu,invert:ec})}throw new Error("Could not integrate due to no input being a variable")}function nc(e,t){if(F(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function ic(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function rc(e,t){if(F(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function ac(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:ic,invert:rc})}throw new Error("Could not integrate due to no input being a variable")}function sc(e,t){if(F(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function oc(e){return o.ln(e).sub(1).times(e)}function lc(e,t){if(F(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function uc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:oc,invert:lc})}throw new Error("Could not integrate due to no input being a variable")}function cc(e,t,n){if(F(t))return t.invert(o.root(e,be(n)));if(F(n))return n.invert(o.ln(e).div(o.ln(be(t))));throw new Error("Could not invert due to no input being a variable")}function dc(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=g.add(n,1);return g.pow(i,r).div(r)}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return g.pow(t,i).div(g.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function fc(e,t){if(F(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function pc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.pow10(n).div(g.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function gc(e,t,n){if(F(t))return t.invert(o.ln(e).div(be(n)));if(F(n))return n.invert(o.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function mc(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.pow(n,i).div(g.ln(n))}else if(F(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=g.add(t,1);return g.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function vc(e,t,n){if(F(t))return t.invert(o.root(e,o.recip(be(n))));if(F(n))return n.invert(o.ln(be(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function hc(e,t,n){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return g.pow(i,g.recip(n).add(1)).times(n).div(g.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function bc(e,t){if(F(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function yc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function wc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function _c(e,t,n,i){if(F(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function Nc(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function Cc(e,t,n,i){if(F(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function kc(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function Mc(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function Sc(e,t,n){if(F(t))return t.invert(o.tetrate(e,o.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ic(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function $c(e,t,n,i){if(F(t))return t.invert(o.layeradd(e,o.minabs(1e308,be(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function xc(e,t){if(F(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Ec(e,t){if(F(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Pc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Tc(e,t){if(F(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Dc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Fc(e,t){if(F(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function Ac(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Oc(e,t){if(F(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Rc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function qc(e,t){if(F(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Vc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.asin(n).times(n).add(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Bc(e,t){if(F(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function Lc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.acos(n).times(n).sub(g.sqrt(g.sub(1,g.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function jc(e,t){if(F(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function zc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.atan(n).times(n).sub(g.ln(g.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Uc(e,t){if(F(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Gc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Wc(e,t){if(F(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Hc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Zc(e,t){if(F(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Yc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Xc(e,t){if(F(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Jc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.asinh(n).times(n).sub(g.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Kc(e,t){if(F(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Qc(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.acosh(n).times(n).sub(g.add(n,1).sqrt().times(g.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function ed(e,t){if(F(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function td(e,t){if(F(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return g.atanh(n).times(n).add(g.sub(1,g.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function In(e){return(t,n)=>new g({inputs:[t,n],evaluate:e,invert:qn})}function F(e){return e instanceof ke&&e.hasVariable()}function be(e,t){return e instanceof ke?e.evaluate(t):s(e)}function nd(){return g.pow(this,2).div(2)}function id(){return this}const Te=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&xt in n?n[xt]:n)),"variable"in e?(typeof e.variable=="object"&&xt in e.variable&&(e.variable=e.variable[xt]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:nd,internalIntegrateInner:id,applySubstitution:qn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var h,w;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((v,y)=>v+(y instanceof Te?y.internalVariables:0),0),c=t.find(v=>v instanceof Te&&v.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,m=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(w=c==null?void 0:c.isIntegrable())!=null?w:!1;return{inputs:t,internalEvaluate:n,internalInvert:m?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>be(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:be(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Te&&e.inputs[n]instanceof Te?t.equals(e.inputs[n]):!(t instanceof Te)&&!(e.inputs[n]instanceof Te)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new g({inputs:[e]})}static variable(e){return new g({variable:e})}static step(e,t,n){const i=V(0),r=n(g.variable(i)),a=ve(t);function l(c){return o.lt(c,s(a))?c:(i.value=o.sub(c,s(a)),o.add(r.evaluate(),s(a)))}function u(c,d){if(F(d)&&r.isInvertible())return o.gt(c,s(a))&&(c=o.add(r.invert(o.sub(c,s(a))),s(a))),d.invert(c);throw new Error("Could not invert due to no input being a variable")}return new g({inputs:[e],evaluate:l,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,i){const r=V(0),a=g.variable(r),l=n(a),u=i==null?void 0:i(a),c=ve(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function m(f,h){if(!F(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new g({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?m:void 0})}static conditional(e,t,n,i){return g.if(e,t,n,i)}static abs(e){return new g({inputs:[e],evaluate:o.abs})}static neg(e){return new g({inputs:[e],evaluate:o.neg,invert:Pu,applySubstitution:Du,integrate:Tu})}static sign(e){return new g({inputs:[e],evaluate:o.sign})}static round(e){return new g({inputs:[e],evaluate:o.round})}static floor(e){return new g({inputs:[e],evaluate:o.floor})}static ceil(e){return new g({inputs:[e],evaluate:o.ceil})}static trunc(e){return new g({inputs:[e],evaluate:o.trunc})}static add(e,t){return new g({inputs:[e,t],evaluate:o.add,invert:Fu,integrate:Au,integrateInner:Ou,applySubstitution:qn})}static sub(e,t){return new g({inputs:[e,t],evaluate:o.sub,invert:Ru,integrate:qu,integrateInner:Vu,applySubstitution:qn})}static mul(e,t){return new g({inputs:[e,t],evaluate:o.mul,invert:Bu,integrate:Lu,applySubstitution:ju})}static div(e,t){return new g({inputs:[e,t],evaluate:o.div,invert:zu,integrate:Uu,applySubstitution:Gu})}static recip(e){return new g({inputs:[e],evaluate:o.recip,invert:Wu,integrate:Hu})}static clamp(e,t,n){return new g({inputs:[e,t,n],evaluate:o.clamp,invert:qn})}static pLog10(e){return new g({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new g({inputs:[e],evaluate:o.absLog10})}static log10(e){return new g({inputs:[e],evaluate:o.log10,invert:Zu,integrate:Ju})}static log(e,t){return new g({inputs:[e,t],evaluate:o.log,invert:Ku,integrate:tc})}static log2(e){return new g({inputs:[e],evaluate:o.log2,invert:nc,integrate:ac})}static ln(e){return new g({inputs:[e],evaluate:o.ln,invert:sc,integrate:uc})}static pow(e,t){return new g({inputs:[e,t],evaluate:o.pow,invert:cc,integrate:dc})}static pow10(e){return new g({inputs:[e],evaluate:o.pow10,invert:fc,integrate:pc})}static pow_base(e,t){return new g({inputs:[e,t],evaluate:o.pow_base,invert:gc,integrate:mc})}static root(e,t){return new g({inputs:[e,t],evaluate:o.root,invert:vc,integrate:hc})}static factorial(e){return new g({inputs:[e],evaluate:o.factorial})}static gamma(e){return new g({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new g({inputs:[e],evaluate:o.lngamma})}static exp(e){return new g({inputs:[e],evaluate:o.exp,invert:bc,integrate:yc})}static sqr(e){return g.pow(e,2)}static sqrt(e){return g.root(e,2)}static cube(e){return g.pow(e,3)}static cbrt(e){return g.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:wc,invert:_c})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Nc,invert:Cc})}static iteratedlog(e,t=10,n=1){return new g({inputs:[e,t,n],evaluate:kc})}static slog(e,t=10){return new g({inputs:[e,t],evaluate:Mc,invert:Sc})}static layeradd10(e,t){return new g({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new g({inputs:[e,t,n],evaluate:Ic,invert:$c})}static lambertw(e){return new g({inputs:[e],evaluate:o.lambertw,invert:xc})}static ssqrt(e){return new g({inputs:[e],evaluate:o.ssqrt,invert:Ec})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Pc})}static sin(e){return new g({inputs:[e],evaluate:o.sin,invert:qc,integrate:Dc})}static cos(e){return new g({inputs:[e],evaluate:o.cos,invert:Bc,integrate:Ac})}static tan(e){return new g({inputs:[e],evaluate:o.tan,invert:jc,integrate:Rc})}static asin(e){return new g({inputs:[e],evaluate:o.asin,invert:Tc,integrate:Vc})}static acos(e){return new g({inputs:[e],evaluate:o.acos,invert:Fc,integrate:Lc})}static atan(e){return new g({inputs:[e],evaluate:o.atan,invert:Oc,integrate:zc})}static sinh(e){return new g({inputs:[e],evaluate:o.sinh,invert:Xc,integrate:Gc})}static cosh(e){return new g({inputs:[e],evaluate:o.cosh,invert:Kc,integrate:Hc})}static tanh(e){return new g({inputs:[e],evaluate:o.tanh,invert:ed,integrate:Yc})}static asinh(e){return new g({inputs:[e],evaluate:o.asinh,invert:Uc,integrate:Jc})}static acosh(e){return new g({inputs:[e],evaluate:o.acosh,invert:Wc,integrate:Qc})}static atanh(e){return new g({inputs:[e],evaluate:o.atanh,invert:Zc,integrate:td})}step(e,t){return g.step(this,e,t)}if(e,t){return g.if(this,e,t)}conditional(e,t){return g.if(this,e,t)}abs(){return g.abs(this)}neg(){return g.neg(this)}sign(){return g.sign(this)}round(){return g.round(this)}floor(){return g.floor(this)}ceil(){return g.ceil(this)}trunc(){return g.trunc(this)}add(e){return g.add(this,e)}sub(e){return g.sub(this,e)}mul(e){return g.mul(this,e)}div(e){return g.div(this,e)}recip(){return g.recip(this)}max(e){return g.max(this,e)}min(e){return g.min(this,e)}maxabs(e){return g.maxabs(this,e)}minabs(e){return g.minabs(this,e)}clamp(e,t){return g.clamp(this,e,t)}clampMin(e){return g.clampMin(this,e)}clampMax(e){return g.clampMax(this,e)}pLog10(){return g.pLog10(this)}absLog10(){return g.absLog10(this)}log10(){return g.log10(this)}log(e){return g.log(this,e)}log2(){return g.log2(this)}ln(){return g.ln(this)}pow(e){return g.pow(this,e)}pow10(){return g.pow10(this)}pow_base(e){return g.pow_base(this,e)}root(e){return g.root(this,e)}factorial(){return g.factorial(this)}gamma(){return g.gamma(this)}lngamma(){return g.lngamma(this)}exp(){return g.exp(this)}sqr(){return g.pow(this,2)}sqrt(){return g.root(this,2)}cube(){return g.pow(this,3)}cbrt(){return g.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return g.iteratedlog(this,e,t)}slog(e=10){return g.slog(this,e)}layeradd10(e){return g.layeradd10(this,e)}layeradd(e,t){return g.layeradd(this,e,t)}lambertw(){return g.lambertw(this)}ssqrt(){return g.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return g.pentate(this,e,t)}sin(){return g.sin(this)}cos(){return g.cos(this)}tan(){return g.tan(this)}asin(){return g.asin(this)}acos(){return g.acos(this)}atan(){return g.atan(this)}sinh(){return g.sinh(this)}cosh(){return g.cosh(this)}tanh(){return g.tanh(this)}asinh(){return g.asinh(this)}acosh(){return g.acosh(this)}atanh(){return g.atanh(this)}};let ke=Te;ke.negate=Te.neg;ke.negated=Te.neg;ke.sgn=Te.sign;ke.plus=Te.add;ke.subtract=Te.sub;ke.minus=Te.sub;ke.multiply=Te.mul;ke.times=Te.mul;ke.divide=Te.div;ke.divideBy=Te.div;ke.dividedBy=Te.div;ke.reciprocal=Te.recip;ke.reciprocate=Te.recip;ke.max=In(o.max);ke.min=In(o.min);ke.minabs=In(o.minabs);ke.maxabs=In(o.maxabs);ke.clampMin=In(o.clampMin);ke.clampMax=In(o.clampMax);ke.logarithm=Te.log;class g extends ke{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Br(e,t,n=!0,i,r=o.dInf){const a=ve(n),l=ve(i),u=ve(r);return N(()=>{var h,w,v,y;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),m=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,m)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((w=s(e.innermostVariable))!=null?w:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),m>0){f=o.sub(f,m).clampMin(0);let I;for(d?I=Vt(e,f,!0,0):I=e.evaluate(o.add((v=s(e.innermostVariable))!=null?v:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER);){const A=e.evaluate(f.add((y=s(e.innermostVariable))!=null?y:0));if(o.add(I,A).lte(t.value))f=f.add(1),I=o.add(I,A);else break}}return f})}function Vt(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)))}else if(u=e.evaluate(a),a=a.add(1),l.gt(1e308))return o.sub(l,a).add(1).times(u)}for(let d=a.toNumber();d{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>g.add(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[_t(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",Ht(s(l))])]))}})}function Ae(e){return He(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>g.times(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[_t(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[x("\xD7"),Ht(s(l))])]))}})}function Si(e){return He(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=ve(n),c=ve(i),d=r==null?void 0:ve(r);return{apply:m=>{let f=m;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:m=>{let f=m;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:m=>a?g.add(m,1).pow(u).sub(1):g.pow(m,u),enabled:d,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[_t(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[x("^"),Ht(s(u))])]))}})}function $t(e){return He(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?N(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?J(()=>p(ne,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(_t)])):void 0}})}const Bn=g.variable(0).add(1),di={id:"deselect",icon:"close",tooltip:e=>({text:"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},pn={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${Mt(M.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},M.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function fi(e,t=1/0){const n=e(g.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${Mt(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(M.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(M.energy.value,r)&&(M.energy.value=o.sub(M.energy.value,r)),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},M.board.selectedAction.value=null},visibility:i=>o.add(i.state.maxConnections,M.computedBonusConnectionsModifier.value).lt(t)}}function Lr(e,t){var n,i;if(((n=M.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=M.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,M.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function rd(e,t){var n,i;if(((n=M.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=M.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,M.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function ad(e,t){var n,i;if(((n=M.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=M.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,M.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function jr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,M.computedBonusConnectionsModifier.value).lte(r.length)}function zr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},M.board.selectedNode.value=e}function sd(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,M.computedBonusConnectionsModifier.value).lte(r.length)}function od(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},M.board.selectedNode.value=e}function ld(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,M.computedBonusConnectionsModifier.value).lte(r.length)}function ud(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},M.board.selectedNode.value=e}function Oe(e){return e===M.board.selectedNode.value||e.state.powered}function ct(e){return M.empowerer.value!=null&&Oe(M.empowerer.value)&&M.empowerer.value.state.tools.includes(e)}function cd(e){var a,l,u;const t=(u=(l=(a=M.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=M.resourceLevels.value[e],i=Vt(Bn,n,!0),r=Vt(Bn,o.add(n,1),!0);return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function Jn(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.lt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const dd={key:0},fd={key:0,class:"mark star"},pd=["src"],gd=Y({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(k(),P("div",dd,[e.mark===!0?(k(),P("div",fd)):(k(),P("img",{key:1,class:"mark",src:e.mark},null,8,pd))])):B("",!0)}});var Gn=fe(gd,[["__scopeId","data-v-2207999f"]]);const md=Y({__name:"Node",props:{id:null},setup(e){const n=Ie(e),i=ti(qi,()=>{}),r=ti(Vi,()=>{}),a=gt(null),l=N(()=>a.value&&a.value.parentElement);return pt([l,n.id],([u,c],[d,m])=>{d&&r(s(m)),u&&i(c,u)}),mr(()=>r(s(n.id))),(u,c)=>(k(),P("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Wn=fe(md,[["__scopeId","data-v-a48cb382"]]),vd=Y({props:{display:{type:O(Object,String,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),onClick:Function,onHold:Function,canClick:{type:O(Boolean),required:!0},small:Boolean,mark:O(Boolean,String),id:{type:String,required:!0}},components:{Node:Wn,MarkNode:Gn},setup(e){const{display:t,onClick:n,onHold:i}=Ie(e),r=gt("");wt(()=>{var m;const u=Ce(t);if(u==null){r.value="";return}if(St(u)){r.value=ue(u);return}const c=ue((m=u.title)!=null?m:"","h3"),d=ue(u.description,"div");r.value=ue(J(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=Ir(n,i);return{start:a,stop:l,comp:r,Visibility:he,isVisible:Le,isHidden:dn,unref:s}}});function hd(e,t,n,i,r,a){var c;const l=Nt("MarkNode"),u=Nt("Node");return e.isVisible(e.visibility)?(k(),P("button",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:me({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)?(k(),ee(Ge(e.unref(e.comp)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):B("",!0)}var Ur=fe(vd,[["render",hd],["__scopeId","data-v-211328c0"]]);const bd=Symbol("Clickable");function yd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return He(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=Jt("clickable-"),r.type=bd,r[mt]=Ur;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"canClick"),ie(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(m){s(r.canClick)!==!1&&d(m)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,m)=>{var f;return Object.assign(d,(f=m.getGatheredProps)==null?void 0:f.call(m,r))},{});return r[st]=function(){const{display:d,visibility:m,style:f,classes:h,onClick:w,onHold:v,canClick:y,small:I,mark:A,id:S}=this;return{display:d,visibility:m,style:s(f),classes:h,onClick:w,onHold:v,canClick:y,small:I,mark:A,id:S,...a}},r})}const wd=["x1","y1","x2","y2"],_d=Y({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Ie(e),i=N(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=N(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(k(),P("line",Lt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,wd))}});const Nd=Y({__name:"Links",props:{links:null},setup(e){var c;const n=Yt(e,"links"),i=V(null),r=ti(Bi,V({})),a=ti(Li,V(void 0)),l=V((c=i.value)==null?void 0:c.getBoundingClientRect());pt(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),li(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=N(()=>{var m,f;const d=r.value;return(f=(m=n.value)==null?void 0:m.filter(h=>{var w,v;return((w=d[h.startNode.id])==null?void 0:w.rect)&&((v=d[h.startNode.id])==null?void 0:v.rect)}))!=null?f:[]});return(d,m)=>(k(),P(ne,null,[s(u)?(k(),P("svg",pa(Lt({key:0},d.$attrs)),[(k(!0),P(ne,null,kn(s(u),(f,h)=>(k(),ee(_d,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),_("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Cd=fe(Nd,[["__scopeId","data-v-063f6d6b"]]);Y({props:{nodes:{type:O(Array),required:!0},leftSideNodes:O(Array),rightSideNodes:O(Array),branches:O(Array)},components:{Links:Cd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Ie(e),r=gt();wt(()=>{const u=Ce(t);r.value=ue(J(()=>p(ne,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(_t)]))])))});const a=gt();wt(()=>{const u=Ce(n);a.value=u?ue(J(()=>p("span",{class:"left-side-nodes small"},[u.map(_t)]))):""});const l=gt();return wt(()=>{const u=Ce(i);l.value=u?ue(J(()=>p("span",{class:"side-nodes small"},[u.map(_t)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});Y({props:{display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),onClick:Function,onHold:Function,color:O(String),glowColor:O(String),canClick:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Gn,Node:Wn},setup(e){const{onClick:t,onHold:n,display:i}=Ie(e),r=Sn(i),{start:a,stop:l}=Ir(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:he,isCoercableComponent:St,isVisible:Le,isHidden:dn}}});function Vn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>ve(u.base)),n.baseText=t.map(u=>ve(u.baseText)),n.visible=t.map(u=>ve(u.visible)),n.title=t.map(u=>ve(u.title)),n.subtitle=t.map(u=>ve(u.subtitle)),i=!0),t}const a=ft({},!1);return[J(()=>{const u=r();let c=!0;const d=u.map((m,f)=>{var A,S,E;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[x("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[x(" ("),s(n.subtitle[f]),x(")")]):null]),w=s(a.value[f])?null:p(ne,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[_t((A=s(n.baseText[f]))!=null?A:"Base")]),p("span",{class:"modifier-amount"},[Mn((S=s(n.base[f]))!=null?S:1),m.unit])]),m.modifier.description==null?null:_t(s(m.modifier.description))]),v=!c;c=!1;const y=(E=s(n.base[f]))!=null?E:1,I=m.modifier.apply(y);return p(ne,null,[v?p("br",null,null):null,p("div",{style:{"--unit":re.alignUnits&&m.unit!=null?"'"+m.unit+"'":""}},[h,p("br",null,null),w,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[x("Total")]),p("span",{class:"modifier-amount",style:(m.smallerIsBetter===!0?o.gt(I,y!=null?y:1):o.lt(I,y!=null?y:1))?"color: var(--danger)":""},[Ht(I),m.unit])])])])});return p(ne,null,[d])}),a]}function Ii(e,t,n){const i=ve(t),r=ve(n);return N(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":ci(o.sub(l,e.value).div(a))})}function tn(e,t,n=1){const i=ve(t),r=ve(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return J(()=>{var a;if(s(i)){const l=Ht(e.evaluate()),u=Ht(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(ne,null,[p("b",null,[p("i",null,[l,x(" \u2192 "),u])])])}return p(ne,null,[Ht(e.evaluate())])})}const kt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},en=Object.keys(kt),Ee={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Fi={dirt:"Replicator",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"BOGO Coupon",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},kd={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 20% stronger":"Material level is 10% stronger"},silver:{description:e=>e?"Doubles each plane's resource gain":"Quadruples each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"Upgrades apply thrice":"Upgrades apply twice"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase":"+1% plane's resource gain per repeatable purchase"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},coalRelic:{description:e=>e?"(Treasures)^2 boost planar speed":"Treasures boost planar speed"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give triple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Power machines)^2 boost ore dropped":"Power machines boost ore dropped"},goldRelic:{description:e=>e?"Each treasure quadruples XP gain":"Each treasure doubles XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs a third the energy":"Creating portals costs half the energy"},platinumRelic:{description:e=>e?"Triple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"ln(energy) boosts planar speed":"log(energy) boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Rt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},$i=g.variable(0).add(8).times(2).pow10();const Md=Y({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(k(),P("div",{style:Re({width:e.width,height:e.height})},null,4))}});function Fn(e){return He(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[oi(n.resource,n.cost instanceof g?Vt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",oi(n.resource,n.cost instanceof g?Vt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),ie(n,"visibility",he.Visible),$(n,"cost"),$(n,"requiresPay"),ie(n,"requiresPay",!0),$(n,"cumulativeCost"),ie(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),ie(n,"maxBulkAmount",1),$(n,"directSum"),ie(n,"pay",function(r){const a=n.cost instanceof g?Vt(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=N(()=>{var u;if(!(n.cost instanceof g))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),l=(u=s(n.directSum))!=null?u:a?10:0;return o.lte(r,l)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof g?n.requirementMet=Br(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=N(()=>o.gte(n.resource.value,s(n.cost))),n})}function Wi(e){return He(()=>({requirementMet:N(()=>Le(e.visibility)),visibility:he.None,requiresPay:!1}))}function Sd(e,t){return He(()=>({requirementMet:ve(e),partialDisplay:t==null?void 0:J(()=>_t(t)),display:t==null?void 0:J(()=>p(ne,null,[x("Req: "),_t(t)])),visibility:t==null?he.None:he.Visible,requiresPay:!1}))}function pi(e){if(Pt(e))return e.every(pi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function Gr(e){if(Pt(e))return e.map(Gr).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function gi(e,t=1){var n,i;if(Pt(e)&&(e=e.filter(r=>Le(r.visibility)),e.length===1&&(e=e[0])),Pt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(ne,null,[r.length>0?p("div",null,[x("Costs:")," ",sr(r.map(l=>l.partialDisplay(t)),p(ne,null,[x(", ")]))]):null,a.length>0?p("div",null,[x("Requires:")," ",sr(a.map(l=>l.partialDisplay(t)),p(ne,null,[x(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(ne,null,null)}function Wr(e,t=1){var n;Pt(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var Id=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:O(Object,String,Function),earned:{type:O(Boolean),required:!0},requirements:O(Object,Array),image:O(String),style:O(String,Object,Array),classes:O(Object),mark:O(Boolean,String),small:O(Boolean),id:{type:String,required:!0}},components:{Node:Wn,MarkNode:Gn},setup(e){const{display:t,requirements:n,earned:i}=Ie(e),r=gt("");return wt(()=>{const a=Ce(t);if(a==null){r.value="";return}if(St(a)){r.value=ue(a);return}const l=ue(a.requirement?a.requirement:J(()=>{var d;return gi((d=Ce(n))!=null?d:[])}),"h3"),u=ue(a.effectDisplay||"","b"),c=Ce(i)?ue(a.optionsDisplay||"","span"):"";r.value=ue(J(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:he,isVisible:Le,isHidden:dn}}});function $d(e,t,n,i,r,a){var c;const l=Nt("MarkNode"),u=Nt("Node");return e.isVisible(e.visibility)?(k(),P("div",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:me({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(k(),ee(Ge(e.comp),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var xd=fe(Id,[["render",$d],["__scopeId","data-v-5673325a"]]);const Ed=ui(),Pd=Symbol("Achievement");let wn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Td(e,...t){const n=ft(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var c,d,m;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=Jt("achievement-"),a.type=Pd,a[mt]=xd;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,w;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const v=s(f.display);let y;St(v)?y=ue(v):v.requirement!=null?y=ue(v.requirement):y=gi((w=f.requirements)!=null?w:[]),Ed.info(p("div",null,[p("h3",null,[x("Achievement earned!")]),p("div",null,[p(y,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),ie(a,"visibility",he.Visible);const l=a.visibility;a.visibility=ga(()=>{const f=s(a.display);switch(re.msDisplay){default:case wn.All:return s(l);case wn.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?he.None:s(l);case wn.Incomplete:return s(a.earned)?he.None:s(l);case wn.None:return he.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),ie(a,"showPopups",!0);for(const f of t)(m=f.postConstruct)==null||m.call(f,a);const u=t.reduce((f,h)=>{var w;return Object.assign(f,(w=h.getGatheredProps)==null?void 0:w.call(h,a))},{});if(a[st]=function(){const{visibility:f,display:h,requirements:w,earned:v,image:y,style:I,classes:A,mark:S,small:E,id:j}=this;return{visibility:f,display:h,requirements:w,earned:v,image:y,style:s(I),classes:A,mark:S,small:E,id:j,...u}},a.requirements){const f=a,h=[Wi(f),Sd(()=>!f.earned.value),...Pt(a.requirements)?a.requirements:[a.requirements]];wt(()=>{re.active===Q.id&&pi(h)&&f.complete()})}return a})}We.on("loadSettings",e=>{ie(e,"msDisplay",wn.All)});const Dd=Object.values(wn).map(e=>({label:Qe(e),value:e}));ks(J(()=>p(Ui,{title:J(()=>p("span",{class:"option-title"},[x("Show achievements"),p("desc",null,[x("Select which achievements to display based on criterias.")])])),options:Dd,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));const Fd=Y({props:{progress:{type:O(String,Object,Number),required:!0},width:{type:O(Number),required:!0},height:{type:O(Number),required:!0},direction:{type:O(String),required:!0},display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),borderStyle:O(Object,String,Array),textStyle:O(Object,String,Array),baseStyle:O(Object,String,Array),fillStyle:O(Object,String,Array),mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Gn,Node:Wn},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=Ie(e),l=N(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=N(()=>{const d={width:Ce(n)+.5+"px",height:Ce(i)+.5+"px"};switch(s(r)){case G.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=Ce(n)+1+"px";break;case G.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=Ce(n)+1+"px";break;case G.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case G.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case G.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=Sn(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:he,isVisible:Le,isHidden:dn}}});function Ad(e,t,n,i,r,a){var c,d,m,f,h,w,v;const l=Nt("MarkNode"),u=Nt("Node");return e.isVisible(e.visibility)?(k(),P("div",{key:0,style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:me({bar:!0,...e.unref(e.classes)})},[_("div",{class:"overlayTextContainer border",style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(k(),P("span",{key:0,class:"overlayText",style:Re(e.unref(e.textStyle))},[(k(),ee(Ge(e.component)))],4)):B("",!0)],4),_("div",{class:"border",style:Re([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(m=e.unref(e.style))!=null?m:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[_("div",{class:"fill",style:Re([e.barStyle,(w=e.unref(e.style))!=null?w:{},(v=e.unref(e.fillStyle))!=null?v:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var Od=fe(Fd,[["render",Ad],["__scopeId","data-v-6bd06b56"]]);const Rd=Symbol("Bar");function qd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return He(i=>{var l,u;const r=e.call(i,i);r.id=Jt("bar-"),r.type=Rd,r[mt]=Od;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),ie(r,"visibility",he.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var m;return Object.assign(c,(m=d.getGatheredProps)==null?void 0:m.call(d,r))},{});return r[st]=function(){const{progress:c,width:d,height:m,direction:f,display:h,visibility:w,style:v,classes:y,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:E,mark:j,id:se}=this;return{progress:c,width:d,height:m,direction:f,display:h,visibility:w,style:s(v),classes:y,borderStyle:I,textStyle:A,baseStyle:S,fillStyle:E,mark:j,id:se,...a}},r})}function Vd(e,...t){return He(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(g.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=N(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=N(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=N(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),ie(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function Bd(e){return Vd(e)}const Hr=Symbol("Repeatable");function ur(e,...t){const n=ft(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var h,w,v;const a=e.call(r,r);a.id=Jt("repeatable-"),a.type=Hr,a[mt]=Ur;for(const y of t)(h=y.preConstruct)==null||h.call(y,a);a.amount=n,a.amount[Xt]=(w=a.initialAmount)!=null?w:0,Object.assign(a,i);const l={requirementMet:N(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:he.None},u=Wi(a);Pt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=N(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=N(()=>{const y=s(c)||{};return a.maxed.value&&(y.bought=!0),y}),a.amountToIncrease=N(()=>o.clampMin(Gr(a.requirements),1)),a.canClick=N(()=>pi(a.requirements));const d=a.onClick;a.onClick=function(y){const I=a;!s(I.canClick)||(Wr(a.requirements,s(a.amountToIncrease)),I.amount.value=o.add(I.amount.value,1),d==null||d(y))},$(a,"display");const m=a.display;a.display=J(()=>{var I,A,S;const y=s(m);if(St(y)){const E=ue(y);return p(E,null,null)}if(y!=null){const E=a,j=ue((I=y.title)!=null?I:"","h3"),se=ue((A=y.description)!=null?A:""),K=ue((S=y.effectDisplay)!=null?S:"");return p("span",null,[y.title==null?null:p("div",null,[p(j,null,null)]),y.description==null?null:p(se,null,null),y.showAmount===!1?null:p("div",null,[p("br",null,null),p(ne,null,[x("Amount: "),Mt(E.amount.value)]),o.isFinite(s(E.limit))?p(ne,null,[x(" / "),Mt(s(E.limit))]):void 0]),y.effectDisplay==null?null:p("div",null,[p("br",null,null),x("Currently: "),p(K,null,null)]),E.maxed.value?null:p("div",null,[p("br",null,null),gi(E.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),ie(a,"visibility",he.Visible),$(a,"limit"),ie(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const y of t)(v=y.postConstruct)==null||v.call(y,a);const f=t.reduce((y,I)=>{var A;return Object.assign(y,(A=I.getGatheredProps)==null?void 0:A.call(I,a))},{});return a[st]=function(){const{display:y,visibility:I,style:A,classes:S,onClick:E,canClick:j,small:se,mark:K,id:z}=this;return{display:y,visibility:I,style:s(A),classes:S,onClick:E,canClick:j,small:se,mark:K,id:z,...f}},a})}const Ld=Symbol("Reset");function jd(e){return He(t=>{const n=e.call(t,t);return n.id=Jt("reset-"),n.type=Ld,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object")if(Xt in a){const l=a;l.value=l[Xt]}else!(a instanceof o)&&!Pe(a)&&Object.values(a).forEach(l=>i(l))};s(n.thingsToReset).forEach(i),We.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const Kn={};We.on("removeLayer",e=>{var t;(t=Kn[e.id])==null||t.call(Kn),Kn[e.id]=void 0});function xi(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),ie(t,"direction",G.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=ft(!1,!1)),Bt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Er(t.pinned)):e.pinned=t.pinned);const n=e[mt];e[mt]=xe;const i=e[st].bind(e);e[st]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:m,pinned:f}=this;return{element:{[mt]:n,[st]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:m,pinned:f}}.bind(t)}),t}var zd=Y({props:{display:{type:O(String,Object,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),requirements:{type:Object,required:!0},canPurchase:{type:O(Boolean),required:!0},bought:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Wn,MarkNode:Gn},setup(e){const{display:t,requirements:n,bought:i}=Ie(e),r=gt("");return wt(()=>{const a=Ce(t);if(a==null){r.value="";return}if(St(a)){r.value=ue(a);return}const l=ue(a.title||"","h3"),u=ue(a.description,"div"),c=ue(a.effectDisplay||"");r.value=ue(J(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[x("Currently: "),p(c,null,null)]):null,i.value?null:p(ne,null,[p("br",null,null),gi(n.value)])])))}),{component:r,unref:s,Visibility:he,isVisible:Le,isHidden:dn}}});const Ud=["disabled"];function Gd(e,t,n,i,r,a){var c;const l=Nt("MarkNode"),u=Nt("Node");return e.isVisible(e.visibility)?(k(),P("button",{key:0,style:Re([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:me({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)?(k(),ee(Ge(e.unref(e.component)),{key:0})):B("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Ud)):B("",!0)}var Wd=fe(zd,[["render",Gd],["__scopeId","data-v-9be6bac0"]]);const Zr=Symbol("Upgrade");function cr(e,...t){const n=ft(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return He(r=>{var c,d;const a=e.call(r,r);a.id=Jt("upgrade-"),a.type=Zr,a[mt]=Wd;for(const m of t)(c=m.preConstruct)==null||c.call(m,a);a.bought=n,Object.assign(a,i),a.canPurchase=N(()=>!n.value&&pi(a.requirements)),a.purchase=function(){var f;const m=a;!s(m.canPurchase)||(Wr(a.requirements),n.value=!0,(f=m.onPurchase)==null||f.call(m))};const l=Wi(a);Pt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),ie(a,"visibility",he.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const m of t)(d=m.postConstruct)==null||d.call(m,a);const u=t.reduce((m,f)=>{var h;return Object.assign(m,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[st]=function(){const{display:m,visibility:f,style:h,classes:w,requirements:v,canPurchase:y,bought:I,mark:A,id:S,purchase:E}=this;return{display:m,visibility:f,style:s(h),classes:w,requirements:v,canPurchase:y,bought:I,mark:A,id:S,purchase:E,...u}},a})}function Hd(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const Zd={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},dr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Ei(e){const t=dr[Math.floor(e()*dr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const pr=ui();function Yr(e,t,n,i){return ji(e,function(){const r=Hd(0,n>>0,n>>32,1);for(let R=0;R<12;R++)r();const a=Ei(r),l=An([.64,.75,.55],r),u=An([.18,.2,.25],r),c=yn(0,Ei(r)),d=ft(0),m=en.indexOf(t);let f=r();const h=i.reduce((R,L)=>(R[L.type]=L.data,R),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const w=f+m+1,v="increaseRewards"in h?w+1:w;let y="relic"in h?m+2:Math.ceil(r()*(m+2));"increaseLength"in h&&y++;const I=[],A=$t(()=>[...I,Ae(()=>({multiplier:()=>M.isEmpowered("silver")?4:2,description:()=>(M.isEmpowered("silver")?"Empowered ":"")+Ee.silver.name,enabled:()=>M.toolNodes.value.silver!=null})),Ae(()=>({multiplier:()=>(M.isEmpowered("diamond")?2:1)*nt.filter(R=>R.bought.value).length/10,description:()=>(M.isEmpowered("diamond")?"Empowered ":"")+Ee.diamond.name,enabled:()=>M.toolNodes.value.diamond!=null})),Ae(()=>({multiplier:()=>o.div(d.value,6e3).times(M.isEmpowered("emerald")?2:1),description:()=>(M.isEmpowered("emerald")?"Empowered ":"")+Ee.emerald.name,enabled:()=>M.toolNodes.value.emerald!=null}))]),S=N(()=>A.apply(0)),E=[],j={};function se({feature:R,canClick:L,modifier:De,cost:It,previewModifier:gn,showETA:Je,previewCost:T}){L=ve(L),Je=ve(Je);const D=or(R);E.push({shouldShowPreview:N(()=>s(L)&&D.value),modifier:$t(()=>{const oe=I.slice();return oe.splice(oe.indexOf(De),1,gn),oe}),cost:T!=null?T:It}),I.push(De);const q=Ii(c,S,()=>be(It)),U=xi(R,{display:Je==null?q:()=>s(Je)?q.value:"",direction:G.Down});return{isHovering:D,eta:q,tooltip:U}}const K=[],z=V(0);let W=g.variable(z).times(0);const qe={};let tt=!0;const X=N(()=>o.add(w,r()-.5).pow_base(2).times(10).times(W.evaluate())),we=[];for(let R=0;R=y-1?0:1};switch(Qn(L,r)){case"upgrades":const Tn=[];for(let Me=0;Me<4;Me++){const ut=Qn({add:1,mult:R===0&&Me===0?0:1,pow:R===0?0:.5},r),Ye=X.value,Ke=bn(r);let rt="",$e,ye;const Se=z.value;switch(ut){case"add":{const de=o.add(Ye,10).pow(r()/4+.875);rt=`Gain ${le(de)} ${c.displayName}/s`,W=W.add(de),$e=an(()=>({addend:de,description:Ke,enabled:Ve.bought})),ye=an(()=>({addend:de}));break}case"mult":{const de=r()*5+1;rt=`Multiply previous ${c.displayName} gain by x${le(de)}.`,W=W.add(o.sub(de,1).times(qe[Se-1])),$e=Ae(()=>({multiplier:de,description:Ke,enabled:Ve.bought})),ye=Ae(()=>({multiplier:de}));break}case"pow":{const de=r()/10+1.05;rt=`Raise previous ${c.displayName} gain to the ^${le(de)}`,W=W.add(o.pow(qe[Se-1],de)).sub(qe[Se-1]),$e=Si(()=>({exponent:de,description:Ke,enabled:Ve.bought})),ye=Si(()=>({exponent:de}))}}qe[z.value]=W.evaluate(),z.value++;const je=tt,Ve=cr(()=>({requirements:Fn(()=>({resource:hn(c),cost:Ye})),display:{title:Ke,description:rt},visibility:je}));se({feature:Ve,canClick:()=>Ve.canPurchase.value,modifier:$e,cost:Ye,showETA:()=>!Ve.bought.value,previewModifier:ye}),Tn.push(Ve)}K.push(Tn);break;case"repeatables":const Dt=[];for(let Me=0;Me<3;Me++){const ut=Qn({add:1.5,mult:3},r),Ye=z.value,Ke=X.value,rt=bn(r);let $e="",ye,Se,je,Ve;const de=g.variable(N(()=>Ue.amount.value)).times(2);switch(ut){case"add":{const _e=o.add(Ke,10).times(r()+.5);$e=`Gain ${le(_e)} ${c.displayName}/s`,Ve=de.add(1).times(Ke),W=W.add(N(()=>o.sub(z.value,Ye).add(1).times(5).times(_e))),ye=N(()=>le(o.times(_e,Ue.amount.value))+"/s"),Se=an(()=>({addend:()=>o.times(_e,Ue.amount.value),description:rt,enabled:()=>o.gt(Ue.amount.value,0)})),je=an(()=>({addend:()=>o.add(Ue.amount.value,1).times(_e)}));break}case"mult":{const _e=r()*.75+1.25;$e=`Multiply previous ${c.displayName} gain by x${le(_e)}.`,Ve=de.pow_base(_e).times(Ke),W=W.add(N(()=>o.sub(z.value,Ye).add(1).times(5).pow_base(_e).sub(1).times(qe[Ye-1]))),ye=N(()=>"x"+le(o.pow(_e,Ue.amount.value))),Se=Ae(()=>({multiplier:()=>o.pow(_e,Ue.amount.value),description:rt,enabled:()=>o.gt(Ue.amount.value,0)})),je=Ae(()=>({multiplier:()=>o.add(Ue.amount.value,1).pow_base(_e)}));break}}qe[z.value]=W.evaluate(),z.value++;const Ot=tt,Ue=ur(()=>({requirements:Fn(()=>({resource:hn(c),cost:Ve})),display:()=>({title:rt,description:$e,effectDisplay:s(ye)}),visibility:Ot}));se({feature:Ue,canClick:()=>s(Ue.canClick),modifier:Se,cost:Ve,previewModifier:je}),Dt.push(Ue)}K.push(Dt);break;case"conversion":const Fe=yn(0,Ei(r)),Ft=An([.64,.75,.55],r),Dn=X.value,Xr=r()/2+.25,Zi=r()/2+.25,Yi=z.value;W=W.add(N(()=>o.sub(z.value,Yi).add(1).pow_base(5).pow(Zi).times(qe[Yi-1])));const At=Bd(()=>({baseResource:hn(c),gainResource:Fe,formula:Me=>Me.div(Dn).pow(Xr),spend(){c.value=0}}));qe[z.value]=W.evaluate(),z.value+=2;const Jr=tt,Xi=bn(r),_i=g.variable(Fe).pow(Zi).add(1),Kr=Ae(()=>({multiplier:()=>_i.evaluate(),description:Xi,enabled:()=>o.gt(Fe.value,0)})),Qr=Ae(()=>({multiplier:()=>_i.evaluate(o.add(Fe.value,At.actualGain.value))})),vn=yd(()=>({display:{title:Xi,description:J(()=>p("span",null,[x("Reset "),c.displayName,x(" for")," ",oi(Fe,o.clampMin(At.actualGain.value,1))," ",Fe.displayName,p("br",null,null),p("div",null,[x("Next:")," ",oi(c,o.lt(At.actualGain.value,1)?At.currentAt.value:At.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(At.actualGain.value,1),prestigeResource:Fe,onClick:At.convert,visibility:Jr})),{isHovering:ea}=se({feature:vn,canClick:()=>s(vn.canClick),modifier:Kr,cost:Dn,previewCost:c,previewModifier:Qr}),Ji=N(()=>ea.value&&vn.canClick.value);K.push([vn]);const ta=tn(g.variable(Fe),Ji,At.actualGain),na=tn(_i,Ji,At.actualGain);j[R*2]=J(()=>p(ne,null,[Le(vn.visibility)?p("div",{style:"margin: 10px"},[x("You have")," ",p("h2",{style:{color:Ft,textShadow:`0px 0px 10px ${Ft}`}},[ta()])," ",Fe.displayName,x(","),p("br",null,null),x("providing a "),na(),x("x multiplier to previous")," ",c.displayName,x(" gain")]):null,Mi(vn)]));break;case"xp":{const Me=yn(0),it=tt,ut=z.value,Ye=bn(r),Ke=o.add(w,r()-.5).pow_base(2).times(10),rt=r()/4+1.125,$e=r()/2+1.25,ye=g.variable(0).pow(rt).times(Ke),Se=Br(ye,Me,!0,10,o.dInf),je=N(()=>Vt(ye,Se.value,!0,10)),Ve=N(()=>Vt(ye,o.add(Se.value,1),!0,10)),de=N(()=>o.pow($e,Se.value)),Ot=Ae(()=>({multiplier:de,description:Ye,enabled:()=>Le(_e.visibility)}));W=W.add(N(()=>o.sub(z.value,ut).add(1).sqrt().times(3).pow($e).times(qe[ut-1]))),qe[z.value]=W.evaluate(),z.value+=2;const Ue=An([.18,.2,.25],r),_e=qd(()=>({direction:G.Right,width:300,height:20,progress:()=>o.sub(Me.value,je.value).div(o.sub(Ve.value,je.value)).toNumber(),visibility:it,xp:Me,display:J(()=>p("span",null,[le(Me.value),x("/"),le(Ve.value)])),fillStyle:`background-color: ${Ue}`}));this.on("preUpdate",Ni=>{if(M.activePortals.value.some(bt=>bt.state.id===e)&&Le(_e.visibility)){const bt=o.times(ht.value,Ni);Me.value=o.add(bt,Me.value)}}),I.push(Ot),K.push([_e]),j[R*2]=J(()=>p(ne,null,[Le(_e.visibility)?p("div",{style:"margin: 10px"},[x("You have "),p("h3",null,[Ye]),x(" Lv. "),ze(Se.value),x(","),p("br",null,null),x("providing a "),le(de.value),x("x multiplier to previous")," ",c.displayName,x(" gain"),p("br",null,null)]):null,Mi(_e)]));break}case"dimensions":{const Me=bn(r),it=yn(0,Me+" energy"),ut=An([.64,.75,.55],r),Ye=z.value;W=W.add(N(()=>o.sub(z.value,Ye).add(1).pow_base(32).add(1).log2().add(1).times(qe[Ye-1])));const Ke=N(()=>o.add(it.value,1).log2().add(1)),rt=Ae(()=>({multiplier:Ke,description:Me,enabled:()=>o.gt(it.value,0)}));I.push(rt);const $e=tt,ye=[];for(let Se=0;Se<4;Se++){const je=o.add(w,r()-.5).pow_base(2).times(10).recip(),Ve=X.value,de=g.variable(N(()=>bt.amount.value)),Ot=de.pow_base(o.pow10(Se+1)).times(Ve),Ue=["First","Second","Third","Fourth"][Se]+" "+Me+" Dimension",_e=yn(0,Ue),Ni=de.sub(1).pow_base(2).times(je).times(N(()=>o.add(bt.amount.value,_e.value))),bt=ur(()=>({display:{title:Ue,description:J(()=>p("div",null,[p("div",null,[x("Amount:")," ",le(o.add(_e.value,bt.amount.value))," ",x("["),ze(bt.amount.value),x("]")])])),effectDisplay:J(()=>p("span",null,[aa()," ",Se===0?it.displayName:ye[ye.length-1].display.title,x("/s")])),showAmount:!1},style:{width:"400px"},effect:Ni,dimensions:_e,energy:Se===0?it:void 0,requirements:Fn(()=>({resource:hn(c),cost:Ot})),visibility:$e}));ye.push(bt);const ia=or(bt),Ki=N(()=>s(bt.canClick)&&ia.value),ra=new g({inputs:[de],evaluate(Qi){return o.sub(Qi,1).pow_base(2).times(je).times(o.add(Qi,_e.value))}}),aa=tn(ra,Ki);E.push({shouldShowPreview:Ki,cost:Ot});const sa=Ii(c,S,()=>be(Ot));xi(bt,{display:sa,direction:G.Down}),qe[z.value]=W.evaluate(),z.value++}this.on("preUpdate",Se=>{if(M.activePortals.value.some(je=>je.state.id===e)&&Le($e)){const je=o.times(ht.value,Se),Ve=ye[0].effect.evaluate();it.value=o.times(Ve,je).add(it.value);for(let de=1;de<4;de++){const Ot=ye[de].effect.evaluate();ye[de-1].dimensions.value=o.times(Ot,je).add(ye[de-1].dimensions.value)}}}),K.push(ye),j[R*2]=J(()=>p(ne,null,[Le($e)?p("div",{style:"margin: 10px"},[x("You have")," ",p("h2",{style:{color:ut,textShadow:`0px 0px 10px ${ut}`}},[le(it.value)])," ",it.displayName,x(","),p("br",null,null),x("providing a "),le(Ke.value),x("x multiplier to previous")," ",c.displayName,x(" gain")]):null,Ps(...ye)]));break}case"prestige":{const Me=bn(r),it=tt,ut=r()/2+1.25,Ye=X.value;W=W.pow(ut);const Ke=Si(()=>({exponent:ut,description:Me,enabled:$e.bought}));qe[z.value]=W.evaluate(),z.value++;const rt=jd(()=>({thingsToReset:K.filter((Se,je)=>je%2===0),onReset(){c.value=0}})),$e=cr(()=>({display:{title:Me,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${le(ut)}`},style:{width:"200px",minHeight:"100px"},onPurchase:rt.reset,visibility:it,requirements:Fn(()=>({resource:hn(c),cost:Ye}))})),ye=Ae(()=>({multiplier:0}));se({feature:$e,canClick:()=>s($e.canPurchase),modifier:Ke,cost:Ye,previewCost:c,previewModifier:ye,showETA:()=>!s($e.bought)}),K.push([$e]);break}}const It={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(M.influenceNodes.value).length+we.length===Object.keys(Rt).length?0:"increaseInfluences"in h?20:2,relic:0};let gn=Qn(It,r);R===y-1&&"relic"in h&&(gn="relic");let Je="",T,D,q,U,oe,ce;switch(gn){case"cache":U=Pi(r,i),Je=`Gain ${le(v)}x your current ${U}.`,D=()=>{var Fe,Ft,Dn;return M.grantResource(U,o.times((Dn=(Ft=(Fe=M.resourceNodes.value[U])==null?void 0:Fe.state)==null?void 0:Ft.amount)!=null?Dn:0,v))};break;case"generation":U=Pi(r,i);const Tn=o.div(v,120).times(kt[U]);Je=`Gain ${le(Tn)} ${U}/s while plane is active.`,T=Fe=>M.grantResource(U,o.times(Fe,Tn)),q=N(()=>M.resourceNodes.value[U]);break;case"resourceMulti":oe=U=Pi(r,i),ce=o.div(v,17).pow_base(2),Je=`Gain ${le(ce)}x ${U} while plane is active.`;break;case"energyMulti":oe="energy",ce=o.div(v,17).add(1),Je=`Gain ${le(ce)}x energy while plane is active.`;break;case"influences":const Dt=Object.keys(Rt)[Math.floor(r()*Object.keys(Rt).length)];we.push(Dt),Je=`Gain a new portal influence (${Rt[Dt].display})`,D=()=>{if(Dt in M.influenceNodes.value){pr.warning(`Error: ignoring duplicate portal influence (${Rt[Dt].display})`);return}const Fe={id:Un(M.board),position:{...M.board.types.portal.nodes.value.find(Ft=>Ft.state.id===e).position},type:"influence",state:{type:Dt,data:Rt[Dt].initialData}};M.board.placeInAvailableSpace(Fe),M.board.nodes.value.push(Fe)};break;case"relic":Je=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Fi[t]})`,D=()=>{if(t==="ultimatum"){Hi.value=!0;return}if(`${t}Relic`in M.toolNodes.value)pr.warning(`Error: ignoring duplicate relic (${Fi[t]})`);else{const Fe={id:Un(M.board),position:{...M.board.types.portal.nodes.value.find(Ft=>Ft.state.id===e).position},type:"passive",state:`${t}Relic`};M.board.placeInAvailableSpace(Fe),M.board.nodes.value.push(Fe)}}}const mn=tt,Tt=X.value,Ct=Td(()=>({requirements:Fn(()=>({resource:hn(c),cost:Tt})),visibility:mn,display:{requirement:`${le(Tt)} ${c.displayName}`,effectDisplay:Je},style:"width: 100%",classes:{final:R===y-1},update:T,onComplete:D,link:q,effectedResource:oe,resourceMulti:ce})),Pn=Ii(c,S,Tt);xi(Ct,{display:()=>Ct.earned.value?"":Pn.value,direction:G.Down}),K.push([Ct]),tt=Ct.earned}const nt=Ti(K,Zr);Ti(K,Hr);const ot=$t(()=>[Ae(()=>({multiplier:()=>{var R,L,De;return o.add((De=(L=(R=M.board.types.booster.nodes.value[0])==null?void 0:R.state)==null?void 0:L.level)!=null?De:0,1)},description:"Booster",enabled:()=>{var R,L,De;return(De=(L=(R=M.board.types.booster.nodes.value[0])==null?void 0:R.state)==null?void 0:L.portals.includes(e))!=null?De:!1}}))]),ht=N(()=>ot.apply(1)),[Ze,$n]=Vn(()=>[{title:`${Qe(c.displayName)} Gain`,modifier:A,base:0,unit:"/s"},{title:`${Qe(c.displayName)} Time Speed`,modifier:ot,base:1,visible:()=>o.gt(ht.value,1)}]),xn=V(!1),vi=J(()=>p(jt,{modelValue:xn.value,"onUpdate:modelValue":R=>xn.value=R},{header:()=>p("h2",null,[x("Modifiers")]),body:()=>et(Ze)}));this.on("preUpdate",R=>{if(!M.activePortals.value.some(De=>De.state.id===e))return;const L=o.times(ht.value,R);d.value=o.add(d.value,L),c.value=o.times(S.value,L).add(c.value),lt.value.forEach(De=>{var It;(It=De.update)==null||It.call(De,L)})});const Zn=N(()=>{const R=E.find(L=>L.shouldShowPreview.value);return R?o.neg(be(R.cost)):0}),Yn=N(()=>{const R=E.find(L=>L.shouldShowPreview.value);return R&&R.modifier?o.sub(R.modifier.apply(0),S.value):0}),hi=tn(g.variable(0).add(c),()=>o.neq(Zn.value,0),Zn),bi=tn(g.variable(0).add(S),()=>o.neq(Yn.value,0),Yn),yi=N(()=>{const R=[];return lt.value.forEach(L=>{L.link&&R.push(L.link)}),R}),wi=N(()=>{const R={};return lt.value.forEach(L=>{L.effectedResource!=null&&L.resourceMulti!=null&&(R[L.effectedResource]!=null?R[L.effectedResource]=o.times(R[L.effectedResource],L.resourceMulti):R[L.effectedResource]=L.resourceMulti)}),R}),lt=N(()=>{const R=[];for(let L=1;Lo.lt(lt.value.length,y)&&K.some(R=>R.some(L=>"earned"in L&&s(L.earned)||"bought"in L&&s(L.bought)?!1:("canClick"in L&&s(L.canClick)||"canPurchase"in L&&s(L.canPurchase),!0))));return{tier:ft(t),seed:ft(n),influences:ft(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:K,resourceTabCollapsed:$n,links:yi,resourceMultis:wi,earnedTreasures:lt,showNotif:En,timeActive:d,display:J(()=>p(ne,null,[p(si,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,x("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(xe,{display:i.map(R=>{const L=Rt[R.type].description;return typeof L=="function"?L(R):L}).join("
"),direction:G.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,x(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>xn.value=!0},[x("modifiers")])])]}),p(si,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[et(hi)])," ",c.displayName]),p("span",{class:"nav-segment"},[x("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(S.value,0)?"+":"",et(bi)]),x("/s)")]),o.neq(ht.value,1)?p("span",{class:"nav-segment"},[x("Speed: "),le(ht.value),x("x")]):null]}),p(Md,{height:"60px"},null),K.map((R,L)=>L in j?et(j[L]):Mi(...R)),et(vi)])),minimizedDisplay:J(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",lt.value.length,x("/"),y,x(" treasures")])]))}})}function Pi(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(kt).reduce((u,c)=>{let d=kt[c];return t.filter(m=>m.data===c).forEach(m=>{m.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(kt),r=Math.floor(e()*n);let a=0,l;for(let u=0;uu+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;ue===M.board.selectedNode.value?{text:"Mining"}:Object.keys(M.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[pn],progress:e=>Oe(e)?new o(e.state.progress).toNumber():0,progressDisplay:ln.Outline,progressColor:"var(--accent2)",classes:e=>({running:Oe(e)}),draggable:!0},Qd={shape:Xe.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===M.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(M.energy.value,100)&&(e.type="factory",M.energy.value=o.sub(M.energy.value,100))},confirmationLabel:()=>o.gte(M.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},ef={shape:Xe.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===M.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Ee[e.state].name}`};if(((t=M.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=M.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":Ee[i].name,a=e.state===i||o.gte(M.energy.value,Ee[i].cost)&&M.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Ee[e.state].name} - ${ze(Ee[e.state].cost)} energy`}),onClick(e){const t=Ee[e.state];if(o.gte(M.energy.value,t.cost)&&M.toolNodes.value[e.state]==null){M.energy.value=o.sub(M.energy.value,t.cost);const n={id:Un(M.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};M.board.placeInAvailableSpace(n),M.board.nodes.value.push(n),M.board.selectedAction.value=null,M.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(M.energy.value,Ee[e.state].cost)&&M.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(M.energy.value,Ee[e.state].cost)?M.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||M.toolNodes.value[e.state]!=null?0:o.div(M.energy.value,Ee[e.state].cost).clampMax(1).toNumber(),progressDisplay:ln.Fill,progressColor:e=>e.state!=null&&o.gte(M.energy.value,Ee[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,M.board.selectedNode.value=e},draggable:!0},tf={shape:Xe.Circle,size:50,title:e=>Qe(e.state.type),subtitle:e=>ze(e.state.amount),progress:e=>cd(e.state.type),onClick(){},progressDisplay:ln.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":M.dowsing.value!=null&&Oe(M.dowsing.value)&&M.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=M.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},nf={shape:Xe.Circle,size:50,title:e=>Ee[e.state].name,label:e=>e===M.board.selectedNode.value?{text:kd[e.state].description(ct(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":ct(e.state)}),draggable:!0},rf={shape:Xe.Diamond,size:50,title:"\u{1F962}",label:e=>e===M.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:Lr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[di,fi(e=>e.add(2).pow_base(100),16),pn],classes:e=>({running:Oe(e)}),canAccept:jr,onDrop:zr,draggable:!0},af={shape:Xe.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===M.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:Lr(e,t=>`Gather ${le(o.div(M.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[di,fi(e=>e.add(2).pow_base(1e4),16),pn],progress:e=>Oe(e)?o.eq(M.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(M.quarryProgressRequired.value).toNumber():0,progressDisplay:ln.Outline,progressColor:"var(--accent2)",canAccept:jr,onDrop:zr,classes:e=>({running:Oe(e)}),draggable:!0},sf={shape:Xe.Diamond,size:50,title:"\u{1F50C}",label:e=>e===M.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:rd(e,t=>t.includes("Relic")?`Double ${Fi[t.slice(0,-5)]}'s effect`:`Double ${Ee[t].name}'s effect`),actionDistance:Math.PI/4,actions:[di,fi(e=>e.add(3).pow_base(1e3),16),pn],canAccept:sd,onDrop:od,classes:e=>({running:Oe(e)}),draggable:!0},of={shape:Xe.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===M.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=M.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${Qe(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal`}),onClick(e){let t=0;for(;`portal-${t}`in Ne;)t++;const{tier:n,influences:i}=e.state;zi(Yr(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>M.influenceNodes.value[a].state)),Q);const r={id:Un(M.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};M.board.placeInAvailableSpace(r),M.board.nodes.value.push(r),M.board.selectedAction.value=null,M.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}M.board.selectedNode.value=e},draggable:!0},lf={shape:Xe.Diamond,size:50,title:"\u{1F300}",label:e=>e===M.board.selectedNode.value?{text:`Portal to ${Ne[e.state.id].name}`,color:Ne[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[pn],classes:e=>({running:Oe(e),showNotif:Ne[e.state.id].showNotif.value}),outlineColor:e=>Ne[e.state.id].background,draggable:!0},uf={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?Xe.Diamond:Xe.Circle,size:50,title:e=>Rt[e.state.type].display,label:e=>{if(e===M.board.selectedNode.value){const n=e.state,i=Rt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=M.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${Qe(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${Qe(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[di],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},M.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},cf={shape:Xe.Diamond,size:50,title:"\u231B",label:e=>e===M.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${ze(o.add(1,e.state.level))}x (${e.state.tools.length}/${o.add(e.state.maxConnections,M.computedBonusConnectionsModifier.value)})`}:ad(e,t=>`Boost ${Ne[t].name}'s speed`),actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect portals"},onClick(e){e.state={...e.state,portals:[]},M.board.selectedAction.value=null,M.board.selectedNode.value=null},visibility:e=>{var t,n;return(n=(t=e.state)==null?void 0:t.portals.length)!=null?n:0>0}},fi(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${ze($i.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(M.energy.value,$i.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=$i.evaluate(e.state.level);o.gte(M.energy.value,t)&&(M.energy.value=o.sub(M.energy.value,t)),e.state={...e.state,level:o.add(e.state.level,1)},M.board.selectedAction.value=null}},pn],canAccept:ld,onDrop:ud,classes:e=>({running:Oe(e)}),draggable:!0},gr=ui(),df={mine:Kd,brokenFactory:Qd,factory:ef,resource:tf,passive:nf,dowsing:rf,quarry:af,empowerer:sf,portalGenerator:of,portal:lf,influence:uf,booster:cf},M=ji("main",function(){const e=yn(0,"energy"),t=N(()=>m.types.resource.nodes.value.reduce((T,D)=>(T[D.state.type]=D,T),{})),n=N(()=>({...m.types.passive.nodes.value.reduce((T,D)=>(T[D.state]=D,T),{}),sand:m.types.dowsing.nodes.value[0],wood:m.types.quarry.nodes.value[0],coal:m.types.empowerer.nodes.value[0],iron:m.types.portalGenerator.nodes.value[0],gold:m.types.booster.nodes.value[0]})),i=N(()=>({...m.types.influence.nodes.value.reduce((T,D)=>(T[D.state.type]=D,T),{})})),r=N(()=>en.reduce((T,D)=>{var ce,mn,Tt;const q=(Tt=(mn=(ce=t.value[D])==null?void 0:ce.state)==null?void 0:mn.amount)!=null?Tt:0;let U=o.floor(Bn.invertIntegral(q)).sub(10).clampMin(0),oe=Vt(Bn,U,!0,0);for(;;){const Ct=Bn.evaluate(U);if(o.add(oe,Ct).lte(q))U=U.add(1),oe=o.add(oe,Ct);else break}return T[D]=U,T},{})),a=on({}),l=on({});Bt(()=>{en.forEach(T=>{pt(()=>r.value[T],(D,q)=>{o.gt(D,q)&&re.active===Q.id&&o.lte(D,100)&&gr.info(p("div",null,[p("h3",null,[o.eq(D,1)?`${Qe(T)} discovered`:`${Qe(T)} is now Level ${Mt(D)}`,x("!")]),p("div",null,[x("Energy gain is now 1.01x higher.")])]))})})});const u=N(()=>S.filter(T=>{var D,q;return(q=(D=T.value)==null?void 0:D.state)==null?void 0:q.powered}).length+m.types.portal.nodes.value.filter(T=>T.state.powered).length),c=N(()=>o.eq(u.value,0)?10:o.add(u.value,1).pow_base(100).div(10).times(.99)),d=N(()=>v.value==null?0:v.value.state.resources.reduce((D,q)=>o.div(100,Ze[q].computedModifier.value).add(D),o.dZero)),m=_u(T=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:df,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const D=[];if(D.push(...Object.keys(a).map(q=>({startNode:f.value,endNode:t.value[q],stroke:"var(--accent3)",strokeWidth:5}))),h.value!=null&&h.value.state!=null&&D.push({startNode:h.value,endNode:t.value[h.value.state],stroke:"var(--foreground)",strokeWidth:4}),w.value!=null&&w.value.state.resources.forEach(q=>{D.push({startNode:w.value,endNode:t.value[q],stroke:Oe(w.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),v.value!=null&&v.value.state.resources.forEach(q=>{D.push({startNode:v.value,endNode:t.value[q],stroke:"var(--foreground)",strokeWidth:4})}),D.push(...Object.keys(l).map(q=>({startNode:v.value,endNode:t.value[q],stroke:"var(--accent3)",strokeWidth:5}))),y.value!=null&&y.value.state.tools.forEach(q=>{D.push({startNode:y.value,endNode:n.value[q],stroke:Oe(y.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),I.value!=null){const q=I.value.state;q.tier!=null&&D.push({startNode:I.value,endNode:t.value[q.tier],stroke:"var(--foreground)",strokeWidth:4}),q.influences.forEach(U=>{D.push({startNode:I.value,endNode:i.value[U],stroke:"var(--foreground)",strokeWidth:4})}),T.types.portal.nodes.value.forEach(U=>{const oe=Ne[U.state.id];return oe.links.value.forEach(ce=>{ce.value!=null&&D.push({startNode:U,endNode:ce.value,stroke:Oe(U)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(oe.resourceMultis.value).forEach(ce=>{ce!=="energy"&&ce in t.value&&D.push({startNode:U,endNode:t.value[ce],stroke:Oe(U)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D})}return A.value!=null&&A.value.state.portals.forEach(q=>{D.push({startNode:A.value,endNode:T.types.portal.nodes.value.find(U=>U.state.id===q),stroke:Oe(A.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Object.values(i.value).forEach(q=>{const U=q.state;(U.type==="increaseResources"||U.type==="decreaseResources")&&U.data.forEach(oe=>{D.push({startNode:q,endNode:t.value[oe],stroke:"var(--foreground)",strokeWidth:4})})}),D}})),f=N(()=>m.types.mine.nodes.value[0]),h=N(()=>m.types.factory.nodes.value[0]),w=N(()=>n.value.sand),v=N(()=>n.value.wood),y=N(()=>n.value.coal),I=N(()=>n.value.iron),A=N(()=>n.value.gold),S=[f,w,v,y,A];function E(T,D){let q=t.value[T];if(D=o.times(D,$n[T].computedModifier.value),q==null)q={id:Un(m),position:{...f.value.position},type:"resource",state:{type:T,amount:D}},m.placeInAvailableSpace(q),m.nodes.value.push(q);else{const U=q.state;q.state={...U,amount:o.add(U.amount,D)}}}const j=N(()=>Object.keys(kt).reduce((T,D)=>T+new o(Ze[D].computedModifier.value).toNumber(),0)),se=N(()=>{const T={};return m.types.portal.nodes.value.forEach(D=>{if(!Oe(D))return;const U=Ne[D.state.id].resourceMultis.value;Object.keys(U).forEach(oe=>{T[oe]!=null?T[oe]=o.times(T[oe],U[oe]):T[oe]=U[oe]})}),T}),K=$t(()=>[...en.map(T=>Ae(()=>({description:()=>`${Qe(T)} (Lv. ${Mt(r.value[T])}) (${Mn(ht.value)}x per level)`,multiplier:()=>o.pow(ht.value,r.value[T]),enabled:()=>{var D,q;return T in t.value&&o.gt((q=(D=t.value[T].state)==null?void 0:D.amount)!=null?q:0,0)}}))),Ae(()=>({multiplier:()=>ct("stone")?4:2,description:()=>(ct("stone")?"Empowered ":"")+Ee.stone.name,enabled:()=>n.value.stone!=null})),Ae(()=>({multiplier:()=>{var T;return(T=se.value.energy)!=null?T:1},description:"Planar Treasures",enabled:()=>{var T;return o.neq((T=se.value.energy)!=null?T:1,1)}})),an(()=>({addend:()=>o.pow(100,u.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(u.value,0)}))]),z=N(()=>K.apply(1)),W=$t(()=>[an(()=>({addend:()=>ct("unobtainium")?2:1,description:()=>(ct("unobtainium")?"Empowered ":"")+Ee.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),qe=N(()=>W.apply(0)),tt=$t(()=>[Ae(()=>({multiplier:()=>ct("dirt")?4:2,description:()=>(ct("dirt")?"Empowered ":"")+Ee.dirt.name,enabled:()=>n.value.dirt!=null}))]),X=N(()=>tt.apply(1)),we=$t(()=>[Ae(()=>({multiplier:()=>ct("gravel")?4:2,description:()=>(ct("gravel")?"Empowered ":"")+Ee.gravel.name,enabled:()=>n.value.gravel!=null}))]),nt=N(()=>we.apply(1)),ot=$t(()=>[an(()=>({addend:()=>ct("copper")?.002:.001,description:()=>(ct("copper")?"Empowered ":"")+Ee.copper.name,enabled:()=>n.value.copper!=null}))]),ht=N(()=>ot.apply(1.01)),Ze=Object.keys(kt).reduce((T,D)=>{const q=$t(()=>[Ae(()=>({multiplier:2,description:"Dowsing",enabled:()=>w.value!=null&&Oe(w.value)&&w.value.state.resources.includes(D)}))]),U=N(()=>q.apply(kt[D])),oe={title:`${Qe(D)} Drop Rate`,modifier:q,base:kt[D]};return T[D]={modifier:q,computedModifier:U,section:oe},T},{}),$n=Object.keys(kt).reduce((T,D)=>{const q=$t(()=>[Ae(()=>({multiplier:()=>{var ce;return(ce=se.value[D])!=null?ce:1},description:"Planar Treasures",enabled:()=>{var ce;return o.neq((ce=se.value[D])!=null?ce:1,1)}}))]),U=N(()=>q.apply(1)),oe={title:`${Qe(D)} Gain`,modifier:q};return T[D]={modifier:q,computedModifier:U,section:oe},T},{}),[xn,vi]=Vn(()=>[{title:"Energy Gain",modifier:K,base:1,unit:"/s"},{title:"Bonus Connections",modifier:W,base:0}]),[Zn,Yn]=Vn(()=>[{title:"Mining Speed",modifier:tt,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:we,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ot,base:1.01,visible:()=>n.value.copper!=null}]),[hi,bi]=Vn(()=>Object.values(Ze).map(T=>T.section)),[yi,wi]=Vn(()=>Object.values($n).map(T=>T.section)),lt=Eu({general:()=>({display:"General",glowColor(){return lt.activeTab.value===this.tab?"white":""},tab:xn,energyTabCollapsed:vi}),mining:()=>({display:"Mine",glowColor(){return lt.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Zn,miningTabCollapsed:Yn}),resources:()=>({display:"Mine Rates",glowColor(){return lt.activeTab.value===this.tab?"white":""},visibility:()=>w.value!=null,tab:hi,resourcesCollapsed:bi}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return lt.activeTab.value===this.tab?"white":""},visibility:()=>Object.values($n).some(T=>o.neq(T.computedModifier.value,1)),tab:yi,resourceGainCollapsed:wi})}),En=V(!1),R=J(()=>p(jt,{modelValue:En.value,"onUpdate:modelValue":T=>En.value=T},{header:()=>p("h2",null,[x("Modifiers")]),body:()=>et(lt)}));this.on("preUpdate",T=>{if(Object.keys(a).forEach(D=>{a[D]-=T,a[D]<=0&&delete a[D]}),Object.keys(l).forEach(D=>{l[D]-=T,l[D]<=0&&delete l[D]}),Oe(f.value)){const D=o.add(f.value.state.progress,o.times(X.value,T)),q=D.floor();f.value.state={...f.value.state,progress:o.sub(D,q)};const U=q.div(j.value).floor();U.gt(0)&&en.forEach(ce=>{E(ce,o.times(new o(Ze[ce].computedModifier.value).toNumber(),U).times(nt.value)),a[ce]=.3});const oe=o.sub(q,U).toNumber();for(let ce=0;ce0){let U=o.add(D,T);const oe=o.div(D,d.value).floor();U=o.sub(U,o.times(oe,d.value)),v.value.state={...v.value.state,progress:U},o.gt(oe,0)&&q.forEach(ce=>{E(ce,oe),l[ce]=.3})}}e.value=o.add(e.value,o.times(z.value,T)),o.lt(e.value,0)&&(e.value=0,f.value.state={...f.value.state,powered:!1},gr.warning(p("div",null,[p("h3",null,[x("Ran out of energy!")]),p("div",null,[x("All machines have been turned off.")])])))});const L=N(()=>{var T,D;return m.selectedAction.value===m.types.brokenFactory.actions[0]?-100:m.selectedAction.value===m.types.factory.actions[1]?o.neg(Ee[m.selectedNode.value.state].cost):((T=m.selectedAction.value)==null?void 0:T.id)==="moreConnections"?o.neg(m.selectedAction.value.formula.evaluate(((D=m.selectedNode.value)==null?void 0:D.state).maxConnections)):0}),De=tn(g.variable(0).add(e),()=>o.neq(L.value,0),L),It=N(()=>{var T;return m.selectedAction.value===pn?((T=m.selectedNode.value)==null?void 0:T.state).powered?o.eq(u.value,1)?10:o.pow(100,u.value).div(10).times(.99):o.neg(c.value):0}),gn=tn(g.variable(0).add(z),()=>o.neq(It.value,0),It),Je=N(()=>m.types.portal.nodes.value.filter(T=>Oe(T)));return pt(Je,T=>{Bt(()=>{Q.tabs=["main",...T.map(D=>D.state.id)]})}),pt(qe,(T,D)=>{o.lt(T,D)&&(Jn(T,w,"resources"),Jn(T,v,"resources"),Jn(T,y,"tools"),Jn(T,A,"portals"))}),{name:"World",board:m,energy:e,modifierTabs:lt,resourceNodes:t,toolNodes:n,influenceNodes:i,grantResource:E,activePortals:Je,isEmpowered:ct,nextPowerCost:c,computedBonusConnectionsModifier:qe,quarryProgressRequired:d,dropRates:Ze,dowsing:w,empowerer:y,resourceLevels:r,planarMultis:se,display:J(()=>p(ne,null,[p(si,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[et(De)])," ",x("energy")]),p("span",{class:"nav-segment"},[x("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(z.value,0)?"+":"",et(gn)]),x("/s)")]),o.gt(u.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[Mt(u.value)])," ",x("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>En.value=!0},[x("modifiers")])]),Q.devSpeed===0?p("span",{class:"nav-segment"},[x("Game Paused")]):Q.devSpeed!=null&&Q.devSpeed!==1?p("span",{class:"nav-segment"},[x("Dev Speed: "),Mn(Q.devSpeed),x("x")]):null]}),et(m),et(R)]))}}),ff=e=>{var i,r,a,l,u;const t=[M];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(Yr(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},Hi=V(!1);function pf(e,t){}var gf=Object.freeze(Object.defineProperty({__proto__:null,main:M,getInitialLayers:ff,hasWon:Hi,fixOldSave:pf},Symbol.toStringTag,{value:"Module"}));const Hn=e=>(un("data-v-4a50ce42"),e=e(),cn(),e),mf={class:"game-over-modal-header"},vf=["src","alt"],hf={class:"game-over-modal-title"},bf=Hn(()=>_("h2",null,"Congratulations!",-1)),yf={key:0},wf=Hn(()=>_("br",null,null,-1)),_f=Hn(()=>_("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Nf=Hn(()=>_("br",null,null,-1)),Cf=["href"],kf=Hn(()=>_("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Mf=Y({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=ge,u=N(()=>ci(Q.timePlayed)),c=N(()=>Hi.value&&!Q.keepGoing),d=Yt(Q,"autosave");function m(){Q.keepGoing=!0}function f(){nn(_n())}return(h,w)=>(k(),ee(jt,{"model-value":s(c)},{header:H(()=>[_("div",mf,[s(n)?(k(),P("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,vf)):B("",!0),_("div",hf,[bf,_("h4",null,"You've beaten "+ae(s(t))+" v"+ae(s(a))+": "+ae(s(l)),1)])])]),body:H(({shown:v})=>[v?(k(),P("div",yf,[_("div",null,"It took you "+ae(s(u))+" to beat the game.",1),wf,_f,Nf,_("div",null,[_("a",{href:s(r),class:"game-over-modal-discord-link"},[kf,x(" "+ae(s(i)),1)],8,Cf)]),p(qt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":w[0]||(w[0]=y=>Pe(d)?d.value=y:null)},null,8,["modelValue"])])):B("",!0)]),footer:H(()=>[_("div",{class:"game-over-footer"},[_("button",{onClick:m,class:"button"},"Keep Going"),_("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Sf=fe(Mf,[["__scopeId","data-v-4a50ce42"]]);const mi=e=>(un("data-v-2776d67d"),e=e(),cn(),e),If=mi(()=>_("div",{class:"nan-modal-header"},[_("h2",null,"NaN value detected!")],-1)),$f={key:0},xf=mi(()=>_("br",null,null,-1)),Ef=["href"],Pf=mi(()=>_("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Tf=mi(()=>_("br",null,null,-1)),Df={class:"nan-footer"},Ff=Y({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ge,i=V(!0),r=V(!0),a=Yt(Be,"hasNaN"),l=V(null);pt(a,h=>{h?(i.value=Q.autosave,r.value=Q.devSpeed===0):(Q.autosave=i.value,Q.devSpeed=r.value?0:null)});const u=N(()=>{var h;return(h=Be.NaNPath)==null?void 0:h.join(".")}),c=N(()=>Be.NaNPersistent!=null?Be.NaNPersistent.value:null);function d(){Be.NaNPersistent!=null&&(Be.NaNPersistent.value=new o(0),Be.hasNaN=!1)}function m(){Be.NaNPersistent&&(Be.NaNPersistent.value=new o(1),Be.hasNaN=!1)}function f(){Be.NaNPersistent&&(Be.NaNPersistent.value=new o(NaN),Be.hasNaN=!1)}return(h,w)=>(k(),P(ne,null,[p(jt,Lt({modelValue:s(a),"onUpdate:modelValue":w[4]||(w[4]=v=>Pe(a)?a.value=v:null)},h.$attrs),{header:H(()=>[If]),body:H(()=>[_("div",null,[x(' Attempted to assign "'+ae(s(u))+'" to NaN',1),s(c)?(k(),P("span",$f,ae(" ")+"(previously "+ae(s(Mn)(s(c)))+")",1)):B("",!0),x(". Auto-saving has been "+ae(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),xf,_("div",null,[_("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Pf,x(" "+ae(s(t)||"The Paper Pilot Community"),1)],8,Ef)]),Tf,p(qt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v)},null,8,["modelValue"]),s(ge).enablePausing?(k(),ee(qt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":w[1]||(w[1]=v=>r.value=v)},null,8,["modelValue"])):B("",!0)]),footer:H(()=>[_("div",Df,[_("button",{onClick:w[2]||(w[2]=v=>{var y;return(y=l.value)==null?void 0:y.open()}),class:"button"},"Open Saves Manager"),_("button",{onClick:d,class:"button"},"Set to 0"),_("button",{onClick:m,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(k(),P("button",{key:0,onClick:w[3]||(w[3]=v=>a.value=!1),class:"button"}," Set to previous ")):B("",!0),_("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(Ar,{ref_key:"savesManager",ref:l},null,512)],64))}});var Af=fe(Ff,[["__scopeId","data-v-2776d67d"]]);const Of={key:0,class:"tpsDisplay"},Rf={key:0,class:"low"},qf=Y({__name:"TPS",setup(e){const t=N(()=>o.div(Be.lastTenTicks.length,Be.lastTenTicks.reduce((a,l)=>a+l,0))),n=V([]);wt(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=N(()=>n.value.reduce((a,l)=>o.max(a,l),0)),r=N(()=>o.sub(t.value,i.value).gt(1));return(a,l)=>s(t).isNan()?B("",!0):(k(),P("div",Of,[x(" TPS: "+ae(s(Mt)(s(t)))+" ",1),p(Cn,{name:"fade"},{default:H(()=>[s(r)?(k(),P("span",Rf,ae(s(Mt)(s(i))),1)):B("",!0)]),_:1})]))}});var Vf=fe(qf,[["__scopeId","data-v-46a3ed5b"]]);var Bf=Y({__name:"App",setup(e){const t=ge.useHeader,n=N(()=>yt[re.theme].variables),i=Yt(re,"showTPS"),r=N(()=>ue(J(()=>p(ne,null,[Ss.map(et)]))));return(a,l)=>(k(),P(ne,null,[_("div",{id:"modal-root",style:Re(s(n))},null,4),_("div",{class:me(["app",{useHeader:s(t)}]),style:Re(s(n))},[s(t)?(k(),ee(Or,{key:0})):B("",!0),p(zl),s(s(i))?(k(),ee(Vf,{key:1})):B("",!0),p(Sf),p(Af),(k(),ee(Ge(s(r))))],6)],64))}});var Lf=fe(Bf,[["__scopeId","data-v-41d15e5e"]]);function jf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,m;const f=async(w=!0)=>{await d,w&&(u==null||u.addEventListener("controlling",v=>{v.isUpdate&&window.location.reload()})),await(m==null?void 0:m())};async function h(){if("serviceWorker"in navigator){const{Workbox:w,messageSW:v}=await Ln(()=>import("./workbox-window.4a8794bb.js"),[]);m=async()=>{c&&c.waiting&&await v(c.waiting,{type:"SKIP_WAITING"})},u=new w("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",y=>{y.isUpdate||i==null||i()});{const y=()=>{n==null||n()};u.addEventListener("waiting",y),u.addEventListener("externalwaiting",y)}u.register({immediate:t}).then(y=>{c=y,a?a("./sw.js",y):r==null||r(y)}).catch(y=>{l==null||l(y)})}}return d=h(),f}function zf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=V(!1),c=V(!1);return{updateServiceWorker:jf({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=ge.title;window.projInfo=ge;if(ge.id==="")throw new Error("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 ws();const{globalBus:e}=await Ln(()=>Promise.resolve().then(function(){return bs}),void 0),{startGameLoop:t}=await Ln(()=>import("./gameLoop.c337231a.js"),["assets/gameLoop.c337231a.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=ma(Lf);e.emit("setupVue",n),n.mount("#app"),Bt(()=>{const i=ui(),{updateServiceWorker:r}=zf({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Ln as _,Be as a,ge as b,gf as c,We as g,_s as l,Q as p,re as s}; diff --git a/index.html b/index.html index f551968..aea81f0 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + diff --git a/sw.js b/sw.js index 01c416a..c1ab8f9 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.d83eb23f.js",revision:null},{url:"assets/index.675cbad0.js",revision:null},{url:"assets/index.6d27cf3a.css",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"fe30581a369f785b13ca7a8a5414d88f"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.c337231a.js",revision:null},{url:"assets/index.6d27cf3a.css",revision:null},{url:"assets/index.7712ec78.js",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"f9b1bd7c97b232e186fa093b70cce73e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));