diff --git a/assets/gameLoop.e85fc477.js b/assets/gameLoop.8e2ab203.js similarity index 89% rename from assets/gameLoop.e85fc477.js rename to assets/gameLoop.8e2ab203.js index 50896c3..852b0c4 100644 --- a/assets/gameLoop.e85fc477.js +++ b/assets/gameLoop.8e2ab203.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.6980da7f.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";import"./unique-names-generator.5494b30b.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 M(){f=(await d(()=>import("./index.6980da7f.js").then(function(t){return t.c}),["assets/index.6980da7f.js","assets/index.e0ba227d.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","assets/unique-names-generator.5494b30b.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M 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.2c261c78.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";import"./unique-names-generator.5494b30b.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 M(){f=(await d(()=>import("./index.2c261c78.js").then(function(t){return t.c}),["assets/index.2c261c78.js","assets/index.69d9c929.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","assets/unique-names-generator.5494b30b.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M as startGameLoop}; diff --git a/assets/index.2c261c78.js b/assets/index.2c261c78.js new file mode 100644 index 0000000..dd81f3e --- /dev/null +++ b/assets/index.2c261c78.js @@ -0,0 +1,18 @@ +/* empty css */import"./vue.c16a309b.js";import{_ as I,C as a,l as Se,q as jt,t as R,b2 as Xe,ab as Y,aF as k,a1 as $,a2 as w,aL as ft,G as ge,aD as Si,w as ze,b3 as Ke,a9 as m,O as se,ap as er,az as On,as as gt,aH as Mn,A as Ne,$ as ee,b7 as z,b9 as Hn,ar as pt,bv as en,a8 as A,bt as tr,bc as tn,T as nr,u as Zn,j as ir,bw as $t,aM as Et,a0 as B,aO as Ae,J as ie,I as Le,aI as Ut,aG as zt,z as Tt,bo as rr,bs as ar,aK as nn,bd as oi,am as xn,H as sr,bx as or,bf as lr}from"./@vue.6b211d3c.js";import{c as Mi}from"./nanoevents.1080beb7.js";import{L as St}from"./lz-string.dccec454.js";import{Y as ur}from"./vue-next-select.ded54c4a.js";import{D as cr}from"./vuedraggable.1879de79.js";import{p as dr}from"./vue-textarea-autosize.35804eaf.js";import{P as fr}from"./vue-panzoom.8ce6f9b1.js";import{s as gr,u as Yn}from"./vue-toastification.9c2dad53.js";import{n as pr,t as mr,l as vr}from"./unique-names-generator.5494b30b.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 hr=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 s of r)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerpolicy&&(s.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?s.credentials="include":r.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}};hr();const br="modulepreload",li={},yr="./",mn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${yr}${i}`,i in li)return;li[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":br,r||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),r)return new Promise((o,c)=>{u.addEventListener("load",o),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},wr="./projInfo-schema.json",_r="Planar Pioneers",Nr="A game about controlling and exploiting planes!",Cr="planar-pioneers",kr="thepaperpilot",Sr="",Mr="",Ir="0.0",xr="Initial Commit",$r=!1,Er=!1,Tr=2,Pr=!0,Fr=null,Dr="",Or=["main"],Ar=3600,Vr=0,qr=!0,Lr="base64";var ce={$schema:wr,title:_r,description:Nr,id:Cr,author:kr,discordName:Sr,discordLink:Mr,versionNumber:Ir,versionTitle:xr,allowGoBack:$r,defaultShowSmall:Er,defaultDecimalsShown:Tr,useHeader:Pr,banner:Fr,logo:Dr,initialTabs:Or,maxTickLength:Ar,offlineLimit:Vr,enablePausing:qr,exportEncoding:Lr};class Rr{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 Br(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 Br{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Bn=17,jr=9e15,Ur=Math.log10(9e15),zr=1/9e15,Gr=308,Wr=-324,ui=5,Hr=(1<<10)-1,Zr=function(){const e=[];for(let n=Wr+1;n<=Gr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Dt=[2,Math.E,3,4,5,6,7,8,9,10],Yr=[[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]],Kr=[[-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 l.fromValue_noAlloc(t)},G=function(e,t,n){return l.fromComponents(e,t,n)},X=function(t,n,i){return l.fromComponents_noNormalize(t,n,i)};const _t=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(s.toFixed(Math.max(i-r,0)))},jn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Jr=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},Ii=.5671432904097838,ci=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Ii;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let 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 X(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)),G(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return h.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(h.sub(1,n.pow(e))).div(h.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n)).sub(n.div(2)),u=s.pow(2);return s.neg().add(u.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=jr)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=h.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const _=parseFloat(i[0]),S=parseFloat(i[1]),P=i[1].split(";");let q=1;if(P.length===2&&(q=parseFloat(P[1]),isFinite(q)||(q=1)),isFinite(_)&&isFinite(S)){const x=h.pentate(_,S,q);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const _=parseFloat(r[0]),S=parseFloat(r[1]),P=r[1].split(";");let q=1;if(P.length===2&&(q=parseFloat(P[1]),isFinite(q)||(q=1)),isFinite(_)&&isFinite(S)){const x=h.tetrate(_,S,q);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const _=parseFloat(s[0]),S=parseFloat(s[1]);if(isFinite(_)&&isFinite(S)){const P=h.pow(_,S);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}e=e.trim().toLowerCase();let u,o,c=e.split("pt");if(c.length===2){u=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(u)&&isFinite(o)){const S=h.tetrate(u,o,_);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){u=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(u)&&isFinite(o)){const S=h.tetrate(u,o,_);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}const f=e.split("e"),v=f.length-1;if(v===0){const _=parseFloat(e);if(isFinite(_))return this.fromNumber(_),h.fromStringCache.size>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}else if(v===1){const _=parseFloat(e);if(isFinite(_)&&_!==0)return this.fromNumber(_),h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}const g=e.split("e^");if(g.length===2){this.sign=1,g[0].charAt(0)=="-"&&(this.sign=-1);let _="";for(let S=0;S=43&&P<=57||P===101)_+=g[1].charAt(S);else return this.layer=parseFloat(_),this.mag=parseFloat(g[1].substr(S+1)),this.normalize(),h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}}if(v<1)return this.sign=0,this.layer=0,this.mag=0,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this;const y=parseFloat(f[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this;let N=parseFloat(f[f.length-1]);if(v>=2){const _=parseFloat(f[f.length-2]);isFinite(_)&&(N*=Math.sign(_),N+=jn(_))}if(!isFinite(y))this.sign=f[0]==="-"?-1:1,this.layer=v,this.mag=N;else if(v===1)this.sign=Math.sign(y),this.layer=1,this.mag=N+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=v,v===2){const _=h.mul(G(1,2,N),C(y));return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}else this.mag=N;return this.normalize(),h.fromStringCache.maxSize>=1&&h.fromStringCache.set(t,h.fromDecimal(this)),this}fromValue(e){return e instanceof h?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:_t(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:_t(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=ui?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):_t(this.m,e)+"e"+_t(this.e,e):this.layer===1?_t(this.m,e)+"e"+_t(this.e,e):this.layer<=ui?(this.sign===-1?"-":"")+"e".repeat(this.layer)+_t(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+_t(this.mag,e)}abs(){return X(this.sign===0?0:1,this.layer,this.mag)}neg(){return X(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?h.dZero:this.layer===0?G(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?h.dZero:this.layer===0?G(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?h.dZero:this.layer===0?G(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?h.dZero:this.layer===0?G(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 X(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(h.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return h.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),s=i.layer*Math.sign(i.mag);if(r-s>=2)return n;if(r===0&&s===-1){if(Math.abs(i.mag-Math.log10(n.mag))>Bn)return n;{const u=Math.pow(10,Math.log10(n.mag)-i.mag),o=i.sign+n.sign*u;return G(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}if(r===1&&s===0){if(Math.abs(n.mag-Math.log10(i.mag))>Bn)return n;{const u=Math.pow(10,n.mag-Math.log10(i.mag)),o=i.sign+n.sign*u;return G(Math.sign(o),1,Math.log10(i.mag)+Math.log10(Math.abs(o)))}}if(Math.abs(n.mag-i.mag)>Bn)return n;{const u=Math.pow(10,n.mag-i.mag),o=i.sign+n.sign*u;return G(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}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 X(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return X(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return h.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return G(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return G(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return G(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=G(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(G(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return G(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=G(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(G(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return G(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?h.dNaN:this.layer===0?G(this.sign,0,1/this.mag):G(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=jn(r)),this.layer0?G(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):G(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?h.dNaN:this.layer>0?G(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):G(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?h.dNaN:this.layer===0&&e.layer===0?G(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):h.div(this.log10(),e.log10())}log2(){return this.sign<=0?h.dNaN:this.layer===0?G(this.sign,0,Math.log2(this.mag)):this.layer===1?G(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?G(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):G(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?h.dNaN:this.layer===0?G(this.sign,0,Math.log(this.mag)):this.layer===1?G(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?G(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):G(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)?X(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return X(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:h.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return h.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 G(1,0,t);if(e.sign===0)return h.dOne;e=X(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?G(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?G(-e.sign,e.layer+1,-e.mag):h.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?h.exp(h.mul(this,h.ln(this).sub(1))):h.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(X(1,0,24)))return h.fromNumber(Jr(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,s=1/r,u=t+s;if(u===t||(t=u,i=i*n,r=360*i,s=1/r,u=t-s,u===t))return h.exp(t);t=u,i=i*n,r=1260*i;let o=1/r;return t=t+o,i=i*n,r=1680*i,o=1/r,t=t-o,h.exp(t)}else return this.layer===1?h.exp(h.mul(this,h.ln(this).sub(1))):h.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?h.dOne:this.layer===0&&this.mag<=709.7?h.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?G(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?G(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):G(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return h.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return G(1,2,Math.log10(this.mag)-.3010299956639812);{const e=h.div(X(this.sign,this.layer-1,this.mag),X(1,0,2));return e.layer+=1,e.normalize(),e}}cube(){return this.pow(3)}cbrt(){return this.pow(1/3)}tetrate(e=2,t=X(1,0,1)){if(e===1)return h.pow(this,t);if(e===0)return new h(t);if(this.eq(h.dOne))return h.dOne;if(this.eq(-1))return h.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return h.fromNumber(Math.E);const s=h.ln(this).neg();return s.lambertw().div(s)}else return r>1.444667861009766?h.fromNumber(Number.POSITIVE_INFINITY):h.dNaN}if(this.eq(h.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),h.fromNumber(r)}if(e<0)return h.iteratedlog(t,this,-e);t=C(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(h.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return X(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=X(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return h.tetrate(e,-t,this);e=C(e);let n=h.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const s=Math.min(t,n.layer-e.layer-3);t-=s,n.layer-=s}for(let s=0;s1e4)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,s=this.slog_internal(e).toNumber();for(let u=1;u1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),s+=n,n===0)break}return h.fromNumber(s)}slog_internal(e=10){if(e=C(e),e.lte(h.dZero)||e.eq(h.dOne))return h.dNaN;if(e.lt(h.dOne))return this.eq(h.dOne)?h.dZero:this.eq(h.dZero)?h.dNegOne:h.dNaN;if(this.mag<0||this.eq(h.dZero))return h.dNegOne;let t=0,n=h.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(h.dZero))n=h.pow(e,n),t-=1;else{if(n.lte(h.dOne))return h.fromNumber(t+h.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=h.log(n,e)}return h.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:h.critical_section(e,t,Kr)}static tetrate_critical(e,t){return h.critical_section(e,t,Yr)}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 u=0;ue){const o=(e-Dt[u])/(Dt[u+1]-Dt[u]);i=n[u][Math.floor(t)]*(1-o)+n[u+1][Math.floor(t)]*o,r=n[u][Math.ceil(t)]*(1-o)+n[u+1][Math.ceil(t)]*o;break}const s=t-Math.floor(t);return i<=0||r<=0?i*(1-s)+r*s:Math.pow(e,Math.log(i)/Math.log(e)*(1-s)+Math.log(r)/Math.log(e)*s)}layeradd10(e){e=h.fromValue_noAlloc(e).toNumber();const t=h.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?h.tetrate(t,i):Number.isFinite(i)?i>=-1?h.log(h.tetrate(t,i+1),t):h.log(h.log(h.tetrate(t,i+2),t),t):h.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return h.fromNumber(ci(this.toNumber()));if(this.layer===0)return h.fromNumber(ci(this.sign*this.mag));if(this.layer===1)return di(this);if(this.layer===2)return di(this);if(this.layer>=3)return X(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return X(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=X(1,0,1)){t=C(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(h.dOne)?(++e,t=h.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?h.fromNumber(Math.sin(this.sign*this.mag)):X(0,0,0)}cos(){return this.mag<0?h.dOne:this.layer===0?h.fromNumber(Math.cos(this.sign*this.mag)):X(0,0,0)}tan(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.tan(this.sign*this.mag)):X(0,0,0)}asin(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.asin(this.sign*this.mag)):X(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?h.fromNumber(Math.acos(this.toNumber())):this.layer===0?h.fromNumber(Math.acos(this.sign*this.mag)):X(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?h.fromNumber(Math.atan(this.sign*this.mag)):h.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 h.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return h.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?X(Number.NaN,Number.NaN,Number.NaN):h.ln(this.add(1).div(h.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(h.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 l=h;l.fromStringCache=new Rr(Hr);l.dZero=X(0,0,0);l.dOne=X(1,0,1);l.dNegOne=X(-1,0,1);l.dTwo=X(1,0,2);l.dTen=X(1,0,10);l.dNaN=X(Number.NaN,Number.NaN,Number.NaN);l.dInf=X(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);l.dNegInf=X(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);l.dNumberMax=G(1,0,Number.MAX_VALUE);l.dNumberMin=G(1,0,Number.MIN_VALUE);C=l.fromValue_noAlloc;G=l.fromComponents;X=l.fromComponents_noNormalize;l.fromMantissaExponent;l.fromMantissaExponent_noNormalize;const Xr=new l(1);function dn(e,t,n=!0){let i=l.log10(e).floor(),r=l.div(e,l.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Xr,i=i.add(1));const s=i.gte(1e9)?ke(i,Math.max(Math.max(t,3),ce.defaultDecimalsShown)):i.gte(1e4)?$n(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function $n(e,t){if(e==null)return"NaN";if(e=new l(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 xi(e,t){return e==null?"NaN":(e=new l(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ce.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Qr=new l("eeee1000"),ea=new l("e100000"),fi=new l("e1000"),$i=new l(1e9),ta=new l(1e6),na=new l(1e3),ia=new l(.98),ra=new l(.001),Ei=new l(0);function ke(e,t,n){if(t==null&&(t=ce.defaultDecimalsShown),n=n!=null?n:ce.defaultShowSmall,e=new l(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ke(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Qr)){const i=e.slog();return i.gte(ta)?"F"+ke(i.floor()):l.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+$n(i.floor(),0)}else{if(e.gte(ea))return dn(e,0,!1);if(e.gte(fi))return dn(e,0);if(e.gte($i))return dn(e,t);if(e.gte(na))return $n(e,0);if(e.gte(ra)||!n)return xi(e,t);if(e.eq(Ei))return 0 .toFixed(t)}return e=Pi(e),e.lt(fi)?dn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ke(e,t)+"\u207B\xB9"}function He(e){return e=new l(e),e.sign<0?"-"+He(e.neg()):e.gte($i)||e.lte(ia)&&!e.eq(Ei)?ke(e):ke(e,0)}function Ti(e){return l.lt(e,0)?"-"+Ti(l.neg(e)):l.gt(e,2**51)?ke(l.div(e,31536e3))+"y":(e=new l(e).toNumber(),e<60?ke(e)+"s":e<3600?He(Math.floor(e/60))+"m "+ke(e%60)+"s":e<86400?He(Math.floor(e/3600))+"h "+He(Math.floor(e/60)%60)+"m "+He(e%60)+"s":e<31536e3?He(Math.floor(e/84600)%365)+"d "+He(Math.floor(e/3600)%24)+"h "+He(Math.floor(e/60)%60)+"m":He(Math.floor(e/31536e3))+"y "+He(Math.floor(e/84600)%365)+"d "+He(Math.floor(e/3600)%24)+"h")}function aa(e,t,n){e=new l(e);let i=e.toStringWithDecimalPlaces(t);return new l(i).gte(n)&&(i=l.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function sa(e,t){return ke(e,t,!0)}function Pi(e){let t=l.log10(e).ceil();const n=l.div(e,l.pow(10,t));return t=t.neg(),e=new l(10).pow(t).times(n),e}var oa=Object.freeze(Object.defineProperty({__proto__:null,default:l,exponentialFormat:dn,commaFormat:$n,regularFormat:xi,format:ke,formatWhole:He,formatTime:Ti,toPlaces:aa,formatSmall:sa,invertOOM:Pi},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:la,commaFormat:ua,regularFormat:ca,format:Rt,formatWhole:tt,formatTime:An,toPlaces:da,formatSmall:Mt,invertOOM:fa}=oa;window.Decimal=l;window.exponentialFormat=la;window.commaFormat=ua;window.regularFormat=ca;window.format=Rt;window.formatWhole=tt;window.formatTime=An;window.toPlaces=da;window.formatSmall=Mt;window.invertOOM=fa;function Ze(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function En(e){return typeof e=="function"}var W=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(W||{});const vn=Symbol("DoNotCache");function O(e,t){const n=e[t];En(n)&&n.length===0&&!n[vn]?e[t]=I(n.bind(e)):En(n)&&(e[t]=n.bind(e),e[t][vn]=!0)}function he(e){return En(e)&&!e[vn]&&(e=I(e)),e}const lt=Symbol("Component"),it=Symbol("GatherProps");let ga=0;function Vn(e="feature-"){return e+ga++}var Me=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Me||{});function Qe(e){const t=a(e);return t!==2&&t!==!1}function rn(e){return a(e)===1}function ne(e){return e[vn]=!0,e}function de(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function pa(e,...t){const n=[],i=r=>{Object.keys(r).forEach(s=>{const u=r[s];u!=null&&typeof u=="object"&&(t.includes(u.type)?n.push(u):!(u instanceof l)&&!Se(u)&&i(u))})};return i(e),n}const Ot={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 Kn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Kn||{}),nt={classic:Ot,paper:{...Ot,variables:{...Ot.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:{...Ot,variables:{...Ot.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:{...Ot,variables:{...Ot.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ve=Mi();"fonts"in document&&(document.fonts.onloadingdone=()=>Ve.emit("fontsLoaded"));var ma=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ve},Symbol.toStringTag,{value:"Module"}));const va=jt({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Z=window.player=va;function Fi(e){return JSON.stringify(e,(t,n)=>a(n))}function Di(e={}){return Object.assign({id:`${ce.id}-0`,name:"Default Save",tabs:ce.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ce.id,modVersion:ce.versionNumber,layers:{}},e)}function je(e){const t=St.compressToUTF16(Fi(e!=null?e:Z));return localStorage.setItem((e!=null?e:Z).id,t),t}async function ha(){wa();try{let e=localStorage.getItem(re.active);if(e==null){await Vt(Qt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=St.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ce.id){await Vt(Qt());return}t.id=re.active,await Vt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await Vt(Qt())}}function Qt(){const e=In(),t=Di({id:e});return je(t),re.saves.push(e),t}function In(){let e,t=0;do e=`${ce.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const ba=R(!1);async function Vt(e){console.info("Loading save",e),ba.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await mn(()=>Promise.resolve().then(function(){return ja}),void 0),{fixOldSave:r,getInitialLayers:s}=await mn(()=>Promise.resolve().then(function(){return Dc}),void 0);for(const u in t){const o=t[u];o&&n(o)}s(e).forEach(u=>i(u,e)),e=Di(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,ce.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ce.versionNumber&&(r(e.modVersion,e),e.modVersion=ce.versionNumber),Object.assign(Z,e),re.active=Z.id,Ve.emit("onLoad")}setInterval(()=>{Z.autosave&&je()},1e3);window.onbeforeunload=()=>{Z.autosave&&je()};window.save=je;const ya=window.hardReset=async()=>{await Vt(Qt())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(Z.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const hn=jt({active:"",saves:[],showTPS:!0,theme:Kn.Nordic,unthrottled:!1,alignUnits:!1});Xe(hn,e=>{const t=St.compressToUTF16(JSON.stringify(e));localStorage.setItem(ce.id,t)},{deep:!0});var re=window.settings=hn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Kn.Nordic,alignUnits:!1};Ve.emit("loadSettings",e),Object.assign(hn,e),ya()};function wa(){try{let e=localStorage.getItem(ce.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=St.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(hn,t)}Ve.emit("loadSettings",hn)}catch{}}const Oi=jt([]);function _a(e){Oi.push(e)}const Na=jt([]),Ca=jt([]),ka={class:"table"},Sa=Y({__name:"Row",setup(e){const t=I(()=>nt[re.theme].mergeAdjacent);return(n,i)=>(k(),$("div",ka,[w("div",{class:ge(["row",{mergeAdjacent:a(t)}])},[ft(n.$slots,"default")],2)]))}});function Ma(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!er(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 Ue(e){if(ut(e))return typeof e=="function"?e():ue(e);const t=e[lt];return m(t,e[it](),null)}function Ia(...e){let t;return m(Sa,null,Ma(t=e.map(Ue))?t:{default:()=>[t]})}function Je(e){if(ut(e))return typeof e=="function"?e():typeof e=="string"?m(se,null,[e]):m(e,null,null);const t=e[lt];return m(t,e[it](),null)}function gi(e,t){return e.reduce((n,i)=>m(se,null,[n,t,i]))}function ut(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[vn]===!0}function Ai(e,t){const n=R(null),i=R(void 0);function r(o){n.value||(n.value=setInterval(u,250)),i.value=o}function s(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Si(s),{start:r,stop:s,handleHolding:u}}function Vi(e,t="div"){const n=ze();return Ke(()=>{n.value=ue(Ee(e),t)}),n}function yn(e,t="div"){const n=ze(null);return Ke(()=>{const i=Ee(e);n.value=i==""||i==null?null:ue(i,t)}),n}function Ee(e){return a(a(e))}function L(...e){return e.includes(Object)||e.push(Object),e}function xa(e){const t=R(!1),n=e[it].bind(e);return e[it]=()=>({...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 $a=Y({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=R({}),i=new ResizeObserver(o),r=R(null);On(()=>{const g=r.value;g!=null&&i.observe(g)});let s=!0,u=R((v=r.value)==null?void 0:v.getBoundingClientRect());function o(){s&&(s=!1,gt(()=>{var g;u.value=(g=r.value)==null?void 0:g.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}Ve.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};Mn(Jn,(g,y)=>{const N=new MutationObserver(()=>f(g));N.observe(y,c),n.value[g]={element:y,observer:N,rect:y.getBoundingClientRect()},o()}),Mn(Xn,g=>{var y;(y=n.value[g])==null||y.observer.disconnect(),n.value[g]=void 0,o()}),Mn(Qn,n),Mn(ei,u);function f(g){const y=n.value[g];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(g,y)=>(k(),$(se,null,[ft(g.$slots,"default",{},void 0,!0),w("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var qi=fe($a,[["__scopeId","data-v-2b1dc1bc"]]);const Ea=["onPointerdown"],Ta={class:"modal-wrapper"},Pa={class:"modal-container"},Fa={class:"modal-header"},Da={class:"modal-body"},Oa={class:"modal-footer"},Aa=w("div",{class:"modal-default-flex-grow"},null,-1),mt=Y({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Ne(e),s=I(()=>a(r.modelValue)||o.value);function u(){n("update:modelValue",!1)}const o=R(!1),c=R(null),f=I(()=>{var v,g;return(g=(v=c.value)==null?void 0:v.nodes)!=null?g:null});return t({isOpen:s,nodes:f}),(v,g)=>(k(),ee(nr,{to:"#modal-root"},[m(tn,{name:"modal",onBeforeEnter:g[0]||(g[0]=y=>o.value=!0),onAfterLeave:g[1]||(g[1]=y=>o.value=!1)},{default:z(()=>[Hn(w("div",pt({class:"modal-mask",onPointerdown:en(u,["self"])},v.$attrs),[w("div",Ta,[w("div",Pa,[w("div",Fa,[ft(v.$slots,"header",{shown:a(s)},()=>[A(" default header ")])]),w("div",Da,[m(qi,{ref_key:"contextRef",ref:c},{default:z(()=>[ft(v.$slots,"body",{shown:a(s)},()=>[A(" default body ")])]),_:3},512)]),w("div",Oa,[ft(v.$slots,"footer",{shown:a(s)},()=>[w("div",{class:"modal-default-footer"},[Aa,w("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,Ea),[[tr,e.modelValue]])]),_:3})]))}}),kt=Symbol("ProxyState");function et(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(s,u){if(u===kt)return r();const o=r()[u];return o!=null&&typeof o=="object"&&ot in o?o[ot]:o},set(s,u,o){return r()[u]=o,!0},has(s,u){return u===kt?!0:Reflect.has(r(),u)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(s,u){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(s,u)}})}var $e=window.state=Zn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const It=Symbol("PersistentState"),bn=Symbol("DefaultValue"),Tn=Symbol("StackTrace"),Pn=Symbol("Deleted"),ot=Symbol("NonPersistent"),qt=Symbol("SaveDataPath"),Gn=Symbol("SkipPersistence");function Va(){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 pi(e,t){var n;if(l.isNaN(t))throw $e.hasNaN||(Z.autosave=!1,$e.hasNaN=!0,$e.NaNPath=e[qt],$e.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[qt])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[It].value=t}function ct(e,t=!0){const n=Se(e)?e:R(e);Se(e)&&(e=e.value);const i=I({get(){return n.value},set(s){t?pi(r,s):r[It].value=s}});i[bn]=e;const r={get value(){return n.value},set value(s){t?pi(r,s):r[It].value=s},__v_isRef:!0,[It]:n,[bn]:e,[Tn]:Va(),[Pn]:!1,[ot]:i,[qt]:void 0};return qe.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` +Created at: +`+r[Tn]):Bt[qe[qe.length-1]].add(r),r}function qa(e){return e!=null&&typeof e=="object"&&It in e}function mi(e){return!(kt in e)&&ot in e?e[ot]:new Proxy(e,{get(t,n){if(n!==It)return n===Gn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===It?!1:n==Gn?!0:Reflect.has(t,n)}})}function Li(e){qe.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):Bt[qe[qe.length-1]].delete(e),e[Pn]=!0}Ve.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let u=!1;return Object.keys(r).forEach(o=>{let c=r[o];if(c!=null&&typeof c=="object"){if(c[Gn]===!0)return;if(kt in c&&(c=c[kt]),qa(c)){if(u=!0,c[Pn]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +Created at: +`+c[Tn]);return}Bt[e.id].delete(c);const f=[e.id,...s,o];c[qt]!=null&&JSON.stringify(f)!==JSON.stringify(c[qt])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[qt].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[qt]=f;const v=s.reduce((y,N)=>(N in y||(y[N]={}),y[N]),t),g=v[o];v[o]=c[It],ir(v)?g!=null?v[o]=g:v[o]=c[bn]:g!=null?v[o].value=g:v[o].value=c[bn]}else!(c instanceof l)&&!Se(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,o])&&($t(c)&&!$t(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.",kt in r?r[kt]:r,o):u=!0))}}),u};i(e[kt]),Bt[e.id].forEach(r=>{r[Pn]||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[Tn])}),Bt[e.id].clear()});const Jn=Symbol("RegisterNode"),Xn=Symbol("UnregisterNode"),Qn=Symbol("Nodes"),ei=Symbol("Bounds"),ve=Zn({});window.layers=ve;const Bt={},qe=[];function ti(e,t){return et(()=>{const n={},i=n.emitter=Mi();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=R({}),n.id=e,qe.push(e),Bt[e]=new Set,n.minimized=ct(!1,!1),Object.assign(n,t.call(n,n)),qe[qe.length-1]==null||qe[qe.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen +Stack: ${qe} +Trying to pop ${n.id}`;qe.pop(),O(n,"color"),O(n,"display"),O(n,"classes"),O(n,"style"),O(n,"name"),de(n,"name",n.id),O(n,"minWidth"),de(n,"minWidth",600),O(n,"minimizable"),de(n,"minimizable",!0),O(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{var u,o;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(u=a(r))!=null?u:"",(o=n.minimized)!=null&&o.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function ni(e,t){if(console.info("Adding layer",e.id),ve[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ve[e.id]);return}de(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ve[e.id]=e,Ve.emit("addLayer",e,t.layers[e.id])}function La(e){return ve[e]}function Ri(e){console.info("Removing layer",e.id),Ve.emit("removeLayer",e),ve[e.id]=void 0}function Ra(e){Ri(e),ni(e,Z)}function Ba(e){const t=R(!1);return{openModal:()=>t.value=!0,modal:ne(()=>m(mt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>m("h2",null,[a(e.name)]),body:a(e.display)}))}}Ve.on("update",function(t){Object.values(ve).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ve).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ve).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ja=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Jn,UnregisterNodeInjectionKey:Xn,NodesInjectionKey:Qn,BoundsInjectionKey:ei,layers:ve,persistentRefs:Bt,addingLayers:qe,createLayer:ti,addLayer:ni,getLayer:La,removeLayer:Ri,reloadLayer:Ra,setupLayerModal:Ba},Symbol.toStringTag,{value:"Module"}));const Ua=Y({components:{Context:qi},props:{index:{type:Number,required:!0},display:{type:L(Object,String,Function),required:!0},minimizedDisplay:L(Object,String,Function),minimized:{type:Object,required:!0},name:{type:L(String),required:!0},color:L(String),minimizable:L(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Ne(e),s=Vi(t),u=yn(r),o=I(()=>ce.allowGoBack&&n.value>0&&!Ee(i));function c(){Z.tabs.splice(a(e.index),1/0)}function f(v){e.nodes.value=v}return{component:s,minimizedComponent:u,showGoBack:o,updateNodes:f,unref:a,goBack:c}}}),za={key:1};function Ga(e,t,n,i,r,s){const u=Et("Context");return k(),$("div",{class:"layer-container",style:Le({"--layer-color":e.unref(e.color)})},[e.showGoBack?(k(),$("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):B("",!0),e.unref(e.minimized)?(k(),$("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(k(),ee(Ae(e.minimizedComponent),{key:0})):(k(),$("div",za,ie(e.unref(e.name)),1))])):(k(),$("div",{key:2,class:ge(["layer-tab",{showGoBack:e.showGoBack}])},[m(u,{onUpdateNodes:e.updateNodes},{default:z(()=>[(k(),ee(Ae(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(k(),$("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],4)}var Wa=fe(Ua,[["render",Ga],["__scopeId","data-v-72dd78b1"]]);const Bi=e=>(Ut("data-v-4b4bda40"),e=e(),zt(),e),Ha=Bi(()=>w("h2",null,"Changelog",-1)),Za=Bi(()=>w("details",{open:""},[w("summary",null,[A("v0.0 Initial Commit - "),w("time",null,"2021-09-04")]),A(" This is the first release :D "),w("ul",null,[w("li",{class:"feature"},"Did everything"),w("li",{class:"fix"},"Had some fun"),w("li",{class:"breaking"},"Removed everything"),w("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ya=Y({__name:"Changelog",setup(e,{expose:t}){const n=R(!1);return t({open(){n.value=!0}}),(i,r)=>(k(),ee(mt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:z(()=>[Ha]),body:z(()=>[Za]),_:1},8,["modelValue"]))}});var Ka=fe(Ya,[["__scopeId","data-v-4b4bda40"]]),Ja=Y({props:{element:Object,display:{type:L(Object,String,Function),required:!0},style:L(Object,String,Array),classes:L(Object),direction:L(String),xoffset:L(String),yoffset:L(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Ne(e),r=R(!1),s=I(()=>(Ee(i)||r.value)&&u.value),u=yn(n),o=ze(ue(ne(()=>{const v=Ee(t);return v==null?"":Je(v)})));function c(v){const g=i;v.shiftKey&&g&&(g.value=!g.value,v.stopPropagation(),v.preventDefault())}const f=I(()=>Ee(i)&&nt[re.theme].showPin);return{Direction:W,isHovered:r,isShown:s,comp:u,elementComp:o,unref:a,togglePinned:c,showPin:f}}});const Xa={key:0,class:"material-icons pinned"};function Qa(e,t,n,i,r,s){return k(),$("div",{class:ge(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=u=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=u=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...u)=>e.togglePinned&&e.togglePinned(...u))},[ft(e.$slots,"default",{},void 0,!0),e.elementComp?(k(),ee(Ae(e.elementComp),{key:0})):B("",!0),m(tn,{name:"fade"},{default:z(()=>{var u;return[e.isShown?(k(),$("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:Le([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(u=e.unref(e.style))!=null?u:{}])},[e.showPin?(k(),$("span",Xa,"push_pin")):B("",!0),e.comp?(k(),ee(Ae(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var Ce=fe(Ja,[["render",Qa],["__scopeId","data-v-6102fa3a"]]);const Gt=e=>(Ut("data-v-4f97aa40"),e=e(),zt(),e),es={class:"info-modal-header"},ts=["src","alt"],ns={class:"info-modal-title"},is={key:0},rs={key:0},as={key:0},ss=Gt(()=>w("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),os=Gt(()=>w("br",null,null,-1)),ls=Gt(()=>w("br",null,null,-1)),us=["href"],cs=Gt(()=>w("span",{class:"material-icons info-modal-discord"},"discord",-1)),ds=Gt(()=>w("div",null,[w("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[w("span",{class:"material-icons info-modal-discord"},"discord"),A(" The Paper Pilot Community ")])],-1)),fs=Gt(()=>w("div",null,[w("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[w("span",{class:"material-icons info-modal-discord"},"discord"),A(" The Modding Tree ")])],-1)),gs=Gt(()=>w("br",null,null,-1));var ps=Y({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:s,discordName:u,discordLink:o,versionNumber:c,versionTitle:f}=ce,v=Ne(n),g=R(!1),y=I(()=>An(Z.timePlayed)),N=I(()=>ue(ne(()=>m(se,null,[Na.map(Ue)]))));t({open(){g.value=!0}});function _(){var S;(S=a(v.changelog))==null||S.open()}return(S,P)=>(k(),ee(mt,{modelValue:g.value,"onUpdate:modelValue":P[0]||(P[0]=q=>g.value=q)},{header:z(()=>[w("div",es,[a(r)?(k(),$("img",{key:0,class:"info-modal-logo",src:a(r),alt:a(i)},null,8,ts)):B("",!0),w("div",ns,[w("h2",null,ie(a(i)),1),w("h4",null,[A(" v"+ie(a(c)),1),a(f)?(k(),$("span",is,": "+ie(a(f)),1)):B("",!0)])])])]),body:z(({shown:q})=>[q?(k(),$("div",rs,[a(s)?(k(),$("div",as,"By "+ie(a(s)),1)):B("",!0),ss,os,w("div",{class:"link",onClick:_},"Changelog"),ls,w("div",null,[a(o)?(k(),$("a",{key:0,href:a(o),class:"info-modal-discord-link",target:"_blank"},[cs,A(" "+ie(a(u)),1)],8,us)):B("",!0)]),ds,fs,gs,w("div",null,"Time Played: "+ie(a(y)),1),(k(),ee(Ae(a(N))))])):B("",!0)]),_:1},8,["modelValue"]))}});var ms=fe(ps,[["__scopeId","data-v-4f97aa40"]]);const vs={class:"field"},hs={key:0,class:"field-title"},ii=Y({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var u;const n=e,i=yn(Tt(n,"title"),"span"),r=R((u=n.options.find(o=>o.value===n.modelValue))!=null?u:null);Xe(Tt(n,"modelValue"),o=>{var c;Ee(r)!==o&&(r.value=(c=n.options.find(f=>f.value===o))!=null?c:null)});function s(o){t("update:modelValue",o.value)}return(o,c)=>(k(),$("div",vs,[a(i)?(k(),$("span",hs,[(k(),ee(Ae(a(i))))])):B("",!0),m(a(ur),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const bs={class:"field"},ys=Y({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=I(()=>{var s;return ue((s=a(n.title))!=null?s:"","span")}),r=I({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,u)=>(k(),$("label",bs,[Hn(w("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=o=>Se(r)?r.value=o:null)},null,512),[[rr,a(r)]]),(k(),ee(Ae(a(i))))]))}});var dt=fe(ys,[["__scopeId","data-v-11046116"]]);const ws=["onClick"],_s=Y({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=R(!1),i=R(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,gt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(s,u)=>(k(),$("button",{onClick:en(r,["stop"]),class:ge(["feedback",{activated:n.value,left:e.left}])},[ft(s.$slots,"default",{},void 0,!0)],10,ws))}});var ji=fe(_s,[["__scopeId","data-v-01a1b95c"]]);const Ns={class:"header"},Cs=w("h2",null,"Settings",-1),ks={class:"option-tabs"},Ss={key:0},Ms={key:1};var Is=Y({__name:"Options",setup(e,{expose:t}){const n=R(!1),i=R("behaviour");function r(oe){return oe==i.value}function s(oe){i.value=oe}t({isTab:r,setTab:s,save:je,open(){n.value=!0}});const u=Object.keys(nt).map(oe=>({label:Ze(oe),value:oe})),o=I(()=>ue(ne(()=>m(se,null,[Oi.map(Ue)])))),{showTPS:c,theme:f,unthrottled:v,alignUnits:g}=Ne(re),{autosave:y,offlineProd:N}=Ne(Z),_=I({get(){return Z.devSpeed===0},set(oe){Z.devSpeed=oe?0:null}}),S=ne(()=>m("span",{class:"option-title"},[A("Unthrottled"),m("desc",null,[A("Allow the game to run as fast as possible. Not battery friendly.")])])),P=ne(()=>m("span",{class:"option-title"},[A("Offline Production"),m(Ce,{display:"Save-specific",direction:W.Right},{default:()=>[A("*")]}),m("desc",null,[A("Simulate production that occurs while the game is closed.")])])),q=ne(()=>m("span",{class:"option-title"},[A("Autosave"),m(Ce,{display:"Save-specific",direction:W.Right},{default:()=>[A("*")]}),m("desc",null,[A("Automatically save the game every second or when the game is closed.")])])),x=ne(()=>m("span",{class:"option-title"},[A("Pause game"),m(Ce,{display:"Save-specific",direction:W.Right},{default:()=>[A("*")]}),m("desc",null,[A("Stop everything from moving.")])])),D=ne(()=>m("span",{class:"option-title"},[A("Theme"),m("desc",null,[A("How the game looks.")])])),F=ne(()=>m("span",{class:"option-title"},[A("Show TPS"),m("desc",null,[A("Show TPS meter at the bottom-left corner of the page.")])])),j=ne(()=>m("span",{class:"option-title"},[A("Align modifier units"),m("desc",null,[A("Align numbers to the beginning of the unit in modifier view.")])]));return(oe,ae)=>(k(),ee(mt,{modelValue:n.value,"onUpdate:modelValue":ae[10]||(ae[10]=Q=>n.value=Q)},{header:z(()=>[w("div",Ns,[Cs,w("div",ks,[w("button",{class:ge({selected:r("behaviour")}),onClick:ae[0]||(ae[0]=Q=>s("behaviour"))},"Behaviour",2),w("button",{class:ge({selected:r("appearance")}),onClick:ae[1]||(ae[1]=Q=>s("appearance"))},"Appearance",2)])])]),body:z(()=>[r("behaviour")?(k(),$("div",Ss,[m(dt,{title:a(S),modelValue:a(v),"onUpdate:modelValue":ae[2]||(ae[2]=Q=>Se(v)?v.value=Q:null)},null,8,["title","modelValue"]),a(ce).enablePausing?(k(),ee(dt,{key:0,title:a(x),modelValue:a(_),"onUpdate:modelValue":ae[3]||(ae[3]=Q=>Se(_)?_.value=Q:null)},null,8,["title","modelValue"])):B("",!0),m(dt,{title:a(P),modelValue:a(N),"onUpdate:modelValue":ae[4]||(ae[4]=Q=>Se(N)?N.value=Q:null)},null,8,["title","modelValue"]),m(dt,{title:a(q),modelValue:a(y),"onUpdate:modelValue":ae[5]||(ae[5]=Q=>Se(y)?y.value=Q:null)},null,8,["title","modelValue"]),a(y)?B("",!0):(k(),ee(ji,{key:1,class:"button save-button",onClick:ae[6]||(ae[6]=Q=>a(je)())},{default:z(()=>[A("Manually save")]),_:1}))])):B("",!0),r("appearance")?(k(),$("div",Ms,[m(ii,{title:a(D),options:a(u),modelValue:a(f),"onUpdate:modelValue":ae[7]||(ae[7]=Q=>Se(f)?f.value=Q:null)},null,8,["title","options","modelValue"]),(k(),ee(Ae(a(o)))),m(dt,{title:a(F),modelValue:a(c),"onUpdate:modelValue":ae[8]||(ae[8]=Q=>Se(c)?c.value=Q:null)},null,8,["title","modelValue"]),m(dt,{title:a(j),modelValue:a(g),"onUpdate:modelValue":ae[9]||(ae[9]=Q=>Se(g)?g.value=Q:null)},null,8,["title","modelValue"])])):B("",!0)]),_:1},8,["modelValue"]))}});const xs=["onSubmit"],$s={class:"field"},Es={key:0,class:"field-title"},Ts=["placeholder"],Ps=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=yn(Tt(n,"title"),"span"),r=ze(null);On(()=>{var c;(c=r.value)==null||c.focus()});const s=I({get(){var c;return(c=a(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function u(){t("submit")}function o(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,f)=>(k(),$("form",{onSubmit:en(u,["prevent"])},[w("div",$s,[a(i)?(k(),$("span",Es,[(k(),ee(Ae(a(i))))])):B("",!0),e.textArea?(k(),ee(a(dr),{key:1,modelValue:a(s),"onUpdate:modelValue":f[0]||(f[0]=v=>Se(s)?s.value=v:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:o,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Hn((k(),$("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=v=>Se(s)?s.value=v:null),placeholder:e.placeholder,class:ge({fullWidth:!e.title}),onBlur:o,ref_key:"field",ref:r},null,42,Ts)),[[ar,a(s)]])])],40,xs))}});var Ui=fe(Ps,[["__scopeId","data-v-90bd4994"]]);const Fs={key:0},Ds=["onClick","disabled"],Os={key:0},As=["onClick"],Vs=Y({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Ne(e),r=R(!1);Xe(r,o=>{t("confirmingChanged",o)});function s(){if(a(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function u(){r.value=!1}return(o,c)=>(k(),$("span",{class:ge(["container",{confirming:r.value}])},[r.value?(k(),$("span",Fs,"Are you sure?")):B("",!0),w("button",{onClick:en(s,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(k(),$("span",Os,"Yes")):ft(o.$slots,"default",{key:1},void 0,!0)],8,Ds),r.value?(k(),$("button",{key:1,class:"button",onClick:en(u,["stop"])},"No",8,As)):B("",!0)],2))}});var qs=fe(Vs,[["__scopeId","data-v-2f8ef34c"]]);const vt=e=>(Ut("data-v-32313015"),e=e(),zt(),e),Ls=vt(()=>w("div",{class:"handle material-icons"},"drag_handle",-1)),Rs={key:0,class:"actions"},Bs=vt(()=>w("span",{class:"material-icons"},"content_paste",-1)),js=vt(()=>w("span",{class:"material-icons"},"content_copy",-1)),Us=vt(()=>w("span",{class:"material-icons"},"edit",-1)),zs=vt(()=>w("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Gs={key:1,class:"actions"},Ws=vt(()=>w("span",{class:"material-icons"},"check",-1)),Hs=vt(()=>w("span",{class:"material-icons"},"close",-1)),Zs={key:2,class:"details"},Ys={class:"save-version"},Ks=vt(()=>w("br",null,null,-1)),Js={key:0},Xs={key:3,class:"details"},Qs={key:4,class:"details error"},eo=vt(()=>w("br",null,null,-1)),to=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"}),s=R(!1),u=R(!1),o=R("");Xe(s,()=>{var g;return o.value=(g=i.value.name)!=null?g:""});const c=I(()=>i.value!=null&&i.value.id===Z.id),f=I(()=>{var g;return c.value?Z.time:(g=i.value!=null&&i.value.time)!=null?g:0});function v(){t("editName",o.value),s.value=!1}return(g,y)=>(k(),$("div",{class:ge(["save",{active:a(c)}])},[Ls,s.value?(k(),$("div",Gs,[w("button",{onClick:v,class:"button"},[m(Ce,{display:"Save",direction:a(W).Left,class:"info"},{default:z(()=>[Ws]),_:1},8,["direction"])]),w("button",{onClick:y[5]||(y[5]=N=>s.value=!s.value),class:"button"},[m(Ce,{display:"Cancel",direction:a(W).Left,class:"info"},{default:z(()=>[Hs]),_:1},8,["direction"])])])):(k(),$("div",Rs,[a(i).error==null&&!u.value?(k(),ee(ji,{key:0,onClick:y[0]||(y[0]=N=>t("export")),class:"button",left:""},{default:z(()=>[m(Ce,{display:"Export",direction:a(W).Left,class:"info"},{default:z(()=>[Bs]),_:1},8,["direction"])]),_:1})):B("",!0),a(i).error==null&&!u.value?(k(),$("button",{key:1,onClick:y[1]||(y[1]=N=>t("duplicate")),class:"button"},[m(Ce,{display:"Duplicate",direction:a(W).Left,class:"info"},{default:z(()=>[js]),_:1},8,["direction"])])):B("",!0),a(i).error==null&&!u.value?(k(),$("button",{key:2,onClick:y[2]||(y[2]=N=>s.value=!s.value),class:"button"},[m(Ce,{display:"Edit Name",direction:a(W).Left,class:"info"},{default:z(()=>[Us]),_:1},8,["direction"])])):B("",!0),m(qs,{disabled:a(c),onClick:y[3]||(y[3]=N=>t("delete")),onConfirmingChanged:y[4]||(y[4]=N=>u.value=N)},{default:z(()=>[m(Ce,{display:"Delete",direction:a(W).Left,class:"info"},{default:z(()=>[zs]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!s.value?(k(),$("div",Zs,[w("button",{class:"button open",onClick:y[6]||(y[6]=N=>t("open"))},[w("h3",null,ie(a(i).name),1)]),w("span",Ys,"v"+ie(a(i).modVersion),1),Ks,a(f)?(k(),$("div",Js,"Last played "+ie(a(r).format(a(f))),1)):B("",!0)])):a(i).error==null&&s.value?(k(),$("div",Xs,[m(Ui,{modelValue:o.value,"onUpdate:modelValue":y[7]||(y[7]=N=>o.value=N),class:"editname",onSubmit:v},null,8,["modelValue"])])):(k(),$("div",Qs,[A(" Error: Failed to load save with id "+ie(a(i).id),1),eo,A(ie(a(i).error),1)]))],2))}});var no=fe(to,[["__scopeId","data-v-32313015"]]);const ri=e=>(Ut("data-v-2a4275be"),e=e(),zt(),e),io=ri(()=>w("h2",null,"Saves Manager",-1)),ro={class:"modal-footer"},ao={class:"field"},so=ri(()=>w("span",{class:"field-title"},"Create Save",-1)),oo={class:"field-buttons"},lo={class:"footer"},uo=ri(()=>w("div",{style:{"flex-grow":"1"}},null,-1)),co=Y({__name:"SavesManager",setup(e,{expose:t}){const n=R(!1),i=R(null);t({open(){n.value=!0}});const r=R(!1),s=R(""),u=R(null);Xe(s,x=>{x?gt(()=>{try{if(x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=St.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x),r.value=!0;return}const D=JSON.parse(x);if(typeof D!="object"){r.value=!0;return}const F=In();D.id=F,je(D),s.value="",r.value=!1,re.saves.push(F)}catch{r.value=!0}}):r.value=!1});let o={},c=R(Object.keys(o).reduce((x,D)=>(x.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:o[D]}),x),[]));const f=Zn({});function v(x){if(f[x]==null){let D=localStorage.getItem(x);if(D==null)f[x]={error:"Save doesn't exist in localStorage",id:x};else if(D==="dW5kZWZpbmVk")f[x]={error:"Save is undefined",id:x};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=St.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,f[x]={error:"Unable to determine preset encoding",id:x},f[x];f[x]={...JSON.parse(D),id:x}}catch(F){f[x]={error:F,id:x},console.warn(`SavesManager: Failed to load info about save with id ${x}: +${F} +${D}`)}}return f[x]}Xe(n,x=>{x&&Object.keys(f).forEach(D=>delete f[D])});const g=I(()=>re.saves.reduce((x,D)=>(x[D]=v(D),x),{}));function y(x){let D;switch(Z.id===x?D=Fi(Z):D=JSON.stringify(g.value[x]),ce.exportEncoding){default:console.warn(`Unknown save encoding: ${ce.exportEncoding}. Defaulting to lz`);case"lz":D=St.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const F=document.createElement("textarea");F.value=D,document.body.appendChild(F),F.select(),F.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(F)}function N(x){Z.id===x&&je();const D={...g.value[x],id:In()};je(D),re.saves.push(D.id)}function _(x){re.saves=re.saves.filter(D=>D!==x),localStorage.removeItem(x),f[x]=void 0}function S(x){g.value[Z.id].time=Z.time,je(),f[Z.id]=void 0,Vt(g.value[x]),f[x]=void 0}function P(x){if(u.value=x,gt(()=>{u.value=null}),x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=St.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x);return}const D=JSON.parse(x);D.id=In(),je(D),re.saves.push(D.id),S(D.id)}function q(x,D){const F=g.value[x];F!=null&&(F.name=D,Z.id===x?(Z.name=D,je()):(je(F),f[x]=void 0))}return(x,D)=>(k(),ee(mt,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=F=>n.value=F),ref_key:"modal",ref:i},{header:z(()=>[io]),body:z(({shown:F})=>[F?(k(),ee(a(cr),{key:0,list:a(re).saves,handle:".handle",itemKey:j=>j},{item:z(({element:j})=>[m(no,{save:a(g)[j],onOpen:oe=>S(j),onExport:oe=>y(j),onEditName:oe=>q(j,oe),onDuplicate:oe=>N(j),onDelete:oe=>_(j)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:z(()=>[w("div",ro,[m(Ui,{modelValue:s.value,"onUpdate:modelValue":D[0]||(D[0]=F=>s.value=F),title:"Import Save",placeholder:"Paste your save here!",class:ge({importingFailed:r.value})},null,8,["modelValue","class"]),w("div",ao,[so,w("div",oo,[w("button",{class:"button",onClick:D[1]||(D[1]=F=>S(a(Qt)().id))},"New Game"),Object.keys(a(c)).length>0?(k(),ee(ii,{key:0,options:a(c),modelValue:u.value,"onUpdate:modelValue":D[2]||(D[2]=F=>P(F)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),w("div",lo,[uo,w("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=F=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zi=fe(co,[["__scopeId","data-v-2a4275be"]]);const Ge=e=>(Ut("data-v-318a1c31"),e=e(),zt(),e),fo=["src","alt"],go={key:1,class:"title"},po=Ge(()=>w("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),mo={class:"discord"},vo={class:"discord-links"},ho={key:0},bo=["href"],yo=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),wo=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),_o={href:"https://forums.moddingtree.com/",target:"_blank"},No=Ge(()=>w("span",{class:"material-icons"},"forum",-1)),Co=Ge(()=>w("span",{class:"material-icons"},"info",-1)),ko=Ge(()=>w("span",{class:"material-icons"},"library_books",-1)),So=Ge(()=>w("span",{class:"material-icons"},"settings",-1)),Mo=Ge(()=>w("span",{class:"material-icons"},"library_books",-1)),Io=Ge(()=>w("span",{class:"material-icons"},"settings",-1)),xo=Ge(()=>w("span",{class:"material-icons"},"info",-1)),$o={href:"https://forums.moddingtree.com/",target:"_blank"},Eo=Ge(()=>w("span",{class:"material-icons"},"forum",-1)),To={class:"discord"},Po={class:"discord-links"},Fo={key:0},Do=["href"],Oo=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Ao=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Vo=Y({__name:"Nav",setup(e){const t=R(null),n=R(null),i=R(null),r=R(null),{useHeader:s,banner:u,title:o,discordName:c,discordLink:f,versionNumber:v}=ce;function g(){window.open(f,"mywindow")}return(y,N)=>(k(),$(se,null,[a(s)?(k(),$("div",pt({key:0,class:"nav"},y.$attrs),[a(u)?(k(),$("img",{key:0,src:a(u),class:"banner",alt:a(o)},null,8,fo)):(k(),$("div",go,ie(a(o)),1)),w("div",{onClick:N[0]||(N[0]=_=>{var S;return(S=r.value)==null?void 0:S.open()}),class:"version-container"},[m(Ce,{display:"Changelog",direction:a(W).Down,class:"version"},{default:z(()=>[w("span",null,"v"+ie(a(v)),1)]),_:1},8,["direction"])]),po,w("div",mo,[w("span",{onClick:g,class:"material-icons"},"discord"),w("ul",vo,[a(f)?(k(),$("li",ho,[w("a",{href:a(f),target:"_blank"},ie(a(c)),9,bo)])):B("",!0),yo,wo])]),w("div",null,[w("a",_o,[m(Ce,{display:"Forums",direction:a(W).Down,yoffset:"5px"},{default:z(()=>[No]),_:1},8,["direction"])])]),w("div",{onClick:N[1]||(N[1]=_=>{var S;return(S=t.value)==null?void 0:S.open()})},[m(Ce,{display:"Info",direction:a(W).Down,class:"info"},{default:z(()=>[Co]),_:1},8,["direction"])]),w("div",{onClick:N[2]||(N[2]=_=>{var S;return(S=n.value)==null?void 0:S.open()})},[m(Ce,{display:"Saves",direction:a(W).Down,xoffset:"-20px"},{default:z(()=>[ko]),_:1},8,["direction"])]),w("div",{onClick:N[3]||(N[3]=_=>{var S;return(S=i.value)==null?void 0:S.open()})},[m(Ce,{display:"Settings",direction:a(W).Down,xoffset:"-66px"},{default:z(()=>[So]),_:1},8,["direction"])])],16)):(k(),$("div",pt({key:1,class:"overlay-nav"},y.$attrs),[w("div",{onClick:N[4]||(N[4]=_=>{var S;return(S=r.value)==null?void 0:S.open()}),class:"version-container"},[m(Ce,{display:"Changelog",direction:a(W).Right,xoffset:"25%",class:"version"},{default:z(()=>[w("span",null,"v"+ie(a(v)),1)]),_:1},8,["direction"])]),w("div",{onClick:N[5]||(N[5]=_=>{var S;return(S=n.value)==null?void 0:S.open()})},[m(Ce,{display:"Saves",direction:a(W).Right},{default:z(()=>[Mo]),_:1},8,["direction"])]),w("div",{onClick:N[6]||(N[6]=_=>{var S;return(S=i.value)==null?void 0:S.open()})},[m(Ce,{display:"Settings",direction:a(W).Right},{default:z(()=>[Io]),_:1},8,["direction"])]),w("div",{onClick:N[7]||(N[7]=_=>{var S;return(S=t.value)==null?void 0:S.open()})},[m(Ce,{display:"Info",direction:a(W).Right},{default:z(()=>[xo]),_:1},8,["direction"])]),w("div",null,[w("a",$o,[m(Ce,{display:"Forums",direction:a(W).Right,xoffset:"7px"},{default:z(()=>[Eo]),_:1},8,["direction"])])]),w("div",To,[w("span",{onClick:g,class:"material-icons"},"discord"),w("ul",Po,[a(f)?(k(),$("li",Fo,[w("a",{href:a(f),target:"_blank"},ie(a(c)),9,Do)])):B("",!0),Oo,Ao])])],16)),m(ms,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),m(zi,{ref_key:"savesManager",ref:n},null,512),m(Is,{ref_key:"options",ref:i},null,512),m(Ka,{ref_key:"changelog",ref:r},null,512)],64))}});var Gi=fe(Vo,[["__scopeId","data-v-318a1c31"]]);const qo={class:"inner-tab"},Lo=Y({__name:"Game",setup(e){const t=Tt(Z,"tabs"),n=I(()=>Object.keys(ve)),i=ce.useHeader;function r(s){const{display:u,minimized:o,name:c,color:f,minimizable:v,nodes:g,minimizedDisplay:y}=s;return{display:u,minimized:o,name:c,color:f,minimizable:v,nodes:g,minimizedDisplay:y}}return(s,u)=>(k(),$("div",{class:ge(["tabs-container",{useHeader:a(i)}])},[(k(!0),$(se,null,nn(a(t),(o,c)=>{var f,v;return k(),$("div",{key:c,class:ge(["tab",a((f=a(ve)[o])==null?void 0:f.classes)]),style:Le(a((v=a(ve)[o])==null?void 0:v.style))},[c===0&&!a(i)?(k(),ee(Gi,{key:0})):B("",!0),w("div",qo,[a(n).includes(o)?(k(),ee(Wa,pt({key:0},r(a(ve)[o]),{index:c,onSetMinimized:g=>a(ve)[o].minimized.value=g}),null,16,["index","onSetMinimized"])):(k(),ee(Ae(o),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Ro=fe(Lo,[["__scopeId","data-v-dcd207b4"]]);const Bo=Y({__name:"Sticky",setup(e){const t=R("0"),n=new ResizeObserver(r),i=ze(null);function r(){let s=i.value;if(s==null)return;let u=0;for(;s.previousSibling;){const o=s.previousSibling;o.dataset&&"vSticky"in o.dataset&&(u+=o.offsetHeight),s=o}t.value=u+"px"}return gt(r),document.fonts.ready.then(r),On(()=>{var u;const s=(u=i.value)==null?void 0:u.parentElement;s&&n.observe(s)}),(s,u)=>(k(),$("div",{class:"sticky",style:Le({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[ft(s.$slots,"default",{},void 0,!0)],4))}});var Fn=fe(Bo,[["__scopeId","data-v-cccac690"]]);const jo=["x1","y1","x2","y2"],Uo=Y({__name:"BoardLink",props:{link:null},setup(e){const n=Ne(e),i=I(()=>{const s=n.link.value.startNode.position;return n.link.value.offsetStart&&(s.x+=a(n.link.value.offsetStart).x,s.y+=a(n.link.value.offsetStart).y),s}),r=I(()=>{const s=n.link.value.endNode.position;return n.link.value.offsetEnd&&(s.x+=a(n.link.value.offsetEnd).x,s.y+=a(n.link.value.offsetEnd).y),s});return(s,u)=>(k(),$("line",pt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,jo))}});var zo=fe(Uo,[["__scopeId","data-v-57c4970a"]]);const Go={key:0},Wo=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Ho=["fill","stroke-width","stroke"],Zo=["fill"],Yo=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=I(()=>le(i.nodeType.value.size,a(i.node))),s=I(()=>{var v;return(v=le(i.nodeType.value.outlineColor,a(i.node)))!=null?v:nt[re.theme].variables["--outline"]}),u=I(()=>{var v;return(v=le(i.nodeType.value.titleColor,a(i.node)))!=null?v:nt[re.theme].variables["--foreground"]}),o=I(()=>le(i.nodeType.value.actionDistance,a(i.node)));function c(v,g){t("clickAction",g.id),v.preventDefault(),v.stopPropagation()}function f(v,g){var y;((y=a(i.selectedAction))==null?void 0:y.id)===g.id&&(v.preventDefault(),v.stopPropagation())}return(v,g)=>(k(),ee(tn,{name:"actions",appear:""},{default:z(()=>[e.isSelected&&e.actions?(k(),$("g",Go,[(k(!0),$(se,null,nn(e.actions,(y,N)=>{var _,S;return k(),$("g",{key:y.id,class:ge(["action",{selected:((_=e.selectedAction)==null?void 0:_.id)===y.id}]),transform:`translate( + ${(-a(r)-30)*Math.sin(((e.actions.length-1)/2-N)*a(o))}, + ${(a(r)+30)*Math.cos(((e.actions.length-1)/2-N)*a(o))} + )`,onMousedown:P=>c(P,y),onTouchstart:P=>c(P,y),onMouseup:P=>f(P,y),onTouchend:en(P=>f(P,y),["stop"])},[w("circle",{fill:a(le)(y.fillColor,e.node),r:"20","stroke-width":((S=e.selectedAction)==null?void 0:S.id)===y.id?4:0,stroke:a(s)},null,8,Ho),w("text",{fill:a(u),class:"material-icons"},ie(a(le)(y.icon,e.node)),9,Zo)],42,Wo)}),128))])):B("",!0)]),_:1}))}});var Ko=fe(Yo,[["__scopeId","data-v-9efb2a56"]]);const Jo=["transform"],Xo={key:0},Qo=["r","fill","stroke"],el=["r","fill","stroke"],tl=["r","fill"],nl=["r","stroke-dasharray","stroke-dashoffset","stroke"],il={key:1,transform:"rotate(45, 0, 0)"},rl=["width","height","transform","fill","stroke"],al=["width","height","transform","fill","stroke"],sl=["width","height","transform","fill"],ol=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],ll=["fill","y"],ul=["fill"],cl={key:0},dl=["fill","y"],fl=["fill","y"],gl=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),s=I(()=>a(r.selectedNode)===a(r.node)),u=I(()=>le(r.nodeType.value.draggable,a(r.node)));Xe(u,J=>{const pe=a(r.node);a(r.dragging)===pe&&!J&&t("endDragging",pe)});const o=I(()=>{var pe;const J=a(r.node);return(pe=le(r.nodeType.value.actions,J))==null?void 0:pe.filter(Ie=>Qe(le(Ie.visibility,J)))}),c=I(()=>{var pe;const J=a(r.node);if(le(r.nodeType.value.draggable,J)&&((pe=a(r.dragging))==null?void 0:pe.id)===J.id&&a(r.dragged)!=null){const{x:Ie,y:Oe}=a(r.dragged);return{x:J.position.x+Math.round(Ie/25)*25,y:J.position.y+Math.round(Oe/25)*25}}return J.position}),f=I(()=>le(r.nodeType.value.shape,a(r.node))),v=I(()=>le(r.nodeType.value.title,a(r.node))),g=I(()=>le(r.nodeType.value.subtitle,a(r.node))),y=I(()=>{var J;return(J=s.value?a(r.selectedAction)&&le(a(r.selectedAction).tooltip,a(r.node)):null)!=null?J:le(r.nodeType.value.label,a(r.node))}),N=I(()=>{var J,pe;return le((pe=(J=a(r.selectedAction))==null?void 0:J.confirmationLabel)!=null?pe:{text:"Tap again to confirm"},a(r.node))}),_=I(()=>le(r.nodeType.value.size,a(r.node))),S=I(()=>{var J;return(J=le(r.nodeType.value.progress,a(r.node)))!=null?J:0}),P=I(()=>nt[re.theme].variables["--background"]),q=I(()=>{var J;return(J=le(r.nodeType.value.outlineColor,a(r.node)))!=null?J:nt[re.theme].variables["--outline"]}),x=I(()=>{var J;return(J=le(r.nodeType.value.fillColor,a(r.node)))!=null?J:nt[re.theme].variables["--raised-background"]}),D=I(()=>le(r.nodeType.value.progressColor,a(r.node))),F=I(()=>{var J;return(J=le(r.nodeType.value.titleColor,a(r.node)))!=null?J:nt[re.theme].variables["--foreground"]}),j=I(()=>le(r.nodeType.value.progressDisplay,a(r.node))),oe=I(()=>r.dragging.value!=null&&a(r.hasDragged)&&le(r.nodeType.value.canAccept,a(r.node),r.dragging.value)),ae=I(()=>le(r.nodeType.value.style,a(r.node))),Q=I(()=>le(r.nodeType.value.classes,a(r.node)));function Pe(J){t("mouseDown",J,r.node.value,u.value)}function K(J){var pe,Ie,Oe;(pe=r.hasDragged)!=null&&pe.value||(t("endDragging",r.node.value),(Oe=(Ie=r.nodeType.value).onClick)==null||Oe.call(Ie,r.node.value),J.stopPropagation())}return(J,pe)=>{var Ie,Oe,H;return k(),$("g",{class:ge(["boardnode",{[e.node.type]:!0,isSelected:a(s),isDraggable:a(u),...a(Q)}]),style:Le([{opacity:((Ie=e.dragging)==null?void 0:Ie.id)===e.node.id&&e.hasDragged?.5:1},(Oe=a(ae))!=null?Oe:[]]),transform:`translate(${a(c).x},${a(c).y})${a(s)?" scale(1.2)":""}`},[m(Ko,{actions:(H=a(o))!=null?H:[],"is-selected":a(s),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:pe[0]||(pe[0]=U=>t("clickAction",U))},null,8,["actions","is-selected","node","node-type","selected-action"]),w("g",{class:"node-container",onMousedown:Pe,onTouchstartPassive:Pe,onMouseup:K,onTouchendPassive:K},[a(f)===a(Be).Circle?(k(),$("g",Xo,[a(oe)?(k(),$("circle",{key:0,class:"receiver",r:a(_)+8,fill:a(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Qo)):B("",!0),w("circle",{class:"body",r:a(_),fill:a(x),stroke:a(q),"stroke-width":4},null,8,el),a(j)===a(Lt).Fill?(k(),$("circle",{key:1,class:"progress progressFill",r:Math.max(a(_)*a(S)-2,0),fill:a(D)},null,8,tl)):(k(),$("circle",{key:2,r:a(_)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(a(_)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(a(_)+4.5)*2*Math.PI-a(S)*(a(_)+4.5)*2*Math.PI,stroke:a(D)},null,8,nl))])):a(f)===a(Be).Diamond?(k(),$("g",il,[a(oe)?(k(),$("rect",{key:0,class:"receiver",width:a(_)*a(i)+16,height:a(_)*a(i)+16,transform:`translate(${-(a(_)*a(i)+16)/2}, ${-(a(_)*a(i)+16)/2})`,fill:a(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,rl)):B("",!0),w("rect",{class:"body",width:a(_)*a(i),height:a(_)*a(i),transform:`translate(${-a(_)*a(i)/2}, ${-a(_)*a(i)/2})`,fill:a(x),stroke:a(q),"stroke-width":4},null,8,al),a(j)===a(Lt).Fill?(k(),$("rect",{key:1,class:"progress progressFill",width:Math.max(a(_)*a(i)*a(S)-2,0),height:Math.max(a(_)*a(i)*a(S)-2,0),transform:`translate(${-Math.max(a(_)*a(i)*a(S)-2,0)/2}, ${-Math.max(a(_)*a(i)*a(S)-2,0)/2})`,fill:a(D)},null,8,sl)):(k(),$("rect",{key:2,class:"progress progressDiamond",width:a(_)*a(i)+9,height:a(_)*a(i)+9,transform:`translate(${-(a(_)*a(i)+9)/2}, ${-(a(_)*a(i)+9)/2})`,fill:"transparent","stroke-dasharray":(a(_)*a(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(a(_)*a(i)+9)*4-a(S)*(a(_)*a(i)+9)*4,stroke:a(D)},null,8,ol))])):B("",!0),w("text",{fill:a(F),class:"node-title",y:a(g)?10:0},ie(a(v)),9,ll),a(g)?(k(),$("text",{key:2,fill:a(F),class:"node-subtitle",y:"-15"},ie(a(g)),9,ul)):B("",!0)],32),m(tn,{name:"fade",appear:""},{default:z(()=>{var U;return[a(y)?(k(),$("g",cl,[w("text",{fill:(U=a(y).color)!=null?U:a(F),class:ge(["node-title",{pulsing:a(y).pulsing}]),y:-a(_)-20},ie(a(y).text),11,dl)])):B("",!0)]}),_:1}),m(tn,{name:"fade",appear:""},{default:z(()=>{var U;return[a(s)&&e.selectedAction?(k(),$("text",{key:0,fill:(U=a(N).color)!=null?U:a(F),class:ge(["node-title",{pulsing:a(N).pulsing}]),y:a(_)+75},ie(a(N).text),11,fl)):B("",!0)]}),_:1})],14,Jo)}}});var pl=fe(gl,[["__scopeId","data-v-4654be02"]]);const ml={class:"stage",width:"100%",height:"100%"},vl={class:"g1"},hl=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=R({x:0,y:0}),r=R({x:0,y:0}),s=R(!1),u=R(null),o=I(()=>{const N=n.nodes.value.slice();if(n.draggingNode.value){const _=N.splice(N.indexOf(n.draggingNode.value),1)[0];N.push(_)}return N});Ke(()=>{const N=n.draggingNode.value;if(N==null)return null;const _={x:N.position.x+r.value.x,y:N.position.y+r.value.y};let S=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((P,q)=>{if(q.id===N.id)return P;const x=n.types.value[q.type];if(!le(x.canAccept,q,N))return P;const F=Math.pow(_.x-q.position.x,2)+Math.pow(_.y-q.position.y,2);let j=le(x.size,q);return F>S||F>j*j?P:(S=F,q)},null))});function c(N){N.setTransformOrigin(null),N.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function f(N,_=null,S=!1){if(n.draggingNode.value==null){N.preventDefault(),N.stopPropagation();let P,q;if("touches"in N)if(N.touches.length===1)P=N.touches[0].clientX,q=N.touches[0].clientY;else return;else P=N.clientX,q=N.clientY;i.value={x:P,y:q},r.value={x:0,y:0},s.value=!1,S&&n.setDraggingNode.value(_)}_!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(N){const{x:_,y:S,scale:P}=u.value.panZoomInstance.getTransform();let q,x;if("touches"in N)if(N.touches.length===1)q=N.touches[0].clientX,x=N.touches[0].clientY;else{g(n.draggingNode.value),n.mousePosition.value=null;return}else q=N.clientX,x=N.clientY;n.mousePosition.value={x:(q-_)/P,y:(x-S)/P},r.value={x:r.value.x+(q-i.value.x)/P,y:r.value.y+(x-i.value.y)/P},i.value={x:q,y:x},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(s.value=!0),n.draggingNode.value!=null&&(N.preventDefault(),N.stopPropagation())}function g(N,_=!1){var S,P;if(n.draggingNode.value!=null&&n.draggingNode.value===N){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 q=n.nodes.value;q.push(q.splice(q.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((P=(S=n.types.value[n.receivingNode.value.type]).onDrop)==null||P.call(S,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!s.value&&!_&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function y(N,_){n.state.value.selectedAction===_?a(n.selectedAction).onClick(a(n.selectedNode)):n.state.value={...n.state.value,selectedAction:_}}return(N,_)=>{const S=Et("panZoom");return a(Qe)(e.visibility)?(k(),ee(S,{key:0,style:Le([{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:u,onInit:c,onMousemove:v,onTouchmove:v,onMousedown:_[0]||(_[0]=P=>f(P)),onTouchstart:_[1]||(_[1]=P=>f(P)),onMouseup:_[2]||(_[2]=()=>g(a(e.draggingNode))),onTouchendPassive:_[3]||(_[3]=()=>g(a(e.draggingNode))),onMouseleave:_[4]||(_[4]=()=>g(a(e.draggingNode),!0))},{default:z(()=>[(k(),$("svg",ml,[w("g",vl,[m(oi,{name:"link",appear:""},{default:z(()=>[(k(!0),$(se,null,nn(a(e.links)||[],P=>(k(),$("g",{key:`${P.startNode.id}-${P.endNode.id}`},[m(zo,{link:P},null,8,["link"])]))),128))]),_:1}),m(oi,{name:"grow",duration:500,appear:""},{default:z(()=>[(k(!0),$(se,null,nn(a(o),P=>{var q;return k(),$("g",{key:P.id,style:{"transition-duration":"0s"}},[m(pl,{node:P,nodeType:e.types[P.type],dragging:a(e.draggingNode),dragged:a(e.draggingNode)===P?r.value:void 0,hasDragged:s.value,receivingNode:((q=a(e.receivingNode))==null?void 0:q.id)===P.id,selectedNode:a(e.selectedNode),selectedAction:a(e.selectedAction),onMouseDown:f,onEndDragging:g,onClickAction:x=>y(P,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});Ve.on("setupVue",e=>fr.install(e));const Wi=Symbol("Board");var Lt=(e=>(e.Outline="Outline",e.Fill="Fill",e))(Lt||{}),Be=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Be||{});function bl(e){const t=ct({nodes:[],selectedNode:null,selectedAction:null},!1);return et(n=>{const i=e.call(n,n);i.id=Vn("board-"),i.type=Wi,i[lt]=hl,i.state?(Li(t),O(i,"state")):(t[bn]={nodes:i.startNodes().map((o,c)=>(o.id=c,o)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=I(()=>a(u.state).nodes),i.selectedNode=I({get(){return u.nodes.value.find(o=>o.id===a(u.state).selectedNode)||null},set(o){var c,f;Se(u.state)?u.state.value={...u.state.value,selectedNode:(c=o==null?void 0:o.id)!=null?c:null}:u.state.selectedNode=(f=o==null?void 0:o.id)!=null?f:null}}),i.selectedAction=I({get(){const o=u.selectedNode.value;if(o==null)return null;const c=u.types[o.type];return c.actions==null?null:c.actions.find(f=>f.id===a(u.state).selectedAction)||null},set(o){var c,f;Se(u.state)?u.state.value={...u.state.value,selectedAction:(c=o==null?void 0:o.id)!=null?c:null}:u.state.selectedAction=(f=o==null?void 0:o.id)!=null?f:null}}),i.mousePosition=R(null),i.links?O(i,"links"):i.links=I(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?le(u.selectedAction.value.links,u.selectedNode.value):null),i.draggingNode=R(null),i.receivingNode=R(null),O(i,"visibility"),de(i,"visibility",Me.Visible),O(i,"width"),de(i,"width","100%"),O(i,"height"),de(i,"height","100%"),O(i,"classes"),O(i,"style");for(const o in i.types){const c=i.types[o];if(O(c,"title"),O(c,"subtitle"),O(c,"label"),O(c,"size"),de(c,"size",50),O(c,"style"),O(c,"classes"),O(c,"draggable"),de(c,"draggable",!1),O(c,"shape"),de(c,"shape","Circle"),O(c,"canAccept"),de(c,"canAccept",!1),O(c,"progress"),O(c,"progressDisplay"),de(c,"progressDisplay","Fill"),O(c,"progressColor"),de(c,"progressColor","none"),O(c,"fillColor"),O(c,"outlineColor"),O(c,"titleColor"),O(c,"actionDistance"),de(c,"actionDistance",Math.PI/6),c.nodes=I(()=>a(u.state).nodes.filter(f=>f.type===o)),de(c,"onClick",function(f){a(u.state).selectedNode=f.id}),c.actions)for(const f of c.actions)O(f,"visibility"),de(f,"visibility",Me.Visible),O(f,"icon"),O(f,"fillColor"),O(f,"tooltip"),O(f,"confirmationLabel"),de(f,"confirmationLabel",{text:"Tap again to confirm"}),O(f,"links")}function r(o){i.draggingNode.value=o}function s(o){i.receivingNode.value=o}i.placeInAvailableSpace=function(o,c=100,f=W.Right){const v=u.nodes.value.slice().filter(g=>g===o||(f===W.Down||f===W.Up)&&Math.abs(g.position.x-o.position.x)>c||(f===W.Left||f===W.Right)&&Math.abs(g.position.y-o.position.y)>c?!1:!(f===W.Right&&g.position.xo.position.x+c||f===W.Up&&g.position.y>o.position.y+c||f===W.Down&&g.position.yg.position.x-y.position.x:f===W.Left?(g,y)=>y.position.x-g.position.x:f===W.Up?(g,y)=>y.position.y-g.position.y:(g,y)=>g.position.y-y.position.y);for(let g=0;g0&&N>c)break}},i[it]=function(){const{nodes:o,types:c,state:f,visibility:v,width:g,height:y,style:N,classes:_,links:S,selectedAction:P,selectedNode:q,mousePosition:x,draggingNode:D,receivingNode:F}=this;return{nodes:o,types:c,state:f,visibility:v,width:g,height:y,style:a(N),classes:_,links:S,selectedAction:P,selectedNode:q,mousePosition:x,draggingNode:D,receivingNode:F,setDraggingNode:r,setReceivingNode:s}};const u=i;return u})}function le(e,t,...n){return En(e)?e(t,...n):a(e)}function Un(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const fn={};Ve.on("addLayer",e=>{const t=pa(e,Wi);fn[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(s=>{var u;return(u=r.update)==null?void 0:u.call(r,s,n)}))})})});Ve.on("removeLayer",e=>{var t;(t=fn[e.id])==null||t.call(fn),fn[e.id]=void 0});function Hi(e,t="points",n=0,i=void 0){const r=Se(e)?e:ct(e);if(r.displayName=t,r.precision=n,r.small=i,!Se(e)){const s=r[ot];s.displayName=t,s.precision=n,s.small=i}return r}new l("10^^8");new l("1e100");function vi(e,t){const n=t!=null?t:e.value;return l.eq(e.precision,0)?tt(e.small?n:l.floor(n)):Rt(n,e.precision,e.small)}Ve.on("setupVue",e=>e.use(gr));function yl(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 wl=Y({props:{visibility:{type:L(Number,Boolean),required:!0},display:{type:L(Object,String,Function),required:!0},style:L(String,Object,Array),classes:L(Object),glowColor:L(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Ne(e),s=Vi(n),u=I(()=>{const c=Ee(i);return c==null||c===""?{}:a(r)?yl(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function o(){t("selectTab")}return{selectTab:o,component:s,glowColorStyle:u,unref:a,Visibility:Me,isVisible:Qe,isHidden:rn}}});function _l(e,t,n,i,r,s){var u;return e.isVisible(e.visibility)?(k(),$("button",{key:0,onClick:t[0]||(t[0]=(...o)=>e.selectTab&&e.selectTab(...o)),class:ge(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(u=e.unref(e.style))!=null?u:{}])},[(k(),ee(Ae(e.component)))],6)):B("",!0)}var Zi=fe(wl,[["render",_l],["__scopeId","data-v-21427abb"]]);const Nl=Y({props:{visibility:{type:L(Number,Boolean),required:!0},activeTab:{type:L(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:L(Object),required:!0},style:L(String,Object,Array),classes:L(Object),buttonContainerStyle:L(String,Object,Array),buttonContainerClasses:L(Object)},components:{Sticky:Fn,TabButton:Zi},setup(e){const{activeTab:t}=Ne(e),n=I(()=>nt[re.theme].floatingTabs),i=ze("");Ke(()=>{const o=Ee(t);if(o==null){i.value="";return}if(ut(o)){i.value=ue(o);return}i.value=ue(a(o.display))});const r=I(()=>{const o=Ee(t);return ut(o)||!o?void 0:a(o.classes)}),s=I(()=>{const o=Ee(t);return ut(o)||!o?void 0:a(o.style)});function u(o){const{display:c,style:f,classes:v,glowColor:g,visibility:y}=o;return{display:c,style:a(f),classes:v,glowColor:g,visibility:y}}return{floating:n,tabClasses:r,tabStyle:s,Visibility:Me,component:i,gatherButtonProps:u,unref:a,isVisible:Qe,isHidden:rn}}});function Cl(e,t,n,i,r,s){var c,f;const u=Et("TabButton"),o=Et("Sticky");return e.isVisible(e.visibility)?(k(),$("div",{key:0,class:ge(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[m(o,{class:ge(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Le(e.unref(e.buttonContainerStyle))},{default:z(()=>[w("div",{class:ge(["tab-buttons",{floating:e.floating}])},[(k(!0),$(se,null,nn(e.unref(e.tabs),(v,g)=>(k(),ee(u,pt({onSelectTab:y=>e.selected.value=g,floating:e.floating,key:g,active:e.unref(v.tab)===e.unref(e.activeTab)},e.gatherButtonProps(v)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(k(),ee(Ae(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var kl=fe(Nl,[["render",Cl],["__scopeId","data-v-58dbf83a"]]);const Sl=Symbol("TabButton"),Ml=Symbol("TabFamily");function Il(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=ct(Object.keys(e)[0],!1);return et(i=>{var u;const r=(u=t==null?void 0:t.call(i,i))!=null?u:{};r.id=Vn("tabFamily-"),r.type=Ml,r[lt]=kl,r.tabs=Object.keys(e).reduce((o,c)=>{const f=e[c]();return f.type=Sl,f[lt]=Zi,O(f,"visibility"),de(f,"visibility",Me.Visible),O(f,"tab"),O(f,"display"),O(f,"classes"),O(f,"style"),O(f,"glowColor"),o[c]=f,o},{}),r.selected=n,r.activeTab=I(()=>{const o=a(s.tabs);if(n.value in o&&Qe(o[n.value].visibility))return a(o[n.value].tab);const c=Object.values(o).find(f=>Qe(f.visibility));return c?a(c.tab):null}),O(r,"visibility"),de(r,"visibility",Me.Visible),O(r,"classes"),O(r,"style"),O(r,"buttonContainerClasses"),O(r,"buttonContainerStyle"),r[it]=function(){const{visibility:o,activeTab:c,selected:f,tabs:v,style:g,classes:y,buttonContainerClasses:N,buttonContainerStyle:_}=this;return{visibility:o,activeTab:c,selected:f,tabs:v,style:a(g),classes:y,buttonContainerClasses:N,buttonContainerStyle:_}};const s=r;return s})}const Yi=l.ln(10);function gn(e){return e}function xl(e,t){if(T(t))return t.invert(l.neg(e));throw new Error("Could not invert due to no input being a variable")}function $l(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return p.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function El(e){return p.neg(e)}function Tl(e,t,n){if(T(t))return t.invert(l.sub(e,be(n)));if(T(n))return n.invert(l.sub(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function Pl(e,t,n){var i,r;if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=t.getIntegralFormula(e);return p.times(n,(i=t.innermostVariable)!=null?i:0).add(s)}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=n.getIntegralFormula(e);return p.times(t,(r=n.innermostVariable)!=null?r:0).add(s)}throw new Error("Could not integrate due to no input being a variable")}function Fl(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return p.add(i,n)}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return p.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Dl(e,t,n){if(T(t))return t.invert(l.add(e,be(n)));if(T(n))return n.invert(l.sub(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Ol(e,t,n){var i,r;if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=t.getIntegralFormula(e);return p.sub(s,p.times(n,(i=t.innermostVariable)!=null?i:0))}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=n.getIntegralFormula(e);return p.times(t,(r=n.innermostVariable)!=null?r:0).sub(s)}throw new Error("Could not integrate due to no input being a variable")}function Al(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return p.sub(i,n)}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return p.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Vl(e,t,n){if(T(t))return t.invert(l.div(e,be(n)));if(T(n))return n.invert(l.div(e,be(t)));throw new Error("Could not invert due to no input being a variable")}function ql(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return p.times(i,n)}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return p.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Ll(e,t,n){if(T(t))return p.div(e,n);if(T(n))return p.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Rl(e,t,n){if(T(t))return t.invert(l.mul(e,be(n)));if(T(n))return n.invert(l.div(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Bl(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return p.div(i,n)}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return p.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function jl(e,t,n){if(T(t))return p.mul(e,n);if(T(n))return p.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Ul(e,t){if(T(t))return t.invert(l.recip(e));throw new Error("Could not invert due to no input being a variable")}function zl(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function Gl(e,t){if(T(t))return t.invert(l.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Wl(e){return l.ln(e).sub(1).times(e).div(Yi)}function Hl(e,t){if(T(t)){const n=Yi.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 Zl(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new p({inputs:[t.getIntegralFormula(e)],evaluate:Wl,invert:Hl})}throw new Error("Could not integrate due to no input being a variable")}function Yl(e,t,n){if(T(t))return t.invert(l.pow(be(n),e));if(T(n))return n.invert(l.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function Kl(e,t){return l.ln(e).sub(1).times(e).div(l.ln(t))}function Jl(e,t,n){if(T(t)){const i=l.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 Xl(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new p({inputs:[t.getIntegralFormula(e),n],evaluate:Kl,invert:Jl})}throw new Error("Could not integrate due to no input being a variable")}function Ql(e,t){if(T(t))return t.invert(l.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function eu(e){return l.ln(e).sub(1).times(e).div(l.ln(2))}function tu(e,t){if(T(t)){const n=l.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 nu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new p({inputs:[t.getIntegralFormula(e)],evaluate:eu,invert:tu})}throw new Error("Could not integrate due to no input being a variable")}function iu(e,t){if(T(t))return t.invert(l.exp(e));throw new Error("Could not invert due to no input being a variable")}function ru(e){return l.ln(e).sub(1).times(e)}function au(e,t){if(T(t))return t.invert(l.div(e,l.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function su(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new p({inputs:[t.getIntegralFormula(e)],evaluate:ru,invert:au})}throw new Error("Could not integrate due to no input being a variable")}function ou(e,t,n){if(T(t))return t.invert(l.root(e,be(n)));if(T(n))return n.invert(l.ln(e).div(l.ln(be(t))));throw new Error("Could not invert due to no input being a variable")}function lu(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=p.add(n,1);return p.pow(i,r).div(r)}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return p.pow(t,i).div(p.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function uu(e,t){if(T(t))return t.invert(l.root(e,10));throw new Error("Could not invert due to no input being a variable")}function cu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.pow10(n).div(p.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function du(e,t,n){if(T(t))return t.invert(l.ln(e).div(be(n)));if(T(n))return n.invert(l.root(be(t),e));throw new Error("Could not invert due to no input being a variable")}function fu(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return p.pow(n,i).div(p.ln(n))}else if(T(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=p.add(t,1);return p.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function gu(e,t,n){if(T(t))return t.invert(l.root(e,l.recip(be(n))));if(T(n))return n.invert(l.ln(be(t)).div(l.ln(e)));throw new Error("Could not invert due to no input being a variable")}function pu(e,t,n){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return p.pow(i,p.recip(n).add(1)).times(n).div(p.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function mu(e,t){if(T(t))return t.invert(l.ln(e));throw new Error("Could not invert due to no input being a variable")}function vu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function hu(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.tetrate(e,i,n)}function bu(e,t,n,i){if(T(t))return t.invert(l.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function yu(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){const i=l.minabs(t,1e308).toNumber();return l.iteratedexp(e,i,new l(n))}function wu(e,t,n,i){if(T(t))return t.invert(l.iteratedlog(e,Math.E,l.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function _u(e,t=10,n=2){const i=l.minabs(n,1e308).toNumber();return l.iteratedlog(e,t,i)}function Nu(e,t=10){const n=l.minabs(t,1e308).toNumber();return l.slog(e,n)}function Cu(e,t,n){if(T(t))return t.invert(l.tetrate(e,l.minabs(1e308,be(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function ku(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.layeradd(e,i,n)}function Su(e,t,n,i){if(T(t))return t.invert(l.layeradd(e,l.minabs(1e308,be(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Mu(e,t){if(T(t))return t.invert(l.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Iu(e,t){if(T(t))return t.invert(l.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function xu(e,t,n){const i=l.minabs(t,1e308).toNumber();return l.pentate(e,i,n)}function $u(e,t){if(T(t))return t.invert(l.asin(e));throw new Error("Could not invert due to no input being a variable")}function Eu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Tu(e,t){if(T(t))return t.invert(l.acos(e));throw new Error("Could not invert due to no input being a variable")}function Pu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function Fu(e,t){if(T(t))return t.invert(l.atan(e));throw new Error("Could not invert due to no input being a variable")}function Du(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Ou(e,t){if(T(t))return t.invert(l.sin(e));throw new Error("Could not invert due to no input being a variable")}function Au(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.asin(n).times(n).add(p.sqrt(p.sub(1,p.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Vu(e,t){if(T(t))return t.invert(l.cos(e));throw new Error("Could not invert due to no input being a variable")}function qu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.acos(n).times(n).sub(p.sqrt(p.sub(1,p.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Lu(e,t){if(T(t))return t.invert(l.tan(e));throw new Error("Could not invert due to no input being a variable")}function Ru(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.atan(n).times(n).sub(p.ln(p.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Bu(e,t){if(T(t))return t.invert(l.asinh(e));throw new Error("Could not invert due to no input being a variable")}function ju(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t){if(T(t))return t.invert(l.acosh(e));throw new Error("Could not invert due to no input being a variable")}function zu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function Gu(e,t){if(T(t))return t.invert(l.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Wu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function Hu(e,t){if(T(t))return t.invert(l.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Zu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.asinh(n).times(n).sub(p.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function Yu(e,t){if(T(t))return t.invert(l.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Ku(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.acosh(n).times(n).sub(p.add(n,1).sqrt().times(p.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function Ju(e,t){if(T(t))return t.invert(l.tanh(e));throw new Error("Could not invert due to no input being a variable")}function Xu(e,t){if(T(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return p.atanh(n).times(n).add(p.sub(1,p.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function an(e){return(t,n)=>new p({inputs:[t,n],evaluate:e,invert:gn})}function T(e){return e instanceof me&&e.hasVariable()}function be(e,t){return e instanceof me?e.evaluate(t):a(e)}function Qu(){return p.pow(this,2).div(2)}function ec(){return this}const _e=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"&&ot in n?n[ot]:n)),"variable"in e?(typeof e.variable=="object"&&ot in e.variable&&(e.variable=e.variable[ot]),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:Qu,internalIntegrateInner:ec,applySubstitution:gn}}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){const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:s,applySubstitution:u}=e,o=t.reduce((v,g)=>v+(g instanceof _e?g.internalVariables:0),0),c=t.find(v=>v instanceof _e&&v.hasVariable()),f=o===1?c==null?void 0:c.innermostVariable:void 0;return{inputs:t,internalEvaluate:n,internalInvert:i,internalIntegrate:r,internalIntegrateInner:s,applySubstitution:u,innermostVariable:f,internalVariables:o}}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 _e&&e.inputs[n]instanceof _e?t.equals(e.inputs[n]):!(t instanceof _e)&&!(e.inputs[n]instanceof _e)&&l.eq(a(t),a(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new p({inputs:[e]})}static variable(e){return new p({variable:e})}static step(e,t,n){const i=R(0),r=n(p.variable(i)),s=he(t);function u(c){return l.lt(c,a(s))?c:(i.value=l.sub(c,a(s)),l.add(r.evaluate(),a(s)))}function o(c,f){if(T(f)&&r.isInvertible())return l.gt(c,a(s))&&(c=l.add(r.invert(l.sub(c,a(s))),a(s))),f.invert(c);throw new Error("Could not invert due to no input being a variable")}return new p({inputs:[e],evaluate:u,invert:r.isInvertible()&&r.hasVariable()?o:void 0})}static if(e,t,n,i){const r=R(0),s=p.variable(r),u=n(s),o=i==null?void 0:i(s),c=he(t);function f(g){return a(c)?(r.value=g,u.evaluate()):o?(r.value=g,o.evaluate()):g}function v(g,y){if(!T(y)||!u.isInvertible()||o!=null&&!o.isInvertible())throw new Error("Could not invert due to no input being a variable");return a(c)?y.invert(u.invert(g)):o?y.invert(o.invert(g)):y.invert(g)}return new p({inputs:[e],evaluate:f,invert:u.isInvertible()&&u.hasVariable()?v:void 0})}static conditional(e,t,n,i){return p.if(e,t,n,i)}static abs(e){return new p({inputs:[e],evaluate:l.abs})}static neg(e){return new p({inputs:[e],evaluate:l.neg,invert:xl,applySubstitution:El,integrate:$l})}static sign(e){return new p({inputs:[e],evaluate:l.sign})}static round(e){return new p({inputs:[e],evaluate:l.round})}static floor(e){return new p({inputs:[e],evaluate:l.floor})}static ceil(e){return new p({inputs:[e],evaluate:l.ceil})}static trunc(e){return new p({inputs:[e],evaluate:l.trunc})}static add(e,t){return new p({inputs:[e,t],evaluate:l.add,invert:Tl,integrate:Pl,integrateInner:Fl,applySubstitution:gn})}static sub(e,t){return new p({inputs:[e,t],evaluate:l.sub,invert:Dl,integrate:Ol,integrateInner:Al,applySubstitution:gn})}static mul(e,t){return new p({inputs:[e,t],evaluate:l.mul,invert:Vl,integrate:ql,applySubstitution:Ll})}static div(e,t){return new p({inputs:[e,t],evaluate:l.div,invert:Rl,integrate:Bl,applySubstitution:jl})}static recip(e){return new p({inputs:[e],evaluate:l.recip,invert:Ul,integrate:zl})}static clamp(e,t,n){return new p({inputs:[e,t,n],evaluate:l.clamp,invert:gn})}static pLog10(e){return new p({inputs:[e],evaluate:l.pLog10})}static absLog10(e){return new p({inputs:[e],evaluate:l.absLog10})}static log10(e){return new p({inputs:[e],evaluate:l.log10,invert:Gl,integrate:Zl})}static log(e,t){return new p({inputs:[e,t],evaluate:l.log,invert:Yl,integrate:Xl})}static log2(e){return new p({inputs:[e],evaluate:l.log2,invert:Ql,integrate:nu})}static ln(e){return new p({inputs:[e],evaluate:l.ln,invert:iu,integrate:su})}static pow(e,t){return new p({inputs:[e,t],evaluate:l.pow,invert:ou,integrate:lu})}static pow10(e){return new p({inputs:[e],evaluate:l.pow10,invert:uu,integrate:cu})}static pow_base(e,t){return new p({inputs:[e,t],evaluate:l.pow_base,invert:du,integrate:fu})}static root(e,t){return new p({inputs:[e,t],evaluate:l.root,invert:gu,integrate:pu})}static factorial(e){return new p({inputs:[e],evaluate:l.factorial})}static gamma(e){return new p({inputs:[e],evaluate:l.gamma})}static lngamma(e){return new p({inputs:[e],evaluate:l.lngamma})}static exp(e){return new p({inputs:[e],evaluate:l.exp,invert:mu,integrate:vu})}static sqr(e){return p.pow(e,2)}static sqrt(e){return p.root(e,2)}static cube(e){return p.pow(e,3)}static cbrt(e){return p.root(e,3)}static tetrate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new p({inputs:[e,t,n],evaluate:hu,invert:bu})}static iteratedexp(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new p({inputs:[e,t,n],evaluate:yu,invert:wu})}static iteratedlog(e,t=10,n=1){return new p({inputs:[e,t,n],evaluate:_u})}static slog(e,t=10){return new p({inputs:[e,t],evaluate:Nu,invert:Cu})}static layeradd10(e,t){return new p({inputs:[e,t],evaluate:l.layeradd10})}static layeradd(e,t,n=10){return new p({inputs:[e,t,n],evaluate:ku,invert:Su})}static lambertw(e){return new p({inputs:[e],evaluate:l.lambertw,invert:Mu})}static ssqrt(e){return new p({inputs:[e],evaluate:l.ssqrt,invert:Iu})}static pentate(e,t=2,n=l.fromComponents_noNormalize(1,0,1)){return new p({inputs:[e,t,n],evaluate:xu})}static sin(e){return new p({inputs:[e],evaluate:l.sin,invert:Ou,integrate:Eu})}static cos(e){return new p({inputs:[e],evaluate:l.cos,invert:Vu,integrate:Pu})}static tan(e){return new p({inputs:[e],evaluate:l.tan,invert:Lu,integrate:Du})}static asin(e){return new p({inputs:[e],evaluate:l.asin,invert:$u,integrate:Au})}static acos(e){return new p({inputs:[e],evaluate:l.acos,invert:Tu,integrate:qu})}static atan(e){return new p({inputs:[e],evaluate:l.atan,invert:Fu,integrate:Ru})}static sinh(e){return new p({inputs:[e],evaluate:l.sinh,invert:Hu,integrate:ju})}static cosh(e){return new p({inputs:[e],evaluate:l.cosh,invert:Yu,integrate:zu})}static tanh(e){return new p({inputs:[e],evaluate:l.tanh,invert:Ju,integrate:Wu})}static asinh(e){return new p({inputs:[e],evaluate:l.asinh,invert:Bu,integrate:Zu})}static acosh(e){return new p({inputs:[e],evaluate:l.acosh,invert:Uu,integrate:Ku})}static atanh(e){return new p({inputs:[e],evaluate:l.atanh,invert:Gu,integrate:Xu})}step(e,t){return p.step(this,e,t)}if(e,t){return p.if(this,e,t)}conditional(e,t){return p.if(this,e,t)}abs(){return p.abs(this)}neg(){return p.neg(this)}sign(){return p.sign(this)}round(){return p.round(this)}floor(){return p.floor(this)}ceil(){return p.ceil(this)}trunc(){return p.trunc(this)}add(e){return p.add(this,e)}sub(e){return p.sub(this,e)}mul(e){return p.mul(this,e)}div(e){return p.div(this,e)}recip(){return p.recip(this)}max(e){return p.max(this,e)}min(e){return p.min(this,e)}maxabs(e){return p.maxabs(this,e)}minabs(e){return p.minabs(this,e)}clamp(e,t){return p.clamp(this,e,t)}clampMin(e){return p.clampMin(this,e)}clampMax(e){return p.clampMax(this,e)}pLog10(){return p.pLog10(this)}absLog10(){return p.absLog10(this)}log10(){return p.log10(this)}log(e){return p.log(this,e)}log2(){return p.log2(this)}ln(){return p.ln(this)}pow(e){return p.pow(this,e)}pow10(){return p.pow10(this)}pow_base(e){return p.pow_base(this,e)}root(e){return p.root(this,e)}factorial(){return p.factorial(this)}gamma(){return p.gamma(this)}lngamma(){return p.lngamma(this)}exp(){return p.exp(this)}sqr(){return p.pow(this,2)}sqrt(){return p.root(this,2)}cube(){return p.pow(this,3)}cbrt(){return p.root(this,3)}tetrate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return p.tetrate(this,e,t)}iteratedexp(e=2,t=l.fromComponents_noNormalize(1,0,1)){return p.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return p.iteratedlog(this,e,t)}slog(e=10){return p.slog(this,e)}layeradd10(e){return p.layeradd10(this,e)}layeradd(e,t){return p.layeradd(this,e,t)}lambertw(){return p.lambertw(this)}ssqrt(){return p.ssqrt(this)}pentate(e=2,t=l.fromComponents_noNormalize(1,0,1)){return p.pentate(this,e,t)}sin(){return p.sin(this)}cos(){return p.cos(this)}tan(){return p.tan(this)}asin(){return p.asin(this)}acos(){return p.acos(this)}atan(){return p.atan(this)}sinh(){return p.sinh(this)}cosh(){return p.cosh(this)}tanh(){return p.tanh(this)}asinh(){return p.asinh(this)}acosh(){return p.acosh(this)}atanh(){return p.atanh(this)}};let me=_e;me.negate=_e.neg;me.negated=_e.neg;me.sgn=_e.sign;me.plus=_e.add;me.subtract=_e.sub;me.minus=_e.sub;me.multiply=_e.mul;me.times=_e.mul;me.divide=_e.div;me.divideBy=_e.div;me.dividedBy=_e.div;me.reciprocal=_e.recip;me.reciprocate=_e.recip;me.max=an(l.max);me.min=an(l.min);me.minabs=an(l.minabs);me.maxabs=an(l.maxabs);me.clampMin=an(l.clampMin);me.clampMax=an(l.clampMax);me.logarithm=_e.log;class p extends me{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=l.add(this.evaluate(0),this.evaluate(1)).div(2);return l.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 tc(e,t,n=!0,i){const r=he(n);return I(()=>{var u,o;let s;if(a(r)){if(!e.isIntegrable()||!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");s=l.floor(e.invertIntegral(l.add(t.value,e.evaluateIntegral()))).sub((u=a(e.innermostVariable))!=null?u:0),i==null&&(i=10)}else{if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula");s=l.floor(e.invert(t.value)),i==null&&(i=0)}if(i>0&&l.lt(xt(e,s,!0,0),1e308)){s=s.sub(i).clampMin(0);let c=xt(e,s,!0,0);for(;;){const f=e.evaluate(s.add((o=a(e.innermostVariable))!=null?o:0));if(l.add(c,f).lte(t.value))s=s.add(1),c=l.add(c,f);else break}}return s})}function xt(e,t,n=!0,i){var s,u,o;let r=l.add(t,(s=a(e.innermostVariable))!=null?s:0);if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with spending resources of non-integrable formula");const c=r;r=r.sub(i!=null?i:10).clampMin((u=a(e.innermostVariable))!=null?u:0);let f=l.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return f.add(l.sub(c,r).times(e.evaluate(r)));for(let v=r.toNumber();v{const{addend:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),u=he(n),o=he(i),c=r==null?void 0:he(r);return{apply:f=>l.add(f,a(u)),invert:f=>l.sub(f,a(u)),getFormula:f=>p.add(f,u),enabled:c,description:i==null?void 0:ne(()=>m("div",{class:"modifier-container"},[a(o)!=null?m("span",{class:"modifier-description"},[Je(a(o))]):null,m("span",{class:"modifier-amount",style:(s===!0?l.gt(a(u),0):l.lt(a(u),0))?"color: var(--danger)":""},[l.gte(a(u),0)?"+":"",Mt(a(u))])]))}})}function Nt(e){return et(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),u=he(n),o=he(i),c=r==null?void 0:he(r);return{apply:f=>l.times(f,a(u)),invert:f=>l.div(f,a(u)),getFormula:f=>p.times(f,u),enabled:c,description:i==null?void 0:ne(()=>m("div",{class:"modifier-container"},[a(o)!=null?m("span",{class:"modifier-description"},[Je(a(o))]):null,m("span",{class:"modifier-amount",style:(s===!0?l.gt(a(u),1):l.lt(a(u),1))?"color: var(--danger)":""},[A("\xD7"),Mt(a(u))])]))}})}function nc(e){return et(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:s,smallerIsBetter:u}=e.call(t,t),o=he(n),c=he(i),f=r==null?void 0:he(r);return{apply:v=>{let g=v;return s&&(g=l.add(g,1)),g=l.pow(g,a(o)),s&&(g=l.sub(g,1)),g},invert:v=>{let g=v;return s&&(g=l.add(g,1)),g=l.root(g,a(o)),s&&(g=l.sub(g,1)),g},getFormula:v=>s?p.add(v,1).pow(o).sub(1):p.pow(v,o),enabled:f,description:i==null?void 0:ne(()=>m("div",{class:"modifier-container"},[a(c)!=null?m("span",{class:"modifier-description"},[Je(a(c)),s?" (+1 effective)":null]):null,m("span",{class:"modifier-amount",style:(u===!0?l.gt(a(o),1):l.lt(a(o),1))?"color: var(--danger)":""},[A("^"),Mt(a(o))])]))}})}function At(e){return et(()=>{const t=e();return{apply:n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?I(()=>t.filter(n=>a(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?ne(()=>m(se,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(Je)])):void 0}})}const ic={key:0},rc={key:0,class:"mark star"},ac=["src"],sc=Y({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(k(),$("div",ic,[e.mark===!0?(k(),$("div",rc)):(k(),$("img",{key:1,class:"mark",src:e.mark},null,8,ac))])):B("",!0)}});var qn=fe(sc,[["__scopeId","data-v-2207999f"]]);const oc=Y({__name:"Node",props:{id:null},setup(e){const n=Ne(e),i=xn(Jn,()=>{}),r=xn(Xn,()=>{}),s=ze(null),u=I(()=>s.value&&s.value.parentElement);return Xe([u,n.id],([o,c],[f,v])=>{f&&r(a(v)),o&&i(c,o)}),Si(()=>r(a(n.id))),(o,c)=>(k(),$("div",{class:"node",ref_key:"node",ref:s},null,512))}});var Ln=fe(oc,[["__scopeId","data-v-a48cb382"]]);Y({props:{display:{type:L(Object,String,Function),required:!0},visibility:{type:L(Number,Boolean),required:!0},style:L(Object,String,Array),classes:L(Object),onClick:Function,onHold:Function,canClick:{type:L(Boolean),required:!0},small:Boolean,mark:L(Boolean,String),id:{type:String,required:!0}},components:{Node:Ln,MarkNode:qn},setup(e){const{display:t,onClick:n,onHold:i}=Ne(e),r=ze("");Ke(()=>{var v;const o=Ee(t);if(o==null){r.value="";return}if(ut(o)){r.value=ue(o);return}const c=ue((v=o.title)!=null?v:"","h3"),f=ue(o.description,"div");r.value=ue(ne(()=>m("span",null,[o.title!=null?m("div",null,[m(c,null,null)]):null,m(f,null,null)])))});const{start:s,stop:u}=Ai(n,i);return{start:s,stop:u,comp:r,Visibility:Me,isVisible:Qe,isHidden:rn,unref:a}}});const lc=["x1","y1","x2","y2"],uc=Y({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Ne(e),i=I(()=>{const s=n.startNode.value.rect,u=n.boundingRect.value,o=u?{x:s.x+s.width/2-u.x,y:s.y+s.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(o.x+=n.link.value.offsetStart.x,o.y+=n.link.value.offsetStart.y),o}),r=I(()=>{const s=n.endNode.value.rect,u=n.boundingRect.value,o=u?{x:s.x+s.width/2-u.x,y:s.y+s.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(o.x+=n.link.value.offsetEnd.x,o.y+=n.link.value.offsetEnd.y),o});return(s,u)=>(k(),$("line",pt({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,lc))}});const cc=Y({__name:"Links",props:{links:null},setup(e){var c;const n=Tt(e,"links"),i=R(null),r=xn(Qn,R({})),s=xn(ei,R(void 0)),u=R((c=i.value)==null?void 0:c.getBoundingClientRect());Xe(s,()=>{var f;return u.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),On(()=>{var f;return u.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const o=I(()=>{var v,g;const f=r.value;return(g=(v=n.value)==null?void 0:v.filter(y=>{var N,_;return((N=f[y.startNode.id])==null?void 0:N.rect)&&((_=f[y.startNode.id])==null?void 0:_.rect)}))!=null?g:[]});return(f,v)=>(k(),$(se,null,[a(o)?(k(),$("svg",sr(pt({key:0},f.$attrs)),[(k(!0),$(se,null,nn(a(o),(g,y)=>(k(),ee(uc,{key:y,link:g,boundingRect:u.value,startNode:a(r)[g.startNode.id],endNode:a(r)[g.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),w("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var dc=fe(cc,[["__scopeId","data-v-063f6d6b"]]);Y({props:{nodes:{type:L(Array),required:!0},leftSideNodes:L(Array),rightSideNodes:L(Array),branches:L(Array)},components:{Links:dc},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Ne(e),r=ze();Ke(()=>{const o=Ee(t);r.value=ue(ne(()=>m(se,null,[o.map(c=>m("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(Je)]))])))});const s=ze();Ke(()=>{const o=Ee(n);s.value=o?ue(ne(()=>m("span",{class:"left-side-nodes small"},[o.map(Je)]))):""});const u=ze();return Ke(()=>{const o=Ee(i);u.value=o?ue(ne(()=>m("span",{class:"side-nodes small"},[o.map(Je)]))):""}),{unref:a,nodesComp:r,leftNodesComp:s,rightNodesComp:u}}});Y({props:{display:L(Object,String,Function),visibility:{type:L(Number,Boolean),required:!0},style:L(String,Object,Array),classes:L(Object),onClick:Function,onHold:Function,color:L(String),glowColor:L(String),canClick:{type:L(Boolean),required:!0},mark:L(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:qn,Node:Ln},setup(e){const{onClick:t,onHold:n,display:i}=Ne(e),r=yn(i),{start:s,stop:u}=Ai(t,n);return{start:s,stop:u,comp:r,unref:a,Visibility:Me,isCoercableComponent:ut,isVisible:Qe,isHidden:rn}}});function pn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(o=>he(o.base)),n.baseText=t.map(o=>he(o.baseText)),n.visible=t.map(o=>he(o.visible)),n.title=t.map(o=>he(o.title)),n.subtitle=t.map(o=>he(o.subtitle)),i=!0),t}const s=ct({},!1);return[ne(()=>{const o=r();let c=!0;const f=o.map((v,g)=>{var q,x,D;if(a(n.visible[g])===!1)return null;const y=m("h3",{onClick:()=>s.value[g]=!s.value[g],style:"cursor: pointer"},[m("span",{class:"modifier-toggle"+(a(s.value[g])?" collapsed":"")},[A("\u25BC")]),a(n.title[g]),a(n.subtitle[g])!=null?m("span",{class:"subtitle"},[A(" ("),a(n.subtitle[g]),A(")")]):null]),N=a(s.value[g])?null:m(se,null,[m("div",{class:"modifier-container"},[m("span",{class:"modifier-description"},[Je((q=a(n.baseText[g]))!=null?q:"Base")]),m("span",{class:"modifier-amount"},[Rt((x=a(n.base[g]))!=null?x:1),v.unit])]),v.modifier.description==null?null:Je(a(v.modifier.description))]),_=!c;c=!1;const S=(D=a(n.base[g]))!=null?D:1,P=v.modifier.apply(S);return m(se,null,[_?m("br",null,null):null,m("div",{style:{"--unit":re.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[y,m("br",null,null),N,m("hr",null,null),m("div",{class:"modifier-container"},[m("span",{class:"modifier-description"},[A("Total")]),m("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?l.gt(P,S!=null?S:1):l.lt(P,S!=null?S:1))?"color: var(--danger)":""},[Mt(P),v.unit])])])])});return m(se,null,[f])}),s]}function hi(e,t,n){const i=he(t),r=he(n);return I(()=>{const s=a(i),u=a(r);return l.gte(e.value,u)?"Now":l.lte(s,0)?"Never":An(l.sub(u,e.value).div(s))})}function Dn(e,t,n=1){const i=he(t),r=he(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return ne(()=>{var s;if(a(i)){const u=Mt(e.evaluate()),o=Mt(e.evaluate(l.add(a((s=e.innermostVariable)!=null?s:0),a(r))));return m(se,null,[m("b",null,[m("i",null,[u,A(" \u2192 "),o])])])}return m(se,null,[Mt(e.evaluate())])})}const fc=Y({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(k(),$("div",{style:Le({width:e.width,height:e.height})},null,4))}});function bi(e){return et(t=>{const n=e.call(t,t);if(n.partialDisplay=i=>m("span",{style:a(n.requirementMet)?"":"color: var(--danger)"},[vi(n.resource,n.cost instanceof p?xt(n.cost,i!=null?i:1,a(n.spendResources)):a(n.cost))," ",n.resource.displayName]),n.display=i=>m("div",null,[a(n.requiresPay)?"Costs: ":"Requires: ",vi(n.resource,n.cost instanceof p?xt(n.cost,i!=null?i:1,a(n.spendResources)):a(n.cost))," ",n.resource.displayName]),O(n,"visibility"),de(n,"visibility",Me.Visible),O(n,"cost"),O(n,"requiresPay"),de(n,"requiresPay",!0),O(n,"spendResources"),de(n,"spendResources",!0),de(n,"pay",function(i){const r=n.cost instanceof p?xt(n.cost,i!=null?i:1,a(n.spendResources)):a(n.cost);n.resource.value=l.sub(n.resource.value,r).max(0)}),n.canMaximize=I(()=>n.cost instanceof p&&n.cost.isInvertible()&&(a(n.spendResources)===!1||n.cost.isIntegrable())),n.cost instanceof p&&n.cost.isInvertible()){const i=tc(n.cost,n.resource,a(n.spendResources));n.requirementMet=I(()=>a(n.canMaximize)?i.value:n.cost instanceof p?l.gte(n.resource.value,n.cost.evaluate()):l.gte(n.resource.value,a(n.cost)))}else n.requirementMet=I(()=>n.cost instanceof p?l.gte(n.resource.value,n.cost.evaluate()):l.gte(n.resource.value,a(n.cost)));return n})}function Ki(e){return et(()=>({requirementMet:I(()=>Qe(e.visibility)),visibility:Me.None,requiresPay:!1}))}function gc(e,t){return et(()=>({requirementMet:he(e),partialDisplay:t==null?void 0:ne(()=>Je(t)),display:t==null?void 0:ne(()=>m(se,null,[A("Req: "),Je(t)])),visibility:t==null?Me.None:Me.Visible,requiresPay:!1}))}function ai(e){if($t(e))return e.every(ai);const t=a(e.requirementMet);return typeof t=="boolean"?t:l.gt(t,0)}function si(e,t=1){var n,i;if($t(e)&&(e=e.filter(r=>Qe(r.visibility)),e.length===1&&(e=e[0])),$t(e)){e=e.filter(u=>"partialDisplay"in u);const r=e.filter(u=>a(u.requiresPay)),s=e.filter(u=>!a(u.requiresPay));return m(se,null,[r.length>0?m("div",null,[A("Costs:")," ",gi(r.map(u=>u.partialDisplay(t)),m(se,null,[A(", ")]))]):null,s.length>0?m("div",null,[A("Requires:")," ",gi(s.map(u=>u.partialDisplay(t)),m(se,null,[A(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:m(se,null,null)}function pc(e,t=1){var n;$t(e)?e.filter(i=>a(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):a(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var mc=Y({props:{display:{type:L(String,Object,Function),required:!0},visibility:{type:L(Number,Boolean),required:!0},style:L(String,Object,Array),classes:L(Object),requirements:{type:Object,required:!0},canPurchase:{type:L(Boolean),required:!0},bought:{type:L(Boolean),required:!0},mark:L(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Ln,MarkNode:qn},setup(e){const{display:t,requirements:n,bought:i}=Ne(e),r=ze("");return Ke(()=>{const s=Ee(t);if(s==null){r.value="";return}if(ut(s)){r.value=ue(s);return}const u=ue(s.title||"","h3"),o=ue(s.description,"div"),c=ue(s.effectDisplay||"");r.value=ue(ne(()=>m("span",null,[s.title!=null?m("div",null,[m(u,null,null)]):null,m(o,null,null),s.effectDisplay!=null?m("div",null,[A("Currently: "),m(c,null,null)]):null,i.value?null:m(se,null,[m("br",null,null),si(n.value)])])))}),{component:r,unref:a,Visibility:Me,isVisible:Qe,isHidden:rn}}});const vc=["disabled"];function hc(e,t,n,i,r,s){var c;const u=Et("MarkNode"),o=Et("Node");return e.isVisible(e.visibility)?(k(),$("button",{key:0,style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),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(Ae(e.unref(e.component)),{key:0})):B("",!0),m(u,{mark:e.unref(e.mark)},null,8,["mark"]),m(o,{id:e.id},null,8,["id"])],14,vc)):B("",!0)}var bc=fe(mc,[["render",hc],["__scopeId","data-v-9be6bac0"]]);const yc=Symbol("Upgrade");function wc(e,...t){const n=ct(!1,!1),i=t.reduce((r,s)=>{var u;return Object.assign(r,(u=s.getPersistentData)==null?void 0:u.call(s))},{});return et(r=>{var c,f;const s=e.call(r,r);s.id=Vn("upgrade-"),s.type=yc,s[lt]=bc;for(const v of t)(c=v.preConstruct)==null||c.call(v,s);s.bought=n,Object.assign(s,i),s.canPurchase=I(()=>ai(s.requirements)),s.purchase=function(){var g;const v=s;!a(v.canPurchase)||(pc(s.requirements),n.value=!0,(g=v.onPurchase)==null||g.call(v))};const u=Ki(s);$t(s.requirements)?s.requirements.unshift(u):s.requirements=[u,s.requirements],O(s,"visibility"),de(s,"visibility",Me.Visible),O(s,"classes"),O(s,"style"),O(s,"display"),O(s,"mark");for(const v of t)(f=v.postConstruct)==null||f.call(v,s);const o=t.reduce((v,g)=>{var y;return Object.assign(v,(y=g.getGatheredProps)==null?void 0:y.call(g,s))},{});return s[it]=function(){const{display:v,visibility:g,style:y,classes:N,requirements:_,canPurchase:S,bought:P,mark:q,id:x,purchase:D}=this;return{display:v,visibility:g,style:a(y),classes:N,requirements:_,canPurchase:S,bought:P,mark:q,id:x,purchase:D,...o}},s})}function _c(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 Nc={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"]},yi=[[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 wi(e){const t=yi[Math.floor(e()*yi.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Ni(e,t){return O(t,"display"),O(t,"classes"),O(t,"style"),O(t,"direction"),de(t,"direction",W.Up),O(t,"xoffset"),O(t,"yoffset"),t.pinnable&&(t.pinned=ct(!1,!1)),gt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Li(t.pinned)):e.pinned=t.pinned);const n=e[lt];e[lt]=Ce;const i=e[it].bind(e);e[it]=function(){const{display:s,classes:u,style:o,direction:c,xoffset:f,yoffset:v,pinned:g}=this;return{element:{[lt]:n,[it]:i},display:s,classes:u,style:a(o),direction:c,xoffset:f,yoffset:v,pinned:g}}.bind(t)}),t}var Sc=Y({props:{visibility:{type:L(Number,Boolean),required:!0},display:L(Object,String,Function),earned:{type:L(Boolean),required:!0},requirements:L(Object,Array),image:L(String),style:L(String,Object,Array),classes:L(Object),mark:L(Boolean,String),small:L(Boolean),id:{type:String,required:!0}},components:{Node:Ln,MarkNode:qn},setup(e){const{display:t,requirements:n,earned:i}=Ne(e),r=ze("");return Ke(()=>{const s=Ee(t);if(s==null){r.value="";return}if(ut(s)){r.value=ue(s);return}const u=ue(s.requirement?s.requirement:ne(()=>{var f;return si((f=Ee(n))!=null?f:[])}),"h3"),o=ue(s.effectDisplay||"","b"),c=Ee(i)?ue(s.optionsDisplay||"","span"):"";r.value=ue(ne(()=>m("span",null,[m(u,null,null),s.effectDisplay!=null?m("div",null,[m(o,null,null)]):null,s.optionsDisplay!=null?m("div",{class:"equal-spaced"},[m(c,null,null)]):null])))}),{comp:r,unref:a,Visibility:Me,isVisible:Qe,isHidden:rn}}});function Mc(e,t,n,i,r,s){var c;const u=Et("MarkNode"),o=Et("Node");return e.isVisible(e.visibility)?(k(),$("div",{key:0,style:Le([{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(Ae(e.comp),{key:0})):B("",!0),m(u,{mark:e.unref(e.mark)},null,8,["mark"]),m(o,{id:e.id},null,8,["id"])],6)):B("",!0)}var Ic=fe(Sc,[["render",Mc],["__scopeId","data-v-5673325a"]]);const xc=Yn(),$c=Symbol("Achievement");let Jt=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Ec(e,...t){const n=ct(!1,!1),i=t.reduce((r,s)=>{var u;return Object.assign(r,(u=s.getPersistentData)==null?void 0:u.call(s))},{});return et(r=>{var c,f,v;const s=(c=e==null?void 0:e.call(r,r))!=null?c:{};s.id=Vn("achievement-"),s.type=$c,s[lt]=Ic;for(const g of t)(f=g.preConstruct)==null||f.call(g,s);s.earned=n,s.complete=function(){var y,N;n.value=!0;const g=s;if((y=g.onComplete)==null||y.call(g),g.display!=null&&a(g.showPopups)===!0){const _=a(g.display);let S;ut(_)?S=ue(_):_.requirement!=null?S=ue(_.requirement):S=si((N=g.requirements)!=null?N:[]),xc.info(m("div",null,[m("h3",null,[A("Achievement earned!")]),m("div",null,[m(S,null,null)])]))}},Object.assign(s,i),O(s,"visibility"),de(s,"visibility",Me.Visible);const u=s.visibility;s.visibility=or(()=>{const g=a(s.display);switch(re.msDisplay){default:case Jt.All:return a(u);case Jt.Configurable:return a(s.earned)&&!(g!=null&&typeof g=="object"&&"optionsDisplay"in g)?Me.None:a(u);case Jt.Incomplete:return a(s.earned)?Me.None:a(u);case Jt.None:return Me.None}}),O(s,"display"),O(s,"mark"),O(s,"small"),O(s,"image"),O(s,"style"),O(s,"classes"),O(s,"showPopups"),de(s,"showPopups",!0);for(const g of t)(v=g.postConstruct)==null||v.call(g,s);const o=t.reduce((g,y)=>{var N;return Object.assign(g,(N=y.getGatheredProps)==null?void 0:N.call(y,s))},{});if(s[it]=function(){const{visibility:g,display:y,requirements:N,earned:_,image:S,style:P,classes:q,mark:x,small:D,id:F}=this;return{visibility:g,display:y,requirements:N,earned:_,image:S,style:a(P),classes:q,mark:x,small:D,id:F,...o}},s.requirements){const g=s,y=[Ki(g),gc(()=>!g.earned.value),...$t(s.requirements)?s.requirements:[s.requirements]];Ke(()=>{re.active===Z.id&&ai(y)&&g.complete()})}return s})}Ve.on("loadSettings",e=>{de(e,"msDisplay",Jt.All)});const Tc=Object.values(Jt).map(e=>({label:Ze(e),value:e}));_a(ne(()=>m(ii,{title:ne(()=>m("span",{class:"option-title"},[A("Show achievements"),m("desc",null,[A("Select which achievements to display based on criterias.")])])),options:Tc,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));function Ji(e,t,n){return ti(e,function(){const i=_c(0,n>>0,n>>32,1);for(let H=0;H<12;H++)i();const r=wi(i),s=_i([.64,.75,.55],i),u=_i([.18,.2,.25],i),o=Hi(0,wi(i)),c=Ct.indexOf(t),f=i()+c+1,v=Math.ceil(i()*(c+2)),g=[],y=At(()=>g),N=I(()=>y.apply(0)),_=[],S=[],P=R(0);let q=p.variable(P),x=!0;for(let H=0;Hxe+ye),_n=Object.keys(U);let ht=Math.floor(i()*rt),bt=0,Wt=null;for(let xe=0;xe<_n.length;xe++){const ye=_n[xe];if(bt+=U[ye],htFe+We),b=Object.keys(wt);let d=0,M=null;ht=i()*Kt;for(let Fe=0;FeWe.add(Fe)),we=Wn(()=>({addend:Fe,description:V,enabled:De.bought}));break}case"mult":{const Fe=i()*5+1;te=`Multiply ${o.displayName} gain by ${ke(Fe)}.`,q=q.step(P.value,We=>{const cn=l.sub(P.value,We.evaluate());return We.add(cn).times(Fe).sub(cn)}),we=Nt(()=>({multiplier:Fe,description:V,enabled:De.bought}));break}case"pow":{const Fe=i()/5+1;te=`Raise ${o.displayName} gain to the ^${ke(Fe)}`,q=q.step(P.value,We=>{const cn=l.sub(P.value,We.evaluate());return We.add(cn).pow(Fe).sub(cn)}),we=nc(()=>({exponent:Fe,description:V,enabled:De.bought}))}}P.value=l.times(f,i()+.5).pow_base(2).add(P.value);const st=x,De=wc(()=>({requirements:bi(()=>({resource:mi(o),cost:E})),display:{title:V,description:te},visibility:st})),un=xa(De);_.push({shouldShowPreview:I(()=>!De.bought.value&&De.canPurchase.value&&un.value),modifier:we,cost:E}),g.push(we);const Qi=hi(o,N,E);Ni(De,{display:()=>De.bought.value?"":Qi.value,direction:W.Down}),xe.push(De)}S.push(xe);break}const Ht={cache:100,generation:10,resourceMulti:5,energyMulti:5},yt=Object.values(Ht).reduce((xe,ye)=>xe+ye),Zt=Object.keys(Ht);ht=Math.floor(i()*yt),bt=0;let sn=null;for(let xe=0;xe{var ye,wt,Kt;return Xt.grantResource(Re,l.times((Kt=(wt=(ye=Xt.resourceNodes.value[Re])==null?void 0:ye.state)==null?void 0:wt.amount)!=null?Kt:0,f))};break;case"generation":Re=zn(i);const xe=l.div(f,120).times(Ye[Re]);Pt=`Gain ${ke(xe)} ${Re}/s while plane is active.`,Nn=ye=>Xt.grantResource(Re,l.times(ye,xe)),kn=I(()=>Xt.resourceNodes.value[Re]);break;case"resourceMulti":on=Re=zn(i),Ft=l.div(f,17).pow_base(2),Pt=`Gain ${ke(Ft)}x ${Re} while plane is active.`;break;case"energyMulti":on="energy",Ft=l.div(f,17),Pt=`Gain ${ke(Ft)}x energy while plane is active.`;break}const at=l.times(f,i()+.5).pow_base(2).times(10).times(q.evaluate()),ln=x,Yt=Ec(()=>({requirements:bi(()=>({resource:mi(o),cost:at})),visibility:ln,display:{requirement:`${ke(at)} ${o.displayName}`,effectDisplay:Pt},style:"width: 100%",classes:{final:H===v-1},update:Nn,onComplete:Cn,link:kn,effectedResource:on,resourceMulti:Ft})),Sn=hi(o,N,at);Ni(Yt,{display:()=>Yt.earned.value?"":Sn.value,direction:W.Down}),S.push([Yt]),x=Yt.earned}const[D,F]=pn(()=>[{title:`${Ze(o.displayName)} Gain`,modifier:y,base:0,unit:"/s"}]),j=R(!1),oe=ne(()=>m(mt,{modelValue:j.value,"onUpdate:modelValue":H=>j.value=H},{header:()=>m("h2",null,[A("Modifiers")]),body:()=>Ue(D)}));this.on("preUpdate",H=>{o.value=l.times(N.value,H).add(o.value),Ie.value.forEach(U=>{var rt;(rt=U.update)==null||rt.call(U,H)})});const ae=I(()=>{const H=_.find(U=>U.shouldShowPreview.value);return H?l.neg(H.cost):0}),Q=I(()=>{const H=_.find(U=>U.shouldShowPreview.value);return H?l.sub(H.modifier.apply(N.value),N.value):0}),Pe=Dn(p.variable(0).add(o),()=>l.neq(ae.value,0),ae),K=Dn(p.variable(0).add(N),()=>l.neq(Q.value,0),Q),J=I(()=>{const H=[];return Ie.value.forEach(U=>{U.link&&H.push(U.link)}),H}),pe=I(()=>{const H={};return Ie.value.forEach(U=>{U.effectedResource!=null&&U.resourceMulti!=null&&(H[U.effectedResource]!=null?H[U.effectedResource]=l.times(H[U.effectedResource],U.resourceMulti):H[U.effectedResource]=U.resourceMulti)}),H}),Ie=I(()=>{const H=[];for(let U=1;Ul.lt(Ie.value.length,v)&&S.some(H=>H.some(U=>"earned"in U&&a(U.earned)||"bought"in U&&a(U.bought)?!1:("canClick"in U&&a(U.canClick)||"canPurchase"in U&&a(U.canPurchase),!0))));return{tier:ct(t),seed:ct(n),name:r,color:s,resource:o,background:u,style:{background:u,"--background":u},features:S,resourceTabCollapsed:F,links:J,resourceMultis:pe,earnedTreasures:Ie,showNotif:Oe,display:ne(()=>m(se,null,[m(Fn,{class:"nav-container"},{default:()=>[m("span",{class:"nav-segment"},[m("h2",null,[r])]),m("span",{class:"nav-segment"},[m("h3",null,[t,A("-tier")])]),m("span",{class:"nav-segment"},[m("button",{class:"button",style:"display: inline",onClick:()=>j.value=!0},[A("open modifiers")])])]}),m(Fn,{class:"nav-container"},{default:()=>[m("span",{class:"nav-segment"},[m("h3",{style:`color: ${s}; text-shadow: 0px 0px 10px ${s};`},[Ue(Pe)])," ",o.displayName]),m("span",{class:"nav-segment"},[A("("),m("h3",{style:`color: ${s}; text-shadow: 0px 0px 10px ${s};`},[l.gt(N.value,0)?"+":"",Ue(K)]),A("/s)")])]}),m(fc,{height:"60px"},null),S.map(H=>Ia(...H)),Ue(oe)])),minimizedDisplay:ne(()=>m("div",null,[m("span",null,[r]),m("span",{style:"font-size: large; vertical-align: sub;"},[" ",Ie.value.length,A("/"),v,A(" treasures")])]))}})}function zn(e){const t=Object.values(Ye).reduce((u,o)=>u+o),n=Object.keys(Ye),i=Math.floor(e()*t);let r=0,s;for(let u=0;ue?"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"}},Xt=ti("main",function(){const e=Hi(0,"energy"),t=p.variable(0).add(1),n=I(()=>F.types.resource.nodes.value.reduce((b,d)=>(b[d.state.type]=d,b),{})),i=I(()=>({...F.types.passive.nodes.value.reduce((b,d)=>(b[d.state]=d,b),{}),sand:F.types.dowsing.nodes.value[0],wood:F.types.quarry.nodes.value[0],coal:F.types.empowerer.nodes.value[0],iron:F.types.portalGenerator.nodes.value[0]})),r=I(()=>Ct.reduce((b,d)=>{var te,we,st;const M=(st=(we=(te=n.value[d])==null?void 0:te.state)==null?void 0:we.amount)!=null?st:0;let E=l.floor(t.invertIntegral(M)).sub(10).clampMin(0),V=xt(t,E,!0,0);for(;;){const De=t.evaluate(E);if(l.add(V,De).lte(M))E=E.add(1),V=l.add(V,De);else break}return b[d]=E,b},{}));function s(b){var te,we,st;const d=(st=(we=(te=n.value[b])==null?void 0:te.state)==null?void 0:we.amount)!=null?st:0,M=r.value[b],E=xt(t,M,!0),V=xt(t,l.add(M,1),!0);return l.sub(d,E).max(0).div(l.sub(V,E)).toNumber()}const u=jt({}),o=jt({});gt(()=>{Ct.forEach(b=>{Xe(()=>r.value[b],(d,M)=>{l.gt(d,M)&&re.active===Z.id&&Ci.info(m("div",null,[m("h3",null,[l.eq(d,1)?`${Ze(b)} discovered`:`${Ze(b)} is now Level ${tt(d)}`,A("!")]),m("div",null,[A("Energy gain is now 1.01x higher.")])]))})})});const c=I(()=>[oe,Q,Pe,K].filter(b=>{var d,M;return(M=(d=b.value)==null?void 0:d.state)==null?void 0:M.powered}).length),f=I(()=>l.eq(c.value,0)?10:l.add(c.value,1).pow_base(100).div(10).times(.99)),v=I(()=>Pe.value==null?0:Pe.value.state.resources.reduce((d,M)=>l.div(100,yt[M].computedModifier.value).add(d),l.dZero)),g={id:"deselect",icon:"close",tooltip:b=>({text:"resources"in b.state?"Disconnect resources":"Disconnect tools"}),onClick(b){"resources"in b.state?b.state={...b.state,resources:[]}:"tools"in b.state&&(b.state={...b.state,tools:[]}),F.selectedAction.value=null,F.selectedNode.value=null},visibility:b=>"resources"in b.state?b.state.resources.length>0:"tools"in b.state?b.state.tools.length>0:!0},y={id:"toggle",icon:"bolt",tooltip:b=>({text:b.state.powered?"Turn Off":`Turn On - Always runs for ${tt(f.value)} energy/s`}),onClick(b){b.state={...b.state,powered:!b.state.powered},F.selectedAction.value=null},fillColor:b=>b.state.powered?"var(--accent1)":"var(--locked)"};function N(b,d=1/0){const M=b(p.variable(0));return{id:"moreConnections",icon:"hub",formula:M,tooltip(E){return{text:`Increase Connections - ${tt(M.evaluate(E.state.maxConnections))} energy`}},confirmationLabel:E=>l.gte(e.value,M.evaluate(E.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(E){const V=M.evaluate(E.state.maxConnections);l.gte(e.value,V)&&(e.value=l.sub(e.value,V)),E.state={...E.state,maxConnections:E.state.maxConnections+1},F.selectedAction.value=null},visibility:E=>E.state.maxConnectionsV!==M)}:b.state={...b.state,resources:[...E,M]},F.selectedNode.value=b}function x(b,d){if(d.type!=="passive")return!1;const M=d.state,{maxConnections:E,tools:V}=b.state;return V.includes(M)?!0:V.length!==E}function D(b,d){if(d.type!=="passive")return;const M=d.state,E=b.state.tools;E.includes(M)?b.state={...b.state,tools:E.filter(V=>V!==M)}:b.state={...b.state,tools:[...E,M]},F.selectedNode.value=b}const F=bl(b=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:Be.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===b.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[y],progress:d=>j(d)?new l(d.state.progress).toNumber():0,progressDisplay:Lt.Outline,progressColor:"var(--accent2)",classes:d=>({running:j(d)}),draggable:!0},brokenFactory:{shape:Be.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===b.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){l.gte(e.value,100)&&(d.type="factory",e.value=l.sub(e.value,100))},confirmationLabel:()=>l.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:Be.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var M,E;if(d===b.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${Te[d.state].name}`};if(((M=b.draggingNode.value)==null?void 0:M.type)==="resource"){const V=((E=b.draggingNode.value)==null?void 0:E.state).type,te=d.state===V?"Disconnect":Te[V].name,we=d.state===V||l.gte(e.value,Te[V].cost)&&i.value[V]==null?"var(--accent2)":"var(--danger)";return{text:te,color:we}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,b.selectedAction.value=null,b.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${Te[d.state].name} - ${tt(Te[d.state].cost)} energy`}),onClick(d){const M=Te[d.state];if(l.gte(e.value,M.cost)&&i.value[d.state]==null){e.value=l.sub(e.value,M.cost);const E={id:Un(b),position:{...d.position},type:M.type,state:M.state};b.placeInAvailableSpace(E),b.nodes.value.push(E),b.selectedAction.value=null,b.selectedNode.value=null,d.state=void 0}},fillColor:d=>l.gte(e.value,Te[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>l.gte(e.value,Te[d.state].cost)?i.value[d.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:d=>d.state==null||i.value[d.state]!=null?0:l.div(e.value,Te[d.state].cost).clampMax(1).toNumber(),progressDisplay:Lt.Fill,progressColor:d=>d.state!=null&&l.gte(e.value,Te[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,M){return M.type==="resource"},onDrop(d,M){const E=M.state.type;d.state===E?d.state=void 0:d.state=E,b.selectedNode.value=d},draggable:!0},resource:{shape:Be.Circle,size:50,title:d=>Ze(d.state.type),subtitle:d=>tt(d.state.amount),progress:d=>s(d.state.type),onClick(){},progressDisplay:Lt.Outline,progressColor:"var(--accent3)",classes:d=>{var M;return{"affected-node":Q.value!=null&&j(Q.value)&&Q.value.state.resources.includes(d.state.type)||l.neq((M=Oe.value[d.state.type])!=null?M:1,1)}},draggable:!0},passive:{shape:Be.Circle,size:50,title:d=>Te[d.state].name,label:d=>d===b.selectedNode.value?{text:ki[d.state].description(K.value!=null&&j(K.value)&&K.value.state.tools.includes(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":K.value!=null&&j(K.value)&&K.value.state.tools.includes(d.state)}),draggable:!0},dowsing:{shape:Be.Diamond,size:50,title:"\u{1F962}",label:d=>d===b.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,M=>`Double ${M} odds`),actionDistance:Math.PI/4,actions:[g,N(d=>d.add(2).pow_base(100),16),y],classes:d=>({running:j(d)}),canAccept:P,onDrop:q,draggable:!0},quarry:{shape:Be.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===b.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,M=>`Gather ${Rt(l.div(yt[M].computedModifier.value,100))} ${M}/s`),actionDistance:Math.PI/4,actions:[g,N(d=>d.add(2).pow_base(1e4),16),y],progress:d=>j(d)?l.eq(v.value,0)?0:new l(d.state.progress).div(v.value).toNumber():0,progressDisplay:Lt.Outline,progressColor:"var(--accent2)",canAccept:P,onDrop:q,classes:d=>({running:j(d)}),draggable:!0},empowerer:{shape:Be.Diamond,size:50,title:"\u{1F50C}",label:d=>d===b.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${d.state.maxConnections})`}:S(d,M=>`Double ${Te[M].name}'s effect`),actionDistance:Math.PI/4,actions:[g,N(d=>d.add(3).pow_base(1e3),16),y],canAccept:x,onDrop:D,classes:d=>({running:j(d)}),draggable:!0},portalGenerator:{shape:Be.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{var M,E;if(d===b.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};if(((M=b.draggingNode.value)==null?void 0:M.type)==="resource"){const V=((E=b.draggingNode.value)==null?void 0:E.state).type;return{text:d.state.tier===V?"Disconnect":`${Ze(V)}-tier Portal`,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(d){d.state={...d.state,tier:void 0,influences:[]},b.selectedAction.value=null,b.selectedNode.value=null},visibility:d=>{const{tier:M,influences:E}=d.state;return M!=null||E.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let M=0;for(;`portal-${M}`in ve;)M++;ni(Ji(`portal-${M}`,d.state.tier,Math.floor(Math.random()*4294967296)),Z);const E={id:Un(b),position:{...d.position},type:"portal",state:{id:`portal-${M}`,powered:!1}};b.placeInAvailableSpace(E),b.nodes.value.push(E),b.selectedAction.value=null,b.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,M){return M.type==="resource"||M.type==="influence"},onDrop(d,M){if(M.type==="resource"){const E=M.state.type,V=d.state.tier;d.state={...d.state,tier:E===V?void 0:E}}else if(M.type==="influence"){const E=M.state,V=d.state.influences;V.includes(E)?d.state={...d.state,influences:V.filter(te=>te!==E)}:d.state={...d.state,influences:[...V,E]}}b.selectedNode.value=d},draggable:!0},portal:{shape:Be.Diamond,size:50,title:"\u{1F300}",label:d=>d===b.selectedNode.value?{text:`Portal to ${ve[d.state.id].name}`,color:ve[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[y],classes:d=>({running:j(d),showNotif:ve[d.state.id].showNotif.value}),outlineColor:d=>ve[d.state.id].background,draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];return d.push(...Object.keys(u).map(M=>({startNode:oe.value,endNode:n.value[M],stroke:"var(--accent3)",strokeWidth:5}))),ae.value!=null&&ae.value.state!=null&&d.push({startNode:ae.value,endNode:n.value[ae.value.state],stroke:"var(--foreground)",strokeWidth:4}),Q.value!=null&&Q.value.state.resources.forEach(M=>{d.push({startNode:Q.value,endNode:n.value[M],stroke:j(Q.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Pe.value!=null&&Pe.value.state.resources.forEach(M=>{d.push({startNode:Pe.value,endNode:n.value[M],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(o).map(M=>({startNode:Pe.value,endNode:n.value[M],stroke:"var(--accent3)",strokeWidth:5}))),K.value!=null&&K.value.state.tools.forEach(M=>{d.push({startNode:K.value,endNode:i.value[M],stroke:j(K.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),J.value!=null&&(J.value.state.tier!=null&&d.push({startNode:J.value,endNode:n.value[J.value.state.tier],stroke:"var(--foreground)",strokeWidth:4}),b.types.portal.nodes.value.forEach(M=>{const E=ve[M.state.id];return E.links.value.forEach(V=>{V.value!=null&&d.push({startNode:M,endNode:V.value,stroke:j(M)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(E.resourceMultis.value).forEach(V=>{V!=="energy"&&V in n.value&&d.push({startNode:M,endNode:n.value[V],stroke:j(M)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),d})),d}}));function j(b){return b===F.selectedNode.value||b.state.powered}const oe=I(()=>F.types.mine.nodes.value[0]),ae=I(()=>F.types.factory.nodes.value[0]),Q=I(()=>i.value.sand),Pe=I(()=>i.value.wood),K=I(()=>i.value.coal),J=I(()=>i.value.iron);function pe(b,d){let M=n.value[b];if(d=l.times(d,Zt[b].computedModifier.value),M==null)M={id:Un(F),position:{...oe.value.position},type:"resource",state:{type:b,amount:d}},F.placeInAvailableSpace(M),F.nodes.value.push(M);else{const E=M.state;M.state={...E,amount:l.add(E.amount,d)}}}const Ie=I(()=>Object.keys(Ye).reduce((b,d)=>b+new l(yt[d].computedModifier.value).toNumber(),0)),Oe=I(()=>{const b={};return F.types.portal.nodes.value.forEach(d=>{if(!j(d))return;const E=ve[d.state.id].resourceMultis.value;Object.keys(E).forEach(V=>{b[V]!=null?b[V]=l.times(b[V],E[V]):b[V]=E[V]})}),b}),H=At(()=>[...Ct.map(b=>Nt(()=>({description:()=>`${Ze(b)} (Lv. ${tt(r.value[b])}) (${Rt(Ht.value)}x per level)`,multiplier:()=>l.pow(Ht.value,r.value[b]),enabled:()=>{var d,M;return b in n.value&&l.gt((M=(d=n.value[b].state)==null?void 0:d.amount)!=null?M:0,0)}}))),Nt(()=>({multiplier:()=>K.value!=null&&j(K.value)&&K.value.state.tools.includes("stone")?4:2,description:()=>(K.value!=null&&j(K.value)&&K.value.state.tools.includes("stone")?"Empowered ":"")+Te.stone.name,enabled:()=>i.value.stone!=null})),Nt(()=>({multiplier:()=>{var b;return(b=Oe.value.energy)!=null?b:1},description:"Planar Treasures",enabled:()=>{var b;return l.neq((b=Oe.value.energy)!=null?b:1,1)}})),Wn(()=>({addend:()=>l.pow(100,c.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>l.gt(c.value,0)}))]),U=I(()=>H.apply(1)),rt=At(()=>[Nt(()=>({multiplier:()=>K.value!=null&&j(K.value)&&K.value.state.tools.includes("dirt")?4:2,description:()=>(K.value!=null&&j(K.value)&&K.value.state.tools.includes("dirt")?"Empowered ":"")+Te.dirt.name,enabled:()=>i.value.dirt!=null}))]),_n=I(()=>rt.apply(1)),ht=At(()=>[Nt(()=>({multiplier:()=>K.value!=null&&j(K.value)&&K.value.state.tools.includes("gravel")?4:2,description:()=>(K.value!=null&&j(K.value)&&K.value.state.tools.includes("gravel")?"Empowered ":"")+Te.gravel.name,enabled:()=>i.value.gravel!=null}))]),bt=I(()=>ht.apply(1)),Wt=At(()=>[Wn(()=>({addend:()=>K.value!=null&&j(K.value)&&K.value.state.tools.includes("copper")?.002:.001,description:()=>(K.value!=null&&j(K.value)&&K.value.state.tools.includes("copper")?"Empowered ":"")+Te.copper.name,enabled:()=>i.value.copper!=null}))]),Ht=I(()=>Wt.apply(1.01)),yt=Object.keys(Ye).reduce((b,d)=>{const M=At(()=>[Nt(()=>({multiplier:2,description:"Dowsing",enabled:()=>Q.value!=null&&j(Q.value)&&Q.value.state.resources.includes(d)}))]),E=I(()=>M.apply(Ye[d])),V={title:`${Ze(d)} Drop Rate`,modifier:M,base:Ye[d]};return b[d]={modifier:M,computedModifier:E,section:V},b},{}),Zt=Object.keys(Ye).reduce((b,d)=>{const M=At(()=>[Nt(()=>({multiplier:()=>{var te;return(te=Oe.value[d])!=null?te:1},description:"Planar Treasures",enabled:()=>{var te;return l.neq((te=Oe.value[d])!=null?te:1,1)}}))]),E=I(()=>M.apply(1)),V={title:`${Ze(d)} Gain`,modifier:M};return b[d]={modifier:M,computedModifier:E,section:V},b},{}),[sn,Pt]=pn(()=>[{title:"Energy Gain",modifier:H,base:1,unit:"/s"}]),[Nn,Cn]=pn(()=>[{title:"Mining Speed",modifier:rt,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:ht,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:Wt,base:1.01,visible:()=>i.value.copper!=null}]),[kn,Re]=pn(()=>Object.values(yt).map(b=>b.section)),[on,Ft]=pn(()=>Object.values(Zt).map(b=>b.section)),at=Il({general:()=>({display:"Energy",glowColor(){return at.activeTab.value===this.tab?"white":""},tab:sn,energyTabCollapsed:Pt}),mining:()=>({display:"Mine",glowColor(){return at.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:Nn,miningTabCollapsed:Cn}),resources:()=>({display:"Mine Rates",glowColor(){return at.activeTab.value===this.tab?"white":""},visibility:()=>Q.value!=null,tab:kn,resourcesCollapsed:Re}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return at.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(Zt).some(b=>l.neq(b.computedModifier.value,1)),tab:on,resourceGainCollapsed:Ft})}),ln=R(!1),Yt=ne(()=>m(mt,{modelValue:ln.value,"onUpdate:modelValue":b=>ln.value=b},{header:()=>m("h2",null,[A("Modifiers")]),body:()=>Ue(at)}));this.on("preUpdate",b=>{if(Object.keys(u).forEach(d=>{u[d]-=b,u[d]<=0&&delete u[d]}),Object.keys(o).forEach(d=>{o[d]-=b,o[d]<=0&&delete o[d]}),j(oe.value)){const d=l.add(oe.value.state.progress,l.times(_n.value,b)),M=d.floor();oe.value.state={...oe.value.state,progress:l.sub(d,M)};const E=M.div(Ie.value).floor();E.gt(0)&&Ct.forEach(te=>{pe(te,l.times(new l(yt[te].computedModifier.value).toNumber(),E).times(bt.value)),u[te]=.3});const V=l.sub(M,E).toNumber();for(let te=0;te0){let E=l.add(d,b);const V=l.div(d,v.value).floor();E=l.sub(E,l.times(V,v.value)),Pe.value.state={...Pe.value.state,progress:E},l.gt(V,0)&&M.forEach(te=>{pe(te,V),o[te]=.3})}}e.value=l.add(e.value,l.times(U.value,b)),l.lt(e.value,0)&&(e.value=0,oe.value.state={...oe.value.state,powered:!1},Ci.warning(m("div",null,[m("h3",null,[A("Ran out of energy!")]),m("div",null,[A("All machines have been turned off.")])])))});const Sn=I(()=>{var b,d;return F.selectedAction.value===F.types.brokenFactory.actions[0]?-100:F.selectedAction.value===F.types.factory.actions[1]?l.neg(Te[F.selectedNode.value.state].cost):((b=F.selectedAction.value)==null?void 0:b.id)==="moreConnections"?l.neg(F.selectedAction.value.formula.evaluate(((d=F.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),xe=Dn(p.variable(0).add(e),()=>l.neq(Sn.value,0),Sn),ye=I(()=>{var b;return F.selectedAction.value===y?((b=F.selectedNode.value)==null?void 0:b.state).powered?l.eq(c.value,1)?10:l.pow(100,c.value).div(10).times(.99):l.neg(f.value):0}),wt=Dn(p.variable(0).add(U),()=>l.neq(ye.value,0),ye),Kt=I(()=>F.types.portal.nodes.value.filter(b=>j(b)));return Xe(Kt,b=>{gt(()=>{Z.tabs=["main",...b.map(d=>d.state.id)]})}),{name:"World",board:F,energy:e,modifierTabs:at,mineLootTable:Ye,tools:Te,passives:ki,resourceNodes:n,toolNodes:i,grantResource:pe,display:ne(()=>m(se,null,[m(Fn,{class:"nav-container"},{default:()=>[m("span",{class:"nav-segment"},[m("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Ue(xe)])," ",A("energy")]),m("span",{class:"nav-segment"},[A("("),m("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[l.gt(U.value,0)?"+":"",Ue(wt)]),A("/s)")]),l.gt(c.value,0)?m("span",{class:"nav-segment"},[m("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[tt(c.value)])," ",A("machines powered")]):null,m("span",{class:"nav-segment"},[m("button",{class:"button",style:"display: inline",onClick:()=>ln.value=!0},[A("open modifiers")])]),Z.devSpeed===0?m("span",{class:"nav-segment"},[A("Game Paused")]):Z.devSpeed!=null&&Z.devSpeed!==1?m("span",{class:"nav-segment"},[A("Dev Speed: "),Rt(Z.devSpeed),A("x")]):null]}),Ue(F),Ue(Yt)]))}}),Pc=e=>{var i,r,s,u;const t=[Xt];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const o=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(Ji(`portal-${n}`,(s=o.tier)!=null?s:"dirt",(u=o.seed)!=null?u:Math.floor(Math.random()*4294967296))),n++}return t},Xi=I(()=>!1);function Fc(e,t){}var Dc=Object.freeze(Object.defineProperty({__proto__:null,mineLootTable:Ye,resourceNames:Ct,main:Xt,getInitialLayers:Pc,hasWon:Xi,fixOldSave:Fc},Symbol.toStringTag,{value:"Module"}));const wn=e=>(Ut("data-v-4a50ce42"),e=e(),zt(),e),Oc={class:"game-over-modal-header"},Ac=["src","alt"],Vc={class:"game-over-modal-title"},qc=wn(()=>w("h2",null,"Congratulations!",-1)),Lc={key:0},Rc=wn(()=>w("br",null,null,-1)),Bc=wn(()=>w("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),jc=wn(()=>w("br",null,null,-1)),Uc=["href"],zc=wn(()=>w("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Gc=Y({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:s,versionTitle:u}=ce,o=I(()=>An(Z.timePlayed)),c=I(()=>Xi.value&&!Z.keepGoing),f=Tt(Z,"autosave");function v(){Z.keepGoing=!0}function g(){Vt(Qt())}return(y,N)=>(k(),ee(mt,{"model-value":a(c)},{header:z(()=>[w("div",Oc,[a(n)?(k(),$("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,Ac)):B("",!0),w("div",Vc,[qc,w("h4",null,"You've beaten "+ie(a(t))+" v"+ie(a(s))+": "+ie(a(u)),1)])])]),body:z(({shown:_})=>[_?(k(),$("div",Lc,[w("div",null,"It took you "+ie(a(o))+" to beat the game.",1),Rc,Bc,jc,w("div",null,[w("a",{href:a(r),class:"game-over-modal-discord-link"},[zc,A(" "+ie(a(i)),1)],8,Uc)]),m(dt,{title:"Autosave",modelValue:a(f),"onUpdate:modelValue":N[0]||(N[0]=S=>Se(f)?f.value=S:null)},null,8,["modelValue"])])):B("",!0)]),footer:z(()=>[w("div",{class:"game-over-footer"},[w("button",{onClick:v,class:"button"},"Keep Going"),w("button",{onClick:g,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Wc=fe(Gc,[["__scopeId","data-v-4a50ce42"]]);const Rn=e=>(Ut("data-v-2776d67d"),e=e(),zt(),e),Hc=Rn(()=>w("div",{class:"nan-modal-header"},[w("h2",null,"NaN value detected!")],-1)),Zc={key:0},Yc=Rn(()=>w("br",null,null,-1)),Kc=["href"],Jc=Rn(()=>w("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Xc=Rn(()=>w("br",null,null,-1)),Qc={class:"nan-footer"},ed=Y({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ce,i=R(!0),r=R(!0),s=Tt($e,"hasNaN"),u=R(null);Xe(s,y=>{y?(i.value=Z.autosave,r.value=Z.devSpeed===0):(Z.autosave=i.value,Z.devSpeed=r.value?0:null)});const o=I(()=>{var y;return(y=$e.NaNPath)==null?void 0:y.join(".")}),c=I(()=>$e.NaNPersistent!=null?$e.NaNPersistent.value:null);function f(){$e.NaNPersistent!=null&&($e.NaNPersistent.value=new l(0),$e.hasNaN=!1)}function v(){$e.NaNPersistent&&($e.NaNPersistent.value=new l(1),$e.hasNaN=!1)}function g(){$e.NaNPersistent&&($e.NaNPersistent.value=new l(NaN),$e.hasNaN=!1)}return(y,N)=>(k(),$(se,null,[m(mt,pt({modelValue:a(s),"onUpdate:modelValue":N[4]||(N[4]=_=>Se(s)?s.value=_:null)},y.$attrs),{header:z(()=>[Hc]),body:z(()=>[w("div",null,[A(' Attempted to assign "'+ie(a(o))+'" to NaN',1),a(c)?(k(),$("span",Zc,ie(" ")+"(previously "+ie(a(Rt)(a(c)))+")",1)):B("",!0),A(". Auto-saving has been "+ie(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Yc,w("div",null,[w("a",{href:a(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Jc,A(" "+ie(a(t)||"The Paper Pilot Community"),1)],8,Kc)]),Xc,m(dt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=_=>i.value=_)},null,8,["modelValue"]),a(ce).enablePausing?(k(),ee(dt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":N[1]||(N[1]=_=>r.value=_)},null,8,["modelValue"])):B("",!0)]),footer:z(()=>[w("div",Qc,[w("button",{onClick:N[2]||(N[2]=_=>{var S;return(S=u.value)==null?void 0:S.open()}),class:"button"},"Open Saves Manager"),w("button",{onClick:f,class:"button"},"Set to 0"),w("button",{onClick:v,class:"button"},"Set to 1"),a(c)&&a(l).neq(a(c),0)&&a(l).neq(a(c),1)?(k(),$("button",{key:0,onClick:N[3]||(N[3]=_=>s.value=!1),class:"button"}," Set to previous ")):B("",!0),w("button",{onClick:g,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),m(zi,{ref_key:"savesManager",ref:u},null,512)],64))}});var td=fe(ed,[["__scopeId","data-v-2776d67d"]]);const nd={key:0,class:"tpsDisplay"},id={key:0,class:"low"},rd=Y({__name:"TPS",setup(e){const t=I(()=>l.div($e.lastTenTicks.length,$e.lastTenTicks.reduce((s,u)=>s+u,0))),n=R([]);Ke(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=I(()=>n.value.reduce((s,u)=>l.max(s,u),0)),r=I(()=>l.sub(t.value,i.value).gt(1));return(s,u)=>a(t).isNan()?B("",!0):(k(),$("div",nd,[A(" TPS: "+ie(a(tt)(a(t)))+" ",1),m(tn,{name:"fade"},{default:z(()=>[a(r)?(k(),$("span",id,ie(a(tt)(a(i))),1)):B("",!0)]),_:1})]))}});var ad=fe(rd,[["__scopeId","data-v-46a3ed5b"]]);var sd=Y({__name:"App",setup(e){const t=ce.useHeader,n=I(()=>nt[re.theme].variables),i=Tt(re,"showTPS"),r=I(()=>ue(ne(()=>m(se,null,[Ca.map(Ue)]))));return(s,u)=>(k(),$(se,null,[w("div",{id:"modal-root",style:Le(a(n))},null,4),w("div",{class:ge(["app",{useHeader:a(t)}]),style:Le(a(n))},[a(t)?(k(),ee(Gi,{key:0})):B("",!0),m(Ro),a(a(i))?(k(),ee(ad,{key:1})):B("",!0),m(Wc),m(td),(k(),ee(Ae(a(r))))],6)],64))}});var od=fe(sd,[["__scopeId","data-v-41d15e5e"]]);function ld(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:u}=e;let o,c,f,v;const g=async(N=!0)=>{await f,N&&(o==null||o.addEventListener("controlling",_=>{_.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function y(){if("serviceWorker"in navigator){const{Workbox:N,messageSW:_}=await mn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await _(c.waiting,{type:"SKIP_WAITING"})},o=new N("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",S=>{S.isUpdate||i==null||i()});{const S=()=>{n==null||n()};o.addEventListener("waiting",S),o.addEventListener("externalwaiting",S)}o.register({immediate:t}).then(S=>{c=S,s?s("./sw.js",S):r==null||r(S)}).catch(S=>{u==null||u(S)})}}return f=y(),g}function ud(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:u}=e,o=R(!1),c=R(!1);return{updateServiceWorker:ld({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:s,onRegisterError:u}),offlineReady:c,needRefresh:o}}document.title=ce.title;window.projInfo=ce;if(ce.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 ha();const{globalBus:e}=await mn(()=>Promise.resolve().then(function(){return ma}),void 0),{startGameLoop:t}=await mn(()=>import("./gameLoop.8e2ab203.js"),["assets/gameLoop.8e2ab203.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","assets/unique-names-generator.5494b30b.js"]),n=window.vue=lr(od);e.emit("setupVue",n),n.mount("#app"),gt(()=>{const i=Yn(),{updateServiceWorker:r}=ud({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(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{l as D,mn as _,$e as a,ce as b,Dc as c,Ve as g,ba as l,Z as p,re as s}; diff --git a/assets/index.6980da7f.js b/assets/index.6980da7f.js deleted file mode 100644 index 13781e2..0000000 --- a/assets/index.6980da7f.js +++ /dev/null @@ -1,18 +0,0 @@ -/* empty css */import"./vue.c16a309b.js";import{_ as I,C as a,l as Ce,q as Ut,t as R,b2 as Ke,ab as Z,aF as k,a1 as $,a2 as w,aL as dt,G as ge,aD as Si,w as ze,b3 as Ye,a9 as m,O as se,ap as Qi,az as Fn,as as ft,aH as kn,A as ye,$ as Q,b7 as U,b9 as Wn,ar as gt,bv as Qt,a8 as A,bt as er,bc as en,T as tr,u as Hn,j as nr,bw as It,aM as xt,a0 as B,aO as Oe,J as te,I as qe,aI as zt,aG as Gt,z as $t,bo as ir,bs as rr,aK as tn,bd as oi,am as Mn,H as ar,bx as sr,bf as or}from"./@vue.6b211d3c.js";import{c as Mi}from"./nanoevents.1080beb7.js";import{L as kt}from"./lz-string.dccec454.js";import{Y as lr}from"./vue-next-select.ded54c4a.js";import{D as ur}from"./vuedraggable.1879de79.js";import{p as cr}from"./vue-textarea-autosize.35804eaf.js";import{P as dr}from"./vue-panzoom.8ce6f9b1.js";import{s as fr,u as Zn}from"./vue-toastification.9c2dad53.js";import{n as gr,t as pr,l as mr}from"./unique-names-generator.5494b30b.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 vr=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 s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerpolicy&&(s.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?s.credentials="include":r.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}};vr();const hr="modulepreload",li={},br="./",gn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${br}${i}`,i in li)return;li[i]=!0;const r=i.endsWith(".css"),s=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":hr,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((o,c)=>{l.addEventListener("load",o),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},yr="./projInfo-schema.json",wr="Planar Pioneers",_r="A game about controlling and exploiting planes!",Nr="planar-pioneers",Cr="thepaperpilot",kr="",Sr="",Mr="0.0",Ir="Initial Commit",xr=!1,$r=!1,Er=2,Tr=!0,Pr=null,Fr="",Dr=["main"],Or=3600,Ar=0,Vr=!0,qr="base64";var ce={$schema:yr,title:wr,description:_r,id:Nr,author:Cr,discordName:kr,discordLink:Sr,versionNumber:Mr,versionTitle:Ir,allowGoBack:xr,defaultShowSmall:$r,defaultDecimalsShown:Er,useHeader:Tr,banner:Pr,logo:Fr,initialTabs:Dr,maxTickLength:Or,offlineLimit:Ar,enablePausing:Vr,exportEncoding:qr};class Lr{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 Rr(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 Rr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Rn=17,Br=9e15,jr=Math.log10(9e15),Ur=1/9e15,zr=308,Gr=-324,ui=5,Wr=(1<<10)-1,Hr=function(){const e=[];for(let n=Gr+1;n<=zr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Dt=[2,Math.E,3,4,5,6,7,8,9,10],Zr=[[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]],Yr=[[-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 u.fromValue_noAlloc(t)},G=function(e,t,n){return u.fromComponents(e,t,n)},J=function(t,n,i){return u.fromComponents_noNormalize(t,n,i)};const wt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(s.toFixed(Math.max(i-r,0)))},Bn=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Kr=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},Ii=.5671432904097838,ci=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Ii;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let 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 J(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)),G(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return v.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(v.sub(1,n.pow(e))).div(v.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const s=t.add(i.mul(n)).sub(n.div(2)),l=s.pow(2);return s.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=Br)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=v.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const _=parseFloat(i[0]),S=parseFloat(i[1]),P=i[1].split(";");let q=1;if(P.length===2&&(q=parseFloat(P[1]),isFinite(q)||(q=1)),isFinite(_)&&isFinite(S)){const x=v.pentate(_,S,q);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const _=parseFloat(r[0]),S=parseFloat(r[1]),P=r[1].split(";");let q=1;if(P.length===2&&(q=parseFloat(P[1]),isFinite(q)||(q=1)),isFinite(_)&&isFinite(S)){const x=v.tetrate(_,S,q);return this.sign=x.sign,this.layer=x.layer,this.mag=x.mag,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const _=parseFloat(s[0]),S=parseFloat(s[1]);if(isFinite(_)&&isFinite(S)){const P=v.pow(_,S);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,o,c=e.split("pt");if(c.length===2){l=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(l)&&isFinite(o)){const S=v.tetrate(l,o,_);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,o=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let _=parseFloat(c[1]);if(isFinite(_)||(_=1),isFinite(l)&&isFinite(o)){const S=v.tetrate(l,o,_);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}}const f=e.split("e"),h=f.length-1;if(h===0){const _=parseFloat(e);if(isFinite(_))return this.fromNumber(_),v.fromStringCache.size>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}else if(h===1){const _=parseFloat(e);if(isFinite(_)&&_!==0)return this.fromNumber(_),v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}const p=e.split("e^");if(p.length===2){this.sign=1,p[0].charAt(0)=="-"&&(this.sign=-1);let _="";for(let S=0;S=43&&P<=57||P===101)_+=p[1].charAt(S);else return this.layer=parseFloat(_),this.mag=parseFloat(p[1].substr(S+1)),this.normalize(),v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}}if(h<1)return this.sign=0,this.layer=0,this.mag=0,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this;const y=parseFloat(f[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this;let N=parseFloat(f[f.length-1]);if(h>=2){const _=parseFloat(f[f.length-2]);isFinite(_)&&(N*=Math.sign(_),N+=Bn(_))}if(!isFinite(y))this.sign=f[0]==="-"?-1:1,this.layer=h,this.mag=N;else if(h===1)this.sign=Math.sign(y),this.layer=1,this.mag=N+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=h,h===2){const _=v.mul(G(1,2,N),C(y));return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}else this.mag=N;return this.normalize(),v.fromStringCache.maxSize>=1&&v.fromStringCache.set(t,v.fromDecimal(this)),this}fromValue(e){return e instanceof v?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:wt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:wt(this.mag,e)}toString(){return isNaN(this.layer)||isNaN(this.sign)||isNaN(this.mag)?"NaN":this.mag===Number.POSITIVE_INFINITY||this.layer===Number.POSITIVE_INFINITY?this.sign===1?"Infinity":"-Infinity":this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toString():this.m+"e"+this.e:this.layer===1?this.m+"e"+this.e:this.layer<=ui?(this.sign===-1?"-":"")+"e".repeat(this.layer)+this.mag:(this.sign===-1?"-":"")+"(e^"+this.layer+")"+this.mag}toExponential(e){return this.layer===0?(this.sign*this.mag).toExponential(e):this.toStringWithDecimalPlaces(e)}toFixed(e){return this.layer===0?(this.sign*this.mag).toFixed(e):this.toStringWithDecimalPlaces(e)}toPrecision(e){return this.e<=-7?this.toExponential(e-1):e>this.e?this.toFixed(e-this.exponent-1):this.toExponential(e-1)}valueOf(){return this.toString()}toJSON(){return this.toString()}toStringWithDecimalPlaces(e){return this.layer===0?this.mag<1e21&&this.mag>1e-7||this.mag===0?(this.sign*this.mag).toFixed(e):wt(this.m,e)+"e"+wt(this.e,e):this.layer===1?wt(this.m,e)+"e"+wt(this.e,e):this.layer<=ui?(this.sign===-1?"-":"")+"e".repeat(this.layer)+wt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+wt(this.mag,e)}abs(){return J(this.sign===0?0:1,this.layer,this.mag)}neg(){return J(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?v.dZero:this.layer===0?G(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?v.dZero:this.layer===0?G(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?v.dZero:this.layer===0?G(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?v.dZero:this.layer===0?G(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 J(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(v.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return v.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),s=i.layer*Math.sign(i.mag);if(r-s>=2)return n;if(r===0&&s===-1){if(Math.abs(i.mag-Math.log10(n.mag))>Rn)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),o=i.sign+n.sign*l;return G(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}if(r===1&&s===0){if(Math.abs(n.mag-Math.log10(i.mag))>Rn)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),o=i.sign+n.sign*l;return G(Math.sign(o),1,Math.log10(i.mag)+Math.log10(Math.abs(o)))}}if(Math.abs(n.mag-i.mag)>Rn)return n;{const l=Math.pow(10,n.mag-i.mag),o=i.sign+n.sign*l;return G(Math.sign(o),1,i.mag+Math.log10(Math.abs(o)))}}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 J(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return J(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 v.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return G(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return G(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return G(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=G(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(G(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return G(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=G(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(G(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return G(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?v.dNaN:this.layer===0?G(this.sign,0,1/this.mag):G(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=Bn(r)),this.layer0?G(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):G(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?v.dNaN:this.layer>0?G(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):G(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?v.dNaN:this.layer===0&&e.layer===0?G(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):v.div(this.log10(),e.log10())}log2(){return this.sign<=0?v.dNaN:this.layer===0?G(this.sign,0,Math.log2(this.mag)):this.layer===1?G(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?G(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):G(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?v.dNaN:this.layer===0?G(this.sign,0,Math.log(this.mag)):this.layer===1?G(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?G(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):G(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)?J(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return J(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:v.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return v.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 G(1,0,t);if(e.sign===0)return v.dOne;e=J(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?G(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?G(-e.sign,e.layer+1,-e.mag):v.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?v.exp(v.mul(this,v.ln(this).sub(1))):v.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(J(1,0,24)))return v.fromNumber(Kr(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,s=1/r,l=t+s;if(l===t||(t=l,i=i*n,r=360*i,s=1/r,l=t-s,l===t))return v.exp(t);t=l,i=i*n,r=1260*i;let o=1/r;return t=t+o,i=i*n,r=1680*i,o=1/r,t=t-o,v.exp(t)}else return this.layer===1?v.exp(v.mul(this,v.ln(this).sub(1))):v.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?v.dOne:this.layer===0&&this.mag<=709.7?v.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?G(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?G(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):G(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return v.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return G(1,2,Math.log10(this.mag)-.3010299956639812);{const e=v.div(J(this.sign,this.layer-1,this.mag),J(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=J(1,0,1)){if(e===1)return v.pow(this,t);if(e===0)return new v(t);if(this.eq(v.dOne))return v.dOne;if(this.eq(-1))return v.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return v.fromNumber(Math.E);const s=v.ln(this).neg();return s.lambertw().div(s)}else return r>1.444667861009766?v.fromNumber(Number.POSITIVE_INFINITY):v.dNaN}if(this.eq(v.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),v.fromNumber(r)}if(e<0)return v.iteratedlog(t,this,-e);t=C(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(v.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r3)return J(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=J(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return v.tetrate(e,-t,this);e=C(e);let n=v.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const s=Math.min(t,n.layer-e.layer-3);t-=s,n.layer-=s}for(let s=0;s1e4)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,s=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),s+=n,n===0)break}return v.fromNumber(s)}slog_internal(e=10){if(e=C(e),e.lte(v.dZero)||e.eq(v.dOne))return v.dNaN;if(e.lt(v.dOne))return this.eq(v.dOne)?v.dZero:this.eq(v.dZero)?v.dNegOne:v.dNaN;if(this.mag<0||this.eq(v.dZero))return v.dNegOne;let t=0,n=v.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(v.dZero))n=v.pow(e,n),t-=1;else{if(n.lte(v.dOne))return v.fromNumber(t+v.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=v.log(n,e)}return v.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:v.critical_section(e,t,Yr)}static tetrate_critical(e,t){return v.critical_section(e,t,Zr)}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 o=(e-Dt[l])/(Dt[l+1]-Dt[l]);i=n[l][Math.floor(t)]*(1-o)+n[l+1][Math.floor(t)]*o,r=n[l][Math.ceil(t)]*(1-o)+n[l+1][Math.ceil(t)]*o;break}const s=t-Math.floor(t);return i<=0||r<=0?i*(1-s)+r*s:Math.pow(e,Math.log(i)/Math.log(e)*(1-s)+Math.log(r)/Math.log(e)*s)}layeradd10(e){e=v.fromValue_noAlloc(e).toNumber();const t=v.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?v.tetrate(t,i):Number.isFinite(i)?i>=-1?v.log(v.tetrate(t,i+1),t):v.log(v.log(v.tetrate(t,i+2),t),t):v.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return v.fromNumber(ci(this.toNumber()));if(this.layer===0)return v.fromNumber(ci(this.sign*this.mag));if(this.layer===1)return di(this);if(this.layer===2)return di(this);if(this.layer>=3)return J(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return J(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=J(1,0,1)){t=C(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(v.dOne)?(++e,t=v.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?v.fromNumber(Math.sin(this.sign*this.mag)):J(0,0,0)}cos(){return this.mag<0?v.dOne:this.layer===0?v.fromNumber(Math.cos(this.sign*this.mag)):J(0,0,0)}tan(){return this.mag<0?this:this.layer===0?v.fromNumber(Math.tan(this.sign*this.mag)):J(0,0,0)}asin(){return this.mag<0?this:this.layer===0?v.fromNumber(Math.asin(this.sign*this.mag)):J(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?v.fromNumber(Math.acos(this.toNumber())):this.layer===0?v.fromNumber(Math.acos(this.sign*this.mag)):J(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?v.fromNumber(Math.atan(this.sign*this.mag)):v.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 v.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return v.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?J(Number.NaN,Number.NaN,Number.NaN):v.ln(this.add(1).div(v.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(v.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 u=v;u.fromStringCache=new Lr(Wr);u.dZero=J(0,0,0);u.dOne=J(1,0,1);u.dNegOne=J(-1,0,1);u.dTwo=J(1,0,2);u.dTen=J(1,0,10);u.dNaN=J(Number.NaN,Number.NaN,Number.NaN);u.dInf=J(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);u.dNegInf=J(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);u.dNumberMax=G(1,0,Number.MAX_VALUE);u.dNumberMin=G(1,0,Number.MIN_VALUE);C=u.fromValue_noAlloc;G=u.fromComponents;J=u.fromComponents_noNormalize;u.fromMantissaExponent;u.fromMantissaExponent_noNormalize;const Jr=new u(1);function un(e,t,n=!0){let i=u.log10(e).floor(),r=u.div(e,u.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=Jr,i=i.add(1));const s=i.gte(1e9)?Ie(i,Math.max(Math.max(t,3),ce.defaultDecimalsShown)):i.gte(1e4)?In(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function In(e,t){if(e==null)return"NaN";if(e=new u(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 xi(e,t){return e==null?"NaN":(e=new u(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ce.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Xr=new u("eeee1000"),Qr=new u("e100000"),fi=new u("e1000"),$i=new u(1e9),ea=new u(1e6),ta=new u(1e3),na=new u(.98),ia=new u(.001),Ei=new u(0);function Ie(e,t,n){if(t==null&&(t=ce.defaultDecimalsShown),n=n!=null?n:ce.defaultShowSmall,e=new u(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Ie(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Xr)){const i=e.slog();return i.gte(ea)?"F"+Ie(i.floor()):u.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+In(i.floor(),0)}else{if(e.gte(Qr))return un(e,0,!1);if(e.gte(fi))return un(e,0);if(e.gte($i))return un(e,t);if(e.gte(ta))return In(e,0);if(e.gte(ia)||!n)return xi(e,t);if(e.eq(Ei))return 0 .toFixed(t)}return e=Pi(e),e.lt(fi)?un(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Ie(e,t)+"\u207B\xB9"}function We(e){return e=new u(e),e.sign<0?"-"+We(e.neg()):e.gte($i)||e.lte(na)&&!e.eq(Ei)?Ie(e):Ie(e,0)}function Ti(e){return u.lt(e,0)?"-"+Ti(u.neg(e)):u.gt(e,2**51)?Ie(u.div(e,31536e3))+"y":(e=new u(e).toNumber(),e<60?Ie(e)+"s":e<3600?We(Math.floor(e/60))+"m "+Ie(e%60)+"s":e<86400?We(Math.floor(e/3600))+"h "+We(Math.floor(e/60)%60)+"m "+We(e%60)+"s":e<31536e3?We(Math.floor(e/84600)%365)+"d "+We(Math.floor(e/3600)%24)+"h "+We(Math.floor(e/60)%60)+"m":We(Math.floor(e/31536e3))+"y "+We(Math.floor(e/84600)%365)+"d "+We(Math.floor(e/3600)%24)+"h")}function ra(e,t,n){e=new u(e);let i=e.toStringWithDecimalPlaces(t);return new u(i).gte(n)&&(i=u.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function aa(e,t){return Ie(e,t,!0)}function Pi(e){let t=u.log10(e).ceil();const n=u.div(e,u.pow(10,t));return t=t.neg(),e=new u(10).pow(t).times(n),e}var sa=Object.freeze(Object.defineProperty({__proto__:null,default:u,exponentialFormat:un,commaFormat:In,regularFormat:xi,format:Ie,formatWhole:We,formatTime:Ti,toPlaces:ra,formatSmall:aa,invertOOM:Pi},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:oa,commaFormat:la,regularFormat:ua,format:Rt,formatWhole:Xe,formatTime:Dn,toPlaces:ca,formatSmall:Bt,invertOOM:da}=sa;window.Decimal=u;window.exponentialFormat=oa;window.commaFormat=la;window.regularFormat=ua;window.format=Rt;window.formatWhole=Xe;window.formatTime=Dn;window.toPlaces=ca;window.formatSmall=Bt;window.invertOOM=da;function He(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function xn(e){return typeof e=="function"}var W=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(W||{});const pn=Symbol("DoNotCache");function O(e,t){const n=e[t];xn(n)&&n.length===0&&!n[pn]?e[t]=I(n.bind(e)):xn(n)&&(e[t]=n.bind(e),e[t][pn]=!0)}function xe(e){return xn(e)&&!e[pn]&&(e=I(e)),e}const rt=Symbol("Component"),et=Symbol("GatherProps");let fa=0;function On(e="feature-"){return e+fa++}var ke=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(ke||{});function Je(e){const t=a(e);return t!==2&&t!==!1}function nn(e){return a(e)===1}function ie(e){return e[pn]=!0,e}function de(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function ga(e,...t){const n=[],i=r=>{Object.keys(r).forEach(s=>{const l=r[s];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof u)&&!Ce(l)&&i(l))})};return i(e),n}const Ot={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 Yn=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Yn||{}),Qe={classic:Ot,paper:{...Ot,variables:{...Ot.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:{...Ot,variables:{...Ot.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:{...Ot,variables:{...Ot.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ae=Mi();"fonts"in document&&(document.fonts.onloadingdone=()=>Ae.emit("fontsLoaded"));var pa=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ae},Symbol.toStringTag,{value:"Module"}));const ma=Ut({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var H=window.player=ma;function Fi(e){return JSON.stringify(e,(t,n)=>a(n))}function Di(e={}){return Object.assign({id:`${ce.id}-0`,name:"Default Save",tabs:ce.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ce.id,modVersion:ce.versionNumber,layers:{}},e)}function je(e){const t=kt.compressToUTF16(Fi(e!=null?e:H));return localStorage.setItem((e!=null?e:H).id,t),t}async function va(){ya();try{let e=localStorage.getItem(re.active);if(e==null){await Vt(Xt());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=kt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ce.id){await Vt(Xt());return}t.id=re.active,await Vt(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await Vt(Xt())}}function Xt(){const e=Sn(),t=Di({id:e});return je(t),re.saves.push(e),t}function Sn(){let e,t=0;do e=`${ce.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const ha=R(!1);async function Vt(e){console.info("Loading save",e),ha.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await gn(()=>Promise.resolve().then(function(){return Ba}),void 0),{fixOldSave:r,getInitialLayers:s}=await gn(()=>Promise.resolve().then(function(){return Pc}),void 0);for(const l in t){const o=t[l];o&&n(o)}s(e).forEach(l=>i(l,e)),e=Di(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,ce.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ce.versionNumber&&(r(e.modVersion,e),e.modVersion=ce.versionNumber),Object.assign(H,e),re.active=H.id,Ae.emit("onLoad")}setInterval(()=>{H.autosave&&je()},1e3);window.onbeforeunload=()=>{H.autosave&&je()};window.save=je;const ba=window.hardReset=async()=>{await Vt(Xt())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(H.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const mn=Ut({active:"",saves:[],showTPS:!0,theme:Yn.Nordic,unthrottled:!1,alignUnits:!1});Ke(mn,e=>{const t=kt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ce.id,t)},{deep:!0});var re=window.settings=mn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Yn.Nordic,alignUnits:!1};Ae.emit("loadSettings",e),Object.assign(mn,e),ba()};function ya(){try{let e=localStorage.getItem(ce.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=kt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(mn,t)}Ae.emit("loadSettings",mn)}catch{}}const Oi=Ut([]);function wa(e){Oi.push(e)}const _a=Ut([]),Na=Ut([]),Ca={class:"table"},ka=Z({__name:"Row",setup(e){const t=I(()=>Qe[re.theme].mergeAdjacent);return(n,i)=>(k(),$("div",Ca,[w("div",{class:ge(["row",{mergeAdjacent:a(t)}])},[dt(n.$slots,"default")],2)]))}});function Sa(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Qi(e)}function ue(e,t="span"){return typeof e=="function"?Z({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),Z({template:e})):Z({render:()=>({})}):e}function Ue(e){if(at(e))return typeof e=="function"?e():ue(e);const t=e[rt];return m(t,e[et](),null)}function Ma(...e){let t;return m(ka,null,Sa(t=e.map(Ue))?t:{default:()=>[t]})}function tt(e){if(at(e))return typeof e=="function"?e():typeof e=="string"?m(se,null,[e]):m(e,null,null);const t=e[rt];return m(t,e[et](),null)}function gi(e,t){return e.reduce((n,i)=>m(se,null,[n,t,i]))}function at(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[pn]===!0}function Ai(e,t){const n=R(null),i=R(void 0);function r(o){n.value||(n.value=setInterval(l,250)),i.value=o}function s(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Si(s),{start:r,stop:s,handleHolding:l}}function Vi(e,t="div"){const n=ze();return Ye(()=>{n.value=ue($e(e),t)}),n}function hn(e,t="div"){const n=ze(null);return Ye(()=>{const i=$e(e);n.value=i==""||i==null?null:ue(i,t)}),n}function $e(e){return a(a(e))}function L(...e){return e.includes(Object)||e.push(Object),e}function Ia(e){const t=R(!1),n=e[et].bind(e);return e[et]=()=>({...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 xa=Z({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=R({}),i=new ResizeObserver(o),r=R(null);Fn(()=>{const p=r.value;p!=null&&i.observe(p)});let s=!0,l=R((h=r.value)==null?void 0:h.getBoundingClientRect());function o(){s&&(s=!1,ft(()=>{var p;l.value=(p=r.value)==null?void 0:p.getBoundingClientRect(),Object.values(n.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}Ae.on("fontsLoaded",o);const c={attributes:!1,childList:!0,subtree:!1};kn(Kn,(p,y)=>{const N=new MutationObserver(()=>f(p));N.observe(y,c),n.value[p]={element:y,observer:N,rect:y.getBoundingClientRect()},o()}),kn(Jn,p=>{var y;(y=n.value[p])==null||y.observer.disconnect(),n.value[p]=void 0,o()}),kn(Xn,n),kn(Qn,l);function f(p){const y=n.value[p];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",n.value))}return(p,y)=>(k(),$(se,null,[dt(p.$slots,"default",{},void 0,!0),w("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var qi=fe(xa,[["__scopeId","data-v-2b1dc1bc"]]);const $a=["onPointerdown"],Ea={class:"modal-wrapper"},Ta={class:"modal-container"},Pa={class:"modal-header"},Fa={class:"modal-body"},Da={class:"modal-footer"},Oa=w("div",{class:"modal-default-flex-grow"},null,-1),pt=Z({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=ye(e),s=I(()=>a(r.modelValue)||o.value);function l(){n("update:modelValue",!1)}const o=R(!1),c=R(null),f=I(()=>{var h,p;return(p=(h=c.value)==null?void 0:h.nodes)!=null?p:null});return t({isOpen:s,nodes:f}),(h,p)=>(k(),Q(tr,{to:"#modal-root"},[m(en,{name:"modal",onBeforeEnter:p[0]||(p[0]=y=>o.value=!0),onAfterLeave:p[1]||(p[1]=y=>o.value=!1)},{default:U(()=>[Wn(w("div",gt({class:"modal-mask",onPointerdown:Qt(l,["self"])},h.$attrs),[w("div",Ea,[w("div",Ta,[w("div",Pa,[dt(h.$slots,"header",{shown:a(s)},()=>[A(" default header ")])]),w("div",Fa,[m(qi,{ref_key:"contextRef",ref:c},{default:U(()=>[dt(h.$slots,"body",{shown:a(s)},()=>[A(" default body ")])]),_:3},512)]),w("div",Da,[dt(h.$slots,"footer",{shown:a(s)},()=>[w("div",{class:"modal-default-footer"},[Oa,w("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,$a),[[er,e.modelValue]])]),_:3})]))}}),Ct=Symbol("ProxyState");function nt(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(s,l){if(l===Ct)return r();const o=r()[l];return o!=null&&typeof o=="object"&&it in o?o[it]:o},set(s,l,o){return r()[l]=o,!0},has(s,l){return l===Ct?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(s,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(s,l)}})}var Me=window.state=Hn({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const St=Symbol("PersistentState"),vn=Symbol("DefaultValue"),$n=Symbol("StackTrace"),En=Symbol("Deleted"),it=Symbol("NonPersistent"),qt=Symbol("SaveDataPath"),zn=Symbol("SkipPersistence");function Aa(){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 pi(e,t){var n;if(u.isNaN(t))throw Me.hasNaN||(H.autosave=!1,Me.hasNaN=!0,Me.NaNPath=e[qt],Me.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[qt])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[St].value=t}function st(e,t=!0){const n=Ce(e)?e:R(e);Ce(e)&&(e=e.value);const i=I({get(){return n.value},set(s){t?pi(r,s):r[St].value=s}});i[vn]=e;const r={get value(){return n.value},set value(s){t?pi(r,s):r[St].value=s},__v_isRef:!0,[St]:n,[vn]:e,[$n]:Aa(),[En]:!1,[it]:i,[qt]:void 0};return Ve.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,` -Created at: -`+r[$n]):jt[Ve[Ve.length-1]].add(r),r}function Va(e){return e!=null&&typeof e=="object"&&St in e}function mi(e){return!(Ct in e)&&it in e?e[it]:new Proxy(e,{get(t,n){if(n!==St)return n===zn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===St?!1:n==zn?!0:Reflect.has(t,n)}})}function Li(e){Ve.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):jt[Ve[Ve.length-1]].delete(e),e[En]=!0}Ae.on("addLayer",(e,t)=>{const n=[],i=(r,s=[])=>{let l=!1;return Object.keys(r).forEach(o=>{let c=r[o];if(c!=null&&typeof c=="object"){if(c[zn]===!0)return;if(Ct in c&&(c=c[Ct]),Va(c)){if(l=!0,c[En]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` -Created at: -`+c[$n]);return}jt[e.id].delete(c);const f=[e.id,...s,o];c[qt]!=null&&JSON.stringify(f)!==JSON.stringify(c[qt])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${c[qt].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[qt]=f;const h=s.reduce((y,N)=>(N in y||(y[N]={}),y[N]),t),p=h[o];h[o]=c[St],nr(h)?p!=null?h[o]=p:h[o]=c[vn]:p!=null?h[o].value=p:h[o].value=c[vn]}else!(c instanceof u)&&!Ce(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...s,o])&&(It(c)&&!It(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.",Ct in r?r[Ct]:r,o):l=!0))}}),l};i(e[Ct]),jt[e.id].forEach(r=>{r[En]||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[$n])}),jt[e.id].clear()});const Kn=Symbol("RegisterNode"),Jn=Symbol("UnregisterNode"),Xn=Symbol("Nodes"),Qn=Symbol("Bounds"),he=Hn({});window.layers=he;const jt={},Ve=[];function ei(e,t){return nt(()=>{const n={},i=n.emitter=Mi();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=R({}),n.id=e,Ve.push(e),jt[e]=new Set,n.minimized=st(!1,!1),Object.assign(n,t.call(n,n)),Ve[Ve.length-1]==null||Ve[Ve.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen -Stack: ${Ve} -Trying to pop ${n.id}`;Ve.pop(),O(n,"color"),O(n,"display"),O(n,"classes"),O(n,"style"),O(n,"name"),de(n,"name",n.id),O(n,"minWidth"),de(n,"minWidth",600),O(n,"minimizable"),de(n,"minimizable",!0),O(n,"minimizedDisplay");const r=n.style;return n.style=I(()=>{var l,o;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(l=a(r))!=null?l:"",(o=n.minimized)!=null&&o.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function ti(e,t){if(console.info("Adding layer",e.id),he[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,he[e.id]);return}de(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),he[e.id]=e,Ae.emit("addLayer",e,t.layers[e.id])}function qa(e){return he[e]}function Ri(e){console.info("Removing layer",e.id),Ae.emit("removeLayer",e),he[e.id]=void 0}function La(e){Ri(e),ti(e,H)}function Ra(e){const t=R(!1);return{openModal:()=>t.value=!0,modal:ie(()=>m(pt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>m("h2",null,[a(e.name)]),body:a(e.display)}))}}Ae.on("update",function(t){Object.values(he).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(he).forEach(n=>{n==null||n.emit("update",t)}),Object.values(he).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ba=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Kn,UnregisterNodeInjectionKey:Jn,NodesInjectionKey:Xn,BoundsInjectionKey:Qn,layers:he,persistentRefs:jt,addingLayers:Ve,createLayer:ei,addLayer:ti,getLayer:qa,removeLayer:Ri,reloadLayer:La,setupLayerModal:Ra},Symbol.toStringTag,{value:"Module"}));const ja=Z({components:{Context:qi},props:{index:{type:Number,required:!0},display:{type:L(Object,String,Function),required:!0},minimizedDisplay:L(Object,String,Function),minimized:{type:Object,required:!0},name:{type:L(String),required:!0},color:L(String),minimizable:L(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=ye(e),s=Vi(t),l=hn(r),o=I(()=>ce.allowGoBack&&n.value>0&&!$e(i));function c(){H.tabs.splice(a(e.index),1/0)}function f(h){e.nodes.value=h}return{component:s,minimizedComponent:l,showGoBack:o,updateNodes:f,unref:a,goBack:c}}}),Ua={key:1};function za(e,t,n,i,r,s){const l=xt("Context");return k(),$("div",{class:"layer-container",style:qe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(k(),$("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...o)=>e.goBack&&e.goBack(...o))},"\u274C")):B("",!0),e.unref(e.minimized)?(k(),$("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=o=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(k(),Q(Oe(e.minimizedComponent),{key:0})):(k(),$("div",Ua,te(e.unref(e.name)),1))])):(k(),$("div",{key:2,class:ge(["layer-tab",{showGoBack:e.showGoBack}])},[m(l,{onUpdateNodes:e.updateNodes},{default:U(()=>[(k(),Q(Oe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(k(),$("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=o=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],4)}var Ga=fe(ja,[["render",za],["__scopeId","data-v-72dd78b1"]]);const Bi=e=>(zt("data-v-4b4bda40"),e=e(),Gt(),e),Wa=Bi(()=>w("h2",null,"Changelog",-1)),Ha=Bi(()=>w("details",{open:""},[w("summary",null,[A("v0.0 Initial Commit - "),w("time",null,"2021-09-04")]),A(" This is the first release :D "),w("ul",null,[w("li",{class:"feature"},"Did everything"),w("li",{class:"fix"},"Had some fun"),w("li",{class:"breaking"},"Removed everything"),w("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Za=Z({__name:"Changelog",setup(e,{expose:t}){const n=R(!1);return t({open(){n.value=!0}}),(i,r)=>(k(),Q(pt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},{header:U(()=>[Wa]),body:U(()=>[Ha]),_:1},8,["modelValue"]))}});var Ya=fe(Za,[["__scopeId","data-v-4b4bda40"]]),Ka=Z({props:{element:Object,display:{type:L(Object,String,Function),required:!0},style:L(Object,String,Array),classes:L(Object),direction:L(String),xoffset:L(String),yoffset:L(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=ye(e),r=R(!1),s=I(()=>($e(i)||r.value)&&l.value),l=hn(n),o=ze(ue(ie(()=>{const h=$e(t);return h==null?"":tt(h)})));function c(h){const p=i;h.shiftKey&&p&&(p.value=!p.value,h.stopPropagation(),h.preventDefault())}const f=I(()=>$e(i)&&Qe[re.theme].showPin);return{Direction:W,isHovered:r,isShown:s,comp:l,elementComp:o,unref:a,togglePinned:c,showPin:f}}});const Ja={key:0,class:"material-icons pinned"};function Xa(e,t,n,i,r,s){return k(),$("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(),Q(Oe(e.elementComp),{key:0})):B("",!0),m(en,{name:"fade"},{default:U(()=>{var l;return[e.isShown?(k(),$("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:qe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(k(),$("span",Ja,"push_pin")):B("",!0),e.comp?(k(),Q(Oe(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var Ne=fe(Ka,[["render",Xa],["__scopeId","data-v-6102fa3a"]]);const Wt=e=>(zt("data-v-4f97aa40"),e=e(),Gt(),e),Qa={class:"info-modal-header"},es=["src","alt"],ts={class:"info-modal-title"},ns={key:0},is={key:0},rs={key:0},as=Wt(()=>w("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),ss=Wt(()=>w("br",null,null,-1)),os=Wt(()=>w("br",null,null,-1)),ls=["href"],us=Wt(()=>w("span",{class:"material-icons info-modal-discord"},"discord",-1)),cs=Wt(()=>w("div",null,[w("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[w("span",{class:"material-icons info-modal-discord"},"discord"),A(" The Paper Pilot Community ")])],-1)),ds=Wt(()=>w("div",null,[w("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[w("span",{class:"material-icons info-modal-discord"},"discord"),A(" The Modding Tree ")])],-1)),fs=Wt(()=>w("br",null,null,-1));var gs=Z({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:s,discordName:l,discordLink:o,versionNumber:c,versionTitle:f}=ce,h=ye(n),p=R(!1),y=I(()=>Dn(H.timePlayed)),N=I(()=>ue(ie(()=>m(se,null,[_a.map(Ue)]))));t({open(){p.value=!0}});function _(){var S;(S=a(h.changelog))==null||S.open()}return(S,P)=>(k(),Q(pt,{modelValue:p.value,"onUpdate:modelValue":P[0]||(P[0]=q=>p.value=q)},{header:U(()=>[w("div",Qa,[a(r)?(k(),$("img",{key:0,class:"info-modal-logo",src:a(r),alt:a(i)},null,8,es)):B("",!0),w("div",ts,[w("h2",null,te(a(i)),1),w("h4",null,[A(" v"+te(a(c)),1),a(f)?(k(),$("span",ns,": "+te(a(f)),1)):B("",!0)])])])]),body:U(({shown:q})=>[q?(k(),$("div",is,[a(s)?(k(),$("div",rs,"By "+te(a(s)),1)):B("",!0),as,ss,w("div",{class:"link",onClick:_},"Changelog"),os,w("div",null,[a(o)?(k(),$("a",{key:0,href:a(o),class:"info-modal-discord-link",target:"_blank"},[us,A(" "+te(a(l)),1)],8,ls)):B("",!0)]),cs,ds,fs,w("div",null,"Time Played: "+te(a(y)),1),(k(),Q(Oe(a(N))))])):B("",!0)]),_:1},8,["modelValue"]))}});var ps=fe(gs,[["__scopeId","data-v-4f97aa40"]]);const ms={class:"field"},vs={key:0,class:"field-title"},ni=Z({__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=hn($t(n,"title"),"span"),r=R((l=n.options.find(o=>o.value===n.modelValue))!=null?l:null);Ke($t(n,"modelValue"),o=>{var c;$e(r)!==o&&(r.value=(c=n.options.find(f=>f.value===o))!=null?c:null)});function s(o){t("update:modelValue",o.value)}return(o,c)=>(k(),$("div",ms,[a(i)?(k(),$("span",vs,[(k(),Q(Oe(a(i))))])):B("",!0),m(a(lr),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>r.value=f),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const hs={class:"field"},bs=Z({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=I(()=>{var s;return ue((s=a(n.title))!=null?s:"","span")}),r=I({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,l)=>(k(),$("label",hs,[Wn(w("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=o=>Ce(r)?r.value=o:null)},null,512),[[ir,a(r)]]),(k(),Q(Oe(a(i))))]))}});var ct=fe(bs,[["__scopeId","data-v-11046116"]]);const ys=["onClick"],ws=Z({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=R(!1),i=R(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,ft(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(s,l)=>(k(),$("button",{onClick:Qt(r,["stop"]),class:ge(["feedback",{activated:n.value,left:e.left}])},[dt(s.$slots,"default",{},void 0,!0)],10,ys))}});var ji=fe(ws,[["__scopeId","data-v-01a1b95c"]]);const _s={class:"header"},Ns=w("h2",null,"Settings",-1),Cs={class:"option-tabs"},ks={key:0},Ss={key:1};var Ms=Z({__name:"Options",setup(e,{expose:t}){const n=R(!1),i=R("behaviour");function r(oe){return oe==i.value}function s(oe){i.value=oe}t({isTab:r,setTab:s,save:je,open(){n.value=!0}});const l=Object.keys(Qe).map(oe=>({label:He(oe),value:oe})),o=I(()=>ue(ie(()=>m(se,null,[Oi.map(Ue)])))),{showTPS:c,theme:f,unthrottled:h,alignUnits:p}=ye(re),{autosave:y,offlineProd:N}=ye(H),_=I({get(){return H.devSpeed===0},set(oe){H.devSpeed=oe?0:null}}),S=ie(()=>m("span",{class:"option-title"},[A("Unthrottled"),m("desc",null,[A("Allow the game to run as fast as possible. Not battery friendly.")])])),P=ie(()=>m("span",{class:"option-title"},[A("Offline Production"),m(Ne,{display:"Save-specific",direction:W.Right},{default:()=>[A("*")]}),m("desc",null,[A("Simulate production that occurs while the game is closed.")])])),q=ie(()=>m("span",{class:"option-title"},[A("Autosave"),m(Ne,{display:"Save-specific",direction:W.Right},{default:()=>[A("*")]}),m("desc",null,[A("Automatically save the game every second or when the game is closed.")])])),x=ie(()=>m("span",{class:"option-title"},[A("Pause game"),m(Ne,{display:"Save-specific",direction:W.Right},{default:()=>[A("*")]}),m("desc",null,[A("Stop everything from moving.")])])),D=ie(()=>m("span",{class:"option-title"},[A("Theme"),m("desc",null,[A("How the game looks.")])])),F=ie(()=>m("span",{class:"option-title"},[A("Show TPS"),m("desc",null,[A("Show TPS meter at the bottom-left corner of the page.")])])),j=ie(()=>m("span",{class:"option-title"},[A("Align modifier units"),m("desc",null,[A("Align numbers to the beginning of the unit in modifier view.")])]));return(oe,ae)=>(k(),Q(pt,{modelValue:n.value,"onUpdate:modelValue":ae[10]||(ae[10]=X=>n.value=X)},{header:U(()=>[w("div",_s,[Ns,w("div",Cs,[w("button",{class:ge({selected:r("behaviour")}),onClick:ae[0]||(ae[0]=X=>s("behaviour"))},"Behaviour",2),w("button",{class:ge({selected:r("appearance")}),onClick:ae[1]||(ae[1]=X=>s("appearance"))},"Appearance",2)])])]),body:U(()=>[r("behaviour")?(k(),$("div",ks,[m(ct,{title:a(S),modelValue:a(h),"onUpdate:modelValue":ae[2]||(ae[2]=X=>Ce(h)?h.value=X:null)},null,8,["title","modelValue"]),a(ce).enablePausing?(k(),Q(ct,{key:0,title:a(x),modelValue:a(_),"onUpdate:modelValue":ae[3]||(ae[3]=X=>Ce(_)?_.value=X:null)},null,8,["title","modelValue"])):B("",!0),m(ct,{title:a(P),modelValue:a(N),"onUpdate:modelValue":ae[4]||(ae[4]=X=>Ce(N)?N.value=X:null)},null,8,["title","modelValue"]),m(ct,{title:a(q),modelValue:a(y),"onUpdate:modelValue":ae[5]||(ae[5]=X=>Ce(y)?y.value=X:null)},null,8,["title","modelValue"]),a(y)?B("",!0):(k(),Q(ji,{key:1,class:"button save-button",onClick:ae[6]||(ae[6]=X=>a(je)())},{default:U(()=>[A("Manually save")]),_:1}))])):B("",!0),r("appearance")?(k(),$("div",Ss,[m(ni,{title:a(D),options:a(l),modelValue:a(f),"onUpdate:modelValue":ae[7]||(ae[7]=X=>Ce(f)?f.value=X:null)},null,8,["title","options","modelValue"]),(k(),Q(Oe(a(o)))),m(ct,{title:a(F),modelValue:a(c),"onUpdate:modelValue":ae[8]||(ae[8]=X=>Ce(c)?c.value=X:null)},null,8,["title","modelValue"]),m(ct,{title:a(j),modelValue:a(p),"onUpdate:modelValue":ae[9]||(ae[9]=X=>Ce(p)?p.value=X:null)},null,8,["title","modelValue"])])):B("",!0)]),_:1},8,["modelValue"]))}});const Is=["onSubmit"],xs={class:"field"},$s={key:0,class:"field-title"},Es=["placeholder"],Ts=Z({__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=hn($t(n,"title"),"span"),r=ze(null);Fn(()=>{var c;(c=r.value)==null||c.focus()});const s=I({get(){var c;return(c=a(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function o(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,f)=>(k(),$("form",{onSubmit:Qt(l,["prevent"])},[w("div",xs,[a(i)?(k(),$("span",$s,[(k(),Q(Oe(a(i))))])):B("",!0),e.textArea?(k(),Q(a(cr),{key:1,modelValue:a(s),"onUpdate:modelValue":f[0]||(f[0]=h=>Ce(s)?s.value=h:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:o,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Wn((k(),$("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=h=>Ce(s)?s.value=h:null),placeholder:e.placeholder,class:ge({fullWidth:!e.title}),onBlur:o,ref_key:"field",ref:r},null,42,Es)),[[rr,a(s)]])])],40,Is))}});var Ui=fe(Ts,[["__scopeId","data-v-90bd4994"]]);const Ps={key:0},Fs=["onClick","disabled"],Ds={key:0},Os=["onClick"],As=Z({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=ye(e),r=R(!1);Ke(r,o=>{t("confirmingChanged",o)});function s(){if(a(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(o,c)=>(k(),$("span",{class:ge(["container",{confirming:r.value}])},[r.value?(k(),$("span",Ps,"Are you sure?")):B("",!0),w("button",{onClick:Qt(s,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(k(),$("span",Ds,"Yes")):dt(o.$slots,"default",{key:1},void 0,!0)],8,Fs),r.value?(k(),$("button",{key:1,class:"button",onClick:Qt(l,["stop"])},"No",8,Os)):B("",!0)],2))}});var Vs=fe(As,[["__scopeId","data-v-2f8ef34c"]]);const mt=e=>(zt("data-v-32313015"),e=e(),Gt(),e),qs=mt(()=>w("div",{class:"handle material-icons"},"drag_handle",-1)),Ls={key:0,class:"actions"},Rs=mt(()=>w("span",{class:"material-icons"},"content_paste",-1)),Bs=mt(()=>w("span",{class:"material-icons"},"content_copy",-1)),js=mt(()=>w("span",{class:"material-icons"},"edit",-1)),Us=mt(()=>w("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),zs={key:1,class:"actions"},Gs=mt(()=>w("span",{class:"material-icons"},"check",-1)),Ws=mt(()=>w("span",{class:"material-icons"},"close",-1)),Hs={key:2,class:"details"},Zs={class:"save-version"},Ys=mt(()=>w("br",null,null,-1)),Ks={key:0},Js={key:3,class:"details"},Xs={key:4,class:"details error"},Qs=mt(()=>w("br",null,null,-1)),eo=Z({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=ye(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=R(!1),l=R(!1),o=R("");Ke(s,()=>{var p;return o.value=(p=i.value.name)!=null?p:""});const c=I(()=>i.value!=null&&i.value.id===H.id),f=I(()=>{var p;return c.value?H.time:(p=i.value!=null&&i.value.time)!=null?p:0});function h(){t("editName",o.value),s.value=!1}return(p,y)=>(k(),$("div",{class:ge(["save",{active:a(c)}])},[qs,s.value?(k(),$("div",zs,[w("button",{onClick:h,class:"button"},[m(Ne,{display:"Save",direction:a(W).Left,class:"info"},{default:U(()=>[Gs]),_:1},8,["direction"])]),w("button",{onClick:y[5]||(y[5]=N=>s.value=!s.value),class:"button"},[m(Ne,{display:"Cancel",direction:a(W).Left,class:"info"},{default:U(()=>[Ws]),_:1},8,["direction"])])])):(k(),$("div",Ls,[a(i).error==null&&!l.value?(k(),Q(ji,{key:0,onClick:y[0]||(y[0]=N=>t("export")),class:"button",left:""},{default:U(()=>[m(Ne,{display:"Export",direction:a(W).Left,class:"info"},{default:U(()=>[Rs]),_:1},8,["direction"])]),_:1})):B("",!0),a(i).error==null&&!l.value?(k(),$("button",{key:1,onClick:y[1]||(y[1]=N=>t("duplicate")),class:"button"},[m(Ne,{display:"Duplicate",direction:a(W).Left,class:"info"},{default:U(()=>[Bs]),_:1},8,["direction"])])):B("",!0),a(i).error==null&&!l.value?(k(),$("button",{key:2,onClick:y[2]||(y[2]=N=>s.value=!s.value),class:"button"},[m(Ne,{display:"Edit Name",direction:a(W).Left,class:"info"},{default:U(()=>[js]),_:1},8,["direction"])])):B("",!0),m(Vs,{disabled:a(c),onClick:y[3]||(y[3]=N=>t("delete")),onConfirmingChanged:y[4]||(y[4]=N=>l.value=N)},{default:U(()=>[m(Ne,{display:"Delete",direction:a(W).Left,class:"info"},{default:U(()=>[Us]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(i).error==null&&!s.value?(k(),$("div",Hs,[w("button",{class:"button open",onClick:y[6]||(y[6]=N=>t("open"))},[w("h3",null,te(a(i).name),1)]),w("span",Zs,"v"+te(a(i).modVersion),1),Ys,a(f)?(k(),$("div",Ks,"Last played "+te(a(r).format(a(f))),1)):B("",!0)])):a(i).error==null&&s.value?(k(),$("div",Js,[m(Ui,{modelValue:o.value,"onUpdate:modelValue":y[7]||(y[7]=N=>o.value=N),class:"editname",onSubmit:h},null,8,["modelValue"])])):(k(),$("div",Xs,[A(" Error: Failed to load save with id "+te(a(i).id),1),Qs,A(te(a(i).error),1)]))],2))}});var to=fe(eo,[["__scopeId","data-v-32313015"]]);const ii=e=>(zt("data-v-2a4275be"),e=e(),Gt(),e),no=ii(()=>w("h2",null,"Saves Manager",-1)),io={class:"modal-footer"},ro={class:"field"},ao=ii(()=>w("span",{class:"field-title"},"Create Save",-1)),so={class:"field-buttons"},oo={class:"footer"},lo=ii(()=>w("div",{style:{"flex-grow":"1"}},null,-1)),uo=Z({__name:"SavesManager",setup(e,{expose:t}){const n=R(!1),i=R(null);t({open(){n.value=!0}});const r=R(!1),s=R(""),l=R(null);Ke(s,x=>{x?ft(()=>{try{if(x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=kt.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x),r.value=!0;return}const D=JSON.parse(x);if(typeof D!="object"){r.value=!0;return}const F=Sn();D.id=F,je(D),s.value="",r.value=!1,re.saves.push(F)}catch{r.value=!0}}):r.value=!1});let o={},c=R(Object.keys(o).reduce((x,D)=>(x.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:o[D]}),x),[]));const f=Hn({});function h(x){if(f[x]==null){let D=localStorage.getItem(x);if(D==null)f[x]={error:"Save doesn't exist in localStorage",id:x};else if(D==="dW5kZWZpbmVk")f[x]={error:"Save is undefined",id:x};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=kt.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,f[x]={error:"Unable to determine preset encoding",id:x},f[x];f[x]={...JSON.parse(D),id:x}}catch(F){f[x]={error:F,id:x},console.warn(`SavesManager: Failed to load info about save with id ${x}: -${F} -${D}`)}}return f[x]}Ke(n,x=>{x&&Object.keys(f).forEach(D=>delete f[D])});const p=I(()=>re.saves.reduce((x,D)=>(x[D]=h(D),x),{}));function y(x){let D;switch(H.id===x?D=Fi(H):D=JSON.stringify(p.value[x]),ce.exportEncoding){default:console.warn(`Unknown save encoding: ${ce.exportEncoding}. Defaulting to lz`);case"lz":D=kt.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const F=document.createElement("textarea");F.value=D,document.body.appendChild(F),F.select(),F.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(F)}function N(x){H.id===x&&je();const D={...p.value[x],id:Sn()};je(D),re.saves.push(D.id)}function _(x){re.saves=re.saves.filter(D=>D!==x),localStorage.removeItem(x),f[x]=void 0}function S(x){p.value[H.id].time=H.time,je(),f[H.id]=void 0,Vt(p.value[x]),f[x]=void 0}function P(x){if(l.value=x,ft(()=>{l.value=null}),x[0]!=="{")if(x[0]==="e")x=decodeURIComponent(escape(atob(x)));else if(x[0]==="\u1BE1")x=kt.decompressFromUTF16(x);else{console.warn("Unable to determine preset encoding",x);return}const D=JSON.parse(x);D.id=Sn(),je(D),re.saves.push(D.id),S(D.id)}function q(x,D){const F=p.value[x];F!=null&&(F.name=D,H.id===x?(H.name=D,je()):(je(F),f[x]=void 0))}return(x,D)=>(k(),Q(pt,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=F=>n.value=F),ref_key:"modal",ref:i},{header:U(()=>[no]),body:U(({shown:F})=>[F?(k(),Q(a(ur),{key:0,list:a(re).saves,handle:".handle",itemKey:j=>j},{item:U(({element:j})=>[m(to,{save:a(p)[j],onOpen:oe=>S(j),onExport:oe=>y(j),onEditName:oe=>q(j,oe),onDuplicate:oe=>N(j),onDelete:oe=>_(j)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:U(()=>[w("div",io,[m(Ui,{modelValue:s.value,"onUpdate:modelValue":D[0]||(D[0]=F=>s.value=F),title:"Import Save",placeholder:"Paste your save here!",class:ge({importingFailed:r.value})},null,8,["modelValue","class"]),w("div",ro,[ao,w("div",so,[w("button",{class:"button",onClick:D[1]||(D[1]=F=>S(a(Xt)().id))},"New Game"),Object.keys(a(c)).length>0?(k(),Q(ni,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":D[2]||(D[2]=F=>P(F)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),w("div",oo,[lo,w("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=F=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zi=fe(uo,[["__scopeId","data-v-2a4275be"]]);const Ge=e=>(zt("data-v-318a1c31"),e=e(),Gt(),e),co=["src","alt"],fo={key:1,class:"title"},go=Ge(()=>w("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),po={class:"discord"},mo={class:"discord-links"},vo={key:0},ho=["href"],bo=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),yo=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),wo={href:"https://forums.moddingtree.com/",target:"_blank"},_o=Ge(()=>w("span",{class:"material-icons"},"forum",-1)),No=Ge(()=>w("span",{class:"material-icons"},"info",-1)),Co=Ge(()=>w("span",{class:"material-icons"},"library_books",-1)),ko=Ge(()=>w("span",{class:"material-icons"},"settings",-1)),So=Ge(()=>w("span",{class:"material-icons"},"library_books",-1)),Mo=Ge(()=>w("span",{class:"material-icons"},"settings",-1)),Io=Ge(()=>w("span",{class:"material-icons"},"info",-1)),xo={href:"https://forums.moddingtree.com/",target:"_blank"},$o=Ge(()=>w("span",{class:"material-icons"},"forum",-1)),Eo={class:"discord"},To={class:"discord-links"},Po={key:0},Fo=["href"],Do=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Oo=Ge(()=>w("li",null,[w("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Ao=Z({__name:"Nav",setup(e){const t=R(null),n=R(null),i=R(null),r=R(null),{useHeader:s,banner:l,title:o,discordName:c,discordLink:f,versionNumber:h}=ce;function p(){window.open(f,"mywindow")}return(y,N)=>(k(),$(se,null,[a(s)?(k(),$("div",gt({key:0,class:"nav"},y.$attrs),[a(l)?(k(),$("img",{key:0,src:a(l),class:"banner",alt:a(o)},null,8,co)):(k(),$("div",fo,te(a(o)),1)),w("div",{onClick:N[0]||(N[0]=_=>{var S;return(S=r.value)==null?void 0:S.open()}),class:"version-container"},[m(Ne,{display:"Changelog",direction:a(W).Down,class:"version"},{default:U(()=>[w("span",null,"v"+te(a(h)),1)]),_:1},8,["direction"])]),go,w("div",po,[w("span",{onClick:p,class:"material-icons"},"discord"),w("ul",mo,[a(f)?(k(),$("li",vo,[w("a",{href:a(f),target:"_blank"},te(a(c)),9,ho)])):B("",!0),bo,yo])]),w("div",null,[w("a",wo,[m(Ne,{display:"Forums",direction:a(W).Down,yoffset:"5px"},{default:U(()=>[_o]),_:1},8,["direction"])])]),w("div",{onClick:N[1]||(N[1]=_=>{var S;return(S=t.value)==null?void 0:S.open()})},[m(Ne,{display:"Info",direction:a(W).Down,class:"info"},{default:U(()=>[No]),_:1},8,["direction"])]),w("div",{onClick:N[2]||(N[2]=_=>{var S;return(S=n.value)==null?void 0:S.open()})},[m(Ne,{display:"Saves",direction:a(W).Down,xoffset:"-20px"},{default:U(()=>[Co]),_:1},8,["direction"])]),w("div",{onClick:N[3]||(N[3]=_=>{var S;return(S=i.value)==null?void 0:S.open()})},[m(Ne,{display:"Settings",direction:a(W).Down,xoffset:"-66px"},{default:U(()=>[ko]),_:1},8,["direction"])])],16)):(k(),$("div",gt({key:1,class:"overlay-nav"},y.$attrs),[w("div",{onClick:N[4]||(N[4]=_=>{var S;return(S=r.value)==null?void 0:S.open()}),class:"version-container"},[m(Ne,{display:"Changelog",direction:a(W).Right,xoffset:"25%",class:"version"},{default:U(()=>[w("span",null,"v"+te(a(h)),1)]),_:1},8,["direction"])]),w("div",{onClick:N[5]||(N[5]=_=>{var S;return(S=n.value)==null?void 0:S.open()})},[m(Ne,{display:"Saves",direction:a(W).Right},{default:U(()=>[So]),_:1},8,["direction"])]),w("div",{onClick:N[6]||(N[6]=_=>{var S;return(S=i.value)==null?void 0:S.open()})},[m(Ne,{display:"Settings",direction:a(W).Right},{default:U(()=>[Mo]),_:1},8,["direction"])]),w("div",{onClick:N[7]||(N[7]=_=>{var S;return(S=t.value)==null?void 0:S.open()})},[m(Ne,{display:"Info",direction:a(W).Right},{default:U(()=>[Io]),_:1},8,["direction"])]),w("div",null,[w("a",xo,[m(Ne,{display:"Forums",direction:a(W).Right,xoffset:"7px"},{default:U(()=>[$o]),_:1},8,["direction"])])]),w("div",Eo,[w("span",{onClick:p,class:"material-icons"},"discord"),w("ul",To,[a(f)?(k(),$("li",Po,[w("a",{href:a(f),target:"_blank"},te(a(c)),9,Fo)])):B("",!0),Do,Oo])])],16)),m(ps,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),m(zi,{ref_key:"savesManager",ref:n},null,512),m(Ms,{ref_key:"options",ref:i},null,512),m(Ya,{ref_key:"changelog",ref:r},null,512)],64))}});var Gi=fe(Ao,[["__scopeId","data-v-318a1c31"]]);const Vo={class:"inner-tab"},qo=Z({__name:"Game",setup(e){const t=$t(H,"tabs"),n=I(()=>Object.keys(he)),i=ce.useHeader;function r(s){const{display:l,minimized:o,name:c,color:f,minimizable:h,nodes:p,minimizedDisplay:y}=s;return{display:l,minimized:o,name:c,color:f,minimizable:h,nodes:p,minimizedDisplay:y}}return(s,l)=>(k(),$("div",{class:ge(["tabs-container",{useHeader:a(i)}])},[(k(!0),$(se,null,tn(a(t),(o,c)=>{var f,h;return k(),$("div",{key:c,class:ge(["tab",a((f=a(he)[o])==null?void 0:f.classes)]),style:qe(a((h=a(he)[o])==null?void 0:h.style))},[c===0&&!a(i)?(k(),Q(Gi,{key:0})):B("",!0),w("div",Vo,[a(n).includes(o)?(k(),Q(Ga,gt({key:0},r(a(he)[o]),{index:c,onSetMinimized:p=>a(he)[o].minimized.value=p}),null,16,["index","onSetMinimized"])):(k(),Q(Oe(o),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Lo=fe(qo,[["__scopeId","data-v-dcd207b4"]]);const Ro=Z({__name:"Sticky",setup(e){const t=R("0"),n=new ResizeObserver(r),i=ze(null);function r(){let s=i.value;if(s==null)return;let l=0;for(;s.previousSibling;){const o=s.previousSibling;o.dataset&&"vSticky"in o.dataset&&(l+=o.offsetHeight),s=o}t.value=l+"px"}return ft(r),document.fonts.ready.then(r),Fn(()=>{var l;const s=(l=i.value)==null?void 0:l.parentElement;s&&n.observe(s)}),(s,l)=>(k(),$("div",{class:"sticky",style:qe({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[dt(s.$slots,"default",{},void 0,!0)],4))}});var Tn=fe(Ro,[["__scopeId","data-v-cccac690"]]);const Bo=["x1","y1","x2","y2"],jo=Z({__name:"BoardLink",props:{link:null},setup(e){const n=ye(e),i=I(()=>{const s=n.link.value.startNode.position;return n.link.value.offsetStart&&(s.x+=a(n.link.value.offsetStart).x,s.y+=a(n.link.value.offsetStart).y),s}),r=I(()=>{const s=n.link.value.endNode.position;return n.link.value.offsetEnd&&(s.x+=a(n.link.value.offsetEnd).x,s.y+=a(n.link.value.offsetEnd).y),s});return(s,l)=>(k(),$("line",gt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,Bo))}});var Uo=fe(jo,[["__scopeId","data-v-57c4970a"]]);const zo={key:0},Go=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Wo=["fill","stroke-width","stroke"],Ho=["fill"],Zo=Z({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=ye(e),r=I(()=>le(i.nodeType.value.size,a(i.node))),s=I(()=>{var h;return(h=le(i.nodeType.value.outlineColor,a(i.node)))!=null?h:Qe[re.theme].variables["--outline"]}),l=I(()=>{var h;return(h=le(i.nodeType.value.titleColor,a(i.node)))!=null?h:Qe[re.theme].variables["--foreground"]}),o=I(()=>le(i.nodeType.value.actionDistance,a(i.node)));function c(h,p){t("clickAction",p.id),h.preventDefault(),h.stopPropagation()}function f(h,p){var y;((y=a(i.selectedAction))==null?void 0:y.id)===p.id&&(h.preventDefault(),h.stopPropagation())}return(h,p)=>(k(),Q(en,{name:"actions",appear:""},{default:U(()=>[e.isSelected&&e.actions?(k(),$("g",zo,[(k(!0),$(se,null,tn(e.actions,(y,N)=>{var _,S;return k(),$("g",{key:y.id,class:ge(["action",{selected:((_=e.selectedAction)==null?void 0:_.id)===y.id}]),transform:`translate( - ${(-a(r)-30)*Math.sin(((e.actions.length-1)/2-N)*a(o))}, - ${(a(r)+30)*Math.cos(((e.actions.length-1)/2-N)*a(o))} - )`,onMousedown:P=>c(P,y),onTouchstart:P=>c(P,y),onMouseup:P=>f(P,y),onTouchend:Qt(P=>f(P,y),["stop"])},[w("circle",{fill:a(le)(y.fillColor,e.node),r:"20","stroke-width":((S=e.selectedAction)==null?void 0:S.id)===y.id?4:0,stroke:a(s)},null,8,Wo),w("text",{fill:a(l),class:"material-icons"},te(a(le)(y.icon,e.node)),9,Ho)],42,Go)}),128))])):B("",!0)]),_:1}))}});var Yo=fe(Zo,[["__scopeId","data-v-9efb2a56"]]);const Ko=["transform"],Jo={key:0},Xo=["r","fill","stroke"],Qo=["r","fill","stroke"],el=["r","fill"],tl=["r","stroke-dasharray","stroke-dashoffset","stroke"],nl={key:1,transform:"rotate(45, 0, 0)"},il=["width","height","transform","fill","stroke"],rl=["width","height","transform","fill","stroke"],al=["width","height","transform","fill"],sl=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],ol=["fill","y"],ll=["fill"],ul={key:0},cl=["fill","y"],dl=["fill","y"],fl=Z({__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=ye(n),s=I(()=>a(r.selectedNode)===a(r.node)),l=I(()=>le(r.nodeType.value.draggable,a(r.node)));Ke(l,K=>{const pe=a(r.node);a(r.dragging)===pe&&!K&&t("endDragging",pe)});const o=I(()=>{var pe;const K=a(r.node);return(pe=le(r.nodeType.value.actions,K))==null?void 0:pe.filter(Ee=>Je(le(Ee.visibility,K)))}),c=I(()=>{var pe;const K=a(r.node);if(le(r.nodeType.value.draggable,K)&&((pe=a(r.dragging))==null?void 0:pe.id)===K.id&&a(r.dragged)!=null){const{x:Ee,y:z}=a(r.dragged);return{x:K.position.x+Math.round(Ee/25)*25,y:K.position.y+Math.round(z/25)*25}}return K.position}),f=I(()=>le(r.nodeType.value.shape,a(r.node))),h=I(()=>le(r.nodeType.value.title,a(r.node))),p=I(()=>le(r.nodeType.value.subtitle,a(r.node))),y=I(()=>{var K;return(K=s.value?a(r.selectedAction)&&le(a(r.selectedAction).tooltip,a(r.node)):null)!=null?K:le(r.nodeType.value.label,a(r.node))}),N=I(()=>{var K,pe;return le((pe=(K=a(r.selectedAction))==null?void 0:K.confirmationLabel)!=null?pe:{text:"Tap again to confirm"},a(r.node))}),_=I(()=>le(r.nodeType.value.size,a(r.node))),S=I(()=>{var K;return(K=le(r.nodeType.value.progress,a(r.node)))!=null?K:0}),P=I(()=>Qe[re.theme].variables["--background"]),q=I(()=>{var K;return(K=le(r.nodeType.value.outlineColor,a(r.node)))!=null?K:Qe[re.theme].variables["--outline"]}),x=I(()=>{var K;return(K=le(r.nodeType.value.fillColor,a(r.node)))!=null?K:Qe[re.theme].variables["--raised-background"]}),D=I(()=>le(r.nodeType.value.progressColor,a(r.node))),F=I(()=>{var K;return(K=le(r.nodeType.value.titleColor,a(r.node)))!=null?K:Qe[re.theme].variables["--foreground"]}),j=I(()=>le(r.nodeType.value.progressDisplay,a(r.node))),oe=I(()=>r.dragging.value!=null&&a(r.hasDragged)&&le(r.nodeType.value.canAccept,a(r.node),r.dragging.value)),ae=I(()=>le(r.nodeType.value.style,a(r.node))),X=I(()=>le(r.nodeType.value.classes,a(r.node)));function Pe(K){t("mouseDown",K,r.node.value,l.value)}function Y(K){var pe,Ee,z;(pe=r.hasDragged)!=null&&pe.value||(t("endDragging",r.node.value),(z=(Ee=r.nodeType.value).onClick)==null||z.call(Ee,r.node.value),K.stopPropagation())}return(K,pe)=>{var Ee,z,ne;return k(),$("g",{class:ge(["boardnode",{[e.node.type]:!0,isSelected:a(s),isDraggable:a(l),...a(X)}]),style:qe([{opacity:((Ee=e.dragging)==null?void 0:Ee.id)===e.node.id&&e.hasDragged?.5:1},(z=a(ae))!=null?z:[]]),transform:`translate(${a(c).x},${a(c).y})${a(s)?" scale(1.2)":""}`},[m(Yo,{actions:(ne=a(o))!=null?ne:[],"is-selected":a(s),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:pe[0]||(pe[0]=Se=>t("clickAction",Se))},null,8,["actions","is-selected","node","node-type","selected-action"]),w("g",{class:"node-container",onMousedown:Pe,onTouchstartPassive:Pe,onMouseup:Y,onTouchendPassive:Y},[a(f)===a(Be).Circle?(k(),$("g",Jo,[a(oe)?(k(),$("circle",{key:0,class:"receiver",r:a(_)+8,fill:a(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Xo)):B("",!0),w("circle",{class:"body",r:a(_),fill:a(x),stroke:a(q),"stroke-width":4},null,8,Qo),a(j)===a(Lt).Fill?(k(),$("circle",{key:1,class:"progress progressFill",r:Math.max(a(_)*a(S)-2,0),fill:a(D)},null,8,el)):(k(),$("circle",{key:2,r:a(_)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(a(_)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(a(_)+4.5)*2*Math.PI-a(S)*(a(_)+4.5)*2*Math.PI,stroke:a(D)},null,8,tl))])):a(f)===a(Be).Diamond?(k(),$("g",nl,[a(oe)?(k(),$("rect",{key:0,class:"receiver",width:a(_)*a(i)+16,height:a(_)*a(i)+16,transform:`translate(${-(a(_)*a(i)+16)/2}, ${-(a(_)*a(i)+16)/2})`,fill:a(P),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,il)):B("",!0),w("rect",{class:"body",width:a(_)*a(i),height:a(_)*a(i),transform:`translate(${-a(_)*a(i)/2}, ${-a(_)*a(i)/2})`,fill:a(x),stroke:a(q),"stroke-width":4},null,8,rl),a(j)===a(Lt).Fill?(k(),$("rect",{key:1,class:"progress progressFill",width:Math.max(a(_)*a(i)*a(S)-2,0),height:Math.max(a(_)*a(i)*a(S)-2,0),transform:`translate(${-Math.max(a(_)*a(i)*a(S)-2,0)/2}, ${-Math.max(a(_)*a(i)*a(S)-2,0)/2})`,fill:a(D)},null,8,al)):(k(),$("rect",{key:2,class:"progress progressDiamond",width:a(_)*a(i)+9,height:a(_)*a(i)+9,transform:`translate(${-(a(_)*a(i)+9)/2}, ${-(a(_)*a(i)+9)/2})`,fill:"transparent","stroke-dasharray":(a(_)*a(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(a(_)*a(i)+9)*4-a(S)*(a(_)*a(i)+9)*4,stroke:a(D)},null,8,sl))])):B("",!0),w("text",{fill:a(F),class:"node-title",y:a(p)?10:0},te(a(h)),9,ol),a(p)?(k(),$("text",{key:2,fill:a(F),class:"node-subtitle",y:"-15"},te(a(p)),9,ll)):B("",!0)],32),m(en,{name:"fade",appear:""},{default:U(()=>{var Se;return[a(y)?(k(),$("g",ul,[w("text",{fill:(Se=a(y).color)!=null?Se:a(F),class:ge(["node-title",{pulsing:a(y).pulsing}]),y:-a(_)-20},te(a(y).text),11,cl)])):B("",!0)]}),_:1}),m(en,{name:"fade",appear:""},{default:U(()=>{var Se;return[a(s)&&e.selectedAction?(k(),$("text",{key:0,fill:(Se=a(N).color)!=null?Se:a(F),class:ge(["node-title",{pulsing:a(N).pulsing}]),y:a(_)+75},te(a(N).text),11,dl)):B("",!0)]}),_:1})],14,Ko)}}});var gl=fe(fl,[["__scopeId","data-v-4654be02"]]);const pl={class:"stage",width:"100%",height:"100%"},ml={class:"g1"},vl=Z({__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=ye(e),i=R({x:0,y:0}),r=R({x:0,y:0}),s=R(!1),l=R(null),o=I(()=>{const N=n.nodes.value.slice();if(n.draggingNode.value){const _=N.splice(N.indexOf(n.draggingNode.value),1)[0];N.push(_)}return N});Ye(()=>{const N=n.draggingNode.value;if(N==null)return null;const _={x:N.position.x+r.value.x,y:N.position.y+r.value.y};let S=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((P,q)=>{if(q.id===N.id)return P;const x=n.types.value[q.type];if(!le(x.canAccept,q,N))return P;const F=Math.pow(_.x-q.position.x,2)+Math.pow(_.y-q.position.y,2);let j=le(x.size,q);return F>S||F>j*j?P:(S=F,q)},null))});function c(N){N.setTransformOrigin(null),N.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function f(N,_=null,S=!1){if(n.draggingNode.value==null){N.preventDefault(),N.stopPropagation();let P,q;if("touches"in N)if(N.touches.length===1)P=N.touches[0].clientX,q=N.touches[0].clientY;else return;else P=N.clientX,q=N.clientY;i.value={x:P,y:q},r.value={x:0,y:0},s.value=!1,S&&n.setDraggingNode.value(_)}_!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(N){const{x:_,y:S,scale:P}=l.value.panZoomInstance.getTransform();let q,x;if("touches"in N)if(N.touches.length===1)q=N.touches[0].clientX,x=N.touches[0].clientY;else{p(n.draggingNode.value),n.mousePosition.value=null;return}else q=N.clientX,x=N.clientY;n.mousePosition.value={x:(q-_)/P,y:(x-S)/P},r.value={x:r.value.x+(q-i.value.x)/P,y:r.value.y+(x-i.value.y)/P},i.value={x:q,y:x},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(s.value=!0),n.draggingNode.value!=null&&(N.preventDefault(),N.stopPropagation())}function p(N,_=!1){var S,P;if(n.draggingNode.value!=null&&n.draggingNode.value===N){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 q=n.nodes.value;q.push(q.splice(q.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((P=(S=n.types.value[n.receivingNode.value.type]).onDrop)==null||P.call(S,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!s.value&&!_&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function y(N,_){n.state.value.selectedAction===_?a(n.selectedAction).onClick(a(n.selectedNode)):n.state.value={...n.state.value,selectedAction:_}}return(N,_)=>{const S=xt("panZoom");return a(Je)(e.visibility)?(k(),Q(S,{key:0,style:qe([{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:h,onTouchmove:h,onMousedown:_[0]||(_[0]=P=>f(P)),onTouchstart:_[1]||(_[1]=P=>f(P)),onMouseup:_[2]||(_[2]=()=>p(a(e.draggingNode))),onTouchendPassive:_[3]||(_[3]=()=>p(a(e.draggingNode))),onMouseleave:_[4]||(_[4]=()=>p(a(e.draggingNode),!0))},{default:U(()=>[(k(),$("svg",pl,[w("g",ml,[m(oi,{name:"link",appear:""},{default:U(()=>[(k(!0),$(se,null,tn(a(e.links)||[],P=>(k(),$("g",{key:`${P.startNode.id}-${P.endNode.id}`},[m(Uo,{link:P},null,8,["link"])]))),128))]),_:1}),m(oi,{name:"grow",duration:500,appear:""},{default:U(()=>[(k(!0),$(se,null,tn(a(o),P=>{var q;return k(),$("g",{key:P.id,style:{"transition-duration":"0s"}},[m(gl,{node:P,nodeType:e.types[P.type],dragging:a(e.draggingNode),dragged:a(e.draggingNode)===P?r.value:void 0,hasDragged:s.value,receivingNode:((q=a(e.receivingNode))==null?void 0:q.id)===P.id,selectedNode:a(e.selectedNode),selectedAction:a(e.selectedAction),onMouseDown:f,onEndDragging:p,onClickAction:x=>y(P,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","selectedNode","selectedAction","onClickAction"])])}),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});Ae.on("setupVue",e=>dr.install(e));const Wi=Symbol("Board");var Lt=(e=>(e.Outline="Outline",e.Fill="Fill",e))(Lt||{}),Be=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Be||{});function hl(e){const t=st({nodes:[],selectedNode:null,selectedAction:null},!1);return nt(n=>{const i=e.call(n,n);i.id=On("board-"),i.type=Wi,i[rt]=vl,i.state?(Li(t),O(i,"state")):(t[vn]={nodes:i.startNodes().map((o,c)=>(o.id=c,o)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=I(()=>a(l.state).nodes),i.selectedNode=I({get(){return l.nodes.value.find(o=>o.id===a(l.state).selectedNode)||null},set(o){var c,f;Ce(l.state)?l.state.value={...l.state.value,selectedNode:(c=o==null?void 0:o.id)!=null?c:null}:l.state.selectedNode=(f=o==null?void 0:o.id)!=null?f:null}}),i.selectedAction=I({get(){const o=l.selectedNode.value;if(o==null)return null;const c=l.types[o.type];return c.actions==null?null:c.actions.find(f=>f.id===a(l.state).selectedAction)||null},set(o){var c,f;Ce(l.state)?l.state.value={...l.state.value,selectedAction:(c=o==null?void 0:o.id)!=null?c:null}:l.state.selectedAction=(f=o==null?void 0:o.id)!=null?f:null}}),i.mousePosition=R(null),i.links?O(i,"links"):i.links=I(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?le(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=R(null),i.receivingNode=R(null),O(i,"visibility"),de(i,"visibility",ke.Visible),O(i,"width"),de(i,"width","100%"),O(i,"height"),de(i,"height","100%"),O(i,"classes"),O(i,"style");for(const o in i.types){const c=i.types[o];if(O(c,"title"),O(c,"subtitle"),O(c,"label"),O(c,"size"),de(c,"size",50),O(c,"style"),O(c,"classes"),O(c,"draggable"),de(c,"draggable",!1),O(c,"shape"),de(c,"shape","Circle"),O(c,"canAccept"),de(c,"canAccept",!1),O(c,"progress"),O(c,"progressDisplay"),de(c,"progressDisplay","Fill"),O(c,"progressColor"),de(c,"progressColor","none"),O(c,"fillColor"),O(c,"outlineColor"),O(c,"titleColor"),O(c,"actionDistance"),de(c,"actionDistance",Math.PI/6),c.nodes=I(()=>a(l.state).nodes.filter(f=>f.type===o)),de(c,"onClick",function(f){a(l.state).selectedNode=f.id}),c.actions)for(const f of c.actions)O(f,"visibility"),de(f,"visibility",ke.Visible),O(f,"icon"),O(f,"fillColor"),O(f,"tooltip"),O(f,"confirmationLabel"),de(f,"confirmationLabel",{text:"Tap again to confirm"}),O(f,"links")}function r(o){i.draggingNode.value=o}function s(o){i.receivingNode.value=o}i.placeInAvailableSpace=function(o,c=100,f=W.Right){const h=l.nodes.value.slice().filter(p=>p===o||(f===W.Down||f===W.Up)&&Math.abs(p.position.x-o.position.x)>c||(f===W.Left||f===W.Right)&&Math.abs(p.position.y-o.position.y)>c?!1:!(f===W.Right&&p.position.xo.position.x+c||f===W.Up&&p.position.y>o.position.y+c||f===W.Down&&p.position.yp.position.x-y.position.x:f===W.Left?(p,y)=>y.position.x-p.position.x:f===W.Up?(p,y)=>y.position.y-p.position.y:(p,y)=>p.position.y-y.position.y);for(let p=0;p0&&N>c)break}},i[et]=function(){const{nodes:o,types:c,state:f,visibility:h,width:p,height:y,style:N,classes:_,links:S,selectedAction:P,selectedNode:q,mousePosition:x,draggingNode:D,receivingNode:F}=this;return{nodes:o,types:c,state:f,visibility:h,width:p,height:y,style:a(N),classes:_,links:S,selectedAction:P,selectedNode:q,mousePosition:x,draggingNode:D,receivingNode:F,setDraggingNode:r,setReceivingNode:s}};const l=i;return l})}function le(e,t,...n){return xn(e)?e(t,...n):a(e)}function jn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const cn={};Ae.on("addLayer",e=>{const t=ga(e,Wi);cn[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(s=>{var l;return(l=r.update)==null?void 0:l.call(r,s,n)}))})})});Ae.on("removeLayer",e=>{var t;(t=cn[e.id])==null||t.call(cn),cn[e.id]=void 0});function Hi(e,t="points",n=0,i=void 0){const r=Ce(e)?e:st(e);if(r.displayName=t,r.precision=n,r.small=i,!Ce(e)){const s=r[it];s.displayName=t,s.precision=n,s.small=i}return r}new u("10^^8");new u("1e100");function vi(e,t){const n=t!=null?t:e.value;return u.eq(e.precision,0)?Xe(e.small?n:u.floor(n)):Rt(n,e.precision,e.small)}Ae.on("setupVue",e=>e.use(fr));function bl(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 yl=Z({props:{visibility:{type:L(Number,Boolean),required:!0},display:{type:L(Object,String,Function),required:!0},style:L(String,Object,Array),classes:L(Object),glowColor:L(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=ye(e),s=Vi(n),l=I(()=>{const c=$e(i);return c==null||c===""?{}:a(r)?bl(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function o(){t("selectTab")}return{selectTab:o,component:s,glowColorStyle:l,unref:a,Visibility:ke,isVisible:Je,isHidden:nn}}});function wl(e,t,n,i,r,s){var l;return e.isVisible(e.visibility)?(k(),$("button",{key:0,onClick:t[0]||(t[0]=(...o)=>e.selectTab&&e.selectTab(...o)),class:ge(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(k(),Q(Oe(e.component)))],6)):B("",!0)}var Zi=fe(yl,[["render",wl],["__scopeId","data-v-21427abb"]]);const _l=Z({props:{visibility:{type:L(Number,Boolean),required:!0},activeTab:{type:L(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:L(Object),required:!0},style:L(String,Object,Array),classes:L(Object),buttonContainerStyle:L(String,Object,Array),buttonContainerClasses:L(Object)},components:{Sticky:Tn,TabButton:Zi},setup(e){const{activeTab:t}=ye(e),n=I(()=>Qe[re.theme].floatingTabs),i=ze("");Ye(()=>{const o=$e(t);if(o==null){i.value="";return}if(at(o)){i.value=ue(o);return}i.value=ue(a(o.display))});const r=I(()=>{const o=$e(t);return at(o)||!o?void 0:a(o.classes)}),s=I(()=>{const o=$e(t);return at(o)||!o?void 0:a(o.style)});function l(o){const{display:c,style:f,classes:h,glowColor:p,visibility:y}=o;return{display:c,style:a(f),classes:h,glowColor:p,visibility:y}}return{floating:n,tabClasses:r,tabStyle:s,Visibility:ke,component:i,gatherButtonProps:l,unref:a,isVisible:Je,isHidden:nn}}});function Nl(e,t,n,i,r,s){var c,f;const l=xt("TabButton"),o=xt("Sticky");return e.isVisible(e.visibility)?(k(),$("div",{key:0,class:ge(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(f=e.tabStyle)!=null?f:[]])},[m(o,{class:ge(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:qe(e.unref(e.buttonContainerStyle))},{default:U(()=>[w("div",{class:ge(["tab-buttons",{floating:e.floating}])},[(k(!0),$(se,null,tn(e.unref(e.tabs),(h,p)=>(k(),Q(l,gt({onSelectTab:y=>e.selected.value=p,floating:e.floating,key:p,active:e.unref(h.tab)===e.unref(e.activeTab)},e.gatherButtonProps(h)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(k(),Q(Oe(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var Cl=fe(_l,[["render",Nl],["__scopeId","data-v-58dbf83a"]]);const kl=Symbol("TabButton"),Sl=Symbol("TabFamily");function Ml(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=st(Object.keys(e)[0],!1);return nt(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=On("tabFamily-"),r.type=Sl,r[rt]=Cl,r.tabs=Object.keys(e).reduce((o,c)=>{const f=e[c]();return f.type=kl,f[rt]=Zi,O(f,"visibility"),de(f,"visibility",ke.Visible),O(f,"tab"),O(f,"display"),O(f,"classes"),O(f,"style"),O(f,"glowColor"),o[c]=f,o},{}),r.selected=n,r.activeTab=I(()=>{const o=a(s.tabs);if(n.value in o&&Je(o[n.value].visibility))return a(o[n.value].tab);const c=Object.values(o).find(f=>Je(f.visibility));return c?a(c.tab):null}),O(r,"visibility"),de(r,"visibility",ke.Visible),O(r,"classes"),O(r,"style"),O(r,"buttonContainerClasses"),O(r,"buttonContainerStyle"),r[et]=function(){const{visibility:o,activeTab:c,selected:f,tabs:h,style:p,classes:y,buttonContainerClasses:N,buttonContainerStyle:_}=this;return{visibility:o,activeTab:c,selected:f,tabs:h,style:a(p),classes:y,buttonContainerClasses:N,buttonContainerStyle:_}};const s=r;return s})}const Yi=u.ln(10);function dn(e){return e}function Il(e,t){if(E(t))return t.invert(u.neg(e));throw new Error("Could not invert due to no input being a variable")}function xl(e,t){if(E(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 $l(e){return g.neg(e)}function El(e,t,n){if(E(t))return t.invert(u.sub(e,ve(n)));if(E(n))return n.invert(u.sub(e,ve(t)));throw new Error("Could not invert due to no input being a variable")}function Tl(e,t,n){var i,r;if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=t.getIntegralFormula(e);return g.times(n,(i=t.innermostVariable)!=null?i:0).add(s)}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=n.getIntegralFormula(e);return g.times(t,(r=n.innermostVariable)!=null?r:0).add(s)}throw new Error("Could not integrate due to no input being a variable")}function Pl(e,t,n){if(E(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(E(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 Fl(e,t,n){if(E(t))return t.invert(u.add(e,ve(n)));if(E(n))return n.invert(u.sub(ve(t),e));throw new Error("Could not invert due to no input being a variable")}function Dl(e,t,n){var i,r;if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=t.getIntegralFormula(e);return g.sub(s,g.times(n,(i=t.innermostVariable)!=null?i:0))}else if(E(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const s=n.getIntegralFormula(e);return g.times(t,(r=n.innermostVariable)!=null?r:0).sub(s)}throw new Error("Could not integrate due to no input being a variable")}function Ol(e,t,n){if(E(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(E(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 Al(e,t,n){if(E(t))return t.invert(u.div(e,ve(n)));if(E(n))return n.invert(u.div(e,ve(t)));throw new Error("Could not invert due to no input being a variable")}function Vl(e,t,n){if(E(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(E(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 ql(e,t,n){if(E(t))return g.div(e,n);if(E(n))return g.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Ll(e,t,n){if(E(t))return t.invert(u.mul(e,ve(n)));if(E(n))return n.invert(u.div(ve(t),e));throw new Error("Could not invert due to no input being a variable")}function Rl(e,t,n){if(E(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(E(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 Bl(e,t,n){if(E(t))return g.mul(e,n);if(E(n))return g.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function jl(e,t){if(E(t))return t.invert(u.recip(e));throw new Error("Could not invert due to no input being a variable")}function Ul(e,t){if(E(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 zl(e,t){if(E(t))return t.invert(u.pow10(e));throw new Error("Could not invert due to no input being a variable")}function Gl(e){return u.ln(e).sub(1).times(e).div(Yi)}function Wl(e,t){if(E(t)){const n=Yi.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 Hl(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Gl,invert:Wl})}throw new Error("Could not integrate due to no input being a variable")}function Zl(e,t,n){if(E(t))return t.invert(u.pow(ve(n),e));if(E(n))return n.invert(u.root(ve(t),e));throw new Error("Could not invert due to no input being a variable")}function Yl(e,t){return u.ln(e).sub(1).times(e).div(u.ln(t))}function Kl(e,t,n){if(E(t)){const i=u.ln(ve(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 Jl(e,t,n){if(E(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:Yl,invert:Kl})}throw new Error("Could not integrate due to no input being a variable")}function Xl(e,t){if(E(t))return t.invert(u.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function Ql(e){return u.ln(e).sub(1).times(e).div(u.ln(2))}function eu(e,t){if(E(t)){const n=u.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 tu(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:Ql,invert:eu})}throw new Error("Could not integrate due to no input being a variable")}function nu(e,t){if(E(t))return t.invert(u.exp(e));throw new Error("Could not invert due to no input being a variable")}function iu(e){return u.ln(e).sub(1).times(e)}function ru(e,t){if(E(t))return t.invert(u.div(e,u.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function au(e,t){if(E(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new g({inputs:[t.getIntegralFormula(e)],evaluate:iu,invert:ru})}throw new Error("Could not integrate due to no input being a variable")}function su(e,t,n){if(E(t))return t.invert(u.root(e,ve(n)));if(E(n))return n.invert(u.ln(e).div(u.ln(ve(t))));throw new Error("Could not invert due to no input being a variable")}function ou(e,t,n){if(E(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(E(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 lu(e,t){if(E(t))return t.invert(u.root(e,10));throw new Error("Could not invert due to no input being a variable")}function uu(e,t){if(E(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 cu(e,t,n){if(E(t))return t.invert(u.ln(e).div(ve(n)));if(E(n))return n.invert(u.root(ve(t),e));throw new Error("Could not invert due to no input being a variable")}function du(e,t,n){if(E(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(E(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 fu(e,t,n){if(E(t))return t.invert(u.root(e,u.recip(ve(n))));if(E(n))return n.invert(u.ln(ve(t)).div(u.ln(e)));throw new Error("Could not invert due to no input being a variable")}function gu(e,t,n){if(E(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 pu(e,t){if(E(t))return t.invert(u.ln(e));throw new Error("Could not invert due to no input being a variable")}function mu(e,t){if(E(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 vu(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const i=u.minabs(t,1e308).toNumber();return u.tetrate(e,i,n)}function hu(e,t,n,i){if(E(t))return t.invert(u.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function bu(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const i=u.minabs(t,1e308).toNumber();return u.iteratedexp(e,i,new u(n))}function yu(e,t,n,i){if(E(t))return t.invert(u.iteratedlog(e,Math.E,u.minabs(1e308,ve(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function wu(e,t=10,n=2){const i=u.minabs(n,1e308).toNumber();return u.iteratedlog(e,t,i)}function _u(e,t=10){const n=u.minabs(t,1e308).toNumber();return u.slog(e,n)}function Nu(e,t,n){if(E(t))return t.invert(u.tetrate(e,u.minabs(1e308,ve(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Cu(e,t,n){const i=u.minabs(t,1e308).toNumber();return u.layeradd(e,i,n)}function ku(e,t,n,i){if(E(t))return t.invert(u.layeradd(e,u.minabs(1e308,ve(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Su(e,t){if(E(t))return t.invert(u.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Mu(e,t){if(E(t))return t.invert(u.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function Iu(e,t,n){const i=u.minabs(t,1e308).toNumber();return u.pentate(e,i,n)}function xu(e,t){if(E(t))return t.invert(u.asin(e));throw new Error("Could not invert due to no input being a variable")}function $u(e,t){if(E(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 Eu(e,t){if(E(t))return t.invert(u.acos(e));throw new Error("Could not invert due to no input being a variable")}function Tu(e,t){if(E(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 Pu(e,t){if(E(t))return t.invert(u.atan(e));throw new Error("Could not invert due to no input being a variable")}function Fu(e,t){if(E(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 Du(e,t){if(E(t))return t.invert(u.sin(e));throw new Error("Could not invert due to no input being a variable")}function Ou(e,t){if(E(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 Au(e,t){if(E(t))return t.invert(u.cos(e));throw new Error("Could not invert due to no input being a variable")}function Vu(e,t){if(E(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 qu(e,t){if(E(t))return t.invert(u.tan(e));throw new Error("Could not invert due to no input being a variable")}function Lu(e,t){if(E(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 Ru(e,t){if(E(t))return t.invert(u.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Bu(e,t){if(E(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 ju(e,t){if(E(t))return t.invert(u.acosh(e));throw new Error("Could not invert due to no input being a variable")}function Uu(e,t){if(E(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 zu(e,t){if(E(t))return t.invert(u.atanh(e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t){if(E(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 Wu(e,t){if(E(t))return t.invert(u.sinh(e));throw new Error("Could not invert due to no input being a variable")}function Hu(e,t){if(E(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 Zu(e,t){if(E(t))return t.invert(u.cosh(e));throw new Error("Could not invert due to no input being a variable")}function Yu(e,t){if(E(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 Ku(e,t){if(E(t))return t.invert(u.tanh(e));throw new Error("Could not invert due to no input being a variable")}function Ju(e,t){if(E(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 rn(e){return(t,n)=>new g({inputs:[t,n],evaluate:e,invert:dn})}function E(e){return e instanceof me&&e.hasVariable()}function ve(e,t){return e instanceof me?e.evaluate(t):a(e)}function Xu(){return g.pow(this,2).div(2)}function Qu(){return this}const be=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"&&it in n?n[it]:n)),"variable"in e?(typeof e.variable=="object"&&it in e.variable&&(e.variable=e.variable[it]),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:Xu,internalIntegrateInner:Qu,applySubstitution:dn}}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){const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:s,applySubstitution:l}=e,o=t.reduce((h,p)=>h+(p instanceof be?p.internalVariables:0),0),c=t.find(h=>h instanceof be&&h.hasVariable()),f=o===1?c==null?void 0:c.innermostVariable:void 0;return{inputs:t,internalEvaluate:n,internalInvert:i,internalIntegrate:r,internalIntegrateInner:s,applySubstitution:l,innermostVariable:f,internalVariables:o}}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=>ve(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:ve(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof be&&e.inputs[n]instanceof be?t.equals(e.inputs[n]):!(t instanceof be)&&!(e.inputs[n]instanceof be)&&u.eq(a(t),a(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=R(0),r=n(g.variable(i)),s=xe(t);function l(c){return u.lt(c,a(s))?c:(i.value=u.sub(c,a(s)),u.add(r.evaluate(),a(s)))}function o(c,f){if(E(f)&&r.isInvertible())return u.gt(c,a(s))&&(c=u.add(r.invert(u.sub(c,a(s))),a(s))),f.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()?o:void 0})}static if(e,t,n,i){const r=R(0),s=g.variable(r),l=n(s),o=i==null?void 0:i(s),c=xe(t);function f(p){return a(c)?(r.value=p,l.evaluate()):o?(r.value=p,o.evaluate()):p}function h(p,y){if(!E(y)||!l.isInvertible()||o!=null&&!o.isInvertible())throw new Error("Could not invert due to no input being a variable");return a(c)?y.invert(l.invert(p)):o?y.invert(o.invert(p)):y.invert(p)}return new g({inputs:[e],evaluate:f,invert:l.isInvertible()&&l.hasVariable()?h:void 0})}static conditional(e,t,n,i){return g.if(e,t,n,i)}static abs(e){return new g({inputs:[e],evaluate:u.abs})}static neg(e){return new g({inputs:[e],evaluate:u.neg,invert:Il,applySubstitution:$l,integrate:xl})}static sign(e){return new g({inputs:[e],evaluate:u.sign})}static round(e){return new g({inputs:[e],evaluate:u.round})}static floor(e){return new g({inputs:[e],evaluate:u.floor})}static ceil(e){return new g({inputs:[e],evaluate:u.ceil})}static trunc(e){return new g({inputs:[e],evaluate:u.trunc})}static add(e,t){return new g({inputs:[e,t],evaluate:u.add,invert:El,integrate:Tl,integrateInner:Pl,applySubstitution:dn})}static sub(e,t){return new g({inputs:[e,t],evaluate:u.sub,invert:Fl,integrate:Dl,integrateInner:Ol,applySubstitution:dn})}static mul(e,t){return new g({inputs:[e,t],evaluate:u.mul,invert:Al,integrate:Vl,applySubstitution:ql})}static div(e,t){return new g({inputs:[e,t],evaluate:u.div,invert:Ll,integrate:Rl,applySubstitution:Bl})}static recip(e){return new g({inputs:[e],evaluate:u.recip,invert:jl,integrate:Ul})}static clamp(e,t,n){return new g({inputs:[e,t,n],evaluate:u.clamp,invert:dn})}static pLog10(e){return new g({inputs:[e],evaluate:u.pLog10})}static absLog10(e){return new g({inputs:[e],evaluate:u.absLog10})}static log10(e){return new g({inputs:[e],evaluate:u.log10,invert:zl,integrate:Hl})}static log(e,t){return new g({inputs:[e,t],evaluate:u.log,invert:Zl,integrate:Jl})}static log2(e){return new g({inputs:[e],evaluate:u.log2,invert:Xl,integrate:tu})}static ln(e){return new g({inputs:[e],evaluate:u.ln,invert:nu,integrate:au})}static pow(e,t){return new g({inputs:[e,t],evaluate:u.pow,invert:su,integrate:ou})}static pow10(e){return new g({inputs:[e],evaluate:u.pow10,invert:lu,integrate:uu})}static pow_base(e,t){return new g({inputs:[e,t],evaluate:u.pow_base,invert:cu,integrate:du})}static root(e,t){return new g({inputs:[e,t],evaluate:u.root,invert:fu,integrate:gu})}static factorial(e){return new g({inputs:[e],evaluate:u.factorial})}static gamma(e){return new g({inputs:[e],evaluate:u.gamma})}static lngamma(e){return new g({inputs:[e],evaluate:u.lngamma})}static exp(e){return new g({inputs:[e],evaluate:u.exp,invert:pu,integrate:mu})}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=u.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:vu,invert:hu})}static iteratedexp(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:bu,invert:yu})}static iteratedlog(e,t=10,n=1){return new g({inputs:[e,t,n],evaluate:wu})}static slog(e,t=10){return new g({inputs:[e,t],evaluate:_u,invert:Nu})}static layeradd10(e,t){return new g({inputs:[e,t],evaluate:u.layeradd10})}static layeradd(e,t,n=10){return new g({inputs:[e,t,n],evaluate:Cu,invert:ku})}static lambertw(e){return new g({inputs:[e],evaluate:u.lambertw,invert:Su})}static ssqrt(e){return new g({inputs:[e],evaluate:u.ssqrt,invert:Mu})}static pentate(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new g({inputs:[e,t,n],evaluate:Iu})}static sin(e){return new g({inputs:[e],evaluate:u.sin,invert:Du,integrate:$u})}static cos(e){return new g({inputs:[e],evaluate:u.cos,invert:Au,integrate:Tu})}static tan(e){return new g({inputs:[e],evaluate:u.tan,invert:qu,integrate:Fu})}static asin(e){return new g({inputs:[e],evaluate:u.asin,invert:xu,integrate:Ou})}static acos(e){return new g({inputs:[e],evaluate:u.acos,invert:Eu,integrate:Vu})}static atan(e){return new g({inputs:[e],evaluate:u.atan,invert:Pu,integrate:Lu})}static sinh(e){return new g({inputs:[e],evaluate:u.sinh,invert:Wu,integrate:Bu})}static cosh(e){return new g({inputs:[e],evaluate:u.cosh,invert:Zu,integrate:Uu})}static tanh(e){return new g({inputs:[e],evaluate:u.tanh,invert:Ku,integrate:Gu})}static asinh(e){return new g({inputs:[e],evaluate:u.asinh,invert:Ru,integrate:Hu})}static acosh(e){return new g({inputs:[e],evaluate:u.acosh,invert:ju,integrate:Yu})}static atanh(e){return new g({inputs:[e],evaluate:u.atanh,invert:zu,integrate:Ju})}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=u.fromComponents_noNormalize(1,0,1)){return g.tetrate(this,e,t)}iteratedexp(e=2,t=u.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=u.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 me=be;me.negate=be.neg;me.negated=be.neg;me.sgn=be.sign;me.plus=be.add;me.subtract=be.sub;me.minus=be.sub;me.multiply=be.mul;me.times=be.mul;me.divide=be.div;me.divideBy=be.div;me.dividedBy=be.div;me.reciprocal=be.recip;me.reciprocate=be.recip;me.max=rn(u.max);me.min=rn(u.min);me.minabs=rn(u.minabs);me.maxabs=rn(u.maxabs);me.clampMin=rn(u.clampMin);me.clampMax=rn(u.clampMax);me.logarithm=be.log;class g extends me{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=u.add(this.evaluate(0),this.evaluate(1)).div(2);return u.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 ec(e,t,n=!0,i){const r=xe(n);return I(()=>{var l,o;let s;if(a(r)){if(!e.isIntegrable()||!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");s=u.floor(e.invertIntegral(u.add(t.value,e.evaluateIntegral()))).sub((l=a(e.innermostVariable))!=null?l:0),i==null&&(i=10)}else{if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula");s=u.floor(e.invert(t.value)),i==null&&(i=0)}if(i>0&&u.lt(Mt(e,s,!0,0),1e308)){s=s.sub(i).clampMin(0);let c=Mt(e,s,!0,0);for(;;){const f=e.evaluate(s.add((o=a(e.innermostVariable))!=null?o:0));if(u.add(c,f).lte(t.value))s=s.add(1),c=u.add(c,f);else break}}return s})}function Mt(e,t,n=!0,i){var s,l,o;let r=u.add(t,(s=a(e.innermostVariable))!=null?s:0);if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with spending resources of non-integrable formula");const c=r;r=r.sub(i!=null?i:10).clampMin((l=a(e.innermostVariable))!=null?l:0);let f=u.sub(e.evaluateIntegral(r),e.evaluateIntegral());if(c.gt(1e308))return f.add(u.sub(c,r).times(e.evaluate(r)));for(let h=r.toNumber();h{const{addend:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),l=xe(n),o=xe(i),c=r==null?void 0:xe(r);return{apply:f=>u.add(f,a(l)),invert:f=>u.sub(f,a(l)),getFormula:f=>g.add(f,l),enabled:c,description:i==null?void 0:ie(()=>m("div",{class:"modifier-container"},[a(o)!=null?m("span",{class:"modifier-description"},[tt(a(o))]):null,m("span",{class:"modifier-amount",style:(s===!0?u.gt(a(l),0):u.lt(a(l),0))?"color: var(--danger)":""},[u.gte(a(l),0)?"+":"",Bt(a(l))])]))}})}function _t(e){return nt(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:s}=e.call(t,t),l=xe(n),o=xe(i),c=r==null?void 0:xe(r);return{apply:f=>u.times(f,a(l)),invert:f=>u.div(f,a(l)),getFormula:f=>g.times(f,l),enabled:c,description:i==null?void 0:ie(()=>m("div",{class:"modifier-container"},[a(o)!=null?m("span",{class:"modifier-description"},[tt(a(o))]):null,m("span",{class:"modifier-amount",style:(s===!0?u.gt(a(l),1):u.lt(a(l),1))?"color: var(--danger)":""},[A("\xD7"),Bt(a(l))])]))}})}function At(e){return nt(()=>{const t=e();return{apply:n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>a(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?I(()=>t.filter(n=>a(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?ie(()=>m(se,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(tt)])):void 0}})}const tc={key:0},nc={key:0,class:"mark star"},ic=["src"],rc=Z({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(k(),$("div",tc,[e.mark===!0?(k(),$("div",nc)):(k(),$("img",{key:1,class:"mark",src:e.mark},null,8,ic))])):B("",!0)}});var An=fe(rc,[["__scopeId","data-v-2207999f"]]);const ac=Z({__name:"Node",props:{id:null},setup(e){const n=ye(e),i=Mn(Kn,()=>{}),r=Mn(Jn,()=>{}),s=ze(null),l=I(()=>s.value&&s.value.parentElement);return Ke([l,n.id],([o,c],[f,h])=>{f&&r(a(h)),o&&i(c,o)}),Si(()=>r(a(n.id))),(o,c)=>(k(),$("div",{class:"node",ref_key:"node",ref:s},null,512))}});var Vn=fe(ac,[["__scopeId","data-v-a48cb382"]]);Z({props:{display:{type:L(Object,String,Function),required:!0},visibility:{type:L(Number,Boolean),required:!0},style:L(Object,String,Array),classes:L(Object),onClick:Function,onHold:Function,canClick:{type:L(Boolean),required:!0},small:Boolean,mark:L(Boolean,String),id:{type:String,required:!0}},components:{Node:Vn,MarkNode:An},setup(e){const{display:t,onClick:n,onHold:i}=ye(e),r=ze("");Ye(()=>{var h;const o=$e(t);if(o==null){r.value="";return}if(at(o)){r.value=ue(o);return}const c=ue((h=o.title)!=null?h:"","h3"),f=ue(o.description,"div");r.value=ue(ie(()=>m("span",null,[o.title!=null?m("div",null,[m(c,null,null)]):null,m(f,null,null)])))});const{start:s,stop:l}=Ai(n,i);return{start:s,stop:l,comp:r,Visibility:ke,isVisible:Je,isHidden:nn,unref:a}}});const sc=["x1","y1","x2","y2"],oc=Z({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=ye(e),i=I(()=>{const s=n.startNode.value.rect,l=n.boundingRect.value,o=l?{x:s.x+s.width/2-l.x,y:s.y+s.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(o.x+=n.link.value.offsetStart.x,o.y+=n.link.value.offsetStart.y),o}),r=I(()=>{const s=n.endNode.value.rect,l=n.boundingRect.value,o=l?{x:s.x+s.width/2-l.x,y:s.y+s.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(o.x+=n.link.value.offsetEnd.x,o.y+=n.link.value.offsetEnd.y),o});return(s,l)=>(k(),$("line",gt({"stroke-width":"15px",stroke:"white"},e.link,{x1:a(i).x,y1:a(i).y,x2:a(r).x,y2:a(r).y}),null,16,sc))}});const lc=Z({__name:"Links",props:{links:null},setup(e){var c;const n=$t(e,"links"),i=R(null),r=Mn(Xn,R({})),s=Mn(Qn,R(void 0)),l=R((c=i.value)==null?void 0:c.getBoundingClientRect());Ke(s,()=>{var f;return l.value=(f=i.value)==null?void 0:f.getBoundingClientRect()}),Fn(()=>{var f;return l.value=(f=i.value)==null?void 0:f.getBoundingClientRect()});const o=I(()=>{var h,p;const f=r.value;return(p=(h=n.value)==null?void 0:h.filter(y=>{var N,_;return((N=f[y.startNode.id])==null?void 0:N.rect)&&((_=f[y.startNode.id])==null?void 0:_.rect)}))!=null?p:[]});return(f,h)=>(k(),$(se,null,[a(o)?(k(),$("svg",ar(gt({key:0},f.$attrs)),[(k(!0),$(se,null,tn(a(o),(p,y)=>(k(),Q(oc,{key:y,link:p,boundingRect:l.value,startNode:a(r)[p.startNode.id],endNode:a(r)[p.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),w("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var uc=fe(lc,[["__scopeId","data-v-063f6d6b"]]);Z({props:{nodes:{type:L(Array),required:!0},leftSideNodes:L(Array),rightSideNodes:L(Array),branches:L(Array)},components:{Links:uc},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=ye(e),r=ze();Ye(()=>{const o=$e(t);r.value=ue(ie(()=>m(se,null,[o.map(c=>m("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(tt)]))])))});const s=ze();Ye(()=>{const o=$e(n);s.value=o?ue(ie(()=>m("span",{class:"left-side-nodes small"},[o.map(tt)]))):""});const l=ze();return Ye(()=>{const o=$e(i);l.value=o?ue(ie(()=>m("span",{class:"side-nodes small"},[o.map(tt)]))):""}),{unref:a,nodesComp:r,leftNodesComp:s,rightNodesComp:l}}});Z({props:{display:L(Object,String,Function),visibility:{type:L(Number,Boolean),required:!0},style:L(String,Object,Array),classes:L(Object),onClick:Function,onHold:Function,color:L(String),glowColor:L(String),canClick:{type:L(Boolean),required:!0},mark:L(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:An,Node:Vn},setup(e){const{onClick:t,onHold:n,display:i}=ye(e),r=hn(i),{start:s,stop:l}=Ai(t,n);return{start:s,stop:l,comp:r,unref:a,Visibility:ke,isCoercableComponent:at,isVisible:Je,isHidden:nn}}});function fn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(o=>xe(o.base)),n.baseText=t.map(o=>xe(o.baseText)),n.visible=t.map(o=>xe(o.visible)),n.title=t.map(o=>xe(o.title)),n.subtitle=t.map(o=>xe(o.subtitle)),i=!0),t}const s=st({},!1);return[ie(()=>{const o=r();let c=!0;const f=o.map((h,p)=>{var q,x,D;if(a(n.visible[p])===!1)return null;const y=m("h3",{onClick:()=>s.value[p]=!s.value[p],style:"cursor: pointer"},[m("span",{class:"modifier-toggle"+(a(s.value[p])?" collapsed":"")},[A("\u25BC")]),a(n.title[p]),a(n.subtitle[p])!=null?m("span",{class:"subtitle"},[A(" ("),a(n.subtitle[p]),A(")")]):null]),N=a(s.value[p])?null:m(se,null,[m("div",{class:"modifier-container"},[m("span",{class:"modifier-description"},[tt((q=a(n.baseText[p]))!=null?q:"Base")]),m("span",{class:"modifier-amount"},[Rt((x=a(n.base[p]))!=null?x:1),h.unit])]),h.modifier.description==null?null:tt(a(h.modifier.description))]),_=!c;c=!1;const S=(D=a(n.base[p]))!=null?D:1,P=h.modifier.apply(S);return m(se,null,[_?m("br",null,null):null,m("div",{style:{"--unit":re.alignUnits&&h.unit!=null?"'"+h.unit+"'":""}},[y,m("br",null,null),N,m("hr",null,null),m("div",{class:"modifier-container"},[m("span",{class:"modifier-description"},[A("Total")]),m("span",{class:"modifier-amount",style:(h.smallerIsBetter===!0?u.gt(P,S!=null?S:1):u.lt(P,S!=null?S:1))?"color: var(--danger)":""},[Bt(P),h.unit])])])])});return m(se,null,[f])}),s]}function hi(e,t,n){const i=xe(t),r=xe(n);return I(()=>{const s=a(i),l=a(r);return u.gte(e.value,l)?"Now":u.lte(s,0)?"Never":Dn(u.sub(l,e.value).div(s))})}function Pn(e,t,n=1){const i=xe(t),r=xe(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return ie(()=>{var s;if(a(i)){const l=Bt(e.evaluate()),o=Bt(e.evaluate(u.add(a((s=e.innermostVariable)!=null?s:0),a(r))));return m(se,null,[m("b",null,[m("i",null,[l,A(" \u2192 "),o])])])}return m(se,null,[Bt(e.evaluate())])})}const cc=Z({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(k(),$("div",{style:qe({width:e.width,height:e.height})},null,4))}});function bi(e){return nt(t=>{const n=e.call(t,t);if(n.partialDisplay=i=>m("span",{style:a(n.requirementMet)?"":"color: var(--danger)"},[vi(n.resource,n.cost instanceof g?Mt(n.cost,i!=null?i:1,a(n.spendResources)):a(n.cost))," ",n.resource.displayName]),n.display=i=>m("div",null,[a(n.requiresPay)?"Costs: ":"Requires: ",vi(n.resource,n.cost instanceof g?Mt(n.cost,i!=null?i:1,a(n.spendResources)):a(n.cost))," ",n.resource.displayName]),O(n,"visibility"),de(n,"visibility",ke.Visible),O(n,"cost"),O(n,"requiresPay"),de(n,"requiresPay",!0),O(n,"spendResources"),de(n,"spendResources",!0),de(n,"pay",function(i){const r=n.cost instanceof g?Mt(n.cost,i!=null?i:1,a(n.spendResources)):a(n.cost);n.resource.value=u.sub(n.resource.value,r).max(0)}),n.canMaximize=I(()=>n.cost instanceof g&&n.cost.isInvertible()&&(a(n.spendResources)===!1||n.cost.isIntegrable())),n.cost instanceof g&&n.cost.isInvertible()){const i=ec(n.cost,n.resource,a(n.spendResources));n.requirementMet=I(()=>a(n.canMaximize)?i.value:n.cost instanceof g?u.gte(n.resource.value,n.cost.evaluate()):u.gte(n.resource.value,a(n.cost)))}else n.requirementMet=I(()=>n.cost instanceof g?u.gte(n.resource.value,n.cost.evaluate()):u.gte(n.resource.value,a(n.cost)));return n})}function Ki(e){return nt(()=>({requirementMet:I(()=>Je(e.visibility)),visibility:ke.None,requiresPay:!1}))}function dc(e,t){return nt(()=>({requirementMet:xe(e),partialDisplay:t==null?void 0:ie(()=>tt(t)),display:t==null?void 0:ie(()=>m(se,null,[A("Req: "),tt(t)])),visibility:t==null?ke.None:ke.Visible,requiresPay:!1}))}function ri(e){if(It(e))return e.every(ri);const t=a(e.requirementMet);return typeof t=="boolean"?t:u.gt(t,0)}function ai(e,t=1){var n,i;if(It(e)&&(e=e.filter(r=>Je(r.visibility)),e.length===1&&(e=e[0])),It(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>a(l.requiresPay)),s=e.filter(l=>!a(l.requiresPay));return m(se,null,[r.length>0?m("div",null,[A("Costs:")," ",gi(r.map(l=>l.partialDisplay(t)),m(se,null,[A(", ")]))]):null,s.length>0?m("div",null,[A("Requires:")," ",gi(s.map(l=>l.partialDisplay(t)),m(se,null,[A(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:m(se,null,null)}function fc(e,t=1){var n;It(e)?e.filter(i=>a(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):a(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var gc=Z({props:{display:{type:L(String,Object,Function),required:!0},visibility:{type:L(Number,Boolean),required:!0},style:L(String,Object,Array),classes:L(Object),requirements:{type:Object,required:!0},canPurchase:{type:L(Boolean),required:!0},bought:{type:L(Boolean),required:!0},mark:L(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:Vn,MarkNode:An},setup(e){const{display:t,requirements:n,bought:i}=ye(e),r=ze("");return Ye(()=>{const s=$e(t);if(s==null){r.value="";return}if(at(s)){r.value=ue(s);return}const l=ue(s.title||"","h3"),o=ue(s.description,"div"),c=ue(s.effectDisplay||"");r.value=ue(ie(()=>m("span",null,[s.title!=null?m("div",null,[m(l,null,null)]):null,m(o,null,null),s.effectDisplay!=null?m("div",null,[A("Currently: "),m(c,null,null)]):null,i.value?null:m(se,null,[m("br",null,null),ai(n.value)])])))}),{component:r,unref:a,Visibility:ke,isVisible:Je,isHidden:nn}}});const pc=["disabled"];function mc(e,t,n,i,r,s){var c;const l=xt("MarkNode"),o=xt("Node");return e.isVisible(e.visibility)?(k(),$("button",{key:0,style:qe([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...f)=>e.purchase&&e.purchase(...f)),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(),Q(Oe(e.unref(e.component)),{key:0})):B("",!0),m(l,{mark:e.unref(e.mark)},null,8,["mark"]),m(o,{id:e.id},null,8,["id"])],14,pc)):B("",!0)}var vc=fe(gc,[["render",mc],["__scopeId","data-v-9be6bac0"]]);const hc=Symbol("Upgrade");function bc(e,...t){const n=st(!1,!1),i=t.reduce((r,s)=>{var l;return Object.assign(r,(l=s.getPersistentData)==null?void 0:l.call(s))},{});return nt(r=>{var c,f;const s=e.call(r,r);s.id=On("upgrade-"),s.type=hc,s[rt]=vc;for(const h of t)(c=h.preConstruct)==null||c.call(h,s);s.bought=n,Object.assign(s,i),s.canPurchase=I(()=>ri(s.requirements)),s.purchase=function(){var p;const h=s;!a(h.canPurchase)||(fc(s.requirements),n.value=!0,(p=h.onPurchase)==null||p.call(h))};const l=Ki(s);It(s.requirements)?s.requirements.unshift(l):s.requirements=[l,s.requirements],O(s,"visibility"),de(s,"visibility",ke.Visible),O(s,"classes"),O(s,"style"),O(s,"display"),O(s,"mark");for(const h of t)(f=h.postConstruct)==null||f.call(h,s);const o=t.reduce((h,p)=>{var y;return Object.assign(h,(y=p.getGatheredProps)==null?void 0:y.call(p,s))},{});return s[et]=function(){const{display:h,visibility:p,style:y,classes:N,requirements:_,canPurchase:S,bought:P,mark:q,id:x,purchase:D}=this;return{display:h,visibility:p,style:a(y),classes:N,requirements:_,canPurchase:S,bought:P,mark:q,id:x,purchase:D,...o}},s})}function yc(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 wc={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"]},yi=[[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 wi(e){const t=yi[Math.floor(e()*yi.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Ni(e,t){return O(t,"display"),O(t,"classes"),O(t,"style"),O(t,"direction"),de(t,"direction",W.Up),O(t,"xoffset"),O(t,"yoffset"),t.pinnable&&(t.pinned=st(!1,!1)),ft(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Li(t.pinned)):e.pinned=t.pinned);const n=e[rt];e[rt]=Ne;const i=e[et].bind(e);e[et]=function(){const{display:s,classes:l,style:o,direction:c,xoffset:f,yoffset:h,pinned:p}=this;return{element:{[rt]:n,[et]:i},display:s,classes:l,style:a(o),direction:c,xoffset:f,yoffset:h,pinned:p}}.bind(t)}),t}var Cc=Z({props:{visibility:{type:L(Number,Boolean),required:!0},display:L(Object,String,Function),earned:{type:L(Boolean),required:!0},requirements:L(Object,Array),image:L(String),style:L(String,Object,Array),classes:L(Object),mark:L(Boolean,String),small:L(Boolean),id:{type:String,required:!0}},components:{Node:Vn,MarkNode:An},setup(e){const{display:t,requirements:n,earned:i}=ye(e),r=ze("");return Ye(()=>{const s=$e(t);if(s==null){r.value="";return}if(at(s)){r.value=ue(s);return}const l=ue(s.requirement?s.requirement:ie(()=>{var f;return ai((f=$e(n))!=null?f:[])}),"h3"),o=ue(s.effectDisplay||"","b"),c=$e(i)?ue(s.optionsDisplay||"","span"):"";r.value=ue(ie(()=>m("span",null,[m(l,null,null),s.effectDisplay!=null?m("div",null,[m(o,null,null)]):null,s.optionsDisplay!=null?m("div",{class:"equal-spaced"},[m(c,null,null)]):null])))}),{comp:r,unref:a,Visibility:ke,isVisible:Je,isHidden:nn}}});function kc(e,t,n,i,r,s){var c;const l=xt("MarkNode"),o=xt("Node");return e.isVisible(e.visibility)?(k(),$("div",{key:0,style:qe([{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(),Q(Oe(e.comp),{key:0})):B("",!0),m(l,{mark:e.unref(e.mark)},null,8,["mark"]),m(o,{id:e.id},null,8,["id"])],6)):B("",!0)}var Sc=fe(Cc,[["render",kc],["__scopeId","data-v-5673325a"]]);const Mc=Zn(),Ic=Symbol("Achievement");let Kt=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function xc(e,...t){const n=st(!1,!1),i=t.reduce((r,s)=>{var l;return Object.assign(r,(l=s.getPersistentData)==null?void 0:l.call(s))},{});return nt(r=>{var c,f,h;const s=(c=e==null?void 0:e.call(r,r))!=null?c:{};s.id=On("achievement-"),s.type=Ic,s[rt]=Sc;for(const p of t)(f=p.preConstruct)==null||f.call(p,s);s.earned=n,s.complete=function(){var y,N;n.value=!0;const p=s;if((y=p.onComplete)==null||y.call(p),p.display!=null&&a(p.showPopups)===!0){const _=a(p.display);let S;at(_)?S=ue(_):_.requirement!=null?S=ue(_.requirement):S=ai((N=p.requirements)!=null?N:[]),Mc.info(m("div",null,[m("h3",null,[A("Achievement earned!")]),m("div",null,[m(S,null,null)])]))}},Object.assign(s,i),O(s,"visibility"),de(s,"visibility",ke.Visible);const l=s.visibility;s.visibility=sr(()=>{const p=a(s.display);switch(re.msDisplay){default:case Kt.All:return a(l);case Kt.Configurable:return a(s.earned)&&!(p!=null&&typeof p=="object"&&"optionsDisplay"in p)?ke.None:a(l);case Kt.Incomplete:return a(s.earned)?ke.None:a(l);case Kt.None:return ke.None}}),O(s,"display"),O(s,"mark"),O(s,"small"),O(s,"image"),O(s,"style"),O(s,"classes"),O(s,"showPopups"),de(s,"showPopups",!0);for(const p of t)(h=p.postConstruct)==null||h.call(p,s);const o=t.reduce((p,y)=>{var N;return Object.assign(p,(N=y.getGatheredProps)==null?void 0:N.call(y,s))},{});if(s[et]=function(){const{visibility:p,display:y,requirements:N,earned:_,image:S,style:P,classes:q,mark:x,small:D,id:F}=this;return{visibility:p,display:y,requirements:N,earned:_,image:S,style:a(P),classes:q,mark:x,small:D,id:F,...o}},s.requirements){const p=s,y=[Ki(p),dc(()=>!p.earned.value),...It(s.requirements)?s.requirements:[s.requirements]];Ye(()=>{re.active===H.id&&ri(y)&&p.complete()})}return s})}Ae.on("loadSettings",e=>{de(e,"msDisplay",Kt.All)});const $c=Object.values(Kt).map(e=>({label:He(e),value:e}));wa(ie(()=>m(ni,{title:ie(()=>m("span",{class:"option-title"},[A("Show achievements"),m("desc",null,[A("Select which achievements to display based on criterias.")])])),options:$c,"onUpdate:modelValue":e=>re.msDisplay=e,modelValue:re.msDisplay},null)));function Ji(e,t,n){return ei(e,function(){const i=yc(0,n>>0,n>>32,1);for(let z=0;z<12;z++)i();const r=wi(i),s=_i([.64,.75,.55],i),l=_i([.18,.2,.25],i),o=Hi(0,wi(i)),c=Nt.indexOf(t),f=i()+c+1,h=Math.ceil(i()*(c+2)),p=[],y=At(()=>p),N=I(()=>y.apply(0)),_=[],S=[],P=R(0);let q=g.variable(P),x=!0;for(let z=0;zwe+_e),an=Object.keys(ne);let Et=Math.floor(i()*Se),vt=0,Ht=null;for(let we=0;weRe+ut),Cn=Object.keys(lt);let b=0,d=null;Et=i()*Yt;for(let Re=0;Reut.add(Re)),ee=Gn(()=>({addend:Re,description:T,enabled:De.bought}));break}case"mult":{const Re=i()*5+1;V=`Multiply ${o.displayName} gain by ${Ie(Re)}.`,q=q.step(P.value,ut=>{const si=u.sub(P.value,ut.evaluate());return ut.add(si).times(Re).sub(si)}),ee=_t(()=>({multiplier:Re,description:T,enabled:De.bought}));break}}P.value=u.times(f,i()+.5).pow_base(2).add(P.value);const Fe=x,De=bc(()=>({requirements:bi(()=>({resource:mi(o),cost:M})),display:{title:T,description:V},visibility:Fe})),yt=Ia(De);_.push({shouldShowPreview:I(()=>!De.bought.value&&De.canPurchase.value&&yt.value),modifier:ee,cost:M}),p.push(ee);const ln=hi(o,N,M);Ni(De,{display:()=>De.bought.value?"":ln.value,direction:W.Down}),we.push(De)}S.push(we);break}const Zt={cache:100,generation:10,resourceMulti:5,energyMulti:5},yn=Object.values(Zt).reduce((we,_e)=>we+_e),ot=Object.keys(Zt);Et=Math.floor(i()*yn),vt=0;let Tt=null;for(let we=0;we{var _e,lt,Yt;return Jt.grantResource(Le,u.times((Yt=(lt=(_e=Jt.resourceNodes.value[Le])==null?void 0:_e.state)==null?void 0:lt.amount)!=null?Yt:0,f))};break;case"generation":Le=Un(i);const we=u.div(f,120).times(Ze[Le]);Pt=`Gain ${Ie(we)} ${Le}/s while plane is active.`,wn=_e=>Jt.grantResource(Le,u.times(_e,we)),Nn=I(()=>Jt.resourceNodes.value[Le]);break;case"resourceMulti":sn=Le=Un(i),Ft=u.div(f,17).pow_base(2),Pt=`Gain ${Ie(Ft)}x ${Le} while plane is active.`;break;case"energyMulti":sn="energy",Ft=u.div(f,17),Pt=`Gain ${Ie(Ft)}x energy while plane is active.`;break}const on=u.times(f,i()+.5).pow_base(2).times(10).times(q.evaluate()),ht=x,bt=xc(()=>({requirements:bi(()=>({resource:mi(o),cost:on})),visibility:ht,display:{requirement:`${Ie(on)} ${o.displayName}`,effectDisplay:Pt},style:"width: 100%",classes:{final:z===h-1},update:wn,onComplete:_n,link:Nn,effectedResource:sn,resourceMulti:Ft})),Ln=hi(o,N,on);Ni(bt,{display:()=>bt.earned.value?"":Ln.value,direction:W.Down}),S.push([bt]),x=bt.earned}const[D,F]=fn(()=>[{title:`${He(o.displayName)} Gain`,modifier:y,base:0,unit:"/s"}]),j=R(!1),oe=ie(()=>m(pt,{modelValue:j.value,"onUpdate:modelValue":z=>j.value=z},{header:()=>m("h2",null,[A("Modifiers")]),body:()=>Ue(D)}));this.on("preUpdate",z=>{o.value=u.times(N.value,z).add(o.value),Ee.value.forEach(ne=>{var Se;(Se=ne.update)==null||Se.call(ne,z)})});const ae=I(()=>{const z=_.find(ne=>ne.shouldShowPreview.value);return z?u.neg(z.cost):0}),X=I(()=>{const z=_.find(ne=>ne.shouldShowPreview.value);return z?u.sub(z.modifier.apply(N.value),N.value):0}),Pe=Pn(g.variable(0).add(o),()=>u.neq(ae.value,0),ae),Y=Pn(g.variable(0).add(N),()=>u.neq(X.value,0),X),K=I(()=>{const z=[];return Ee.value.forEach(ne=>{ne.link&&z.push(ne.link)}),z}),pe=I(()=>{const z={};return Ee.value.forEach(ne=>{ne.effectedResource!=null&&ne.resourceMulti!=null&&(z[ne.effectedResource]!=null?z[ne.effectedResource]=u.times(z[ne.effectedResource],ne.resourceMulti):z[ne.effectedResource]=ne.resourceMulti)}),z}),Ee=I(()=>{const z=[];for(let ne=1;nem(se,null,[m(Tn,{class:"nav-container"},{default:()=>[m("span",{class:"nav-segment"},[m("h2",null,[r])]),m("span",{class:"nav-segment"},[m("h3",null,[t,A("-tier")])]),m("span",{class:"nav-segment"},[m("button",{class:"button",style:"display: inline",onClick:()=>j.value=!0},[A("open modifiers")])])]}),m(Tn,{class:"nav-container"},{default:()=>[m("span",{class:"nav-segment"},[m("h3",{style:`color: ${s}; text-shadow: 0px 0px 10px ${s};`},[Ue(Pe)])," ",o.displayName]),m("span",{class:"nav-segment"},[A("("),m("h3",{style:`color: ${s}; text-shadow: 0px 0px 10px ${s};`},[u.gt(N.value,0)?"+":"",Ue(Y)]),A("/s)")])]}),m(cc,{height:"60px"},null),S.map(z=>Ma(...z)),Ue(oe)])),minimizedDisplay:ie(()=>m("div",null,[m("span",null,[r]),m("span",{style:"font-size: large; vertical-align: sub;"},[" ",Ee.value.length,A("/"),h,A(" treasures")])]))}})}function Un(e){const t=Object.values(Ze).reduce((l,o)=>l+o),n=Object.keys(Ze),i=Math.floor(e()*t);let r=0,s;for(let l=0;le?"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"}},Jt=ei("main",function(){const e=Hi(0,"energy"),t=g.variable(0).add(1),n=I(()=>F.types.resource.nodes.value.reduce((b,d)=>(b[d.state.type]=d,b),{})),i=I(()=>({...F.types.passive.nodes.value.reduce((b,d)=>(b[d.state]=d,b),{}),sand:F.types.dowsing.nodes.value[0],wood:F.types.quarry.nodes.value[0],coal:F.types.empowerer.nodes.value[0],iron:F.types.portalGenerator.nodes.value[0]})),r=I(()=>Nt.reduce((b,d)=>{var ee,Fe,De;const M=(De=(Fe=(ee=n.value[d])==null?void 0:ee.state)==null?void 0:Fe.amount)!=null?De:0;let T=u.floor(t.invertIntegral(M)).sub(10).clampMin(0),V=Mt(t,T,!0,0);for(;;){const yt=t.evaluate(T);if(u.add(V,yt).lte(M))T=T.add(1),V=u.add(V,yt);else break}return b[d]=T,b},{}));function s(b){var ee,Fe,De;const d=(De=(Fe=(ee=n.value[b])==null?void 0:ee.state)==null?void 0:Fe.amount)!=null?De:0,M=r.value[b],T=Mt(t,M,!0),V=Mt(t,u.add(M,1),!0);return u.sub(d,T).max(0).div(u.sub(V,T)).toNumber()}const l=Ut({}),o=Ut({});ft(()=>{Nt.forEach(b=>{Ke(()=>r.value[b],(d,M)=>{u.gt(d,M)&&re.active===H.id&&Ci.info(m("div",null,[m("h3",null,[u.eq(d,1)?`${He(b)} discovered`:`${He(b)} is now Level ${Xe(d)}`,A("!")]),m("div",null,[A("Energy gain is now 1.01x higher.")])]))})})});const c=I(()=>[oe,X,Pe,Y].filter(b=>{var d,M;return(M=(d=b.value)==null?void 0:d.state)==null?void 0:M.powered}).length),f=I(()=>u.eq(c.value,0)?10:u.add(c.value,1).pow_base(100).div(10).times(.99)),h=I(()=>Pe.value==null?0:Pe.value.state.resources.reduce((d,M)=>u.div(100,ot[M].computedModifier.value).add(d),u.dZero)),p={id:"deselect",icon:"close",tooltip:b=>({text:"resources"in b.state?"Disconnect resources":"Disconnect tools"}),onClick(b){"resources"in b.state?b.state={...b.state,resources:[]}:"tools"in b.state&&(b.state={...b.state,tools:[]}),F.selectedAction.value=null,F.selectedNode.value=null},visibility:b=>"resources"in b.state?b.state.resources.length>0:"tools"in b.state?b.state.tools.length>0:!0},y={id:"toggle",icon:"bolt",tooltip:b=>({text:b.state.powered?"Turn Off":`Turn On - Always runs for ${Xe(f.value)} energy/s`}),onClick(b){b.state={...b.state,powered:!b.state.powered},F.selectedAction.value=null},fillColor:b=>b.state.powered?"var(--accent1)":"var(--locked)"};function N(b,d=1/0){const M=b(g.variable(0));return{id:"moreConnections",icon:"hub",formula:M,tooltip(T){return{text:`Increase Connections - ${Xe(M.evaluate(T.state.maxConnections))} energy`}},confirmationLabel:T=>u.gte(e.value,M.evaluate(T.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(T){const V=M.evaluate(T.state.maxConnections);u.gte(e.value,V)&&(e.value=u.sub(e.value,V)),T.state={...T.state,maxConnections:T.state.maxConnections+1},F.selectedAction.value=null},visibility:T=>T.state.maxConnectionsV!==M)}:b.state={...b.state,resources:[...T,M]},F.selectedNode.value=b}function x(b,d){if(d.type!=="passive")return!1;const M=d.state,{maxConnections:T,tools:V}=b.state;return V.includes(M)?!0:V.length!==T}function D(b,d){if(d.type!=="passive")return;const M=d.state,T=b.state.tools;T.includes(M)?b.state={...b.state,tools:T.filter(V=>V!==M)}:b.state={...b.state,tools:[...T,M]},F.selectedNode.value=b}const F=hl(b=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:{mine:{shape:Be.Diamond,size:50,title:"\u{1FAA8}",label:d=>d===b.selectedNode.value?{text:"Mining"}:Object.keys(n.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[y],progress:d=>j(d)?new u(d.state.progress).toNumber():0,progressDisplay:Lt.Outline,progressColor:"var(--accent2)",classes:d=>({running:j(d)}),draggable:!0},brokenFactory:{shape:Be.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>d===b.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(d){u.gte(e.value,100)&&(d.type="factory",e.value=u.sub(e.value,100))},confirmationLabel:()=>u.gte(e.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},factory:{shape:Be.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:d=>{var M,T;if(d===b.selectedNode.value)return{text:d.state==null?"Forge - Drag a resource to me!":`Forging ${Te[d.state].name}`};if(((M=b.draggingNode.value)==null?void 0:M.type)==="resource"){const V=((T=b.draggingNode.value)==null?void 0:T.state).type,ee=d.state===V?"Disconnect":Te[V].name,Fe=d.state===V||u.gte(e.value,Te[V].cost)&&i.value[V]==null?"var(--accent2)":"var(--danger)";return{text:ee,color:Fe}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(d){d.state=void 0,b.selectedAction.value=null,b.selectedNode.value=null},visibility:d=>d.state!=null},{id:"craft",icon:"done",tooltip:d=>({text:`Forge ${Te[d.state].name} - ${Xe(Te[d.state].cost)} energy`}),onClick(d){const M=Te[d.state];if(u.gte(e.value,M.cost)&&i.value[d.state]==null){e.value=u.sub(e.value,M.cost);const T={id:jn(b),position:{...d.position},type:M.type,state:M.state};b.placeInAvailableSpace(T),b.nodes.value.push(T),b.selectedAction.value=null,b.selectedNode.value=null,d.state=void 0}},fillColor:d=>u.gte(e.value,Te[d.state].cost)&&i.value[d.state]==null?"var(--accent2)":"var(--danger)",visibility:d=>d.state!=null,confirmationLabel:d=>u.gte(e.value,Te[d.state].cost)?i.value[d.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:d=>d.state==null||i.value[d.state]!=null?0:u.div(e.value,Te[d.state].cost).clampMax(1).toNumber(),progressDisplay:Lt.Fill,progressColor:d=>d.state!=null&&u.gte(e.value,Te[d.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(d,M){return M.type==="resource"},onDrop(d,M){const T=M.state.type;d.state===T?d.state=void 0:d.state=T,b.selectedNode.value=d},draggable:!0},resource:{shape:Be.Circle,size:50,title:d=>He(d.state.type),subtitle:d=>Xe(d.state.amount),progress:d=>s(d.state.type),onClick(){},progressDisplay:Lt.Outline,progressColor:"var(--accent3)",classes:d=>{var M;return{"affected-node":X.value!=null&&j(X.value)&&X.value.state.resources.includes(d.state.type)||u.neq((M=z.value[d.state.type])!=null?M:1,1)}},draggable:!0},passive:{shape:Be.Circle,size:50,title:d=>Te[d.state].name,label:d=>d===b.selectedNode.value?{text:ki[d.state].description(Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes(d.state))}:null,outlineColor:"var(--bought)",classes:d=>({"affected-node":Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes(d.state)}),draggable:!0},dowsing:{shape:Be.Diamond,size:50,title:"\u{1F962}",label:d=>d===b.selectedNode.value?{text:d.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,M=>`Double ${M} odds`),actionDistance:Math.PI/4,actions:[p,N(d=>d.add(2).pow_base(100),16),y],classes:d=>({running:j(d)}),canAccept:P,onDrop:q,draggable:!0},quarry:{shape:Be.Diamond,size:50,title:"\u26CF\uFE0F",label:d=>d===b.selectedNode.value?{text:d.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${d.state.resources.length}/${d.state.maxConnections})`}:_(d,M=>`Gather ${Rt(u.div(ot[M].computedModifier.value,100))} ${M}/s`),actionDistance:Math.PI/4,actions:[p,N(d=>d.add(2).pow_base(1e4),16),y],progress:d=>j(d)?u.eq(h.value,0)?0:new u(d.state.progress).div(h.value).toNumber():0,progressDisplay:Lt.Outline,progressColor:"var(--accent2)",canAccept:P,onDrop:q,classes:d=>({running:j(d)}),draggable:!0},empowerer:{shape:Be.Diamond,size:50,title:"\u{1F50C}",label:d=>d===b.selectedNode.value?{text:d.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${d.state.tools.length}/${d.state.maxConnections})`}:S(d,M=>`Double ${Te[M].name}'s effect`),actionDistance:Math.PI/4,actions:[p,N(d=>d.add(3).pow_base(1e3),16),y],canAccept:x,onDrop:D,classes:d=>({running:j(d)}),draggable:!0},portalGenerator:{shape:Be.Diamond,size:50,title:"\u26E9\uFE0F",label:d=>{var M,T;if(d===b.selectedNode.value)return{text:d.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${d.state.tier}-tier portal`};if(((M=b.draggingNode.value)==null?void 0:M.type)==="resource"){const V=((T=b.draggingNode.value)==null?void 0:T.state).type;return{text:d.state.tier===V?"Disconnect":`${He(V)}-tier Portal`,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(d){d.state={...d.state,tier:void 0,influences:[]},b.selectedAction.value=null,b.selectedNode.value=null},visibility:d=>{const{tier:M,influences:T}=d.state;return M!=null||T.length>0}},{id:"makePortal",icon:"done",tooltip:d=>({text:`Spawn ${d.state.tier}-tier portal`}),onClick(d){let M=0;for(;`portal-${M}`in he;)M++;ti(Ji(`portal-${M}`,d.state.tier,Math.floor(Math.random()*4294967296)),H);const T={id:jn(b),position:{...d.position},type:"portal",state:{id:`portal-${M}`,powered:!1}};b.placeInAvailableSpace(T),b.nodes.value.push(T),b.selectedAction.value=null,b.selectedNode.value=null,d.state={tier:void 0,influences:[]}},visibility:d=>d.state.tier!=null}],canAccept(d,M){return M.type==="resource"||M.type==="influence"},onDrop(d,M){if(M.type==="resource"){const T=M.state.type,V=d.state.tier;d.state={...d.state,tier:T===V?void 0:T}}else if(M.type==="influence"){const T=M.state,V=d.state.influences;V.includes(T)?d.state={...d.state,influences:V.filter(ee=>ee!==T)}:d.state={...d.state,influences:[...V,T]}}b.selectedNode.value=d},draggable:!0},portal:{shape:Be.Diamond,size:50,title:"\u{1F300}",label:d=>d===b.selectedNode.value?{text:`Portal to ${he[d.state.id].name}`,color:he[d.state.id].color}:null,actionDistance:Math.PI/4,actions:[y],classes:d=>({running:j(d)}),outlineColor:d=>he[d.state.id].background,draggable:!0}},style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const d=[];return d.push(...Object.keys(l).map(M=>({startNode:oe.value,endNode:n.value[M],stroke:"var(--accent3)",strokeWidth:5}))),ae.value!=null&&ae.value.state!=null&&d.push({startNode:ae.value,endNode:n.value[ae.value.state],stroke:"var(--foreground)",strokeWidth:4}),X.value!=null&&X.value.state.resources.forEach(M=>{d.push({startNode:X.value,endNode:n.value[M],stroke:j(X.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),Pe.value!=null&&Pe.value.state.resources.forEach(M=>{d.push({startNode:Pe.value,endNode:n.value[M],stroke:"var(--foreground)",strokeWidth:4})}),d.push(...Object.keys(o).map(M=>({startNode:Pe.value,endNode:n.value[M],stroke:"var(--accent3)",strokeWidth:5}))),Y.value!=null&&Y.value.state.tools.forEach(M=>{d.push({startNode:Y.value,endNode:i.value[M],stroke:j(Y.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),K.value!=null&&(K.value.state.tier!=null&&d.push({startNode:K.value,endNode:n.value[K.value.state.tier],stroke:"var(--foreground)",strokeWidth:4}),b.types.portal.nodes.value.forEach(M=>{const T=he[M.state.id];return T.links.value.forEach(V=>{V.value!=null&&d.push({startNode:M,endNode:V.value,stroke:j(M)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(T.resourceMultis.value).forEach(V=>{V!=="energy"&&V in n.value&&d.push({startNode:M,endNode:n.value[V],stroke:j(M)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),d})),d}}));function j(b){return b===F.selectedNode.value||b.state.powered}const oe=I(()=>F.types.mine.nodes.value[0]),ae=I(()=>F.types.factory.nodes.value[0]),X=I(()=>i.value.sand),Pe=I(()=>i.value.wood),Y=I(()=>i.value.coal),K=I(()=>i.value.iron);function pe(b,d){let M=n.value[b];if(d=u.times(d,Tt[b].computedModifier.value),M==null)M={id:jn(F),position:{...oe.value.position},type:"resource",state:{type:b,amount:d}},F.placeInAvailableSpace(M),F.nodes.value.push(M);else{const T=M.state;M.state={...T,amount:u.add(T.amount,d)}}}const Ee=I(()=>Object.keys(Ze).reduce((b,d)=>b+new u(ot[d].computedModifier.value).toNumber(),0)),z=I(()=>{const b={};return F.types.portal.nodes.value.forEach(d=>{if(!j(d))return;const T=he[d.state.id].resourceMultis.value;Object.keys(T).forEach(V=>{b[V]!=null?b[V]=u.times(b[V],T[V]):b[V]=T[V]})}),b}),ne=At(()=>[...Nt.map(b=>_t(()=>({description:()=>`${He(b)} (Lv. ${Xe(r.value[b])}) (${Rt(yn.value)}x per level)`,multiplier:()=>u.pow(yn.value,r.value[b]),enabled:()=>{var d,M;return b in n.value&&u.gt((M=(d=n.value[b].state)==null?void 0:d.amount)!=null?M:0,0)}}))),_t(()=>({multiplier:()=>Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("stone")?4:2,description:()=>(Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("stone")?"Empowered ":"")+Te.stone.name,enabled:()=>i.value.stone!=null})),_t(()=>({multiplier:()=>{var b;return(b=z.value.energy)!=null?b:1},description:"Planar Treasures",enabled:()=>{var b;return u.neq((b=z.value.energy)!=null?b:1,1)}})),Gn(()=>({addend:()=>u.pow(100,c.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>u.gt(c.value,0)}))]),Se=I(()=>ne.apply(1)),an=At(()=>[_t(()=>({multiplier:()=>Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("dirt")?4:2,description:()=>(Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("dirt")?"Empowered ":"")+Te.dirt.name,enabled:()=>i.value.dirt!=null}))]),Et=I(()=>an.apply(1)),vt=At(()=>[_t(()=>({multiplier:()=>Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("gravel")?4:2,description:()=>(Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("gravel")?"Empowered ":"")+Te.gravel.name,enabled:()=>i.value.gravel!=null}))]),Ht=I(()=>vt.apply(1)),Zt=At(()=>[Gn(()=>({addend:()=>Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("copper")?.002:.001,description:()=>(Y.value!=null&&j(Y.value)&&Y.value.state.tools.includes("copper")?"Empowered ":"")+Te.copper.name,enabled:()=>i.value.copper!=null}))]),yn=I(()=>Zt.apply(1.01)),ot=Object.keys(Ze).reduce((b,d)=>{const M=At(()=>[_t(()=>({multiplier:2,description:"Dowsing",enabled:()=>X.value!=null&&j(X.value)&&X.value.state.resources.includes(d)}))]),T=I(()=>M.apply(Ze[d])),V={title:`${He(d)} Drop Rate`,modifier:M,base:Ze[d]};return b[d]={modifier:M,computedModifier:T,section:V},b},{}),Tt=Object.keys(Ze).reduce((b,d)=>{const M=At(()=>[_t(()=>({multiplier:()=>{var ee;return(ee=z.value[d])!=null?ee:1},description:"Planar Treasures",enabled:()=>{var ee;return u.neq((ee=z.value[d])!=null?ee:1,1)}}))]),T=I(()=>M.apply(1)),V={title:`${He(d)} Gain`,modifier:M};return b[d]={modifier:M,computedModifier:T,section:V},b},{}),[Pt,wn]=fn(()=>[{title:"Energy Gain",modifier:ne,base:1,unit:"/s"}]),[_n,Nn]=fn(()=>[{title:"Mining Speed",modifier:an,base:1,unit:"/s",visible:()=>i.value.dirt!=null},{title:"Ore Dropped",modifier:vt,base:1,visible:()=>i.value.gravel!=null},{title:"Material Level Effect",modifier:Zt,base:1.01,visible:()=>i.value.copper!=null}]),[Le,sn]=fn(()=>Object.values(ot).map(b=>b.section)),[Ft,on]=fn(()=>Object.values(Tt).map(b=>b.section)),ht=Ml({general:()=>({display:"Energy",glowColor(){return ht.activeTab.value===this.tab?"white":""},tab:Pt,energyTabCollapsed:wn}),mining:()=>({display:"Mine",glowColor(){return ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(i.value).length>0,tab:_n,miningTabCollapsed:Nn}),resources:()=>({display:"Mine Rates",glowColor(){return ht.activeTab.value===this.tab?"white":""},visibility:()=>X.value!=null,tab:Le,resourcesCollapsed:sn}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return ht.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(Tt).some(b=>u.neq(b.computedModifier.value,1)),tab:Ft,resourceGainCollapsed:on})}),bt=R(!1),Ln=ie(()=>m(pt,{modelValue:bt.value,"onUpdate:modelValue":b=>bt.value=b},{header:()=>m("h2",null,[A("Modifiers")]),body:()=>Ue(ht)}));this.on("preUpdate",b=>{if(Object.keys(l).forEach(d=>{l[d]-=b,l[d]<=0&&delete l[d]}),Object.keys(o).forEach(d=>{o[d]-=b,o[d]<=0&&delete o[d]}),j(oe.value)){const d=u.add(oe.value.state.progress,u.times(Et.value,b)),M=d.floor();oe.value.state={...oe.value.state,progress:u.sub(d,M)};const T=M.div(Ee.value).floor();T.gt(0)&&Nt.forEach(ee=>{pe(ee,u.times(new u(ot[ee].computedModifier.value).toNumber(),T).times(Ht.value)),l[ee]=.3});const V=u.sub(M,T).toNumber();for(let ee=0;ee0){let T=u.add(d,b);const V=u.div(d,h.value).floor();T=u.sub(T,u.times(V,h.value)),Pe.value.state={...Pe.value.state,progress:T},u.gt(V,0)&&M.forEach(ee=>{pe(ee,V),o[ee]=.3})}}e.value=u.add(e.value,u.times(Se.value,b)),u.lt(e.value,0)&&(e.value=0,oe.value.state={...oe.value.state,powered:!1},Ci.warning(m("div",null,[m("h3",null,[A("Ran out of energy!")]),m("div",null,[A("All machines have been turned off.")])])))});const we=I(()=>{var b,d;return F.selectedAction.value===F.types.brokenFactory.actions[0]?-100:F.selectedAction.value===F.types.factory.actions[1]?u.neg(Te[F.selectedNode.value.state].cost):((b=F.selectedAction.value)==null?void 0:b.id)==="moreConnections"?u.neg(F.selectedAction.value.formula.evaluate(((d=F.selectedNode.value)==null?void 0:d.state).maxConnections)):0}),_e=Pn(g.variable(0).add(e),()=>u.neq(we.value,0),we),lt=I(()=>{var b;return F.selectedAction.value===y?((b=F.selectedNode.value)==null?void 0:b.state).powered?u.eq(c.value,1)?10:u.pow(100,c.value).div(10).times(.99):u.neg(f.value):0}),Yt=Pn(g.variable(0).add(Se),()=>u.neq(lt.value,0),lt),Cn=I(()=>F.types.portal.nodes.value.filter(b=>j(b)));return Ke(Cn,b=>{ft(()=>{H.tabs=["main",...b.map(d=>d.state.id)]})}),{name:"World",board:F,energy:e,modifierTabs:ht,mineLootTable:Ze,tools:Te,passives:ki,resourceNodes:n,toolNodes:i,grantResource:pe,display:ie(()=>m(se,null,[m(Tn,{class:"nav-container"},{default:()=>[m("span",{class:"nav-segment"},[m("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[Ue(_e)])," ",A("energy")]),m("span",{class:"nav-segment"},[A("("),m("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[u.gt(Se.value,0)?"+":"",Ue(Yt)]),A("/s)")]),u.gt(c.value,0)?m("span",{class:"nav-segment"},[m("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[Xe(c.value)])," ",A("machines powered")]):null,m("span",{class:"nav-segment"},[m("button",{class:"button",style:"display: inline",onClick:()=>bt.value=!0},[A("open modifiers")])]),H.devSpeed===0?m("span",{class:"nav-segment"},[A("Game Paused")]):H.devSpeed!=null&&H.devSpeed!==1?m("span",{class:"nav-segment"},[A("Dev Speed: "),Rt(H.devSpeed),A("x")]):null]}),Ue(F),Ue(Ln)]))}}),Ec=e=>{var i,r,s,l;const t=[Jt];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const o=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(Ji(`portal-${n}`,(s=o.tier)!=null?s:"dirt",(l=o.seed)!=null?l:Math.floor(Math.random()*4294967296))),n++}return t},Xi=I(()=>!1);function Tc(e,t){}var Pc=Object.freeze(Object.defineProperty({__proto__:null,mineLootTable:Ze,resourceNames:Nt,main:Jt,getInitialLayers:Ec,hasWon:Xi,fixOldSave:Tc},Symbol.toStringTag,{value:"Module"}));const bn=e=>(zt("data-v-4a50ce42"),e=e(),Gt(),e),Fc={class:"game-over-modal-header"},Dc=["src","alt"],Oc={class:"game-over-modal-title"},Ac=bn(()=>w("h2",null,"Congratulations!",-1)),Vc={key:0},qc=bn(()=>w("br",null,null,-1)),Lc=bn(()=>w("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Rc=bn(()=>w("br",null,null,-1)),Bc=["href"],jc=bn(()=>w("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Uc=Z({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:s,versionTitle:l}=ce,o=I(()=>Dn(H.timePlayed)),c=I(()=>Xi.value&&!H.keepGoing),f=$t(H,"autosave");function h(){H.keepGoing=!0}function p(){Vt(Xt())}return(y,N)=>(k(),Q(pt,{"model-value":a(c)},{header:U(()=>[w("div",Fc,[a(n)?(k(),$("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,Dc)):B("",!0),w("div",Oc,[Ac,w("h4",null,"You've beaten "+te(a(t))+" v"+te(a(s))+": "+te(a(l)),1)])])]),body:U(({shown:_})=>[_?(k(),$("div",Vc,[w("div",null,"It took you "+te(a(o))+" to beat the game.",1),qc,Lc,Rc,w("div",null,[w("a",{href:a(r),class:"game-over-modal-discord-link"},[jc,A(" "+te(a(i)),1)],8,Bc)]),m(ct,{title:"Autosave",modelValue:a(f),"onUpdate:modelValue":N[0]||(N[0]=S=>Ce(f)?f.value=S:null)},null,8,["modelValue"])])):B("",!0)]),footer:U(()=>[w("div",{class:"game-over-footer"},[w("button",{onClick:h,class:"button"},"Keep Going"),w("button",{onClick:p,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var zc=fe(Uc,[["__scopeId","data-v-4a50ce42"]]);const qn=e=>(zt("data-v-2776d67d"),e=e(),Gt(),e),Gc=qn(()=>w("div",{class:"nan-modal-header"},[w("h2",null,"NaN value detected!")],-1)),Wc={key:0},Hc=qn(()=>w("br",null,null,-1)),Zc=["href"],Yc=qn(()=>w("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Kc=qn(()=>w("br",null,null,-1)),Jc={class:"nan-footer"},Xc=Z({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ce,i=R(!0),r=R(!0),s=$t(Me,"hasNaN"),l=R(null);Ke(s,y=>{y?(i.value=H.autosave,r.value=H.devSpeed===0):(H.autosave=i.value,H.devSpeed=r.value?0:null)});const o=I(()=>{var y;return(y=Me.NaNPath)==null?void 0:y.join(".")}),c=I(()=>Me.NaNPersistent!=null?Me.NaNPersistent.value:null);function f(){Me.NaNPersistent!=null&&(Me.NaNPersistent.value=new u(0),Me.hasNaN=!1)}function h(){Me.NaNPersistent&&(Me.NaNPersistent.value=new u(1),Me.hasNaN=!1)}function p(){Me.NaNPersistent&&(Me.NaNPersistent.value=new u(NaN),Me.hasNaN=!1)}return(y,N)=>(k(),$(se,null,[m(pt,gt({modelValue:a(s),"onUpdate:modelValue":N[4]||(N[4]=_=>Ce(s)?s.value=_:null)},y.$attrs),{header:U(()=>[Gc]),body:U(()=>[w("div",null,[A(' Attempted to assign "'+te(a(o))+'" to NaN',1),a(c)?(k(),$("span",Wc,te(" ")+"(previously "+te(a(Rt)(a(c)))+")",1)):B("",!0),A(". Auto-saving has been "+te(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Hc,w("div",null,[w("a",{href:a(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Yc,A(" "+te(a(t)||"The Paper Pilot Community"),1)],8,Zc)]),Kc,m(ct,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=_=>i.value=_)},null,8,["modelValue"]),a(ce).enablePausing?(k(),Q(ct,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":N[1]||(N[1]=_=>r.value=_)},null,8,["modelValue"])):B("",!0)]),footer:U(()=>[w("div",Jc,[w("button",{onClick:N[2]||(N[2]=_=>{var S;return(S=l.value)==null?void 0:S.open()}),class:"button"},"Open Saves Manager"),w("button",{onClick:f,class:"button"},"Set to 0"),w("button",{onClick:h,class:"button"},"Set to 1"),a(c)&&a(u).neq(a(c),0)&&a(u).neq(a(c),1)?(k(),$("button",{key:0,onClick:N[3]||(N[3]=_=>s.value=!1),class:"button"}," Set to previous ")):B("",!0),w("button",{onClick:p,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),m(zi,{ref_key:"savesManager",ref:l},null,512)],64))}});var Qc=fe(Xc,[["__scopeId","data-v-2776d67d"]]);const ed={key:0,class:"tpsDisplay"},td={key:0,class:"low"},nd=Z({__name:"TPS",setup(e){const t=I(()=>u.div(Me.lastTenTicks.length,Me.lastTenTicks.reduce((s,l)=>s+l,0))),n=R([]);Ye(()=>{n.value.push(Math.round(t.value.toNumber())),n.value.length>10&&(n.value=n.value.slice(1))});const i=I(()=>n.value.reduce((s,l)=>u.max(s,l),0)),r=I(()=>u.sub(t.value,i.value).gt(1));return(s,l)=>a(t).isNan()?B("",!0):(k(),$("div",ed,[A(" TPS: "+te(a(Xe)(a(t)))+" ",1),m(en,{name:"fade"},{default:U(()=>[a(r)?(k(),$("span",td,te(a(Xe)(a(i))),1)):B("",!0)]),_:1})]))}});var id=fe(nd,[["__scopeId","data-v-46a3ed5b"]]);var rd=Z({__name:"App",setup(e){const t=ce.useHeader,n=I(()=>Qe[re.theme].variables),i=$t(re,"showTPS"),r=I(()=>ue(ie(()=>m(se,null,[Na.map(Ue)]))));return(s,l)=>(k(),$(se,null,[w("div",{id:"modal-root",style:qe(a(n))},null,4),w("div",{class:ge(["app",{useHeader:a(t)}]),style:qe(a(n))},[a(t)?(k(),Q(Gi,{key:0})):B("",!0),m(Lo),a(a(i))?(k(),Q(id,{key:1})):B("",!0),m(zc),m(Qc),(k(),Q(Oe(a(r))))],6)],64))}});var ad=fe(rd,[["__scopeId","data-v-41d15e5e"]]);function sd(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:l}=e;let o,c,f,h;const p=async(N=!0)=>{await f,N&&(o==null||o.addEventListener("controlling",_=>{_.isUpdate&&window.location.reload()})),await(h==null?void 0:h())};async function y(){if("serviceWorker"in navigator){const{Workbox:N,messageSW:_}=await gn(()=>import("./workbox-window.4a8794bb.js"),[]);h=async()=>{c&&c.waiting&&await _(c.waiting,{type:"SKIP_WAITING"})},o=new N("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",S=>{S.isUpdate||i==null||i()});{const S=()=>{n==null||n()};o.addEventListener("waiting",S),o.addEventListener("externalwaiting",S)}o.register({immediate:t}).then(S=>{c=S,s?s("./sw.js",S):r==null||r(S)}).catch(S=>{l==null||l(S)})}}return f=y(),p}function od(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:s,onRegisterError:l}=e,o=R(!1),c=R(!1);return{updateServiceWorker:sd({immediate:t,onNeedRefresh(){o.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:s,onRegisterError:l}),offlineReady:c,needRefresh:o}}document.title=ce.title;window.projInfo=ce;if(ce.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 va();const{globalBus:e}=await gn(()=>Promise.resolve().then(function(){return pa}),void 0),{startGameLoop:t}=await gn(()=>import("./gameLoop.e85fc477.js"),["assets/gameLoop.e85fc477.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","assets/unique-names-generator.5494b30b.js"]),n=window.vue=or(ad);e.emit("setupVue",n),n.mount("#app"),ft(()=>{const i=Zn(),{updateServiceWorker:r}=od({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(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{u as D,gn as _,Me as a,ce as b,Pc as c,Ae as g,ha as l,H as p,re as s}; diff --git a/assets/index.e0ba227d.css b/assets/index.69d9c929.css similarity index 90% rename from assets/index.e0ba227d.css rename to assets/index.69d9c929.css index 7771ed0..6bdc6cf 100644 --- a/assets/index.e0ba227d.css +++ b/assets/index.69d9c929.css @@ -1 +1 @@ -.table{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;max-width:100%;margin:0 auto}.table+.table{margin-top:10px}.row{display:flex;flex-flow:row wrap;justify-content:center;align-items:stretch;max-width:100%;margin:0 10px}.row>:not(.feature){margin:0;display:flex}.col{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;height:100%;margin:10px 0}.row.mergeAdjacent>.feature:not(.dontMerge),.row.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin-left:0;margin-right:0;border-radius:0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child,.row.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:var(--border-radius) 0 0 var(--border-radius)}.row.mergeAdjacent>.feature:not(.dontMerge):last-child,.row.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0 var(--border-radius) var(--border-radius) 0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child:last-child,.row.mergeAdjacent>.tooltip-container:first-child:last-child>.feature:not(.dontMerge){border-radius:var(--border-radius)}.row-grid.mergeAdjacent>.feature:not(.dontMerge),.row-grid.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin:0;border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):last-child,.row-grid.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):first-child,.row-grid.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):first-child{border-radius:0 0 0 var(--border-radius)}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):last-child{border-radius:0 var(--border-radius) 0 0}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):first-child{border-radius:var(--border-radius) 0 0 0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) 0}.col.mergeAdjacent .feature:not(.dontMerge){margin-top:0;margin-bottom:0;border-radius:0}.col.mergeAdjacent .feature:not(.dontMerge):first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.col.mergeAdjacent .feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.col.mergeAdjacent .feature:not(.dontMerge):first-child:last-child{border-radius:var(--border-radius)}.resize-listener[data-v-2b1dc1bc]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}.modal-mask{position:fixed;z-index:9998;top:0;left:0;bottom:0;right:0;background-color:#00000080;transition:opacity .3s ease}.modal-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.modal-container{width:640px;max-width:95vw;max-height:95vh;background-color:var(--background);padding:20px;border-radius:5px;transition:all .3s ease;text-align:left;border:var(--modal-border);box-sizing:border-box;display:flex;flex-direction:column}.modal-header{width:100%}.modal-body{margin:20px 0;width:100%;overflow-y:auto;overflow-x:hidden}.modal-footer{width:100%}.modal-default-footer{display:flex}.modal-default-flex-grow{flex-grow:1}.modal-enter-from,.modal-leave-active{opacity:0}.modal-enter-from .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.layer-container[data-v-72dd78b1]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:20px;padding-bottom:20px;min-height:100%;flex-grow:1;text-align:center;position:relative}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-72dd78b1]{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;padding:55px 0 0;margin:0;cursor:pointer;font-size:40px;color:var(--foreground);border:none;background-color:transparent}.layer-tab.minimized>*[data-v-72dd78b1]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-72dd78b1]{padding-bottom:0}.modal-body .layer-tab[data-v-72dd78b1]:not(.hasSubtabs){padding-top:0}.minimize[data-v-72dd78b1]{position:sticky;top:6px;right:9px;z-index:7;line-height:30px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:40px;cursor:pointer;margin-top:-44px;margin-right:-30px}.minimized+.minimize[data-v-72dd78b1]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-72dd78b1]{position:sticky;top:10px;left:10px;line-height:30px;margin-top:-50px;margin-left:-35px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:30px;cursor:pointer;z-index:7}.goBack[data-v-72dd78b1]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}.layer-tab.minimized>*>.desc{color:var(--accent1);font-size:30px}details[data-v-4b4bda40]{margin:10px 0;padding-left:18px}summary[data-v-4b4bda40]{cursor:pointer;margin-bottom:10px;margin-left:-18px}ul[data-v-4b4bda40]{margin:var(--feature-margin) 0;background:var(--raised-background);border:2px solid rgba(0,0,0,.125);padding:5px 5px 5px 15px;list-style:inside}li[data-v-4b4bda40]{margin:8px 0}li[data-v-4b4bda40]:before{padding:2px 8px;margin-right:8px;border-radius:var(--border-radius)}.feature[data-v-4b4bda40]:before{content:"Feature";background:var(--accent1)}.fix[data-v-4b4bda40]:before{content:"Fix";background:var(--accent2)}.balancing[data-v-4b4bda40]:before{content:"Balancing";background:var(--accent3)}.breaking[data-v-4b4bda40]:before{content:"Breaking";background:var(--danger)}.tooltip-container[data-v-6102fa3a]{position:relative;--xoffset: 0px;--yoffset: 0px;text-shadow:none!important}.tooltip[data-v-6102fa3a],.tooltip[data-v-6102fa3a]:after{pointer-events:none;position:absolute}.tooltip[data-v-6102fa3a]{text-align:center;width:150px;font-size:14px;line-height:1.2;bottom:calc(100% + var(--yoffset));left:calc(50% + var(--xoffset));margin-bottom:5px;transform:translate(-50%);padding:7px;border-radius:3px;background-color:var(--tooltip-background);color:var(--points);z-index:100!important;word-break:break-word}.tooltip[data-v-6102fa3a] hr{margin:var(--feature-margin) 0}.shown[data-v-6102fa3a]{z-index:10}.fade-enter-from[data-v-6102fa3a],.fade-leave-to[data-v-6102fa3a]{opacity:0}.tooltip[data-v-6102fa3a]:after{content:" ";position:absolute;top:100%;bottom:100%;left:calc(50% - var(--xoffset));width:0;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}.tooltip.left[data-v-6102fa3a],.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top){bottom:calc(50% + var(--yoffset));left:unset;right:calc(100% + var(--xoffset));margin-bottom:unset;margin-right:5px;transform:translateY(50%)}.tooltip.left[data-v-6102fa3a]:after,.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top):after{top:calc(50% + var(--yoffset));bottom:unset;left:100%;right:100%;margin-left:unset;margin-top:-5px;border-color:transparent transparent transparent var(--tooltip-background)}.tooltip.right[data-v-6102fa3a]{bottom:calc(50% + var(--yoffset));left:calc(100% + var(--xoffset));margin-bottom:unset;margin-left:5px;transform:translateY(50%)}.tooltip.right[data-v-6102fa3a]:after{top:calc(50% + var(--yoffset));left:0;right:100%;margin-left:-10px;margin-top:-5px;border-color:transparent var(--tooltip-background) transparent transparent}.tooltip.bottom[data-v-6102fa3a]{top:calc(100% + var(--yoffset));bottom:unset;left:calc(50% + var(--xoffset));margin-bottom:unset;margin-top:5px;transform:translate(-50%)}.tooltip.bottom[data-v-6102fa3a]:after{top:0;margin-top:-10px;border-color:transparent transparent var(--tooltip-background) transparent}.pinned[data-v-6102fa3a]{position:absolute;right:-5px;top:-5px;transform:rotate(45deg)}.info-modal-header[data-v-4f97aa40]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.info-modal-header *[data-v-4f97aa40]{margin:0}.info-modal-logo[data-v-4f97aa40]{height:4em;width:4em}.info-modal-title[data-v-4f97aa40]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.info-modal-discord-link[data-v-4f97aa40]{display:flex;align-items:center}.info-modal-discord[data-v-4f97aa40]{margin:0 4px 0 0}.field{display:flex;position:relative;min-height:2em;margin:10px 0;user-select:none;justify-content:space-between;align-items:center}.field>*{margin:0}.vue-select{width:50%;border-radius:var(--border-radius)}.field-buttons .vue-select{width:unset}.vue-select,.vue-dropdown{border-color:var(--outline)}.vue-dropdown{background:var(--raised-background)}.vue-dropdown-item{color:var(--foreground)}.vue-dropdown-item,.vue-dropdown-item *{transition-duration:0s}.vue-dropdown-item.highlighted{background-color:var(--highlighted)}.vue-dropdown-item.selected,.vue-dropdown-item.highlighted.selected{background-color:var(--bought)}.vue-input input{font-size:inherit}.vue-input input::placeholder{color:var(--link)}.field[data-v-11046116]{cursor:pointer}input[data-v-11046116]{appearance:none;pointer-events:none}span[data-v-11046116]{width:100%;padding-right:41px;position:relative}input+span[data-v-11046116]:before{content:"";position:absolute;top:calc(50% - 7px);right:0px;border-radius:7px;width:36px;height:14px;background-color:var(--outline);opacity:.38;vertical-align:top;transition:background-color .2s,opacity .2s}input+span[data-v-11046116]:after{content:"";position:absolute;top:calc(50% - 10px);right:16px;border-radius:50%;width:20px;height:20px;background-color:var(--locked);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:background-color .2s,transform .2s}input:checked+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked+span[data-v-11046116]:after{background-color:var(--link);transform:translate(16px)}input:active+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked:active+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:disabled+span[data-v-11046116]{color:#000;opacity:.38;cursor:default}input:disabled+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:checked:disabled+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}.feedback[data-v-01a1b95c]{position:relative}.feedback[data-v-01a1b95c]:after{position:absolute;left:calc(100% + 5px);top:50%;transform:translateY(-50%);content:"\2714";opacity:0;pointer-events:none;box-shadow:inset 0 0 0 35px #6f94b600;text-shadow:none}.feedback.left[data-v-01a1b95c]:after{left:unset;right:calc(100% + 5px)}.feedback.activated[data-v-01a1b95c]:after{animation:feedback-01a1b95c .5s ease-out forwards}@keyframes feedback-01a1b95c{0%{opacity:1;transform:scale3d(.4,.4,1),translateY(-50%)}80%{opacity:.1}to{opacity:0;transform:scale3d(1.2,1.2,1),translateY(-50%)}}.option-tabs{border-bottom:2px solid var(--outline);margin-top:10px;margin-bottom:-10px}.option-tabs button{background-color:transparent;color:var(--foreground);margin-bottom:-2px;font-size:14px;cursor:pointer;padding:5px 20px;border:none;border-bottom:2px solid var(--foreground)}.option-tabs button:not(.selected){border-bottom-color:transparent}.option-title .tooltip-container{display:inline;margin-left:5px}.option-title desc{display:block;opacity:.6;font-size:small;width:300px;margin-left:0}.save-button{text-align:right}form[data-v-90bd4994]{margin:0;width:100%}.field>*[data-v-90bd4994]{margin:0}input[data-v-90bd4994]{width:50%;outline:none;border:solid 1px var(--outline);background-color:unset;border-radius:var(--border-radius)}.fullWidth[data-v-90bd4994]{width:100%}.container[data-v-2f8ef34c]{display:flex;align-items:center;background:var(--raised-background);box-shadow:var(--raised-background) 0 2px 3px 5px}.container.confirming button[data-v-2f8ef34c]{font-size:1em}.container>*[data-v-2f8ef34c]{margin:0 4px}.danger,.button.danger{position:relative;border:solid 2px var(--danger);border-right-width:16px}.danger:after{position:absolute;content:"!";color:#fff;right:-13px}.save[data-v-32313015]{position:relative;border:solid 4px var(--outline);padding:4px;background:var(--raised-background);margin:var(--feature-margin);display:flex;align-items:center;min-height:30px}.save.active[data-v-32313015]{border-color:var(--bought)}.open[data-v-32313015]{display:inline;margin:0;padding-left:0}.handle[data-v-32313015]{flex-grow:0;margin-right:8px;margin-left:0;cursor:pointer}.details[data-v-32313015]{margin:0 80px 0 0;flex-grow:1}.error[data-v-32313015]{font-size:.8em;color:var(--danger)}.save-version[data-v-32313015]{margin-left:4px;font-size:.7em;opacity:.7}.actions[data-v-32313015]{position:absolute;top:0;bottom:0;right:4px;display:flex;padding:4px;z-index:1}.editname[data-v-32313015]{margin:0}.save button{transition-duration:0s}.save .actions button{display:flex;font-size:1.2em}.save .actions button .material-icons{font-size:unset}.save .button.danger{display:flex;align-items:center;padding:4px}.save .field,.field form[data-v-2a4275be],.field .field-title[data-v-2a4275be],.field .field-buttons[data-v-2a4275be]{margin:0}.field-buttons[data-v-2a4275be]{display:flex}.field-buttons .field[data-v-2a4275be]{margin:0 0 0 8px}.modal-footer[data-v-2a4275be]{margin-top:-20px}.footer[data-v-2a4275be]{display:flex;margin-top:20px}.importingFailed input{color:red}.field-buttons .v-select{width:220px}.presets .vue-select[aria-expanded=true] vue-dropdown{visibility:hidden}.nav[data-v-318a1c31]{background-color:var(--raised-background);display:flex;left:0;right:0;top:0;height:46px;width:100%;border-bottom:4px solid var(--outline)}.nav>*[data-v-318a1c31]{height:46px;width:46px;display:flex;cursor:pointer;flex-shrink:0}.nav>.banner[data-v-318a1c31]{height:100%;width:unset}.overlay-nav[data-v-318a1c31]{position:fixed;top:10px;left:10px;display:flex;flex-direction:column;z-index:2}.overlay-nav>*[data-v-318a1c31]{height:50px;width:50px;display:flex;cursor:pointer;margin:0;align-items:center;justify-content:center}.title[data-v-318a1c31]{font-size:36px;text-align:left;margin-left:12px;cursor:unset}.nav>.title[data-v-318a1c31]{width:unset;flex-shrink:1;overflow:hidden;white-space:nowrap}.nav .saves[data-v-318a1c31],.nav .info[data-v-318a1c31]{display:flex}.tooltip-container[data-v-318a1c31]{width:100%;height:100%;display:flex}.overlay-nav .discord[data-v-318a1c31]{position:relative}.discord img[data-v-318a1c31]{width:100%;height:100%}.discord-links[data-v-318a1c31]{position:fixed;top:45px;padding:20px;right:-280px;width:200px;transition:right .25s ease;background:var(--raised-background);z-index:10}.overlay-nav .discord-links[data-v-318a1c31]{position:absolute;left:-280px;right:unset;transition:left .25s ease}.overlay-nav .discord:hover .discord-links[data-v-318a1c31]{left:-10px}.discord-links li[data-v-318a1c31]{margin-bottom:4px}.discord-links li[data-v-318a1c31]:first-child{font-size:1.2em}*:not(.overlay-nav) .discord:hover .discord-links[data-v-318a1c31]{right:0}.material-icons[data-v-318a1c31]{font-size:36px}.material-icons[data-v-318a1c31]:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--foreground)}.nav .version-container[data-v-318a1c31]{display:flex;height:25px;margin-bottom:0;margin-left:10px}.overlay-nav .version-container[data-v-318a1c31]{width:unset;height:25px}.version[data-v-318a1c31]{color:var(--points)}.version:hover span[data-v-318a1c31]{text-shadow:5px 0 10px var(--points),-3px 0 12px var(--points)}.nav>div>a[data-v-318a1c31],.overlay-nav>div>a[data-v-318a1c31]{color:var(--foreground);text-shadow:none}.tabs-container[data-v-dcd207b4]{width:100vw;flex-grow:1;overflow-x:auto;overflow-y:hidden;display:flex}.tabs-container[data-v-dcd207b4]:not(.useHeader){width:calc(100vw - 50px);margin-left:50px}.tab[data-v-dcd207b4]{position:relative;height:100%;flex-grow:1;transition-duration:0s;overflow-y:auto;overflow-x:hidden}.inner-tab[data-v-dcd207b4]{padding:50px 10px;min-height:calc(100% - 100px);display:flex;flex-direction:column;margin:0;flex-grow:1}.tab+.tab>.inner-tab[data-v-dcd207b4]{border-left:solid 4px var(--outline)}.tab hr{height:4px;border:none;background:var(--outline);margin:var(--feature-margin) 0}.tab .modal-body hr{margin:7px 0}.sticky[data-v-cccac690]{position:sticky;background:var(--background);width:calc(100% - 2px);z-index:3}.link[data-v-57c4970a]{transition-duration:0s}.link.pulsing[data-v-57c4970a]{animation:pulsing-57c4970a 2s ease-in infinite}@keyframes pulsing-57c4970a{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.action:not(.boardnode):hover circle[data-v-9efb2a56],.action:not(.boardnode).selected circle[data-v-9efb2a56]{r:25}.action:not(.boardnode):hover text[data-v-9efb2a56],.action:not(.boardnode).selected text[data-v-9efb2a56]{font-size:187.5%}.action:not(.boardnode) text[data-v-9efb2a56]{text-anchor:middle;dominant-baseline:central}.actions-enter-from .action,.actions-leave-to .action{transform:translate(0)}.boardnode[data-v-4654be02]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-4654be02]{fill:var(--highlighted)}.boardnode.running .body[data-v-4654be02]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-4654be02]{fill:var(--locked)}.node-title[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:200%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.node-subtitle[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:150%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.progress[data-v-4654be02]{transition-duration:.05s}.progressRing[data-v-4654be02]{transform:rotate(-90deg)}.fade-enter-from[data-v-4654be02],.fade-leave-to[data-v-4654be02]{opacity:0}.pulsing[data-v-4654be02]{animation:pulsing-4654be02 2s ease-in infinite}@keyframes pulsing-4654be02{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.grow-enter-from .node-container,.grow-leave-to .node-container{transform:scale(0)}.vue-pan-zoom-scene{width:100%;height:100%;cursor:grab}.vue-pan-zoom-scene:active{cursor:grabbing}.g1{transition-duration:0s}.link-enter-from,.link-leave-to{opacity:0}.tabButton[data-v-21427abb]{background-color:transparent;color:var(--foreground);font-size:20px;cursor:pointer;padding:5px 20px;margin:5px;border-radius:5px;border:2px solid;flex-shrink:0;border-color:var(--layer-color)}.tabButton[data-v-21427abb]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}:not(.floating)>.tabButton[data-v-21427abb]{height:50px;margin:0;border-left:none;border-right:none;border-top:none;border-bottom-width:4px;border-radius:0;transform:unset}:not(.floating) .tabButton[data-v-21427abb]:not(.active){border-bottom-color:transparent}.tabButton>*[data-v-21427abb]{pointer-events:none}.tab-family-container[data-v-58dbf83a]{margin:calc(50px + var(--feature-margin)) 20px var(--feature-margin) 20px;position:relative;border:solid 4px;border-color:var(--outline)}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child{margin:-4px -11px var(--feature-margin) -11px}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child:nth-last-child(3){border-bottom-style:none;border-left-style:none;border-right-style:none;height:calc(100% + 50px)}.modal-body>.tab-family-container[data-v-58dbf83a]:first-child{margin:calc(10px + var(--feature-margin)) 10px 0 10px;border:none}.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:20px}.modal-body>.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:50px}.tab-family-container[data-v-f18896fc][data-v-58dbf83a]>:last-child{margin-bottom:20px}.tab-buttons-container[data-v-58dbf83a]{z-index:4}.tab-buttons-container[data-v-58dbf83a]:not(.floating){border-bottom:solid 4px;border-color:inherit}:not(.layer-tab):not(.modal-body)>.tab-family-container>.tab-buttons-container[data-v-58dbf83a]:not(.floating){width:calc(100% + 6px);margin-left:-3px}.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{text-align:left;margin-bottom:-4px}.tab-buttons-container.floating .tab-buttons[data-v-58dbf83a]{justify-content:center;margin-top:-25px}.tab-buttons[data-v-58dbf83a]{margin-bottom:24px;display:flex;flex-flow:wrap;z-index:4}.layer-tab>.tab-family-container:first-child:nth-last-child(3)>.tab-buttons-container>.tab-buttons[data-v-58dbf83a]{padding-right:60px}.tab-buttons[data-v-58dbf83a]:not(.floating){text-align:left;border-bottom:inherit;border-width:4px;box-sizing:border-box;height:50px}.modal-body .tab-buttons[data-v-58dbf83a]{width:100%;margin-left:0;margin-right:0;padding-left:0}.showGoBack>.tab-family-container:first-child>.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{padding-left:70px}:not(.showGoBack)>.tab-family-container>.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{padding-left:0}.minimizable>.tab-buttons-container[data-v-58dbf83a]:not(.floating):first-child{padding-right:50px}.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{margin-top:-50px}.tab-buttons-container+*[data-v-58dbf83a]{margin-top:20px}.modifier-container{display:flex;padding:1px 8px}.modifier-container:nth-child(2n){background:var(--raised-background)}.modifier-amount{flex-shrink:0;text-align:right}:not(:first-of-type,:last-of-type)>.modifier-amount:after{content:var(--unit);opacity:0}.modifier-description{flex-grow:1}.collapsible-container[data-v-a72c16aa]{width:calc(100% - 10px)}.collapsible-toggle[data-v-a72c16aa]{max-width:unset;width:calc(100% + 0px);margin:0 0 0 -5px;background:var(--raised-background);padding:var(--feature-margin);color:var(--foreground);cursor:pointer;transition-duration:0s}.collapsible-toggle[data-v-a72c16aa]:last-child{margin-left:unset}[data-v-a72c16aa] .collapsible-toggle+.table{max-width:unset;width:calc(100% + 10px);margin-left:-5px}[data-v-a72c16aa] .col{margin-top:0;margin-bottom:0;width:100%}.mergeAdjacent .collapsible-toggle[data-v-a72c16aa]{border:0;border-top-left-radius:0!important;border-top-right-radius:0!important}[data-v-a72c16aa] .mergeAdjacent .feature:not(.dontMerge):first-child{border-top-left-radius:0!important;border-top-right-radius:0!important}.feature:not(li),.feature:not(li) button{position:relative;padding:5px;border-radius:var(--border-radius);border:2px solid rgba(0,0,0,.125);margin:var(--feature-margin);box-sizing:border-box;color:var(--feature-foreground);z-index:0;transition:all .5s,z-index 0s .5s}.can,.can button{background-color:var(--layer-color);cursor:pointer}.can:hover,.can:hover button{transform:scale(1.15);box-shadow:0 0 20px var(--points);z-index:1;transition:all .5s,z-index 0s}.locked,.locked button{background-color:var(--locked);cursor:not-allowed}.bought,.bought button{background-color:var(--bought);cursor:default}.mark[data-v-2207999f]{position:absolute;left:-25px;top:-10px;width:30px;height:30px;z-index:1;pointer-events:none;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid transparent;border-left:.3em solid transparent;font-size:10px}.star[data-v-2207999f]{left:-10px;width:0;height:0;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid #ffcc00;border-left:.3em solid transparent;font-size:10px;pointer-events:none}.star[data-v-2207999f]:before,.star[data-v-2207999f]:after{content:"";width:0;height:0;position:absolute;top:.6em;left:-1em;border-right:1em solid transparent;border-bottom:.7em solid #ffcc00;border-left:1em solid transparent;transform:rotate(-35deg)}.star[data-v-2207999f]:after{transform:rotate(35deg)}.node[data-v-a48cb382]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.clickable[data-v-211328c0]{min-height:120px;width:120px;font-size:10px}.clickable.small[data-v-211328c0]{min-height:unset}.clickable>*[data-v-211328c0]{pointer-events:none}.resize-listener[data-v-063f6d6b]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}svg[data-v-063f6d6b]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-10;pointer-events:none}.left-side-nodes[data-v-39ca96d0]{position:absolute;left:15px;top:65px}.side-nodes[data-v-39ca96d0]{position:absolute;right:15px;top:65px}.left-side-nodes[data-v-39ca96d0] .treeNode,.side-nodes[data-v-39ca96d0] .treeNode{margin:20px auto}.small[data-v-39ca96d0] .treeNode{height:60px;width:60px}.small[data-v-39ca96d0] .treeNode>*:first-child{font-size:30px}.treeNode[data-v-727230a6]{height:100px;width:100px;border-radius:50%;padding:0;margin:0 10px}.treeNode>*[data-v-727230a6]:first-child{width:100%;height:100%;border:2px solid rgba(0,0,0,.125);border-radius:inherit;font-size:40px;color:#00000080;text-shadow:2px 2px 4px rgba(0,0,0,.25);box-shadow:-4px -4px 4px #00000040 inset,0 0 20px var(--background);display:flex}.treeNode>*:first-child>*[data-v-727230a6]{pointer-events:none}.modifier-toggle{padding-right:10px;transform:translateY(-1px);display:inline-block}.modifier-toggle.collapsed{transform:translate(-5px,-5px) rotate(-90deg)}.nav-container{margin-top:-50px;text-align:left;border-bottom:solid 1px var(--outline);margin-left:-10px;margin-right:-10px;padding:10px;width:100%}.nav-segment{border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.achievement.final{border-color:var(--accent3)}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.achievement[data-v-5673325a]{height:90px;width:90px;font-size:10px;color:#fff;text-shadow:0 0 2px #000000}.achievement[data-v-5673325a]:not(.small){height:unset;width:calc(100% - 10px);min-width:120px;padding-left:5px;padding-right:5px;background-color:var(--locked);border-width:4px;border-radius:5px;color:#00000080;font-size:unset;text-shadow:unset}.achievement.done[data-v-5673325a]{background-color:var(--bought);cursor:default}.achievement[data-v-5673325a] .equal-spaced{display:flex;justify-content:center}.achievement[data-v-5673325a] .equal-spaced>*{margin:auto}.game-over-modal-header[data-v-4a50ce42]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.game-over-modal-header *[data-v-4a50ce42]{margin:0}.game-over-modal-logo[data-v-4a50ce42]{height:4em;width:4em}.game-over-modal-title[data-v-4a50ce42]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.game-over-footer[data-v-4a50ce42]{display:flex;justify-content:flex-end}.game-over-footer button[data-v-4a50ce42]{margin:0 10px}.game-over-modal-discord-link[data-v-4a50ce42]{display:flex;align-items:center}.game-over-modal-discord[data-v-4a50ce42]{margin:0 4px 0 0}.nan-modal-header[data-v-2776d67d]{padding:10px 0;margin-left:10px}.nan-footer[data-v-2776d67d]{display:flex;justify-content:flex-end}.nan-footer button[data-v-2776d67d]{margin:0 10px}.nan-modal-discord-link[data-v-2776d67d]{display:flex;align-items:center}.nan-modal-discord[data-v-2776d67d]{margin:0 4px 0 0}.tpsDisplay[data-v-46a3ed5b]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-46a3ed5b]{color:var(--danger)}.fade-leave-to[data-v-46a3ed5b]{opacity:0}:root{color-scheme:dark}*{transition-duration:.5s;font-family:Roboto Mono,monospace;font-weight:700;margin:auto;text-size-adjust:none}*:focus{outline:none}body{overflow:hidden;transition:none;text-align:center}html,body,#app{min-height:100%;height:100%}h1,h2,h3,b,input{display:inline}button{color:#000}a,.button,.link{display:block;color:var(--link);background:none;border:none;cursor:pointer;text-decoration:none}a:hover,.button:hover,.link:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--link)}.button:disabled{opacity:.5;cursor:not-allowed}.button:disabled:hover{text-shadow:none}ul{list-style-type:none}.Vue-Toastification__toast{margin:unset}.app[data-v-41d15e5e]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-41d15e5e]{position:absolute;min-height:100%;height:100%;color:var(--foreground)} +.table{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;max-width:100%;margin:0 auto}.table+.table{margin-top:10px}.row{display:flex;flex-flow:row wrap;justify-content:center;align-items:stretch;max-width:100%;margin:0 10px}.row>:not(.feature){margin:0;display:flex}.col{display:flex;flex-flow:column wrap;justify-content:center;align-items:center;height:100%;margin:10px 0}.row.mergeAdjacent>.feature:not(.dontMerge),.row.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin-left:0;margin-right:0;border-radius:0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child,.row.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:var(--border-radius) 0 0 var(--border-radius)}.row.mergeAdjacent>.feature:not(.dontMerge):last-child,.row.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0 var(--border-radius) var(--border-radius) 0}.row.mergeAdjacent>.feature:not(.dontMerge):first-child:last-child,.row.mergeAdjacent>.tooltip-container:first-child:last-child>.feature:not(.dontMerge){border-radius:var(--border-radius)}.row-grid.mergeAdjacent>.feature:not(.dontMerge),.row-grid.mergeAdjacent>.tooltip-container>.feature:not(.dontMerge){margin:0;border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):last-child,.row-grid.mergeAdjacent>.tooltip-container:last-child>.feature:not(.dontMerge){border-radius:0}.row-grid.mergeAdjacent>.feature:not(.dontMerge):first-child,.row-grid.mergeAdjacent>.tooltip-container:first-child>.feature:not(.dontMerge){border-radius:0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):first-child{border-radius:0 0 0 var(--border-radius)}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):last-child{border-radius:0 var(--border-radius) 0 0}.table-grid>.row-grid.mergeAdjacent:first-child>.feature:not(.dontMerge):first-child{border-radius:var(--border-radius) 0 0 0}.table-grid>.row-grid.mergeAdjacent:last-child>.feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) 0}.col.mergeAdjacent .feature:not(.dontMerge){margin-top:0;margin-bottom:0;border-radius:0}.col.mergeAdjacent .feature:not(.dontMerge):first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.col.mergeAdjacent .feature:not(.dontMerge):last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}.col.mergeAdjacent .feature:not(.dontMerge):first-child:last-child{border-radius:var(--border-radius)}.resize-listener[data-v-2b1dc1bc]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}.modal-mask{position:fixed;z-index:9998;top:0;left:0;bottom:0;right:0;background-color:#00000080;transition:opacity .3s ease}.modal-wrapper{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.modal-container{width:640px;max-width:95vw;max-height:95vh;background-color:var(--background);padding:20px;border-radius:5px;transition:all .3s ease;text-align:left;border:var(--modal-border);box-sizing:border-box;display:flex;flex-direction:column}.modal-header{width:100%}.modal-body{margin:20px 0;width:100%;overflow-y:auto;overflow-x:hidden}.modal-footer{width:100%}.modal-default-footer{display:flex}.modal-default-flex-grow{flex-grow:1}.modal-enter-from,.modal-leave-active{opacity:0}.modal-enter-from .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.layer-container[data-v-72dd78b1]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:20px;padding-bottom:20px;min-height:100%;flex-grow:1;text-align:center;position:relative}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-72dd78b1]{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;padding:55px 0 0;margin:0;cursor:pointer;font-size:40px;color:var(--foreground);border:none;background-color:transparent}.layer-tab.minimized>*[data-v-72dd78b1]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-72dd78b1]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-72dd78b1]{padding-bottom:0}.modal-body .layer-tab[data-v-72dd78b1]:not(.hasSubtabs){padding-top:0}.minimize[data-v-72dd78b1]{position:sticky;top:6px;right:9px;z-index:7;line-height:30px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:40px;cursor:pointer;margin-top:-44px;margin-right:-30px}.minimized+.minimize[data-v-72dd78b1]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-72dd78b1]{position:sticky;top:10px;left:10px;line-height:30px;margin-top:-50px;margin-left:-35px;border:none;background:var(--background);box-shadow:var(--background) 0 2px 3px 5px;border-radius:50%;color:var(--foreground);font-size:30px;cursor:pointer;z-index:7}.goBack[data-v-72dd78b1]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}.layer-tab.minimized>*>.desc{color:var(--accent1);font-size:30px}details[data-v-4b4bda40]{margin:10px 0;padding-left:18px}summary[data-v-4b4bda40]{cursor:pointer;margin-bottom:10px;margin-left:-18px}ul[data-v-4b4bda40]{margin:var(--feature-margin) 0;background:var(--raised-background);border:2px solid rgba(0,0,0,.125);padding:5px 5px 5px 15px;list-style:inside}li[data-v-4b4bda40]{margin:8px 0}li[data-v-4b4bda40]:before{padding:2px 8px;margin-right:8px;border-radius:var(--border-radius)}.feature[data-v-4b4bda40]:before{content:"Feature";background:var(--accent1)}.fix[data-v-4b4bda40]:before{content:"Fix";background:var(--accent2)}.balancing[data-v-4b4bda40]:before{content:"Balancing";background:var(--accent3)}.breaking[data-v-4b4bda40]:before{content:"Breaking";background:var(--danger)}.tooltip-container[data-v-6102fa3a]{position:relative;--xoffset: 0px;--yoffset: 0px;text-shadow:none!important}.tooltip[data-v-6102fa3a],.tooltip[data-v-6102fa3a]:after{pointer-events:none;position:absolute}.tooltip[data-v-6102fa3a]{text-align:center;width:150px;font-size:14px;line-height:1.2;bottom:calc(100% + var(--yoffset));left:calc(50% + var(--xoffset));margin-bottom:5px;transform:translate(-50%);padding:7px;border-radius:3px;background-color:var(--tooltip-background);color:var(--points);z-index:100!important;word-break:break-word}.tooltip[data-v-6102fa3a] hr{margin:var(--feature-margin) 0}.shown[data-v-6102fa3a]{z-index:10}.fade-enter-from[data-v-6102fa3a],.fade-leave-to[data-v-6102fa3a]{opacity:0}.tooltip[data-v-6102fa3a]:after{content:" ";position:absolute;top:100%;bottom:100%;left:calc(50% - var(--xoffset));width:0;margin-left:-5px;border-width:5px;border-style:solid;border-color:var(--tooltip-background) transparent transparent transparent}.tooltip.left[data-v-6102fa3a],.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top){bottom:calc(50% + var(--yoffset));left:unset;right:calc(100% + var(--xoffset));margin-bottom:unset;margin-right:5px;transform:translateY(50%)}.tooltip.left[data-v-6102fa3a]:after,.side-nodes .tooltip[data-v-6102fa3a]:not(.right):not(.bottom):not(.top):after{top:calc(50% + var(--yoffset));bottom:unset;left:100%;right:100%;margin-left:unset;margin-top:-5px;border-color:transparent transparent transparent var(--tooltip-background)}.tooltip.right[data-v-6102fa3a]{bottom:calc(50% + var(--yoffset));left:calc(100% + var(--xoffset));margin-bottom:unset;margin-left:5px;transform:translateY(50%)}.tooltip.right[data-v-6102fa3a]:after{top:calc(50% + var(--yoffset));left:0;right:100%;margin-left:-10px;margin-top:-5px;border-color:transparent var(--tooltip-background) transparent transparent}.tooltip.bottom[data-v-6102fa3a]{top:calc(100% + var(--yoffset));bottom:unset;left:calc(50% + var(--xoffset));margin-bottom:unset;margin-top:5px;transform:translate(-50%)}.tooltip.bottom[data-v-6102fa3a]:after{top:0;margin-top:-10px;border-color:transparent transparent var(--tooltip-background) transparent}.pinned[data-v-6102fa3a]{position:absolute;right:-5px;top:-5px;transform:rotate(45deg)}.info-modal-header[data-v-4f97aa40]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.info-modal-header *[data-v-4f97aa40]{margin:0}.info-modal-logo[data-v-4f97aa40]{height:4em;width:4em}.info-modal-title[data-v-4f97aa40]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.info-modal-discord-link[data-v-4f97aa40]{display:flex;align-items:center}.info-modal-discord[data-v-4f97aa40]{margin:0 4px 0 0}.field{display:flex;position:relative;min-height:2em;margin:10px 0;user-select:none;justify-content:space-between;align-items:center}.field>*{margin:0}.vue-select{width:50%;border-radius:var(--border-radius)}.field-buttons .vue-select{width:unset}.vue-select,.vue-dropdown{border-color:var(--outline)}.vue-dropdown{background:var(--raised-background)}.vue-dropdown-item{color:var(--foreground)}.vue-dropdown-item,.vue-dropdown-item *{transition-duration:0s}.vue-dropdown-item.highlighted{background-color:var(--highlighted)}.vue-dropdown-item.selected,.vue-dropdown-item.highlighted.selected{background-color:var(--bought)}.vue-input input{font-size:inherit}.vue-input input::placeholder{color:var(--link)}.field[data-v-11046116]{cursor:pointer}input[data-v-11046116]{appearance:none;pointer-events:none}span[data-v-11046116]{width:100%;padding-right:41px;position:relative}input+span[data-v-11046116]:before{content:"";position:absolute;top:calc(50% - 7px);right:0px;border-radius:7px;width:36px;height:14px;background-color:var(--outline);opacity:.38;vertical-align:top;transition:background-color .2s,opacity .2s}input+span[data-v-11046116]:after{content:"";position:absolute;top:calc(50% - 10px);right:16px;border-radius:50%;width:20px;height:20px;background-color:var(--locked);box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:background-color .2s,transform .2s}input:checked+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked+span[data-v-11046116]:after{background-color:var(--link);transform:translate(16px)}input:active+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}input:checked:active+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:disabled+span[data-v-11046116]{color:#000;opacity:.38;cursor:default}input:disabled+span[data-v-11046116]:before{background-color:var(--outline);opacity:.38}input:checked:disabled+span[data-v-11046116]:before{background-color:var(--link);opacity:.6}.feedback[data-v-01a1b95c]{position:relative}.feedback[data-v-01a1b95c]:after{position:absolute;left:calc(100% + 5px);top:50%;transform:translateY(-50%);content:"\2714";opacity:0;pointer-events:none;box-shadow:inset 0 0 0 35px #6f94b600;text-shadow:none}.feedback.left[data-v-01a1b95c]:after{left:unset;right:calc(100% + 5px)}.feedback.activated[data-v-01a1b95c]:after{animation:feedback-01a1b95c .5s ease-out forwards}@keyframes feedback-01a1b95c{0%{opacity:1;transform:scale3d(.4,.4,1),translateY(-50%)}80%{opacity:.1}to{opacity:0;transform:scale3d(1.2,1.2,1),translateY(-50%)}}.option-tabs{border-bottom:2px solid var(--outline);margin-top:10px;margin-bottom:-10px}.option-tabs button{background-color:transparent;color:var(--foreground);margin-bottom:-2px;font-size:14px;cursor:pointer;padding:5px 20px;border:none;border-bottom:2px solid var(--foreground)}.option-tabs button:not(.selected){border-bottom-color:transparent}.option-title .tooltip-container{display:inline;margin-left:5px}.option-title desc{display:block;opacity:.6;font-size:small;width:300px;margin-left:0}.save-button{text-align:right}form[data-v-90bd4994]{margin:0;width:100%}.field>*[data-v-90bd4994]{margin:0}input[data-v-90bd4994]{width:50%;outline:none;border:solid 1px var(--outline);background-color:unset;border-radius:var(--border-radius)}.fullWidth[data-v-90bd4994]{width:100%}.container[data-v-2f8ef34c]{display:flex;align-items:center;background:var(--raised-background);box-shadow:var(--raised-background) 0 2px 3px 5px}.container.confirming button[data-v-2f8ef34c]{font-size:1em}.container>*[data-v-2f8ef34c]{margin:0 4px}.danger,.button.danger{position:relative;border:solid 2px var(--danger);border-right-width:16px}.danger:after{position:absolute;content:"!";color:#fff;right:-13px}.save[data-v-32313015]{position:relative;border:solid 4px var(--outline);padding:4px;background:var(--raised-background);margin:var(--feature-margin);display:flex;align-items:center;min-height:30px}.save.active[data-v-32313015]{border-color:var(--bought)}.open[data-v-32313015]{display:inline;margin:0;padding-left:0}.handle[data-v-32313015]{flex-grow:0;margin-right:8px;margin-left:0;cursor:pointer}.details[data-v-32313015]{margin:0 80px 0 0;flex-grow:1}.error[data-v-32313015]{font-size:.8em;color:var(--danger)}.save-version[data-v-32313015]{margin-left:4px;font-size:.7em;opacity:.7}.actions[data-v-32313015]{position:absolute;top:0;bottom:0;right:4px;display:flex;padding:4px;z-index:1}.editname[data-v-32313015]{margin:0}.save button{transition-duration:0s}.save .actions button{display:flex;font-size:1.2em}.save .actions button .material-icons{font-size:unset}.save .button.danger{display:flex;align-items:center;padding:4px}.save .field,.field form[data-v-2a4275be],.field .field-title[data-v-2a4275be],.field .field-buttons[data-v-2a4275be]{margin:0}.field-buttons[data-v-2a4275be]{display:flex}.field-buttons .field[data-v-2a4275be]{margin:0 0 0 8px}.modal-footer[data-v-2a4275be]{margin-top:-20px}.footer[data-v-2a4275be]{display:flex;margin-top:20px}.importingFailed input{color:red}.field-buttons .v-select{width:220px}.presets .vue-select[aria-expanded=true] vue-dropdown{visibility:hidden}.nav[data-v-318a1c31]{background-color:var(--raised-background);display:flex;left:0;right:0;top:0;height:46px;width:100%;border-bottom:4px solid var(--outline)}.nav>*[data-v-318a1c31]{height:46px;width:46px;display:flex;cursor:pointer;flex-shrink:0}.nav>.banner[data-v-318a1c31]{height:100%;width:unset}.overlay-nav[data-v-318a1c31]{position:fixed;top:10px;left:10px;display:flex;flex-direction:column;z-index:2}.overlay-nav>*[data-v-318a1c31]{height:50px;width:50px;display:flex;cursor:pointer;margin:0;align-items:center;justify-content:center}.title[data-v-318a1c31]{font-size:36px;text-align:left;margin-left:12px;cursor:unset}.nav>.title[data-v-318a1c31]{width:unset;flex-shrink:1;overflow:hidden;white-space:nowrap}.nav .saves[data-v-318a1c31],.nav .info[data-v-318a1c31]{display:flex}.tooltip-container[data-v-318a1c31]{width:100%;height:100%;display:flex}.overlay-nav .discord[data-v-318a1c31]{position:relative}.discord img[data-v-318a1c31]{width:100%;height:100%}.discord-links[data-v-318a1c31]{position:fixed;top:45px;padding:20px;right:-280px;width:200px;transition:right .25s ease;background:var(--raised-background);z-index:10}.overlay-nav .discord-links[data-v-318a1c31]{position:absolute;left:-280px;right:unset;transition:left .25s ease}.overlay-nav .discord:hover .discord-links[data-v-318a1c31]{left:-10px}.discord-links li[data-v-318a1c31]{margin-bottom:4px}.discord-links li[data-v-318a1c31]:first-child{font-size:1.2em}*:not(.overlay-nav) .discord:hover .discord-links[data-v-318a1c31]{right:0}.material-icons[data-v-318a1c31]{font-size:36px}.material-icons[data-v-318a1c31]:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--foreground)}.nav .version-container[data-v-318a1c31]{display:flex;height:25px;margin-bottom:0;margin-left:10px}.overlay-nav .version-container[data-v-318a1c31]{width:unset;height:25px}.version[data-v-318a1c31]{color:var(--points)}.version:hover span[data-v-318a1c31]{text-shadow:5px 0 10px var(--points),-3px 0 12px var(--points)}.nav>div>a[data-v-318a1c31],.overlay-nav>div>a[data-v-318a1c31]{color:var(--foreground);text-shadow:none}.tabs-container[data-v-dcd207b4]{width:100vw;flex-grow:1;overflow-x:auto;overflow-y:hidden;display:flex}.tabs-container[data-v-dcd207b4]:not(.useHeader){width:calc(100vw - 50px);margin-left:50px}.tab[data-v-dcd207b4]{position:relative;height:100%;flex-grow:1;transition-duration:0s;overflow-y:auto;overflow-x:hidden}.inner-tab[data-v-dcd207b4]{padding:50px 10px;min-height:calc(100% - 100px);display:flex;flex-direction:column;margin:0;flex-grow:1}.tab+.tab>.inner-tab[data-v-dcd207b4]{border-left:solid 4px var(--outline)}.tab hr{height:4px;border:none;background:var(--outline);margin:var(--feature-margin) 0}.tab .modal-body hr{margin:7px 0}.sticky[data-v-cccac690]{position:sticky;background:var(--background);width:calc(100% - 2px);z-index:3}.link[data-v-57c4970a]{transition-duration:0s}.link.pulsing[data-v-57c4970a]{animation:pulsing-57c4970a 2s ease-in infinite}@keyframes pulsing-57c4970a{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.action:not(.boardnode):hover circle[data-v-9efb2a56],.action:not(.boardnode).selected circle[data-v-9efb2a56]{r:25}.action:not(.boardnode):hover text[data-v-9efb2a56],.action:not(.boardnode).selected text[data-v-9efb2a56]{font-size:187.5%}.action:not(.boardnode) text[data-v-9efb2a56]{text-anchor:middle;dominant-baseline:central}.actions-enter-from .action,.actions-leave-to .action{transform:translate(0)}.boardnode[data-v-4654be02]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-4654be02]{fill:var(--highlighted)}.boardnode.running .body[data-v-4654be02]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-4654be02]{fill:var(--locked)}.node-title[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:200%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.node-subtitle[data-v-4654be02]{text-anchor:middle;dominant-baseline:middle;font-family:monospace;font-size:150%;pointer-events:none;filter:drop-shadow(3px 3px 2px var(--tooltip-background))}.progress[data-v-4654be02]{transition-duration:.05s}.progressRing[data-v-4654be02]{transform:rotate(-90deg)}.fade-enter-from[data-v-4654be02],.fade-leave-to[data-v-4654be02]{opacity:0}.pulsing[data-v-4654be02]{animation:pulsing-4654be02 2s ease-in infinite}@keyframes pulsing-4654be02{0%{opacity:.25}50%{opacity:1}to{opacity:.25}}.grow-enter-from .node-container,.grow-leave-to .node-container{transform:scale(0)}.vue-pan-zoom-scene{width:100%;height:100%;cursor:grab}.vue-pan-zoom-scene:active{cursor:grabbing}.g1{transition-duration:0s}.link-enter-from,.link-leave-to{opacity:0}.tabButton[data-v-21427abb]{background-color:transparent;color:var(--foreground);font-size:20px;cursor:pointer;padding:5px 20px;margin:5px;border-radius:5px;border:2px solid;flex-shrink:0;border-color:var(--layer-color)}.tabButton[data-v-21427abb]:hover{transform:scale(1.1);text-shadow:0 0 7px var(--foreground)}:not(.floating)>.tabButton[data-v-21427abb]{height:50px;margin:0;border-left:none;border-right:none;border-top:none;border-bottom-width:4px;border-radius:0;transform:unset}:not(.floating) .tabButton[data-v-21427abb]:not(.active){border-bottom-color:transparent}.tabButton>*[data-v-21427abb]{pointer-events:none}.tab-family-container[data-v-58dbf83a]{margin:calc(50px + var(--feature-margin)) 20px var(--feature-margin) 20px;position:relative;border:solid 4px;border-color:var(--outline)}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child{margin:-4px -11px var(--feature-margin) -11px}.layer-tab>.tab-family-container[data-v-58dbf83a]:first-child:nth-last-child(3){border-bottom-style:none;border-left-style:none;border-right-style:none;height:calc(100% + 50px)}.modal-body>.tab-family-container[data-v-58dbf83a]:first-child{margin:calc(10px + var(--feature-margin)) 10px 0 10px;border:none}.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:20px}.modal-body>.tab-family-container[data-v-58dbf83a]>:nth-child(2){margin-top:50px}.tab-family-container[data-v-f18896fc][data-v-58dbf83a]>:last-child{margin-bottom:20px}.tab-buttons-container[data-v-58dbf83a]{z-index:4}.tab-buttons-container[data-v-58dbf83a]:not(.floating){border-bottom:solid 4px;border-color:inherit}:not(.layer-tab):not(.modal-body)>.tab-family-container>.tab-buttons-container[data-v-58dbf83a]:not(.floating){width:calc(100% + 6px);margin-left:-3px}.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{text-align:left;margin-bottom:-4px}.tab-buttons-container.floating .tab-buttons[data-v-58dbf83a]{justify-content:center;margin-top:-25px}.tab-buttons[data-v-58dbf83a]{margin-bottom:24px;display:flex;flex-flow:wrap;z-index:4}.layer-tab>.tab-family-container:first-child:nth-last-child(3)>.tab-buttons-container>.tab-buttons[data-v-58dbf83a]{padding-right:60px}.tab-buttons[data-v-58dbf83a]:not(.floating){text-align:left;border-bottom:inherit;border-width:4px;box-sizing:border-box;height:50px}.modal-body .tab-buttons[data-v-58dbf83a]{width:100%;margin-left:0;margin-right:0;padding-left:0}.showGoBack>.tab-family-container:first-child>.tab-buttons-container:not(.floating) .tab-buttons[data-v-58dbf83a]{padding-left:70px}:not(.showGoBack)>.tab-family-container>.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{padding-left:0}.minimizable>.tab-buttons-container[data-v-58dbf83a]:not(.floating):first-child{padding-right:50px}.tab-buttons-container:not(.floating):first-child .tab-buttons[data-v-58dbf83a]{margin-top:-50px}.tab-buttons-container+*[data-v-58dbf83a]{margin-top:20px}.modifier-container{display:flex;padding:1px 8px}.modifier-container:nth-child(2n){background:var(--raised-background)}.modifier-amount{flex-shrink:0;text-align:right}:not(:first-of-type,:last-of-type)>.modifier-amount:after{content:var(--unit);opacity:0}.modifier-description{flex-grow:1}.collapsible-container[data-v-a72c16aa]{width:calc(100% - 10px)}.collapsible-toggle[data-v-a72c16aa]{max-width:unset;width:calc(100% + 0px);margin:0 0 0 -5px;background:var(--raised-background);padding:var(--feature-margin);color:var(--foreground);cursor:pointer;transition-duration:0s}.collapsible-toggle[data-v-a72c16aa]:last-child{margin-left:unset}[data-v-a72c16aa] .collapsible-toggle+.table{max-width:unset;width:calc(100% + 10px);margin-left:-5px}[data-v-a72c16aa] .col{margin-top:0;margin-bottom:0;width:100%}.mergeAdjacent .collapsible-toggle[data-v-a72c16aa]{border:0;border-top-left-radius:0!important;border-top-right-radius:0!important}[data-v-a72c16aa] .mergeAdjacent .feature:not(.dontMerge):first-child{border-top-left-radius:0!important;border-top-right-radius:0!important}.feature:not(li),.feature:not(li) button{position:relative;padding:5px;border-radius:var(--border-radius);border:2px solid rgba(0,0,0,.125);margin:var(--feature-margin);box-sizing:border-box;color:var(--feature-foreground);z-index:0;transition:all .5s,z-index 0s .5s}.can,.can button{background-color:var(--layer-color);cursor:pointer}.can:hover,.can:hover button{transform:scale(1.15);box-shadow:0 0 20px var(--points);z-index:1;transition:all .5s,z-index 0s}.locked,.locked button{background-color:var(--locked);cursor:not-allowed}.bought,.bought button{background-color:var(--bought);cursor:default}.mark[data-v-2207999f]{position:absolute;left:-25px;top:-10px;width:30px;height:30px;z-index:1;pointer-events:none;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid transparent;border-left:.3em solid transparent;font-size:10px}.star[data-v-2207999f]{left:-10px;width:0;height:0;margin-left:.9em;margin-right:.9em;margin-bottom:1.2em;border-right:.3em solid transparent;border-bottom:.7em solid #ffcc00;border-left:.3em solid transparent;font-size:10px;pointer-events:none}.star[data-v-2207999f]:before,.star[data-v-2207999f]:after{content:"";width:0;height:0;position:absolute;top:.6em;left:-1em;border-right:1em solid transparent;border-bottom:.7em solid #ffcc00;border-left:1em solid transparent;transform:rotate(-35deg)}.star[data-v-2207999f]:after{transform:rotate(35deg)}.node[data-v-a48cb382]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.clickable[data-v-211328c0]{min-height:120px;width:120px;font-size:10px}.clickable.small[data-v-211328c0]{min-height:unset}.clickable>*[data-v-211328c0]{pointer-events:none}.resize-listener[data-v-063f6d6b]{position:absolute;top:0px;left:0;right:-4px;bottom:5px;z-index:-10;pointer-events:none}svg[data-v-063f6d6b]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:-10;pointer-events:none}.left-side-nodes[data-v-39ca96d0]{position:absolute;left:15px;top:65px}.side-nodes[data-v-39ca96d0]{position:absolute;right:15px;top:65px}.left-side-nodes[data-v-39ca96d0] .treeNode,.side-nodes[data-v-39ca96d0] .treeNode{margin:20px auto}.small[data-v-39ca96d0] .treeNode{height:60px;width:60px}.small[data-v-39ca96d0] .treeNode>*:first-child{font-size:30px}.treeNode[data-v-727230a6]{height:100px;width:100px;border-radius:50%;padding:0;margin:0 10px}.treeNode>*[data-v-727230a6]:first-child{width:100%;height:100%;border:2px solid rgba(0,0,0,.125);border-radius:inherit;font-size:40px;color:#00000080;text-shadow:2px 2px 4px rgba(0,0,0,.25);box-shadow:-4px -4px 4px #00000040 inset,0 0 20px var(--background);display:flex}.treeNode>*:first-child>*[data-v-727230a6]{pointer-events:none}.modifier-toggle{padding-right:10px;transform:translateY(-1px);display:inline-block}.modifier-toggle.collapsed{transform:translate(-5px,-5px) rotate(-90deg)}.nav-container{margin-top:-50px;text-align:left;border-bottom:solid 1px var(--outline);margin-left:-10px;margin-right:-10px;padding:10px;width:100%}.nav-segment{border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.affected-node{filter:drop-shadow(0px 0px 20px var(--accent1))}.achievement.final{border-color:var(--accent3)}.showNotif .body{filter:drop-shadow(0px 0px 20px var(--foreground))}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.achievement[data-v-5673325a]{height:90px;width:90px;font-size:10px;color:#fff;text-shadow:0 0 2px #000000}.achievement[data-v-5673325a]:not(.small){height:unset;width:calc(100% - 10px);min-width:120px;padding-left:5px;padding-right:5px;background-color:var(--locked);border-width:4px;border-radius:5px;color:#00000080;font-size:unset;text-shadow:unset}.achievement.done[data-v-5673325a]{background-color:var(--bought);cursor:default}.achievement[data-v-5673325a] .equal-spaced{display:flex;justify-content:center}.achievement[data-v-5673325a] .equal-spaced>*{margin:auto}.game-over-modal-header[data-v-4a50ce42]{display:flex;margin:-20px -20px 0;background:var(--raised-background);align-items:center}.game-over-modal-header *[data-v-4a50ce42]{margin:0}.game-over-modal-logo[data-v-4a50ce42]{height:4em;width:4em}.game-over-modal-title[data-v-4a50ce42]{display:flex;flex-direction:column;padding:10px 0;margin-left:10px}.game-over-footer[data-v-4a50ce42]{display:flex;justify-content:flex-end}.game-over-footer button[data-v-4a50ce42]{margin:0 10px}.game-over-modal-discord-link[data-v-4a50ce42]{display:flex;align-items:center}.game-over-modal-discord[data-v-4a50ce42]{margin:0 4px 0 0}.nan-modal-header[data-v-2776d67d]{padding:10px 0;margin-left:10px}.nan-footer[data-v-2776d67d]{display:flex;justify-content:flex-end}.nan-footer button[data-v-2776d67d]{margin:0 10px}.nan-modal-discord-link[data-v-2776d67d]{display:flex;align-items:center}.nan-modal-discord[data-v-2776d67d]{margin:0 4px 0 0}.tpsDisplay[data-v-46a3ed5b]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-46a3ed5b]{color:var(--danger)}.fade-leave-to[data-v-46a3ed5b]{opacity:0}:root{color-scheme:dark}*{transition-duration:.5s;font-family:Roboto Mono,monospace;font-weight:700;margin:auto;text-size-adjust:none}*:focus{outline:none}body{overflow:hidden;transition:none;text-align:center}html,body,#app{min-height:100%;height:100%}h1,h2,h3,b,input{display:inline}button{color:#000}a,.button,.link{display:block;color:var(--link);background:none;border:none;cursor:pointer;text-decoration:none}a:hover,.button:hover,.link:hover{text-shadow:5px 0 10px var(--link),-3px 0 12px var(--link)}.button:disabled{opacity:.5;cursor:not-allowed}.button:disabled:hover{text-shadow:none}ul{list-style-type:none}.Vue-Toastification__toast{margin:unset}.app[data-v-41d15e5e]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-41d15e5e]{position:absolute;min-height:100%;height:100%;color:var(--foreground)} diff --git a/index.html b/index.html index ebc2def..437c247 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + @@ -32,7 +32,7 @@ - + diff --git a/sw.js b/sw.js index d64f44c..0c1e30f 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.e85fc477.js",revision:null},{url:"assets/index.6980da7f.js",revision:null},{url:"assets/index.e0ba227d.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/unique-names-generator.5494b30b.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:"909625b0c78aeb964a4f0b3e2e349879"},{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.8e2ab203.js",revision:null},{url:"assets/index.2c261c78.js",revision:null},{url:"assets/index.69d9c929.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/unique-names-generator.5494b30b.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:"12adf25b341358674bfda2d37321fae0"},{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")))}));