diff --git a/assets/gameLoop.a8abe3ac.js b/assets/gameLoop.659c1ba3.js similarity index 89% rename from assets/gameLoop.a8abe3ac.js rename to assets/gameLoop.659c1ba3.js index 0188875..37ed5aa 100644 --- a/assets/gameLoop.a8abe3ac.js +++ b/assets/gameLoop.659c1ba3.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.3f4ba557.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./lz-string.dccec454.js";import"./nanoevents.1080beb7.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.3f4ba557.js").then(function(t){return t.c}),["assets/index.3f4ba557.js","assets/index.8a0a226e.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/lz-string.dccec454.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; +import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.a102b2d9.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./lz-string.dccec454.js";import"./nanoevents.1080beb7.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.a102b2d9.js").then(function(t){return t.c}),["assets/index.a102b2d9.js","assets/index.82a00c6b.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/lz-string.dccec454.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; diff --git a/assets/index.3f4ba557.js b/assets/index.3f4ba557.js deleted file mode 100644 index e48078b..0000000 --- a/assets/index.3f4ba557.js +++ /dev/null @@ -1,21 +0,0 @@ -/* empty css */import"./vue.c16a309b.js";import{q as ln,C as s,ab as X,t as G,aF as S,a1 as T,aL as qt,bv as Pn,G as Ne,as as Xt,_ as w,az as Qn,a2 as N,J as ee,O as ne,aK as Dt,a0 as B,I as Le,a8 as y,a9 as d,b7 as H,aI as cn,aG as dn,l as Ve,u as Lr,b2 as wt,aD as Mi,w as _t,b3 as Pt,ap as ua,aH as sr,A as Ae,$ as re,b9 as jr,ar as Vt,bt as ca,bc as Wn,T as da,j as pa,bw as Bt,ay as fa,aM as Ct,aO as Ke,z as Jt,bo as ga,bs as ma,bd as ui,am as dr,H as va,bx as ha,bf as ba}from"./@vue.6b211d3c.js";import{L as Yt}from"./lz-string.dccec454.js";import{c as Ii}from"./nanoevents.1080beb7.js";import{Y as ya}from"./vue-next-select.ded54c4a.js";import{D as wa}from"./vuedraggable.1879de79.js";import{p as _a}from"./vue-textarea-autosize.35804eaf.js";import{P as Na}from"./vue-panzoom.8ce6f9b1.js";import{s as Ca,u as hr}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const ka=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}};ka();const Sa="modulepreload",ci={},Ma="./",Hn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Ma}${r}`,r in ci)return;ci[r]=!0;const i=r.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${a}`))return;const u=document.createElement("link");if(u.rel=i?"stylesheet":Sa,i||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),i)return new Promise((l,c)=>{u.addEventListener("load",l),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},Ia="./projInfo-schema.json",xa="Planar Pioneers",$a="A game about controlling and exploiting planes!",Da="planar-pioneers",Ta="thepaperpilot",Pa="",Aa="",Ra="0.0",Ea="Initial Commit",Fa=!1,Oa=!1,qa=2,Va=!0,Ba=null,La="",ja=["main"],za=3600,Ga=0,Ua=!0,Wa="base64";var ve={$schema:Ia,title:xa,description:$a,id:Da,author:Ta,discordName:Pa,discordLink:Aa,versionNumber:Ra,versionTitle:Ea,allowGoBack:Fa,defaultShowSmall:Oa,defaultDecimalsShown:qa,useHeader:Va,banner:Ba,logo:La,initialTabs:ja,maxTickLength:za,offlineLimit:Ga,enablePausing:Ua,exportEncoding:Wa};const Ha=ln({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Y=window.player=Ha;function zr(e){return JSON.stringify(e,(t,n)=>s(n))}var be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Ya=["onClick"],Za=X({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=G(!1),r=G(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Xt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(a,u)=>(S(),T("button",{onClick:Pn(i,["stop"]),class:Ne(["feedback",{activated:n.value,left:e.left}])},[qt(a.$slots,"default",{},void 0,!0)],10,Ya))}});var Gr=be(Za,[["__scopeId","data-v-01a1b95c"]]);const br=e=>(cn("data-v-ac351c02"),e=e(),dn(),e),Xa={class:"error"},Ja={class:"error-title"},Ka={class:"error-details",style:{"margin-top":"-10px"}},Qa={key:0},es={class:"instructions"},ts=["href"],ns=br(()=>N("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),rs=br(()=>N("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),is=br(()=>N("br",null,null,-1)),as={key:0,style:{"margin-top":"20px"}},ss=br(()=>N("h3",null,"Other errors",-1)),os=[ss],ls={class:"error-details"},us={key:0,style:{"margin-top":"10px"}},cs={key:1,style:{"margin-top":"10px"}},ds=X({__name:"Error",props:{errors:null},setup(e){const t=e,n=w(()=>t.errors[0]),r=w(()=>t.errors.map(u=>u.stack==null?[]:u.stack.split(` -`))),i=w(()=>t.errors.map(u=>u.cause==null?[]:(typeof u.cause=="string"?u.cause:JSON.stringify(u.cause)).split(` -`)));function a(){let u=zr(Y);switch(ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":u=Yt.compressToUTF16(u);break;case"base64":u=btoa(unescape(encodeURIComponent(u)));break;case"plain":break}console.log(u);const l=document.createElement("textarea");l.value=u,document.body.appendChild(l),l.select(),l.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(l)}return Qn(()=>{Y.autosave=!1,Y.devSpeed=0}),(u,l)=>(S(),T("div",Xa,[N("h1",Ja,ee(s(n).name)+": "+ee(s(n).message),1),N("div",Ka,[s(n).cause?(S(),T("div",Qa,[(S(!0),T(ne,null,Dt(s(i)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))])):B("",!0),s(n).stack?(S(),T("div",{key:1,style:Le(s(n).cause?"margin-top: 10px":"")},[(S(!0),T(ne,null,Dt(s(r)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))],4)):B("",!0)]),N("div",es,[y(" Check the console for more details, and consider sharing it with the developers on "),N("a",{href:s(ve).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,ts),y("! "),d(Gr,{onClick:a,class:"button",style:{display:"inline-flex"}},{default:H(()=>[ns,rs]),_:1}),is,e.errors.length>1?(S(),T("div",as,os)):B("",!0),(S(!0),T(ne,null,Dt(e.errors.slice(1),(c,p)=>(S(),T("div",{key:p,style:{"margin-top":"20px"}},[N("details",ls,[N("summary",null,ee(c.name)+": "+ee(c.message),1),c.cause?(S(),T("div",us,[(S(!0),T(ne,null,Dt(s(i)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0),c.stack?(S(),T("div",cs,[(S(!0),T(ne,null,Dt(s(r)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0)])]))),128))])]))}});var xi=be(ds,[["__scopeId","data-v-ac351c02"]]);class ps{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 r=new fs(t,n);for(this.first===void 0?(this.first=r,this.last=r):(r.next=this.first,this.first.prev=r,this.first=r),this.map.set(t,r);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class fs{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Pr=17,gs=9e15,ms=Math.log10(9e15),vs=1/9e15,hs=308,bs=-324,di=5,ys=(1<<10)-1,ws=function(){const e=[];for(let n=bs+1;n<=hs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),gn=[2,Math.E,3,4,5,6,7,8,9,10],_s=[[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]],Ns=[[-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 M=function(t){return o.fromValue_noAlloc(t)},Q=function(e,t,n){return o.fromComponents(e,t,n)},se=function(t,n,r){return o.fromComponents_noNormalize(t,n,r)};const rn=function(t,n){const r=n+1,i=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,r-i))*Math.pow(10,i-r);return parseFloat(a.toFixed(Math.max(r-i,0)))},Ar=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},Cs=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 r=e*e;let i=e;return n=n+1/(12*i),i=i*r,n=n+1/(360*i),i=i*r,n=n+1/(1260*i),i=i*r,n=n+1/(1680*i),i=i*r,n=n+1/(1188*i),i=i*r,n=n+691/(360360*i),i=i*r,n=n+7/(1092*i),i=i*r,n=n+3617/(122400*i),Math.exp(n)/t},$i=.5671432904097838,pi=function(e,t=1e-10){let n,r;if(!Number.isFinite(e)||e===0)return e;if(e===1)return $i;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(r=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(r-n).5?1:-1;if(Math.random()*20<1)return se(t,0,1);const n=Math.floor(Math.random()*(e+1));let r=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(r=Math.trunc(r));let i=Math.pow(10,r);return Math.random()>.9&&(i=Math.trunc(i)),Q(t,n,i)}static affordGeometricSeries_core(e,t,n,r){const i=t.mul(n.pow(r));return _.floor(e.div(i).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,r){return t.mul(n.pow(r)).mul(_.sub(1,n.pow(e))).div(_.sub(1,n))}static affordArithmeticSeries_core(e,t,n,r){const a=t.add(r.mul(n)).sub(n.div(2)),u=a.pow(2);return a.neg().add(u.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,r){const i=t.add(r.mul(n));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=gs)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=_.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const r=e.split("^^^");if(r.length===2){const k=parseFloat(r[0]),C=parseFloat(r[1]),$=r[1].split(";");let x=1;if($.length===2&&(x=parseFloat($[1]),isFinite(x)||(x=1)),isFinite(k)&&isFinite(C)){const I=_.pentate(k,C,x);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const i=e.split("^^");if(i.length===2){const k=parseFloat(i[0]),C=parseFloat(i[1]),$=i[1].split(";");let x=1;if($.length===2&&(x=parseFloat($[1]),isFinite(x)||(x=1)),isFinite(k)&&isFinite(C)){const I=_.tetrate(k,C,x);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const k=parseFloat(a[0]),C=parseFloat(a[1]);if(isFinite(k)&&isFinite(C)){const $=_.pow(k,C);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}e=e.trim().toLowerCase();let u,l,c=e.split("pt");if(c.length===2){u=10,l=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let k=parseFloat(c[1]);if(isFinite(k)||(k=1),isFinite(u)&&isFinite(l)){const C=_.tetrate(u,l,k);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){u=10,l=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let k=parseFloat(c[1]);if(isFinite(k)||(k=1),isFinite(u)&&isFinite(l)){const C=_.tetrate(u,l,k);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const p=e.split("e"),h=p.length-1;if(h===0){const k=parseFloat(e);if(isFinite(k))return this.fromNumber(k),_.fromStringCache.size>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}else if(h===1){const k=parseFloat(e);if(isFinite(k)&&k!==0)return this.fromNumber(k),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}const g=e.split("e^");if(g.length===2){this.sign=1,g[0].charAt(0)=="-"&&(this.sign=-1);let k="";for(let C=0;C=43&&$<=57||$===101)k+=g[1].charAt(C);else return this.layer=parseFloat(k),this.mag=parseFloat(g[1].substr(C+1)),this.normalize(),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}if(h<1)return this.sign=0,this.layer=0,this.mag=0,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this;const b=parseFloat(p[0]);if(b===0)return this.sign=0,this.layer=0,this.mag=0,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this;let v=parseFloat(p[p.length-1]);if(h>=2){const k=parseFloat(p[p.length-2]);isFinite(k)&&(v*=Math.sign(k),v+=Ar(k))}if(!isFinite(b))this.sign=p[0]==="-"?-1:1,this.layer=h,this.mag=v;else if(h===1)this.sign=Math.sign(b),this.layer=1,this.mag=v+Math.log10(Math.abs(b));else if(this.sign=Math.sign(b),this.layer=h,h===2){const k=_.mul(Q(1,2,v),M(b));return this.sign=k.sign,this.layer=k.layer,this.mag=k.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}else this.mag=v;return this.normalize(),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}fromValue(e){return e instanceof _?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:rn(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:rn(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<=di?(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):rn(this.m,e)+"e"+rn(this.e,e):this.layer===1?rn(this.m,e)+"e"+rn(this.e,e):this.layer<=di?(this.sign===-1?"-":"")+"e".repeat(this.layer)+rn(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+rn(this.mag,e)}abs(){return se(this.sign===0?0:1,this.layer,this.mag)}neg(){return se(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=M(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 se(0,0,0);let n,r;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(_.cmpabs(this,t)>0?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return _.fromNumber(n.sign*n.mag+r.sign*r.mag);const i=n.layer*Math.sign(n.mag),a=r.layer*Math.sign(r.mag);if(i-a>=2)return n;if(i===0&&a===-1){if(Math.abs(r.mag-Math.log10(n.mag))>Pr)return n;{const u=Math.pow(10,Math.log10(n.mag)-r.mag),l=r.sign+n.sign*u;return Q(Math.sign(l),1,r.mag+Math.log10(Math.abs(l)))}}if(i===1&&a===0){if(Math.abs(n.mag-Math.log10(r.mag))>Pr)return n;{const u=Math.pow(10,n.mag-Math.log10(r.mag)),l=r.sign+n.sign*u;return Q(Math.sign(l),1,Math.log10(r.mag)+Math.log10(Math.abs(l)))}}if(Math.abs(n.mag-r.mag)>Pr)return n;{const u=Math.pow(10,n.mag-r.mag),l=r.sign+n.sign*u;return Q(Math.sign(l),1,r.mag+Math.log10(Math.abs(l)))}}plus(e){return this.add(e)}sub(e){return this.add(M(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=M(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return se(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return se(this.sign*t.sign,0,1);let n,r;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return _.fromNumber(n.sign*r.sign*n.mag*r.mag);if(n.layer>=3||n.layer-r.layer>=2)return Q(n.sign*r.sign,n.layer,n.mag);if(n.layer===1&&r.layer===0)return Q(n.sign*r.sign,1,n.mag+Math.log10(r.mag));if(n.layer===1&&r.layer===1)return Q(n.sign*r.sign,1,n.mag+r.mag);if(n.layer===2&&r.layer===1){const i=Q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Q(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return Q(n.sign*r.sign,i.layer+1,i.sign*i.mag)}if(n.layer===2&&r.layer===2){const i=Q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Q(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return Q(n.sign*r.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=M(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?_.dNaN:this.layer===0?Q(this.sign,0,1/this.mag):Q(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=M(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,r=t.mag>0?t.layer:-t.layer;return n>r?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=M(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=M(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let r=this.mag,i=n.mag;return this.layer>n.layer&&(i=Ar(i)),this.layer0?Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Q(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?_.dNaN:this.layer>0?Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Q(this.sign,0,Math.log10(this.mag))}log(e){return e=M(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?_.dNaN:this.layer===0&&e.layer===0?Q(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):_.div(this.log10(),e.log10())}log2(){return this.sign<=0?_.dNaN:this.layer===0?Q(this.sign,0,Math.log2(this.mag)):this.layer===1?Q(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Q(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?_.dNaN:this.layer===0?Q(this.sign,0,Math.log(this.mag)):this.layer===1?Q(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Q(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=M(e),n=this,r=t;if(n.sign===0)return r.eq(0)?se(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(r.sign===0)return se(1,0,1);if(r.sign===1&&r.layer===0&&r.mag===1)return n;const i=n.absLog10().mul(r).pow10();return this.sign===-1?Math.abs(r.toNumber()%2)%2===1?i.neg():Math.abs(r.toNumber()%2)%2===0?i:_.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return _.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return Q(1,0,t);if(e.sign===0)return _.dOne;e=se(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Q(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Q(-e.sign,e.layer+1,-e.mag):_.dOne}pow_base(e){return M(e).pow(this)}root(e){const t=M(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(se(1,0,24)))return _.fromNumber(Cs(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 r=e,i=12*r,a=1/i,u=t+a;if(u===t||(t=u,r=r*n,i=360*r,a=1/i,u=t-a,u===t))return _.exp(t);t=u,r=r*n,i=1260*r;let l=1/i;return t=t+l,r=r*n,i=1680*r,l=1/i,t=t-l,_.exp(t)}else return this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?_.dOne:this.layer===0&&this.mag<=709.7?_.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Q(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Q(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Q(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return _.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Q(1,2,Math.log10(this.mag)-.3010299956639812);{const e=_.div(se(this.sign,this.layer-1,this.mag),se(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=se(1,0,1)){if(e===1)return _.pow(this,t);if(e===0)return new _(t);if(this.eq(_.dOne))return _.dOne;if(this.eq(-1))return _.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return _.fromNumber(Math.E);const a=_.ln(this).neg();return a.lambertw().div(a)}else return i>1.444667861009766?_.fromNumber(Number.POSITIVE_INFINITY):_.dNaN}if(this.eq(_.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),_.fromNumber(i)}if(e<0)return _.iteratedlog(t,this,-e);t=M(t);const n=e;e=Math.trunc(e);const r=n-e;if(this.gt(_.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i3)return se(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=se(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return _.tetrate(e,-t,this);e=M(e);let n=_.fromDecimal(this);const r=t;t=Math.trunc(t);const i=r-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return i>0&&i<1&&(e.eq(10)?n=n.layeradd10(-i):n=n.layeradd(-i,e)),n}slog(e=10,t=100){let n=.001,r=!1,i=!1,a=this.slog_internal(e).toNumber();for(let u=1;u1&&i!=c&&(r=!0),i=c,r?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return _.fromNumber(a)}slog_internal(e=10){if(e=M(e),e.lte(_.dZero)||e.eq(_.dOne))return _.dNaN;if(e.lt(_.dOne))return this.eq(_.dOne)?_.dZero:this.eq(_.dZero)?_.dNegOne:_.dNaN;if(this.mag<0||this.eq(_.dZero))return _.dNegOne;let t=0,n=_.fromDecimal(this);if(n.layer-e.layer>3){const r=n.layer-e.layer-3;t+=r,n.layer-=r}for(let r=0;r<100;++r)if(n.lt(_.dZero))n=_.pow(e,n),t-=1;else{if(n.lte(_.dOne))return _.fromNumber(t+_.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=_.log(n,e)}return _.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:_.critical_section(e,t,Ns)}static tetrate_critical(e,t){return _.critical_section(e,t,_s)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let r=0,i=0;for(let u=0;ue){const l=(e-gn[u])/(gn[u+1]-gn[u]);r=n[u][Math.floor(t)]*(1-l)+n[u+1][Math.floor(t)]*l,i=n[u][Math.ceil(t)]*(1-l)+n[u+1][Math.ceil(t)]*l;break}const a=t-Math.floor(t);return r<=0||i<=0?r*(1-a)+i*a:Math.pow(e,Math.log(r)/Math.log(e)*(1-a)+Math.log(i)/Math.log(e)*a)}layeradd10(e){e=_.fromValue_noAlloc(e).toNumber();const t=_.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 r=0;r<100;++r){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 r=this.slog(t).toNumber()+e;return r>=0?_.tetrate(t,r):Number.isFinite(r)?r>=-1?_.log(_.tetrate(t,r+1),t):_.log(_.log(_.tetrate(t,r+2),t),t):_.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return _.fromNumber(pi(this.toNumber()));if(this.layer===0)return _.fromNumber(pi(this.sign*this.mag));if(this.layer===1)return fi(this);if(this.layer===2)return fi(this);if(this.layer>=3)return se(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return se(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=se(1,0,1)){t=M(t);const n=e;e=Math.trunc(e);const r=n-e;r!==0&&(t.eq(_.dOne)?(++e,t=_.fromNumber(r)):this.eq(10)?t=t.layeradd10(r):t=t.layeradd(r,this));for(let i=0;i10)return t}return t}sin(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.sin(this.sign*this.mag)):se(0,0,0)}cos(){return this.mag<0?_.dOne:this.layer===0?_.fromNumber(Math.cos(this.sign*this.mag)):se(0,0,0)}tan(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.tan(this.sign*this.mag)):se(0,0,0)}asin(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.asin(this.sign*this.mag)):se(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?_.fromNumber(Math.acos(this.toNumber())):this.layer===0?_.fromNumber(Math.acos(this.sign*this.mag)):se(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.atan(this.sign*this.mag)):_.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 _.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return _.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?se(Number.NaN,Number.NaN,Number.NaN):_.ln(this.add(1).div(_.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(_.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=_;o.fromStringCache=new ps(ys);o.dZero=se(0,0,0);o.dOne=se(1,0,1);o.dNegOne=se(-1,0,1);o.dTwo=se(1,0,2);o.dTen=se(1,0,10);o.dNaN=se(Number.NaN,Number.NaN,Number.NaN);o.dInf=se(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=se(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Q(1,0,Number.MAX_VALUE);o.dNumberMin=Q(1,0,Number.MIN_VALUE);M=o.fromValue_noAlloc;Q=o.fromComponents;se=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const ks=new o(1);function jn(e,t,n=!0){let r=o.log10(e).floor(),i=o.div(e,o.pow(10,r));i.toStringWithDecimalPlaces(t)==="10"&&(i=ks,r=r.add(1));const a=r.gte(1e9)?Nt(r,Math.max(Math.max(t,3),ve.defaultDecimalsShown)):r.gte(1e4)?pr(r,0):r.toStringWithDecimalPlaces(0);return n?i.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function pr(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const r=e.toStringWithDecimalPlaces(t).split(".");return r[0]=r[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),r.length==1?r[0]:r[0]+"."+r[1]}function Di(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ve.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ss=new o("eeee1000"),Ms=new o("e100000"),gi=new o("e1000"),Ti=new o(1e9),Is=new o(1e6),xs=new o(1e3),$s=new o(.98),Ds=new o(.001),Pi=new o(0);function Nt(e,t,n){if(t==null&&(t=ve.defaultDecimalsShown),n=n!=null?n:ve.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Nt(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ss)){const r=e.slog();return r.gte(Is)?"F"+Nt(r.floor()):o.pow(10,r.sub(r.floor())).toStringWithDecimalPlaces(3)+"F"+pr(r.floor(),0)}else{if(e.gte(Ms))return jn(e,0,!1);if(e.gte(gi))return jn(e,0);if(e.gte(Ti))return jn(e,t);if(e.gte(xs))return pr(e,0);if(e.gte(Ds)||!n)return Di(e,t);if(e.eq(Pi))return 0 .toFixed(t)}return e=Ri(e),e.lt(gi)?jn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Nt(e,t)+"\u207B\xB9"}function Ye(e){return e=new o(e),e.sign<0?"-"+Ye(e.neg()):e.gte(Ti)||e.lte($s)&&!e.eq(Pi)?Nt(e):Nt(e,0)}function Ai(e){return o.lt(e,0)?"-"+Ai(o.neg(e)):o.gt(e,2**51)?Nt(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?Nt(e)+"s":e<3600?Ye(Math.floor(e/60))+"m "+Nt(e%60)+"s":e<86400?Ye(Math.floor(e/3600))+"h "+Ye(Math.floor(e/60)%60)+"m "+Ye(e%60)+"s":e<31536e3?Ye(Math.floor(e/84600)%365)+"d "+Ye(Math.floor(e/3600)%24)+"h "+Ye(Math.floor(e/60)%60)+"m":Ye(Math.floor(e/31536e3))+"y "+Ye(Math.floor(e/84600)%365)+"d "+Ye(Math.floor(e/3600)%24)+"h")}function Ts(e,t,n){e=new o(e);let r=e.toStringWithDecimalPlaces(t);return new o(r).gte(n)&&(r=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),r}function Ps(e,t){return Nt(e,t,!0)}function Ri(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var As=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:jn,commaFormat:pr,regularFormat:Di,format:Nt,formatWhole:Ye,formatTime:Ai,toPlaces:Ts,formatSmall:Ps,invertOOM:Ri},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Ur,commaFormat:Rs,regularFormat:Es,format:xe,formatWhole:ut,formatTime:yr,toPlaces:Fs,formatSmall:Zt,invertOOM:Os}=As;window.Decimal=o;window.exponentialFormat=Ur;window.commaFormat=Rs;window.regularFormat=Es;window.format=xe;window.formatWhole=ut;window.formatTime=yr;window.toPlaces=Fs;window.formatSmall=Zt;window.invertOOM=Os;function st(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Yn(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 Zn=Symbol("DoNotCache");function A(e,t){const n=e[t];Yn(n)&&n.length===0&&!n[Zn]?e[t]=w(n.bind(e)):Yn(n)&&(e[t]=n.bind(e),e[t][Zn]=!0)}function _e(e){return Yn(e)&&!e[Zn]&&(e=w(e)),e}const gt=Symbol("Component"),dt=Symbol("GatherProps");let qs=0;function Qt(e="feature-"){return e+qs++}var Se=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Se||{});function Ze(e){const t=s(e);return t!==2&&t!==!1}function _n(e){return s(e)===1}function j(e){return e[Zn]=!0,e}function oe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Xn(e,...t){const n=[],r=i=>{Object.keys(i).forEach(a=>{const u=i[a];u!=null&&typeof u=="object"&&(t.includes(u.type)?n.push(u):!(u instanceof o)&&!Ve(u)&&r(u))})};return r(e),n}var Fe=window.state=Lr({lastTenTicks:[],hasNaN:!1,NaNPath:[],errors:ln([])});const mn={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 Wr=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Wr||{}),It={classic:mn,paper:{...mn,variables:{...mn.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:{...mn,variables:{...mn.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:{...mn,variables:{...mn.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Qe=Ii();"fonts"in document&&(document.fonts.onloadingdone=()=>Qe.emit("fontsLoaded"));var Vs=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Qe},Symbol.toStringTag,{value:"Module"}));function Ei(e={}){return Object.assign({id:`${ve.id}-0`,name:"Default Save",tabs:ve.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ve.id,modVersion:ve.versionNumber,layers:{}},e)}function bt(e){const t=Yt.compressToUTF16(zr(e!=null?e:Y));return localStorage.setItem((e!=null?e:Y).id,t),t}async function Bs(){zs();try{let e=localStorage.getItem(ie.active);if(e==null){await bn(Tn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ve.id){await bn(Tn());return}t.id=ie.active,await bn(t)}catch(e){console.error(`Failed to load save. Falling back to new save. -`,e),await bn(Tn())}}function Tn(){const e=cr(),t=Ei({id:e});return bt(t),ie.saves.push(e),t}function cr(){let e,t=0;do e=`${ve.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Ls=G(!1);async function bn(e){console.info("Loading save",e),Ls.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await Hn(()=>Promise.resolve().then(function(){return ql}),void 0),{fixOldSave:i,getInitialLayers:a}=await Hn(()=>Promise.resolve().then(function(){return Yp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>r(u,e)),e=Ei(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,ve.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ve.versionNumber&&(i(e.modVersion,e),e.modVersion=ve.versionNumber),Object.assign(Y,e),ie.active=Y.id,Qe.emit("onLoad")}setInterval(()=>{Y.autosave&&bt()},1e3);window.onbeforeunload=()=>{Y.autosave&&bt()};window.save=bt;const js=window.hardReset=async()=>{await bn(Tn())};window.deleteLowerSaves=()=>{const e=Object.values(ie.saves).indexOf(Y.id)+1;Object.values(ie.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ie.saves=ie.saves.slice(0,e)};const Jn=ln({active:"",saves:[],showTPS:!0,theme:Wr.Nordic,unthrottled:!1,alignUnits:!1});wt(Jn,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ve.id,t)},{deep:!0});var ie=window.settings=Jn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Wr.Nordic,alignUnits:!1};Qe.emit("loadSettings",e),Object.assign(Jn,e),js()};function zs(){try{let e=localStorage.getItem(ve.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Jn,t)}Qe.emit("loadSettings",Jn)}catch{}}const Fi=ln([]);function Oi(e){Fi.push(e)}const Gs=ln([]),Us=ln([]),Ws={class:"table"},Hs=X({__name:"Column",setup(e){const t=w(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Ws,[N("div",{class:Ne(["col",{mergeAdjacent:s(t)}])},[qt(n.$slots,"default")],2)]))}}),Ys={class:"table"},Zs=X({__name:"Row",setup(e){const t=w(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Ys,[N("div",{class:Ne(["row",{mergeAdjacent:s(t)}])},[qt(n.$slots,"default")],2)]))}});function qi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ua(e)}function fe(e,t="span"){return typeof e=="function"?X({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),X({template:e})):X({render:()=>({})}):e}function ot(e){if(At(e))return typeof e=="function"?e():fe(e);const t=e[gt];return d(t,e[dt](),null)}function Rr(...e){let t;return d(Zs,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function Xs(...e){let t;return d(Hs,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function mt(e){if(At(e))return typeof e=="function"?e():typeof e=="string"?d(ne,null,[e]):d(e,null,null);const t=e[gt];return d(t,e[dt](),null)}function mi(e,t){return e.reduce((n,r)=>d(ne,null,[n,t,r]))}function At(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Zn]===!0}function Vi(e,t){const n=G(null),r=G(void 0);function i(l){n.value||(n.value=setInterval(u,250)),r.value=l}function a(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return Mi(a),{start:i,stop:a,handleHolding:u}}function Hr(e,t="div"){const n=_t();return Pt(()=>{n.value=fe(Pe(e),t)}),n}function Rn(e,t="div"){const n=_t(null);return Pt(()=>{const r=Pe(e);n.value=r==""||r==null?null:fe(r,t)}),n}function Pe(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function vi(e){const t=G(!1),n=e[dt].bind(e);return e[dt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}const Js=X({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=G({}),r=new ResizeObserver(l),i=G(null);Qn(()=>{const g=i.value;g!=null&&r.observe(g)});let a=!0,u=G((h=i.value)==null?void 0:h.getBoundingClientRect());function l(){a&&(a=!1,Xt(()=>{var g;u.value=(g=i.value)==null?void 0:g.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}Qe.on("fontsLoaded",l);const c={attributes:!1,childList:!0,subtree:!1};sr(Yr,(g,b)=>{const v=new MutationObserver(()=>p(g));v.observe(b,c),n.value[g]={element:b,observer:v,rect:b.getBoundingClientRect()},l()}),sr(Zr,g=>{var b;(b=n.value[g])==null||b.observer.disconnect(),n.value[g]=void 0,l()}),sr(Xr,n),sr(Jr,u);function p(g){const b=n.value[g];b!=null&&(b.rect=b.element.getBoundingClientRect(),t("updateNodes",n.value))}return(g,b)=>(S(),T(ne,null,[qt(g.$slots,"default",{},void 0,!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Bi=be(Js,[["__scopeId","data-v-2b1dc1bc"]]);const Ks=["onPointerdown"],Qs={class:"modal-wrapper"},eo={class:"modal-container"},to={class:"modal-header"},no={class:"modal-body"},ro={class:"modal-footer"},io=N("div",{class:"modal-default-flex-grow"},null,-1),Lt=X({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=Ae(e),a=w(()=>s(i.modelValue)||l.value);function u(){n("update:modelValue",!1)}const l=G(!1),c=G(null),p=w(()=>{var h,g;return(g=(h=c.value)==null?void 0:h.nodes)!=null?g:null});return t({isOpen:a,nodes:p}),(h,g)=>(S(),re(da,{to:"#modal-root"},[d(Wn,{name:"modal",onBeforeEnter:g[0]||(g[0]=b=>l.value=!0),onAfterLeave:g[1]||(g[1]=b=>l.value=!1)},{default:H(()=>[jr(N("div",Vt({class:"modal-mask",onPointerdown:Pn(u,["self"])},h.$attrs),[N("div",Qs,[N("div",eo,[N("div",to,[qt(h.$slots,"header",{shown:s(a)},()=>[y(" default header ")])]),N("div",no,[d(Bi,{ref_key:"contextRef",ref:c},{default:H(()=>[qt(h.$slots,"body",{shown:s(a)},()=>[y(" default body ")])]),_:3},512)]),N("div",ro,[qt(h.$slots,"footer",{shown:s(a)},()=>[N("div",{class:"modal-default-footer"},[io,N("button",{class:"button modal-default-button",onClick:u}," Close ")])])])])])],16,Ks),[[ca,e.modelValue]])]),_:3})]))}}),an=Symbol("ProxyState");function et(e,t={}){const n=t;let r=!1,i=!1;function a(){return r||(i&&console.error("Cyclical dependency detected. Cannot evaluate lazy proxy."),i=!0,Object.assign(n,e.call(n,n)),r=!0),n}return new Proxy(n,{get(u,l){if(l===an)return a();const c=a()[l];return c!=null&&typeof c=="object"&&Ot in c?c[Ot]:c},set(u,l,c){return a()[l]=c,!0},has(u,l){return l===an?!0:Reflect.has(a(),l)},ownKeys(){return Reflect.ownKeys(a())},getOwnPropertyDescriptor(u,l){return r||(Object.assign(n,e.call(n,n)),r=!0),Object.getOwnPropertyDescriptor(u,l)}})}const Li=o.ln(10);function zn(e){return e}function ao(e,t){return F(t)?t.invert(o.neg(e)):(console.error("Could not invert due to no input being a variable"),0)}function so(e,t){return F(t)?t.isIntegrable()?f.neg(t.getIntegralFormula(e)):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function oo(e){return f.neg(e)}function lo(e,t,n){return F(t)?t.invert(o.sub(e,Me(n))):F(n)?n.invert(o.sub(e,Me(t))):(console.error("Could not invert due to no input being a variable"),0)}function uo(e,t,n){var r,i;if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const a=t.getIntegralFormula(e);return f.times(n,(r=t.innermostVariable)!=null?r:0).add(a)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const a=n.getIntegralFormula(e);return f.times(t,(i=n.innermostVariable)!=null?i:0).add(a)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function co(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.add(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.add(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function po(e,t,n){return F(t)?t.invert(o.add(e,Me(n))):F(n)?n.invert(o.sub(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function fo(e,t,n){var r,i;if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const a=t.getIntegralFormula(e);return f.sub(a,f.times(n,(r=t.innermostVariable)!=null?r:0))}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const a=n.getIntegralFormula(e);return f.times(t,(i=n.innermostVariable)!=null?i:0).sub(a)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function go(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.sub(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.sub(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function mo(e,t,n){return F(t)?t.invert(o.div(e,Me(n))):F(n)?n.invert(o.div(e,Me(t))):(console.error("Could not invert due to no input being a variable"),0)}function vo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.times(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.times(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ho(e,t,n){return F(t)?f.div(e,n):F(n)?f.div(e,t):(console.error("Could not apply substitution due to no input being a variable"),f.constant(0))}function bo(e,t,n){return F(t)?t.invert(o.mul(e,Me(n))):F(n)?n.invert(o.div(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function yo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.div(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.div(t,r)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function wo(e,t,n){return F(t)?f.mul(e,n):F(n)?f.mul(e,t):(console.error("Could not apply substitution due to no input being a variable"),f.constant(0))}function _o(e,t){return F(t)?t.invert(o.recip(e)):(console.error("Could not invert due to no input being a variable"),0)}function No(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.ln(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Co(e,t){return F(t)?t.invert(o.pow10(e)):(console.error("Could not invert due to no input being a variable"),0)}function ko(e){return o.ln(e).sub(1).times(e).div(Li)}function So(e,t){if(F(t)){const n=Li.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Mo(e,t){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:ko,invert:So}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Io(e,t,n){return F(t)?t.invert(o.pow(Me(n),e)):F(n)?n.invert(o.root(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function xo(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function $o(e,t,n){if(F(t)){const r=o.ln(Me(n)).times(e);return t.invert(r.div(r.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Do(e,t,n){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e),n],evaluate:xo,invert:$o}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function To(e,t){return F(t)?t.invert(o.pow(2,e)):(console.error("Could not invert due to no input being a variable"),0)}function Po(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function Ao(e,t){if(F(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Ro(e,t){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Po,invert:Ao}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Eo(e,t){return F(t)?t.invert(o.exp(e)):(console.error("Could not invert due to no input being a variable"),0)}function Fo(e){return o.ln(e).sub(1).times(e)}function Oo(e,t){return F(t)?t.invert(o.div(e,o.div(e,Math.E).lambertw())):(console.error("Could not invert due to no input being a variable"),0)}function qo(e,t){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Fo,invert:Oo}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Vo(e,t,n){return F(t)?t.invert(o.root(e,Me(n))):F(n)?n.invert(o.ln(e).div(o.ln(Me(t)))):(console.error("Could not invert due to no input being a variable"),0)}function Bo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e),i=f.add(n,1);return f.pow(r,i).div(i)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.pow(t,r).div(f.ln(t))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Lo(e,t){return F(t)?t.invert(o.root(e,10)):(console.error("Could not invert due to no input being a variable"),0)}function jo(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.pow10(n).div(f.ln(10))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function zo(e,t,n){return F(t)?t.invert(o.ln(e).div(o.ln(Me(n)))):F(n)?n.invert(o.root(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Go(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.pow(n,r).div(f.ln(n))}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e),i=f.add(t,1);return f.pow(r,i).div(i)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Uo(e,t,n){return F(t)?t.invert(o.root(e,o.recip(Me(n)))):F(n)?n.invert(o.ln(Me(t)).div(o.ln(e))):(console.error("Could not invert due to no input being a variable"),0)}function Wo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.pow(r,f.recip(n).add(1)).times(n).div(f.add(n,1))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Ho(e,t){return F(t)?t.invert(o.ln(e)):(console.error("Could not invert due to no input being a variable"),0)}function Yo(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.exp(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Zo(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const r=o.minabs(t,1e308).toNumber();return o.tetrate(e,r,n)}function Xo(e,t,n,r){return F(t)?t.invert(o.ssqrt(e)):(console.error("Could not invert due to no input being a variable"),0)}function Jo(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const r=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,r,new o(n))}function Ko(e,t,n,r){return F(t)?t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,Me(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function Qo(e,t=10,n=2){const r=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,r)}function el(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function tl(e,t,n){return F(t)?t.invert(o.tetrate(e,o.minabs(1e308,Me(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function nl(e,t,n){const r=o.minabs(t,1e308).toNumber();return o.layeradd(e,r,n)}function rl(e,t,n,r){return F(t)?t.invert(o.layeradd(e,o.minabs(1e308,Me(n)).negate().toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function il(e,t){return F(t)?t.invert(o.pow(Math.E,e).times(e)):(console.error("Could not invert due to no input being a variable"),0)}function al(e,t){return F(t)?t.invert(o.tetrate(e,2)):(console.error("Could not invert due to no input being a variable"),0)}function sl(e,t,n){const r=o.minabs(t,1e308).toNumber();return o.pentate(e,r,n)}function ol(e,t){return F(t)?t.invert(o.asin(e)):(console.error("Could not invert due to no input being a variable"),0)}function ll(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cos(n).neg()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ul(e,t){return F(t)?t.invert(o.acos(e)):(console.error("Could not invert due to no input being a variable"),0)}function cl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.sin(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function dl(e,t){return F(t)?t.invert(o.atan(e)):(console.error("Could not invert due to no input being a variable"),0)}function pl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cos(n).ln().neg()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function fl(e,t){return F(t)?t.invert(o.sin(e)):(console.error("Could not invert due to no input being a variable"),0)}function gl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.asin(n).times(n).add(f.sqrt(f.sub(1,f.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ml(e,t){return F(t)?t.invert(o.cos(e)):(console.error("Could not invert due to no input being a variable"),0)}function vl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.acos(n).times(n).sub(f.sqrt(f.sub(1,f.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function hl(e,t){return F(t)?t.invert(o.tan(e)):(console.error("Could not invert due to no input being a variable"),0)}function bl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.atan(n).times(n).sub(f.ln(f.pow(n,2).add(1)).div(2))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function yl(e,t){return F(t)?t.invert(o.asinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function wl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cosh(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function _l(e,t){return F(t)?t.invert(o.acosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Nl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.sinh(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Cl(e,t){return F(t)?t.invert(o.atanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function kl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cosh(n).ln()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Sl(e,t){return F(t)?t.invert(o.sinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ml(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.asinh(n).times(n).sub(f.pow(n,2).add(1).sqrt())}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Il(e,t){return F(t)?t.invert(o.cosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function xl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.acosh(n).times(n).sub(f.add(n,1).sqrt().times(f.sub(n,1).sqrt()))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function $l(e,t){return F(t)?t.invert(o.tanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Dl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.atanh(n).times(n).add(f.sub(1,f.pow(n,2)).ln().div(2))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function En(e){return(t,n)=>new f({inputs:[t,n],evaluate:e,invert:zn})}function F(e){return e instanceof Re&&e.hasVariable()}function Me(e,t){return e instanceof Re?e.evaluate(t):s(e)}function Tl(){return f.pow(this,2).div(2)}function Pl(){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"&&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:Tl,internalIntegrateInner:Pl,applySubstitution:zn}}setupConstant({inputs:e}){return e.length!==1&&console.error("Evaluate function is required if inputs is not length 1"),{inputs:e,internalVariables:0}}setupFormula(e){var b,v;const{inputs:t,evaluate:n,invert:r,integrate:i,integrateInner:a,applySubstitution:u}=e,l=t.reduce((k,C)=>k+(C instanceof Be?C.internalVariables:0),0),c=t.find(k=>k instanceof Be&&k.hasVariable()),p=l===1?c==null?void 0:c.innermostVariable:void 0,h=(b=c==null?void 0:c.isInvertible())!=null?b:!1,g=(v=c==null?void 0:c.isIntegrable())!=null?v:!1;return{inputs:t,internalEvaluate:n,internalInvert:h?r:void 0,internalIntegrate:g?i:void 0,internalIntegrateInner:a,applySubstitution:u,innermostVariable:p,internalVariables:l}}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,r;return(r=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(i=>Me(i,e))))!=null?n:this.hasVariable()?e:null)!=null?r:Me(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)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new f({inputs:[e]})}static variable(e){return new f({variable:e})}static step(e,t,n){const r=n(f.variable(0)),i=_e(t);function a(l){return o.lt(l,s(i))?l:o.add(r.evaluate(o.sub(l,s(i))),s(i))}function u(l,c){return F(c)&&r.isInvertible()?(o.gt(l,s(i))&&(l=o.add(r.invert(o.sub(l,s(i))),s(i))),c.invert(l)):(console.error("Could not invert due to no input being a variable"),0)}return new f({inputs:[e],evaluate:a,invert:r.isInvertible()&&r.hasVariable()?u:void 0})}static if(e,t,n,r){const i=G(0),a=f.variable(i),u=n(a),l=r==null?void 0:r(a),c=_e(t);function p(g){return s(c)?(i.value=g,u.evaluate()):l?(i.value=g,l.evaluate()):g}function h(g,b){return!F(b)||!u.isInvertible()||l!=null&&!l.isInvertible()?(console.error("Could not invert due to no input being a variable"),0):s(c)?b.invert(u.invert(g)):l?b.invert(l.invert(g)):b.invert(g)}return new f({inputs:[e],evaluate:p,invert:u.isInvertible()&&u.hasVariable()?h:void 0})}static conditional(e,t,n,r){return f.if(e,t,n,r)}static abs(e){return new f({inputs:[e],evaluate:o.abs})}static neg(e){return new f({inputs:[e],evaluate:o.neg,invert:ao,applySubstitution:oo,integrate:so})}static sign(e){return new f({inputs:[e],evaluate:o.sign})}static round(e){return new f({inputs:[e],evaluate:o.round})}static floor(e){return new f({inputs:[e],evaluate:o.floor})}static ceil(e){return new f({inputs:[e],evaluate:o.ceil})}static trunc(e){return new f({inputs:[e],evaluate:o.trunc})}static add(e,t){return new f({inputs:[e,t],evaluate:o.add,invert:lo,integrate:uo,integrateInner:co,applySubstitution:zn})}static sub(e,t){return new f({inputs:[e,t],evaluate:o.sub,invert:po,integrate:fo,integrateInner:go,applySubstitution:zn})}static mul(e,t){return new f({inputs:[e,t],evaluate:o.mul,invert:mo,integrate:vo,applySubstitution:ho})}static div(e,t){return new f({inputs:[e,t],evaluate:o.div,invert:bo,integrate:yo,applySubstitution:wo})}static recip(e){return new f({inputs:[e],evaluate:o.recip,invert:_o,integrate:No})}static clamp(e,t,n){return new f({inputs:[e,t,n],evaluate:o.clamp,invert:zn})}static pLog10(e){return new f({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new f({inputs:[e],evaluate:o.absLog10})}static log10(e){return new f({inputs:[e],evaluate:o.log10,invert:Co,integrate:Mo})}static log(e,t){return new f({inputs:[e,t],evaluate:o.log,invert:Io,integrate:Do})}static log2(e){return new f({inputs:[e],evaluate:o.log2,invert:To,integrate:Ro})}static ln(e){return new f({inputs:[e],evaluate:o.ln,invert:Eo,integrate:qo})}static pow(e,t){return new f({inputs:[e,t],evaluate:o.pow,invert:Vo,integrate:Bo})}static pow10(e){return new f({inputs:[e],evaluate:o.pow10,invert:Lo,integrate:jo})}static pow_base(e,t){return new f({inputs:[e,t],evaluate:o.pow_base,invert:zo,integrate:Go})}static root(e,t){return new f({inputs:[e,t],evaluate:o.root,invert:Uo,integrate:Wo})}static factorial(e){return new f({inputs:[e],evaluate:o.factorial})}static gamma(e){return new f({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new f({inputs:[e],evaluate:o.lngamma})}static exp(e){return new f({inputs:[e],evaluate:o.exp,invert:Ho,integrate:Yo})}static sqr(e){return f.pow(e,2)}static sqrt(e){return f.root(e,2)}static cube(e){return f.pow(e,3)}static cbrt(e){return f.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:Zo,invert:Xo})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:Jo,invert:Ko})}static iteratedlog(e,t=10,n=1){return new f({inputs:[e,t,n],evaluate:Qo})}static slog(e,t=10){return new f({inputs:[e,t],evaluate:el,invert:tl})}static layeradd10(e,t){return new f({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new f({inputs:[e,t,n],evaluate:nl,invert:rl})}static lambertw(e){return new f({inputs:[e],evaluate:o.lambertw,invert:il})}static ssqrt(e){return new f({inputs:[e],evaluate:o.ssqrt,invert:al})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:sl})}static sin(e){return new f({inputs:[e],evaluate:o.sin,invert:fl,integrate:ll})}static cos(e){return new f({inputs:[e],evaluate:o.cos,invert:ml,integrate:cl})}static tan(e){return new f({inputs:[e],evaluate:o.tan,invert:hl,integrate:pl})}static asin(e){return new f({inputs:[e],evaluate:o.asin,invert:ol,integrate:gl})}static acos(e){return new f({inputs:[e],evaluate:o.acos,invert:ul,integrate:vl})}static atan(e){return new f({inputs:[e],evaluate:o.atan,invert:dl,integrate:bl})}static sinh(e){return new f({inputs:[e],evaluate:o.sinh,invert:Sl,integrate:wl})}static cosh(e){return new f({inputs:[e],evaluate:o.cosh,invert:Il,integrate:Nl})}static tanh(e){return new f({inputs:[e],evaluate:o.tanh,invert:$l,integrate:kl})}static asinh(e){return new f({inputs:[e],evaluate:o.asinh,invert:yl,integrate:Ml})}static acosh(e){return new f({inputs:[e],evaluate:o.acosh,invert:_l,integrate:xl})}static atanh(e){return new f({inputs:[e],evaluate:o.atanh,invert:Cl,integrate:Dl})}step(e,t){return f.step(this,e,t)}if(e,t){return f.if(this,e,t)}conditional(e,t){return f.if(this,e,t)}abs(){return f.abs(this)}neg(){return f.neg(this)}sign(){return f.sign(this)}round(){return f.round(this)}floor(){return f.floor(this)}ceil(){return f.ceil(this)}trunc(){return f.trunc(this)}add(e){return f.add(this,e)}sub(e){return f.sub(this,e)}mul(e){return f.mul(this,e)}div(e){return f.div(this,e)}recip(){return f.recip(this)}max(e){return f.max(this,e)}min(e){return f.min(this,e)}maxabs(e){return f.maxabs(this,e)}minabs(e){return f.minabs(this,e)}clamp(e,t){return f.clamp(this,e,t)}clampMin(e){return f.clampMin(this,e)}clampMax(e){return f.clampMax(this,e)}pLog10(){return f.pLog10(this)}absLog10(){return f.absLog10(this)}log10(){return f.log10(this)}log(e){return f.log(this,e)}log2(){return f.log2(this)}ln(){return f.ln(this)}pow(e){return f.pow(this,e)}pow10(){return f.pow10(this)}pow_base(e){return f.pow_base(this,e)}root(e){return f.root(this,e)}factorial(){return f.factorial(this)}gamma(){return f.gamma(this)}lngamma(){return f.lngamma(this)}exp(){return f.exp(this)}sqr(){return f.pow(this,2)}sqrt(){return f.root(this,2)}cube(){return f.pow(this,3)}cbrt(){return f.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return f.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return f.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return f.iteratedlog(this,e,t)}slog(e=10){return f.slog(this,e)}layeradd10(e){return f.layeradd10(this,e)}layeradd(e,t){return f.layeradd(this,e,t)}lambertw(){return f.lambertw(this)}ssqrt(){return f.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return f.pentate(this,e,t)}sin(){return f.sin(this)}cos(){return f.cos(this)}tan(){return f.tan(this)}asin(){return f.asin(this)}acos(){return f.acos(this)}atan(){return f.atan(this)}sinh(){return f.sinh(this)}cosh(){return f.cosh(this)}tanh(){return f.tanh(this)}asinh(){return f.asinh(this)}acosh(){return f.acosh(this)}atanh(){return f.atanh(this)}};let Re=Be;Re.negate=Be.neg;Re.negated=Be.neg;Re.sgn=Be.sign;Re.plus=Be.add;Re.subtract=Be.sub;Re.minus=Be.sub;Re.multiply=Be.mul;Re.times=Be.mul;Re.divide=Be.div;Re.divideBy=Be.div;Re.dividedBy=Be.div;Re.reciprocal=Be.recip;Re.reciprocate=Be.recip;Re.max=En(o.max);Re.min=En(o.min);Re.minabs=En(o.minabs);Re.maxabs=En(o.maxabs);Re.clampMin=En(o.clampMin);Re.clampMax=En(o.clampMax);Re.logarithm=Be.log;class f extends Re{invert(t){return this.internalInvert&&this.hasVariable()?this.internalInvert.call(this,t,...this.inputs):this.inputs.length===1&&this.hasVariable()?t:(console.error("Cannot invert non-invertible formula"),0)}evaluateIntegral(t){return this.isIntegrable()?this.getIntegralFormula().evaluate(t):(console.error("Cannot evaluate integral of formula without integral"),0)}invertIntegral(t){return!this.isIntegrable()||!this.getIntegralFormula().isInvertible()?(console.error("Cannot invert integral of formula without invertible integral"),0):this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)return console.error("Cannot integrate formula with non-integrable operation"),f.constant(0);let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(r=>n=r(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 return console.error("Cannot integrate formula without variable"),f.constant(0);return this.integralFormula}else return this.applySubstitution==null?(console.error("Cannot have two complex operations in an integrable formula"),f.constant(0)):(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner?this.internalIntegrateInner.call(this,t,...this.inputs):this.internalIntegrate?this.internalIntegrate.call(this,t,...this.inputs):this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable()?this:(console.error("Cannot integrate formula without variable"),f.constant(0)))}}function ji(e,t,n=!0,r,i=o.dInf){const a=_e(n),u=_e(r),l=_e(i);return w(()=>{var b,v,k,C;const c=s(l);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const p=s(a),h=(b=s(u))!=null?b:p?10:0;let g=0;if(o.gt(c,h)){if(!e.isInvertible())return console.error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum"),0;if(p){if(!e.isIntegralInvertible())return console.error("Cannot calculate max affordable of formula with non-invertible integral"),0;g=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((v=s(e.innermostVariable))!=null?v:0)}else g=o.floor(e.invert(t.value))}if(g=o.clampMax(g,c),h>0){const $=g;g=o.sub(g,h).clampMin(0);let x;for(p?x=sn(e,g,!0,0):x=e.evaluate(o.add((k=s(e.innermostVariable))!=null?k:0,g));o.lt(g,c)&&o.lt(g,Number.MAX_SAFE_INTEGER)&&o.add($,1).gte(g);){const I=e.evaluate(g.add((C=s(e.innermostVariable))!=null?C:0));if(o.add(x,I).lte(t.value))g=g.add(1),x=o.add(x,I);else break}}return g})}function sn(e,t,n=!0,r){var c;if(o.eq(t,1))return e.evaluate();const i=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,i);const u=a;r!=null||(r=n?10:0),a=a.sub(r).clampMin(i);let l=0;if(o.gt(t,r)){if(!e.isInvertible())return console.error("Cannot calculate cost with indirect sum of non-invertible formula"),0;if(n){if(!e.isIntegrable())return console.error("Cannot calculate cost with cumulative cost of non-integrable formula"),0;if(l=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),u.gt(1e308))return o.add(l,o.sub(u,a).times(e.evaluate(a)))}else if(l=e.evaluate(a),a=a.add(1),u.gt(1e308))return o.sub(u,a).add(1).times(l)}for(let p=a.toNumber();pn.trim()).join(` -`))!=null?t:""}function hi(e,t){var n;o.isNaN(t)&&(Fe.hasNaN||(Y.autosave=!1,Fe.hasNaN=!0,Fe.NaNPath=e[yn],Fe.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[yn])==null?void 0:n.join(".")}`)),e[on].value=t}function ct(e,t=!0){const n=Ve(e)?e:G(e);Ve(e)&&(e=e.value);const r=w({get(){return n.value},set(a){t?hi(i,a):i[on].value=a}});r[Kt]=e;const i={get value(){return n.value},set value(a){t?hi(i,a):i[on].value=a},__v_isRef:!0,[on]:n,[Kt]:e,[fr]:Al(),[gr]:!1,[Ot]:r,[yn]:void 0};return ft.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,` -Created at: -`+i[fr]):wn[ft[ft.length-1]].add(i),i}function Rl(e){return e!=null&&typeof e=="object"&&on in e}function In(e){return!(an in e)&&Ot in e?e[Ot]:new Proxy(e,{get(t,n){if(n!==on)return n===Kn?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===on?!1:n==Kn?!0:Reflect.has(t,n)}})}function zi(e){ft.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):wn[ft[ft.length-1]].delete(e),e[gr]=!0}Qe.on("addLayer",(e,t)=>{const n=[],r=(i,a=[])=>{let u=!1;return Object.keys(i).forEach(l=>{let c=i[l];if(c!=null&&typeof c=="object"){if(c[Kn]===!0)return;if(an in c&&(c=c[an]),Rl(c)){if(u=!0,c[gr]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` -Created at: -`+c[fr]);return}wn[e.id].delete(c);const p=[e.id,...a,l];c[yn]!=null&&JSON.stringify(p)!==JSON.stringify(c[yn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[yn].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[yn]=p;const h=a.reduce((b,v)=>(v in b||(b[v]={}),b[v]),t),g=h[l];h[l]=c[on],pa(h)?g!=null?h[l]=g:h[l]=c[Kt]:g!=null?h[l].value=g:h[l].value=c[Kt]}else!(c instanceof o)&&!(c instanceof f)&&!Ve(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...a,l])&&(Bt(c)&&!Bt(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",an in i?i[an]:i,l):u=!0))}}),u};r(e[an]),wn[e.id].forEach(i=>{i[gr]||console.error(`Created persistent ref in ${e.id} without registering it to the layer!`,`Make sure to include everything persistent in the returned object. - -Created at: -`+i[fr])}),wn[e.id].clear()});const Yr=Symbol("RegisterNode"),Zr=Symbol("UnregisterNode"),Xr=Symbol("Nodes"),Jr=Symbol("Bounds"),ge=Lr({});window.layers=ge;const wn={},ft=[];function Kr(e,t){return et(()=>{const n={},r=n.emitter=Ii();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=G({}),n.id=e,ft.push(e),wn[e]=new Set,n.minimized=ct(!1,!1),Object.assign(n,t.call(n,n)),ft[ft.length-1]==null||ft[ft.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen -Stack: ${ft} -Trying to pop ${n.id}`);ft.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),oe(n,"name",n.id),A(n,"minWidth"),oe(n,"minWidth",600),A(n,"minimizable"),oe(n,"minimizable",!0),A(n,"minimizedDisplay");const i=n.style;return n.style=w(()=>{var u,l;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(u=s(i))!=null?u:"",(l=n.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Qr(e,t){if(console.info("Adding layer",e.id),ge[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ge[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ge[e.id]=e,Qe.emit("addLayer",e,t.layers[e.id])}function El(e){return ge[e]}function ei(e){console.info("Removing layer",e.id),Qe.emit("removeLayer",e),ge[e.id]=void 0}function Fl(e){ei(e),Qr(e,Y)}function Ol(e){const t=G(!1);return{openModal:()=>t.value=!0,modal:j(()=>d(Lt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[s(e.name)]),body:s(e.display)}))}}Qe.on("update",function(t){Object.values(ge).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ql=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Yr,UnregisterNodeInjectionKey:Zr,NodesInjectionKey:Xr,BoundsInjectionKey:Jr,layers:ge,persistentRefs:wn,addingLayers:ft,createLayer:Kr,addLayer:Qr,getLayer:El,removeLayer:ei,reloadLayer:Fl,setupLayerModal:Ol},Symbol.toStringTag,{value:"Module"}));const Vl=X({components:{Context:Bi,ErrorVue:xi},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=Ae(e),a=Hr(t),u=Rn(i),l=w(()=>ve.allowGoBack&&n.value>0&&!Pe(r));function c(){Y.tabs.splice(s(e.index),1/0)}function p(g){e.nodes.value=g}const h=G([]);return fa((g,b,v)=>(console.warn(`Error caught in "${e.name}" layer`,g,b,v),h.value.push(g instanceof Error?g:new Error(JSON.stringify(g))),!1)),{component:a,minimizedComponent:u,showGoBack:l,updateNodes:p,unref:s,goBack:c,errors:h}}}),Bl={key:1};function Ll(e,t,n,r,i,a){const u=Ct("ErrorVue"),l=Ct("Context");return e.errors.length>0?(S(),re(u,{key:0,errors:e.errors},null,8,["errors"])):(S(),T("div",Vt({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(S(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):B("",!0),e.unref(e.minimized)?(S(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),re(Ke(e.minimizedComponent),{key:0})):(S(),T("div",Bl,ee(e.unref(e.name)),1))])):(S(),T("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[d(l,{onUpdateNodes:e.updateNodes},{default:H(()=>[(S(),re(Ke(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],16))}var jl=be(Vl,[["render",Ll],["__scopeId","data-v-a9f5b1da"]]);const Gi=e=>(cn("data-v-4b4bda40"),e=e(),dn(),e),zl=Gi(()=>N("h2",null,"Changelog",-1)),Gl=Gi(()=>N("details",{open:""},[N("summary",null,[y("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),y(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ul=X({__name:"Changelog",setup(e,{expose:t}){const n=G(!1);return t({open(){n.value=!0}}),(r,i)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a)},{header:H(()=>[zl]),body:H(()=>[Gl]),_:1},8,["modelValue"]))}});var Wl=be(Ul,[["__scopeId","data-v-4b4bda40"]]),Hl=X({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),direction:q(String),xoffset:q(String),yoffset:q(String),pinned:Object},setup(e){const{element:t,display:n,pinned:r}=Ae(e),i=G(!1),a=w(()=>(Pe(r)||i.value)&&u.value),u=Rn(n),l=_t(fe(j(()=>{const h=Pe(t);return h==null?"":mt(h)})));function c(h){const g=r;h.shiftKey&&g&&(g.value=!g.value,h.stopPropagation(),h.preventDefault())}const p=w(()=>Pe(r)&&It[ie.theme].showPin);return{Direction:W,isHovered:i,isShown:a,comp:u,elementComp:l,unref:s,togglePinned:c,showPin:p}}});const Yl={key:0,class:"material-icons pinned"};function Zl(e,t,n,r,i,a){return S(),T("div",{class:Ne(["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))},[qt(e.$slots,"default",{},void 0,!0),e.elementComp?(S(),re(Ke(e.elementComp),{key:0})):B("",!0),d(Wn,{name:"fade"},{default:H(()=>{var u;return[e.isShown?(S(),T("div",{key:0,class:Ne(["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?(S(),T("span",Yl,"push_pin")):B("",!0),e.comp?(S(),re(Ke(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var qe=be(Hl,[["render",Zl],["__scopeId","data-v-6102fa3a"]]);const Nn=e=>(cn("data-v-4f97aa40"),e=e(),dn(),e),Xl={class:"info-modal-header"},Jl=["src","alt"],Kl={class:"info-modal-title"},Ql={key:0},eu={key:0},tu={key:0},nu=Nn(()=>N("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),ru=Nn(()=>N("br",null,null,-1)),iu=Nn(()=>N("br",null,null,-1)),au=["href"],su=Nn(()=>N("span",{class:"material-icons info-modal-discord"},"discord",-1)),ou=Nn(()=>N("div",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),y(" The Paper Pilot Community ")])],-1)),lu=Nn(()=>N("div",null,[N("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),y(" The Modding Tree ")])],-1)),uu=Nn(()=>N("br",null,null,-1));var cu=X({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:r,logo:i,author:a,discordName:u,discordLink:l,versionNumber:c,versionTitle:p}=ve,h=Ae(n),g=G(!1),b=w(()=>yr(Y.timePlayed)),v=w(()=>fe(j(()=>d(ne,null,[Gs.map(ot)]))));t({open(){g.value=!0}});function k(){var C;(C=s(h.changelog))==null||C.open()}return(C,$)=>(S(),re(Lt,{modelValue:g.value,"onUpdate:modelValue":$[0]||($[0]=x=>g.value=x)},{header:H(()=>[N("div",Xl,[s(i)?(S(),T("img",{key:0,class:"info-modal-logo",src:s(i),alt:s(r)},null,8,Jl)):B("",!0),N("div",Kl,[N("h2",null,ee(s(r)),1),N("h4",null,[y(" v"+ee(s(c)),1),s(p)?(S(),T("span",Ql,": "+ee(s(p)),1)):B("",!0)])])])]),body:H(({shown:x})=>[x?(S(),T("div",eu,[s(a)?(S(),T("div",tu,"By "+ee(s(a)),1)):B("",!0),nu,ru,N("div",{class:"link",onClick:k},"Changelog"),iu,N("div",null,[s(l)?(S(),T("a",{key:0,href:s(l),class:"info-modal-discord-link",target:"_blank"},[su,y(" "+ee(s(u)),1)],8,au)):B("",!0)]),ou,lu,uu,N("div",null,"Time Played: "+ee(s(b)),1),(S(),re(Ke(s(v))))])):B("",!0)]),_:1},8,["modelValue"]))}});var du=be(cu,[["__scopeId","data-v-4f97aa40"]]);const pu={class:"field"},fu={key:0,class:"field-title"},ti=X({__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,r=Rn(Jt(n,"title"),"span"),i=G((u=n.options.find(l=>l.value===n.modelValue))!=null?u:null);wt(Jt(n,"modelValue"),l=>{var c;Pe(i)!==l&&(i.value=(c=n.options.find(p=>p.value===l))!=null?c:null)});function a(l){t("update:modelValue",l.value)}return(l,c)=>(S(),T("div",pu,[s(r)?(S(),T("span",fu,[(S(),re(Ke(s(r))))])):B("",!0),d(s(ya),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[c[0]||(c[0]=p=>i.value=p),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const gu={class:"field"},mu=X({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=w(()=>{var a;return fe((a=s(n.title))!=null?a:"","span")}),i=w({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,u)=>(S(),T("label",gu,[jr(N("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":u[0]||(u[0]=l=>Ve(i)?i.value=l:null)},null,512),[[ga,s(i)]]),(S(),re(Ke(s(r))))]))}});var $t=be(mu,[["__scopeId","data-v-11046116"]]);const vu={class:"header"},hu=N("h2",null,"Settings",-1),bu={class:"option-tabs"},yu={key:0},wu={key:1};var _u=X({__name:"Options",setup(e,{expose:t}){const n=G(!1),r=G("behaviour");function i(le){return le==r.value}function a(le){r.value=le}t({isTab:i,setTab:a,save:bt,open(){n.value=!0}});const u=Object.keys(It).map(le=>({label:st(le),value:le})),l=w(()=>fe(j(()=>d(ne,null,[Fi.map(ot)])))),{showTPS:c,theme:p,unthrottled:h,alignUnits:g}=Ae(ie),{autosave:b,offlineProd:v}=Ae(Y),k=w({get(){return Y.devSpeed===0},set(le){Y.devSpeed=le?0:null}}),C=j(()=>d("span",{class:"option-title"},[y("Unthrottled"),d("desc",null,[y("Allow the game to run as fast as possible. Not battery friendly.")])])),$=j(()=>d("span",{class:"option-title"},[y("Offline Production"),d(qe,{display:"Save-specific",direction:W.Right},{default:()=>[y("*")]}),d("desc",null,[y("Simulate production that occurs while the game is closed.")])])),x=j(()=>d("span",{class:"option-title"},[y("Autosave"),d(qe,{display:"Save-specific",direction:W.Right},{default:()=>[y("*")]}),d("desc",null,[y("Automatically save the game every second or when the game is closed.")])])),I=j(()=>d("span",{class:"option-title"},[y("Pause game"),d(qe,{display:"Save-specific",direction:W.Right},{default:()=>[y("*")]}),d("desc",null,[y("Stop everything from moving.")])])),R=j(()=>d("span",{class:"option-title"},[y("Theme"),d("desc",null,[y("How the game looks.")])])),L=j(()=>d("span",{class:"option-title"},[y("Show TPS"),d("desc",null,[y("Show TPS meter at the bottom-left corner of the page.")])])),ce=j(()=>d("span",{class:"option-title"},[y("Align modifier units"),d("desc",null,[y("Align numbers to the beginning of the unit in modifier view.")])]));return(le,ae)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":ae[10]||(ae[10]=J=>n.value=J)},{header:H(()=>[N("div",vu,[hu,N("div",bu,[N("button",{class:Ne({selected:i("behaviour")}),onClick:ae[0]||(ae[0]=J=>a("behaviour"))},"Behaviour",2),N("button",{class:Ne({selected:i("appearance")}),onClick:ae[1]||(ae[1]=J=>a("appearance"))},"Appearance",2)])])]),body:H(()=>[i("behaviour")?(S(),T("div",yu,[d($t,{title:s(C),modelValue:s(h),"onUpdate:modelValue":ae[2]||(ae[2]=J=>Ve(h)?h.value=J:null)},null,8,["title","modelValue"]),s(ve).enablePausing?(S(),re($t,{key:0,title:s(I),modelValue:s(k),"onUpdate:modelValue":ae[3]||(ae[3]=J=>Ve(k)?k.value=J:null)},null,8,["title","modelValue"])):B("",!0),d($t,{title:s($),modelValue:s(v),"onUpdate:modelValue":ae[4]||(ae[4]=J=>Ve(v)?v.value=J:null)},null,8,["title","modelValue"]),d($t,{title:s(x),modelValue:s(b),"onUpdate:modelValue":ae[5]||(ae[5]=J=>Ve(b)?b.value=J:null)},null,8,["title","modelValue"]),s(b)?B("",!0):(S(),re(Gr,{key:1,class:"button save-button",onClick:ae[6]||(ae[6]=J=>s(bt)())},{default:H(()=>[y("Manually save")]),_:1}))])):B("",!0),i("appearance")?(S(),T("div",wu,[d(ti,{title:s(R),options:s(u),modelValue:s(p),"onUpdate:modelValue":ae[7]||(ae[7]=J=>Ve(p)?p.value=J:null)},null,8,["title","options","modelValue"]),(S(),re(Ke(s(l)))),d($t,{title:s(L),modelValue:s(c),"onUpdate:modelValue":ae[8]||(ae[8]=J=>Ve(c)?c.value=J:null)},null,8,["title","modelValue"]),d($t,{title:s(ce),modelValue:s(g),"onUpdate:modelValue":ae[9]||(ae[9]=J=>Ve(g)?g.value=J:null)},null,8,["title","modelValue"])])):B("",!0)]),_:1},8,["modelValue"]))}});const Nu=["onSubmit"],Cu={class:"field"},ku={key:0,class:"field-title"},Su=["placeholder"],Mu=X({__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,r=Rn(Jt(n,"title"),"span"),i=_t(null);Qn(()=>{var c;(c=i.value)==null||c.focus()});const a=w({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function u(){t("submit")}function l(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,p)=>(S(),T("form",{onSubmit:Pn(u,["prevent"])},[N("div",Cu,[s(r)?(S(),T("span",ku,[(S(),re(Ke(s(r))))])):B("",!0),e.textArea?(S(),re(s(_a),{key:1,modelValue:s(a),"onUpdate:modelValue":p[0]||(p[0]=h=>Ve(a)?a.value=h:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:l,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):jr((S(),T("input",{key:2,type:"text","onUpdate:modelValue":p[1]||(p[1]=h=>Ve(a)?a.value=h:null),placeholder:e.placeholder,class:Ne({fullWidth:!e.title}),onBlur:l,ref_key:"field",ref:i},null,42,Su)),[[ma,s(a)]])])],40,Nu))}});var Ui=be(Mu,[["__scopeId","data-v-90bd4994"]]);const Iu={key:0},xu=["onClick","disabled"],$u={key:0},Du=["onClick"],Tu=X({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const r=Ae(e),i=G(!1);wt(i,l=>{t("confirmingChanged",l)});function a(){if(s(r.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function u(){i.value=!1}return(l,c)=>(S(),T("span",{class:Ne(["container",{confirming:i.value}])},[i.value?(S(),T("span",Iu,"Are you sure?")):B("",!0),N("button",{onClick:Pn(a,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(S(),T("span",$u,"Yes")):qt(l.$slots,"default",{key:1},void 0,!0)],8,xu),i.value?(S(),T("button",{key:1,class:"button",onClick:Pn(u,["stop"])},"No",8,Du)):B("",!0)],2))}});var Pu=be(Tu,[["__scopeId","data-v-2f8ef34c"]]);const en=e=>(cn("data-v-32313015"),e=e(),dn(),e),Au=en(()=>N("div",{class:"handle material-icons"},"drag_handle",-1)),Ru={key:0,class:"actions"},Eu=en(()=>N("span",{class:"material-icons"},"content_paste",-1)),Fu=en(()=>N("span",{class:"material-icons"},"content_copy",-1)),Ou=en(()=>N("span",{class:"material-icons"},"edit",-1)),qu=en(()=>N("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Vu={key:1,class:"actions"},Bu=en(()=>N("span",{class:"material-icons"},"check",-1)),Lu=en(()=>N("span",{class:"material-icons"},"close",-1)),ju={key:2,class:"details"},zu={class:"save-version"},Gu=en(()=>N("br",null,null,-1)),Uu={key:0},Wu={key:3,class:"details"},Hu={key:4,class:"details error"},Yu=en(()=>N("br",null,null,-1)),Zu=X({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:r}=Ae(n),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=G(!1),u=G(!1),l=G("");wt(a,()=>{var g;return l.value=(g=r.value.name)!=null?g:""});const c=w(()=>r.value!=null&&r.value.id===Y.id),p=w(()=>{var g;return c.value?Y.time:(g=r.value!=null&&r.value.time)!=null?g:0});function h(){t("editName",l.value),a.value=!1}return(g,b)=>(S(),T("div",{class:Ne(["save",{active:s(c)}])},[Au,a.value?(S(),T("div",Vu,[N("button",{onClick:h,class:"button"},[d(qe,{display:"Save",direction:s(W).Left,class:"info"},{default:H(()=>[Bu]),_:1},8,["direction"])]),N("button",{onClick:b[5]||(b[5]=v=>a.value=!a.value),class:"button"},[d(qe,{display:"Cancel",direction:s(W).Left,class:"info"},{default:H(()=>[Lu]),_:1},8,["direction"])])])):(S(),T("div",Ru,[s(r).error==null&&!u.value?(S(),re(Gr,{key:0,onClick:b[0]||(b[0]=v=>t("export")),class:"button",left:""},{default:H(()=>[d(qe,{display:"Export",direction:s(W).Left,class:"info"},{default:H(()=>[Eu]),_:1},8,["direction"])]),_:1})):B("",!0),s(r).error==null&&!u.value?(S(),T("button",{key:1,onClick:b[1]||(b[1]=v=>t("duplicate")),class:"button"},[d(qe,{display:"Duplicate",direction:s(W).Left,class:"info"},{default:H(()=>[Fu]),_:1},8,["direction"])])):B("",!0),s(r).error==null&&!u.value?(S(),T("button",{key:2,onClick:b[2]||(b[2]=v=>a.value=!a.value),class:"button"},[d(qe,{display:"Edit Name",direction:s(W).Left,class:"info"},{default:H(()=>[Ou]),_:1},8,["direction"])])):B("",!0),d(Pu,{disabled:s(c),onClick:b[3]||(b[3]=v=>t("delete")),onConfirmingChanged:b[4]||(b[4]=v=>u.value=v)},{default:H(()=>[d(qe,{display:"Delete",direction:s(W).Left,class:"info"},{default:H(()=>[qu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(r).error==null&&!a.value?(S(),T("div",ju,[N("button",{class:"button open",onClick:b[6]||(b[6]=v=>t("open"))},[N("h3",null,ee(s(r).name),1)]),N("span",zu,"v"+ee(s(r).modVersion),1),Gu,s(p)?(S(),T("div",Uu,"Last played "+ee(s(i).format(s(p))),1)):B("",!0)])):s(r).error==null&&a.value?(S(),T("div",Wu,[d(Ui,{modelValue:l.value,"onUpdate:modelValue":b[7]||(b[7]=v=>l.value=v),class:"editname",onSubmit:h},null,8,["modelValue"])])):(S(),T("div",Hu,[y(" Error: Failed to load save with id "+ee(s(r).id),1),Yu,y(ee(s(r).error),1)]))],2))}});var Xu=be(Zu,[["__scopeId","data-v-32313015"]]);const ni=e=>(cn("data-v-2a4275be"),e=e(),dn(),e),Ju=ni(()=>N("h2",null,"Saves Manager",-1)),Ku={class:"modal-footer"},Qu={class:"field"},ec=ni(()=>N("span",{class:"field-title"},"Create Save",-1)),tc={class:"field-buttons"},nc={class:"footer"},rc=ni(()=>N("div",{style:{"flex-grow":"1"}},null,-1)),ic=X({__name:"SavesManager",setup(e,{expose:t}){const n=G(!1),r=G(null);t({open(){n.value=!0}});const i=G(!1),a=G(""),u=G(null);wt(a,I=>{I?Xt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Yt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),i.value=!0;return}const R=JSON.parse(I);if(typeof R!="object"){i.value=!0;return}const L=cr();R.id=L,bt(R),a.value="",i.value=!1,ie.saves.push(L)}catch{i.value=!0}}):i.value=!1});let l={},c=G(Object.keys(l).reduce((I,R)=>(I.push({label:R.split("/").slice(-1)[0].slice(0,-4),value:l[R]}),I),[]));const p=Lr({});function h(I){if(p[I]==null){let R=localStorage.getItem(I);if(R==null)p[I]={error:"Save doesn't exist in localStorage",id:I};else if(R==="dW5kZWZpbmVk")p[I]={error:"Save is undefined",id:I};else try{if(R[0]!=="{")if(R[0]==="e")R=decodeURIComponent(escape(atob(R)));else if(R[0]==="\u1BE1")R=Yt.decompressFromUTF16(R);else return console.warn("Unable to determine preset encoding",R),i.value=!0,p[I]={error:"Unable to determine preset encoding",id:I},p[I];p[I]={...JSON.parse(R),id:I}}catch(L){p[I]={error:L,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}: -${L} -${R}`)}}return p[I]}wt(n,I=>{I&&Object.keys(p).forEach(R=>delete p[R])});const g=w(()=>ie.saves.reduce((I,R)=>(I[R]=h(R),I),{}));function b(I){let R;switch(Y.id===I?R=zr(Y):R=JSON.stringify(g.value[I]),ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":R=Yt.compressToUTF16(R);break;case"base64":R=btoa(unescape(encodeURIComponent(R)));break;case"plain":break}const L=document.createElement("textarea");L.value=R,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function v(I){Y.id===I&&bt();const R={...g.value[I],id:cr()};bt(R),ie.saves.push(R.id)}function k(I){ie.saves=ie.saves.filter(R=>R!==I),localStorage.removeItem(I),p[I]=void 0}function C(I){g.value[Y.id].time=Y.time,bt(),p[Y.id]=void 0,bn(g.value[I]),p[I]=void 0}function $(I){if(u.value=I,Xt(()=>{u.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Yt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const R=JSON.parse(I);R.id=cr(),bt(R),ie.saves.push(R.id),C(R.id)}function x(I,R){const L=g.value[I];L!=null&&(L.name=R,Y.id===I?(Y.name=R,bt()):(bt(L),p[I]=void 0))}return(I,R)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":R[4]||(R[4]=L=>n.value=L),ref_key:"modal",ref:r},{header:H(()=>[Ju]),body:H(({shown:L})=>[L?(S(),re(s(wa),{key:0,list:s(ie).saves,handle:".handle",itemKey:ce=>ce},{item:H(({element:ce})=>[d(Xu,{save:s(g)[ce],onOpen:le=>C(ce),onExport:le=>b(ce),onEditName:le=>x(ce,le),onDuplicate:le=>v(ce),onDelete:le=>k(ce)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[N("div",Ku,[d(Ui,{modelValue:a.value,"onUpdate:modelValue":R[0]||(R[0]=L=>a.value=L),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:i.value})},null,8,["modelValue","class"]),N("div",Qu,[ec,N("div",tc,[N("button",{class:"button",onClick:R[1]||(R[1]=L=>C(s(Tn)().id))},"New Game"),Object.keys(s(c)).length>0?(S(),re(ti,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":R[2]||(R[2]=L=>$(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),N("div",nc,[rc,N("button",{class:"button modal-default-button",onClick:R[3]||(R[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Wi=be(ic,[["__scopeId","data-v-2a4275be"]]);const kt=e=>(cn("data-v-318a1c31"),e=e(),dn(),e),ac=["src","alt"],sc={key:1,class:"title"},oc=kt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),lc={class:"discord"},uc={class:"discord-links"},cc={key:0},dc=["href"],pc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),fc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),gc={href:"https://forums.moddingtree.com/",target:"_blank"},mc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),vc=kt(()=>N("span",{class:"material-icons"},"info",-1)),hc=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),bc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),yc=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),wc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),_c=kt(()=>N("span",{class:"material-icons"},"info",-1)),Nc={href:"https://forums.moddingtree.com/",target:"_blank"},Cc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),kc={class:"discord"},Sc={class:"discord-links"},Mc={key:0},Ic=["href"],xc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),$c=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Dc=X({__name:"Nav",setup(e){const t=G(null),n=G(null),r=G(null),i=G(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:p,versionNumber:h}=ve;function g(){window.open(p,"mywindow")}return(b,v)=>(S(),T(ne,null,[s(a)?(S(),T("div",Vt({key:0,class:"nav"},b.$attrs),[s(u)?(S(),T("img",{key:0,src:s(u),class:"banner",alt:s(l)},null,8,ac)):(S(),T("div",sc,ee(s(l)),1)),N("div",{onClick:v[0]||(v[0]=k=>{var C;return(C=i.value)==null?void 0:C.open()}),class:"version-container"},[d(qe,{display:"Changelog",direction:s(W).Down,class:"version"},{default:H(()=>[N("span",null,"v"+ee(s(h)),1)]),_:1},8,["direction"])]),oc,N("div",lc,[N("span",{onClick:g,class:"material-icons"},"discord"),N("ul",uc,[s(p)?(S(),T("li",cc,[N("a",{href:s(p),target:"_blank"},ee(s(c)),9,dc)])):B("",!0),pc,fc])]),N("div",null,[N("a",gc,[d(qe,{display:"Forums",direction:s(W).Down,yoffset:"5px"},{default:H(()=>[mc]),_:1},8,["direction"])])]),N("div",{onClick:v[1]||(v[1]=k=>{var C;return(C=t.value)==null?void 0:C.open()})},[d(qe,{display:"Info",direction:s(W).Down,class:"info"},{default:H(()=>[vc]),_:1},8,["direction"])]),N("div",{onClick:v[2]||(v[2]=k=>{var C;return(C=n.value)==null?void 0:C.open()})},[d(qe,{display:"Saves",direction:s(W).Down,xoffset:"-20px"},{default:H(()=>[hc]),_:1},8,["direction"])]),N("div",{onClick:v[3]||(v[3]=k=>{var C;return(C=r.value)==null?void 0:C.open()})},[d(qe,{display:"Settings",direction:s(W).Down,xoffset:"-66px"},{default:H(()=>[bc]),_:1},8,["direction"])])],16)):(S(),T("div",Vt({key:1,class:"overlay-nav"},b.$attrs),[N("div",{onClick:v[4]||(v[4]=k=>{var C;return(C=i.value)==null?void 0:C.open()}),class:"version-container"},[d(qe,{display:"Changelog",direction:s(W).Right,xoffset:"25%",class:"version"},{default:H(()=>[N("span",null,"v"+ee(s(h)),1)]),_:1},8,["direction"])]),N("div",{onClick:v[5]||(v[5]=k=>{var C;return(C=n.value)==null?void 0:C.open()})},[d(qe,{display:"Saves",direction:s(W).Right},{default:H(()=>[yc]),_:1},8,["direction"])]),N("div",{onClick:v[6]||(v[6]=k=>{var C;return(C=r.value)==null?void 0:C.open()})},[d(qe,{display:"Settings",direction:s(W).Right},{default:H(()=>[wc]),_:1},8,["direction"])]),N("div",{onClick:v[7]||(v[7]=k=>{var C;return(C=t.value)==null?void 0:C.open()})},[d(qe,{display:"Info",direction:s(W).Right},{default:H(()=>[_c]),_:1},8,["direction"])]),N("div",null,[N("a",Nc,[d(qe,{display:"Forums",direction:s(W).Right,xoffset:"7px"},{default:H(()=>[Cc]),_:1},8,["direction"])])]),N("div",kc,[N("span",{onClick:g,class:"material-icons"},"discord"),N("ul",Sc,[s(p)?(S(),T("li",Mc,[N("a",{href:s(p),target:"_blank"},ee(s(c)),9,Ic)])):B("",!0),xc,$c])])],16)),d(du,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),d(Wi,{ref_key:"savesManager",ref:n},null,512),d(_u,{ref_key:"options",ref:r},null,512),d(Wl,{ref_key:"changelog",ref:i},null,512)],64))}});var Hi=be(Dc,[["__scopeId","data-v-318a1c31"]]);const Tc={class:"inner-tab"},Pc=X({__name:"Game",setup(e){const t=Jt(Y,"tabs"),n=w(()=>Object.keys(ge)),r=ve.useHeader;function i(a){const{display:u,minimized:l,name:c,color:p,minimizable:h,nodes:g,minimizedDisplay:b}=a;return{display:u,minimized:l,name:c,color:p,minimizable:h,nodes:g,minimizedDisplay:b}}return(a,u)=>(S(),T("div",{class:Ne(["tabs-container",{useHeader:s(r)}])},[(S(!0),T(ne,null,Dt(s(t),(l,c)=>{var p,h;return S(),T("div",{key:c,class:Ne(["tab",s((p=s(ge)[l])==null?void 0:p.classes)]),style:Le(s((h=s(ge)[l])==null?void 0:h.style))},[c===0&&!s(r)?(S(),re(Hi,{key:0})):B("",!0),N("div",Tc,[s(n).includes(l)?(S(),re(jl,Vt({key:0},i(s(ge)[l]),{index:c,onSetMinimized:g=>s(ge)[l].minimized.value=g}),null,16,["index","onSetMinimized"])):(S(),re(Ke(l),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Ac=be(Pc,[["__scopeId","data-v-dcd207b4"]]);const Rc=X({__name:"Sticky",setup(e){const t=G("0"),n=new ResizeObserver(i),r=_t(null);function i(){let a=r.value;if(a==null)return;let u=0;for(;a.previousSibling;){const l=a.previousSibling;l.dataset&&"vSticky"in l.dataset&&(u+=l.offsetHeight),a=l}t.value=u+"px"}return Xt(i),document.fonts.ready.then(i),Qn(()=>{var u;const a=(u=r.value)==null?void 0:u.parentElement;a&&n.observe(a)}),(a,u)=>(S(),T("div",{class:"sticky",style:Le({top:t.value}),ref_key:"element",ref:r,"data-v-sticky":""},[qt(a.$slots,"default",{},void 0,!0)],4))}});var mr=be(Rc,[["__scopeId","data-v-cccac690"]]);const Ec=["x1","y1","x2","y2"],Fc=X({__name:"BoardLink",props:{link:null,dragging:null,dragged:null},setup(e){const n=Ae(e),r=w(()=>{var u,l,c,p,h,g,b;const a={...n.link.value.startNode.position};return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),((u=n.dragging)==null?void 0:u.value)===n.link.value.startNode&&(a.x+=(p=(c=(l=n.dragged)==null?void 0:l.value)==null?void 0:c.x)!=null?p:0,a.y+=(b=(g=(h=n.dragged)==null?void 0:h.value)==null?void 0:g.y)!=null?b:0),a}),i=w(()=>{var u,l,c,p,h,g,b;const a={...n.link.value.endNode.position};return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),((u=n.dragging)==null?void 0:u.value)===n.link.value.endNode&&(a.x+=(p=(c=(l=n.dragged)==null?void 0:l.value)==null?void 0:c.x)!=null?p:0,a.y+=(b=(g=(h=n.dragged)==null?void 0:h.value)==null?void 0:g.y)!=null?b:0),a});return(a,u)=>(S(),T("line",Vt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(r).x,y1:s(r).y,x2:s(i).x,y2:s(i).y}),null,16,Ec))}});var Oc=be(Fc,[["__scopeId","data-v-58e8d695"]]);const qc={key:0},Vc=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],Bc=["fill","stroke-width","stroke"],Lc=["fill"],jc=X({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const r=Ae(e),i=w(()=>pe(r.nodeType.value.size,s(r.node))),a=w(()=>{var h;return(h=pe(r.nodeType.value.outlineColor,s(r.node)))!=null?h:It[ie.theme].variables["--outline"]}),u=w(()=>{var h;return(h=pe(r.nodeType.value.titleColor,s(r.node)))!=null?h:It[ie.theme].variables["--foreground"]}),l=w(()=>pe(r.nodeType.value.actionDistance,s(r.node)));function c(h,g){t("clickAction",g.id),h.preventDefault(),h.stopPropagation()}function p(h,g){var b;((b=s(r.selectedAction))==null?void 0:b.id)===g.id&&(h.preventDefault(),h.stopPropagation())}return(h,g)=>(S(),re(Wn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(S(),T("g",qc,[(S(!0),T(ne,null,Dt(e.actions,(b,v)=>{var k,C;return S(),T("g",{key:b.id,class:Ne(["action",{selected:((k=e.selectedAction)==null?void 0:k.id)===b.id}]),transform:`translate( - ${(-s(i)-30)*Math.sin(((e.actions.length-1)/2-v)*s(l))}, - ${(s(i)+30)*Math.cos(((e.actions.length-1)/2-v)*s(l))} - )`,onMousedown:$=>c($,b),onTouchstart:$=>c($,b),onMouseup:$=>p($,b),onTouchend:Pn($=>p($,b),["stop"])},[N("circle",{fill:s(pe)(b.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===b.id?4:0,stroke:s(a)},null,8,Bc),N("text",{fill:s(u),class:"material-icons"},ee(s(pe)(b.icon,e.node)),9,Lc)],42,Vc)}),128))])):B("",!0)]),_:1}))}});var zc=be(jc,[["__scopeId","data-v-9efb2a56"]]);const Gc=["transform"],Uc={key:0},Wc=["r","fill","stroke"],Hc=["r","fill","stroke"],Yc=["r","fill"],Zc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Xc=["fill","transform"],Jc={key:1,transform:"rotate(45, 0, 0)"},Kc=["width","height","transform","fill","stroke"],Qc=["width","height","transform","fill","stroke"],ed=["width","height","transform","fill"],td=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],nd=["fill","y"],rd=["fill"],id=["fill","y"],ad={key:0},sd=["fill","y"],od=["fill","y"],ld=X({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,r=Math.sqrt(2),i=Ae(n),a=w(()=>pe(i.nodeType.value.draggable,s(i.node)));wt(a,K=>{const $e=s(i.node);s(i.dragging)===$e&&!K&&t("endDragging",$e)});const u=w(()=>{var $e;const K=s(i.node);return($e=pe(i.nodeType.value.actions,K))==null?void 0:$e.filter(nt=>Ze(pe(nt.visibility,K)))}),l=w(()=>{var $e;const K=s(i.node);if(pe(i.nodeType.value.draggable,K)&&(($e=s(i.dragging))==null?void 0:$e.id)===K.id&&s(i.dragged)!=null){const{x:nt,y:ht}=s(i.dragged);return{x:K.position.x+Math.round(nt/25)*25,y:K.position.y+Math.round(ht/25)*25}}return K.position}),c=w(()=>pe(i.nodeType.value.shape,s(i.node))),p=w(()=>pe(i.nodeType.value.title,s(i.node))),h=w(()=>pe(i.nodeType.value.otherSubtitle,s(i.node))),g=w(()=>{var K;return(K=i.isSelected.value?s(i.selectedAction)&&pe(s(i.selectedAction).tooltip,s(i.node)):null)!=null?K:pe(i.nodeType.value.label,s(i.node))}),b=w(()=>{var K,$e;return pe(($e=(K=s(i.selectedAction))==null?void 0:K.confirmationLabel)!=null?$e:{text:"Tap again to confirm"},s(i.node))}),v=w(()=>pe(i.nodeType.value.size,s(i.node))),k=w(()=>{var K;return(K=pe(i.nodeType.value.progress,s(i.node)))!=null?K:0}),C=w(()=>It[ie.theme].variables["--background"]),$=w(()=>{var K;return(K=pe(i.nodeType.value.outlineColor,s(i.node)))!=null?K:It[ie.theme].variables["--outline"]}),x=w(()=>{var K;return(K=pe(i.nodeType.value.fillColor,s(i.node)))!=null?K:It[ie.theme].variables["--raised-background"]}),I=w(()=>pe(i.nodeType.value.progressColor,s(i.node))),R=w(()=>{var K;return(K=pe(i.nodeType.value.titleColor,s(i.node)))!=null?K:It[ie.theme].variables["--foreground"]}),L=w(()=>pe(i.nodeType.value.progressDisplay,s(i.node))),ce=w(()=>i.dragging.value!=null&&s(i.hasDragged)&&pe(i.nodeType.value.canAccept,s(i.node),i.dragging.value)),le=w(()=>pe(i.nodeType.value.style,s(i.node))),ae=w(()=>pe(i.nodeType.value.classes,s(i.node)));function J(K){t("mouseDown",K,i.node.value,a.value)}function Ie(K){var $e,nt,ht;($e=i.hasDragged)!=null&&$e.value||(t("endDragging",i.node.value),(ht=(nt=i.nodeType.value).onClick)==null||ht.call(nt,i.node.value),K.stopPropagation())}const he=w(()=>pe(i.nodeType.value.subtitle,s(i.node))),Ue=w(()=>pe(i.nodeType.value.showStar,s(i.node))),vt=w(()=>pe(i.nodeType.value.fillStar,s(i.node)));return(K,$e)=>{var nt,ht,pt;return S(),T("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(ae)}]),style:Le([{opacity:((nt=e.dragging)==null?void 0:nt.id)===e.node.id&&e.hasDragged?.5:1},(ht=s(le))!=null?ht:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[d(zc,{actions:(pt=s(u))!=null?pt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:$e[0]||($e[0]=St=>t("clickAction",St))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:J,onTouchstartPassive:J,onMouseup:Ie,onTouchendPassive:Ie},[s(c)===s(Ge).Circle?(S(),T("g",Uc,[s(ce)?(S(),T("circle",{key:0,class:"receiver",r:s(v)+8,fill:s(C),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Wc)):B("",!0),N("circle",{class:"body",r:s(v),fill:s(x),stroke:s($),"stroke-width":4},null,8,Hc),s(L)===s(un).Fill?(S(),T("circle",{key:1,class:"progress progressFill",r:Math.max(s(v)*s(k)-2,0),fill:s(I)},null,8,Yc)):(S(),T("circle",{key:2,r:s(v)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(v)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(v)+4.5)*2*Math.PI-s(k)*(s(v)+4.5)*2*Math.PI,stroke:s(I)},null,8,Zc)),s(Ue)?(S(),T("path",{key:3,d:"m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z",stroke:"var(--bought)","stroke-width":4,fill:s(vt)?"var(--bought)":"none",transform:`translate(${-s(v)/4}, ${-s(v)-10}), scale(0.5)`},null,8,Xc)):B("",!0)])):s(c)===s(Ge).Diamond?(S(),T("g",Jc,[s(ce)?(S(),T("rect",{key:0,class:"receiver",width:s(v)*s(r)+16,height:s(v)*s(r)+16,transform:`translate(${-(s(v)*s(r)+16)/2}, ${-(s(v)*s(r)+16)/2})`,fill:s(C),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Kc)):B("",!0),N("rect",{class:"body",width:s(v)*s(r),height:s(v)*s(r),transform:`translate(${-s(v)*s(r)/2}, ${-s(v)*s(r)/2})`,fill:s(x),stroke:s($),"stroke-width":4},null,8,Qc),s(L)===s(un).Fill?(S(),T("rect",{key:1,class:"progress progressFill",width:Math.max(s(v)*s(r)*s(k)-2,0),height:Math.max(s(v)*s(r)*s(k)-2,0),transform:`translate(${-Math.max(s(v)*s(r)*s(k)-2,0)/2}, ${-Math.max(s(v)*s(r)*s(k)-2,0)/2})`,fill:s(I)},null,8,ed)):(S(),T("rect",{key:2,class:"progress progressDiamond",width:s(v)*s(r)+9,height:s(v)*s(r)+9,transform:`translate(${-(s(v)*s(r)+9)/2}, ${-(s(v)*s(r)+9)/2})`,fill:"transparent","stroke-dasharray":(s(v)*s(r)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(v)*s(r)+9)*4-s(k)*(s(v)*s(r)+9)*4,stroke:s(I)},null,8,td))])):B("",!0),N("text",{fill:s(R),class:"node-title",y:s(h)&&!s(he)?-10:0},ee(s(p)),9,nd),s(he)?(S(),T("text",{key:2,fill:s(R),class:"node-subtitle",y:"-25"},ee(s(he)),9,rd)):B("",!0),s(h)?(S(),T("text",{key:3,fill:s(R),class:"node-subtitle",y:s(he)?25:15},ee(s(h)),9,id)):B("",!0)],32),d(Wn,{name:"fade",appear:""},{default:H(()=>{var St;return[s(g)?(S(),T("g",ad,[N("text",{fill:(St=s(g).color)!=null?St:s(R),class:Ne(["node-title",{pulsing:s(g).pulsing}]),y:-s(v)-20},ee(s(g).text),11,sd)])):B("",!0)]}),_:1}),d(Wn,{name:"fade",appear:""},{default:H(()=>{var St;return[e.isSelected&&e.selectedAction?(S(),T("text",{key:0,fill:(St=s(b).color)!=null?St:s(R),class:Ne(["node-title",{pulsing:s(b).pulsing}]),y:s(v)+75},ee(s(b).text),11,od)):B("",!0)]}),_:1})],14,Gc)}}});var ud=be(ld,[["__scopeId","data-v-85b0e9a6"]]);const cd={class:"stage",width:"100%",height:"100%"},dd={class:"g1"},pd=X({__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=Ae(e),r=G({x:0,y:0}),i=G({x:0,y:0}),a=G(!1),u=G(null),l=w(()=>{const v=n.nodes.value.slice();if(n.selectedNode.value){const k=v.splice(v.indexOf(n.selectedNode.value),1)[0];v.push(k)}if(n.draggingNode.value){const k=v.splice(v.indexOf(n.draggingNode.value),1)[0];v.push(k)}return v});Pt(()=>{const v=n.draggingNode.value;if(v==null)return null;const k={x:v.position.x+i.value.x,y:v.position.y+i.value.y};let C=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce(($,x)=>{if(x.id===v.id)return $;const I=n.types.value[x.type];if(!pe(I.canAccept,x,v))return $;const L=Math.pow(k.x-x.position.x,2)+Math.pow(k.y-x.position.y,2);let ce=pe(I.size,x);return L>C||L>ce*ce?$:(C=L,x)},null))});function c(v){v.setTransformOrigin(null),v.moveTo(u.value.$el.clientWidth/2,u.value.$el.clientHeight/2)}function p(v,k=null,C=!1){if(n.draggingNode.value==null){v.preventDefault(),v.stopPropagation();let $,x;if("touches"in v)if(v.touches.length===1)$=v.touches[0].clientX,x=v.touches[0].clientY;else return;else $=v.clientX,x=v.clientY;r.value={x:$,y:x},i.value={x:0,y:0},a.value=!1,C&&n.setDraggingNode.value(k)}k!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(v){const{x:k,y:C,scale:$}=u.value.panZoomInstance.getTransform();let x,I;if("touches"in v)if(v.touches.length===1)x=v.touches[0].clientX,I=v.touches[0].clientY;else{g(n.draggingNode.value),n.mousePosition.value=null;return}else x=v.clientX,I=v.clientY;n.mousePosition.value={x:(x-k)/$,y:(I-C)/$},i.value={x:i.value.x+(x-r.value.x)/$,y:i.value.y+(I-r.value.y)/$},r.value={x,y:I},(Math.abs(i.value.x)>10||Math.abs(i.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(v.preventDefault(),v.stopPropagation())}function g(v,k=!1){var C,$;if(n.draggingNode.value!=null&&n.draggingNode.value===v){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(i.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(i.value.y/25)*25);const x=n.nodes.value;x.push(x.splice(x.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&(($=(C=n.types.value[n.receivingNode.value.type]).onDrop)==null||$.call(C,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!k&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(v,k){var $,x;const C=n.types.value[v.type];pe((x=($=C.actions)==null?void 0:$.find(I=>I.id===k))==null?void 0:x.confirmationLabel,v)==null&&(n.state.value.selectedAction=k),n.state.value.selectedAction===k?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:k}}return(v,k)=>{const C=Ct("panZoom");return s(Ze)(e.visibility)?(S(),re(C,{key:0,style:Le([{width:e.width,height:e.height},e.style]),class:Ne(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:u,onInit:c,onMousemove:h,onTouchmove:h,onMousedown:k[0]||(k[0]=$=>p($)),onTouchstart:k[1]||(k[1]=$=>p($)),onMouseup:k[2]||(k[2]=()=>g(s(e.draggingNode))),onTouchendPassive:k[3]||(k[3]=()=>g(s(e.draggingNode))),onMouseleave:k[4]||(k[4]=()=>g(s(e.draggingNode),!0))},{default:H(()=>[(S(),T("svg",cd,[N("g",dd,[d(ui,{name:"link",appear:""},{default:H(()=>[(S(!0),T(ne,null,Dt(s(e.links)||[],$=>(S(),T("g",{key:`${$.startNode.id}-${$.endNode.id}`},[d(Oc,{link:$,dragging:s(e.draggingNode),dragged:$.startNode===s(e.draggingNode)||$.endNode===s(e.draggingNode)?i.value:void 0},null,8,["link","dragging","dragged"])]))),128))]),_:1}),d(ui,{name:"grow",duration:500,appear:""},{default:H(()=>[(S(!0),T(ne,null,Dt(s(l),$=>(S(),T("g",{key:$.id,style:{"transition-duration":"0s"}},[d(ud,{node:$,nodeType:e.types[$.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===$?i.value:void 0,hasDragged:s(e.draggingNode)==null?!1:a.value,receivingNode:s(e.receivingNode)===$,isSelected:s(e.selectedNode)===$,selectedAction:s(e.selectedNode)===$?s(e.selectedAction):null,onMouseDown:p,onEndDragging:g,onClickAction:x=>b($,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});Qe.on("setupVue",e=>Na.install(e));const Yi=Symbol("Board");var un=(e=>(e.Outline="Outline",e.Fill="Fill",e))(un||{}),Ge=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ge||{});function fd(e){const t=ct({nodes:[],selectedNode:null,selectedAction:null},!1);return et(n=>{const r=e.call(n,n);r.id=Qt("board-"),r.type=Yi,r[gt]=pd,r.state?(zi(t),A(r,"state")):(t[Kt]={nodes:r.startNodes().map((l,c)=>(l.id=c,l)),selectedNode:null,selectedAction:null},r.state=t),r.nodes=w(()=>s(u.state).nodes),r.selectedNode=w({get(){return u.nodes.value.find(l=>l.id===s(u.state).selectedNode)||null},set(l){var c,p;Ve(u.state)?u.state.value={...u.state.value,selectedNode:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedNode=(p=l==null?void 0:l.id)!=null?p:null}}),r.selectedAction=w({get(){const l=u.selectedNode.value;if(l==null)return null;const c=u.types[l.type];return c.actions==null?null:c.actions.find(p=>p.id===s(u.state).selectedAction)||null},set(l){var c,p;Ve(u.state)?u.state.value={...u.state.value,selectedAction:(c=l==null?void 0:l.id)!=null?c:null}:u.state.selectedAction=(p=l==null?void 0:l.id)!=null?p:null}}),r.mousePosition=G(null),r.links?A(r,"links"):r.links=w(()=>u.selectedAction.value==null?null:u.selectedAction.value.links&&u.selectedNode.value?pe(u.selectedAction.value.links,u.selectedNode.value):null),r.draggingNode=G(null),r.receivingNode=G(null),A(r,"visibility"),oe(r,"visibility",Se.Visible),A(r,"width"),oe(r,"width","100%"),A(r,"height"),oe(r,"height","100%"),A(r,"classes"),A(r,"style");for(const l in r.types){const c=r.types[l];if(A(c,"title"),A(c,"subtitle"),A(c,"label"),A(c,"size"),oe(c,"size",50),A(c,"style"),A(c,"classes"),A(c,"draggable"),oe(c,"draggable",!1),A(c,"shape"),oe(c,"shape","Circle"),A(c,"canAccept"),oe(c,"canAccept",!1),A(c,"progress"),A(c,"progressDisplay"),oe(c,"progressDisplay","Fill"),A(c,"progressColor"),oe(c,"progressColor","none"),A(c,"fillColor"),A(c,"outlineColor"),A(c,"titleColor"),A(c,"actionDistance"),oe(c,"actionDistance",Math.PI/6),A(c,"otherSubtitle"),A(c,"showStar"),A(c,"fillStar"),c.nodes=w(()=>s(u.state).nodes.filter(p=>p.type===l)),oe(c,"onClick",function(p){s(u.state).selectedNode=p.id}),c.actions)for(const p of c.actions)A(p,"visibility"),oe(p,"visibility",Se.Visible),A(p,"icon"),A(p,"fillColor"),A(p,"tooltip"),A(p,"confirmationLabel"),oe(p,"confirmationLabel",{text:"Tap again to confirm"}),A(p,"links")}function i(l){r.draggingNode.value=l}function a(l){r.receivingNode.value=l}r.placeInAvailableSpace=function(l,c=100,p=W.Right){const h=u.nodes.value.slice().filter(g=>g===l||(p===W.Down||p===W.Up)&&Math.abs(g.position.x-l.position.x)>c||(p===W.Left||p===W.Right)&&Math.abs(g.position.y-l.position.y)>c?!1:!(p===W.Right&&g.position.xl.position.x+c||p===W.Up&&g.position.y>l.position.y+c||p===W.Down&&g.position.yg.position.x-b.position.x:p===W.Left?(g,b)=>b.position.x-g.position.x:p===W.Up?(g,b)=>b.position.y-g.position.y:(g,b)=>g.position.y-b.position.y);for(let g=0;g0&&v>c)break}},r[dt]=function(){const{nodes:l,types:c,state:p,visibility:h,width:g,height:b,style:v,classes:k,links:C,selectedAction:$,selectedNode:x,mousePosition:I,draggingNode:R,receivingNode:L}=this;return{nodes:l,types:c,state:p,visibility:h,width:g,height:b,style:s(v),classes:k,links:C,selectedAction:$,selectedNode:x,mousePosition:I,draggingNode:R,receivingNode:L,setDraggingNode:i,setReceivingNode:a}};const u=r;return u})}function pe(e,t,...n){return Yn(e)?e(t,...n):s(e)}function An(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Gn={};Qe.on("addLayer",e=>{const t=Xn(e,Yi);Gn[e.id]=e.on("postUpdate",n=>{t.forEach(r=>{Object.values(r.types).forEach(i=>i.nodes.value.forEach(a=>{var u;return(u=i.update)==null?void 0:u.call(i,a,n)}))})})});Qe.on("removeLayer",e=>{var t;(t=Gn[e.id])==null||t.call(Gn),Gn[e.id]=void 0});function $n(e,t="points",n=0,r=void 0){const i=Ve(e)?e:ct(e);if(i.displayName=t,i.precision=n,i.small=r,!Ve(e)){const a=i[Ot];a.displayName=t,a.precision=n,a.small=r}return i}new o("10^^8");new o("1e100");function vr(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?ut(e.small?n:o.floor(n)):xe(n,e.precision,e.small)}Qe.on("setupVue",e=>e.use(Ca));function gd(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 md=X({props:{visibility:{type:q(Number,Boolean),required:!0},display:{type:q(Object,String,Function),required:!0},style:q(String,Object,Array),classes:q(Object),glowColor:q(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:r,floating:i}=Ae(e),a=Hr(n),u=w(()=>{const c=Pe(r);return c==null||c===""?{}:s(i)?gd(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function l(){t("selectTab")}return{selectTab:l,component:a,glowColorStyle:u,unref:s,Visibility:Se,isVisible:Ze,isHidden:_n}}});function vd(e,t,n,r,i,a){var u;return e.isVisible(e.visibility)?(S(),T("button",{key:0,onClick:t[0]||(t[0]=(...l)=>e.selectTab&&e.selectTab(...l)),class:Ne(["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:{}])},[(S(),re(Ke(e.component)))],6)):B("",!0)}var Zi=be(md,[["render",vd],["__scopeId","data-v-21427abb"]]);const hd=X({props:{visibility:{type:q(Number,Boolean),required:!0},activeTab:{type:q(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:q(Object),required:!0},style:q(String,Object,Array),classes:q(Object),buttonContainerStyle:q(String,Object,Array),buttonContainerClasses:q(Object)},components:{Sticky:mr,TabButton:Zi},setup(e){const{activeTab:t}=Ae(e),n=w(()=>It[ie.theme].floatingTabs),r=_t("");Pt(()=>{const l=Pe(t);if(l==null){r.value="";return}if(At(l)){r.value=fe(l);return}r.value=fe(s(l.display))});const i=w(()=>{const l=Pe(t);return At(l)||!l?void 0:s(l.classes)}),a=w(()=>{const l=Pe(t);return At(l)||!l?void 0:s(l.style)});function u(l){const{display:c,style:p,classes:h,glowColor:g,visibility:b}=l;return{display:c,style:s(p),classes:h,glowColor:g,visibility:b}}return{floating:n,tabClasses:i,tabStyle:a,Visibility:Se,component:r,gatherButtonProps:u,unref:s,isVisible:Ze,isHidden:_n}}});function bd(e,t,n,r,i,a){var c,p;const u=Ct("TabButton"),l=Ct("Sticky");return e.isVisible(e.visibility)?(S(),T("div",{key:0,class:Ne(["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:[],(p=e.tabStyle)!=null?p:[]])},[d(l,{class:Ne(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Le(e.unref(e.buttonContainerStyle))},{default:H(()=>[N("div",{class:Ne(["tab-buttons",{floating:e.floating}])},[(S(!0),T(ne,null,Dt(e.unref(e.tabs),(h,g)=>(S(),re(u,Vt({onSelectTab:b=>e.selected.value=g,floating:e.floating,key:g,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)?(S(),re(Ke(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var yd=be(hd,[["render",bd],["__scopeId","data-v-58dbf83a"]]);const wd=Symbol("TabButton"),_d=Symbol("TabFamily");function Xi(e,t){Object.keys(e).length===0&&console.error("Cannot create tab family with 0 tabs");const n=ct(Object.keys(e)[0],!1);return et(r=>{var u;const i=(u=t==null?void 0:t.call(r,r))!=null?u:{};i.id=Qt("tabFamily-"),i.type=_d,i[gt]=yd,i.tabs=Object.keys(e).reduce((l,c)=>{const p=e[c]();return p.type=wd,p[gt]=Zi,A(p,"visibility"),oe(p,"visibility",Se.Visible),A(p,"tab"),A(p,"display"),A(p,"classes"),A(p,"style"),A(p,"glowColor"),l[c]=p,l},{}),i.selected=n,i.activeTab=w(()=>{const l=s(a.tabs);if(n.value in l&&Ze(l[n.value].visibility))return s(l[n.value].tab);const c=Object.values(l).find(p=>Ze(p.visibility));return c?s(c.tab):null}),A(i,"visibility"),oe(i,"visibility",Se.Visible),A(i,"classes"),A(i,"style"),A(i,"buttonContainerClasses"),A(i,"buttonContainerStyle"),i[dt]=function(){const{visibility:l,activeTab:c,selected:p,tabs:h,style:g,classes:b,buttonContainerClasses:v,buttonContainerStyle:k}=this;return{visibility:l,activeTab:c,selected:p,tabs:h,style:s(g),classes:b,buttonContainerClasses:v,buttonContainerStyle:k}};const a=i;return a})}function Ht(e){return et(t=>{const{addend:n,description:r,enabled:i,smallerIsBetter:a}=e.call(t,t),u=_e(n),l=_e(r),c=i==null?void 0:_e(i);return{apply:p=>o.add(p,s(u)),invert:p=>o.sub(p,s(u)),getFormula:p=>f.add(p,u),enabled:c,description:r==null?void 0:j(()=>d("div",{class:"modifier-container"},[s(l)!=null?d("span",{class:"modifier-description"},[mt(s(l))]):null,d("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),0):o.lt(s(u),0))?"color: var(--danger)":""},[o.gte(s(u),0)?"+":"",Zt(s(u))])]))}})}function Ce(e){return et(t=>{const{multiplier:n,description:r,enabled:i,smallerIsBetter:a}=e.call(t,t),u=_e(n),l=_e(r),c=i==null?void 0:_e(i);return{apply:p=>o.times(p,s(u)),invert:p=>o.div(p,s(u)),getFormula:p=>f.times(p,u),enabled:c,description:r==null?void 0:j(()=>d("div",{class:"modifier-container"},[s(l)!=null?d("span",{class:"modifier-description"},[mt(s(l))]):null,d("span",{class:"modifier-amount",style:(a===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[y("\xD7"),Zt(s(u))])]))}})}function Nd(e){return et(t=>{const{exponent:n,description:r,enabled:i,supportLowNumbers:a,smallerIsBetter:u}=e.call(t,t),l=_e(n),c=_e(r),p=i==null?void 0:_e(i);return{apply:h=>{let g=h;return a&&(g=o.add(g,1)),g=o.pow(g,s(l)),a&&(g=o.sub(g,1)),g},invert:h=>{let g=h;return a&&(g=o.add(g,1)),g=o.root(g,s(l)),a&&(g=o.sub(g,1)),g},getFormula:h=>a?f.add(h,1).pow(l).sub(1):f.pow(h,l),enabled:p,description:r==null?void 0:j(()=>d("div",{class:"modifier-container"},[s(c)!=null?d("span",{class:"modifier-description"},[mt(s(c)),a?" (+1 effective)":null]):null,d("span",{class:"modifier-amount",style:(u===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[y("^"),Zt(s(l))])]))}})}function Mt(e){return et(()=>{const t=e();return{apply:n=>t.filter(r=>s(r.enabled)!==!1).reduce((r,i)=>i.apply(r),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(r=>s(r.enabled)!==!1).reduceRight((r,i)=>i.invert(r),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(r=>s(r.enabled)!==!1).reduce((r,i)=>i.getFormula(r),n):void 0,enabled:t.some(n=>n.enabled!=null)?w(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?j(()=>d(ne,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(mt)])):void 0}})}const Br=f.variable(0).step(2e3,e=>e.pow_base(1.02)).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).pow(1.5),pn={id:"deselect",icon:"close",tooltip:e=>({text:"portals"in e.state?"Disconnect portals":"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"portals"in e.state?e.state={...e.state,portals:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),m.board.selectedAction.value=null,m.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"portals"in e.state?e.state.portals.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},jt={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${ut(m.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},m.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function Cn(e,t=1/0){const n=e(f.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(r){return{text:`Increase Connections - ${ut(n.evaluate(r.state.maxConnections))} energy`}},fillColor(r){return o.gte(m.energy.value,n.evaluate(r.state.maxConnections))?"var(--bought)":"var(--locked)"},confirmationLabel:r=>o.gte(m.energy.value,n.evaluate(r.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(r){const i=n.evaluate(r.state.maxConnections);o.gte(m.energy.value,i)&&(m.energy.value=o.sub(m.energy.value,i),r.state={...r.state,maxConnections:o.add(r.state.maxConnections,1)},m.board.selectedAction.value=null)},visibility:r=>o.add(r.state.maxConnections,m.computedBonusConnectionsModifier.value).lt(t)}}function Ji(e,t){var n,r;if(((n=m.board.draggingNode.value)==null?void 0:n.type)==="resource"){const i=((r=m.board.draggingNode.value)==null?void 0:r.state).type,{maxConnections:a,resources:u}=e.state;return u.includes(i)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,m.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(i),color:"var(--accent2)"}}return null}function Cd(e,t){var n,r;if(((n=m.board.draggingNode.value)==null?void 0:n.type)==="passive"){const i=(r=m.board.draggingNode.value)==null?void 0:r.state,{maxConnections:a,tools:u}=e.state;return u.includes(i)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,m.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(i),color:"var(--accent2)"}}return null}function wr(e,t){var n,r;if(((n=m.board.draggingNode.value)==null?void 0:n.type)==="portal"){const i=((r=m.board.draggingNode.value)==null?void 0:r.state).id,{maxConnections:a,portals:u}=e.state;return u.includes(i)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,m.computedBonusConnectionsModifier.value).lte(u.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(i),color:"var(--accent2)"}}return null}function Ki(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:r,resources:i}=e.state;return i.includes(n)?!0:!o.add(r,m.computedBonusConnectionsModifier.value).lte(i.length)}function Qi(e,t){if(t.type!=="resource")return;const n=t.state.type,r=e.state.resources;r.includes(n)?e.state={...e.state,resources:r.filter(i=>i!==n)}:e.state={...e.state,resources:[...r,n]},m.board.selectedNode.value=e}function kd(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:r,tools:i}=e.state;return i.includes(n)?!0:!o.add(r,m.computedBonusConnectionsModifier.value).lte(i.length)}function Sd(e,t){if(t.type!=="passive")return;const n=t.state,r=e.state.tools;r.includes(n)?e.state={...e.state,tools:r.filter(i=>i!==n)}:e.state={...e.state,tools:[...r,n]},m.board.selectedNode.value=e}function _r(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:r,portals:i}=e.state;return i.includes(n)?!0:!o.add(r,m.computedBonusConnectionsModifier.value).lte(i.length)}function Nr(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:r}=e.state;r.includes(n)?e.state={...e.state,portals:r.filter(i=>i!==n)}:e.state={...e.state,portals:[...r,n]},m.board.selectedNode.value=e}function ke(e){return e===m.board.selectedNode.value||e.state.powered}function te(e){return m.empowerer.value!=null&&ke(m.empowerer.value)&&m.empowerer.value.state.tools.includes(e)}function Md(e){var a,u,l;const t=(l=(u=(a=m.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:u.amount)!=null?l:0,n=m.resourceLevels.value[e],r=Br.evaluate(n),i=Br.evaluate(o.add(n,1));return o.sub(t,r).max(0).div(o.sub(i,r)).toNumber()}function vn(e,t,n){if(t.value){const r=t.value.state,i=r[n],a=r.maxConnections;o.gt(i.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:i.slice(0,o.add(a,e).toNumber())})}}function zt(e){return{id:"help",icon:"question_mark",tooltip:{text:"Help"},onClick(){m.helpModals[e].showModal.value=!0,m.board.selectedAction.value=null},confirmationLabel:null}}function bi(e){return t=>ie.lineVisibility||e===m.board.selectedNode.value||e===m.board.draggingNode.value||m.resourceNodes.value[t]===m.board.draggingNode.value}const Id={key:0},xd={key:0,class:"mark star"},$d=["src"],Dd=X({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(S(),T("div",Id,[e.mark===!0?(S(),T("div",xd)):(S(),T("img",{key:1,class:"mark",src:e.mark},null,8,$d))])):B("",!0)}});var er=be(Dd,[["__scopeId","data-v-2207999f"]]);const Td=X({__name:"Node",props:{id:null},setup(e){const n=Ae(e),r=dr(Yr,()=>{}),i=dr(Zr,()=>{}),a=_t(null),u=w(()=>a.value&&a.value.parentElement);return wt([u,n.id],([l,c],[p,h])=>{p&&i(s(h)),l&&r(c,l)}),Mi(()=>i(s(n.id))),(l,c)=>(S(),T("div",{class:"node",ref_key:"node",ref:a},null,512))}});var tr=be(Td,[["__scopeId","data-v-a48cb382"]]),Pd=X({props:{display:{type:q(Object,String,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),onClick:Function,onHold:Function,canClick:{type:q(Boolean),required:!0},small:Boolean,mark:q(Boolean,String),id:{type:String,required:!0}},components:{Node:tr,MarkNode:er},setup(e){const{display:t,onClick:n,onHold:r}=Ae(e),i=_t("");Pt(()=>{var h;const l=Pe(t);if(l==null){i.value="";return}if(At(l)){i.value=fe(l);return}const c=fe((h=l.title)!=null?h:"","h3"),p=fe(l.description,"div");i.value=fe(j(()=>d("span",null,[l.title!=null?d("div",null,[d(c,null,null)]):null,d(p,null,null)])))});const{start:a,stop:u}=Vi(n,r);return{start:a,stop:u,comp:i,Visibility:Se,isVisible:Ze,isHidden:_n,unref:s}}});function Ad(e,t,n,r,i,a){var c;const u=Ct("MarkNode"),l=Ct("Node");return e.isVisible(e.visibility)?(S(),T("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]=(...p)=>e.onClick&&e.onClick(...p)),onMousedown:t[1]||(t[1]=(...p)=>e.start&&e.start(...p)),onMouseleave:t[2]||(t[2]=(...p)=>e.stop&&e.stop(...p)),onMouseup:t[3]||(t[3]=(...p)=>e.stop&&e.stop(...p)),onTouchstartPassive:t[4]||(t[4]=(...p)=>e.start&&e.start(...p)),onTouchendPassive:t[5]||(t[5]=(...p)=>e.stop&&e.stop(...p)),onTouchcancelPassive:t[6]||(t[6]=(...p)=>e.stop&&e.stop(...p)),class:Ne({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(S(),re(Ke(e.unref(e.comp)),{key:0})):B("",!0),d(u,{mark:e.unref(e.mark)},null,8,["mark"]),d(l,{id:e.id},null,8,["id"])],38)):B("",!0)}var ea=be(Pd,[["render",Ad],["__scopeId","data-v-211328c0"]]);const ta=Symbol("Clickable");function yi(e,...t){const n=t.reduce((r,i)=>{var a;return Object.assign(r,(a=i.getPersistentData)==null?void 0:a.call(i))},{});return et(r=>{var u,l,c;const i=(u=e==null?void 0:e.call(r,r))!=null?u:{};i.id=Qt("clickable-"),i.type=ta,i[gt]=ea;for(const p of t)(l=p.preConstruct)==null||l.call(p,i);if(Object.assign(i,n),A(i,"visibility"),oe(i,"visibility",Se.Visible),A(i,"canClick"),oe(i,"canClick",!0),A(i,"classes"),A(i,"style"),A(i,"mark"),A(i,"display"),i.onClick){const p=i.onClick.bind(i);i.onClick=function(h){s(i.canClick)!==!1&&p(h)}}if(i.onHold){const p=i.onHold.bind(i);i.onHold=function(){s(i.canClick)!==!1&&p()}}for(const p of t)(c=p.postConstruct)==null||c.call(p,i);const a=t.reduce((p,h)=>{var g;return Object.assign(p,(g=h.getGatheredProps)==null?void 0:g.call(h,i))},{});return i[dt]=function(){const{display:p,visibility:h,style:g,classes:b,onClick:v,onHold:k,canClick:C,small:$,mark:x,id:I}=this;return{display:p,visibility:h,style:s(g),classes:b,onClick:v,onHold:k,canClick:C,small:$,mark:x,id:I,...a}},i})}function Rd(e,t,n=[]){n=n.length===0?Xn(e,ta):n;const r=typeof t=="function"?w(t):t;return e.on("update",()=>{s(r)&&n.filter(i=>s(i.canClick)).forEach(i=>{var a;return(a=i.onClick)==null?void 0:a.call(i)})})}const Ed=["x1","y1","x2","y2"],Fd=X({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Ae(e),r=w(()=>{const a=n.startNode.value.rect,u=n.boundingRect.value,l=u?{x:a.x+a.width/2-u.x,y:a.y+a.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(l.x+=n.link.value.offsetStart.x,l.y+=n.link.value.offsetStart.y),l}),i=w(()=>{const a=n.endNode.value.rect,u=n.boundingRect.value,l=u?{x:a.x+a.width/2-u.x,y:a.y+a.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(l.x+=n.link.value.offsetEnd.x,l.y+=n.link.value.offsetEnd.y),l});return(a,u)=>(S(),T("line",Vt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(r).x,y1:s(r).y,x2:s(i).x,y2:s(i).y}),null,16,Ed))}});const Od=X({__name:"Links",props:{links:null},setup(e){var c;const n=Jt(e,"links"),r=G(null),i=dr(Xr,G({})),a=dr(Jr,G(void 0)),u=G((c=r.value)==null?void 0:c.getBoundingClientRect());wt(a,()=>{var p;return u.value=(p=r.value)==null?void 0:p.getBoundingClientRect()}),Qn(()=>{var p;return u.value=(p=r.value)==null?void 0:p.getBoundingClientRect()});const l=w(()=>{var h,g;const p=i.value;return(g=(h=n.value)==null?void 0:h.filter(b=>{var v,k;return((v=p[b.startNode.id])==null?void 0:v.rect)&&((k=p[b.startNode.id])==null?void 0:k.rect)}))!=null?g:[]});return(p,h)=>(S(),T(ne,null,[s(l)?(S(),T("svg",va(Vt({key:0},p.$attrs)),[(S(!0),T(ne,null,Dt(s(l),(g,b)=>(S(),re(Fd,{key:b,link:g,boundingRect:u.value,startNode:s(i)[g.startNode.id],endNode:s(i)[g.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),N("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var qd=be(Od,[["__scopeId","data-v-063f6d6b"]]);X({props:{nodes:{type:q(Array),required:!0},leftSideNodes:q(Array),rightSideNodes:q(Array),branches:q(Array)},components:{Links:qd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:r}=Ae(e),i=_t();Pt(()=>{const l=Pe(t);i.value=fe(j(()=>d(ne,null,[l.map(c=>d("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(mt)]))])))});const a=_t();Pt(()=>{const l=Pe(n);a.value=l?fe(j(()=>d("span",{class:"left-side-nodes small"},[l.map(mt)]))):""});const u=_t();return Pt(()=>{const l=Pe(r);u.value=l?fe(j(()=>d("span",{class:"side-nodes small"},[l.map(mt)]))):""}),{unref:s,nodesComp:i,leftNodesComp:a,rightNodesComp:u}}});X({props:{display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),onClick:Function,onHold:Function,color:q(String),glowColor:q(String),canClick:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:er,Node:tr},setup(e){const{onClick:t,onHold:n,display:r}=Ae(e),i=Rn(r),{start:a,stop:u}=Vi(t,n);return{start:a,stop:u,comp:i,unref:s,Visibility:Se,isCoercableComponent:At,isVisible:Ze,isHidden:_n}}});function Un(e){const t=[],n={};let r=!1;function i(){return r||(t.push(...e()),n.base=t.map(l=>_e(l.base)),n.baseText=t.map(l=>_e(l.baseText)),n.visible=t.map(l=>_e(l.visible)),n.title=t.map(l=>_e(l.title)),n.subtitle=t.map(l=>_e(l.subtitle)),r=!0),t}const a=ct({},!1);return[j(()=>{const l=i();let c=!0;const p=l.map((h,g)=>{var x,I,R;if(s(n.visible[g])===!1)return null;const b=d("h3",{onClick:()=>a.value[g]=!a.value[g],style:"cursor: pointer"},[d("span",{class:"modifier-toggle"+(s(a.value[g])?" collapsed":"")},[y("\u25BC")]),s(n.title[g]),s(n.subtitle[g])!=null?d("span",{class:"subtitle"},[y(" ("),s(n.subtitle[g]),y(")")]):null]),v=s(a.value[g])?null:d(ne,null,[d("div",{class:"modifier-container"},[d("span",{class:"modifier-description"},[mt((x=s(n.baseText[g]))!=null?x:"Base")]),d("span",{class:"modifier-amount"},[xe((I=s(n.base[g]))!=null?I:1),h.unit])]),h.modifier.description==null?null:mt(s(h.modifier.description))]),k=!c;c=!1;const C=(R=s(n.base[g]))!=null?R:1,$=h.modifier.apply(C);return d(ne,null,[k?d("br",null,null):null,d("div",{style:{"--unit":ie.alignUnits&&h.unit!=null?"'"+h.unit+"'":""}},[b,d("br",null,null),v,d("hr",null,null),d("div",{class:"modifier-container"},[d("span",{class:"modifier-description"},[y("Total")]),d("span",{class:"modifier-amount",style:(h.smallerIsBetter===!0?o.gt($,C!=null?C:1):o.lt($,C!=null?C:1))?"color: var(--danger)":""},[Zt($),h.unit])])])])});return d(ne,null,[p])}),a]}function Er(e,t,n){const r=_e(t),i=_e(n);return w(()=>{const a=s(r),u=s(i);return o.gte(e.value,u)?"Now":o.lte(a,0)?"Never":yr(o.sub(u,e.value).div(a))})}function hn(e,t,n=1){const r=_e(t),i=_e(n);return e.hasVariable()||console.error("Cannot create formula preview if the formula does not have a variable"),j(()=>{var a;if(s(r)){const u=Zt(e.evaluate()),l=Zt(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(i))));return d(ne,null,[d("b",null,[d("i",null,[u,y(" \u2192 "),l])])])}return d(ne,null,[Zt(e.evaluate())])})}const Tt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Et=Object.keys(Tt),ze={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"AI",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"ML",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Ft={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Nets",wood:"Mining Laser",stone:"Replicator",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"OC'ed Portals",ultimatum:"Rebates"},Vd={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 40% stronger":"Material level is 20% stronger"},silver:{description:e=>e?"Quadruples each plane's resource gain":"Doubles each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase (diminishing)":"+1% plane's resource gain per repeatable purchase (diminishing)"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"All upgrades apply twice":"Non-multiplicative upgrades apply twice"},coalRelic:{description:e=>e?"Every treasure boosts planar speed by +20%":"Every treasure boosts planar speed by +10%"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give quadruple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Powered machines)^2 boost quarry speed":"Powered machines boost quarry speed"},goldRelic:{description:e=>e?"Each treasure gives +50% XP gain":"Each treasure gives +25% XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs 20x less energy":"Creating portals costs 10x less energy"},platinumRelic:{description:e=>e?"Quadruple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"log(energy)^0.5 boosts planes' resource gain":"log(energy)^0.25 boosts planes' resource gain"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},yt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+difficulty",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-difficulty",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},or=f.variable(0).add(8).times(2).pow10(),Bd=X({__name:"Tab",props:{display:null},setup(e){const t=e,{display:n}=Ae(t),r=Hr(n);return(i,a)=>(S(),re(Ke(s(r))))}}),Ld=Symbol("Tab");function Fr(e){return et(t=>{const n=e.call(t,t);return n.id=Qt("tab-"),n.type=Ld,n[gt]=Bd,n[dt]=function(){const{display:r}=this;return{display:r}},n})}function Gt(e,t,n={}){const r=ct(!1);return{modal:j(()=>d(Lt,{modelValue:r.value,"onUpdate:modelValue":a=>r.value=a},{header:()=>d("h2",null,[e]),body:t})),showModal:r,...n}}function jd(){return Gt("Getting Started",j(()=>d("div",null,[d("p",null,[y(`Welcome to Planar Pioneers! Your job is to gather resources and eventually explore and conquer increasingly difficult "planes", which are like alien worlds. To start you'll use the mine (\u26CF\uFE0F) machine to gather resources.`)]),d("br",null,null),d("p",null,[y(`You'll gain energy every second based on how much of each resource you have. You can check the exact calculation and various other information by clicking the "modifiers" button near the top of the screen.`)]),d("br",null,null),d("p",null,[y("Select the machine by clicking it to make the mine active. You can also drag them around to organize your various machines and other objects. While selected machines will have various actions you can take, such as viewing the help for that machine. There's also an action to power the machine, allowing it to be active even while not selected, at the cost of energy per second (cost increases based on the total number of machines being powered).")])])))}function zd(){return Gt("Forging",j(()=>d("div",null,[d("p",null,[y("You've repaired the forge (\u{1F6E0}\uFE0F)! This is the next main line of progression. Here you'll be able to craft a total of 16 machines and passive bonuses to create - one for each resource!")]),d("br",null,null),d("p",null,[y("Drag a resource onto the forge to select that resource tier. You can then use an action on the forge to create that item, at the cost of energy based on the resource tier. You can only have 1 of each item.")])])))}function Gd(){return Gt("Dowsing",j(()=>d("div",null,[d("p",null,[y("You've created the dowsing rod (\u{1F962})! This machine lets you bias the odds of specified resources from mining. It will double the odds of each specified resource, so keep in mind rare resources will still be fairly rare.")]),d("br",null,null),d("p",null,[y("Specify resources to boost by dragging them to the dowsing rod. You can only select a single resource to start, but that can be increased using an action.")])])))}function Ud(){return Gt("Quarry",j(()=>d("div",null,[d("p",null,[y("You've created the Quarry (\u26F0\uFE0F)! This machine lets you gather specified resources. Unlike the mine, this machine will always output the same resources. However, rarer resources will take longer to gather.")]),d("br",null,null),d("p",null,[y("Specify resources to gather by dragging them to the quarry. You can only select a single resource to start, but that can be increased using an action.")])])))}function Wd(){return Gt("Tool Empowerer",j(()=>d("div",null,[d("p",null,[y("You've created the Tool Empowerer (\u{1F50C})! This machine lets you increase the effect of specified passives. Experimenting with which passives to empower can really help you progress!")]),d("br",null,null),d("p",null,[y("Specify passives to empower by dragging them to the empowerer. You can only select a single passive to start, but that can be increased using an action.")])])))}function Hd(){const e=Xi({general:()=>({display:"General",glowColor(){return e.activeTab.value===this.tab?"white":""},tab:Fr(()=>({display:j(()=>d("div",null,[d("p",null,[y("You've created the Portal Generator (\u26E9\uFE0F)! This machine lets you create portals to other planes, which will have treasures that help you in various ways! To create a portal you need to specify a tier by dragging a resource to the generator - higher tier planes cost more energy to generate portals for, but offer more and better treasures! Keep in mind time in planes will be paused if the portal is inactive (not selected nor powered).")]),d("br",null,null),d("p",null,[y("You've also gained a trash can for portals (\u{1F5D1}\uFE0F). Dragging a portal here will permanently destroy it. Any treasures that require the portal to be active will no longer work. This can be used to keep your workspace clean from old portals you no longer need or want.")]),d("br",null,null),d("p",null,[y("Once you have portals, the lines on the board might getting particularly necessary. Here's a setting (also accessible in the settings modal) to disable resource gain lines unless the node is active.")]),d("br",null,null),d($t,{title:j(()=>d("span",{class:"option-title"},[y("Always show lines to resource nodes")])),modelValue:ie.lineVisibility,"onUpdate:modelValue":t=>ie.lineVisibility=t},null)]))}))}),treasures:()=>({display:"Treasures",glowColor(){return e.activeTab.value===this.tab?"white":""},tab:Fr(()=>({display:j(()=>d("div",null,[y("Types of potential treasures:"),d("ul",{style:"list-style-type: unset"},[d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("Caches")]),y(": Gain an amount of a resource based on your current amount.")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("Gen")]),y(": Passively gain an amount of a resource while the portal is active (selected or powered).")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("Resource Mult")]),y(": Increase the amount gained of a resource from all sources (except caches) while the portal is active (selected or powered).")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("Energy Mult")]),y(": Increase the energy gained per second while the portal is active (selected or powered).")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("Influences")]),y(": Gain a influence. See the influences tab for details. You can only have 1 of each influence.")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("Relic")]),y(": Gain the relic unique to this tier of plane. These are powerful passive boosts that can be empowered. You can only have 1 of each relic. Relics can only appear with the +relic influence, and will always be the last treasure on a plane.")])])]))}))}),influences:()=>({display:"Influences",glowColor(){return e.activeTab.value===this.tab?"white":""},tab:Fr(()=>({display:j(()=>d("div",null,[d("p",null,[y("Some treasures will grant you influences that can help the portal generator create portals to planes with specified qualities. Each influence will multiply the energy cost of creating the portal.")]),d("br",null,null),Object.keys(m.influenceNodes.value).length>0?d("div",null,[y("Discovered influences:"),d("ul",{style:"list-style-type: unset"},[m.influenceNodes.value.increaseResources==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+resource")]),y(": Can be connected to resources and will cause any treasures that reference resources (caches, gens, and resource mults) to have increased odds of picking a selected resource.")]),m.influenceNodes.value.decreaseResources==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("-resource")]),y(": Can be connected to resources and will cause any treasures that reference resources (caches, gens, and resource mults) to have decreased odds of picking a selected resource.")]),m.influenceNodes.value.increaseLength==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+length")]),y(": Cause the plane to have 1 extra treasure than it otherwise would have.")]),m.influenceNodes.value.increaseCaches==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+caches")]),y(": Causes treasures to have an increased chance to be caches.")]),m.influenceNodes.value.increaseGens==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+gens")]),y(": Causes treasures to have an increased chance to be gens.")]),m.influenceNodes.value.increaseResourceMults==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+resource mults")]),y(": Causes treasures to have an increased chance to be resource mults.")]),m.influenceNodes.value.increaseEnergyMults==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+energy mults")]),y(": Causes treasures to have an increased chance to be energy mults.")]),m.influenceNodes.value.increaseInfluences==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+influences")]),y(": Causes treasures to have an increased chance to be influences.")]),m.influenceNodes.value.relic==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+relic")]),y(": Maximizes length and difficulty for this tier of plane, and makes the last treasure a relic (unique per tier of plane). Overrides any other difficulty-changing influences.")]),m.influenceNodes.value.increaseDiff==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+difficulty")]),y(": Causes the difficulty and rewards to be in the upper half of what's possible at this tier.")]),m.influenceNodes.value.decreaseDiff==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("-difficulty")]),y(": Causes the difficulty and rewards to be in the lower half of what's possible at this tier.")]),m.influenceNodes.value.increaseRewards==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[y("+rewards")]),y(": Causes the quality of treasures to be 1 tier higher. Does not affect influences or relics treasures.")])])]):d("div",null,[y("Once you discover influences, summaries will appear here describing their effects.")])]))}))})});return Gt("Portal Generator",j(()=>mt(e)),{tabFamily:e})}function Yd(){return Gt("Booster",j(()=>d("div",null,[d("p",null,[y("You've created the Booster (\u231B)! This machine lets you increase the rate of time of planes! This affects its resource gain, gen treasures, and any other effects of time.")]),d("br",null,null),d("p",null,[y("Specify planes to boost by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")]),d("br",null,null),d("p",null,[y("Initially the booster will double the rate of time, but that can be increased using an action.")])])))}function Zd(){return Gt("Upgrader",j(()=>d("div",null,[d("p",null,[y("You've created the Upgrader (\u{1F916})! This machine lets you automatically purchase upgrades within planes (includes prestiges but not repeatables or dimensions)!")]),d("br",null,null),d("p",null,[y("Specify planes to auto-purchase upgrades from by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")])])))}function Xd(){return Gt("Automator",j(()=>d("div",null,[d("p",null,[y("You've created the Automator (\u{1F9BE})! This machine lets you automatically purchase repeatables and dimensions within planes!")]),d("br",null,null),d("p",null,[y("Specify planes to auto-purchase repeatables and dimensions from by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")])])))}function Jd(){return Gt("Investments",j(()=>d("div",null,[d("p",null,[y("You've created the Investments machine (\u{1F4B1})! This machine lets you automatically gain the resources from conversions without spending the plane's primary resource!")]),d("br",null,null),d("p",null,[y("Specify planes to gain converted resources from by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")])])))}const Kd=X({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(S(),T("div",{style:Le({width:e.width,height:e.height})},null,4))}});function Bn(e){return et(t=>{var r;const n=e.call(t,t);return n.partialDisplay=i=>d("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[vr(n.resource,n.cost instanceof f?sn(n.cost,i!=null?i:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=i=>d("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",vr(n.resource,n.cost instanceof f?sn(n.cost,i!=null?i:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),A(n,"visibility"),oe(n,"visibility",Se.Visible),A(n,"cost"),A(n,"requiresPay"),oe(n,"requiresPay",!0),A(n,"cumulativeCost"),oe(n,"cumulativeCost",!0),A(n,"maxBulkAmount"),oe(n,"maxBulkAmount",1),A(n,"directSum"),oe(n,"pay",function(i){const a=n.cost instanceof f?sn(n.cost,i!=null?i:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=w(()=>{var l;if(!(n.cost instanceof f))return!1;const i=s(n.maxBulkAmount);if(o.lte(i,1))return!1;const a=s(n.cumulativeCost),u=(l=s(n.directSum))!=null?l:a?10:0;return o.lte(i,u)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof f?n.requirementMet=ji(n.cost,n.resource,(r=n.cumulativeCost)!=null?r:!0,n.directSum,n.maxBulkAmount):n.requirementMet=w(()=>o.gte(n.resource.value,s(n.cost))),n})}function ri(e){return et(()=>({requirementMet:w(()=>Ze(e.visibility)),visibility:Se.None,requiresPay:!1}))}function Qd(e,t){return et(()=>({requirementMet:_e(e),partialDisplay:t==null?void 0:j(()=>mt(t)),display:t==null?void 0:j(()=>d(ne,null,[y("Req: "),mt(t)])),visibility:t==null?Se.None:Se.Visible,requiresPay:!1}))}function Cr(e){if(Bt(e))return e.every(Cr);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function na(e){if(Bt(e))return e.map(na).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function kr(e,t=1){var n,r;if(Bt(e)&&(e=e.filter(i=>Ze(i.visibility)),e.length===1&&(e=e[0])),Bt(e)){e=e.filter(u=>"partialDisplay"in u);const i=e.filter(u=>s(u.requiresPay)),a=e.filter(u=>!s(u.requiresPay));return d(ne,null,[i.length>0?d("div",null,[y("Costs:")," ",mi(i.map(u=>u.partialDisplay(t)),d(ne,null,[y(", ")]))]):null,a.length>0?d("div",null,[y("Requires:")," ",mi(a.map(u=>u.partialDisplay(t)),d(ne,null,[y(", ")]))]):null])}return(r=(n=e.display)==null?void 0:n.call(e))!=null?r:d(ne,null,null)}function ra(e,t=1){var n;Bt(e)?e.filter(r=>s(r.requiresPay)).forEach(r=>{var i;return(i=r.pay)==null?void 0:i.call(r,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var ep=X({props:{visibility:{type:q(Number,Boolean),required:!0},display:q(Object,String,Function),earned:{type:q(Boolean),required:!0},requirements:q(Object,Array),image:q(String),style:q(String,Object,Array),classes:q(Object),mark:q(Boolean,String),small:q(Boolean),id:{type:String,required:!0}},components:{Node:tr,MarkNode:er},setup(e){const{display:t,requirements:n,earned:r}=Ae(e),i=_t("");return Pt(()=>{const a=Pe(t);if(a==null){i.value="";return}if(At(a)){i.value=fe(a);return}const u=fe(a.requirement?a.requirement:j(()=>{var p;return kr((p=Pe(n))!=null?p:[])}),"h3"),l=fe(a.effectDisplay||"","b"),c=Pe(r)?fe(a.optionsDisplay||"","span"):"";i.value=fe(j(()=>d("span",null,[d(u,null,null),a.effectDisplay!=null?d("div",null,[d(l,null,null)]):null,a.optionsDisplay!=null?d("div",{class:"equal-spaced"},[d(c,null,null)]):null])))}),{comp:i,unref:s,Visibility:Se,isVisible:Ze,isHidden:_n}}});function tp(e,t,n,r,i,a){var c;const u=Ct("MarkNode"),l=Ct("Node");return e.isVisible(e.visibility)?(S(),T("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:Ne({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?(S(),re(Ke(e.comp),{key:0})):B("",!0),d(u,{mark:e.unref(e.mark)},null,8,["mark"]),d(l,{id:e.id},null,8,["id"])],6)):B("",!0)}var np=be(ep,[["render",tp],["__scopeId","data-v-5673325a"]]);const rp=hr(),ip=Symbol("Achievement");let Dn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function ap(e,...t){const n=ct(!1,!1),r=t.reduce((i,a)=>{var u;return Object.assign(i,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return et(i=>{var c,p,h;const a=(c=e==null?void 0:e.call(i,i))!=null?c:{};a.id=Qt("achievement-"),a.type=ip,a[gt]=np;for(const g of t)(p=g.preConstruct)==null||p.call(g,a);a.earned=n,a.complete=function(){var b,v;if(n.value)return;n.value=!0;const g=a;if((b=g.onComplete)==null||b.call(g),g.display!=null&&s(g.showPopups)===!0){const k=s(g.display);let C;At(k)?C=fe(k):k.requirement!=null?C=fe(k.requirement):C=kr((v=g.requirements)!=null?v:[]),rp.info(d("div",null,[d("h3",null,[y("Treasure earned!")]),d("div",null,[d(C,null,null)])]))}},Object.assign(a,r),A(a,"visibility"),oe(a,"visibility",Se.Visible);const u=a.visibility;a.visibility=ha(()=>{const g=s(a.display);switch(ie.msDisplay){default:case Dn.All:return s(u);case Dn.Configurable:return s(a.earned)&&!(g!=null&&typeof g=="object"&&"optionsDisplay"in g)?Se.None:s(u);case Dn.Incomplete:return s(a.earned)?Se.None:s(u);case Dn.None:return Se.None}}),A(a,"display"),A(a,"mark"),A(a,"small"),A(a,"image"),A(a,"style"),A(a,"classes"),A(a,"showPopups"),oe(a,"showPopups",!0);for(const g of t)(h=g.postConstruct)==null||h.call(g,a);const l=t.reduce((g,b)=>{var v;return Object.assign(g,(v=b.getGatheredProps)==null?void 0:v.call(b,a))},{});if(a[dt]=function(){const{visibility:g,display:b,requirements:v,earned:k,image:C,style:$,classes:x,mark:I,small:R,id:L}=this;return{visibility:g,display:b,requirements:v,earned:k,image:C,style:s($),classes:x,mark:I,small:R,id:L,...l}},a.requirements){const g=a,b=[ri(g),Qd(()=>!g.earned.value),...Bt(a.requirements)?a.requirements:[a.requirements]];Pt(()=>{ie.active===Y.id&&Cr(b)&&g.complete()})}return a})}Qe.on("loadSettings",e=>{oe(e,"msDisplay",Dn.All)});const sp=Object.values(Dn).map(e=>({label:st(e),value:e}));Oi(j(()=>d(ti,{title:j(()=>d("span",{class:"option-title"},[y("Show achievements"),d("desc",null,[y("Select which achievements to display based on criterias.")])])),options:sp,"onUpdate:modelValue":e=>ie.msDisplay=e,modelValue:ie.msDisplay},null)));const op=X({props:{progress:{type:q(String,Object,Number),required:!0},width:{type:q(Number),required:!0},height:{type:q(Number),required:!0},direction:{type:q(String),required:!0},display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),borderStyle:q(Object,String,Array),textStyle:q(Object,String,Array),baseStyle:q(Object,String,Array),fillStyle:q(Object,String,Array),mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:er,Node:tr},setup(e){const{progress:t,width:n,height:r,direction:i,display:a}=Ae(e),u=w(()=>{let p=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(p,0),1))*100}),l=w(()=>{const p={width:Pe(n)+.5+"px",height:Pe(r)+.5+"px"};switch(s(i)){case W.Up:p.clipPath=`inset(${u.value}% 0% 0% 0%)`,p.width=Pe(n)+1+"px";break;case W.Down:p.clipPath=`inset(0% 0% ${u.value}% 0%)`,p.width=Pe(n)+1+"px";break;case W.Right:p.clipPath=`inset(0% ${u.value}% 0% 0%)`;break;case W.Left:p.clipPath=`inset(0% 0% 0% ${u.value} + '%)`;break;case W.Default:p.clipPath="inset(0% 50% 0% 0%)";break}return p}),c=Rn(a);return{normalizedProgress:u,barStyle:l,component:c,unref:s,Visibility:Se,isVisible:Ze,isHidden:_n}}});function lp(e,t,n,r,i,a){var c,p,h,g,b,v,k;const u=Ct("MarkNode"),l=Ct("Node");return e.isVisible(e.visibility)?(S(),T("div",{key:0,style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:Ne({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.borderStyle))!=null?p:{}])},[e.component?(S(),T("span",{key:0,class:"overlayText",style:Le(e.unref(e.textStyle))},[(S(),re(Ke(e.component)))],4)):B("",!0)],4),N("div",{class:"border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(h=e.unref(e.style))!=null?h:{},(g=e.unref(e.baseStyle))!=null?g:{},(b=e.unref(e.borderStyle))!=null?b:{}])},[N("div",{class:"fill",style:Le([e.barStyle,(v=e.unref(e.style))!=null?v:{},(k=e.unref(e.fillStyle))!=null?k:{}])},null,4)],4),d(u,{mark:e.unref(e.mark)},null,8,["mark"]),d(l,{id:e.id},null,8,["id"])],6)):B("",!0)}var up=be(op,[["render",lp],["__scopeId","data-v-6bd06b56"]]);const cp=Symbol("Bar");function dp(e,...t){const n=t.reduce((r,i)=>{var a;return Object.assign(r,(a=i.getPersistentData)==null?void 0:a.call(i))},{});return et(r=>{var u,l;const i=e.call(r,r);i.id=Qt("bar-"),i.type=cp,i[gt]=up;for(const c of t)(u=c.preConstruct)==null||u.call(c,i);Object.assign(i,n),A(i,"visibility"),oe(i,"visibility",Se.Visible),A(i,"width"),A(i,"height"),A(i,"direction"),A(i,"style"),A(i,"classes"),A(i,"borderStyle"),A(i,"baseStyle"),A(i,"textStyle"),A(i,"fillStyle"),A(i,"progress"),A(i,"display"),A(i,"mark");for(const c of t)(l=c.postConstruct)==null||l.call(c,i);const a=t.reduce((c,p)=>{var h;return Object.assign(c,(h=p.getGatheredProps)==null?void 0:h.call(p,i))},{});return i[dt]=function(){const{progress:c,width:p,height:h,direction:g,display:b,visibility:v,style:k,classes:C,borderStyle:$,textStyle:x,baseStyle:I,fillStyle:R,mark:L,id:ce}=this;return{progress:c,width:p,height:h,direction:g,display:b,visibility:v,style:s(k),classes:C,borderStyle:$,textStyle:x,baseStyle:I,fillStyle:R,mark:L,id:ce,...a}},i})}function pp(e,...t){return et(n=>{var i,a;const r=e.call(n,n);for(const u of t)(i=u.preConstruct)==null||i.call(u,r);r.formula=r.formula(f.variable(r.baseResource)),r.currentGain==null&&(r.currentGain=w(()=>{let u=o.floor(r.formula.evaluate(r.baseResource.value)).max(0);return s(r.buyMax)===!1&&(u=u.min(1)),u})),r.actualGain==null&&(r.actualGain=r.currentGain),r.currentAt==null&&(r.currentAt=w(()=>r.formula.invert(o.floor(s(r.currentGain))))),r.nextAt==null&&(r.nextAt=w(()=>r.formula.invert(o.floor(s(r.currentGain)).add(1)))),r.convert==null&&(r.convert=function(){var l;const u=s(r.currentGain);r.gainResource.value=o.add(r.gainResource.value,u),r.spend(u),(l=r.onConvert)==null||l.call(r,u)}),r.spend==null&&(r.spend=function(){r.baseResource.value=0}),A(r,"currentGain"),A(r,"actualGain"),A(r,"currentAt"),A(r,"nextAt"),A(r,"buyMax"),oe(r,"buyMax",!0);for(const u of t)(a=u.postConstruct)==null||a.call(u,r);return r})}function fp(e){return pp(e)}function gp(e,t,n=1,r=o.dInf){const i=_e(n),a=_e(r);e.on("preUpdate",u=>{const l=s(i);o.neq(l,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(l,u).times(o.ceil(s(t.actualGain)))).min(s(a)).max(t.gainResource.value))})}const mp={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),A(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=w(()=>{var t;return o.add(s((t=e.amount)!=null?t:0),s(e.bonusAmount))}))}},ia=Symbol("Repeatable");function wi(e,...t){const n=ct(0),r=t.reduce((i,a)=>{var u;return Object.assign(i,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return et(i=>{var b,v,k;const a=e.call(i,i);a.id=Qt("repeatable-"),a.type=ia,a[gt]=ea;for(const C of t)(b=C.preConstruct)==null||b.call(C,a);a.amount=n,a.amount[Kt]=(v=a.initialAmount)!=null?v:0,Object.assign(a,r);const u={requirementMet:w(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:Se.None,canMaximize:!0},l=ri(a);Bt(a.requirements)?(a.requirements.unshift(l),a.requirements.push(u)):a.requirements=[l,a.requirements,u],a.maxed=w(()=>o.gte(a.amount.value,s(a.limit))),A(a,"classes");const c=a.classes;a.classes=w(()=>{const C=s(c)||{};return a.maxed.value&&(C.bought=!0),C}),a.amountToIncrease=w(()=>o.clampMin(na(a.requirements),1)),a.canClick=w(()=>Cr(a.requirements));const p=a.onClick;a.onClick=function(C){var I;const $=a;if(!s($.canClick))return;const x=(I=s(a.amountToIncrease))!=null?I:1;ra(a.requirements,x),$.amount.value=o.add($.amount.value,x),p==null||p(C)},A(a,"display");const h=a.display;a.display=j(()=>{var $,x,I;const C=s(h);if(At(C)){const R=fe(C);return d(R,null,null)}if(C!=null){const R=a,L=fe(($=C.title)!=null?$:"","h3"),ce=fe((x=C.description)!=null?x:""),le=fe((I=C.effectDisplay)!=null?I:"");return d("span",null,[C.title==null?null:d("div",null,[d(L,null,null)]),C.description==null?null:d(ce,null,null),C.showAmount===!1?null:d("div",null,[d("br",null,null),d(ne,null,[y("Amount: "),ut(R.amount.value)]),o.isFinite(s(R.limit))?d(ne,null,[y(" / "),ut(s(R.limit))]):void 0]),C.effectDisplay==null?null:d("div",null,[d("br",null,null),y("Currently: "),d(le,null,null)]),R.maxed.value?null:d("div",null,[d("br",null,null),kr(R.requirements,s(a.amountToIncrease))])])}return""}),A(a,"visibility"),oe(a,"visibility",Se.Visible),A(a,"limit"),oe(a,"limit",o.dInf),A(a,"style"),A(a,"mark"),A(a,"small");for(const C of t)(k=C.postConstruct)==null||k.call(C,a);const g=t.reduce((C,$)=>{var x;return Object.assign(C,(x=$.getGatheredProps)==null?void 0:x.call($,a))},{});return a[dt]=function(){const{display:C,visibility:$,style:x,classes:I,onClick:R,canClick:L,small:ce,mark:le,id:ae}=this;return{display:C,visibility:$,style:s(x),classes:I,onClick:R,canClick:L,small:ce,mark:le,id:ae,...g}},a})}const vp=Symbol("Reset");function hp(e){return et(t=>{const n=e.call(t,t);return n.id=Qt("reset-"),n.type=vp,n.reset=function(){var i;const r=a=>{if(a!=null&&typeof a=="object"&&!(a instanceof o)&&!(a instanceof f)){if(Kn in a&&a[Kn]===!0)return;if(Kt in a){const u=a;u.value=u[Kt]}else!(a instanceof o)&&!Ve(a)&&Object.values(a).forEach(u=>r(u))}};s(n.thingsToReset).forEach(r),Qe.emit("reset",n),(i=n.onReset)==null||i.call(n)},A(n,"thingsToReset"),n})}const lr={};Qe.on("removeLayer",e=>{var t;(t=lr[e.id])==null||t.call(lr),lr[e.id]=void 0});function Or(e,t){return A(t,"display"),A(t,"classes"),A(t,"style"),A(t,"direction"),oe(t,"direction",W.Up),A(t,"xoffset"),A(t,"yoffset"),t.pinnable&&(t.pinned=ct(!1,!1)),Xt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,zi(t.pinned)):e.pinned=t.pinned);const n=e[gt];e[gt]=qe;const r=e[dt].bind(e);e[dt]=function(){const{display:a,classes:u,style:l,direction:c,xoffset:p,yoffset:h,pinned:g}=this;return{element:{[gt]:n,[dt]:r},display:a,classes:u,style:s(l),direction:c,xoffset:p,yoffset:h,pinned:g}}.bind(t)}),t}var bp=X({props:{display:{type:q(String,Object,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),requirements:{type:Object,required:!0},canPurchase:{type:q(Boolean),required:!0},bought:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:tr,MarkNode:er},setup(e){const{display:t,requirements:n,bought:r}=Ae(e),i=_t("");return Pt(()=>{const a=Pe(t);if(a==null){i.value="";return}if(At(a)){i.value=fe(a);return}const u=fe(a.title||"","h3"),l=fe(a.description,"div"),c=fe(a.effectDisplay||"");i.value=fe(j(()=>d("span",null,[a.title!=null?d("div",null,[d(u,null,null)]):null,d(l,null,null),a.effectDisplay!=null?d("div",null,[y("Currently: "),d(c,null,null)]):null,r.value?null:d(ne,null,[d("br",null,null),kr(n.value)])])))}),{component:i,unref:s,Visibility:Se,isVisible:Ze,isHidden:_n}}});const yp=["disabled"];function wp(e,t,n,r,i,a){var c;const u=Ct("MarkNode"),l=Ct("Node");return e.isVisible(e.visibility)?(S(),T("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]=(...p)=>e.purchase&&e.purchase(...p)),class:Ne({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)?(S(),re(Ke(e.unref(e.component)),{key:0})):B("",!0),d(u,{mark:e.unref(e.mark)},null,8,["mark"]),d(l,{id:e.id},null,8,["id"])],14,yp)):B("",!0)}var _p=be(bp,[["render",wp],["__scopeId","data-v-9be6bac0"]]);const ii=Symbol("Upgrade");function _i(e,...t){const n=ct(!1,!1),r=t.reduce((i,a)=>{var u;return Object.assign(i,(u=a.getPersistentData)==null?void 0:u.call(a))},{});return et(i=>{var c,p;const a=e.call(i,i);a.id=Qt("upgrade-"),a.type=ii,a[gt]=_p;for(const h of t)(c=h.preConstruct)==null||c.call(h,a);a.bought=n,Object.assign(a,r),a.canPurchase=w(()=>!n.value&&Cr(a.requirements)),a.purchase=function(){var g;const h=a;!s(h.canPurchase)||(ra(a.requirements),n.value=!0,(g=h.onPurchase)==null||g.call(h))};const u=ri(a);Bt(a.requirements)?a.requirements.unshift(u):a.requirements=[u,a.requirements],A(a,"visibility"),oe(a,"visibility",Se.Visible),A(a,"classes"),A(a,"style"),A(a,"display"),A(a,"mark");for(const h of t)(p=h.postConstruct)==null||p.call(h,a);const l=t.reduce((h,g)=>{var b;return Object.assign(h,(b=g.getGatheredProps)==null?void 0:b.call(g,a))},{});return a[dt]=function(){const{display:h,visibility:g,style:b,classes:v,requirements:k,canPurchase:C,bought:$,mark:x,id:I,purchase:R}=this;return{display:h,visibility:g,style:s(b),classes:v,requirements:k,canPurchase:C,bought:$,mark:x,id:I,purchase:R,...l}},a})}function Np(e,t,n=[]){n=n.length===0?Xn(e,ii):n;const r=Yn(t)?w(t):t;e.on("update",()=>{s(r)&&n.forEach(i=>i.purchase())})}function Cp(e,t,n,r){return function(){e>>>=0,t>>>=0,n>>>=0,r>>>=0;let i=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,r=r+1|0,i=i+r|0,n=n+i|0,(i>>>0)/4294967296}}const kp={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"]},Ni=[[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 qr(e){const t=Ni[Math.floor(e()*Ni.length)];let n="";for(let r=0;rn-20&&(a+=40);const[u,l,c]=Ip(a,r,i);return`rgb(${u*255}, ${l*255}, ${c*255})`}function Mp(e,t,n){const r=Math.max(e,t,n),i=r-Math.min(e,t,n),a=i&&(r==e?(t-n)/i:r==t?2+(n-e)/i:4+(e-t)/i);return[60*(a<0?a+6:a),r&&i/r,r]}function Ip(e,t,n){const r=(i,a=(i+e/60)%6)=>n-n*t*Math.max(Math.min(a,4-a,1),0);return[r(5),r(3),r(1)]}const ki=hr();function aa(e,t,n,r){return Kr(e,function(){const i=Cp(0,n>>0,n>>32,1);for(let V=0;V<12;V++)i();const a=qr(i),u=Ln([.56,.74,.73],i),l=Ln([.18,.2,.25],i),c=$n(0,qr(i)),p=ct(0),h=Et.indexOf(t);let g=i();const b=r.reduce((V,z)=>(V[z.type]=z.data,V),{});"increaseDiff"in b&&(g=g/2+.5),"decreaseDiff"in b&&(g=g/2),"relic"in b&&(g=1);const v=g+h+1,k=m.toolNodes.value.sandRelic!=null?te("sandRelic")?2:1:0,C=ct(k),$=w(()=>("increaseRewards"in b?v+1:v)+C.value);let x="relic"in b?h+2:Math.ceil(i()*(h+2));"increaseLength"in b&&x++;const I=[],R=Mt(()=>I),L=w(()=>R.apply(0)),ce=[],le={};function ae({feature:V,canClick:z,modifier:De,cost:rt,previewModifier:Sn,showETA:We,previewCost:Rt}){z=_e(z),We=_e(We);const Ut=vi(V);ce.push({shouldShowPreview:w(()=>s(z)&&Ut.value),modifier:Mt(()=>{const Wt=I.slice();return Wt.splice(Wt.indexOf(De),1,Sn),Wt}),cost:Rt!=null?Rt:rt}),I.push(De);const xt=Er(c,L,()=>Me(rt)),it=Or(V,{display:We==null?xt:()=>s(We)?xt.value:"",direction:W.Down});return{isHovering:Ut,eta:xt,tooltip:it}}const J=[],Ie=G(0);let he=f.variable(Ie).times(0),Ue=0,vt=!0;const K=w(()=>o.add(v,i()-.5).pow_base(2).times(10).times(he.evaluate()));for(let V=0;V=x-1?0:4};switch(ur(z,i)){case"upgrades":const P=[];for(let E=0;E<4;E++){const Z=ur({add:1,mult:V===0&&E===0?0:1},i),Te=K.value,Xe=xn(i);let je="",Oe,me;switch(Z){case"add":{const de=o.add(Te,10).pow(i()/4+1);je=`Gain ${xe(de)} ${c.displayName}/s`,he=he.add(de),Oe=at=>Ht(()=>({addend:de,description:Xe,enabled:at==null?we.bought:()=>at()&&we.bought.value})),me=Ht(()=>({addend:de}));break}case"mult":{const de=i()*5+1;je=`Multiply previous ${c.displayName} gain by x${xe(de)}.`;const at=Ue;he=he.add(o.sub(de,1).times(at)),Oe=Je=>Ce(()=>({multiplier:de,description:Xe,enabled:Je==null?we.bought:()=>Je()&&we.bought.value})),me=Ce(()=>({multiplier:de}));break}}Ue=he.evaluate(),Ie.value++;const Ee=vt,we=_i(()=>({requirements:Bn(()=>({resource:In(c),cost:Te,requiresPay:()=>m.toolNodes.value.unobtainiumRelic==null})),display:{title:Xe,description:je},visibility:w(()=>ye.value.length!==x&&s(Ee))}));ae({feature:we,canClick:()=>we.canPurchase.value,modifier:Oe(),cost:Te,previewCost:w(()=>m.toolNodes.value.unobtainiumRelic==null?Te:0),showETA:()=>!we.bought.value,previewModifier:me}),I.push(Oe(()=>Z==="add"?m.toolNodes.value.stoneRelic!=null:te("stoneRelic"))),P.push(we)}J.push(P);break;case"repeatables":const O=[];for(let E=0;E<3;E++){const Z=ur({add:1.5,mult:3},i),Te=Ie.value,Xe=K.value,je=xn(i);let Oe="",me,Ee,we,de;const at=f.variable(w(()=>ue.amount.value)).times(2);switch(Z){case"add":{const He=o.add(Xe,10).times(i()+.5);Oe=`Gain ${xe(He)} ${c.displayName}/s`,de=at.add(1).times(Xe),he=he.add(w(()=>o.sub(Ie.value,Te).times(2).add(1).pow(2).clampMax(100).times(He))),me=w(()=>xe(o.times(He,s(ue.totalAmount)))+"/s"),Ee=Ht(()=>({addend:()=>o.times(He,s(ue.totalAmount)),description:je,enabled:()=>o.gt(s(ue.totalAmount),0)})),we=Ht(()=>({addend:()=>o.add(s(ue.totalAmount),ue.amountToIncrease.value).times(He)}));break}case"mult":{const He=i()*.75+1.25;Oe=`Multiply previous ${c.displayName} gain by x${xe(He)}.`,de=at.add(1).pow_base(He).times(Xe);const lt=Ue;he=he.add(w(()=>o.sub(Ie.value,Te).times(2).add(1).pow(2).clampMax(100).pow_base(He).sub(1).times(lt))),me=w(()=>"x"+xe(o.pow(He,s(ue.totalAmount)))),Ee=Ce(()=>({multiplier:()=>o.pow(He,s(ue.totalAmount)),description:je,enabled:()=>o.gt(s(ue.totalAmount),0)})),we=Ce(()=>({multiplier:()=>o.add(s(ue.totalAmount),ue.amountToIncrease.value).pow_base(He)}));break}}Ue=he.evaluate(),Ie.value++;const Je=vt,ue=wi(()=>({requirements:Bn(()=>({resource:In(c),cost:de,maxBulkAmount:()=>m.toolNodes.value.diamondRelic!=null?o.dInf:1,requiresPay:()=>m.toolNodes.value.unobtainiumRelic==null})),display:()=>({title:je,description:`${Oe}

Amount: ${ut(ue.amount.value)}${o.gt(s(ue.bonusAmount),0)?` [+${ut(s(ue.bonusAmount))}]`:""}`,effectDisplay:s(me),showAmount:!1}),visibility:w(()=>ye.value.length!==x&&s(Je)),limit:100,bonusAmount:()=>o.gt(ue.amount.value,0)?te("dirtRelic")?2:m.toolNodes.value.dirtRelic!=null?1:0:0}),mp);ae({feature:ue,canClick:()=>s(ue.canClick),modifier:Ee,cost:de,previewModifier:we,previewCost:w(()=>m.toolNodes.value.unobtainiumRelic==null?sn(de,ue.amountToIncrease.value):0),showETA:()=>!ue.maxed.value}),O.push(ue)}J.push(O);break;case"conversion":{const E=$n(0,qr(i)),U=Ln([.56,.74,.73],i),Z=K.value,Te=i()/2+.25,Xe=i()/2+.25,je=Ie.value,Oe=Ue;he=he.add(w(()=>o.sub(Ie.value,je).add(1).pow10().times(Oe)));const me=fp(()=>({baseResource:In(c),gainResource:E,formula:Tr=>Tr.div(Z).pow(Te).times(w(()=>m.toolNodes.value.ironRelic!=null?te("ironRelic")?4:2:1)),spend(){c.value=0}}));Ue=he.evaluate(),Ie.value+=2;const Ee=vt,we=xn(i),de=f.variable(E).pow(Xe).add(1),at=Ce(()=>({multiplier:()=>de.evaluate(),description:we,enabled:()=>o.gt(E.value,0)})),Je=Ce(()=>({multiplier:()=>de.evaluate(o.add(E.value,me.actualGain.value))})),ue=yi(()=>({display:{title:we,description:j(()=>d("span",null,[y("Reset "),c.displayName,y(" for")," ",vr(E,o.clampMin(me.actualGain.value,1))," ",E.displayName,d("br",null,null),d("div",null,[y("Next:")," ",vr(c,o.lt(me.actualGain.value,1)?me.currentAt.value:me.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(me.actualGain.value,1),prestigeResource:E,onClick:me.convert,visibility:w(()=>ye.value.length!==x&&s(Ee))})),{isHovering:He}=ae({feature:ue,canClick:()=>s(ue.canClick),modifier:at,cost:Z,previewCost:c,previewModifier:Je}),lt=w(()=>He.value&&ue.canClick.value);J.push([ue]);const Vn=hn(f.variable(E),lt,me.actualGain),tt=hn(de,lt,me.actualGain);le[V*2]=j(()=>d(ne,null,[Ze(ue.visibility)?d("div",{style:"margin: 10px"},[y("You have")," ",d("h2",{style:{color:U,textShadow:`0px 0px 10px ${U}`}},[Vn()])," ",E.displayName,y(","),d("br",null,null),y("providing a "),tt(),y("x multiplier to previous")," ",c.displayName,y(" gain")]):null,Rr(ue)])),gp(this,me,()=>ye.value.lengthsn(me,Ee.value,!0,10)),de=w(()=>sn(me,o.add(Ee.value,1),!0,10)),at=w(()=>o.pow(Oe,Ee.value)),Je=Ce(()=>({multiplier:at,description:Te,enabled:()=>Ze(lt.visibility)})),ue=Ue;he=he.add(w(()=>o.sub(Ie.value,Z).add(1).times(3).pow(Oe).times(ue))),Ue=he.evaluate(),Ie.value+=2;const He=Ln([.56,.74,.73],i),lt=dp(()=>({direction:W.Right,width:300,height:20,progress:()=>o.sub(E.value,we.value).div(o.sub(de.value,we.value)).toNumber(),visibility:w(()=>ye.value.length!==x&&s(U)),xp:E,display:j(()=>d("span",null,[xe(E.value),y("/"),xe(de.value)])),fillStyle:`background-color: ${He}`,textStyle:"text-shadow: 5px 0 10px black"}));this.on("preUpdate",Vn=>{if(ye.value.lengthtt.state.id===e)&&Ze(lt.visibility)){let tt=o.times(pt.value,Vn);m.toolNodes.value.goldRelic!=null&&(tt=o.times(te("goldRelic")?.5:.25,ye.value.length).add(1).times(tt)),E.value=o.add(tt,E.value)}}),I.push(Je),J.push([lt]),le[V*2]=j(()=>d(ne,null,[Ze(lt.visibility)?d("div",{style:"margin: 10px"},[y("You have "),d("h3",null,[Te]),y(" Lv. "),ut(Ee.value),y(","),d("br",null,null),y("providing a "),xe(at.value),y("x multiplier to previous")," ",c.displayName,y(" gain"),d("br",null,null)]):null,Rr(lt)]));break}case"dimensions":{const E=xn(i),U=$n(0,E+" energy"),Z=Ln([.56,.74,.73],i),Te=Ie.value,Xe=Ue;he=he.add(w(()=>o.sub(Ie.value,Te).add(1).pow_base(32).add(1).log2().add(1).times(Xe)));const je=w(()=>o.add(U.value,1).log2().add(1)),Oe=Ce(()=>({multiplier:je,description:E,enabled:()=>o.gt(U.value,0)}));I.push(Oe);const me=vt,Ee=[];for(let we=0;we<4;we++){const de=o.add(v,i()-.5).pow_base(2).times(10).recip(),at=K.value,Je=f.variable(w(()=>tt.amount.value)),ue=Je.pow_base(o.pow10(we+1)).times(at),He=["First","Second","Third","Fourth"][we]+" "+E+" Dimension",lt=$n(0,He),Vn=Je.sub(1).pow_base(2).times(de).times(w(()=>o.add(tt.amount.value,lt.value))),tt=wi(()=>({display:{title:He,description:j(()=>d("div",null,[d("div",null,[y("Amount:")," ",xe(o.add(lt.value,tt.amount.value))," ",y("["),ut(tt.amount.value),y("]")])])),effectDisplay:j(()=>d("span",null,[oa()," ",we===0?U.displayName:["First","Second","Third","Fourth"][we-1]+" "+E+" Dimension",y("/s")])),showAmount:!1},style:{width:"400px"},effect:Vn,dimensions:lt,limit:100,energy:we===0?U:void 0,requirements:Bn(()=>({resource:In(c),cost:ue,maxBulkAmount:()=>te("diamondRelic")!=null?o.dInf:1,requiresPay:()=>!te("unobtainiumRelic")})),visibility:w(()=>ye.value.length!==x&&s(me))}));Ee.push(tt);const Tr=vi(tt),oi=w(()=>s(tt.canClick)&&Tr.value),sa=new f({inputs:[Je],evaluate(li){return o.sub(li,1).pow_base(2).times(de).times(o.add(li,lt.value))}}),oa=hn(sa,oi);ce.push({shouldShowPreview:oi,cost:w(()=>te("unobtainiumRelic")?0:sn(ue,tt.amountToIncrease.value))});const la=Er(c,L,()=>Me(ue));Or(tt,{display:la,direction:W.Down}),Ue=he.evaluate(),Ie.value++}this.on("preUpdate",we=>{if(ye.value.lengthde.state.id===e)&&Ze(me)){let de=o.times(pt.value,we);m.toolNodes.value.platinumRelic!=null&&(de=o.times(te("platinumRelic")?4:2,de));const at=Ee[0].effect.evaluate();U.value=o.times(at,de).add(U.value);for(let Je=1;Je<4;Je++){const ue=Ee[Je].effect.evaluate();Ee[Je-1].dimensions.value=o.times(ue,de).add(Ee[Je-1].dimensions.value)}}}),J.push(Ee),le[V*2]=j(()=>d(ne,null,[Ze(ye.value.length!==x&&s(me))?d("div",{style:"margin: 10px"},[y("You have")," ",d("h2",{style:{color:Z,textShadow:`0px 0px 10px ${Z}`}},[xe(U.value)])," ",U.displayName,y(","),d("br",null,null),y("providing a "),xe(je.value),y("x multiplier to previous")," ",c.displayName,y(" gain")]):null,Xs(...Ee)]));break}case"prestige":{const E=xn(i),U=vt,Z=i()/10+1.1,Te=K.value;he=he.pow(Z);const Xe=Nd(()=>({exponent:Z,description:E,enabled:me.bought}));Ue=he.evaluate(),Ie.value+=20;const je=J.filter((we,de)=>de%2===0),Oe=hp(()=>({thingsToReset:je,onReset(){c.value=0}})),me=_i(()=>({display:{title:E,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${xe(Z)}`},style:{width:"200px",minHeight:"100px"},onPurchase:()=>{te("unobtainiumRelic")||Oe.reset()},visibility:w(()=>ye.value.length!==x&&s(U)),requirements:Bn(()=>({resource:In(c),cost:Te,requiresPay:!1}))})),Ee=Ce(()=>({multiplier:0}));ae({feature:me,canClick:()=>s(me.canPurchase),modifier:Xe,cost:Te,previewCost:w(()=>te("unobtainiumRelic")?0:c.value),previewModifier:Ee,showETA:()=>!s(me.bought)}),J.push([me]);break}}const rt={cache:"increaseCaches"in b?8:.8,generation:"increaseGens"in b?10:1,resourceMulti:"increaseResourceMults"in b?10:1,energyMulti:"increaseEnergyMults"in b?2.5:.25,influences:"increaseInfluences"in b?20:2,relic:0};let Sn=ur(rt,i);V===x-1&&"relic"in b&&(Sn="relic");let We="",Rt,Ut,xt,it,Wt,nn;switch(Sn){case"cache":it=Vr(i,r),We=`Cache: Gain ${xe(o.div($.value,12))}x your current ${it} (no modifiers).`,Ut=()=>{var E,U,Z;return m.grantResource(it,o.times((Z=(U=(E=m.resourceNodes.value[it])==null?void 0:E.state)==null?void 0:U.amount)!=null?Z:0,o.div($.value,12)))};break;case"generation":it=Vr(i,r);const P=o.pow($.value,2).div(40).times(Tt[it]);We=`Gen: Gain ${xe(P)} ${it}/s while plane is active.`,Rt=E=>m.grantResource(it,o.times(E,P)),xt=it;break;case"resourceMulti":Wt=it=Vr(i,r),nn=o.pow($.value,2).div(10).pow_base(1.5),We=`Resource Mult: Gain ${xe(nn)}x ${it} while plane is active.`;break;case"energyMulti":Wt="energy",nn=o.div($.value,8).add(1),We=`Energy Mult: Gain ${xe(nn)}x energy while plane is active.`;break;case"influences":const O=Object.keys(yt)[Math.floor(i()*Object.keys(yt).length)];We=`Influence: Gain a portal influence (${yt[O].display})`,Ut=()=>{if(O in m.influenceNodes.value){ki.warning(`You already have a ${yt[O].display} influence, skipping treasure`);return}const E={id:An(m.board),position:{...m.board.types.portal.nodes.value.find(U=>U.state.id===e).position},type:"influence",state:{type:O,data:yt[O].initialData}};m.board.placeInAvailableSpace(E),m.board.nodes.value.push(E)};break;case"relic":We=t==="ultimatum"?"Win the game!":`Relic: Gain the ${t}-tier planar relic (${Ft[t]})`,Ut=()=>{if(t==="ultimatum"){ai.value=!0;return}if(`${t}Relic`in m.toolNodes.value)ki.warning(`You already have a ${Ft[t]} relic, skipping treasure`);else{const E={id:An(m.board),position:{...m.board.types.portal.nodes.value.find(U=>U.state.id===e).position},type:"passive",state:`${t}Relic`};m.board.placeInAvailableSpace(E),m.board.nodes.value.push(E)}}}const Dr=vt,Mn=K.value,fn=ap(()=>({requirements:Bn(()=>({resource:In(c),cost:Mn})),visibility:w(()=>s(Dr)),display:{requirement:`${xe(Mn)} ${c.displayName}`,effectDisplay:We},style:"width: 100%",classes:{final:V===x-1},update:Rt,onComplete:Ut,link:xt,effectedResource:Wt,resourceMulti:nn})),D=Er(c,L,Mn);Or(fn,{display:()=>fn.earned.value?"":D.value,direction:W.Down}),J.push([fn]),vt=fn.earned,le[V*2+1]=j(()=>mt(fn))}const $e=Xn(J,ii),nt=Xn(J,ia);I.push(Ce(()=>({multiplier:()=>te("silver")?4:2,description:()=>(te("silver")?"Empowered ":"")+ze.silver.name,enabled:()=>m.toolNodes.value.silver!=null})),Ce(()=>({multiplier:()=>o.add(1,(te("diamond")?2:1)*$e.filter(V=>V.bought.value).length/10),description:()=>(te("diamond")?"Empowered ":"")+ze.diamond.name,enabled:()=>m.toolNodes.value.diamond!=null})),Ce(()=>({multiplier:()=>o.div(p.value,6e3).times(te("emerald")?2:1).add(1),description:()=>(te("emerald")?"Empowered ":"")+ze.emerald.name,enabled:()=>m.toolNodes.value.emerald!=null})),Ce(()=>({multiplier:()=>o.div(nt.reduce((V,z)=>V.add(s(z.totalAmount)),o.dZero),100).times(te("gravelRelic")?2:1).add(1).pow(.75),description:()=>(te("gravelRelic")?"Empowered ":"")+Ft.gravel,enabled:()=>m.toolNodes.value.gravelRelic!=null})),Ce(()=>({multiplier:()=>o.add(m.energy.value,1).log10().add(1).pow(te("beryliumRelic")?.5:.25),description:()=>(te("beryliumRelic")?"Empowered ":"")+Ft.berylium,enabled:()=>m.toolNodes.value.beryliumRelic!=null})));const ht=Mt(()=>[Ce(()=>({multiplier:()=>{var V,z,De;return o.add((De=(z=(V=m.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:z.level)!=null?De:0,1)},description:"Booster",enabled:()=>{var V,z,De;return(De=(z=(V=m.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:z.portals.includes(e))!=null?De:!1}})),Ce(()=>({multiplier:()=>o.times(te("coalRelic")?.2:.1,ye.value.length).add(1),description:()=>(te("coalRelic")?"Empowered ":"")+Ft.coal,enabled:()=>m.toolNodes.value.coalRelic!=null}))]),pt=w(()=>ht.apply(1)),[St,Mr]=Un(()=>[{title:`${st(c.displayName)} Gain`,modifier:R,base:0,unit:"/s"},{title:`${st(c.displayName)} Time Speed`,modifier:ht,base:1,visible:()=>o.gt(pt.value,1)}]),kn=G(!1),rr=j(()=>d(Lt,{modelValue:kn.value,"onUpdate:modelValue":V=>kn.value=V},{header:()=>d("h2",null,[y("Modifiers")]),body:()=>ot(St)}));this.on("preUpdate",V=>{if(!m.activePortals.value.some(De=>De.state.id===e))return;const z=o.times(pt.value,V);p.value=o.add(p.value,z),ye.value.length{var rt;(rt=De.update)==null||rt.call(De,z)})}),Np(this,()=>ye.value.lengthye.value.length{const V=ce.find(z=>z.shouldShowPreview.value);return V?o.neg(Me(V.cost)):0}),On=w(()=>{const V=ce.find(z=>z.shouldShowPreview.value);return V&&V.modifier?o.sub(V.modifier.apply(0),L.value):0}),tn=hn(f.variable(0).add(c),()=>o.neq(Fn.value,0),Fn),qn=hn(f.variable(0).add(L),()=>o.neq(On.value,0),On),ir=w(()=>{const V=[];return ye.value.forEach(z=>{z.link&&V.push(z.link)}),V}),ar=w(()=>{const V={};return ye.value.forEach(z=>{z.effectedResource!=null&&z.resourceMulti!=null&&(V[z.effectedResource]!=null?V[z.effectedResource]=o.times(V[z.effectedResource],z.resourceMulti):V[z.effectedResource]=z.resourceMulti)}),V}),ye=w(()=>{const V=[];for(let z=1;zo.lt(ye.value.length,x)&&J.some(V=>V.some(z=>"earned"in z&&s(z.earned)||"bought"in z&&s(z.bought)?!1:("canClick"in z&&s(z.canClick)||"canPurchase"in z&&s(z.canPurchase),!0)))),xr=w(()=>{const V=J.findIndex((De,rt)=>rt>0&&rt%2===0&&!J[rt-1][0].earned.value);let z;return V===-1?z=J:z=J.slice(0,V),z.map((De,rt)=>rt in le?ot(le[rt]):Rr(...De))}),$r=yi(()=>({display:{description:"Select Portal Node"},onClick(){m.board.selectedNode.value=m.portalNodes.value[e]},style:"min-height: 30px; width: 200px; margin-bottom: 20px"}));return{tier:ct(t),seed:ct(n),influences:ct(r),name:a,color:u,resource:c,background:l,style:{background:l,"--background":l},classes:{plane:!0},features:J,resourceTabCollapsed:Mr,links:ir,resourceMultis:ar,earnedTreasures:ye,showNotif:Ir,timeActive:p,bonusRewardsLevel:C,display:j(()=>d(ne,null,[d(mr,{class:"nav-container",style:"z-index: 5"},{default:()=>[d("span",{class:"nav-segment"},[d("h2",null,[a])]),d("span",{class:"nav-segment"},[d("h3",null,[t,y("-tier")])]),r.length===0?null:d("span",{class:"nav-segment"},[d(qe,{display:r.map(V=>{const z=yt[V.type].description;return typeof z=="function"?z(V):z}).join("
"),direction:W.Down,style:"width: 300px"},{default:()=>[d("h3",null,[r.length,y(" influence"),r.length===1?"":"s"])]})]),d("span",{class:"nav-segment"},[d("button",{class:"button",style:"display: inline",onClick:()=>kn.value=!0},[y("modifiers")])])]}),ye.value.length===x?null:d(mr,{class:"nav-container"},{default:()=>[d("span",{class:"nav-segment"},[d("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[ot(tn)])," ",c.displayName]),d("span",{class:"nav-segment"},[y("("),d("h3",{style:`color: ${u}; text-shadow: 0px 0px 10px ${u};`},[o.gt(L.value,0)?"+":"",ot(qn)]),y("/s)")]),o.neq(pt.value,1)?d("span",{class:"nav-segment"},[y("Speed: "),xe(pt.value),y("x")]):null]}),d(Kd,{height:ye.value.length===x?"30px":"60px"},null),ot($r),ye.value.length===x?d("div",null,[d("h1",{style:"color: var(--layer-color)"},[y("Plane Complete!")])]):null,xr.value,ye.value.length+1d("div",null,[d("span",null,[a]),d("span",{style:"font-size: large; vertical-align: sub;"},[" ",t,y("-tier |")," ",ye.value.length===x?d("span",null,[y("Plane Complete")]):d("span",null,[ye.value.length,y("/"),x,y(" treasures")])])]))}})}function Vr(e,t){t=t.filter(l=>l.type==="increaseResources"||l.type==="decreaseResources");const n=Object.keys(Tt).reduce((l,c)=>{let p=Tt[c];return t.filter(h=>h.data===c).forEach(h=>{h.type==="increaseResources"?p*=1e3:p/=1e3}),l+p},0),r=Object.keys(Tt),i=Math.floor(e()*n);let a=0,u;for(let l=0;ll+c),r=Object.keys(e);let i=0,a=null;const u=t()*n;for(let l=0;le===m.board.selectedNode.value?{text:"Mining"}:Object.keys(m.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[jt,zt("mine")],progress:e=>ke(e)?new o(e.state.progress).toNumber():0,progressDisplay:un.Outline,progressColor:"var(--accent2)",classes:e=>({running:ke(e)}),draggable:!0},$p={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===m.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(m.energy.value,100)&&(e.type="factory",m.energy.value=o.sub(m.energy.value,100),m.helpModals.factory.showModal.value=!0)},confirmationLabel:()=>o.gte(m.energy.value,100)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},Dp={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===m.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${ze[e.state].name}`};if(((t=m.board.draggingNode.value)==null?void 0:t.type)==="resource"){const r=((n=m.board.draggingNode.value)==null?void 0:n.state).type,i=e.state===r?"Disconnect":m.toolNodes.value[r]==null?ze[r].name:"Already crafted",a=e.state===r||m.toolNodes.value[r]==null?"var(--accent2)":"var(--danger)";return{text:i,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,m.board.selectedAction.value=null,m.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${ze[e.state].name} - ${Ye(ze[e.state].cost)} energy`}),onClick(e){const t=ze[e.state];if(o.gte(m.energy.value,t.cost)&&m.toolNodes.value[e.state]==null){m.energy.value=o.sub(m.energy.value,t.cost);const n={id:An(m.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};if(m.board.placeInAvailableSpace(n),m.board.nodes.value.push(n),e.state==="iron"){const r={id:An(m.board),position:{...e.position},type:"trashCan"};m.board.placeInAvailableSpace(r),m.board.nodes.value.push(r)}m.board.selectedAction.value=null,m.board.selectedNode.value=null,e.state=void 0,t.type in m.helpModals&&(m.helpModals[t.type].showModal.value=!0)}},fillColor:e=>o.gte(m.energy.value,ze[e.state].cost)&&m.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(m.energy.value,ze[e.state].cost)?m.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}},zt("factory")],progress:e=>e.state==null||m.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(m.energy.value),o.sqrt(ze[e.state].cost)).clampMax(1).toNumber(),progressDisplay:un.Fill,progressColor:e=>e.state!=null&&o.gte(m.energy.value,ze[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){var r;if(t.type!=="resource")return!1;const n=((r=m.board.draggingNode.value)==null?void 0:r.state).type;return m.toolNodes.value[n]==null},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,m.board.selectedNode.value=e},draggable:!0},Tp=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],Pp={shape:Ge.Circle,size:50,title:e=>st(e.state.type),subtitle:e=>Ye(e.state.amount),otherSubtitle:e=>Tp[Et.indexOf(e.state.type)],progress:e=>Md(e.state.type),onClick(){},progressDisplay:un.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":m.dowsing.value!=null&&ke(m.dowsing.value)&&m.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=m.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0,showStar:e=>m.toolNodes.value[e.state.type]!=null,fillStar:e=>`${e.state.type}Relic`in m.toolNodes.value},Ap={shape:Ge.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Ft[t.slice(0,-5)]:ze[t].name},label:e=>e===m.board.selectedNode.value?{text:Vd[e.state].description(te(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":te(e.state)}),draggable:!0},Rp={shape:Ge.Diamond,size:50,title:"\u{1F962}",label:e=>e===m.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:Ji(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(2).pow_base(100),16),jt,zt("dowsing")],classes:e=>({running:ke(e)}),canAccept:Ki,onDrop:Qi,draggable:!0},Ep={shape:Ge.Diamond,size:50,title:"\u26F0\uFE0F",label:e=>e===m.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:Ji(e,t=>`Gather ${Nt(o.div(m.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(2).pow_base(1e4),16),jt,zt("quarry")],progress:e=>ke(e)?o.eq(m.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(m.quarryProgressRequired.value).toNumber():0,progressDisplay:un.Outline,progressColor:"var(--accent2)",canAccept:Ki,onDrop:Qi,classes:e=>({running:ke(e)}),draggable:!0},Fp={shape:Ge.Diamond,size:50,title:"\u{1F50C}",label:e=>e===m.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:Cd(e,t=>t.includes("Relic")?`Double ${Ft[t.slice(0,-5)]}'s effect`:`Double ${ze[t].name}'s effect`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(3).pow_base(1e3),24),jt,zt("empowerer")],canAccept:kd,onDrop:Sd,classes:e=>({running:ke(e)}),draggable:!0},Op={shape:Ge.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===m.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=m.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${st(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type;if(e.state.influences.includes(n))return{text:"Disconnect",color:"var(--accent2)"};const i=yt[n].cost;let a;return o.lt(i,1e3)?a=Ye(i):a=Ur(i,0),{text:`Add influence (${a}x cost)`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="portal")return{text:`Copy tier/influences from ${ge[t.state.id].name}`};return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},m.board.selectedAction.value=null,m.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal - ${Ye(m.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(m.energy.value,m.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(m.energy.value,m.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(m.energy.value,m.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in ge;)t++;m.energy.value=o.sub(m.energy.value,m.computedPortalCost.value);const{tier:n,influences:r}=e.state;Qr(aa(`portal-${t}`,n,Math.floor(Math.random()*4294967296),r.map(a=>m.influenceNodes.value[a].state)),Y);const i={id:An(m.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};m.board.placeInAvailableSpace(i),m.board.nodes.value.push(i),m.board.selectedAction.value=null,m.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null},zt("portalGenerator")],canAccept(e,t){return t.type==="resource"||t.type==="influence"||t.type==="portal"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,r=e.state.tier;e.state={...e.state,tier:n===r?void 0:n}}else if(t.type==="influence"){const n=t.state.type,r=e.state.influences;r.includes(n)?e.state={...e.state,influences:r.filter(i=>i!==n)}:e.state={...e.state,influences:[...r,n]}}else if(t.type==="portal"){const n=ge[t.state.id];e.state={...e.state,tier:n.tier.value,influences:n.influences.value.map(r=>r.type)}}m.board.selectedNode.value=e},progress:e=>e.state.tier==null?0:o.div(o.sqrt(m.energy.value),o.sqrt(m.computedPortalCost.value)).clampMax(1).toNumber(),progressDisplay:un.Fill,progressColor:e=>e.state.tier!=null&&o.gte(m.energy.value,m.computedPortalCost.value)?"var(--accent2)":"var(--foreground)",draggable:!0},qp={shape:Ge.Diamond,size:50,title:"\u{1F300}",label:e=>e===m.board.selectedNode.value?{text:`Portal to ${ge[e.state.id].name}`,color:ge[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[jt],classes:e=>({running:ke(e),showNotif:ge[e.state.id].showNotif.value,"affected-node":m.booster.value!=null&&ke(m.booster.value)&&m.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>ge[e.state.id].background,draggable:!0,onClick(e){m.board.selectedNode.value=e,ge[e.state.id].minimized.value=!1}},Vp={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?Ge.Diamond:Ge.Circle,size:50,title:e=>yt[e.state.type].display,otherSubtitle:e=>{const t=yt[e.state.type].cost;return o.lt(t,1e3)?`${Ye(t)}x cost`:`${Ur(t,0)}x cost`},label:e=>{if(e===m.board.selectedNode.value){const n=e.state,r=yt[n.type].description;return{text:typeof r=="function"?r(n):r}}const t=m.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:r,data:i}=e.state;let a;if(Array.isArray(i)&&i.includes(n))a="Disconnect";else if(r==="increaseResources")a=`Increase ${st(n)} odds`;else if(r==="decreaseResources")a=`Decrease ${st(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[pn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,r=e.state.data;r!=null&&(r.includes(n)?e.state={...e.state,data:r.filter(i=>i!==n)}:e.state={...e.state,data:[...r,n]},m.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},Bp={shape:Ge.Diamond,size:50,title:"\u231B",label:e=>e===m.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ye(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Boost ${ge[t].name}'s speed`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ye(or.evaluate(e.state.level))} energy`}},fillColor(e){return o.gte(m.energy.value,or.evaluate(e.state.level))?"var(--bought)":"var(--locked)"},confirmationLabel(e){return o.gte(m.energy.value,or.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=or.evaluate(e.state.level);o.gte(m.energy.value,t)&&(m.energy.value=o.sub(m.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},m.board.selectedAction.value=null)}},jt,zt("booster")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},Lp={shape:Ge.Diamond,size:50,title:"\u{1F916}",label:e=>e===m.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Auto-buy ${ge[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(4).pow_base(1e6)),jt,zt("upgrader")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},jp={shape:Ge.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===m.board.selectedNode.value?{text:e.state.portals.length===0?"Automator - Drag a portal to me!":`Automatating (${e.state.portals.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Auto-buy ${ge[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(4).pow_base(1e6)),jt,zt("automator")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},zp={shape:Ge.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===m.board.selectedNode.value?{text:e.state.portals.length===0?"Investments - Drag a portal to me!":`Investing (${e.state.portals.length}/${o.add(e.state.maxConnections,m.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Passively generate ${ge[t].name}'s conversions`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(3).pow_base(1e8)),jt,zt("investments")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},Gp={shape:Ge.Diamond,size:50,title:"\u{1F5D1}\uFE0F",label:e=>{var t;if(e===m.board.selectedNode.value)return{text:"Trash Can - Drag a portal to me!"};if(((t=m.board.draggingNode.value)==null?void 0:t.type)==="portal"){const n=m.board.draggingNode.value.state.id;return{text:`Delete ${ge[n].name}!`,color:"var(--danger)"}}return null},canAccept:(e,t)=>t.type==="portal",onDrop:(e,t)=>{const n=t.state.id;ei(ge[n]),delete Y.layers[n],m.board.state.value.nodes=m.board.state.value.nodes.filter(r=>r!==t),m.booster.value&&(m.booster.value.state={...m.booster.value.state,portals:m.booster.value.state.portals.filter(r=>r!==n)}),m.upgrader.value&&(m.upgrader.value.state={...m.upgrader.value.state,portals:m.upgrader.value.state.portals.filter(r=>r!==n)}),m.automator.value&&(m.automator.value.state={...m.automator.value.state,portals:m.automator.value.state.portals.filter(r=>r!==n)}),m.investments.value&&(m.investments.value.state={...m.investments.value.state,portals:m.investments.value.state.portals.filter(r=>r!==n)}),Y.tabs=Y.tabs.filter(r=>r!==n)},draggable:!0},Si=hr(),Up={mine:xp,brokenFactory:$p,factory:Dp,resource:Pp,passive:Ap,dowsing:Rp,quarry:Ep,empowerer:Fp,portalGenerator:Op,portal:qp,influence:Vp,booster:Bp,upgrader:Lp,automator:jp,investments:zp,trashCan:Gp},m=Kr("main",function(){const e=$n(0,"energy"),t=w(()=>v.types.resource.nodes.value.reduce((D,P)=>(D[P.state.type]=P,D),{})),n=w(()=>({...v.types.passive.nodes.value.reduce((D,P)=>(D[P.state]=P,D),{}),sand:v.types.dowsing.nodes.value[0],wood:v.types.quarry.nodes.value[0],coal:v.types.empowerer.nodes.value[0],iron:v.types.portalGenerator.nodes.value[0],gold:v.types.booster.nodes.value[0],platinum:v.types.upgrader.nodes.value[0],berylium:v.types.automator.nodes.value[0],ultimatum:v.types.investments.nodes.value[0]})),r=w(()=>Object.keys(Ft).filter(D=>`${D}Relic`in n.value).length),i=w(()=>({...v.types.influence.nodes.value.reduce((D,P)=>(D[P.state.type]=P,D),{})})),a=w(()=>({...v.types.portal.nodes.value.reduce((D,P)=>(D[P.state.id]=P,D),{})})),u=w(()=>Et.reduce((D,P)=>{var E,U,Z;const O=(Z=(U=(E=t.value[P])==null?void 0:E.state)==null?void 0:U.amount)!=null?Z:0;return D[P]=o.floor(Br.invert(O)),D},{})),l=ln({}),c=ln({});Xt(()=>{Et.forEach(D=>{wt(()=>u.value[D],(P,O)=>{const E=o.sub(P,O);(o.eq(P,1)||o.gt(E,1))&&o.gt(E,o.div(O,100))&&ie.active===Y.id&&Si.info(d("div",null,[d("h3",null,[o.eq(P,1)?`${st(D)} discovered`:`${st(D)} is now Level ${ut(P)}`,y("!")]),o.gt(E,1)?d("div",null,[y("Gained "),ut(E),y(" levels")]):null]))})})});const p=w(()=>J.filter(D=>{var P,O;return(O=(P=D.value)==null?void 0:P.state)==null?void 0:O.powered}).length+v.types.portal.nodes.value.filter(D=>D.state.powered).length),h=w(()=>{let D=p.value;return n.value.copperRelic!=null&&(D--,te("copperRelic")&&D--),D}),g=w(()=>{const D=h.value;return o.lt(D,0)?0:o.eq(D,0)?10:o.add(D,1).pow_base(100).div(10).times(.99)}),b=w(()=>{if(x.value==null)return 0;let P=x.value.state.resources.reduce((O,E)=>o.div(100,tn[E].computedModifier.value).add(O),o.dZero);return n.value.silverRelic!=null&&(P=o.div(P,o.add(p.value,1)),te("silverRelic")&&(P=o.div(P,o.add(p.value,1)))),P}),v=fd(D=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:Up,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const P=[];if(P.push(...Object.keys(l).filter(bi(k.value)).map(O=>({startNode:k.value,endNode:t.value[O],stroke:"var(--accent3)",strokeWidth:5}))),C.value!=null&&C.value.state!=null&&P.push({startNode:C.value,endNode:t.value[C.value.state],stroke:"var(--foreground)",strokeWidth:4}),$.value!=null&&$.value.state.resources.forEach(O=>{P.push({startNode:$.value,endNode:t.value[O],stroke:ke($.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),x.value!=null&&x.value.state.resources.forEach(O=>{P.push({startNode:x.value,endNode:t.value[O],stroke:O in c?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),I.value!=null&&I.value.state.tools.forEach(O=>{P.push({startNode:I.value,endNode:n.value[O],stroke:ke(I.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),R.value!=null){const O=R.value.state;O.tier!=null&&P.push({startNode:R.value,endNode:t.value[O.tier],stroke:"var(--foreground)",strokeWidth:4}),O.influences.forEach(E=>{P.push({startNode:R.value,endNode:i.value[E],stroke:"var(--foreground)",strokeWidth:4})}),D.types.portal.nodes.value.forEach(E=>{const U=ge[E.state.id];return Et.filter(bi(E)).forEach(Z=>{let Te;if(U.links.value.includes(Z))Te="var(--accent3)";else if(Z in U.resourceMultis.value)Te="var(--accent1)";else return;P.push({startNode:E,endNode:t.value[Z],stroke:ke(E)?Te:"var(--foreground)",strokeWidth:4})}),P})}return L.value!=null&&L.value.state.portals.filter(O=>a.value[O]!=null).forEach(O=>{P.push({startNode:L.value,endNode:a.value[O],stroke:ke(L.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),ce.value!=null&&ce.value.state.portals.filter(O=>a.value[O]!=null).forEach(O=>{P.push({startNode:ce.value,endNode:a.value[O],stroke:"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.filter(O=>a.value[O]!=null).forEach(O=>{P.push({startNode:le.value,endNode:a.value[O],stroke:"var(--foreground)",strokeWidth:4})}),ae.value!=null&&ae.value.state.portals.filter(O=>a.value[O]!=null).forEach(O=>{P.push({startNode:ae.value,endNode:a.value[O],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(i.value).forEach(O=>{const E=O.state;(E.type==="increaseResources"||E.type==="decreaseResources")&&E.data.forEach(U=>{P.push({startNode:O,endNode:t.value[U],stroke:"var(--foreground)",strokeWidth:4})})}),P}})),k=w(()=>v.types.mine.nodes.value[0]),C=w(()=>v.types.factory.nodes.value[0]),$=w(()=>n.value.sand),x=w(()=>n.value.wood),I=w(()=>n.value.coal),R=w(()=>n.value.iron),L=w(()=>n.value.gold),ce=w(()=>n.value.platinum),le=w(()=>n.value.berylium),ae=w(()=>n.value.ultimatum),J=[k,$,x,I,L,ce,le,ae];function Ie(D,P){let O=t.value[D];if(P=o.times(P,qn[D].computedModifier.value),O==null)O={id:An(v),position:{...k.value.position},type:"resource",state:{type:D,amount:P}},v.placeInAvailableSpace(O),v.nodes.value.push(O);else{const E=O.state;O.state={...E,amount:o.add(E.amount,P)}}}const he=w(()=>Object.keys(Tt).reduce((D,P)=>D+new o(tn[P].computedModifier.value).toNumber(),0)),Ue=w(()=>{const D={};return v.types.portal.nodes.value.forEach(P=>{if(!ke(P))return;const E=ge[P.state.id].resourceMultis.value;Object.keys(E).forEach(U=>{D[U]!=null?D[U]=o.times(D[U],E[U]):D[U]=E[U]})}),D}),vt=Mt(()=>Et.map(D=>Ht(()=>({description:()=>st(D),addend:()=>u.value[D],enabled:()=>o.gt(u.value[D],0)})))),K=w(()=>vt.apply(0)),$e=Mt(()=>[Ht(()=>({addend:K,description:"Resource Levels"})),Ce(()=>({multiplier:()=>o.pow(On.value,K.value),description:()=>`${Zt(On.value,3)}x per Resource Level`})),Ce(()=>({multiplier:()=>te("stone")?4:2,description:()=>(te("stone")?"Empowered ":"")+ze.stone.name,enabled:()=>n.value.stone!=null})),Ce(()=>({multiplier:()=>{var D;return(D=Ue.value.energy)!=null?D:1},description:"Planar Treasures",enabled:()=>{var D;return o.neq((D=Ue.value.energy)!=null?D:1,1)}})),Ht(()=>({addend:()=>o.pow(100,h.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(h.value,0)}))]),nt=w(()=>$e.apply(0)),ht=Mt(()=>[Ht(()=>({addend:()=>te("unobtainium")?2:1,description:()=>(te("unobtainium")?"Empowered ":"")+ze.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),pt=w(()=>ht.apply(0)),St=Mt(()=>[Ce(()=>({multiplier:()=>te("dirt")?4:2,description:()=>(te("dirt")?"Empowered ":"")+ze.dirt.name,enabled:()=>n.value.dirt!=null})),Ce(()=>({multiplier:()=>o.pow(r.value,te("woodRelic")?2:1),description:()=>(te("woodRelic")?"Empowered ":"")+Ft.wood,enabled:()=>n.value.woodRelic!=null}))]),Mr=w(()=>St.apply(1)),kn=Mt(()=>[Ce(()=>({multiplier:()=>te("gravel")?4:2,description:()=>(te("gravel")?"Empowered ":"")+ze.gravel.name,enabled:()=>n.value.gravel!=null}))]),rr=w(()=>kn.apply(1)),Fn=Mt(()=>[Ht(()=>({addend:()=>te("copper")?.004:.002,description:()=>(te("copper")?"Empowered ":"")+ze.copper.name,enabled:()=>n.value.copper!=null}))]),On=w(()=>Fn.apply(1.01)),tn=Object.keys(Tt).reduce((D,P)=>{const O=Mt(()=>[Ce(()=>({multiplier:2,description:"Dowsing",enabled:()=>$.value!=null&&ke($.value)&&$.value.state.resources.includes(P)}))]),E=w(()=>O.apply(Tt[P])),U={title:`${st(P)} Drop Rate`,modifier:O,base:Tt[P]};return D[P]={modifier:O,computedModifier:E,section:U},D},{}),qn=Object.keys(Tt).reduce((D,P)=>{const O=Mt(()=>[Ce(()=>({multiplier:()=>{var Z;return(Z=Ue.value[P])!=null?Z:1},description:"Planar Treasures",enabled:()=>{var Z;return o.neq((Z=Ue.value[P])!=null?Z:1,1)}}))]),E=w(()=>O.apply(1)),U={title:`${st(P)} Gain`,modifier:O};return D[P]={modifier:O,computedModifier:E,section:U},D},{}),ir=w(()=>{var P,O,E;const D=Et.indexOf((E=(O=(P=R.value)==null?void 0:P.state)==null?void 0:O.tier)!=null?E:"dirt");return o.add(D,1).times(D).div(2).add(9).pow10()}),ar=Mt(()=>[...Object.keys(yt).map(D=>Ce(()=>({multiplier:yt[D].cost,description:yt[D].display,enabled:()=>{var P,O,E;return(E=(O=(P=R.value)==null?void 0:P.state)==null?void 0:O.influences.includes(D))!=null?E:!1},smallerIsBetter:!0}))),Ce(()=>({multiplier:()=>te("emeraldRelic")?.05:.1,description:()=>(te("emeraldRelic")?"Empowered ":"")+Ft.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),ye=w(()=>ar.apply(ir.value)),[Ir,xr]=Un(()=>[{title:"Resource Levels",modifier:vt,base:0},{title:"Energy Gain",modifier:$e,base:0,unit:"/s"},{title:"Portal Cost",modifier:ar,base:ir,unit:" energy",baseText:()=>{var D,P,O;return`${st((O=(P=(D=R.value)==null?void 0:D.state)==null?void 0:P.tier)!=null?O:"dirt")}-tier Base Cost`},visible:()=>R.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:ht,base:0,visible:()=>o.gt(pt.value,0)}]),[$r,V]=Un(()=>[{title:"Mining Speed",modifier:St,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:kn,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:Fn,base:1.01,visible:()=>n.value.copper!=null}]),[z,De]=Un(()=>Object.values(tn).map(D=>D.section)),[rt,Sn]=Un(()=>Object.values(qn).map(D=>D.section)),We=Xi({general:()=>({display:"General",glowColor(){return We.activeTab.value===this.tab?"white":""},tab:Ir,energyTabCollapsed:xr}),mining:()=>({display:"Mine",glowColor(){return We.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(n.value).filter(D=>D!=null).length>0,tab:$r,miningTabCollapsed:V}),resources:()=>({display:"Ore Rates",glowColor(){return We.activeTab.value===this.tab?"white":""},visibility:()=>$.value!=null,tab:z,resourcesCollapsed:De}),resourcesGain:()=>({display:"Ore Gain",glowColor(){return We.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(qn).some(D=>o.neq(D.computedModifier.value,1)),tab:rt,resourceGainCollapsed:Sn})}),Rt=G(!1),Ut=j(()=>d(Lt,{modelValue:Rt.value,"onUpdate:modelValue":D=>Rt.value=D},{header:()=>d("h2",null,[y("Modifiers")]),body:()=>ot(We)})),xt={mine:jd(),factory:zd(),dowsing:Gd(),quarry:Ud(),empowerer:Wd(),portalGenerator:Hd(),booster:Yd(),upgrader:Zd(),automator:Xd(),investments:Jd()};xt.mine.showModal[Kt]=!0,xt.mine.showModal.value=!0,this.on("preUpdate",D=>{if(Object.keys(l).forEach(P=>{l[P]-=D,l[P]<=0&&delete l[P]}),Object.keys(c).forEach(P=>{c[P]-=D,c[P]<=0&&delete c[P]}),ke(k.value)){const P=o.add(k.value.state.progress,o.times(Mr.value,D)),O=P.floor();k.value.state={...k.value.state,progress:o.sub(P,O)};const E=O.div(he.value).floor();E.gt(0)&&Et.forEach(Z=>{Ie(Z,o.times(new o(tn[Z].computedModifier.value).toNumber(),E).times(rr.value)),l[Z]=.3});const U=o.sub(O,E).toNumber();for(let Z=0;Z0){let E=o.add(P,D);const U=o.div(P,b.value).floor();E=o.sub(E,o.times(U,b.value)),x.value.state={...x.value.state,progress:E},o.gt(U,0)&&O.forEach(Z=>{Ie(Z,U),c[Z]=.3})}}e.value=o.add(e.value,o.times(nt.value,D)),o.lt(e.value,0)&&(e.value=0,J.map(P=>P.value).filter(P=>P!=null).forEach(P=>{(P==null?void 0:P.state).powered=!1}),Object.values(a.value).forEach(P=>{P.state.powered=!1}),k.value.state={...k.value.state,powered:!1},Si.warning(d("div",null,[d("h3",null,[y("Ran out of energy!")]),d("div",null,[y("All machines have been turned off.")])])))});const it=w(()=>{var D,P;return v.selectedAction.value===v.types.brokenFactory.actions[0]?-100:v.selectedAction.value===v.types.factory.actions[1]?o.neg(ze[v.selectedNode.value.state].cost):((D=v.selectedAction.value)==null?void 0:D.id)==="moreConnections"?o.neg(v.selectedAction.value.formula.evaluate(((P=v.selectedNode.value)==null?void 0:P.state).maxConnections)):0}),Wt=hn(f.variable(0).add(e),()=>o.neq(it.value,0),it),nn=w(()=>{var D;return v.selectedAction.value===jt?((D=v.selectedNode.value)==null?void 0:D.state).powered?o.eq(p.value,1)?10:o.pow(100,p.value).div(10).times(.99):o.neg(g.value):0}),Dr=hn(f.variable(0).add(nt),()=>o.neq(nn.value,0),nn),Mn=w(()=>v.types.portal.nodes.value.filter(D=>ke(D))),fn=w(()=>Mn.value.sort((D,P)=>{var U,Z;const O=(U=ge[D.state.id])!=null&&U.minimized.value?1:0,E=(Z=ge[P.state.id])!=null&&Z.minimized.value?1:0;return O-E}).map(D=>D.state.id));return wt(fn,D=>{Xt(()=>{Y.tabs=["main",...D]})}),wt(pt,(D,P)=>{o.lt(D,P)&&(vn(D,$,"resources"),vn(D,x,"resources"),vn(D,I,"tools"),vn(D,L,"portals"),vn(D,ce,"portals"),vn(D,le,"portals"),vn(D,ae,"portals"))}),{name:"World",board:v,energy:e,modifierTabs:We,resourceNodes:t,toolNodes:n,influenceNodes:i,portalNodes:a,grantResource:Ie,activePortals:Mn,nextPowerCost:g,computedBonusConnectionsModifier:pt,quarryProgressRequired:b,dropRates:tn,dowsing:$,empowerer:I,booster:L,upgrader:ce,automator:le,investments:ae,resourceLevels:u,planarMultis:Ue,computedPortalCost:ye,helpModals:xt,display:j(()=>d(ne,null,[d(mr,{class:"nav-container"},{default:()=>[d("span",{class:"nav-segment"},[d("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[ot(Wt)])," ",y("energy")]),d("span",{class:"nav-segment"},[y("("),d("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(nt.value,0)?"+":"",ot(Dr)]),y("/s)")]),o.gt(p.value,0)?d("span",{class:"nav-segment"},[d("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[ut(p.value)])," ",o.eq(p.value,1)?"machine":"machines"," ",y("powered")]):null,d("span",{class:"nav-segment"},[d("button",{class:"button",style:"display: inline",onClick:()=>Rt.value=!0},[y("modifiers")])]),Y.devSpeed===0?d("span",{class:"nav-segment"},[y("Game Paused")]):Y.devSpeed!=null&&Y.devSpeed!==1?d("span",{class:"nav-segment"},[y("Dev Speed: "),xe(Y.devSpeed),y("x")]):null]}),ot(v),ot(Ut),Object.values(xt).map(({modal:D})=>D())]))}});Qe.on("loadSettings",e=>{oe(e,"lineVisibility",!0)});Oi(j(()=>d($t,{title:j(()=>d("span",{class:"option-title"},[y("Always show lines to resource nodes"),d("desc",null,[y("Otherwise, will only be visible when either end of the line is selected.")])])),modelValue:ie.lineVisibility,"onUpdate:modelValue":e=>ie.lineVisibility=e},null)));const Wp=e=>{var n,r,i,a,u;const t=[m];return(u=(a=(i=(r=(n=e.layers)==null?void 0:n.main)==null?void 0:r.board)==null?void 0:i.state)==null?void 0:a.nodes)==null||u.filter(l=>(l==null?void 0:l.type)==="portal").map(l=>{var c,p;return(p=(c=l==null?void 0:l.state)==null?void 0:c.id)!=null?p:""}).forEach(l=>{var p,h,g,b;const c=(p=e.layers)==null?void 0:p[l];t.push(aa(l,(h=c.tier)!=null?h:"dirt",(g=c.seed)!=null?g:Math.floor(Math.random()*4294967296),(b=c.influences)!=null?b:[]))}),t},ai=G(!1);function Hp(e,t){}var Yp=Object.freeze(Object.defineProperty({__proto__:null,main:m,getInitialLayers:Wp,hasWon:ai,fixOldSave:Hp},Symbol.toStringTag,{value:"Module"}));const nr=e=>(cn("data-v-4a50ce42"),e=e(),dn(),e),Zp={class:"game-over-modal-header"},Xp=["src","alt"],Jp={class:"game-over-modal-title"},Kp=nr(()=>N("h2",null,"Congratulations!",-1)),Qp={key:0},ef=nr(()=>N("br",null,null,-1)),tf=nr(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),nf=nr(()=>N("br",null,null,-1)),rf=["href"],af=nr(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),sf=X({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:r,discordLink:i,versionNumber:a,versionTitle:u}=ve,l=w(()=>yr(Y.timePlayed)),c=w(()=>ai.value&&!Y.keepGoing),p=Jt(Y,"autosave");function h(){Y.keepGoing=!0}function g(){bn(Tn())}return(b,v)=>(S(),re(Lt,{"model-value":s(c)},{header:H(()=>[N("div",Zp,[s(n)?(S(),T("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,Xp)):B("",!0),N("div",Jp,[Kp,N("h4",null,"You've beaten "+ee(s(t))+" v"+ee(s(a))+": "+ee(s(u)),1)])])]),body:H(({shown:k})=>[k?(S(),T("div",Qp,[N("div",null,"It took you "+ee(s(l))+" to beat the game.",1),ef,tf,nf,N("div",null,[N("a",{href:s(i),class:"game-over-modal-discord-link"},[af,y(" "+ee(s(r)),1)],8,rf)]),d($t,{title:"Autosave",modelValue:s(p),"onUpdate:modelValue":v[0]||(v[0]=C=>Ve(p)?p.value=C:null)},null,8,["modelValue"])])):B("",!0)]),footer:H(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:h,class:"button"},"Keep Going"),N("button",{onClick:g,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var of=be(sf,[["__scopeId","data-v-4a50ce42"]]);const Sr=e=>(cn("data-v-2776d67d"),e=e(),dn(),e),lf=Sr(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),uf={key:0},cf=Sr(()=>N("br",null,null,-1)),df=["href"],pf=Sr(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),ff=Sr(()=>N("br",null,null,-1)),gf={class:"nan-footer"},mf=X({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ve,r=G(!0),i=G(!0),a=Jt(Fe,"hasNaN"),u=G(null);wt(a,b=>{b?(r.value=Y.autosave,i.value=Y.devSpeed===0):(Y.autosave=r.value,Y.devSpeed=i.value?0:null)});const l=w(()=>{var b;return(b=Fe.NaNPath)==null?void 0:b.join(".")}),c=w(()=>Fe.NaNPersistent!=null?Fe.NaNPersistent.value:null);function p(){Fe.NaNPersistent!=null&&(Fe.NaNPersistent.value=new o(0),Fe.hasNaN=!1)}function h(){Fe.NaNPersistent&&(Fe.NaNPersistent.value=new o(1),Fe.hasNaN=!1)}function g(){Fe.NaNPersistent&&(Fe.NaNPersistent.value=new o(NaN),Fe.hasNaN=!1)}return(b,v)=>(S(),T(ne,null,[d(Lt,Vt({modelValue:s(a),"onUpdate:modelValue":v[4]||(v[4]=k=>Ve(a)?a.value=k:null)},b.$attrs),{header:H(()=>[lf]),body:H(()=>[N("div",null,[y(' Attempted to assign "'+ee(s(l))+'" to NaN',1),s(c)?(S(),T("span",uf,ee(" ")+"(previously "+ee(s(xe)(s(c)))+")",1)):B("",!0),y(". Auto-saving has been "+ee(r.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),cf,N("div",null,[N("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[pf,y(" "+ee(s(t)||"The Paper Pilot Community"),1)],8,df)]),ff,d($t,{title:"Autosave",modelValue:r.value,"onUpdate:modelValue":v[0]||(v[0]=k=>r.value=k)},null,8,["modelValue"]),s(ve).enablePausing?(S(),re($t,{key:0,title:"Pause game",modelValue:i.value,"onUpdate:modelValue":v[1]||(v[1]=k=>i.value=k)},null,8,["modelValue"])):B("",!0)]),footer:H(()=>[N("div",gf,[N("button",{onClick:v[2]||(v[2]=k=>{var C;return(C=u.value)==null?void 0:C.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:p,class:"button"},"Set to 0"),N("button",{onClick:h,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(S(),T("button",{key:0,onClick:v[3]||(v[3]=k=>a.value=!1),class:"button"}," Set to previous ")):B("",!0),N("button",{onClick:g,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),d(Wi,{ref_key:"savesManager",ref:u},null,512)],64))}});var vf=be(mf,[["__scopeId","data-v-2776d67d"]]);const hf={key:0,class:"tpsDisplay"},bf=X({__name:"TPS",setup(e){const t=w(()=>o.div(Fe.lastTenTicks.length,Fe.lastTenTicks.reduce((n,r)=>n+r,0)));return(n,r)=>s(t).isNan()?B("",!0):(S(),T("div",hf,"TPS: "+ee(s(ut)(s(t))),1))}});var yf=be(bf,[["__scopeId","data-v-89b89152"]]);var wf=X({__name:"App",setup(e){const t=ve.useHeader,n=w(()=>It[ie.theme].variables),r=Jt(ie,"showTPS"),i=Jt(Fe,"errors"),a=w(()=>fe(j(()=>d(ne,null,[Us.map(ot)]))));return(u,l)=>s(i).length>0?(S(),T("div",{key:0,class:"error-container",style:Le(s(n))},[d(xi,{errors:s(i)},null,8,["errors"])],4)):(S(),T(ne,{key:1},[N("div",{id:"modal-root",style:Le(s(n))},null,4),N("div",{class:Ne(["app",{useHeader:s(t)}]),style:Le(s(n))},[s(t)?(S(),re(Hi,{key:0})):B("",!0),d(Ac),s(s(r))?(S(),re(yf,{key:1})):B("",!0),d(of),d(vf),(S(),re(Ke(s(a))))],6)],64))}});var _f=be(wf,[["__scopeId","data-v-bf4e22ac"]]);function Nf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:u}=e;let l,c,p,h;const g=async(v=!0)=>{await p,v&&(l==null||l.addEventListener("controlling",k=>{k.isUpdate&&window.location.reload()})),await(h==null?void 0:h())};async function b(){if("serviceWorker"in navigator){const{Workbox:v,messageSW:k}=await Hn(()=>import("./workbox-window.4a8794bb.js"),[]);h=async()=>{c&&c.waiting&&await k(c.waiting,{type:"SKIP_WAITING"})},l=new v("./sw.js",{scope:"./",type:"classic"}),l.addEventListener("activated",C=>{C.isUpdate||r==null||r()});{const C=()=>{n==null||n()};l.addEventListener("waiting",C),l.addEventListener("externalwaiting",C)}l.register({immediate:t}).then(C=>{c=C,a?a("./sw.js",C):i==null||i(C)}).catch(C=>{u==null||u(C)})}}return p=b(),g}function Cf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:u}=e,l=G(!1),c=G(!1);return{updateServiceWorker:Nf({immediate:t,onNeedRefresh(){l.value=!0,n==null||n()},onOfflineReady(){c.value=!0,r==null||r()},onRegistered:i,onRegisteredSW:a,onRegisterError:u}),offlineReady:c,needRefresh:l}}const si=console.error;console.error=function(...e){si(...e)};window.onerror=function(e,t,n,r,i){return Fe.errors.push(i instanceof Error?i:new Error(JSON.stringify(i))),si(i),!0};window.onunhandledrejection=function(e){Fe.errors.push(e.reason instanceof Error?e.reason:new Error(JSON.stringify(e.reason))),si(e.reason)};document.title=ve.title;window.projInfo=ve;ve.id===""&&console.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 Bs();const{globalBus:e}=await Hn(()=>Promise.resolve().then(function(){return Vs}),void 0),{startGameLoop:t}=await Hn(()=>import("./gameLoop.a8abe3ac.js"),["assets/gameLoop.a8abe3ac.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/lz-string.dccec454.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=ba(_f);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Xt(()=>{const r=hr(),{updateServiceWorker:i}=Cf({onNeedRefresh(){r.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(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Hn as _,Fe as a,ve as b,Yp as c,Qe as g,Ls as l,Y as p,ie as s}; diff --git a/assets/index.8a0a226e.css b/assets/index.82a00c6b.css similarity index 99% rename from assets/index.8a0a226e.css rename to assets/index.82a00c6b.css index b5746c9..f93030a 100644 --- a/assets/index.8a0a226e.css +++ b/assets/index.82a00c6b.css @@ -1 +1 @@ -.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%)}}.error[data-v-ac351c02]{border:solid 10px var(--danger);position:absolute;top:0;left:0;right:0;min-height:calc(100% - 20px);text-align:left;color:var(--foreground)}.error-title[data-v-ac351c02]{background:var(--danger);color:var(--feature-foreground);display:block;margin:-10px 0 10px;position:sticky;top:0}.error-details[data-v-ac351c02]{white-space:nowrap;overflow:auto;padding:10px;background-color:var(--raised-background)}.instructions[data-v-ac351c02]{padding:10px}.discord-link[data-v-ac351c02]{display:inline}summary[data-v-ac351c02]{cursor:pointer;user-select:none}.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-a9f5b1da]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-a9f5b1da]: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-a9f5b1da]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-a9f5b1da]{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-a9f5b1da]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-a9f5b1da]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-a9f5b1da]{padding-bottom:0}.modal-body .layer-tab[data-v-a9f5b1da]:not(.hasSubtabs){padding-top:0}.minimize[data-v-a9f5b1da]{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-a9f5b1da]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-a9f5b1da]{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-a9f5b1da]: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}.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-58e8d695]{transition-duration:0s}.link.pulsing[data-v-58e8d695]{animation:pulsing-58e8d695 2s ease-in infinite}@keyframes pulsing-58e8d695{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-85b0e9a6]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-85b0e9a6]{fill:var(--highlighted)}.boardnode.running .body[data-v-85b0e9a6]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-85b0e9a6]{fill:var(--locked)}.node-title[data-v-85b0e9a6]{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-85b0e9a6]{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-85b0e9a6]{transition-duration:.05s}.progressRing[data-v-85b0e9a6]{transform:rotate(-90deg)}.fade-enter-from[data-v-85b0e9a6],.fade-leave-to[data-v-85b0e9a6]{opacity:0}.pulsing[data-v-85b0e9a6]{animation:pulsing-85b0e9a6 2s ease-in infinite}@keyframes pulsing-85b0e9a6{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:not(:last-child){border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.nav-segment .tooltip-container{display:inline}.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))}.plane .row{min-width:100%;margin:0}.plane .col{margin:0}.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}.bar[data-v-6bd06b56]{position:relative;display:table}.overlayTextContainer[data-v-6bd06b56]{position:absolute;border-radius:10px;vertical-align:middle;display:flex;justify-content:center;z-index:3}.overlayText[data-v-6bd06b56]{z-index:6}.border[data-v-6bd06b56]{border:2px solid;border-radius:10px;border-color:var(--foreground);overflow:hidden;mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);margin:0}.fill[data-v-6bd06b56]{position:absolute;background-color:var(--foreground);overflow:hidden;margin-left:-.5px;transition-duration:.2s;z-index:2;transition-duration:.05s}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.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-89b89152]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-89b89152]{color:var(--danger)}.fade-leave-to[data-v-89b89152]{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-bf4e22ac]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-bf4e22ac]{position:absolute;min-height:100%;height:100%;color:var(--foreground)}.error-container[data-v-bf4e22ac]{background:var(--background);overflow:auto;width:100%;height:100%}.error-container>.error[data-v-bf4e22ac]{position:static} +.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%)}}.error[data-v-ac351c02]{border:solid 10px var(--danger);position:absolute;top:0;left:0;right:0;min-height:calc(100% - 20px);text-align:left;color:var(--foreground)}.error-title[data-v-ac351c02]{background:var(--danger);color:var(--feature-foreground);display:block;margin:-10px 0 10px;position:sticky;top:0}.error-details[data-v-ac351c02]{white-space:nowrap;overflow:auto;padding:10px;background-color:var(--raised-background)}.instructions[data-v-ac351c02]{padding:10px}.discord-link[data-v-ac351c02]{display:inline}summary[data-v-ac351c02]{cursor:pointer;user-select:none}.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-a9f5b1da]{min-width:100%;min-height:100%;margin:0;flex-grow:1;display:flex;isolation:isolate}.layer-tab[data-v-a9f5b1da]: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-a9f5b1da]:not(.minimized){padding-top:50px}.layer-tab.minimized[data-v-a9f5b1da]{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-a9f5b1da]{margin:0;writing-mode:vertical-rl;text-align:left;padding-left:10px;width:50px}.inner-tab>.layer-container>.layer-tab[data-v-a9f5b1da]:not(.minimized){margin:-50px -10px;padding:50px 10px}.modal-body .layer-tab[data-v-a9f5b1da]{padding-bottom:0}.modal-body .layer-tab[data-v-a9f5b1da]:not(.hasSubtabs){padding-top:0}.minimize[data-v-a9f5b1da]{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-a9f5b1da]{transform:rotate(-90deg);top:10px;right:18px;pointer-events:none}.goBack[data-v-a9f5b1da]{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-a9f5b1da]: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}.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-0f903ba5]{transition-duration:0s}.link.pulsing[data-v-0f903ba5]{animation:pulsing-0f903ba5 2s ease-in infinite}@keyframes pulsing-0f903ba5{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-85b0e9a6]{cursor:pointer;transition-duration:0s}.boardnode:hover .body[data-v-85b0e9a6]{fill:var(--highlighted)}.boardnode.running .body[data-v-85b0e9a6]{fill:var(--accent1)!important}.boardnode:not(.isDraggable) .body[data-v-85b0e9a6]{fill:var(--locked)}.node-title[data-v-85b0e9a6]{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-85b0e9a6]{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-85b0e9a6]{transition-duration:.05s}.progressRing[data-v-85b0e9a6]{transform:rotate(-90deg)}.fade-enter-from[data-v-85b0e9a6],.fade-leave-to[data-v-85b0e9a6]{opacity:0}.pulsing[data-v-85b0e9a6]{animation:pulsing-85b0e9a6 2s ease-in infinite}@keyframes pulsing-85b0e9a6{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:not(:last-child){border-right:solid 1px var(--outline);padding-right:10px;margin-right:10px}.nav-segment .tooltip-container{display:inline}.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))}.plane .row{min-width:100%;margin:0}.plane .col{margin:0}.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}.bar[data-v-6bd06b56]{position:relative;display:table}.overlayTextContainer[data-v-6bd06b56]{position:absolute;border-radius:10px;vertical-align:middle;display:flex;justify-content:center;z-index:3}.overlayText[data-v-6bd06b56]{z-index:6}.border[data-v-6bd06b56]{border:2px solid;border-radius:10px;border-color:var(--foreground);overflow:hidden;mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);margin:0}.fill[data-v-6bd06b56]{position:absolute;background-color:var(--foreground);overflow:hidden;margin-left:-.5px;transition-duration:.2s;z-index:2;transition-duration:.05s}.upgrade[data-v-9be6bac0]{min-height:120px;width:120px;font-size:10px}.upgrade>*[data-v-9be6bac0]{pointer-events:none}.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-89b89152]{position:absolute;left:10px;bottom:10px;z-index:100}.low[data-v-89b89152]{color:var(--danger)}.fade-leave-to[data-v-89b89152]{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-bf4e22ac]{background-color:var(--background);color:var(--foreground);display:flex;flex-flow:column;min-height:100%;height:100%}#modal-root[data-v-bf4e22ac]{position:absolute;min-height:100%;height:100%;color:var(--foreground)}.error-container[data-v-bf4e22ac]{background:var(--background);overflow:auto;width:100%;height:100%}.error-container>.error[data-v-bf4e22ac]{position:static} diff --git a/assets/index.a102b2d9.js b/assets/index.a102b2d9.js new file mode 100644 index 0000000..26be8f0 --- /dev/null +++ b/assets/index.a102b2d9.js @@ -0,0 +1,21 @@ +/* empty css */import"./vue.c16a309b.js";import{q as ln,C as a,ab as X,t as G,aF as S,a1 as T,aL as qt,bv as Pn,G as Ne,as as Xt,_ as y,az as Qn,a2 as N,J as ee,O as ne,aK as Dt,a0 as B,I as Le,a8 as w,a9 as d,b7 as H,aI as cn,aG as dn,l as Ve,u as Lr,b2 as wt,aD as Mi,w as _t,b3 as Pt,ap as ca,aH as sr,A as Ae,$ as re,b9 as jr,ar as Vt,bt as da,bc as Wn,T as pa,j as fa,bw as Bt,ay as ga,aM as Ct,aO as Ke,z as Jt,bo as ma,bs as va,bd as ui,am as dr,H as ha,bx as ba,bf as ya}from"./@vue.6b211d3c.js";import{L as Yt}from"./lz-string.dccec454.js";import{c as Ii}from"./nanoevents.1080beb7.js";import{Y as wa}from"./vue-next-select.ded54c4a.js";import{D as _a}from"./vuedraggable.1879de79.js";import{p as Na}from"./vue-textarea-autosize.35804eaf.js";import{P as Ca}from"./vue-panzoom.8ce6f9b1.js";import{s as ka,u as hr}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const Sa=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}};Sa();const Ma="modulepreload",ci={},Ia="./",Hn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Ia}${r}`,r in ci)return;ci[r]=!0;const i=r.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${s}`))return;const l=document.createElement("link");if(l.rel=i?"stylesheet":Ma,i||(l.as="script",l.crossOrigin=""),l.href=r,document.head.appendChild(l),i)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},xa="./projInfo-schema.json",$a="Planar Pioneers",Da="A game about controlling and exploiting planes!",Ta="planar-pioneers",Pa="thepaperpilot",Aa="",Ra="",Ea="0.0",Fa="Initial Commit",Oa=!1,qa=!1,Va=2,Ba=!0,La=null,ja="",za=["main"],Ga=3600,Ua=0,Wa=!0,Ha="base64";var ve={$schema:xa,title:$a,description:Da,id:Ta,author:Pa,discordName:Aa,discordLink:Ra,versionNumber:Ea,versionTitle:Fa,allowGoBack:Oa,defaultShowSmall:qa,defaultDecimalsShown:Va,useHeader:Ba,banner:La,logo:ja,initialTabs:za,maxTickLength:Ga,offlineLimit:Ua,enablePausing:Wa,exportEncoding:Ha};const Ya=ln({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Y=window.player=Ya;function zr(e){return JSON.stringify(e,(t,n)=>a(n))}var be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Za=["onClick"],Xa=X({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=G(!1),r=G(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Xt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(s,l)=>(S(),T("button",{onClick:Pn(i,["stop"]),class:Ne(["feedback",{activated:n.value,left:e.left}])},[qt(s.$slots,"default",{},void 0,!0)],10,Za))}});var Gr=be(Xa,[["__scopeId","data-v-01a1b95c"]]);const br=e=>(cn("data-v-ac351c02"),e=e(),dn(),e),Ja={class:"error"},Ka={class:"error-title"},Qa={class:"error-details",style:{"margin-top":"-10px"}},es={key:0},ts={class:"instructions"},ns=["href"],rs=br(()=>N("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),is=br(()=>N("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),as=br(()=>N("br",null,null,-1)),ss={key:0,style:{"margin-top":"20px"}},os=br(()=>N("h3",null,"Other errors",-1)),ls=[os],us={class:"error-details"},cs={key:0,style:{"margin-top":"10px"}},ds={key:1,style:{"margin-top":"10px"}},ps=X({__name:"Error",props:{errors:null},setup(e){const t=e,n=y(()=>t.errors[0]),r=y(()=>t.errors.map(l=>l.stack==null?[]:l.stack.split(` +`))),i=y(()=>t.errors.map(l=>l.cause==null?[]:(typeof l.cause=="string"?l.cause:JSON.stringify(l.cause)).split(` +`)));function s(){let l=zr(Y);switch(ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":l=Yt.compressToUTF16(l);break;case"base64":l=btoa(unescape(encodeURIComponent(l)));break;case"plain":break}console.log(l);const u=document.createElement("textarea");u.value=l,document.body.appendChild(u),u.select(),u.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(u)}return Qn(()=>{Y.autosave=!1,Y.devSpeed=0}),(l,u)=>(S(),T("div",Ja,[N("h1",Ka,ee(a(n).name)+": "+ee(a(n).message),1),N("div",Qa,[a(n).cause?(S(),T("div",es,[(S(!0),T(ne,null,Dt(a(i)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))])):B("",!0),a(n).stack?(S(),T("div",{key:1,style:Le(a(n).cause?"margin-top: 10px":"")},[(S(!0),T(ne,null,Dt(a(r)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))],4)):B("",!0)]),N("div",ts,[w(" Check the console for more details, and consider sharing it with the developers on "),N("a",{href:a(ve).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,ns),w("! "),d(Gr,{onClick:s,class:"button",style:{display:"inline-flex"}},{default:H(()=>[rs,is]),_:1}),as,e.errors.length>1?(S(),T("div",ss,ls)):B("",!0),(S(!0),T(ne,null,Dt(e.errors.slice(1),(c,p)=>(S(),T("div",{key:p,style:{"margin-top":"20px"}},[N("details",us,[N("summary",null,ee(c.name)+": "+ee(c.message),1),c.cause?(S(),T("div",cs,[(S(!0),T(ne,null,Dt(a(i)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0),c.stack?(S(),T("div",ds,[(S(!0),T(ne,null,Dt(a(r)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0)])]))),128))])]))}});var xi=be(ps,[["__scopeId","data-v-ac351c02"]]);class fs{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 r=new gs(t,n);for(this.first===void 0?(this.first=r,this.last=r):(r.next=this.first,this.first.prev=r,this.first=r),this.map.set(t,r);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class gs{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Pr=17,ms=9e15,vs=Math.log10(9e15),hs=1/9e15,bs=308,ys=-324,di=5,ws=(1<<10)-1,_s=function(){const e=[];for(let n=ys+1;n<=bs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),gn=[2,Math.E,3,4,5,6,7,8,9,10],Ns=[[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]],Cs=[[-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 M=function(t){return o.fromValue_noAlloc(t)},Q=function(e,t,n){return o.fromComponents(e,t,n)},se=function(t,n,r){return o.fromComponents_noNormalize(t,n,r)};const rn=function(t,n){const r=n+1,i=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,r-i))*Math.pow(10,i-r);return parseFloat(s.toFixed(Math.max(r-i,0)))},Ar=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},ks=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 r=e*e;let i=e;return n=n+1/(12*i),i=i*r,n=n+1/(360*i),i=i*r,n=n+1/(1260*i),i=i*r,n=n+1/(1680*i),i=i*r,n=n+1/(1188*i),i=i*r,n=n+691/(360360*i),i=i*r,n=n+7/(1092*i),i=i*r,n=n+3617/(122400*i),Math.exp(n)/t},$i=.5671432904097838,pi=function(e,t=1e-10){let n,r;if(!Number.isFinite(e)||e===0)return e;if(e===1)return $i;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(r=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(r-n).5?1:-1;if(Math.random()*20<1)return se(t,0,1);const n=Math.floor(Math.random()*(e+1));let r=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(r=Math.trunc(r));let i=Math.pow(10,r);return Math.random()>.9&&(i=Math.trunc(i)),Q(t,n,i)}static affordGeometricSeries_core(e,t,n,r){const i=t.mul(n.pow(r));return _.floor(e.div(i).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,r){return t.mul(n.pow(r)).mul(_.sub(1,n.pow(e))).div(_.sub(1,n))}static affordArithmeticSeries_core(e,t,n,r){const s=t.add(r.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,r){const i=t.add(r.mul(n));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=ms)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=_.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const r=e.split("^^^");if(r.length===2){const k=parseFloat(r[0]),C=parseFloat(r[1]),$=r[1].split(";");let x=1;if($.length===2&&(x=parseFloat($[1]),isFinite(x)||(x=1)),isFinite(k)&&isFinite(C)){const I=_.pentate(k,C,x);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const i=e.split("^^");if(i.length===2){const k=parseFloat(i[0]),C=parseFloat(i[1]),$=i[1].split(";");let x=1;if($.length===2&&(x=parseFloat($[1]),isFinite(x)||(x=1)),isFinite(k)&&isFinite(C)){const I=_.tetrate(k,C,x);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const k=parseFloat(s[0]),C=parseFloat(s[1]);if(isFinite(k)&&isFinite(C)){const $=_.pow(k,C);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,u,c=e.split("pt");if(c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let k=parseFloat(c[1]);if(isFinite(k)||(k=1),isFinite(l)&&isFinite(u)){const C=_.tetrate(l,u,k);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let k=parseFloat(c[1]);if(isFinite(k)||(k=1),isFinite(l)&&isFinite(u)){const C=_.tetrate(l,u,k);return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}const p=e.split("e"),h=p.length-1;if(h===0){const k=parseFloat(e);if(isFinite(k))return this.fromNumber(k),_.fromStringCache.size>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}else if(h===1){const k=parseFloat(e);if(isFinite(k)&&k!==0)return this.fromNumber(k),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}const g=e.split("e^");if(g.length===2){this.sign=1,g[0].charAt(0)=="-"&&(this.sign=-1);let k="";for(let C=0;C=43&&$<=57||$===101)k+=g[1].charAt(C);else return this.layer=parseFloat(k),this.mag=parseFloat(g[1].substr(C+1)),this.normalize(),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}}if(h<1)return this.sign=0,this.layer=0,this.mag=0,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this;const b=parseFloat(p[0]);if(b===0)return this.sign=0,this.layer=0,this.mag=0,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this;let m=parseFloat(p[p.length-1]);if(h>=2){const k=parseFloat(p[p.length-2]);isFinite(k)&&(m*=Math.sign(k),m+=Ar(k))}if(!isFinite(b))this.sign=p[0]==="-"?-1:1,this.layer=h,this.mag=m;else if(h===1)this.sign=Math.sign(b),this.layer=1,this.mag=m+Math.log10(Math.abs(b));else if(this.sign=Math.sign(b),this.layer=h,h===2){const k=_.mul(Q(1,2,m),M(b));return this.sign=k.sign,this.layer=k.layer,this.mag=k.mag,_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}else this.mag=m;return this.normalize(),_.fromStringCache.maxSize>=1&&_.fromStringCache.set(t,_.fromDecimal(this)),this}fromValue(e){return e instanceof _?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:rn(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:rn(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<=di?(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):rn(this.m,e)+"e"+rn(this.e,e):this.layer===1?rn(this.m,e)+"e"+rn(this.e,e):this.layer<=di?(this.sign===-1?"-":"")+"e".repeat(this.layer)+rn(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+rn(this.mag,e)}abs(){return se(this.sign===0?0:1,this.layer,this.mag)}neg(){return se(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?_.dZero:this.layer===0?Q(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=M(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 se(0,0,0);let n,r;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(_.cmpabs(this,t)>0?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return _.fromNumber(n.sign*n.mag+r.sign*r.mag);const i=n.layer*Math.sign(n.mag),s=r.layer*Math.sign(r.mag);if(i-s>=2)return n;if(i===0&&s===-1){if(Math.abs(r.mag-Math.log10(n.mag))>Pr)return n;{const l=Math.pow(10,Math.log10(n.mag)-r.mag),u=r.sign+n.sign*l;return Q(Math.sign(u),1,r.mag+Math.log10(Math.abs(u)))}}if(i===1&&s===0){if(Math.abs(n.mag-Math.log10(r.mag))>Pr)return n;{const l=Math.pow(10,n.mag-Math.log10(r.mag)),u=r.sign+n.sign*l;return Q(Math.sign(u),1,Math.log10(r.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-r.mag)>Pr)return n;{const l=Math.pow(10,n.mag-r.mag),u=r.sign+n.sign*l;return Q(Math.sign(u),1,r.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(M(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=M(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return se(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return se(this.sign*t.sign,0,1);let n,r;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return _.fromNumber(n.sign*r.sign*n.mag*r.mag);if(n.layer>=3||n.layer-r.layer>=2)return Q(n.sign*r.sign,n.layer,n.mag);if(n.layer===1&&r.layer===0)return Q(n.sign*r.sign,1,n.mag+Math.log10(r.mag));if(n.layer===1&&r.layer===1)return Q(n.sign*r.sign,1,n.mag+r.mag);if(n.layer===2&&r.layer===1){const i=Q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Q(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return Q(n.sign*r.sign,i.layer+1,i.sign*i.mag)}if(n.layer===2&&r.layer===2){const i=Q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(Q(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return Q(n.sign*r.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=M(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?_.dNaN:this.layer===0?Q(this.sign,0,1/this.mag):Q(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=M(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,r=t.mag>0?t.layer:-t.layer;return n>r?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=M(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=M(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let r=this.mag,i=n.mag;return this.layer>n.layer&&(i=Ar(i)),this.layer0?Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Q(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?_.dNaN:this.layer>0?Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Q(this.sign,0,Math.log10(this.mag))}log(e){return e=M(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?_.dNaN:this.layer===0&&e.layer===0?Q(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):_.div(this.log10(),e.log10())}log2(){return this.sign<=0?_.dNaN:this.layer===0?Q(this.sign,0,Math.log2(this.mag)):this.layer===1?Q(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Q(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?_.dNaN:this.layer===0?Q(this.sign,0,Math.log(this.mag)):this.layer===1?Q(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Q(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=M(e),n=this,r=t;if(n.sign===0)return r.eq(0)?se(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(r.sign===0)return se(1,0,1);if(r.sign===1&&r.layer===0&&r.mag===1)return n;const i=n.absLog10().mul(r).pow10();return this.sign===-1?Math.abs(r.toNumber()%2)%2===1?i.neg():Math.abs(r.toNumber()%2)%2===0?i:_.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return _.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return Q(1,0,t);if(e.sign===0)return _.dOne;e=se(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Q(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Q(-e.sign,e.layer+1,-e.mag):_.dOne}pow_base(e){return M(e).pow(this)}root(e){const t=M(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(se(1,0,24)))return _.fromNumber(ks(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 r=e,i=12*r,s=1/i,l=t+s;if(l===t||(t=l,r=r*n,i=360*r,s=1/i,l=t-s,l===t))return _.exp(t);t=l,r=r*n,i=1260*r;let u=1/i;return t=t+u,r=r*n,i=1680*r,u=1/i,t=t-u,_.exp(t)}else return this.layer===1?_.exp(_.mul(this,_.ln(this).sub(1))):_.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?_.dOne:this.layer===0&&this.mag<=709.7?_.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Q(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Q(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Q(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return _.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Q(1,2,Math.log10(this.mag)-.3010299956639812);{const e=_.div(se(this.sign,this.layer-1,this.mag),se(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=se(1,0,1)){if(e===1)return _.pow(this,t);if(e===0)return new _(t);if(this.eq(_.dOne))return _.dOne;if(this.eq(-1))return _.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return _.fromNumber(Math.E);const s=_.ln(this).neg();return s.lambertw().div(s)}else return i>1.444667861009766?_.fromNumber(Number.POSITIVE_INFINITY):_.dNaN}if(this.eq(_.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),_.fromNumber(i)}if(e<0)return _.iteratedlog(t,this,-e);t=M(t);const n=e;e=Math.trunc(e);const r=n-e;if(this.gt(_.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i3)return se(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=se(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return _.tetrate(e,-t,this);e=M(e);let n=_.fromDecimal(this);const r=t;t=Math.trunc(t);const i=r-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 i>0&&i<1&&(e.eq(10)?n=n.layeradd10(-i):n=n.layeradd(-i,e)),n}slog(e=10,t=100){let n=.001,r=!1,i=!1,s=this.slog_internal(e).toNumber();for(let l=1;l1&&i!=c&&(r=!0),i=c,r?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),s+=n,n===0)break}return _.fromNumber(s)}slog_internal(e=10){if(e=M(e),e.lte(_.dZero)||e.eq(_.dOne))return _.dNaN;if(e.lt(_.dOne))return this.eq(_.dOne)?_.dZero:this.eq(_.dZero)?_.dNegOne:_.dNaN;if(this.mag<0||this.eq(_.dZero))return _.dNegOne;let t=0,n=_.fromDecimal(this);if(n.layer-e.layer>3){const r=n.layer-e.layer-3;t+=r,n.layer-=r}for(let r=0;r<100;++r)if(n.lt(_.dZero))n=_.pow(e,n),t-=1;else{if(n.lte(_.dOne))return _.fromNumber(t+_.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=_.log(n,e)}return _.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:_.critical_section(e,t,Cs)}static tetrate_critical(e,t){return _.critical_section(e,t,Ns)}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 r=0,i=0;for(let l=0;le){const u=(e-gn[l])/(gn[l+1]-gn[l]);r=n[l][Math.floor(t)]*(1-u)+n[l+1][Math.floor(t)]*u,i=n[l][Math.ceil(t)]*(1-u)+n[l+1][Math.ceil(t)]*u;break}const s=t-Math.floor(t);return r<=0||i<=0?r*(1-s)+i*s:Math.pow(e,Math.log(r)/Math.log(e)*(1-s)+Math.log(i)/Math.log(e)*s)}layeradd10(e){e=_.fromValue_noAlloc(e).toNumber();const t=_.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 r=0;r<100;++r){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 r=this.slog(t).toNumber()+e;return r>=0?_.tetrate(t,r):Number.isFinite(r)?r>=-1?_.log(_.tetrate(t,r+1),t):_.log(_.log(_.tetrate(t,r+2),t),t):_.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return _.fromNumber(pi(this.toNumber()));if(this.layer===0)return _.fromNumber(pi(this.sign*this.mag));if(this.layer===1)return fi(this);if(this.layer===2)return fi(this);if(this.layer>=3)return se(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return se(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=se(1,0,1)){t=M(t);const n=e;e=Math.trunc(e);const r=n-e;r!==0&&(t.eq(_.dOne)?(++e,t=_.fromNumber(r)):this.eq(10)?t=t.layeradd10(r):t=t.layeradd(r,this));for(let i=0;i10)return t}return t}sin(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.sin(this.sign*this.mag)):se(0,0,0)}cos(){return this.mag<0?_.dOne:this.layer===0?_.fromNumber(Math.cos(this.sign*this.mag)):se(0,0,0)}tan(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.tan(this.sign*this.mag)):se(0,0,0)}asin(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.asin(this.sign*this.mag)):se(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?_.fromNumber(Math.acos(this.toNumber())):this.layer===0?_.fromNumber(Math.acos(this.sign*this.mag)):se(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?_.fromNumber(Math.atan(this.sign*this.mag)):_.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 _.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return _.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?se(Number.NaN,Number.NaN,Number.NaN):_.ln(this.add(1).div(_.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(_.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=_;o.fromStringCache=new fs(ws);o.dZero=se(0,0,0);o.dOne=se(1,0,1);o.dNegOne=se(-1,0,1);o.dTwo=se(1,0,2);o.dTen=se(1,0,10);o.dNaN=se(Number.NaN,Number.NaN,Number.NaN);o.dInf=se(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=se(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=Q(1,0,Number.MAX_VALUE);o.dNumberMin=Q(1,0,Number.MIN_VALUE);M=o.fromValue_noAlloc;Q=o.fromComponents;se=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const Ss=new o(1);function jn(e,t,n=!0){let r=o.log10(e).floor(),i=o.div(e,o.pow(10,r));i.toStringWithDecimalPlaces(t)==="10"&&(i=Ss,r=r.add(1));const s=r.gte(1e9)?Nt(r,Math.max(Math.max(t,3),ve.defaultDecimalsShown)):r.gte(1e4)?pr(r,0):r.toStringWithDecimalPlaces(0);return n?i.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function pr(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const r=e.toStringWithDecimalPlaces(t).split(".");return r[0]=r[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),r.length==1?r[0]:r[0]+"."+r[1]}function Di(e,t){return e==null?"NaN":(e=new o(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),ve.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const Ms=new o("eeee1000"),Is=new o("e100000"),gi=new o("e1000"),Ti=new o(1e9),xs=new o(1e6),$s=new o(1e3),Ds=new o(.98),Ts=new o(.001),Pi=new o(0);function Nt(e,t,n){if(t==null&&(t=ve.defaultDecimalsShown),n=n!=null?n:ve.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+Nt(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(Ms)){const r=e.slog();return r.gte(xs)?"F"+Nt(r.floor()):o.pow(10,r.sub(r.floor())).toStringWithDecimalPlaces(3)+"F"+pr(r.floor(),0)}else{if(e.gte(Is))return jn(e,0,!1);if(e.gte(gi))return jn(e,0);if(e.gte(Ti))return jn(e,t);if(e.gte($s))return pr(e,0);if(e.gte(Ts)||!n)return Di(e,t);if(e.eq(Pi))return 0 .toFixed(t)}return e=Ri(e),e.lt(gi)?jn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):Nt(e,t)+"\u207B\xB9"}function Ye(e){return e=new o(e),e.sign<0?"-"+Ye(e.neg()):e.gte(Ti)||e.lte(Ds)&&!e.eq(Pi)?Nt(e):Nt(e,0)}function Ai(e){return o.lt(e,0)?"-"+Ai(o.neg(e)):o.gt(e,2**51)?Nt(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?Nt(e)+"s":e<3600?Ye(Math.floor(e/60))+"m "+Nt(e%60)+"s":e<86400?Ye(Math.floor(e/3600))+"h "+Ye(Math.floor(e/60)%60)+"m "+Ye(e%60)+"s":e<31536e3?Ye(Math.floor(e/84600)%365)+"d "+Ye(Math.floor(e/3600)%24)+"h "+Ye(Math.floor(e/60)%60)+"m":Ye(Math.floor(e/31536e3))+"y "+Ye(Math.floor(e/84600)%365)+"d "+Ye(Math.floor(e/3600)%24)+"h")}function Ps(e,t,n){e=new o(e);let r=e.toStringWithDecimalPlaces(t);return new o(r).gte(n)&&(r=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),r}function As(e,t){return Nt(e,t,!0)}function Ri(e){let t=o.log10(e).ceil();const n=o.div(e,o.pow(10,t));return t=t.neg(),e=new o(10).pow(t).times(n),e}var Rs=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:jn,commaFormat:pr,regularFormat:Di,format:Nt,formatWhole:Ye,formatTime:Ai,toPlaces:Ps,formatSmall:As,invertOOM:Ri},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:Ur,commaFormat:Es,regularFormat:Fs,format:xe,formatWhole:ut,formatTime:yr,toPlaces:Os,formatSmall:Zt,invertOOM:qs}=Rs;window.Decimal=o;window.exponentialFormat=Ur;window.commaFormat=Es;window.regularFormat=Fs;window.format=xe;window.formatWhole=ut;window.formatTime=yr;window.toPlaces=Os;window.formatSmall=Zt;window.invertOOM=qs;function st(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Vs(e){return(e[0]+e.slice(1).replace(/[A-Z]/g,t=>`-${t}`)).toLowerCase()}function Yn(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 Zn=Symbol("DoNotCache");function A(e,t){const n=e[t];Yn(n)&&n.length===0&&!n[Zn]?e[t]=y(n.bind(e)):Yn(n)&&(e[t]=n.bind(e),e[t][Zn]=!0)}function _e(e){return Yn(e)&&!e[Zn]&&(e=y(e)),e}const gt=Symbol("Component"),dt=Symbol("GatherProps");let Bs=0;function Qt(e="feature-"){return e+Bs++}var Se=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Se||{});function Ze(e){const t=a(e);return t!==2&&t!==!1}function _n(e){return a(e)===1}function j(e){return e[Zn]=!0,e}function oe(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Xn(e,...t){const n=[],r=i=>{Object.keys(i).forEach(s=>{const l=i[s];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof o)&&!Ve(l)&&r(l))})};return r(e),n}var Fe=window.state=Lr({lastTenTicks:[],hasNaN:!1,NaNPath:[],errors:ln([])});const mn={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 Wr=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Wr||{}),It={classic:mn,paper:{...mn,variables:{...mn.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:{...mn,variables:{...mn.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:{...mn,variables:{...mn.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Qe=Ii();"fonts"in document&&(document.fonts.onloadingdone=()=>Qe.emit("fontsLoaded"));var Ls=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Qe},Symbol.toStringTag,{value:"Module"}));function Ei(e={}){return Object.assign({id:`${ve.id}-0`,name:"Default Save",tabs:ve.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:ve.id,modVersion:ve.versionNumber,layers:{}},e)}function bt(e){const t=Yt.compressToUTF16(zr(e!=null?e:Y));return localStorage.setItem((e!=null?e:Y).id,t),t}async function js(){Us();try{let e=localStorage.getItem(ie.active);if(e==null){await bn(Tn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==ve.id){await bn(Tn());return}t.id=ie.active,await bn(t)}catch(e){console.error(`Failed to load save. Falling back to new save. +`,e),await bn(Tn())}}function Tn(){const e=cr(),t=Ei({id:e});return bt(t),ie.saves.push(e),t}function cr(){let e,t=0;do e=`${ve.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const zs=G(!1);async function bn(e){console.info("Loading save",e),zs.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await Hn(()=>Promise.resolve().then(function(){return Bl}),void 0),{fixOldSave:i,getInitialLayers:s}=await Hn(()=>Promise.resolve().then(function(){return Xp}),void 0);for(const l in t){const u=t[l];u&&n(u)}s(e).forEach(l=>r(l,e)),e=Ei(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,ve.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ve.versionNumber&&(i(e.modVersion,e),e.modVersion=ve.versionNumber),Object.assign(Y,e),ie.active=Y.id,Qe.emit("onLoad")}setInterval(()=>{Y.autosave&&bt()},1e3);window.onbeforeunload=()=>{Y.autosave&&bt()};window.save=bt;const Gs=window.hardReset=async()=>{await bn(Tn())};window.deleteLowerSaves=()=>{const e=Object.values(ie.saves).indexOf(Y.id)+1;Object.values(ie.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ie.saves=ie.saves.slice(0,e)};const Jn=ln({active:"",saves:[],showTPS:!0,theme:Wr.Nordic,unthrottled:!1,alignUnits:!1});wt(Jn,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ve.id,t)},{deep:!0});var ie=window.settings=Jn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Wr.Nordic,alignUnits:!1};Qe.emit("loadSettings",e),Object.assign(Jn,e),Gs()};function Us(){try{let e=localStorage.getItem(ve.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Jn,t)}Qe.emit("loadSettings",Jn)}catch{}}const Fi=ln([]);function Oi(e){Fi.push(e)}const Ws=ln([]),Hs=ln([]),Ys={class:"table"},Zs=X({__name:"Column",setup(e){const t=y(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Ys,[N("div",{class:Ne(["col",{mergeAdjacent:a(t)}])},[qt(n.$slots,"default")],2)]))}}),Xs={class:"table"},Js=X({__name:"Row",setup(e){const t=y(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Xs,[N("div",{class:Ne(["row",{mergeAdjacent:a(t)}])},[qt(n.$slots,"default")],2)]))}});function qi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ca(e)}function fe(e,t="span"){return typeof e=="function"?X({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),X({template:e})):X({render:()=>({})}):e}function ot(e){if(At(e))return typeof e=="function"?e():fe(e);const t=e[gt];return d(t,e[dt](),null)}function Rr(...e){let t;return d(Js,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function Ks(...e){let t;return d(Zs,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function mt(e){if(At(e))return typeof e=="function"?e():typeof e=="string"?d(ne,null,[e]):d(e,null,null);const t=e[gt];return d(t,e[dt](),null)}function mi(e,t){return e.reduce((n,r)=>d(ne,null,[n,t,r]))}function At(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Zn]===!0}function Vi(e,t){const n=G(null),r=G(void 0);function i(u){n.value||(n.value=setInterval(l,250)),r.value=u}function s(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return Mi(s),{start:i,stop:s,handleHolding:l}}function Hr(e,t="div"){const n=_t();return Pt(()=>{n.value=fe(Pe(e),t)}),n}function Rn(e,t="div"){const n=_t(null);return Pt(()=>{const r=Pe(e);n.value=r==""||r==null?null:fe(r,t)}),n}function Pe(e){return a(a(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function vi(e){const t=G(!1),n=e[dt].bind(e);return e[dt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}function Bi(e){return Object.keys(e).reduce((t,n)=>(t[Vs(n)]=e[n],t),{})}const Qs=X({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=G({}),r=new ResizeObserver(u),i=G(null);Qn(()=>{const g=i.value;g!=null&&r.observe(g)});let s=!0,l=G((h=i.value)==null?void 0:h.getBoundingClientRect());function u(){s&&(s=!1,Xt(()=>{var g;l.value=(g=i.value)==null?void 0:g.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),s=!0}))}Qe.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};sr(Yr,(g,b)=>{const m=new MutationObserver(()=>p(g));m.observe(b,c),n.value[g]={element:b,observer:m,rect:b.getBoundingClientRect()},u()}),sr(Zr,g=>{var b;(b=n.value[g])==null||b.observer.disconnect(),n.value[g]=void 0,u()}),sr(Xr,n),sr(Jr,l);function p(g){const b=n.value[g];b!=null&&(b.rect=b.element.getBoundingClientRect(),t("updateNodes",n.value))}return(g,b)=>(S(),T(ne,null,[qt(g.$slots,"default",{},void 0,!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var Li=be(Qs,[["__scopeId","data-v-2b1dc1bc"]]);const eo=["onPointerdown"],to={class:"modal-wrapper"},no={class:"modal-container"},ro={class:"modal-header"},io={class:"modal-body"},ao={class:"modal-footer"},so=N("div",{class:"modal-default-flex-grow"},null,-1),Lt=X({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=Ae(e),s=y(()=>a(i.modelValue)||u.value);function l(){n("update:modelValue",!1)}const u=G(!1),c=G(null),p=y(()=>{var h,g;return(g=(h=c.value)==null?void 0:h.nodes)!=null?g:null});return t({isOpen:s,nodes:p}),(h,g)=>(S(),re(pa,{to:"#modal-root"},[d(Wn,{name:"modal",onBeforeEnter:g[0]||(g[0]=b=>u.value=!0),onAfterLeave:g[1]||(g[1]=b=>u.value=!1)},{default:H(()=>[jr(N("div",Vt({class:"modal-mask",onPointerdown:Pn(l,["self"])},h.$attrs),[N("div",to,[N("div",no,[N("div",ro,[qt(h.$slots,"header",{shown:a(s)},()=>[w(" default header ")])]),N("div",io,[d(Li,{ref_key:"contextRef",ref:c},{default:H(()=>[qt(h.$slots,"body",{shown:a(s)},()=>[w(" default body ")])]),_:3},512)]),N("div",ao,[qt(h.$slots,"footer",{shown:a(s)},()=>[N("div",{class:"modal-default-footer"},[so,N("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,eo),[[da,e.modelValue]])]),_:3})]))}}),an=Symbol("ProxyState");function et(e,t={}){const n=t;let r=!1,i=!1;function s(){return r||(i&&console.error("Cyclical dependency detected. Cannot evaluate lazy proxy."),i=!0,Object.assign(n,e.call(n,n)),r=!0),n}return new Proxy(n,{get(l,u){if(u===an)return s();const c=s()[u];return c!=null&&typeof c=="object"&&Ot in c?c[Ot]:c},set(l,u,c){return s()[u]=c,!0},has(l,u){return u===an?!0:Reflect.has(s(),u)},ownKeys(){return Reflect.ownKeys(s())},getOwnPropertyDescriptor(l,u){return r||(Object.assign(n,e.call(n,n)),r=!0),Object.getOwnPropertyDescriptor(l,u)}})}const ji=o.ln(10);function zn(e){return e}function oo(e,t){return F(t)?t.invert(o.neg(e)):(console.error("Could not invert due to no input being a variable"),0)}function lo(e,t){return F(t)?t.isIntegrable()?f.neg(t.getIntegralFormula(e)):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function uo(e){return f.neg(e)}function co(e,t,n){return F(t)?t.invert(o.sub(e,Me(n))):F(n)?n.invert(o.sub(e,Me(t))):(console.error("Could not invert due to no input being a variable"),0)}function po(e,t,n){var r,i;if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=t.getIntegralFormula(e);return f.times(n,(r=t.innermostVariable)!=null?r:0).add(s)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=n.getIntegralFormula(e);return f.times(t,(i=n.innermostVariable)!=null?i:0).add(s)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function fo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.add(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.add(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function go(e,t,n){return F(t)?t.invert(o.add(e,Me(n))):F(n)?n.invert(o.sub(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function mo(e,t,n){var r,i;if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=t.getIntegralFormula(e);return f.sub(s,f.times(n,(r=t.innermostVariable)!=null?r:0))}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const s=n.getIntegralFormula(e);return f.times(t,(i=n.innermostVariable)!=null?i:0).sub(s)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function vo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.sub(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.sub(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ho(e,t,n){return F(t)?t.invert(o.div(e,Me(n))):F(n)?n.invert(o.div(e,Me(t))):(console.error("Could not invert due to no input being a variable"),0)}function bo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.times(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.times(r,t)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function yo(e,t,n){return F(t)?f.div(e,n):F(n)?f.div(e,t):(console.error("Could not apply substitution due to no input being a variable"),f.constant(0))}function wo(e,t,n){return F(t)?t.invert(o.mul(e,Me(n))):F(n)?n.invert(o.div(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function _o(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.div(r,n)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.div(t,r)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function No(e,t,n){return F(t)?f.mul(e,n):F(n)?f.mul(e,t):(console.error("Could not apply substitution due to no input being a variable"),f.constant(0))}function Co(e,t){return F(t)?t.invert(o.recip(e)):(console.error("Could not invert due to no input being a variable"),0)}function ko(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.ln(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function So(e,t){return F(t)?t.invert(o.pow10(e)):(console.error("Could not invert due to no input being a variable"),0)}function Mo(e){return o.ln(e).sub(1).times(e).div(ji)}function Io(e,t){if(F(t)){const n=ji.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function xo(e,t){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Mo,invert:Io}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function $o(e,t,n){return F(t)?t.invert(o.pow(Me(n),e)):F(n)?n.invert(o.root(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Do(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function To(e,t,n){if(F(t)){const r=o.ln(Me(n)).times(e);return t.invert(r.div(r.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Po(e,t,n){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e),n],evaluate:Do,invert:To}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Ao(e,t){return F(t)?t.invert(o.pow(2,e)):(console.error("Could not invert due to no input being a variable"),0)}function Ro(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function Eo(e,t){if(F(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Fo(e,t){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:Ro,invert:Eo}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Oo(e,t){return F(t)?t.invert(o.exp(e)):(console.error("Could not invert due to no input being a variable"),0)}function qo(e){return o.ln(e).sub(1).times(e)}function Vo(e,t){return F(t)?t.invert(o.div(e,o.div(e,Math.E).lambertw())):(console.error("Could not invert due to no input being a variable"),0)}function Bo(e,t){return F(t)?t.isIntegrable()?new f({inputs:[t.getIntegralFormula(e)],evaluate:qo,invert:Vo}):(console.error("Could not integrate due to variable not being integrable"),f.constant(0)):(console.error("Could not integrate due to no input being a variable"),f.constant(0))}function Lo(e,t,n){return F(t)?t.invert(o.root(e,Me(n))):F(n)?n.invert(o.ln(e).div(o.ln(Me(t)))):(console.error("Could not invert due to no input being a variable"),0)}function jo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e),i=f.add(n,1);return f.pow(r,i).div(i)}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e);return f.pow(t,r).div(f.ln(t))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function zo(e,t){return F(t)?t.invert(o.root(e,10)):(console.error("Could not invert due to no input being a variable"),0)}function Go(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.pow10(n).div(f.ln(10))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Uo(e,t,n){return F(t)?t.invert(o.ln(e).div(o.ln(Me(n)))):F(n)?n.invert(o.root(Me(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Wo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.pow(n,r).div(f.ln(n))}else if(F(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=n.getIntegralFormula(e),i=f.add(t,1);return f.pow(r,i).div(i)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Ho(e,t,n){return F(t)?t.invert(o.root(e,o.recip(Me(n)))):F(n)?n.invert(o.ln(Me(t)).div(o.ln(e))):(console.error("Could not invert due to no input being a variable"),0)}function Yo(e,t,n){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const r=t.getIntegralFormula(e);return f.pow(r,f.recip(n).add(1)).times(n).div(f.add(n,1))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Zo(e,t){return F(t)?t.invert(o.ln(e)):(console.error("Could not invert due to no input being a variable"),0)}function Xo(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.exp(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Jo(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const r=o.minabs(t,1e308).toNumber();return o.tetrate(e,r,n)}function Ko(e,t,n,r){return F(t)?t.invert(o.ssqrt(e)):(console.error("Could not invert due to no input being a variable"),0)}function Qo(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const r=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,r,new o(n))}function el(e,t,n,r){return F(t)?t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,Me(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function tl(e,t=10,n=2){const r=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,r)}function nl(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function rl(e,t,n){return F(t)?t.invert(o.tetrate(e,o.minabs(1e308,Me(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function il(e,t,n){const r=o.minabs(t,1e308).toNumber();return o.layeradd(e,r,n)}function al(e,t,n,r){return F(t)?t.invert(o.layeradd(e,o.minabs(1e308,Me(n)).negate().toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function sl(e,t){return F(t)?t.invert(o.pow(Math.E,e).times(e)):(console.error("Could not invert due to no input being a variable"),0)}function ol(e,t){return F(t)?t.invert(o.tetrate(e,2)):(console.error("Could not invert due to no input being a variable"),0)}function ll(e,t,n){const r=o.minabs(t,1e308).toNumber();return o.pentate(e,r,n)}function ul(e,t){return F(t)?t.invert(o.asin(e)):(console.error("Could not invert due to no input being a variable"),0)}function cl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cos(n).neg()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function dl(e,t){return F(t)?t.invert(o.acos(e)):(console.error("Could not invert due to no input being a variable"),0)}function pl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.sin(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function fl(e,t){return F(t)?t.invert(o.atan(e)):(console.error("Could not invert due to no input being a variable"),0)}function gl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cos(n).ln().neg()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function ml(e,t){return F(t)?t.invert(o.sin(e)):(console.error("Could not invert due to no input being a variable"),0)}function vl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.asin(n).times(n).add(f.sqrt(f.sub(1,f.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function hl(e,t){return F(t)?t.invert(o.cos(e)):(console.error("Could not invert due to no input being a variable"),0)}function bl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.acos(n).times(n).sub(f.sqrt(f.sub(1,f.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function yl(e,t){return F(t)?t.invert(o.tan(e)):(console.error("Could not invert due to no input being a variable"),0)}function wl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.atan(n).times(n).sub(f.ln(f.pow(n,2).add(1)).div(2))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function _l(e,t){return F(t)?t.invert(o.asinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Nl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cosh(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Cl(e,t){return F(t)?t.invert(o.acosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function kl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.sinh(n)}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Sl(e,t){return F(t)?t.invert(o.atanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ml(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.cosh(n).ln()}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Il(e,t){return F(t)?t.invert(o.sinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function xl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.asinh(n).times(n).sub(f.pow(n,2).add(1).sqrt())}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function $l(e,t){return F(t)?t.invert(o.cosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Dl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.acosh(n).times(n).sub(f.add(n,1).sqrt().times(f.sub(n,1).sqrt()))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function Tl(e,t){return F(t)?t.invert(o.tanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Pl(e,t){if(F(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),f.constant(0);const n=t.getIntegralFormula(e);return f.atanh(n).times(n).add(f.sub(1,f.pow(n,2)).ln().div(2))}return console.error("Could not integrate due to no input being a variable"),f.constant(0)}function En(e){return(t,n)=>new f({inputs:[t,n],evaluate:e,invert:zn})}function F(e){return e instanceof Re&&e.hasVariable()}function Me(e,t){return e instanceof Re?e.evaluate(t):a(e)}function Al(){return f.pow(this,2).div(2)}function Rl(){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"&&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:Al,internalIntegrateInner:Rl,applySubstitution:zn}}setupConstant({inputs:e}){return e.length!==1&&console.error("Evaluate function is required if inputs is not length 1"),{inputs:e,internalVariables:0}}setupFormula(e){var b,m;const{inputs:t,evaluate:n,invert:r,integrate:i,integrateInner:s,applySubstitution:l}=e,u=t.reduce((k,C)=>k+(C instanceof Be?C.internalVariables:0),0),c=t.find(k=>k instanceof Be&&k.hasVariable()),p=u===1?c==null?void 0:c.innermostVariable:void 0,h=(b=c==null?void 0:c.isInvertible())!=null?b:!1,g=(m=c==null?void 0:c.isIntegrable())!=null?m:!1;return{inputs:t,internalEvaluate:n,internalInvert:h?r:void 0,internalIntegrate:g?i:void 0,internalIntegrateInner:s,applySubstitution:l,innermostVariable:p,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,r;return(r=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(i=>Me(i,e))))!=null?n:this.hasVariable()?e:null)!=null?r:Me(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)&&o.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 f({inputs:[e]})}static variable(e){return new f({variable:e})}static step(e,t,n){const r=n(f.variable(0)),i=_e(t);function s(u){return o.lt(u,a(i))?u:o.add(r.evaluate(o.sub(u,a(i))),a(i))}function l(u,c){return F(c)&&r.isInvertible()?(o.gt(u,a(i))&&(u=o.add(r.invert(o.sub(u,a(i))),a(i))),c.invert(u)):(console.error("Could not invert due to no input being a variable"),0)}return new f({inputs:[e],evaluate:s,invert:r.isInvertible()&&r.hasVariable()?l:void 0})}static if(e,t,n,r){const i=G(0),s=f.variable(i),l=n(s),u=r==null?void 0:r(s),c=_e(t);function p(g){return a(c)?(i.value=g,l.evaluate()):u?(i.value=g,u.evaluate()):g}function h(g,b){return!F(b)||!l.isInvertible()||u!=null&&!u.isInvertible()?(console.error("Could not invert due to no input being a variable"),0):a(c)?b.invert(l.invert(g)):u?b.invert(u.invert(g)):b.invert(g)}return new f({inputs:[e],evaluate:p,invert:l.isInvertible()&&l.hasVariable()?h:void 0})}static conditional(e,t,n,r){return f.if(e,t,n,r)}static abs(e){return new f({inputs:[e],evaluate:o.abs})}static neg(e){return new f({inputs:[e],evaluate:o.neg,invert:oo,applySubstitution:uo,integrate:lo})}static sign(e){return new f({inputs:[e],evaluate:o.sign})}static round(e){return new f({inputs:[e],evaluate:o.round})}static floor(e){return new f({inputs:[e],evaluate:o.floor})}static ceil(e){return new f({inputs:[e],evaluate:o.ceil})}static trunc(e){return new f({inputs:[e],evaluate:o.trunc})}static add(e,t){return new f({inputs:[e,t],evaluate:o.add,invert:co,integrate:po,integrateInner:fo,applySubstitution:zn})}static sub(e,t){return new f({inputs:[e,t],evaluate:o.sub,invert:go,integrate:mo,integrateInner:vo,applySubstitution:zn})}static mul(e,t){return new f({inputs:[e,t],evaluate:o.mul,invert:ho,integrate:bo,applySubstitution:yo})}static div(e,t){return new f({inputs:[e,t],evaluate:o.div,invert:wo,integrate:_o,applySubstitution:No})}static recip(e){return new f({inputs:[e],evaluate:o.recip,invert:Co,integrate:ko})}static clamp(e,t,n){return new f({inputs:[e,t,n],evaluate:o.clamp,invert:zn})}static pLog10(e){return new f({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new f({inputs:[e],evaluate:o.absLog10})}static log10(e){return new f({inputs:[e],evaluate:o.log10,invert:So,integrate:xo})}static log(e,t){return new f({inputs:[e,t],evaluate:o.log,invert:$o,integrate:Po})}static log2(e){return new f({inputs:[e],evaluate:o.log2,invert:Ao,integrate:Fo})}static ln(e){return new f({inputs:[e],evaluate:o.ln,invert:Oo,integrate:Bo})}static pow(e,t){return new f({inputs:[e,t],evaluate:o.pow,invert:Lo,integrate:jo})}static pow10(e){return new f({inputs:[e],evaluate:o.pow10,invert:zo,integrate:Go})}static pow_base(e,t){return new f({inputs:[e,t],evaluate:o.pow_base,invert:Uo,integrate:Wo})}static root(e,t){return new f({inputs:[e,t],evaluate:o.root,invert:Ho,integrate:Yo})}static factorial(e){return new f({inputs:[e],evaluate:o.factorial})}static gamma(e){return new f({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new f({inputs:[e],evaluate:o.lngamma})}static exp(e){return new f({inputs:[e],evaluate:o.exp,invert:Zo,integrate:Xo})}static sqr(e){return f.pow(e,2)}static sqrt(e){return f.root(e,2)}static cube(e){return f.pow(e,3)}static cbrt(e){return f.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:Jo,invert:Ko})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:Qo,invert:el})}static iteratedlog(e,t=10,n=1){return new f({inputs:[e,t,n],evaluate:tl})}static slog(e,t=10){return new f({inputs:[e,t],evaluate:nl,invert:rl})}static layeradd10(e,t){return new f({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new f({inputs:[e,t,n],evaluate:il,invert:al})}static lambertw(e){return new f({inputs:[e],evaluate:o.lambertw,invert:sl})}static ssqrt(e){return new f({inputs:[e],evaluate:o.ssqrt,invert:ol})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new f({inputs:[e,t,n],evaluate:ll})}static sin(e){return new f({inputs:[e],evaluate:o.sin,invert:ml,integrate:cl})}static cos(e){return new f({inputs:[e],evaluate:o.cos,invert:hl,integrate:pl})}static tan(e){return new f({inputs:[e],evaluate:o.tan,invert:yl,integrate:gl})}static asin(e){return new f({inputs:[e],evaluate:o.asin,invert:ul,integrate:vl})}static acos(e){return new f({inputs:[e],evaluate:o.acos,invert:dl,integrate:bl})}static atan(e){return new f({inputs:[e],evaluate:o.atan,invert:fl,integrate:wl})}static sinh(e){return new f({inputs:[e],evaluate:o.sinh,invert:Il,integrate:Nl})}static cosh(e){return new f({inputs:[e],evaluate:o.cosh,invert:$l,integrate:kl})}static tanh(e){return new f({inputs:[e],evaluate:o.tanh,invert:Tl,integrate:Ml})}static asinh(e){return new f({inputs:[e],evaluate:o.asinh,invert:_l,integrate:xl})}static acosh(e){return new f({inputs:[e],evaluate:o.acosh,invert:Cl,integrate:Dl})}static atanh(e){return new f({inputs:[e],evaluate:o.atanh,invert:Sl,integrate:Pl})}step(e,t){return f.step(this,e,t)}if(e,t){return f.if(this,e,t)}conditional(e,t){return f.if(this,e,t)}abs(){return f.abs(this)}neg(){return f.neg(this)}sign(){return f.sign(this)}round(){return f.round(this)}floor(){return f.floor(this)}ceil(){return f.ceil(this)}trunc(){return f.trunc(this)}add(e){return f.add(this,e)}sub(e){return f.sub(this,e)}mul(e){return f.mul(this,e)}div(e){return f.div(this,e)}recip(){return f.recip(this)}max(e){return f.max(this,e)}min(e){return f.min(this,e)}maxabs(e){return f.maxabs(this,e)}minabs(e){return f.minabs(this,e)}clamp(e,t){return f.clamp(this,e,t)}clampMin(e){return f.clampMin(this,e)}clampMax(e){return f.clampMax(this,e)}pLog10(){return f.pLog10(this)}absLog10(){return f.absLog10(this)}log10(){return f.log10(this)}log(e){return f.log(this,e)}log2(){return f.log2(this)}ln(){return f.ln(this)}pow(e){return f.pow(this,e)}pow10(){return f.pow10(this)}pow_base(e){return f.pow_base(this,e)}root(e){return f.root(this,e)}factorial(){return f.factorial(this)}gamma(){return f.gamma(this)}lngamma(){return f.lngamma(this)}exp(){return f.exp(this)}sqr(){return f.pow(this,2)}sqrt(){return f.root(this,2)}cube(){return f.pow(this,3)}cbrt(){return f.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return f.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return f.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return f.iteratedlog(this,e,t)}slog(e=10){return f.slog(this,e)}layeradd10(e){return f.layeradd10(this,e)}layeradd(e,t){return f.layeradd(this,e,t)}lambertw(){return f.lambertw(this)}ssqrt(){return f.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return f.pentate(this,e,t)}sin(){return f.sin(this)}cos(){return f.cos(this)}tan(){return f.tan(this)}asin(){return f.asin(this)}acos(){return f.acos(this)}atan(){return f.atan(this)}sinh(){return f.sinh(this)}cosh(){return f.cosh(this)}tanh(){return f.tanh(this)}asinh(){return f.asinh(this)}acosh(){return f.acosh(this)}atanh(){return f.atanh(this)}};let Re=Be;Re.negate=Be.neg;Re.negated=Be.neg;Re.sgn=Be.sign;Re.plus=Be.add;Re.subtract=Be.sub;Re.minus=Be.sub;Re.multiply=Be.mul;Re.times=Be.mul;Re.divide=Be.div;Re.divideBy=Be.div;Re.dividedBy=Be.div;Re.reciprocal=Be.recip;Re.reciprocate=Be.recip;Re.max=En(o.max);Re.min=En(o.min);Re.minabs=En(o.minabs);Re.maxabs=En(o.maxabs);Re.clampMin=En(o.clampMin);Re.clampMax=En(o.clampMax);Re.logarithm=Be.log;class f extends Re{invert(t){return this.internalInvert&&this.hasVariable()?this.internalInvert.call(this,t,...this.inputs):this.inputs.length===1&&this.hasVariable()?t:(console.error("Cannot invert non-invertible formula"),0)}evaluateIntegral(t){return this.isIntegrable()?this.getIntegralFormula().evaluate(t):(console.error("Cannot evaluate integral of formula without integral"),0)}invertIntegral(t){return!this.isIntegrable()||!this.getIntegralFormula().isInvertible()?(console.error("Cannot invert integral of formula without invertible integral"),0):this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)return console.error("Cannot integrate formula with non-integrable operation"),f.constant(0);let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(r=>n=r(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 return console.error("Cannot integrate formula without variable"),f.constant(0);return this.integralFormula}else return this.applySubstitution==null?(console.error("Cannot have two complex operations in an integrable formula"),f.constant(0)):(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner?this.internalIntegrateInner.call(this,t,...this.inputs):this.internalIntegrate?this.internalIntegrate.call(this,t,...this.inputs):this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable()?this:(console.error("Cannot integrate formula without variable"),f.constant(0)))}}function zi(e,t,n=!0,r,i=o.dInf){const s=_e(n),l=_e(r),u=_e(i);return y(()=>{var b,m,k,C;const c=a(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const p=a(s),h=(b=a(l))!=null?b:p?10:0;let g=0;if(o.gt(c,h)){if(!e.isInvertible())return console.error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum"),0;if(p){if(!e.isIntegralInvertible())return console.error("Cannot calculate max affordable of formula with non-invertible integral"),0;g=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((m=a(e.innermostVariable))!=null?m:0)}else g=o.floor(e.invert(t.value))}if(g=o.clampMax(g,c),h>0){const $=g;g=o.sub(g,h).clampMin(0);let x;for(p?x=sn(e,g,!0,0):x=e.evaluate(o.add((k=a(e.innermostVariable))!=null?k:0,g));o.lt(g,c)&&o.lt(g,Number.MAX_SAFE_INTEGER)&&o.add($,1).gte(g);){const I=e.evaluate(g.add((C=a(e.innermostVariable))!=null?C:0));if(o.add(x,I).lte(t.value))g=g.add(1),x=o.add(x,I);else break}}return g})}function sn(e,t,n=!0,r){var c;if(o.eq(t,1))return e.evaluate();const i=(c=a(e.innermostVariable))!=null?c:0;let s=o.add(t,i);const l=s;r!=null||(r=n?10:0),s=s.sub(r).clampMin(i);let u=0;if(o.gt(t,r)){if(!e.isInvertible())return console.error("Cannot calculate cost with indirect sum of non-invertible formula"),0;if(n){if(!e.isIntegrable())return console.error("Cannot calculate cost with cumulative cost of non-integrable formula"),0;if(u=o.sub(e.evaluateIntegral(s),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,s).times(e.evaluate(s)))}else if(u=e.evaluate(s),s=s.add(1),l.gt(1e308))return o.sub(l,s).add(1).times(u)}for(let p=s.toNumber();pn.trim()).join(` +`))!=null?t:""}function hi(e,t){var n;o.isNaN(t)&&(Fe.hasNaN||(Y.autosave=!1,Fe.hasNaN=!0,Fe.NaNPath=e[yn],Fe.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[yn])==null?void 0:n.join(".")}`)),e[on].value=t}function ct(e,t=!0){const n=Ve(e)?e:G(e);Ve(e)&&(e=e.value);const r=y({get(){return n.value},set(s){t?hi(i,s):i[on].value=s}});r[Kt]=e;const i={get value(){return n.value},set value(s){t?hi(i,s):i[on].value=s},__v_isRef:!0,[on]:n,[Kt]:e,[fr]:El(),[gr]:!1,[Ot]:r,[yn]:void 0};return ft.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,` +Created at: +`+i[fr]):wn[ft[ft.length-1]].add(i),i}function Fl(e){return e!=null&&typeof e=="object"&&on in e}function In(e){return!(an in e)&&Ot in e?e[Ot]:new Proxy(e,{get(t,n){if(n!==on)return n===Kn?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===on?!1:n==Kn?!0:Reflect.has(t,n)}})}function Gi(e){ft.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):wn[ft[ft.length-1]].delete(e),e[gr]=!0}Qe.on("addLayer",(e,t)=>{const n=[],r=(i,s=[])=>{let l=!1;return Object.keys(i).forEach(u=>{let c=i[u];if(c!=null&&typeof c=="object"){if(c[Kn]===!0)return;if(an in c&&(c=c[an]),Fl(c)){if(l=!0,c[gr]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,` +Created at: +`+c[fr]);return}wn[e.id].delete(c);const p=[e.id,...s,u];c[yn]!=null&&JSON.stringify(p)!==JSON.stringify(c[yn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[yn].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[yn]=p;const h=s.reduce((b,m)=>(m in b||(b[m]={}),b[m]),t),g=h[u];h[u]=c[on],fa(h)?g!=null?h[u]=g:h[u]=c[Kt]:g!=null?h[u].value=g:h[u].value=c[Kt]}else!(c instanceof o)&&!(c instanceof f)&&!Ve(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...s,u])&&(Bt(c)&&!Bt(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",an in i?i[an]:i,u):l=!0))}}),l};r(e[an]),wn[e.id].forEach(i=>{i[gr]||console.error(`Created persistent ref in ${e.id} without registering it to the layer!`,`Make sure to include everything persistent in the returned object. + +Created at: +`+i[fr])}),wn[e.id].clear()});const Yr=Symbol("RegisterNode"),Zr=Symbol("UnregisterNode"),Xr=Symbol("Nodes"),Jr=Symbol("Bounds"),ge=Lr({});window.layers=ge;const wn={},ft=[];function Kr(e,t){return et(()=>{const n={},r=n.emitter=Ii();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=G({}),n.id=e,ft.push(e),wn[e]=new Set,n.minimized=ct(!1,!1),Object.assign(n,t.call(n,n)),ft[ft.length-1]==null||ft[ft.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen +Stack: ${ft} +Trying to pop ${n.id}`);ft.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),oe(n,"name",n.id),A(n,"minWidth"),oe(n,"minWidth",600),A(n,"minimizable"),oe(n,"minimizable",!0),A(n,"minimizedDisplay");const i=n.style;return n.style=y(()=>{var l,u;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(l=a(i))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Qr(e,t){if(console.info("Adding layer",e.id),ge[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ge[e.id]);return}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ge[e.id]=e,Qe.emit("addLayer",e,t.layers[e.id])}function Ol(e){return ge[e]}function ei(e){console.info("Removing layer",e.id),Qe.emit("removeLayer",e),ge[e.id]=void 0}function ql(e){ei(e),Qr(e,Y)}function Vl(e){const t=G(!1);return{openModal:()=>t.value=!0,modal:j(()=>d(Lt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[a(e.name)]),body:a(e.display)}))}}Qe.on("update",function(t){Object.values(ge).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Bl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Yr,UnregisterNodeInjectionKey:Zr,NodesInjectionKey:Xr,BoundsInjectionKey:Jr,layers:ge,persistentRefs:wn,addingLayers:ft,createLayer:Kr,addLayer:Qr,getLayer:Ol,removeLayer:ei,reloadLayer:ql,setupLayerModal:Vl},Symbol.toStringTag,{value:"Module"}));const Ll=X({components:{Context:Li,ErrorVue:xi},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=Ae(e),s=Hr(t),l=Rn(i),u=y(()=>ve.allowGoBack&&n.value>0&&!Pe(r));function c(){Y.tabs.splice(a(e.index),1/0)}function p(g){e.nodes.value=g}const h=G([]);return ga((g,b,m)=>(console.warn(`Error caught in "${e.name}" layer`,g,b,m),h.value.push(g instanceof Error?g:new Error(JSON.stringify(g))),!1)),{component:s,minimizedComponent:l,showGoBack:u,updateNodes:p,unref:a,goBack:c,errors:h}}}),jl={key:1};function zl(e,t,n,r,i,s){const l=Ct("ErrorVue"),u=Ct("Context");return e.errors.length>0?(S(),re(l,{key:0,errors:e.errors},null,8,["errors"])):(S(),T("div",Vt({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(S(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):B("",!0),e.unref(e.minimized)?(S(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),re(Ke(e.minimizedComponent),{key:0})):(S(),T("div",jl,ee(e.unref(e.name)),1))])):(S(),T("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[d(u,{onUpdateNodes:e.updateNodes},{default:H(()=>[(S(),re(Ke(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],16))}var Gl=be(Ll,[["render",zl],["__scopeId","data-v-a9f5b1da"]]);const Ui=e=>(cn("data-v-4b4bda40"),e=e(),dn(),e),Ul=Ui(()=>N("h2",null,"Changelog",-1)),Wl=Ui(()=>N("details",{open:""},[N("summary",null,[w("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),w(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Hl=X({__name:"Changelog",setup(e,{expose:t}){const n=G(!1);return t({open(){n.value=!0}}),(r,i)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s)},{header:H(()=>[Ul]),body:H(()=>[Wl]),_:1},8,["modelValue"]))}});var Yl=be(Hl,[["__scopeId","data-v-4b4bda40"]]),Zl=X({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),direction:q(String),xoffset:q(String),yoffset:q(String),pinned:Object},setup(e){const{element:t,display:n,pinned:r}=Ae(e),i=G(!1),s=y(()=>(Pe(r)||i.value)&&l.value),l=Rn(n),u=_t(fe(j(()=>{const h=Pe(t);return h==null?"":mt(h)})));function c(h){const g=r;h.shiftKey&&g&&(g.value=!g.value,h.stopPropagation(),h.preventDefault())}const p=y(()=>Pe(r)&&It[ie.theme].showPin);return{Direction:W,isHovered:i,isShown:s,comp:l,elementComp:u,unref:a,togglePinned:c,showPin:p}}});const Xl={key:0,class:"material-icons pinned"};function Jl(e,t,n,r,i,s){return S(),T("div",{class:Ne(["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))},[qt(e.$slots,"default",{},void 0,!0),e.elementComp?(S(),re(Ke(e.elementComp),{key:0})):B("",!0),d(Wn,{name:"fade"},{default:H(()=>{var l;return[e.isShown?(S(),T("div",{key:0,class:Ne(["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"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(S(),T("span",Xl,"push_pin")):B("",!0),e.comp?(S(),re(Ke(e.comp),{key:1})):B("",!0)],6)):B("",!0)]}),_:1})],34)}var qe=be(Zl,[["render",Jl],["__scopeId","data-v-6102fa3a"]]);const Nn=e=>(cn("data-v-4f97aa40"),e=e(),dn(),e),Kl={class:"info-modal-header"},Ql=["src","alt"],eu={class:"info-modal-title"},tu={key:0},nu={key:0},ru={key:0},iu=Nn(()=>N("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),au=Nn(()=>N("br",null,null,-1)),su=Nn(()=>N("br",null,null,-1)),ou=["href"],lu=Nn(()=>N("span",{class:"material-icons info-modal-discord"},"discord",-1)),uu=Nn(()=>N("div",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),w(" The Paper Pilot Community ")])],-1)),cu=Nn(()=>N("div",null,[N("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[N("span",{class:"material-icons info-modal-discord"},"discord"),w(" The Modding Tree ")])],-1)),du=Nn(()=>N("br",null,null,-1));var pu=X({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:r,logo:i,author:s,discordName:l,discordLink:u,versionNumber:c,versionTitle:p}=ve,h=Ae(n),g=G(!1),b=y(()=>yr(Y.timePlayed)),m=y(()=>fe(j(()=>d(ne,null,[Ws.map(ot)]))));t({open(){g.value=!0}});function k(){var C;(C=a(h.changelog))==null||C.open()}return(C,$)=>(S(),re(Lt,{modelValue:g.value,"onUpdate:modelValue":$[0]||($[0]=x=>g.value=x)},{header:H(()=>[N("div",Kl,[a(i)?(S(),T("img",{key:0,class:"info-modal-logo",src:a(i),alt:a(r)},null,8,Ql)):B("",!0),N("div",eu,[N("h2",null,ee(a(r)),1),N("h4",null,[w(" v"+ee(a(c)),1),a(p)?(S(),T("span",tu,": "+ee(a(p)),1)):B("",!0)])])])]),body:H(({shown:x})=>[x?(S(),T("div",nu,[a(s)?(S(),T("div",ru,"By "+ee(a(s)),1)):B("",!0),iu,au,N("div",{class:"link",onClick:k},"Changelog"),su,N("div",null,[a(u)?(S(),T("a",{key:0,href:a(u),class:"info-modal-discord-link",target:"_blank"},[lu,w(" "+ee(a(l)),1)],8,ou)):B("",!0)]),uu,cu,du,N("div",null,"Time Played: "+ee(a(b)),1),(S(),re(Ke(a(m))))])):B("",!0)]),_:1},8,["modelValue"]))}});var fu=be(pu,[["__scopeId","data-v-4f97aa40"]]);const gu={class:"field"},mu={key:0,class:"field-title"},ti=X({__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,r=Rn(Jt(n,"title"),"span"),i=G((l=n.options.find(u=>u.value===n.modelValue))!=null?l:null);wt(Jt(n,"modelValue"),u=>{var c;Pe(i)!==u&&(i.value=(c=n.options.find(p=>p.value===u))!=null?c:null)});function s(u){t("update:modelValue",u.value)}return(u,c)=>(S(),T("div",gu,[a(r)?(S(),T("span",mu,[(S(),re(Ke(a(r))))])):B("",!0),d(a(wa),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[c[0]||(c[0]=p=>i.value=p),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const vu={class:"field"},hu=X({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=y(()=>{var s;return fe((s=a(n.title))!=null?s:"","span")}),i=y({get(){return!!n.modelValue},set(s){t("update:modelValue",s)}});return(s,l)=>(S(),T("label",vu,[jr(N("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=u=>Ve(i)?i.value=u:null)},null,512),[[ma,a(i)]]),(S(),re(Ke(a(r))))]))}});var $t=be(hu,[["__scopeId","data-v-11046116"]]);const bu={class:"header"},yu=N("h2",null,"Settings",-1),wu={class:"option-tabs"},_u={key:0},Nu={key:1};var Cu=X({__name:"Options",setup(e,{expose:t}){const n=G(!1),r=G("behaviour");function i(le){return le==r.value}function s(le){r.value=le}t({isTab:i,setTab:s,save:bt,open(){n.value=!0}});const l=Object.keys(It).map(le=>({label:st(le),value:le})),u=y(()=>fe(j(()=>d(ne,null,[Fi.map(ot)])))),{showTPS:c,theme:p,unthrottled:h,alignUnits:g}=Ae(ie),{autosave:b,offlineProd:m}=Ae(Y),k=y({get(){return Y.devSpeed===0},set(le){Y.devSpeed=le?0:null}}),C=j(()=>d("span",{class:"option-title"},[w("Unthrottled"),d("desc",null,[w("Allow the game to run as fast as possible. Not battery friendly.")])])),$=j(()=>d("span",{class:"option-title"},[w("Offline Production"),d(qe,{display:"Save-specific",direction:W.Right},{default:()=>[w("*")]}),d("desc",null,[w("Simulate production that occurs while the game is closed.")])])),x=j(()=>d("span",{class:"option-title"},[w("Autosave"),d(qe,{display:"Save-specific",direction:W.Right},{default:()=>[w("*")]}),d("desc",null,[w("Automatically save the game every second or when the game is closed.")])])),I=j(()=>d("span",{class:"option-title"},[w("Pause game"),d(qe,{display:"Save-specific",direction:W.Right},{default:()=>[w("*")]}),d("desc",null,[w("Stop everything from moving.")])])),R=j(()=>d("span",{class:"option-title"},[w("Theme"),d("desc",null,[w("How the game looks.")])])),L=j(()=>d("span",{class:"option-title"},[w("Show TPS"),d("desc",null,[w("Show TPS meter at the bottom-left corner of the page.")])])),ce=j(()=>d("span",{class:"option-title"},[w("Align modifier units"),d("desc",null,[w("Align numbers to the beginning of the unit in modifier view.")])]));return(le,ae)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":ae[10]||(ae[10]=J=>n.value=J)},{header:H(()=>[N("div",bu,[yu,N("div",wu,[N("button",{class:Ne({selected:i("behaviour")}),onClick:ae[0]||(ae[0]=J=>s("behaviour"))},"Behaviour",2),N("button",{class:Ne({selected:i("appearance")}),onClick:ae[1]||(ae[1]=J=>s("appearance"))},"Appearance",2)])])]),body:H(()=>[i("behaviour")?(S(),T("div",_u,[d($t,{title:a(C),modelValue:a(h),"onUpdate:modelValue":ae[2]||(ae[2]=J=>Ve(h)?h.value=J:null)},null,8,["title","modelValue"]),a(ve).enablePausing?(S(),re($t,{key:0,title:a(I),modelValue:a(k),"onUpdate:modelValue":ae[3]||(ae[3]=J=>Ve(k)?k.value=J:null)},null,8,["title","modelValue"])):B("",!0),d($t,{title:a($),modelValue:a(m),"onUpdate:modelValue":ae[4]||(ae[4]=J=>Ve(m)?m.value=J:null)},null,8,["title","modelValue"]),d($t,{title:a(x),modelValue:a(b),"onUpdate:modelValue":ae[5]||(ae[5]=J=>Ve(b)?b.value=J:null)},null,8,["title","modelValue"]),a(b)?B("",!0):(S(),re(Gr,{key:1,class:"button save-button",onClick:ae[6]||(ae[6]=J=>a(bt)())},{default:H(()=>[w("Manually save")]),_:1}))])):B("",!0),i("appearance")?(S(),T("div",Nu,[d(ti,{title:a(R),options:a(l),modelValue:a(p),"onUpdate:modelValue":ae[7]||(ae[7]=J=>Ve(p)?p.value=J:null)},null,8,["title","options","modelValue"]),(S(),re(Ke(a(u)))),d($t,{title:a(L),modelValue:a(c),"onUpdate:modelValue":ae[8]||(ae[8]=J=>Ve(c)?c.value=J:null)},null,8,["title","modelValue"]),d($t,{title:a(ce),modelValue:a(g),"onUpdate:modelValue":ae[9]||(ae[9]=J=>Ve(g)?g.value=J:null)},null,8,["title","modelValue"])])):B("",!0)]),_:1},8,["modelValue"]))}});const ku=["onSubmit"],Su={class:"field"},Mu={key:0,class:"field-title"},Iu=["placeholder"],xu=X({__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,r=Rn(Jt(n,"title"),"span"),i=_t(null);Qn(()=>{var c;(c=i.value)==null||c.focus()});const s=y({get(){var c;return(c=a(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,p)=>(S(),T("form",{onSubmit:Pn(l,["prevent"])},[N("div",Su,[a(r)?(S(),T("span",Mu,[(S(),re(Ke(a(r))))])):B("",!0),e.textArea?(S(),re(a(Na),{key:1,modelValue:a(s),"onUpdate:modelValue":p[0]||(p[0]=h=>Ve(s)?s.value=h:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):jr((S(),T("input",{key:2,type:"text","onUpdate:modelValue":p[1]||(p[1]=h=>Ve(s)?s.value=h:null),placeholder:e.placeholder,class:Ne({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:i},null,42,Iu)),[[va,a(s)]])])],40,ku))}});var Wi=be(xu,[["__scopeId","data-v-90bd4994"]]);const $u={key:0},Du=["onClick","disabled"],Tu={key:0},Pu=["onClick"],Au=X({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const r=Ae(e),i=G(!1);wt(i,u=>{t("confirmingChanged",u)});function s(){if(a(r.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function l(){i.value=!1}return(u,c)=>(S(),T("span",{class:Ne(["container",{confirming:i.value}])},[i.value?(S(),T("span",$u,"Are you sure?")):B("",!0),N("button",{onClick:Pn(s,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(S(),T("span",Tu,"Yes")):qt(u.$slots,"default",{key:1},void 0,!0)],8,Du),i.value?(S(),T("button",{key:1,class:"button",onClick:Pn(l,["stop"])},"No",8,Pu)):B("",!0)],2))}});var Ru=be(Au,[["__scopeId","data-v-2f8ef34c"]]);const en=e=>(cn("data-v-32313015"),e=e(),dn(),e),Eu=en(()=>N("div",{class:"handle material-icons"},"drag_handle",-1)),Fu={key:0,class:"actions"},Ou=en(()=>N("span",{class:"material-icons"},"content_paste",-1)),qu=en(()=>N("span",{class:"material-icons"},"content_copy",-1)),Vu=en(()=>N("span",{class:"material-icons"},"edit",-1)),Bu=en(()=>N("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),Lu={key:1,class:"actions"},ju=en(()=>N("span",{class:"material-icons"},"check",-1)),zu=en(()=>N("span",{class:"material-icons"},"close",-1)),Gu={key:2,class:"details"},Uu={class:"save-version"},Wu=en(()=>N("br",null,null,-1)),Hu={key:0},Yu={key:3,class:"details"},Zu={key:4,class:"details error"},Xu=en(()=>N("br",null,null,-1)),Ju=X({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:r}=Ae(n),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=G(!1),l=G(!1),u=G("");wt(s,()=>{var g;return u.value=(g=r.value.name)!=null?g:""});const c=y(()=>r.value!=null&&r.value.id===Y.id),p=y(()=>{var g;return c.value?Y.time:(g=r.value!=null&&r.value.time)!=null?g:0});function h(){t("editName",u.value),s.value=!1}return(g,b)=>(S(),T("div",{class:Ne(["save",{active:a(c)}])},[Eu,s.value?(S(),T("div",Lu,[N("button",{onClick:h,class:"button"},[d(qe,{display:"Save",direction:a(W).Left,class:"info"},{default:H(()=>[ju]),_:1},8,["direction"])]),N("button",{onClick:b[5]||(b[5]=m=>s.value=!s.value),class:"button"},[d(qe,{display:"Cancel",direction:a(W).Left,class:"info"},{default:H(()=>[zu]),_:1},8,["direction"])])])):(S(),T("div",Fu,[a(r).error==null&&!l.value?(S(),re(Gr,{key:0,onClick:b[0]||(b[0]=m=>t("export")),class:"button",left:""},{default:H(()=>[d(qe,{display:"Export",direction:a(W).Left,class:"info"},{default:H(()=>[Ou]),_:1},8,["direction"])]),_:1})):B("",!0),a(r).error==null&&!l.value?(S(),T("button",{key:1,onClick:b[1]||(b[1]=m=>t("duplicate")),class:"button"},[d(qe,{display:"Duplicate",direction:a(W).Left,class:"info"},{default:H(()=>[qu]),_:1},8,["direction"])])):B("",!0),a(r).error==null&&!l.value?(S(),T("button",{key:2,onClick:b[2]||(b[2]=m=>s.value=!s.value),class:"button"},[d(qe,{display:"Edit Name",direction:a(W).Left,class:"info"},{default:H(()=>[Vu]),_:1},8,["direction"])])):B("",!0),d(Ru,{disabled:a(c),onClick:b[3]||(b[3]=m=>t("delete")),onConfirmingChanged:b[4]||(b[4]=m=>l.value=m)},{default:H(()=>[d(qe,{display:"Delete",direction:a(W).Left,class:"info"},{default:H(()=>[Bu]),_:1},8,["direction"])]),_:1},8,["disabled"])])),a(r).error==null&&!s.value?(S(),T("div",Gu,[N("button",{class:"button open",onClick:b[6]||(b[6]=m=>t("open"))},[N("h3",null,ee(a(r).name),1)]),N("span",Uu,"v"+ee(a(r).modVersion),1),Wu,a(p)?(S(),T("div",Hu,"Last played "+ee(a(i).format(a(p))),1)):B("",!0)])):a(r).error==null&&s.value?(S(),T("div",Yu,[d(Wi,{modelValue:u.value,"onUpdate:modelValue":b[7]||(b[7]=m=>u.value=m),class:"editname",onSubmit:h},null,8,["modelValue"])])):(S(),T("div",Zu,[w(" Error: Failed to load save with id "+ee(a(r).id),1),Xu,w(ee(a(r).error),1)]))],2))}});var Ku=be(Ju,[["__scopeId","data-v-32313015"]]);const ni=e=>(cn("data-v-2a4275be"),e=e(),dn(),e),Qu=ni(()=>N("h2",null,"Saves Manager",-1)),ec={class:"modal-footer"},tc={class:"field"},nc=ni(()=>N("span",{class:"field-title"},"Create Save",-1)),rc={class:"field-buttons"},ic={class:"footer"},ac=ni(()=>N("div",{style:{"flex-grow":"1"}},null,-1)),sc=X({__name:"SavesManager",setup(e,{expose:t}){const n=G(!1),r=G(null);t({open(){n.value=!0}});const i=G(!1),s=G(""),l=G(null);wt(s,I=>{I?Xt(()=>{try{if(I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Yt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I),i.value=!0;return}const R=JSON.parse(I);if(typeof R!="object"){i.value=!0;return}const L=cr();R.id=L,bt(R),s.value="",i.value=!1,ie.saves.push(L)}catch{i.value=!0}}):i.value=!1});let u={},c=G(Object.keys(u).reduce((I,R)=>(I.push({label:R.split("/").slice(-1)[0].slice(0,-4),value:u[R]}),I),[]));const p=Lr({});function h(I){if(p[I]==null){let R=localStorage.getItem(I);if(R==null)p[I]={error:"Save doesn't exist in localStorage",id:I};else if(R==="dW5kZWZpbmVk")p[I]={error:"Save is undefined",id:I};else try{if(R[0]!=="{")if(R[0]==="e")R=decodeURIComponent(escape(atob(R)));else if(R[0]==="\u1BE1")R=Yt.decompressFromUTF16(R);else return console.warn("Unable to determine preset encoding",R),i.value=!0,p[I]={error:"Unable to determine preset encoding",id:I},p[I];p[I]={...JSON.parse(R),id:I}}catch(L){p[I]={error:L,id:I},console.warn(`SavesManager: Failed to load info about save with id ${I}: +${L} +${R}`)}}return p[I]}wt(n,I=>{I&&Object.keys(p).forEach(R=>delete p[R])});const g=y(()=>ie.saves.reduce((I,R)=>(I[R]=h(R),I),{}));function b(I){let R;switch(Y.id===I?R=zr(Y):R=JSON.stringify(g.value[I]),ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":R=Yt.compressToUTF16(R);break;case"base64":R=btoa(unescape(encodeURIComponent(R)));break;case"plain":break}const L=document.createElement("textarea");L.value=R,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function m(I){Y.id===I&&bt();const R={...g.value[I],id:cr()};bt(R),ie.saves.push(R.id)}function k(I){ie.saves=ie.saves.filter(R=>R!==I),localStorage.removeItem(I),p[I]=void 0}function C(I){g.value[Y.id].time=Y.time,bt(),p[Y.id]=void 0,bn(g.value[I]),p[I]=void 0}function $(I){if(l.value=I,Xt(()=>{l.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Yt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const R=JSON.parse(I);R.id=cr(),bt(R),ie.saves.push(R.id),C(R.id)}function x(I,R){const L=g.value[I];L!=null&&(L.name=R,Y.id===I?(Y.name=R,bt()):(bt(L),p[I]=void 0))}return(I,R)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":R[4]||(R[4]=L=>n.value=L),ref_key:"modal",ref:r},{header:H(()=>[Qu]),body:H(({shown:L})=>[L?(S(),re(a(_a),{key:0,list:a(ie).saves,handle:".handle",itemKey:ce=>ce},{item:H(({element:ce})=>[d(Ku,{save:a(g)[ce],onOpen:le=>C(ce),onExport:le=>b(ce),onEditName:le=>x(ce,le),onDuplicate:le=>m(ce),onDelete:le=>k(ce)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[N("div",ec,[d(Wi,{modelValue:s.value,"onUpdate:modelValue":R[0]||(R[0]=L=>s.value=L),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:i.value})},null,8,["modelValue","class"]),N("div",tc,[nc,N("div",rc,[N("button",{class:"button",onClick:R[1]||(R[1]=L=>C(a(Tn)().id))},"New Game"),Object.keys(a(c)).length>0?(S(),re(ti,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":R[2]||(R[2]=L=>$(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),N("div",ic,[ac,N("button",{class:"button modal-default-button",onClick:R[3]||(R[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Hi=be(sc,[["__scopeId","data-v-2a4275be"]]);const kt=e=>(cn("data-v-318a1c31"),e=e(),dn(),e),oc=["src","alt"],lc={key:1,class:"title"},uc=kt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),cc={class:"discord"},dc={class:"discord-links"},pc={key:0},fc=["href"],gc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),mc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),vc={href:"https://forums.moddingtree.com/",target:"_blank"},hc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),bc=kt(()=>N("span",{class:"material-icons"},"info",-1)),yc=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),wc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),_c=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),Nc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),Cc=kt(()=>N("span",{class:"material-icons"},"info",-1)),kc={href:"https://forums.moddingtree.com/",target:"_blank"},Sc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),Mc={class:"discord"},Ic={class:"discord-links"},xc={key:0},$c=["href"],Dc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Tc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Pc=X({__name:"Nav",setup(e){const t=G(null),n=G(null),r=G(null),i=G(null),{useHeader:s,banner:l,title:u,discordName:c,discordLink:p,versionNumber:h}=ve;function g(){window.open(p,"mywindow")}return(b,m)=>(S(),T(ne,null,[a(s)?(S(),T("div",Vt({key:0,class:"nav"},b.$attrs),[a(l)?(S(),T("img",{key:0,src:a(l),class:"banner",alt:a(u)},null,8,oc)):(S(),T("div",lc,ee(a(u)),1)),N("div",{onClick:m[0]||(m[0]=k=>{var C;return(C=i.value)==null?void 0:C.open()}),class:"version-container"},[d(qe,{display:"Changelog",direction:a(W).Down,class:"version"},{default:H(()=>[N("span",null,"v"+ee(a(h)),1)]),_:1},8,["direction"])]),uc,N("div",cc,[N("span",{onClick:g,class:"material-icons"},"discord"),N("ul",dc,[a(p)?(S(),T("li",pc,[N("a",{href:a(p),target:"_blank"},ee(a(c)),9,fc)])):B("",!0),gc,mc])]),N("div",null,[N("a",vc,[d(qe,{display:"Forums",direction:a(W).Down,yoffset:"5px"},{default:H(()=>[hc]),_:1},8,["direction"])])]),N("div",{onClick:m[1]||(m[1]=k=>{var C;return(C=t.value)==null?void 0:C.open()})},[d(qe,{display:"Info",direction:a(W).Down,class:"info"},{default:H(()=>[bc]),_:1},8,["direction"])]),N("div",{onClick:m[2]||(m[2]=k=>{var C;return(C=n.value)==null?void 0:C.open()})},[d(qe,{display:"Saves",direction:a(W).Down,xoffset:"-20px"},{default:H(()=>[yc]),_:1},8,["direction"])]),N("div",{onClick:m[3]||(m[3]=k=>{var C;return(C=r.value)==null?void 0:C.open()})},[d(qe,{display:"Settings",direction:a(W).Down,xoffset:"-66px"},{default:H(()=>[wc]),_:1},8,["direction"])])],16)):(S(),T("div",Vt({key:1,class:"overlay-nav"},b.$attrs),[N("div",{onClick:m[4]||(m[4]=k=>{var C;return(C=i.value)==null?void 0:C.open()}),class:"version-container"},[d(qe,{display:"Changelog",direction:a(W).Right,xoffset:"25%",class:"version"},{default:H(()=>[N("span",null,"v"+ee(a(h)),1)]),_:1},8,["direction"])]),N("div",{onClick:m[5]||(m[5]=k=>{var C;return(C=n.value)==null?void 0:C.open()})},[d(qe,{display:"Saves",direction:a(W).Right},{default:H(()=>[_c]),_:1},8,["direction"])]),N("div",{onClick:m[6]||(m[6]=k=>{var C;return(C=r.value)==null?void 0:C.open()})},[d(qe,{display:"Settings",direction:a(W).Right},{default:H(()=>[Nc]),_:1},8,["direction"])]),N("div",{onClick:m[7]||(m[7]=k=>{var C;return(C=t.value)==null?void 0:C.open()})},[d(qe,{display:"Info",direction:a(W).Right},{default:H(()=>[Cc]),_:1},8,["direction"])]),N("div",null,[N("a",kc,[d(qe,{display:"Forums",direction:a(W).Right,xoffset:"7px"},{default:H(()=>[Sc]),_:1},8,["direction"])])]),N("div",Mc,[N("span",{onClick:g,class:"material-icons"},"discord"),N("ul",Ic,[a(p)?(S(),T("li",xc,[N("a",{href:a(p),target:"_blank"},ee(a(c)),9,$c)])):B("",!0),Dc,Tc])])],16)),d(fu,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),d(Hi,{ref_key:"savesManager",ref:n},null,512),d(Cu,{ref_key:"options",ref:r},null,512),d(Yl,{ref_key:"changelog",ref:i},null,512)],64))}});var Yi=be(Pc,[["__scopeId","data-v-318a1c31"]]);const Ac={class:"inner-tab"},Rc=X({__name:"Game",setup(e){const t=Jt(Y,"tabs"),n=y(()=>Object.keys(ge)),r=ve.useHeader;function i(s){const{display:l,minimized:u,name:c,color:p,minimizable:h,nodes:g,minimizedDisplay:b}=s;return{display:l,minimized:u,name:c,color:p,minimizable:h,nodes:g,minimizedDisplay:b}}return(s,l)=>(S(),T("div",{class:Ne(["tabs-container",{useHeader:a(r)}])},[(S(!0),T(ne,null,Dt(a(t),(u,c)=>{var p,h;return S(),T("div",{key:c,class:Ne(["tab",a((p=a(ge)[u])==null?void 0:p.classes)]),style:Le(a((h=a(ge)[u])==null?void 0:h.style))},[c===0&&!a(r)?(S(),re(Yi,{key:0})):B("",!0),N("div",Ac,[a(n).includes(u)?(S(),re(Gl,Vt({key:0},i(a(ge)[u]),{index:c,onSetMinimized:g=>a(ge)[u].minimized.value=g}),null,16,["index","onSetMinimized"])):(S(),re(Ke(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Ec=be(Rc,[["__scopeId","data-v-dcd207b4"]]);const Fc=X({__name:"Sticky",setup(e){const t=G("0"),n=new ResizeObserver(i),r=_t(null);function i(){let s=r.value;if(s==null)return;let l=0;for(;s.previousSibling;){const u=s.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),s=u}t.value=l+"px"}return Xt(i),document.fonts.ready.then(i),Qn(()=>{var l;const s=(l=r.value)==null?void 0:l.parentElement;s&&n.observe(s)}),(s,l)=>(S(),T("div",{class:"sticky",style:Le({top:t.value}),ref_key:"element",ref:r,"data-v-sticky":""},[qt(s.$slots,"default",{},void 0,!0)],4))}});var mr=be(Fc,[["__scopeId","data-v-cccac690"]]);const Oc=["x1","y1","x2","y2"],qc=X({__name:"BoardLink",props:{link:null,dragging:null,dragged:null},setup(e){const t=e,n=Ae(t),r=y(()=>{var u,c,p,h,g,b,m;const l={...n.link.value.startNode.position};return n.link.value.offsetStart&&(l.x+=a(n.link.value.offsetStart).x,l.y+=a(n.link.value.offsetStart).y),((u=n.dragging)==null?void 0:u.value)===n.link.value.startNode&&(l.x+=(h=(p=(c=n.dragged)==null?void 0:c.value)==null?void 0:p.x)!=null?h:0,l.y+=(m=(b=(g=n.dragged)==null?void 0:g.value)==null?void 0:b.y)!=null?m:0),l}),i=y(()=>{var u,c,p,h,g,b,m;const l={...n.link.value.endNode.position};return n.link.value.offsetEnd&&(l.x+=a(n.link.value.offsetEnd).x,l.y+=a(n.link.value.offsetEnd).y),((u=n.dragging)==null?void 0:u.value)===n.link.value.endNode&&(l.x+=(h=(p=(c=n.dragged)==null?void 0:c.value)==null?void 0:p.x)!=null?h:0,l.y+=(m=(b=(g=n.dragged)==null?void 0:g.value)==null?void 0:b.y)!=null?m:0),l}),s=y(()=>Bi(t.link));return(l,u)=>(S(),T("line",Vt({class:"link"},a(s),{class:{pulsing:e.link.pulsing},x1:a(r).x,y1:a(r).y,x2:a(i).x,y2:a(i).y}),null,16,Oc))}});var Vc=be(qc,[["__scopeId","data-v-0f903ba5"]]);const Bc={key:0},Lc=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],jc=["fill","stroke-width","stroke"],zc=["fill"],Gc=X({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const r=Ae(e),i=y(()=>pe(r.nodeType.value.size,a(r.node))),s=y(()=>{var h;return(h=pe(r.nodeType.value.outlineColor,a(r.node)))!=null?h:It[ie.theme].variables["--outline"]}),l=y(()=>{var h;return(h=pe(r.nodeType.value.titleColor,a(r.node)))!=null?h:It[ie.theme].variables["--foreground"]}),u=y(()=>pe(r.nodeType.value.actionDistance,a(r.node)));function c(h,g){t("clickAction",g.id),h.preventDefault(),h.stopPropagation()}function p(h,g){var b;((b=a(r.selectedAction))==null?void 0:b.id)===g.id&&(h.preventDefault(),h.stopPropagation())}return(h,g)=>(S(),re(Wn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(S(),T("g",Bc,[(S(!0),T(ne,null,Dt(e.actions,(b,m)=>{var k,C;return S(),T("g",{key:b.id,class:Ne(["action",{selected:((k=e.selectedAction)==null?void 0:k.id)===b.id}]),transform:`translate( + ${(-a(i)-30)*Math.sin(((e.actions.length-1)/2-m)*a(u))}, + ${(a(i)+30)*Math.cos(((e.actions.length-1)/2-m)*a(u))} + )`,onMousedown:$=>c($,b),onTouchstart:$=>c($,b),onMouseup:$=>p($,b),onTouchend:Pn($=>p($,b),["stop"])},[N("circle",{fill:a(pe)(b.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===b.id?4:0,stroke:a(s)},null,8,jc),N("text",{fill:a(l),class:"material-icons"},ee(a(pe)(b.icon,e.node)),9,zc)],42,Lc)}),128))])):B("",!0)]),_:1}))}});var Uc=be(Gc,[["__scopeId","data-v-9efb2a56"]]);const Wc=["transform"],Hc={key:0},Yc=["r","fill","stroke"],Zc=["r","fill","stroke"],Xc=["r","fill"],Jc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Kc=["fill","transform"],Qc={key:1,transform:"rotate(45, 0, 0)"},ed=["width","height","transform","fill","stroke"],td=["width","height","transform","fill","stroke"],nd=["width","height","transform","fill"],rd=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],id=["fill","y"],ad=["fill"],sd=["fill","y"],od={key:0},ld=["fill","y"],ud=["fill","y"],cd=X({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,r=Math.sqrt(2),i=Ae(n),s=y(()=>pe(i.nodeType.value.draggable,a(i.node)));wt(s,K=>{const $e=a(i.node);a(i.dragging)===$e&&!K&&t("endDragging",$e)});const l=y(()=>{var $e;const K=a(i.node);return($e=pe(i.nodeType.value.actions,K))==null?void 0:$e.filter(nt=>Ze(pe(nt.visibility,K)))}),u=y(()=>{var $e;const K=a(i.node);if(pe(i.nodeType.value.draggable,K)&&(($e=a(i.dragging))==null?void 0:$e.id)===K.id&&a(i.dragged)!=null){const{x:nt,y:ht}=a(i.dragged);return{x:K.position.x+Math.round(nt/25)*25,y:K.position.y+Math.round(ht/25)*25}}return K.position}),c=y(()=>pe(i.nodeType.value.shape,a(i.node))),p=y(()=>pe(i.nodeType.value.title,a(i.node))),h=y(()=>pe(i.nodeType.value.otherSubtitle,a(i.node))),g=y(()=>{var K;return(K=i.isSelected.value?a(i.selectedAction)&&pe(a(i.selectedAction).tooltip,a(i.node)):null)!=null?K:pe(i.nodeType.value.label,a(i.node))}),b=y(()=>{var K,$e;return pe(($e=(K=a(i.selectedAction))==null?void 0:K.confirmationLabel)!=null?$e:{text:"Tap again to confirm"},a(i.node))}),m=y(()=>pe(i.nodeType.value.size,a(i.node))),k=y(()=>{var K;return(K=pe(i.nodeType.value.progress,a(i.node)))!=null?K:0}),C=y(()=>It[ie.theme].variables["--background"]),$=y(()=>{var K;return(K=pe(i.nodeType.value.outlineColor,a(i.node)))!=null?K:It[ie.theme].variables["--outline"]}),x=y(()=>{var K;return(K=pe(i.nodeType.value.fillColor,a(i.node)))!=null?K:It[ie.theme].variables["--raised-background"]}),I=y(()=>pe(i.nodeType.value.progressColor,a(i.node))),R=y(()=>{var K;return(K=pe(i.nodeType.value.titleColor,a(i.node)))!=null?K:It[ie.theme].variables["--foreground"]}),L=y(()=>pe(i.nodeType.value.progressDisplay,a(i.node))),ce=y(()=>i.dragging.value!=null&&a(i.hasDragged)&&pe(i.nodeType.value.canAccept,a(i.node),i.dragging.value)),le=y(()=>pe(i.nodeType.value.style,a(i.node))),ae=y(()=>pe(i.nodeType.value.classes,a(i.node)));function J(K){t("mouseDown",K,i.node.value,s.value)}function Ie(K){var $e,nt,ht;($e=i.hasDragged)!=null&&$e.value||(t("endDragging",i.node.value),(ht=(nt=i.nodeType.value).onClick)==null||ht.call(nt,i.node.value),K.stopPropagation())}const he=y(()=>pe(i.nodeType.value.subtitle,a(i.node))),Ue=y(()=>pe(i.nodeType.value.showStar,a(i.node))),vt=y(()=>pe(i.nodeType.value.fillStar,a(i.node)));return(K,$e)=>{var nt,ht,pt;return S(),T("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:a(s),...a(ae)}]),style:Le([{opacity:((nt=e.dragging)==null?void 0:nt.id)===e.node.id&&e.hasDragged?.5:1},(ht=a(le))!=null?ht:[]]),transform:`translate(${a(u).x},${a(u).y})${e.isSelected?" scale(1.2)":""}`},[d(Uc,{actions:(pt=a(l))!=null?pt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:$e[0]||($e[0]=St=>t("clickAction",St))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:J,onTouchstartPassive:J,onMouseup:Ie,onTouchendPassive:Ie},[a(c)===a(Ge).Circle?(S(),T("g",Hc,[a(ce)?(S(),T("circle",{key:0,class:"receiver",r:a(m)+8,fill:a(C),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,Yc)):B("",!0),N("circle",{class:"body",r:a(m),fill:a(x),stroke:a($),"stroke-width":4},null,8,Zc),a(L)===a(un).Fill?(S(),T("circle",{key:1,class:"progress progressFill",r:Math.max(a(m)*a(k)-2,0),fill:a(I)},null,8,Xc)):(S(),T("circle",{key:2,r:a(m)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(a(m)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(a(m)+4.5)*2*Math.PI-a(k)*(a(m)+4.5)*2*Math.PI,stroke:a(I)},null,8,Jc)),a(Ue)?(S(),T("path",{key:3,d:"m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z",stroke:"var(--bought)","stroke-width":4,fill:a(vt)?"var(--bought)":"none",transform:`translate(${-a(m)/4}, ${-a(m)-10}), scale(0.5)`},null,8,Kc)):B("",!0)])):a(c)===a(Ge).Diamond?(S(),T("g",Qc,[a(ce)?(S(),T("rect",{key:0,class:"receiver",width:a(m)*a(r)+16,height:a(m)*a(r)+16,transform:`translate(${-(a(m)*a(r)+16)/2}, ${-(a(m)*a(r)+16)/2})`,fill:a(C),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,ed)):B("",!0),N("rect",{class:"body",width:a(m)*a(r),height:a(m)*a(r),transform:`translate(${-a(m)*a(r)/2}, ${-a(m)*a(r)/2})`,fill:a(x),stroke:a($),"stroke-width":4},null,8,td),a(L)===a(un).Fill?(S(),T("rect",{key:1,class:"progress progressFill",width:Math.max(a(m)*a(r)*a(k)-2,0),height:Math.max(a(m)*a(r)*a(k)-2,0),transform:`translate(${-Math.max(a(m)*a(r)*a(k)-2,0)/2}, ${-Math.max(a(m)*a(r)*a(k)-2,0)/2})`,fill:a(I)},null,8,nd)):(S(),T("rect",{key:2,class:"progress progressDiamond",width:a(m)*a(r)+9,height:a(m)*a(r)+9,transform:`translate(${-(a(m)*a(r)+9)/2}, ${-(a(m)*a(r)+9)/2})`,fill:"transparent","stroke-dasharray":(a(m)*a(r)+9)*4,"stroke-width":5,"stroke-dashoffset":(a(m)*a(r)+9)*4-a(k)*(a(m)*a(r)+9)*4,stroke:a(I)},null,8,rd))])):B("",!0),N("text",{fill:a(R),class:"node-title",y:a(h)&&!a(he)?-10:0},ee(a(p)),9,id),a(he)?(S(),T("text",{key:2,fill:a(R),class:"node-subtitle",y:"-25"},ee(a(he)),9,ad)):B("",!0),a(h)?(S(),T("text",{key:3,fill:a(R),class:"node-subtitle",y:a(he)?25:15},ee(a(h)),9,sd)):B("",!0)],32),d(Wn,{name:"fade",appear:""},{default:H(()=>{var St;return[a(g)?(S(),T("g",od,[N("text",{fill:(St=a(g).color)!=null?St:a(R),class:Ne(["node-title",{pulsing:a(g).pulsing}]),y:-a(m)-20},ee(a(g).text),11,ld)])):B("",!0)]}),_:1}),d(Wn,{name:"fade",appear:""},{default:H(()=>{var St;return[e.isSelected&&e.selectedAction?(S(),T("text",{key:0,fill:(St=a(b).color)!=null?St:a(R),class:Ne(["node-title",{pulsing:a(b).pulsing}]),y:a(m)+75},ee(a(b).text),11,ud)):B("",!0)]}),_:1})],14,Wc)}}});var dd=be(cd,[["__scopeId","data-v-85b0e9a6"]]);const pd={class:"stage",width:"100%",height:"100%"},fd={class:"g1"},gd=X({__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=Ae(e),r=G({x:0,y:0}),i=G({x:0,y:0}),s=G(!1),l=G(null),u=y(()=>{const m=n.nodes.value.slice();if(n.selectedNode.value){const k=m.splice(m.indexOf(n.selectedNode.value),1)[0];m.push(k)}if(n.draggingNode.value){const k=m.splice(m.indexOf(n.draggingNode.value),1)[0];m.push(k)}return m});Pt(()=>{const m=n.draggingNode.value;if(m==null)return null;const k={x:m.position.x+i.value.x,y:m.position.y+i.value.y};let C=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce(($,x)=>{if(x.id===m.id)return $;const I=n.types.value[x.type];if(!pe(I.canAccept,x,m))return $;const L=Math.pow(k.x-x.position.x,2)+Math.pow(k.y-x.position.y,2);let ce=pe(I.size,x);return L>C||L>ce*ce?$:(C=L,x)},null))});function c(m){m.setTransformOrigin(null),m.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function p(m,k=null,C=!1){if(n.draggingNode.value==null){m.preventDefault(),m.stopPropagation();let $,x;if("touches"in m)if(m.touches.length===1)$=m.touches[0].clientX,x=m.touches[0].clientY;else return;else $=m.clientX,x=m.clientY;r.value={x:$,y:x},i.value={x:0,y:0},s.value=!1,C&&n.setDraggingNode.value(k)}k!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(m){const{x:k,y:C,scale:$}=l.value.panZoomInstance.getTransform();let x,I;if("touches"in m)if(m.touches.length===1)x=m.touches[0].clientX,I=m.touches[0].clientY;else{g(n.draggingNode.value),n.mousePosition.value=null;return}else x=m.clientX,I=m.clientY;n.mousePosition.value={x:(x-k)/$,y:(I-C)/$},i.value={x:i.value.x+(x-r.value.x)/$,y:i.value.y+(I-r.value.y)/$},r.value={x,y:I},(Math.abs(i.value.x)>10||Math.abs(i.value.y)>10)&&(s.value=!0),n.draggingNode.value!=null&&(m.preventDefault(),m.stopPropagation())}function g(m,k=!1){var C,$;if(n.draggingNode.value!=null&&n.draggingNode.value===m){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(i.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(i.value.y/25)*25);const x=n.nodes.value;x.push(x.splice(x.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&(($=(C=n.types.value[n.receivingNode.value.type]).onDrop)==null||$.call(C,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!s.value&&!k&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function b(m,k){var $,x;const C=n.types.value[m.type];pe((x=($=C.actions)==null?void 0:$.find(I=>I.id===k))==null?void 0:x.confirmationLabel,m)==null&&(n.state.value.selectedAction=k),n.state.value.selectedAction===k?a(n.selectedAction).onClick(a(n.selectedNode)):n.state.value={...n.state.value,selectedAction:k}}return(m,k)=>{const C=Ct("panZoom");return a(Ze)(e.visibility)?(S(),re(C,{key:0,style:Le([{width:e.width,height:e.height},e.style]),class:Ne(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:k[0]||(k[0]=$=>p($)),onTouchstart:k[1]||(k[1]=$=>p($)),onMouseup:k[2]||(k[2]=()=>g(a(e.draggingNode))),onTouchendPassive:k[3]||(k[3]=()=>g(a(e.draggingNode))),onMouseleave:k[4]||(k[4]=()=>g(a(e.draggingNode),!0))},{default:H(()=>[(S(),T("svg",pd,[N("g",fd,[d(ui,{name:"link",appear:""},{default:H(()=>[(S(!0),T(ne,null,Dt(a(e.links)||[],$=>(S(),T("g",{key:`${$.startNode.id}-${$.endNode.id}`},[d(Vc,{link:$,dragging:a(e.draggingNode),dragged:$.startNode===a(e.draggingNode)||$.endNode===a(e.draggingNode)?i.value:void 0},null,8,["link","dragging","dragged"])]))),128))]),_:1}),d(ui,{name:"grow",duration:500,appear:""},{default:H(()=>[(S(!0),T(ne,null,Dt(a(u),$=>(S(),T("g",{key:$.id,style:{"transition-duration":"0s"}},[d(dd,{node:$,nodeType:e.types[$.type],dragging:a(e.draggingNode),dragged:a(e.draggingNode)===$?i.value:void 0,hasDragged:a(e.draggingNode)==null?!1:s.value,receivingNode:a(e.receivingNode)===$,isSelected:a(e.selectedNode)===$,selectedAction:a(e.selectedNode)===$?a(e.selectedAction):null,onMouseDown:p,onEndDragging:g,onClickAction:x=>b($,x)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):B("",!0)}}});Qe.on("setupVue",e=>Ca.install(e));const Zi=Symbol("Board");var un=(e=>(e.Outline="Outline",e.Fill="Fill",e))(un||{}),Ge=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(Ge||{});function md(e){const t=ct({nodes:[],selectedNode:null,selectedAction:null},!1);return et(n=>{const r=e.call(n,n);r.id=Qt("board-"),r.type=Zi,r[gt]=gd,r.state?(Gi(t),A(r,"state")):(t[Kt]={nodes:r.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},r.state=t),r.nodes=y(()=>a(l.state).nodes),r.selectedNode=y({get(){return l.nodes.value.find(u=>u.id===a(l.state).selectedNode)||null},set(u){var c,p;Ve(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(p=u==null?void 0:u.id)!=null?p:null}}),r.selectedAction=y({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(p=>p.id===a(l.state).selectedAction)||null},set(u){var c,p;Ve(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(p=u==null?void 0:u.id)!=null?p:null}}),r.mousePosition=G(null),r.links?A(r,"links"):r.links=y(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?pe(l.selectedAction.value.links,l.selectedNode.value):null),r.draggingNode=G(null),r.receivingNode=G(null),A(r,"visibility"),oe(r,"visibility",Se.Visible),A(r,"width"),oe(r,"width","100%"),A(r,"height"),oe(r,"height","100%"),A(r,"classes"),A(r,"style");for(const u in r.types){const c=r.types[u];if(A(c,"title"),A(c,"subtitle"),A(c,"label"),A(c,"size"),oe(c,"size",50),A(c,"style"),A(c,"classes"),A(c,"draggable"),oe(c,"draggable",!1),A(c,"shape"),oe(c,"shape","Circle"),A(c,"canAccept"),oe(c,"canAccept",!1),A(c,"progress"),A(c,"progressDisplay"),oe(c,"progressDisplay","Fill"),A(c,"progressColor"),oe(c,"progressColor","none"),A(c,"fillColor"),A(c,"outlineColor"),A(c,"titleColor"),A(c,"actionDistance"),oe(c,"actionDistance",Math.PI/6),A(c,"otherSubtitle"),A(c,"showStar"),A(c,"fillStar"),c.nodes=y(()=>a(l.state).nodes.filter(p=>p.type===u)),oe(c,"onClick",function(p){a(l.state).selectedNode=p.id}),c.actions)for(const p of c.actions)A(p,"visibility"),oe(p,"visibility",Se.Visible),A(p,"icon"),A(p,"fillColor"),A(p,"tooltip"),A(p,"confirmationLabel"),oe(p,"confirmationLabel",{text:"Tap again to confirm"}),A(p,"links")}function i(u){r.draggingNode.value=u}function s(u){r.receivingNode.value=u}r.placeInAvailableSpace=function(u,c=100,p=W.Right){const h=l.nodes.value.slice().filter(g=>g===u||(p===W.Down||p===W.Up)&&Math.abs(g.position.x-u.position.x)>c||(p===W.Left||p===W.Right)&&Math.abs(g.position.y-u.position.y)>c?!1:!(p===W.Right&&g.position.xu.position.x+c||p===W.Up&&g.position.y>u.position.y+c||p===W.Down&&g.position.yg.position.x-b.position.x:p===W.Left?(g,b)=>b.position.x-g.position.x:p===W.Up?(g,b)=>b.position.y-g.position.y:(g,b)=>g.position.y-b.position.y);for(let g=0;g0&&m>c)break}},r[dt]=function(){const{nodes:u,types:c,state:p,visibility:h,width:g,height:b,style:m,classes:k,links:C,selectedAction:$,selectedNode:x,mousePosition:I,draggingNode:R,receivingNode:L}=this;return{nodes:u,types:c,state:p,visibility:h,width:g,height:b,style:a(m),classes:k,links:C,selectedAction:$,selectedNode:x,mousePosition:I,draggingNode:R,receivingNode:L,setDraggingNode:i,setReceivingNode:s}};const l=r;return l})}function pe(e,t,...n){return Yn(e)?e(t,...n):a(e)}function An(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Gn={};Qe.on("addLayer",e=>{const t=Xn(e,Zi);Gn[e.id]=e.on("postUpdate",n=>{t.forEach(r=>{Object.values(r.types).forEach(i=>i.nodes.value.forEach(s=>{var l;return(l=i.update)==null?void 0:l.call(i,s,n)}))})})});Qe.on("removeLayer",e=>{var t;(t=Gn[e.id])==null||t.call(Gn),Gn[e.id]=void 0});function $n(e,t="points",n=0,r=void 0){const i=Ve(e)?e:ct(e);if(i.displayName=t,i.precision=n,i.small=r,!Ve(e)){const s=i[Ot];s.displayName=t,s.precision=n,s.small=r}return i}new o("10^^8");new o("1e100");function vr(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?ut(e.small?n:o.floor(n)):xe(n,e.precision,e.small)}Qe.on("setupVue",e=>e.use(ka));function vd(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 hd=X({props:{visibility:{type:q(Number,Boolean),required:!0},display:{type:q(Object,String,Function),required:!0},style:q(String,Object,Array),classes:q(Object),glowColor:q(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:r,floating:i}=Ae(e),s=Hr(n),l=y(()=>{const c=Pe(r);return c==null||c===""?{}:a(i)?vd(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:s,glowColorStyle:l,unref:a,Visibility:Se,isVisible:Ze,isHidden:_n}}});function bd(e,t,n,r,i,s){var l;return e.isVisible(e.visibility)?(S(),T("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:Ne(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:Le([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(S(),re(Ke(e.component)))],6)):B("",!0)}var Xi=be(hd,[["render",bd],["__scopeId","data-v-21427abb"]]);const yd=X({props:{visibility:{type:q(Number,Boolean),required:!0},activeTab:{type:q(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:q(Object),required:!0},style:q(String,Object,Array),classes:q(Object),buttonContainerStyle:q(String,Object,Array),buttonContainerClasses:q(Object)},components:{Sticky:mr,TabButton:Xi},setup(e){const{activeTab:t}=Ae(e),n=y(()=>It[ie.theme].floatingTabs),r=_t("");Pt(()=>{const u=Pe(t);if(u==null){r.value="";return}if(At(u)){r.value=fe(u);return}r.value=fe(a(u.display))});const i=y(()=>{const u=Pe(t);return At(u)||!u?void 0:a(u.classes)}),s=y(()=>{const u=Pe(t);return At(u)||!u?void 0:a(u.style)});function l(u){const{display:c,style:p,classes:h,glowColor:g,visibility:b}=u;return{display:c,style:a(p),classes:h,glowColor:g,visibility:b}}return{floating:n,tabClasses:i,tabStyle:s,Visibility:Se,component:r,gatherButtonProps:l,unref:a,isVisible:Ze,isHidden:_n}}});function wd(e,t,n,r,i,s){var c,p;const l=Ct("TabButton"),u=Ct("Sticky");return e.isVisible(e.visibility)?(S(),T("div",{key:0,class:Ne(["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:[],(p=e.tabStyle)!=null?p:[]])},[d(u,{class:Ne(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:Le(e.unref(e.buttonContainerStyle))},{default:H(()=>[N("div",{class:Ne(["tab-buttons",{floating:e.floating}])},[(S(!0),T(ne,null,Dt(e.unref(e.tabs),(h,g)=>(S(),re(l,Vt({onSelectTab:b=>e.selected.value=g,floating:e.floating,key:g,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)?(S(),re(Ke(e.unref(e.component)),{key:0})):B("",!0)],6)):B("",!0)}var _d=be(yd,[["render",wd],["__scopeId","data-v-58dbf83a"]]);const Nd=Symbol("TabButton"),Cd=Symbol("TabFamily");function Ji(e,t){Object.keys(e).length===0&&console.error("Cannot create tab family with 0 tabs");const n=ct(Object.keys(e)[0],!1);return et(r=>{var l;const i=(l=t==null?void 0:t.call(r,r))!=null?l:{};i.id=Qt("tabFamily-"),i.type=Cd,i[gt]=_d,i.tabs=Object.keys(e).reduce((u,c)=>{const p=e[c]();return p.type=Nd,p[gt]=Xi,A(p,"visibility"),oe(p,"visibility",Se.Visible),A(p,"tab"),A(p,"display"),A(p,"classes"),A(p,"style"),A(p,"glowColor"),u[c]=p,u},{}),i.selected=n,i.activeTab=y(()=>{const u=a(s.tabs);if(n.value in u&&Ze(u[n.value].visibility))return a(u[n.value].tab);const c=Object.values(u).find(p=>Ze(p.visibility));return c?a(c.tab):null}),A(i,"visibility"),oe(i,"visibility",Se.Visible),A(i,"classes"),A(i,"style"),A(i,"buttonContainerClasses"),A(i,"buttonContainerStyle"),i[dt]=function(){const{visibility:u,activeTab:c,selected:p,tabs:h,style:g,classes:b,buttonContainerClasses:m,buttonContainerStyle:k}=this;return{visibility:u,activeTab:c,selected:p,tabs:h,style:a(g),classes:b,buttonContainerClasses:m,buttonContainerStyle:k}};const s=i;return s})}function Ht(e){return et(t=>{const{addend:n,description:r,enabled:i,smallerIsBetter:s}=e.call(t,t),l=_e(n),u=_e(r),c=i==null?void 0:_e(i);return{apply:p=>o.add(p,a(l)),invert:p=>o.sub(p,a(l)),getFormula:p=>f.add(p,l),enabled:c,description:r==null?void 0:j(()=>d("div",{class:"modifier-container"},[a(u)!=null?d("span",{class:"modifier-description"},[mt(a(u))]):null,d("span",{class:"modifier-amount",style:(s===!0?o.gt(a(l),0):o.lt(a(l),0))?"color: var(--danger)":""},[o.gte(a(l),0)?"+":"",Zt(a(l))])]))}})}function Ce(e){return et(t=>{const{multiplier:n,description:r,enabled:i,smallerIsBetter:s}=e.call(t,t),l=_e(n),u=_e(r),c=i==null?void 0:_e(i);return{apply:p=>o.times(p,a(l)),invert:p=>o.div(p,a(l)),getFormula:p=>f.times(p,l),enabled:c,description:r==null?void 0:j(()=>d("div",{class:"modifier-container"},[a(u)!=null?d("span",{class:"modifier-description"},[mt(a(u))]):null,d("span",{class:"modifier-amount",style:(s===!0?o.gt(a(l),1):o.lt(a(l),1))?"color: var(--danger)":""},[w("\xD7"),Zt(a(l))])]))}})}function kd(e){return et(t=>{const{exponent:n,description:r,enabled:i,supportLowNumbers:s,smallerIsBetter:l}=e.call(t,t),u=_e(n),c=_e(r),p=i==null?void 0:_e(i);return{apply:h=>{let g=h;return s&&(g=o.add(g,1)),g=o.pow(g,a(u)),s&&(g=o.sub(g,1)),g},invert:h=>{let g=h;return s&&(g=o.add(g,1)),g=o.root(g,a(u)),s&&(g=o.sub(g,1)),g},getFormula:h=>s?f.add(h,1).pow(u).sub(1):f.pow(h,u),enabled:p,description:r==null?void 0:j(()=>d("div",{class:"modifier-container"},[a(c)!=null?d("span",{class:"modifier-description"},[mt(a(c)),s?" (+1 effective)":null]):null,d("span",{class:"modifier-amount",style:(l===!0?o.gt(a(u),1):o.lt(a(u),1))?"color: var(--danger)":""},[w("^"),Zt(a(u))])]))}})}function Mt(e){return et(()=>{const t=e();return{apply:n=>t.filter(r=>a(r.enabled)!==!1).reduce((r,i)=>i.apply(r),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(r=>a(r.enabled)!==!1).reduceRight((r,i)=>i.invert(r),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(r=>a(r.enabled)!==!1).reduce((r,i)=>i.getFormula(r),n):void 0,enabled:t.some(n=>n.enabled!=null)?y(()=>t.filter(n=>a(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?j(()=>d(ne,null,[t.filter(n=>a(n.enabled)!==!1).map(n=>a(n.description)).filter(n=>n).map(mt)])):void 0}})}const Br=f.variable(0).step(2e3,e=>e.pow_base(1.02)).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).pow(1.5),pn={id:"deselect",icon:"close",tooltip:e=>({text:"portals"in e.state?"Disconnect portals":"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"portals"in e.state?e.state={...e.state,portals:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),v.board.selectedAction.value=null,v.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"portals"in e.state?e.state.portals.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},jt={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${ut(v.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},v.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function Cn(e,t=1/0){const n=e(f.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(r){return{text:`Increase Connections - ${ut(n.evaluate(r.state.maxConnections))} energy`}},fillColor(r){return o.gte(v.energy.value,n.evaluate(r.state.maxConnections))?"var(--bought)":"var(--locked)"},confirmationLabel:r=>o.gte(v.energy.value,n.evaluate(r.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(r){const i=n.evaluate(r.state.maxConnections);o.gte(v.energy.value,i)&&(v.energy.value=o.sub(v.energy.value,i),r.state={...r.state,maxConnections:o.add(r.state.maxConnections,1)},v.board.selectedAction.value=null)},visibility:r=>o.add(r.state.maxConnections,v.computedBonusConnectionsModifier.value).lt(t)}}function Ki(e,t){var n,r;if(((n=v.board.draggingNode.value)==null?void 0:n.type)==="resource"){const i=((r=v.board.draggingNode.value)==null?void 0:r.state).type,{maxConnections:s,resources:l}=e.state;return l.includes(i)?{text:"Disconnect",color:"var(--accent2)"}:o.add(s,v.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(i),color:"var(--accent2)"}}return null}function Sd(e,t){var n,r;if(((n=v.board.draggingNode.value)==null?void 0:n.type)==="passive"){const i=(r=v.board.draggingNode.value)==null?void 0:r.state,{maxConnections:s,tools:l}=e.state;return l.includes(i)?{text:"Disconnect",color:"var(--accent2)"}:o.add(s,v.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(i),color:"var(--accent2)"}}return null}function wr(e,t){var n,r;if(((n=v.board.draggingNode.value)==null?void 0:n.type)==="portal"){const i=((r=v.board.draggingNode.value)==null?void 0:r.state).id,{maxConnections:s,portals:l}=e.state;return l.includes(i)?{text:"Disconnect",color:"var(--accent2)"}:o.add(s,v.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(i),color:"var(--accent2)"}}return null}function Qi(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:r,resources:i}=e.state;return i.includes(n)?!0:!o.add(r,v.computedBonusConnectionsModifier.value).lte(i.length)}function ea(e,t){if(t.type!=="resource")return;const n=t.state.type,r=e.state.resources;r.includes(n)?e.state={...e.state,resources:r.filter(i=>i!==n)}:e.state={...e.state,resources:[...r,n]},v.board.selectedNode.value=e}function Md(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:r,tools:i}=e.state;return i.includes(n)?!0:!o.add(r,v.computedBonusConnectionsModifier.value).lte(i.length)}function Id(e,t){if(t.type!=="passive")return;const n=t.state,r=e.state.tools;r.includes(n)?e.state={...e.state,tools:r.filter(i=>i!==n)}:e.state={...e.state,tools:[...r,n]},v.board.selectedNode.value=e}function _r(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:r,portals:i}=e.state;return i.includes(n)?!0:!o.add(r,v.computedBonusConnectionsModifier.value).lte(i.length)}function Nr(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:r}=e.state;r.includes(n)?e.state={...e.state,portals:r.filter(i=>i!==n)}:e.state={...e.state,portals:[...r,n]},v.board.selectedNode.value=e}function ke(e){return e===v.board.selectedNode.value||e.state.powered}function te(e){return v.empowerer.value!=null&&ke(v.empowerer.value)&&v.empowerer.value.state.tools.includes(e)}function xd(e){var s,l,u;const t=(u=(l=(s=v.resourceNodes.value[e])==null?void 0:s.state)==null?void 0:l.amount)!=null?u:0,n=v.resourceLevels.value[e],r=Br.evaluate(n),i=Br.evaluate(o.add(n,1));return o.sub(t,r).max(0).div(o.sub(i,r)).toNumber()}function vn(e,t,n){if(t.value){const r=t.value.state,i=r[n],s=r.maxConnections;o.gt(i.length,o.add(s,e))&&(t.value.state={...t.value.state,[n]:i.slice(0,o.add(s,e).toNumber())})}}function zt(e){return{id:"help",icon:"question_mark",tooltip:{text:"Help"},onClick(){v.helpModals[e].showModal.value=!0,v.board.selectedAction.value=null},confirmationLabel:null}}function bi(e){return t=>ie.lineVisibility||e===v.board.selectedNode.value||e===v.board.draggingNode.value||v.resourceNodes.value[t]===v.board.draggingNode.value}const $d={key:0},Dd={key:0,class:"mark star"},Td=["src"],Pd=X({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(S(),T("div",$d,[e.mark===!0?(S(),T("div",Dd)):(S(),T("img",{key:1,class:"mark",src:e.mark},null,8,Td))])):B("",!0)}});var er=be(Pd,[["__scopeId","data-v-2207999f"]]);const Ad=X({__name:"Node",props:{id:null},setup(e){const n=Ae(e),r=dr(Yr,()=>{}),i=dr(Zr,()=>{}),s=_t(null),l=y(()=>s.value&&s.value.parentElement);return wt([l,n.id],([u,c],[p,h])=>{p&&i(a(h)),u&&r(c,u)}),Mi(()=>i(a(n.id))),(u,c)=>(S(),T("div",{class:"node",ref_key:"node",ref:s},null,512))}});var tr=be(Ad,[["__scopeId","data-v-a48cb382"]]),Rd=X({props:{display:{type:q(Object,String,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),onClick:Function,onHold:Function,canClick:{type:q(Boolean),required:!0},small:Boolean,mark:q(Boolean,String),id:{type:String,required:!0}},components:{Node:tr,MarkNode:er},setup(e){const{display:t,onClick:n,onHold:r}=Ae(e),i=_t("");Pt(()=>{var h;const u=Pe(t);if(u==null){i.value="";return}if(At(u)){i.value=fe(u);return}const c=fe((h=u.title)!=null?h:"","h3"),p=fe(u.description,"div");i.value=fe(j(()=>d("span",null,[u.title!=null?d("div",null,[d(c,null,null)]):null,d(p,null,null)])))});const{start:s,stop:l}=Vi(n,r);return{start:s,stop:l,comp:i,Visibility:Se,isVisible:Ze,isHidden:_n,unref:a}}});function Ed(e,t,n,r,i,s){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(S(),T("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]=(...p)=>e.onClick&&e.onClick(...p)),onMousedown:t[1]||(t[1]=(...p)=>e.start&&e.start(...p)),onMouseleave:t[2]||(t[2]=(...p)=>e.stop&&e.stop(...p)),onMouseup:t[3]||(t[3]=(...p)=>e.stop&&e.stop(...p)),onTouchstartPassive:t[4]||(t[4]=(...p)=>e.start&&e.start(...p)),onTouchendPassive:t[5]||(t[5]=(...p)=>e.stop&&e.stop(...p)),onTouchcancelPassive:t[6]||(t[6]=(...p)=>e.stop&&e.stop(...p)),class:Ne({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(S(),re(Ke(e.unref(e.comp)),{key:0})):B("",!0),d(l,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],38)):B("",!0)}var ta=be(Rd,[["render",Ed],["__scopeId","data-v-211328c0"]]);const na=Symbol("Clickable");function yi(e,...t){const n=t.reduce((r,i)=>{var s;return Object.assign(r,(s=i.getPersistentData)==null?void 0:s.call(i))},{});return et(r=>{var l,u,c;const i=(l=e==null?void 0:e.call(r,r))!=null?l:{};i.id=Qt("clickable-"),i.type=na,i[gt]=ta;for(const p of t)(u=p.preConstruct)==null||u.call(p,i);if(Object.assign(i,n),A(i,"visibility"),oe(i,"visibility",Se.Visible),A(i,"canClick"),oe(i,"canClick",!0),A(i,"classes"),A(i,"style"),A(i,"mark"),A(i,"display"),i.onClick){const p=i.onClick.bind(i);i.onClick=function(h){a(i.canClick)!==!1&&p(h)}}if(i.onHold){const p=i.onHold.bind(i);i.onHold=function(){a(i.canClick)!==!1&&p()}}for(const p of t)(c=p.postConstruct)==null||c.call(p,i);const s=t.reduce((p,h)=>{var g;return Object.assign(p,(g=h.getGatheredProps)==null?void 0:g.call(h,i))},{});return i[dt]=function(){const{display:p,visibility:h,style:g,classes:b,onClick:m,onHold:k,canClick:C,small:$,mark:x,id:I}=this;return{display:p,visibility:h,style:a(g),classes:b,onClick:m,onHold:k,canClick:C,small:$,mark:x,id:I,...s}},i})}function Fd(e,t,n=[]){n=n.length===0?Xn(e,na):n;const r=typeof t=="function"?y(t):t;return e.on("update",()=>{a(r)&&n.filter(i=>a(i.canClick)).forEach(i=>{var s;return(s=i.onClick)==null?void 0:s.call(i)})})}const Od=["x1","y1","x2","y2"],qd=X({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const t=e,n=Ae(t),r=y(()=>{const l=n.startNode.value.rect,u=n.boundingRect.value,c=u?{x:l.x+l.width/2-u.x,y:l.y+l.height/2-u.y}:{x:0,y:0};return n.link.value.offsetStart&&(c.x+=n.link.value.offsetStart.x,c.y+=n.link.value.offsetStart.y),c}),i=y(()=>{const l=n.endNode.value.rect,u=n.boundingRect.value,c=u?{x:l.x+l.width/2-u.x,y:l.y+l.height/2-u.y}:{x:0,y:0};return n.link.value.offsetEnd&&(c.x+=n.link.value.offsetEnd.x,c.y+=n.link.value.offsetEnd.y),c}),s=y(()=>Bi(t.link));return(l,u)=>(S(),T("line",Vt({"stroke-width":"15px",stroke:"white"},a(s),{x1:a(r).x,y1:a(r).y,x2:a(i).x,y2:a(i).y}),null,16,Od))}});const Vd=X({__name:"Links",props:{links:null},setup(e){var c;const n=Jt(e,"links"),r=G(null),i=dr(Xr,G({})),s=dr(Jr,G(void 0)),l=G((c=r.value)==null?void 0:c.getBoundingClientRect());wt(s,()=>{var p;return l.value=(p=r.value)==null?void 0:p.getBoundingClientRect()}),Qn(()=>{var p;return l.value=(p=r.value)==null?void 0:p.getBoundingClientRect()});const u=y(()=>{var h,g;const p=i.value;return(g=(h=n.value)==null?void 0:h.filter(b=>{var m,k;return((m=p[b.startNode.id])==null?void 0:m.rect)&&((k=p[b.startNode.id])==null?void 0:k.rect)}))!=null?g:[]});return(p,h)=>(S(),T(ne,null,[a(u)?(S(),T("svg",ha(Vt({key:0},p.$attrs)),[(S(!0),T(ne,null,Dt(a(u),(g,b)=>(S(),re(qd,{key:b,link:g,boundingRect:l.value,startNode:a(i)[g.startNode.id],endNode:a(i)[g.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):B("",!0),N("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var Bd=be(Vd,[["__scopeId","data-v-063f6d6b"]]);X({props:{nodes:{type:q(Array),required:!0},leftSideNodes:q(Array),rightSideNodes:q(Array),branches:q(Array)},components:{Links:Bd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:r}=Ae(e),i=_t();Pt(()=>{const u=Pe(t);i.value=fe(j(()=>d(ne,null,[u.map(c=>d("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(mt)]))])))});const s=_t();Pt(()=>{const u=Pe(n);s.value=u?fe(j(()=>d("span",{class:"left-side-nodes small"},[u.map(mt)]))):""});const l=_t();return Pt(()=>{const u=Pe(r);l.value=u?fe(j(()=>d("span",{class:"side-nodes small"},[u.map(mt)]))):""}),{unref:a,nodesComp:i,leftNodesComp:s,rightNodesComp:l}}});X({props:{display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),onClick:Function,onHold:Function,color:q(String),glowColor:q(String),canClick:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:er,Node:tr},setup(e){const{onClick:t,onHold:n,display:r}=Ae(e),i=Rn(r),{start:s,stop:l}=Vi(t,n);return{start:s,stop:l,comp:i,unref:a,Visibility:Se,isCoercableComponent:At,isVisible:Ze,isHidden:_n}}});function Un(e){const t=[],n={};let r=!1;function i(){return r||(t.push(...e()),n.base=t.map(u=>_e(u.base)),n.baseText=t.map(u=>_e(u.baseText)),n.visible=t.map(u=>_e(u.visible)),n.title=t.map(u=>_e(u.title)),n.subtitle=t.map(u=>_e(u.subtitle)),r=!0),t}const s=ct({},!1);return[j(()=>{const u=i();let c=!0;const p=u.map((h,g)=>{var x,I,R;if(a(n.visible[g])===!1)return null;const b=d("h3",{onClick:()=>s.value[g]=!s.value[g],style:"cursor: pointer"},[d("span",{class:"modifier-toggle"+(a(s.value[g])?" collapsed":"")},[w("\u25BC")]),a(n.title[g]),a(n.subtitle[g])!=null?d("span",{class:"subtitle"},[w(" ("),a(n.subtitle[g]),w(")")]):null]),m=a(s.value[g])?null:d(ne,null,[d("div",{class:"modifier-container"},[d("span",{class:"modifier-description"},[mt((x=a(n.baseText[g]))!=null?x:"Base")]),d("span",{class:"modifier-amount"},[xe((I=a(n.base[g]))!=null?I:1),h.unit])]),h.modifier.description==null?null:mt(a(h.modifier.description))]),k=!c;c=!1;const C=(R=a(n.base[g]))!=null?R:1,$=h.modifier.apply(C);return d(ne,null,[k?d("br",null,null):null,d("div",{style:{"--unit":ie.alignUnits&&h.unit!=null?"'"+h.unit+"'":""}},[b,d("br",null,null),m,d("hr",null,null),d("div",{class:"modifier-container"},[d("span",{class:"modifier-description"},[w("Total")]),d("span",{class:"modifier-amount",style:(h.smallerIsBetter===!0?o.gt($,C!=null?C:1):o.lt($,C!=null?C:1))?"color: var(--danger)":""},[Zt($),h.unit])])])])});return d(ne,null,[p])}),s]}function Er(e,t,n){const r=_e(t),i=_e(n);return y(()=>{const s=a(r),l=a(i);return o.gte(e.value,l)?"Now":o.lte(s,0)?"Never":yr(o.sub(l,e.value).div(s))})}function hn(e,t,n=1){const r=_e(t),i=_e(n);return e.hasVariable()||console.error("Cannot create formula preview if the formula does not have a variable"),j(()=>{var s;if(a(r)){const l=Zt(e.evaluate()),u=Zt(e.evaluate(o.add(a((s=e.innermostVariable)!=null?s:0),a(i))));return d(ne,null,[d("b",null,[d("i",null,[l,w(" \u2192 "),u])])])}return d(ne,null,[Zt(e.evaluate())])})}const Tt={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Et=Object.keys(Tt),ze={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"AI",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"ML",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Ft={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Nets",wood:"Mining Laser",stone:"Replicator",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"OC'ed Portals",ultimatum:"Rebates"},Ld={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 40% stronger":"Material level is 20% stronger"},silver:{description:e=>e?"Quadruples each plane's resource gain":"Doubles each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase (diminishing)":"+1% plane's resource gain per repeatable purchase (diminishing)"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"All upgrades apply twice":"Non-multiplicative upgrades apply twice"},coalRelic:{description:e=>e?"Every treasure boosts planar speed by +20%":"Every treasure boosts planar speed by +10%"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give quadruple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Powered machines)^2 boost quarry speed":"Powered machines boost quarry speed"},goldRelic:{description:e=>e?"Each treasure gives +50% XP gain":"Each treasure gives +25% XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs 20x less energy":"Creating portals costs 10x less energy"},platinumRelic:{description:e=>e?"Quadruple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"log(energy)^0.5 boosts planes' resource gain":"log(energy)^0.25 boosts planes' resource gain"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},yt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+difficulty",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-difficulty",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},or=f.variable(0).add(8).times(2).pow10(),jd=X({__name:"Tab",props:{display:null},setup(e){const t=e,{display:n}=Ae(t),r=Hr(n);return(i,s)=>(S(),re(Ke(a(r))))}}),zd=Symbol("Tab");function Fr(e){return et(t=>{const n=e.call(t,t);return n.id=Qt("tab-"),n.type=zd,n[gt]=jd,n[dt]=function(){const{display:r}=this;return{display:r}},n})}function Gt(e,t,n={}){const r=ct(!1);return{modal:j(()=>d(Lt,{modelValue:r.value,"onUpdate:modelValue":s=>r.value=s},{header:()=>d("h2",null,[e]),body:t})),showModal:r,...n}}function Gd(){return Gt("Getting Started",j(()=>d("div",null,[d("p",null,[w(`Welcome to Planar Pioneers! Your job is to gather resources and eventually explore and conquer increasingly difficult "planes", which are like alien worlds. To start you'll use the mine (\u26CF\uFE0F) machine to gather resources.`)]),d("br",null,null),d("p",null,[w(`You'll gain energy every second based on how much of each resource you have. You can check the exact calculation and various other information by clicking the "modifiers" button near the top of the screen.`)]),d("br",null,null),d("p",null,[w("Select the machine by clicking it to make the mine active. You can also drag them around to organize your various machines and other objects. While selected machines will have various actions you can take, such as viewing the help for that machine. There's also an action to power the machine, allowing it to be active even while not selected, at the cost of energy per second (cost increases based on the total number of machines being powered).")])])))}function Ud(){return Gt("Forging",j(()=>d("div",null,[d("p",null,[w("You've repaired the forge (\u{1F6E0}\uFE0F)! This is the next main line of progression. Here you'll be able to craft a total of 16 machines and passive bonuses to create - one for each resource!")]),d("br",null,null),d("p",null,[w("Drag a resource onto the forge to select that resource tier. You can then use an action on the forge to create that item, at the cost of energy based on the resource tier. You can only have 1 of each item.")])])))}function Wd(){return Gt("Dowsing",j(()=>d("div",null,[d("p",null,[w("You've created the dowsing rod (\u{1F962})! This machine lets you bias the odds of specified resources from mining. It will double the odds of each specified resource, so keep in mind rare resources will still be fairly rare.")]),d("br",null,null),d("p",null,[w("Specify resources to boost by dragging them to the dowsing rod. You can only select a single resource to start, but that can be increased using an action.")])])))}function Hd(){return Gt("Quarry",j(()=>d("div",null,[d("p",null,[w("You've created the Quarry (\u26F0\uFE0F)! This machine lets you gather specified resources. Unlike the mine, this machine will always output the same resources. However, rarer resources will take longer to gather.")]),d("br",null,null),d("p",null,[w("Specify resources to gather by dragging them to the quarry. You can only select a single resource to start, but that can be increased using an action.")])])))}function Yd(){return Gt("Tool Empowerer",j(()=>d("div",null,[d("p",null,[w("You've created the Tool Empowerer (\u{1F50C})! This machine lets you increase the effect of specified passives. Experimenting with which passives to empower can really help you progress!")]),d("br",null,null),d("p",null,[w("Specify passives to empower by dragging them to the empowerer. You can only select a single passive to start, but that can be increased using an action.")])])))}function Zd(){const e=Ji({general:()=>({display:"General",glowColor(){return e.activeTab.value===this.tab?"white":""},tab:Fr(()=>({display:j(()=>d("div",null,[d("p",null,[w("You've created the Portal Generator (\u26E9\uFE0F)! This machine lets you create portals to other planes, which will have treasures that help you in various ways! To create a portal you need to specify a tier by dragging a resource to the generator - higher tier planes cost more energy to generate portals for, but offer more and better treasures! Keep in mind time in planes will be paused if the portal is inactive (not selected nor powered).")]),d("br",null,null),d("p",null,[w("You've also gained a trash can for portals (\u{1F5D1}\uFE0F). Dragging a portal here will permanently destroy it. Any treasures that require the portal to be active will no longer work. This can be used to keep your workspace clean from old portals you no longer need or want.")]),d("br",null,null),d("p",null,[w("Once you have portals, the lines on the board might getting particularly necessary. Here's a setting (also accessible in the settings modal) to disable resource gain lines unless the node is active.")]),d("br",null,null),d($t,{title:j(()=>d("span",{class:"option-title"},[w("Always show lines to resource nodes")])),modelValue:ie.lineVisibility,"onUpdate:modelValue":t=>ie.lineVisibility=t},null)]))}))}),treasures:()=>({display:"Treasures",glowColor(){return e.activeTab.value===this.tab?"white":""},tab:Fr(()=>({display:j(()=>d("div",null,[w("Types of potential treasures:"),d("ul",{style:"list-style-type: unset"},[d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("Caches")]),w(": Gain an amount of a resource based on your current amount.")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("Gen")]),w(": Passively gain an amount of a resource while the portal is active (selected or powered).")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("Resource Mult")]),w(": Increase the amount gained of a resource from all sources (except caches) while the portal is active (selected or powered).")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("Energy Mult")]),w(": Increase the energy gained per second while the portal is active (selected or powered).")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("Influences")]),w(": Gain a influence. See the influences tab for details. You can only have 1 of each influence.")]),d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("Relic")]),w(": Gain the relic unique to this tier of plane. These are powerful passive boosts that can be empowered. You can only have 1 of each relic. Relics can only appear with the +relic influence, and will always be the last treasure on a plane.")])])]))}))}),influences:()=>({display:"Influences",glowColor(){return e.activeTab.value===this.tab?"white":""},tab:Fr(()=>({display:j(()=>d("div",null,[d("p",null,[w("Some treasures will grant you influences that can help the portal generator create portals to planes with specified qualities. Each influence will multiply the energy cost of creating the portal.")]),d("br",null,null),Object.keys(v.influenceNodes.value).length>0?d("div",null,[w("Discovered influences:"),d("ul",{style:"list-style-type: unset"},[v.influenceNodes.value.increaseResources==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+resource")]),w(": Can be connected to resources and will cause any treasures that reference resources (caches, gens, and resource mults) to have increased odds of picking a selected resource.")]),v.influenceNodes.value.decreaseResources==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("-resource")]),w(": Can be connected to resources and will cause any treasures that reference resources (caches, gens, and resource mults) to have decreased odds of picking a selected resource.")]),v.influenceNodes.value.increaseLength==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+length")]),w(": Cause the plane to have 1 extra treasure than it otherwise would have.")]),v.influenceNodes.value.increaseCaches==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+caches")]),w(": Causes treasures to have an increased chance to be caches.")]),v.influenceNodes.value.increaseGens==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+gens")]),w(": Causes treasures to have an increased chance to be gens.")]),v.influenceNodes.value.increaseResourceMults==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+resource mults")]),w(": Causes treasures to have an increased chance to be resource mults.")]),v.influenceNodes.value.increaseEnergyMults==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+energy mults")]),w(": Causes treasures to have an increased chance to be energy mults.")]),v.influenceNodes.value.increaseInfluences==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+influences")]),w(": Causes treasures to have an increased chance to be influences.")]),v.influenceNodes.value.relic==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+relic")]),w(": Maximizes length and difficulty for this tier of plane, and makes the last treasure a relic (unique per tier of plane). Overrides any other difficulty-changing influences.")]),v.influenceNodes.value.increaseDiff==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+difficulty")]),w(": Causes the difficulty and rewards to be in the upper half of what's possible at this tier.")]),v.influenceNodes.value.decreaseDiff==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("-difficulty")]),w(": Causes the difficulty and rewards to be in the lower half of what's possible at this tier.")]),v.influenceNodes.value.increaseRewards==null?null:d("li",{style:"margin-top: var(--feature-margin)"},[d("b",{style:"color: var(--bought)"},[w("+rewards")]),w(": Causes the quality of treasures to be 1 tier higher. Does not affect influences or relics treasures.")])])]):d("div",null,[w("Once you discover influences, summaries will appear here describing their effects.")])]))}))})});return Gt("Portal Generator",j(()=>mt(e)),{tabFamily:e})}function Xd(){return Gt("Booster",j(()=>d("div",null,[d("p",null,[w("You've created the Booster (\u231B)! This machine lets you increase the rate of time of planes! This affects its resource gain, gen treasures, and any other effects of time.")]),d("br",null,null),d("p",null,[w("Specify planes to boost by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")]),d("br",null,null),d("p",null,[w("Initially the booster will double the rate of time, but that can be increased using an action.")])])))}function Jd(){return Gt("Upgrader",j(()=>d("div",null,[d("p",null,[w("You've created the Upgrader (\u{1F916})! This machine lets you automatically purchase upgrades within planes (includes prestiges but not repeatables or dimensions)!")]),d("br",null,null),d("p",null,[w("Specify planes to auto-purchase upgrades from by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")])])))}function Kd(){return Gt("Automator",j(()=>d("div",null,[d("p",null,[w("You've created the Automator (\u{1F9BE})! This machine lets you automatically purchase repeatables and dimensions within planes!")]),d("br",null,null),d("p",null,[w("Specify planes to auto-purchase repeatables and dimensions from by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")])])))}function Qd(){return Gt("Investments",j(()=>d("div",null,[d("p",null,[w("You've created the Investments machine (\u{1F4B1})! This machine lets you automatically gain the resources from conversions without spending the plane's primary resource!")]),d("br",null,null),d("p",null,[w("Specify planes to gain converted resources from by dragging their portals to the booster. You can only select a single plane to start, but that can be increased using an action.")])])))}const ep=X({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(S(),T("div",{style:Le({width:e.width,height:e.height})},null,4))}});function Bn(e){return et(t=>{var r;const n=e.call(t,t);return n.partialDisplay=i=>d("span",{style:a(n.requirementMet)?"":"color: var(--danger)"},[vr(n.resource,n.cost instanceof f?sn(n.cost,i!=null?i:1,a(n.cumulativeCost),a(n.directSum)):a(n.cost))," ",n.resource.displayName]),n.display=i=>d("div",null,[a(n.requiresPay)?"Costs: ":"Requires: ",vr(n.resource,n.cost instanceof f?sn(n.cost,i!=null?i:1,a(n.cumulativeCost),a(n.directSum)):a(n.cost))," ",n.resource.displayName]),A(n,"visibility"),oe(n,"visibility",Se.Visible),A(n,"cost"),A(n,"requiresPay"),oe(n,"requiresPay",!0),A(n,"cumulativeCost"),oe(n,"cumulativeCost",!0),A(n,"maxBulkAmount"),oe(n,"maxBulkAmount",1),A(n,"directSum"),oe(n,"pay",function(i){const s=n.cost instanceof f?sn(n.cost,i!=null?i:1,a(n.cumulativeCost),a(n.directSum)):a(n.cost);n.resource.value=o.sub(n.resource.value,s).max(0)}),n.canMaximize=y(()=>{var u;if(!(n.cost instanceof f))return!1;const i=a(n.maxBulkAmount);if(o.lte(i,1))return!1;const s=a(n.cumulativeCost),l=(u=a(n.directSum))!=null?u:s?10:0;return o.lte(i,l)?!0:!(!n.cost.isInvertible()||s===!0&&!n.cost.isIntegrable())}),n.cost instanceof f?n.requirementMet=zi(n.cost,n.resource,(r=n.cumulativeCost)!=null?r:!0,n.directSum,n.maxBulkAmount):n.requirementMet=y(()=>o.gte(n.resource.value,a(n.cost))),n})}function ri(e){return et(()=>({requirementMet:y(()=>Ze(e.visibility)),visibility:Se.None,requiresPay:!1}))}function tp(e,t){return et(()=>({requirementMet:_e(e),partialDisplay:t==null?void 0:j(()=>mt(t)),display:t==null?void 0:j(()=>d(ne,null,[w("Req: "),mt(t)])),visibility:t==null?Se.None:Se.Visible,requiresPay:!1}))}function Cr(e){if(Bt(e))return e.every(Cr);const t=a(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function ra(e){if(Bt(e))return e.map(ra).reduce(o.min);const t=a(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&a(e.canMaximize)!==!0?1:t}function kr(e,t=1){var n,r;if(Bt(e)&&(e=e.filter(i=>Ze(i.visibility)),e.length===1&&(e=e[0])),Bt(e)){e=e.filter(l=>"partialDisplay"in l);const i=e.filter(l=>a(l.requiresPay)),s=e.filter(l=>!a(l.requiresPay));return d(ne,null,[i.length>0?d("div",null,[w("Costs:")," ",mi(i.map(l=>l.partialDisplay(t)),d(ne,null,[w(", ")]))]):null,s.length>0?d("div",null,[w("Requires:")," ",mi(s.map(l=>l.partialDisplay(t)),d(ne,null,[w(", ")]))]):null])}return(r=(n=e.display)==null?void 0:n.call(e))!=null?r:d(ne,null,null)}function ia(e,t=1){var n;Bt(e)?e.filter(r=>a(r.requiresPay)).forEach(r=>{var i;return(i=r.pay)==null?void 0:i.call(r,t)}):a(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var np=X({props:{visibility:{type:q(Number,Boolean),required:!0},display:q(Object,String,Function),earned:{type:q(Boolean),required:!0},requirements:q(Object,Array),image:q(String),style:q(String,Object,Array),classes:q(Object),mark:q(Boolean,String),small:q(Boolean),id:{type:String,required:!0}},components:{Node:tr,MarkNode:er},setup(e){const{display:t,requirements:n,earned:r}=Ae(e),i=_t("");return Pt(()=>{const s=Pe(t);if(s==null){i.value="";return}if(At(s)){i.value=fe(s);return}const l=fe(s.requirement?s.requirement:j(()=>{var p;return kr((p=Pe(n))!=null?p:[])}),"h3"),u=fe(s.effectDisplay||"","b"),c=Pe(r)?fe(s.optionsDisplay||"","span"):"";i.value=fe(j(()=>d("span",null,[d(l,null,null),s.effectDisplay!=null?d("div",null,[d(u,null,null)]):null,s.optionsDisplay!=null?d("div",{class:"equal-spaced"},[d(c,null,null)]):null])))}),{comp:i,unref:a,Visibility:Se,isVisible:Ze,isHidden:_n}}});function rp(e,t,n,r,i,s){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(S(),T("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:Ne({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?(S(),re(Ke(e.comp),{key:0})):B("",!0),d(l,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var ip=be(np,[["render",rp],["__scopeId","data-v-5673325a"]]);const ap=hr(),sp=Symbol("Achievement");let Dn=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function op(e,...t){const n=ct(!1,!1),r=t.reduce((i,s)=>{var l;return Object.assign(i,(l=s.getPersistentData)==null?void 0:l.call(s))},{});return et(i=>{var c,p,h;const s=(c=e==null?void 0:e.call(i,i))!=null?c:{};s.id=Qt("achievement-"),s.type=sp,s[gt]=ip;for(const g of t)(p=g.preConstruct)==null||p.call(g,s);s.earned=n,s.complete=function(){var b,m;if(n.value)return;n.value=!0;const g=s;if((b=g.onComplete)==null||b.call(g),g.display!=null&&a(g.showPopups)===!0){const k=a(g.display);let C;At(k)?C=fe(k):k.requirement!=null?C=fe(k.requirement):C=kr((m=g.requirements)!=null?m:[]),ap.info(d("div",null,[d("h3",null,[w("Treasure earned!")]),d("div",null,[d(C,null,null)])]))}},Object.assign(s,r),A(s,"visibility"),oe(s,"visibility",Se.Visible);const l=s.visibility;s.visibility=ba(()=>{const g=a(s.display);switch(ie.msDisplay){default:case Dn.All:return a(l);case Dn.Configurable:return a(s.earned)&&!(g!=null&&typeof g=="object"&&"optionsDisplay"in g)?Se.None:a(l);case Dn.Incomplete:return a(s.earned)?Se.None:a(l);case Dn.None:return Se.None}}),A(s,"display"),A(s,"mark"),A(s,"small"),A(s,"image"),A(s,"style"),A(s,"classes"),A(s,"showPopups"),oe(s,"showPopups",!0);for(const g of t)(h=g.postConstruct)==null||h.call(g,s);const u=t.reduce((g,b)=>{var m;return Object.assign(g,(m=b.getGatheredProps)==null?void 0:m.call(b,s))},{});if(s[dt]=function(){const{visibility:g,display:b,requirements:m,earned:k,image:C,style:$,classes:x,mark:I,small:R,id:L}=this;return{visibility:g,display:b,requirements:m,earned:k,image:C,style:a($),classes:x,mark:I,small:R,id:L,...u}},s.requirements){const g=s,b=[ri(g),tp(()=>!g.earned.value),...Bt(s.requirements)?s.requirements:[s.requirements]];Pt(()=>{ie.active===Y.id&&Cr(b)&&g.complete()})}return s})}Qe.on("loadSettings",e=>{oe(e,"msDisplay",Dn.All)});const lp=Object.values(Dn).map(e=>({label:st(e),value:e}));Oi(j(()=>d(ti,{title:j(()=>d("span",{class:"option-title"},[w("Show achievements"),d("desc",null,[w("Select which achievements to display based on criterias.")])])),options:lp,"onUpdate:modelValue":e=>ie.msDisplay=e,modelValue:ie.msDisplay},null)));const up=X({props:{progress:{type:q(String,Object,Number),required:!0},width:{type:q(Number),required:!0},height:{type:q(Number),required:!0},direction:{type:q(String),required:!0},display:q(Object,String,Function),visibility:{type:q(Number,Boolean),required:!0},style:q(Object,String,Array),classes:q(Object),borderStyle:q(Object,String,Array),textStyle:q(Object,String,Array),baseStyle:q(Object,String,Array),fillStyle:q(Object,String,Array),mark:q(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:er,Node:tr},setup(e){const{progress:t,width:n,height:r,direction:i,display:s}=Ae(e),l=y(()=>{let p=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(p,0),1))*100}),u=y(()=>{const p={width:Pe(n)+.5+"px",height:Pe(r)+.5+"px"};switch(a(i)){case W.Up:p.clipPath=`inset(${l.value}% 0% 0% 0%)`,p.width=Pe(n)+1+"px";break;case W.Down:p.clipPath=`inset(0% 0% ${l.value}% 0%)`,p.width=Pe(n)+1+"px";break;case W.Right:p.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case W.Left:p.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case W.Default:p.clipPath="inset(0% 50% 0% 0%)";break}return p}),c=Rn(s);return{normalizedProgress:l,barStyle:u,component:c,unref:a,Visibility:Se,isVisible:Ze,isHidden:_n}}});function cp(e,t,n,r,i,s){var c,p,h,g,b,m,k;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(S(),T("div",{key:0,style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:Ne({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(p=e.unref(e.borderStyle))!=null?p:{}])},[e.component?(S(),T("span",{key:0,class:"overlayText",style:Le(e.unref(e.textStyle))},[(S(),re(Ke(e.component)))],4)):B("",!0)],4),N("div",{class:"border",style:Le([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(h=e.unref(e.style))!=null?h:{},(g=e.unref(e.baseStyle))!=null?g:{},(b=e.unref(e.borderStyle))!=null?b:{}])},[N("div",{class:"fill",style:Le([e.barStyle,(m=e.unref(e.style))!=null?m:{},(k=e.unref(e.fillStyle))!=null?k:{}])},null,4)],4),d(l,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],6)):B("",!0)}var dp=be(up,[["render",cp],["__scopeId","data-v-6bd06b56"]]);const pp=Symbol("Bar");function fp(e,...t){const n=t.reduce((r,i)=>{var s;return Object.assign(r,(s=i.getPersistentData)==null?void 0:s.call(i))},{});return et(r=>{var l,u;const i=e.call(r,r);i.id=Qt("bar-"),i.type=pp,i[gt]=dp;for(const c of t)(l=c.preConstruct)==null||l.call(c,i);Object.assign(i,n),A(i,"visibility"),oe(i,"visibility",Se.Visible),A(i,"width"),A(i,"height"),A(i,"direction"),A(i,"style"),A(i,"classes"),A(i,"borderStyle"),A(i,"baseStyle"),A(i,"textStyle"),A(i,"fillStyle"),A(i,"progress"),A(i,"display"),A(i,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,i);const s=t.reduce((c,p)=>{var h;return Object.assign(c,(h=p.getGatheredProps)==null?void 0:h.call(p,i))},{});return i[dt]=function(){const{progress:c,width:p,height:h,direction:g,display:b,visibility:m,style:k,classes:C,borderStyle:$,textStyle:x,baseStyle:I,fillStyle:R,mark:L,id:ce}=this;return{progress:c,width:p,height:h,direction:g,display:b,visibility:m,style:a(k),classes:C,borderStyle:$,textStyle:x,baseStyle:I,fillStyle:R,mark:L,id:ce,...s}},i})}function gp(e,...t){return et(n=>{var i,s;const r=e.call(n,n);for(const l of t)(i=l.preConstruct)==null||i.call(l,r);r.formula=r.formula(f.variable(r.baseResource)),r.currentGain==null&&(r.currentGain=y(()=>{let l=o.floor(r.formula.evaluate(r.baseResource.value)).max(0);return a(r.buyMax)===!1&&(l=l.min(1)),l})),r.actualGain==null&&(r.actualGain=r.currentGain),r.currentAt==null&&(r.currentAt=y(()=>r.formula.invert(o.floor(a(r.currentGain))))),r.nextAt==null&&(r.nextAt=y(()=>r.formula.invert(o.floor(a(r.currentGain)).add(1)))),r.convert==null&&(r.convert=function(){var u;const l=a(r.currentGain);r.gainResource.value=o.add(r.gainResource.value,l),r.spend(l),(u=r.onConvert)==null||u.call(r,l)}),r.spend==null&&(r.spend=function(){r.baseResource.value=0}),A(r,"currentGain"),A(r,"actualGain"),A(r,"currentAt"),A(r,"nextAt"),A(r,"buyMax"),oe(r,"buyMax",!0);for(const l of t)(s=l.postConstruct)==null||s.call(l,r);return r})}function mp(e){return gp(e)}function vp(e,t,n=1,r=o.dInf){const i=_e(n),s=_e(r);e.on("preUpdate",l=>{const u=a(i);o.neq(u,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(u,l).times(o.ceil(a(t.actualGain)))).min(a(s)).max(t.gainResource.value))})}const hp={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),A(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=y(()=>{var t;return o.add(a((t=e.amount)!=null?t:0),a(e.bonusAmount))}))}},aa=Symbol("Repeatable");function wi(e,...t){const n=ct(0),r=t.reduce((i,s)=>{var l;return Object.assign(i,(l=s.getPersistentData)==null?void 0:l.call(s))},{});return et(i=>{var b,m,k;const s=e.call(i,i);s.id=Qt("repeatable-"),s.type=aa,s[gt]=ta;for(const C of t)(b=C.preConstruct)==null||b.call(C,s);s.amount=n,s.amount[Kt]=(m=s.initialAmount)!=null?m:0,Object.assign(s,r);const l={requirementMet:y(()=>o.sub(a(s.limit),s.amount.value)),requiresPay:!1,visibility:Se.None,canMaximize:!0},u=ri(s);Bt(s.requirements)?(s.requirements.unshift(u),s.requirements.push(l)):s.requirements=[u,s.requirements,l],s.maxed=y(()=>o.gte(s.amount.value,a(s.limit))),A(s,"classes");const c=s.classes;s.classes=y(()=>{const C=a(c)||{};return s.maxed.value&&(C.bought=!0),C}),s.amountToIncrease=y(()=>o.clampMin(ra(s.requirements),1)),s.canClick=y(()=>Cr(s.requirements));const p=s.onClick;s.onClick=function(C){var I;const $=s;if(!a($.canClick))return;const x=(I=a(s.amountToIncrease))!=null?I:1;ia(s.requirements,x),$.amount.value=o.add($.amount.value,x),p==null||p(C)},A(s,"display");const h=s.display;s.display=j(()=>{var $,x,I;const C=a(h);if(At(C)){const R=fe(C);return d(R,null,null)}if(C!=null){const R=s,L=fe(($=C.title)!=null?$:"","h3"),ce=fe((x=C.description)!=null?x:""),le=fe((I=C.effectDisplay)!=null?I:"");return d("span",null,[C.title==null?null:d("div",null,[d(L,null,null)]),C.description==null?null:d(ce,null,null),C.showAmount===!1?null:d("div",null,[d("br",null,null),d(ne,null,[w("Amount: "),ut(R.amount.value)]),o.isFinite(a(R.limit))?d(ne,null,[w(" / "),ut(a(R.limit))]):void 0]),C.effectDisplay==null?null:d("div",null,[d("br",null,null),w("Currently: "),d(le,null,null)]),R.maxed.value?null:d("div",null,[d("br",null,null),kr(R.requirements,a(s.amountToIncrease))])])}return""}),A(s,"visibility"),oe(s,"visibility",Se.Visible),A(s,"limit"),oe(s,"limit",o.dInf),A(s,"style"),A(s,"mark"),A(s,"small");for(const C of t)(k=C.postConstruct)==null||k.call(C,s);const g=t.reduce((C,$)=>{var x;return Object.assign(C,(x=$.getGatheredProps)==null?void 0:x.call($,s))},{});return s[dt]=function(){const{display:C,visibility:$,style:x,classes:I,onClick:R,canClick:L,small:ce,mark:le,id:ae}=this;return{display:C,visibility:$,style:a(x),classes:I,onClick:R,canClick:L,small:ce,mark:le,id:ae,...g}},s})}const bp=Symbol("Reset");function yp(e){return et(t=>{const n=e.call(t,t);return n.id=Qt("reset-"),n.type=bp,n.reset=function(){var i;const r=s=>{if(s!=null&&typeof s=="object"&&!(s instanceof o)&&!(s instanceof f)){if(Kn in s&&s[Kn]===!0)return;if(Kt in s){const l=s;l.value=l[Kt]}else!(s instanceof o)&&!Ve(s)&&Object.values(s).forEach(l=>r(l))}};a(n.thingsToReset).forEach(r),Qe.emit("reset",n),(i=n.onReset)==null||i.call(n)},A(n,"thingsToReset"),n})}const lr={};Qe.on("removeLayer",e=>{var t;(t=lr[e.id])==null||t.call(lr),lr[e.id]=void 0});function Or(e,t){return A(t,"display"),A(t,"classes"),A(t,"style"),A(t,"direction"),oe(t,"direction",W.Up),A(t,"xoffset"),A(t,"yoffset"),t.pinnable&&(t.pinned=ct(!1,!1)),Xt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,Gi(t.pinned)):e.pinned=t.pinned);const n=e[gt];e[gt]=qe;const r=e[dt].bind(e);e[dt]=function(){const{display:s,classes:l,style:u,direction:c,xoffset:p,yoffset:h,pinned:g}=this;return{element:{[gt]:n,[dt]:r},display:s,classes:l,style:a(u),direction:c,xoffset:p,yoffset:h,pinned:g}}.bind(t)}),t}var wp=X({props:{display:{type:q(String,Object,Function),required:!0},visibility:{type:q(Number,Boolean),required:!0},style:q(String,Object,Array),classes:q(Object),requirements:{type:Object,required:!0},canPurchase:{type:q(Boolean),required:!0},bought:{type:q(Boolean),required:!0},mark:q(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:tr,MarkNode:er},setup(e){const{display:t,requirements:n,bought:r}=Ae(e),i=_t("");return Pt(()=>{const s=Pe(t);if(s==null){i.value="";return}if(At(s)){i.value=fe(s);return}const l=fe(s.title||"","h3"),u=fe(s.description,"div"),c=fe(s.effectDisplay||"");i.value=fe(j(()=>d("span",null,[s.title!=null?d("div",null,[d(l,null,null)]):null,d(u,null,null),s.effectDisplay!=null?d("div",null,[w("Currently: "),d(c,null,null)]):null,r.value?null:d(ne,null,[d("br",null,null),kr(n.value)])])))}),{component:i,unref:a,Visibility:Se,isVisible:Ze,isHidden:_n}}});const _p=["disabled"];function Np(e,t,n,r,i,s){var c;const l=Ct("MarkNode"),u=Ct("Node");return e.isVisible(e.visibility)?(S(),T("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]=(...p)=>e.purchase&&e.purchase(...p)),class:Ne({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)?(S(),re(Ke(e.unref(e.component)),{key:0})):B("",!0),d(l,{mark:e.unref(e.mark)},null,8,["mark"]),d(u,{id:e.id},null,8,["id"])],14,_p)):B("",!0)}var Cp=be(wp,[["render",Np],["__scopeId","data-v-9be6bac0"]]);const ii=Symbol("Upgrade");function _i(e,...t){const n=ct(!1,!1),r=t.reduce((i,s)=>{var l;return Object.assign(i,(l=s.getPersistentData)==null?void 0:l.call(s))},{});return et(i=>{var c,p;const s=e.call(i,i);s.id=Qt("upgrade-"),s.type=ii,s[gt]=Cp;for(const h of t)(c=h.preConstruct)==null||c.call(h,s);s.bought=n,Object.assign(s,r),s.canPurchase=y(()=>!n.value&&Cr(s.requirements)),s.purchase=function(){var g;const h=s;!a(h.canPurchase)||(ia(s.requirements),n.value=!0,(g=h.onPurchase)==null||g.call(h))};const l=ri(s);Bt(s.requirements)?s.requirements.unshift(l):s.requirements=[l,s.requirements],A(s,"visibility"),oe(s,"visibility",Se.Visible),A(s,"classes"),A(s,"style"),A(s,"display"),A(s,"mark");for(const h of t)(p=h.postConstruct)==null||p.call(h,s);const u=t.reduce((h,g)=>{var b;return Object.assign(h,(b=g.getGatheredProps)==null?void 0:b.call(g,s))},{});return s[dt]=function(){const{display:h,visibility:g,style:b,classes:m,requirements:k,canPurchase:C,bought:$,mark:x,id:I,purchase:R}=this;return{display:h,visibility:g,style:a(b),classes:m,requirements:k,canPurchase:C,bought:$,mark:x,id:I,purchase:R,...u}},s})}function kp(e,t,n=[]){n=n.length===0?Xn(e,ii):n;const r=Yn(t)?y(t):t;e.on("update",()=>{a(r)&&n.forEach(i=>i.purchase())})}function Sp(e,t,n,r){return function(){e>>>=0,t>>>=0,n>>>=0,r>>>=0;let i=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,r=r+1|0,i=i+r|0,n=n+i|0,(i>>>0)/4294967296}}const Mp={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"]},Ni=[[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 qr(e){const t=Ni[Math.floor(e()*Ni.length)];let n="";for(let r=0;rn-20&&(s+=40);const[l,u,c]=$p(s,r,i);return`rgb(${l*255}, ${u*255}, ${c*255})`}function xp(e,t,n){const r=Math.max(e,t,n),i=r-Math.min(e,t,n),s=i&&(r==e?(t-n)/i:r==t?2+(n-e)/i:4+(e-t)/i);return[60*(s<0?s+6:s),r&&i/r,r]}function $p(e,t,n){const r=(i,s=(i+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}const ki=hr();function sa(e,t,n,r){return Kr(e,function(){const i=Sp(0,n>>0,n>>32,1);for(let V=0;V<12;V++)i();const s=qr(i),l=Ln([.56,.74,.73],i),u=Ln([.18,.2,.25],i),c=$n(0,qr(i)),p=ct(0),h=Et.indexOf(t);let g=i();const b=r.reduce((V,z)=>(V[z.type]=z.data,V),{});"increaseDiff"in b&&(g=g/2+.5),"decreaseDiff"in b&&(g=g/2),"relic"in b&&(g=1);const m=g+h+1,k=v.toolNodes.value.sandRelic!=null?te("sandRelic")?2:1:0,C=ct(k),$=y(()=>("increaseRewards"in b?m+1:m)+C.value);let x="relic"in b?h+2:Math.ceil(i()*(h+2));"increaseLength"in b&&x++;const I=[],R=Mt(()=>I),L=y(()=>R.apply(0)),ce=[],le={};function ae({feature:V,canClick:z,modifier:De,cost:rt,previewModifier:Sn,showETA:We,previewCost:Rt}){z=_e(z),We=_e(We);const Ut=vi(V);ce.push({shouldShowPreview:y(()=>a(z)&&Ut.value),modifier:Mt(()=>{const Wt=I.slice();return Wt.splice(Wt.indexOf(De),1,Sn),Wt}),cost:Rt!=null?Rt:rt}),I.push(De);const xt=Er(c,L,()=>Me(rt)),it=Or(V,{display:We==null?xt:()=>a(We)?xt.value:"",direction:W.Down});return{isHovering:Ut,eta:xt,tooltip:it}}const J=[],Ie=G(0);let he=f.variable(Ie).times(0),Ue=0,vt=!0;const K=y(()=>o.add(m,i()-.5).pow_base(2).times(10).times(he.evaluate()));for(let V=0;V=x-1?0:4};switch(ur(z,i)){case"upgrades":const P=[];for(let E=0;E<4;E++){const Z=ur({add:1,mult:V===0&&E===0?0:1},i),Te=K.value,Xe=xn(i);let je="",Oe,me;switch(Z){case"add":{const de=o.add(Te,10).pow(i()/4+1);je=`Gain ${xe(de)} ${c.displayName}/s`,he=he.add(de),Oe=at=>Ht(()=>({addend:de,description:Xe,enabled:at==null?we.bought:()=>at()&&we.bought.value})),me=Ht(()=>({addend:de}));break}case"mult":{const de=i()*5+1;je=`Multiply previous ${c.displayName} gain by x${xe(de)}.`;const at=Ue;he=he.add(o.sub(de,1).times(at)),Oe=Je=>Ce(()=>({multiplier:de,description:Xe,enabled:Je==null?we.bought:()=>Je()&&we.bought.value})),me=Ce(()=>({multiplier:de}));break}}Ue=he.evaluate(),Ie.value++;const Ee=vt,we=_i(()=>({requirements:Bn(()=>({resource:In(c),cost:Te,requiresPay:()=>v.toolNodes.value.unobtainiumRelic==null})),display:{title:Xe,description:je},visibility:y(()=>ye.value.length!==x&&a(Ee))}));ae({feature:we,canClick:()=>we.canPurchase.value,modifier:Oe(),cost:Te,previewCost:y(()=>v.toolNodes.value.unobtainiumRelic==null?Te:0),showETA:()=>!we.bought.value,previewModifier:me}),I.push(Oe(()=>Z==="add"?v.toolNodes.value.stoneRelic!=null:te("stoneRelic"))),P.push(we)}J.push(P);break;case"repeatables":const O=[];for(let E=0;E<3;E++){const Z=ur({add:1.5,mult:3},i),Te=Ie.value,Xe=K.value,je=xn(i);let Oe="",me,Ee,we,de;const at=f.variable(y(()=>ue.amount.value)).times(2);switch(Z){case"add":{const He=o.add(Xe,10).times(i()+.5);Oe=`Gain ${xe(He)} ${c.displayName}/s`,de=at.add(1).times(Xe),he=he.add(y(()=>o.sub(Ie.value,Te).times(2).add(1).pow(2).clampMax(100).times(He))),me=y(()=>xe(o.times(He,a(ue.totalAmount)))+"/s"),Ee=Ht(()=>({addend:()=>o.times(He,a(ue.totalAmount)),description:je,enabled:()=>o.gt(a(ue.totalAmount),0)})),we=Ht(()=>({addend:()=>o.add(a(ue.totalAmount),ue.amountToIncrease.value).times(He)}));break}case"mult":{const He=i()*.75+1.25;Oe=`Multiply previous ${c.displayName} gain by x${xe(He)}.`,de=at.add(1).pow_base(He).times(Xe);const lt=Ue;he=he.add(y(()=>o.sub(Ie.value,Te).times(2).add(1).pow(2).clampMax(100).pow_base(He).sub(1).times(lt))),me=y(()=>"x"+xe(o.pow(He,a(ue.totalAmount)))),Ee=Ce(()=>({multiplier:()=>o.pow(He,a(ue.totalAmount)),description:je,enabled:()=>o.gt(a(ue.totalAmount),0)})),we=Ce(()=>({multiplier:()=>o.add(a(ue.totalAmount),ue.amountToIncrease.value).pow_base(He)}));break}}Ue=he.evaluate(),Ie.value++;const Je=vt,ue=wi(()=>({requirements:Bn(()=>({resource:In(c),cost:de,maxBulkAmount:()=>v.toolNodes.value.diamondRelic!=null?o.dInf:1,requiresPay:()=>v.toolNodes.value.unobtainiumRelic==null})),display:()=>({title:je,description:`${Oe}

Amount: ${ut(ue.amount.value)}${o.gt(a(ue.bonusAmount),0)?` [+${ut(a(ue.bonusAmount))}]`:""}`,effectDisplay:a(me),showAmount:!1}),visibility:y(()=>ye.value.length!==x&&a(Je)),limit:100,bonusAmount:()=>o.gt(ue.amount.value,0)?te("dirtRelic")?2:v.toolNodes.value.dirtRelic!=null?1:0:0}),hp);ae({feature:ue,canClick:()=>a(ue.canClick),modifier:Ee,cost:de,previewModifier:we,previewCost:y(()=>v.toolNodes.value.unobtainiumRelic==null?sn(de,ue.amountToIncrease.value):0),showETA:()=>!ue.maxed.value}),O.push(ue)}J.push(O);break;case"conversion":{const E=$n(0,qr(i)),U=Ln([.56,.74,.73],i),Z=K.value,Te=i()/2+.25,Xe=i()/2+.25,je=Ie.value,Oe=Ue;he=he.add(y(()=>o.sub(Ie.value,je).add(1).pow10().times(Oe)));const me=mp(()=>({baseResource:In(c),gainResource:E,formula:Tr=>Tr.div(Z).pow(Te).times(y(()=>v.toolNodes.value.ironRelic!=null?te("ironRelic")?4:2:1)),spend(){c.value=0}}));Ue=he.evaluate(),Ie.value+=2;const Ee=vt,we=xn(i),de=f.variable(E).pow(Xe).add(1),at=Ce(()=>({multiplier:()=>de.evaluate(),description:we,enabled:()=>o.gt(E.value,0)})),Je=Ce(()=>({multiplier:()=>de.evaluate(o.add(E.value,me.actualGain.value))})),ue=yi(()=>({display:{title:we,description:j(()=>d("span",null,[w("Reset "),c.displayName,w(" for")," ",vr(E,o.clampMin(me.actualGain.value,1))," ",E.displayName,d("br",null,null),d("div",null,[w("Next:")," ",vr(c,o.lt(me.actualGain.value,1)?me.currentAt.value:me.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(me.actualGain.value,1),prestigeResource:E,onClick:me.convert,visibility:y(()=>ye.value.length!==x&&a(Ee))})),{isHovering:He}=ae({feature:ue,canClick:()=>a(ue.canClick),modifier:at,cost:Z,previewCost:c,previewModifier:Je}),lt=y(()=>He.value&&ue.canClick.value);J.push([ue]);const Vn=hn(f.variable(E),lt,me.actualGain),tt=hn(de,lt,me.actualGain);le[V*2]=j(()=>d(ne,null,[Ze(ue.visibility)?d("div",{style:"margin: 10px"},[w("You have")," ",d("h2",{style:{color:U,textShadow:`0px 0px 10px ${U}`}},[Vn()])," ",E.displayName,w(","),d("br",null,null),w("providing a "),tt(),w("x multiplier to previous")," ",c.displayName,w(" gain")]):null,Rr(ue)])),vp(this,me,()=>ye.value.lengthsn(me,Ee.value,!0,10)),de=y(()=>sn(me,o.add(Ee.value,1),!0,10)),at=y(()=>o.pow(Oe,Ee.value)),Je=Ce(()=>({multiplier:at,description:Te,enabled:()=>Ze(lt.visibility)})),ue=Ue;he=he.add(y(()=>o.sub(Ie.value,Z).add(1).times(3).pow(Oe).times(ue))),Ue=he.evaluate(),Ie.value+=2;const He=Ln([.56,.74,.73],i),lt=fp(()=>({direction:W.Right,width:300,height:20,progress:()=>o.sub(E.value,we.value).div(o.sub(de.value,we.value)).toNumber(),visibility:y(()=>ye.value.length!==x&&a(U)),xp:E,display:j(()=>d("span",null,[xe(E.value),w("/"),xe(de.value)])),fillStyle:`background-color: ${He}`,textStyle:"text-shadow: 5px 0 10px black"}));this.on("preUpdate",Vn=>{if(ye.value.lengthtt.state.id===e)&&Ze(lt.visibility)){let tt=o.times(pt.value,Vn);v.toolNodes.value.goldRelic!=null&&(tt=o.times(te("goldRelic")?.5:.25,ye.value.length).add(1).times(tt)),E.value=o.add(tt,E.value)}}),I.push(Je),J.push([lt]),le[V*2]=j(()=>d(ne,null,[Ze(lt.visibility)?d("div",{style:"margin: 10px"},[w("You have "),d("h3",null,[Te]),w(" Lv. "),ut(Ee.value),w(","),d("br",null,null),w("providing a "),xe(at.value),w("x multiplier to previous")," ",c.displayName,w(" gain"),d("br",null,null)]):null,Rr(lt)]));break}case"dimensions":{const E=xn(i),U=$n(0,E+" energy"),Z=Ln([.56,.74,.73],i),Te=Ie.value,Xe=Ue;he=he.add(y(()=>o.sub(Ie.value,Te).add(1).pow_base(32).add(1).log2().add(1).times(Xe)));const je=y(()=>o.add(U.value,1).log2().add(1)),Oe=Ce(()=>({multiplier:je,description:E,enabled:()=>o.gt(U.value,0)}));I.push(Oe);const me=vt,Ee=[];for(let we=0;we<4;we++){const de=o.add(m,i()-.5).pow_base(2).times(10).recip(),at=K.value,Je=f.variable(y(()=>tt.amount.value)),ue=Je.pow_base(o.pow10(we+1)).times(at),He=["First","Second","Third","Fourth"][we]+" "+E+" Dimension",lt=$n(0,He),Vn=Je.sub(1).pow_base(2).times(de).times(y(()=>o.add(tt.amount.value,lt.value))),tt=wi(()=>({display:{title:He,description:j(()=>d("div",null,[d("div",null,[w("Amount:")," ",xe(o.add(lt.value,tt.amount.value))," ",w("["),ut(tt.amount.value),w("]")])])),effectDisplay:j(()=>d("span",null,[la()," ",we===0?U.displayName:["First","Second","Third","Fourth"][we-1]+" "+E+" Dimension",w("/s")])),showAmount:!1},style:{width:"400px"},effect:Vn,dimensions:lt,limit:100,energy:we===0?U:void 0,requirements:Bn(()=>({resource:In(c),cost:ue,maxBulkAmount:()=>te("diamondRelic")!=null?o.dInf:1,requiresPay:()=>!te("unobtainiumRelic")})),visibility:y(()=>ye.value.length!==x&&a(me))}));Ee.push(tt);const Tr=vi(tt),oi=y(()=>a(tt.canClick)&&Tr.value),oa=new f({inputs:[Je],evaluate(li){return o.sub(li,1).pow_base(2).times(de).times(o.add(li,lt.value))}}),la=hn(oa,oi);ce.push({shouldShowPreview:oi,cost:y(()=>te("unobtainiumRelic")?0:sn(ue,tt.amountToIncrease.value))});const ua=Er(c,L,()=>Me(ue));Or(tt,{display:ua,direction:W.Down}),Ue=he.evaluate(),Ie.value++}this.on("preUpdate",we=>{if(ye.value.lengthde.state.id===e)&&Ze(me)){let de=o.times(pt.value,we);v.toolNodes.value.platinumRelic!=null&&(de=o.times(te("platinumRelic")?4:2,de));const at=Ee[0].effect.evaluate();U.value=o.times(at,de).add(U.value);for(let Je=1;Je<4;Je++){const ue=Ee[Je].effect.evaluate();Ee[Je-1].dimensions.value=o.times(ue,de).add(Ee[Je-1].dimensions.value)}}}),J.push(Ee),le[V*2]=j(()=>d(ne,null,[Ze(ye.value.length!==x&&a(me))?d("div",{style:"margin: 10px"},[w("You have")," ",d("h2",{style:{color:Z,textShadow:`0px 0px 10px ${Z}`}},[xe(U.value)])," ",U.displayName,w(","),d("br",null,null),w("providing a "),xe(je.value),w("x multiplier to previous")," ",c.displayName,w(" gain")]):null,Ks(...Ee)]));break}case"prestige":{const E=xn(i),U=vt,Z=i()/10+1.1,Te=K.value;he=he.pow(Z);const Xe=kd(()=>({exponent:Z,description:E,enabled:me.bought}));Ue=he.evaluate(),Ie.value+=20;const je=J.filter((we,de)=>de%2===0),Oe=yp(()=>({thingsToReset:je,onReset(){c.value=0}})),me=_i(()=>({display:{title:E,description:`Reset all previous ${s} content to raise all previous ${c.displayName} gain to the ^${xe(Z)}`},style:{width:"200px",minHeight:"100px"},onPurchase:()=>{te("unobtainiumRelic")||Oe.reset()},visibility:y(()=>ye.value.length!==x&&a(U)),requirements:Bn(()=>({resource:In(c),cost:Te,requiresPay:!1}))})),Ee=Ce(()=>({multiplier:0}));ae({feature:me,canClick:()=>a(me.canPurchase),modifier:Xe,cost:Te,previewCost:y(()=>te("unobtainiumRelic")?0:c.value),previewModifier:Ee,showETA:()=>!a(me.bought)}),J.push([me]);break}}const rt={cache:"increaseCaches"in b?8:.8,generation:"increaseGens"in b?10:1,resourceMulti:"increaseResourceMults"in b?10:1,energyMulti:"increaseEnergyMults"in b?2.5:.25,influences:"increaseInfluences"in b?20:2,relic:0};let Sn=ur(rt,i);V===x-1&&"relic"in b&&(Sn="relic");let We="",Rt,Ut,xt,it,Wt,nn;switch(Sn){case"cache":it=Vr(i,r),We=`Cache: Gain ${xe(o.div($.value,12))}x your current ${it} (no modifiers).`,Ut=()=>{var E,U,Z;return v.grantResource(it,o.times((Z=(U=(E=v.resourceNodes.value[it])==null?void 0:E.state)==null?void 0:U.amount)!=null?Z:0,o.div($.value,12)))};break;case"generation":it=Vr(i,r);const P=o.pow($.value,2).div(40).times(Tt[it]);We=`Gen: Gain ${xe(P)} ${it}/s while plane is active.`,Rt=E=>v.grantResource(it,o.times(E,P)),xt=it;break;case"resourceMulti":Wt=it=Vr(i,r),nn=o.pow($.value,2).div(10).pow_base(1.5),We=`Resource Mult: Gain ${xe(nn)}x ${it} while plane is active.`;break;case"energyMulti":Wt="energy",nn=o.div($.value,8).add(1),We=`Energy Mult: Gain ${xe(nn)}x energy while plane is active.`;break;case"influences":const O=Object.keys(yt)[Math.floor(i()*Object.keys(yt).length)];We=`Influence: Gain a portal influence (${yt[O].display})`,Ut=()=>{if(O in v.influenceNodes.value){ki.warning(`You already have a ${yt[O].display} influence, skipping treasure`);return}const E={id:An(v.board),position:{...v.board.types.portal.nodes.value.find(U=>U.state.id===e).position},type:"influence",state:{type:O,data:yt[O].initialData}};v.board.placeInAvailableSpace(E),v.board.nodes.value.push(E)};break;case"relic":We=t==="ultimatum"?"Win the game!":`Relic: Gain the ${t}-tier planar relic (${Ft[t]})`,Ut=()=>{if(t==="ultimatum"){ai.value=!0;return}if(`${t}Relic`in v.toolNodes.value)ki.warning(`You already have a ${Ft[t]} relic, skipping treasure`);else{const E={id:An(v.board),position:{...v.board.types.portal.nodes.value.find(U=>U.state.id===e).position},type:"passive",state:`${t}Relic`};v.board.placeInAvailableSpace(E),v.board.nodes.value.push(E)}}}const Dr=vt,Mn=K.value,fn=op(()=>({requirements:Bn(()=>({resource:In(c),cost:Mn})),visibility:y(()=>a(Dr)),display:{requirement:`${xe(Mn)} ${c.displayName}`,effectDisplay:We},style:"width: 100%",classes:{final:V===x-1},update:Rt,onComplete:Ut,link:xt,effectedResource:Wt,resourceMulti:nn})),D=Er(c,L,Mn);Or(fn,{display:()=>fn.earned.value?"":D.value,direction:W.Down}),J.push([fn]),vt=fn.earned,le[V*2+1]=j(()=>mt(fn))}const $e=Xn(J,ii),nt=Xn(J,aa);I.push(Ce(()=>({multiplier:()=>te("silver")?4:2,description:()=>(te("silver")?"Empowered ":"")+ze.silver.name,enabled:()=>v.toolNodes.value.silver!=null})),Ce(()=>({multiplier:()=>o.add(1,(te("diamond")?2:1)*$e.filter(V=>V.bought.value).length/10),description:()=>(te("diamond")?"Empowered ":"")+ze.diamond.name,enabled:()=>v.toolNodes.value.diamond!=null})),Ce(()=>({multiplier:()=>o.div(p.value,6e3).times(te("emerald")?2:1).add(1),description:()=>(te("emerald")?"Empowered ":"")+ze.emerald.name,enabled:()=>v.toolNodes.value.emerald!=null})),Ce(()=>({multiplier:()=>o.div(nt.reduce((V,z)=>V.add(a(z.totalAmount)),o.dZero),100).times(te("gravelRelic")?2:1).add(1).pow(.75),description:()=>(te("gravelRelic")?"Empowered ":"")+Ft.gravel,enabled:()=>v.toolNodes.value.gravelRelic!=null})),Ce(()=>({multiplier:()=>o.add(v.energy.value,1).log10().add(1).pow(te("beryliumRelic")?.5:.25),description:()=>(te("beryliumRelic")?"Empowered ":"")+Ft.berylium,enabled:()=>v.toolNodes.value.beryliumRelic!=null})));const ht=Mt(()=>[Ce(()=>({multiplier:()=>{var V,z,De;return o.add((De=(z=(V=v.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:z.level)!=null?De:0,1)},description:"Booster",enabled:()=>{var V,z,De;return(De=(z=(V=v.board.types.booster.nodes.value[0])==null?void 0:V.state)==null?void 0:z.portals.includes(e))!=null?De:!1}})),Ce(()=>({multiplier:()=>o.times(te("coalRelic")?.2:.1,ye.value.length).add(1),description:()=>(te("coalRelic")?"Empowered ":"")+Ft.coal,enabled:()=>v.toolNodes.value.coalRelic!=null}))]),pt=y(()=>ht.apply(1)),[St,Mr]=Un(()=>[{title:`${st(c.displayName)} Gain`,modifier:R,base:0,unit:"/s"},{title:`${st(c.displayName)} Time Speed`,modifier:ht,base:1,visible:()=>o.gt(pt.value,1)}]),kn=G(!1),rr=j(()=>d(Lt,{modelValue:kn.value,"onUpdate:modelValue":V=>kn.value=V},{header:()=>d("h2",null,[w("Modifiers")]),body:()=>ot(St)}));this.on("preUpdate",V=>{if(!v.activePortals.value.some(De=>De.state.id===e))return;const z=o.times(pt.value,V);p.value=o.add(p.value,z),ye.value.length{var rt;(rt=De.update)==null||rt.call(De,z)})}),kp(this,()=>ye.value.lengthye.value.length{const V=ce.find(z=>z.shouldShowPreview.value);return V?o.neg(Me(V.cost)):0}),On=y(()=>{const V=ce.find(z=>z.shouldShowPreview.value);return V&&V.modifier?o.sub(V.modifier.apply(0),L.value):0}),tn=hn(f.variable(0).add(c),()=>o.neq(Fn.value,0),Fn),qn=hn(f.variable(0).add(L),()=>o.neq(On.value,0),On),ir=y(()=>{const V=[];return ye.value.forEach(z=>{z.link&&V.push(z.link)}),V}),ar=y(()=>{const V={};return ye.value.forEach(z=>{z.effectedResource!=null&&z.resourceMulti!=null&&(V[z.effectedResource]!=null?V[z.effectedResource]=o.times(V[z.effectedResource],z.resourceMulti):V[z.effectedResource]=z.resourceMulti)}),V}),ye=y(()=>{const V=[];for(let z=1;zo.lt(ye.value.length,x)&&J.some(V=>V.some(z=>"earned"in z&&a(z.earned)||"bought"in z&&a(z.bought)?!1:("canClick"in z&&a(z.canClick)||"canPurchase"in z&&a(z.canPurchase),!0)))),xr=y(()=>{const V=J.findIndex((De,rt)=>rt>0&&rt%2===0&&!J[rt-1][0].earned.value);let z;return V===-1?z=J:z=J.slice(0,V),z.map((De,rt)=>rt in le?ot(le[rt]):Rr(...De))}),$r=yi(()=>({display:{description:"Select Portal Node"},onClick(){v.board.selectedNode.value=v.portalNodes.value[e]},style:"min-height: 30px; width: 200px; margin-bottom: 20px"}));return{tier:ct(t),seed:ct(n),influences:ct(r),name:s,color:l,resource:c,background:u,style:{background:u,"--background":u},classes:{plane:!0},features:J,resourceTabCollapsed:Mr,links:ir,resourceMultis:ar,earnedTreasures:ye,showNotif:Ir,timeActive:p,bonusRewardsLevel:C,display:j(()=>d(ne,null,[d(mr,{class:"nav-container",style:"z-index: 5"},{default:()=>[d("span",{class:"nav-segment"},[d("h2",null,[s])]),d("span",{class:"nav-segment"},[d("h3",null,[t,w("-tier")])]),r.length===0?null:d("span",{class:"nav-segment"},[d(qe,{display:r.map(V=>{const z=yt[V.type].description;return typeof z=="function"?z(V):z}).join("
"),direction:W.Down,style:"width: 300px"},{default:()=>[d("h3",null,[r.length,w(" influence"),r.length===1?"":"s"])]})]),d("span",{class:"nav-segment"},[d("button",{class:"button",style:"display: inline",onClick:()=>kn.value=!0},[w("modifiers")])])]}),ye.value.length===x?null:d(mr,{class:"nav-container"},{default:()=>[d("span",{class:"nav-segment"},[d("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[ot(tn)])," ",c.displayName]),d("span",{class:"nav-segment"},[w("("),d("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(L.value,0)?"+":"",ot(qn)]),w("/s)")]),o.neq(pt.value,1)?d("span",{class:"nav-segment"},[w("Speed: "),xe(pt.value),w("x")]):null]}),d(ep,{height:ye.value.length===x?"30px":"60px"},null),ot($r),ye.value.length===x?d("div",null,[d("h1",{style:"color: var(--layer-color)"},[w("Plane Complete!")])]):null,xr.value,ye.value.length+1d("div",null,[d("span",null,[s]),d("span",{style:"font-size: large; vertical-align: sub;"},[" ",t,w("-tier |")," ",ye.value.length===x?d("span",null,[w("Plane Complete")]):d("span",null,[ye.value.length,w("/"),x,w(" treasures")])])]))}})}function Vr(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(Tt).reduce((u,c)=>{let p=Tt[c];return t.filter(h=>h.data===c).forEach(h=>{h.type==="increaseResources"?p*=1e3:p/=1e3}),u+p},0),r=Object.keys(Tt),i=Math.floor(e()*n);let s=0,l;for(let u=0;uu+c),r=Object.keys(e);let i=0,s=null;const l=t()*n;for(let u=0;ue===v.board.selectedNode.value?{text:"Mining"}:Object.keys(v.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[jt,zt("mine")],progress:e=>ke(e)?new o(e.state.progress).toNumber():0,progressDisplay:un.Outline,progressColor:"var(--accent2)",classes:e=>({running:ke(e)}),draggable:!0},Tp={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===v.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(v.energy.value,100)&&(e.type="factory",v.energy.value=o.sub(v.energy.value,100),v.helpModals.factory.showModal.value=!0)},confirmationLabel:()=>o.gte(v.energy.value,100)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},Pp={shape:Ge.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===v.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${ze[e.state].name}`};if(((t=v.board.draggingNode.value)==null?void 0:t.type)==="resource"){const r=((n=v.board.draggingNode.value)==null?void 0:n.state).type,i=e.state===r?"Disconnect":v.toolNodes.value[r]==null?ze[r].name:"Already crafted",s=e.state===r||v.toolNodes.value[r]==null?"var(--accent2)":"var(--danger)";return{text:i,color:s}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,v.board.selectedAction.value=null,v.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${ze[e.state].name} - ${Ye(ze[e.state].cost)} energy`}),onClick(e){const t=ze[e.state];if(o.gte(v.energy.value,t.cost)&&v.toolNodes.value[e.state]==null){v.energy.value=o.sub(v.energy.value,t.cost);const n={id:An(v.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};if(v.board.placeInAvailableSpace(n),v.board.nodes.value.push(n),e.state==="iron"){const r={id:An(v.board),position:{...e.position},type:"trashCan"};v.board.placeInAvailableSpace(r),v.board.nodes.value.push(r)}v.board.selectedAction.value=null,v.board.selectedNode.value=null,e.state=void 0,t.type in v.helpModals&&(v.helpModals[t.type].showModal.value=!0)}},fillColor:e=>o.gte(v.energy.value,ze[e.state].cost)&&v.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(v.energy.value,ze[e.state].cost)?v.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}},zt("factory")],progress:e=>e.state==null||v.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(v.energy.value),o.sqrt(ze[e.state].cost)).clampMax(1).toNumber(),progressDisplay:un.Fill,progressColor:e=>e.state!=null&&o.gte(v.energy.value,ze[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){var r;if(t.type!=="resource")return!1;const n=((r=v.board.draggingNode.value)==null?void 0:r.state).type;return v.toolNodes.value[n]==null},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,v.board.selectedNode.value=e},draggable:!0},Ap=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],Rp={shape:Ge.Circle,size:50,title:e=>st(e.state.type),subtitle:e=>Ye(e.state.amount),otherSubtitle:e=>Ap[Et.indexOf(e.state.type)],progress:e=>xd(e.state.type),onClick(){},progressDisplay:un.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":v.dowsing.value!=null&&ke(v.dowsing.value)&&v.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=v.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0,showStar:e=>v.toolNodes.value[e.state.type]!=null,fillStar:e=>`${e.state.type}Relic`in v.toolNodes.value},Ep={shape:Ge.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Ft[t.slice(0,-5)]:ze[t].name},label:e=>e===v.board.selectedNode.value?{text:Ld[e.state].description(te(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":te(e.state)}),draggable:!0},Fp={shape:Ge.Diamond,size:50,title:"\u{1F962}",label:e=>e===v.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:Ki(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(2).pow_base(100),16),jt,zt("dowsing")],classes:e=>({running:ke(e)}),canAccept:Qi,onDrop:ea,draggable:!0},Op={shape:Ge.Diamond,size:50,title:"\u26F0\uFE0F",label:e=>e===v.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:Ki(e,t=>`Gather ${Nt(o.div(v.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(2).pow_base(1e4),16),jt,zt("quarry")],progress:e=>ke(e)?o.eq(v.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(v.quarryProgressRequired.value).toNumber():0,progressDisplay:un.Outline,progressColor:"var(--accent2)",canAccept:Qi,onDrop:ea,classes:e=>({running:ke(e)}),draggable:!0},qp={shape:Ge.Diamond,size:50,title:"\u{1F50C}",label:e=>e===v.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:Sd(e,t=>t.includes("Relic")?`Double ${Ft[t.slice(0,-5)]}'s effect`:`Double ${ze[t].name}'s effect`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(3).pow_base(1e3),24),jt,zt("empowerer")],canAccept:Md,onDrop:Id,classes:e=>({running:ke(e)}),draggable:!0},Vp={shape:Ge.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===v.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=v.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${st(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type;if(e.state.influences.includes(n))return{text:"Disconnect",color:"var(--accent2)"};const i=yt[n].cost;let s;return o.lt(i,1e3)?s=Ye(i):s=Ur(i,0),{text:`Add influence (${s}x cost)`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="portal")return{text:`Copy tier/influences from ${ge[t.state.id].name}`};return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},v.board.selectedAction.value=null,v.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal - ${Ye(v.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(v.energy.value,v.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(v.energy.value,v.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(v.energy.value,v.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in ge;)t++;v.energy.value=o.sub(v.energy.value,v.computedPortalCost.value);const{tier:n,influences:r}=e.state;Qr(sa(`portal-${t}`,n,Math.floor(Math.random()*4294967296),r.map(s=>v.influenceNodes.value[s].state)),Y);const i={id:An(v.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};v.board.placeInAvailableSpace(i),v.board.nodes.value.push(i),v.board.selectedAction.value=null,v.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null},zt("portalGenerator")],canAccept(e,t){return t.type==="resource"||t.type==="influence"||t.type==="portal"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,r=e.state.tier;e.state={...e.state,tier:n===r?void 0:n}}else if(t.type==="influence"){const n=t.state.type,r=e.state.influences;r.includes(n)?e.state={...e.state,influences:r.filter(i=>i!==n)}:e.state={...e.state,influences:[...r,n]}}else if(t.type==="portal"){const n=ge[t.state.id];e.state={...e.state,tier:n.tier.value,influences:n.influences.value.map(r=>r.type)}}v.board.selectedNode.value=e},progress:e=>e.state.tier==null?0:o.div(o.sqrt(v.energy.value),o.sqrt(v.computedPortalCost.value)).clampMax(1).toNumber(),progressDisplay:un.Fill,progressColor:e=>e.state.tier!=null&&o.gte(v.energy.value,v.computedPortalCost.value)?"var(--accent2)":"var(--foreground)",draggable:!0},Bp={shape:Ge.Diamond,size:50,title:"\u{1F300}",label:e=>e===v.board.selectedNode.value?{text:`Portal to ${ge[e.state.id].name}`,color:ge[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[jt],classes:e=>({running:ke(e),showNotif:ge[e.state.id].showNotif.value,"affected-node":v.booster.value!=null&&ke(v.booster.value)&&v.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>ge[e.state.id].background,draggable:!0,onClick(e){v.board.selectedNode.value=e,ge[e.state.id].minimized.value=!1}},Lp={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?Ge.Diamond:Ge.Circle,size:50,title:e=>yt[e.state.type].display,otherSubtitle:e=>{const t=yt[e.state.type].cost;return o.lt(t,1e3)?`${Ye(t)}x cost`:`${Ur(t,0)}x cost`},label:e=>{if(e===v.board.selectedNode.value){const n=e.state,r=yt[n.type].description;return{text:typeof r=="function"?r(n):r}}const t=v.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:r,data:i}=e.state;let s;if(Array.isArray(i)&&i.includes(n))s="Disconnect";else if(r==="increaseResources")s=`Increase ${st(n)} odds`;else if(r==="decreaseResources")s=`Decrease ${st(n)} odds`;else return null;return{text:s,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[pn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,r=e.state.data;r!=null&&(r.includes(n)?e.state={...e.state,data:r.filter(i=>i!==n)}:e.state={...e.state,data:[...r,n]},v.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},jp={shape:Ge.Diamond,size:50,title:"\u231B",label:e=>e===v.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ye(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Boost ${ge[t].name}'s speed`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ye(or.evaluate(e.state.level))} energy`}},fillColor(e){return o.gte(v.energy.value,or.evaluate(e.state.level))?"var(--bought)":"var(--locked)"},confirmationLabel(e){return o.gte(v.energy.value,or.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=or.evaluate(e.state.level);o.gte(v.energy.value,t)&&(v.energy.value=o.sub(v.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},v.board.selectedAction.value=null)}},jt,zt("booster")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},zp={shape:Ge.Diamond,size:50,title:"\u{1F916}",label:e=>e===v.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Auto-buy ${ge[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(4).pow_base(1e6)),jt,zt("upgrader")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},Gp={shape:Ge.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===v.board.selectedNode.value?{text:e.state.portals.length===0?"Automator - Drag a portal to me!":`Automatating (${e.state.portals.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Auto-buy ${ge[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(4).pow_base(1e6)),jt,zt("automator")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},Up={shape:Ge.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===v.board.selectedNode.value?{text:e.state.portals.length===0?"Investments - Drag a portal to me!":`Investing (${e.state.portals.length}/${o.add(e.state.maxConnections,v.computedBonusConnectionsModifier.value)})`}:wr(e,t=>`Passively generate ${ge[t].name}'s conversions`),actionDistance:Math.PI/4,actions:[pn,Cn(e=>e.add(3).pow_base(1e8)),jt,zt("investments")],canAccept:_r,onDrop:Nr,classes:e=>({running:ke(e)}),draggable:!0},Wp={shape:Ge.Diamond,size:50,title:"\u{1F5D1}\uFE0F",label:e=>{var t;if(e===v.board.selectedNode.value)return{text:"Trash Can - Drag a portal to me!"};if(((t=v.board.draggingNode.value)==null?void 0:t.type)==="portal"){const n=v.board.draggingNode.value.state.id;return{text:`Delete ${ge[n].name}!`,color:"var(--danger)"}}return null},canAccept:(e,t)=>t.type==="portal",onDrop:(e,t)=>{const n=t.state.id;ei(ge[n]),delete Y.layers[n],v.board.state.value.nodes=v.board.state.value.nodes.filter(r=>r!==t),v.booster.value&&(v.booster.value.state={...v.booster.value.state,portals:v.booster.value.state.portals.filter(r=>r!==n)}),v.upgrader.value&&(v.upgrader.value.state={...v.upgrader.value.state,portals:v.upgrader.value.state.portals.filter(r=>r!==n)}),v.automator.value&&(v.automator.value.state={...v.automator.value.state,portals:v.automator.value.state.portals.filter(r=>r!==n)}),v.investments.value&&(v.investments.value.state={...v.investments.value.state,portals:v.investments.value.state.portals.filter(r=>r!==n)}),Y.tabs=Y.tabs.filter(r=>r!==n)},draggable:!0},Si=hr(),Hp={mine:Dp,brokenFactory:Tp,factory:Pp,resource:Rp,passive:Ep,dowsing:Fp,quarry:Op,empowerer:qp,portalGenerator:Vp,portal:Bp,influence:Lp,booster:jp,upgrader:zp,automator:Gp,investments:Up,trashCan:Wp},v=Kr("main",function(){const e=$n(0,"energy"),t=y(()=>m.types.resource.nodes.value.reduce((D,P)=>(D[P.state.type]=P,D),{})),n=y(()=>({...m.types.passive.nodes.value.reduce((D,P)=>(D[P.state]=P,D),{}),sand:m.types.dowsing.nodes.value[0],wood:m.types.quarry.nodes.value[0],coal:m.types.empowerer.nodes.value[0],iron:m.types.portalGenerator.nodes.value[0],gold:m.types.booster.nodes.value[0],platinum:m.types.upgrader.nodes.value[0],berylium:m.types.automator.nodes.value[0],ultimatum:m.types.investments.nodes.value[0]})),r=y(()=>Object.keys(Ft).filter(D=>`${D}Relic`in n.value).length),i=y(()=>({...m.types.influence.nodes.value.reduce((D,P)=>(D[P.state.type]=P,D),{})})),s=y(()=>({...m.types.portal.nodes.value.reduce((D,P)=>(D[P.state.id]=P,D),{})})),l=y(()=>Et.reduce((D,P)=>{var E,U,Z;const O=(Z=(U=(E=t.value[P])==null?void 0:E.state)==null?void 0:U.amount)!=null?Z:0;return D[P]=o.floor(Br.invert(O)),D},{})),u=ln({}),c=ln({});Xt(()=>{Et.forEach(D=>{wt(()=>l.value[D],(P,O)=>{const E=o.sub(P,O);(o.eq(P,1)||o.gt(E,1))&&o.gt(E,o.div(O,100))&&ie.active===Y.id&&Si.info(d("div",null,[d("h3",null,[o.eq(P,1)?`${st(D)} discovered`:`${st(D)} is now Level ${ut(P)}`,w("!")]),o.gt(E,1)?d("div",null,[w("Gained "),ut(E),w(" levels")]):null]))})})});const p=y(()=>J.filter(D=>{var P,O;return(O=(P=D.value)==null?void 0:P.state)==null?void 0:O.powered}).length+m.types.portal.nodes.value.filter(D=>D.state.powered).length),h=y(()=>{let D=p.value;return n.value.copperRelic!=null&&(D--,te("copperRelic")&&D--),D}),g=y(()=>{const D=h.value;return o.lt(D,0)?0:o.eq(D,0)?10:o.add(D,1).pow_base(100).div(10).times(.99)}),b=y(()=>{if(x.value==null)return 0;let P=x.value.state.resources.reduce((O,E)=>o.div(100,tn[E].computedModifier.value).add(O),o.dZero);return n.value.silverRelic!=null&&(P=o.div(P,o.add(p.value,1)),te("silverRelic")&&(P=o.div(P,o.add(p.value,1)))),P}),m=md(D=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:Hp,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const P=[];if(P.push(...Object.keys(u).filter(bi(k.value)).map(O=>({startNode:k.value,endNode:t.value[O],stroke:"var(--accent3)",strokeWidth:5}))),C.value!=null&&C.value.state!=null&&P.push({startNode:C.value,endNode:t.value[C.value.state],stroke:"var(--foreground)",strokeWidth:4}),$.value!=null&&$.value.state.resources.forEach(O=>{P.push({startNode:$.value,endNode:t.value[O],stroke:ke($.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),x.value!=null&&x.value.state.resources.forEach(O=>{P.push({startNode:x.value,endNode:t.value[O],stroke:O in c?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),I.value!=null&&I.value.state.tools.forEach(O=>{P.push({startNode:I.value,endNode:n.value[O],stroke:ke(I.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),R.value!=null){const O=R.value.state;O.tier!=null&&P.push({startNode:R.value,endNode:t.value[O.tier],stroke:"var(--foreground)",strokeWidth:4}),O.influences.forEach(E=>{P.push({startNode:R.value,endNode:i.value[E],stroke:"var(--foreground)",strokeWidth:4})}),D.types.portal.nodes.value.forEach(E=>{const U=ge[E.state.id];return Et.filter(bi(E)).forEach(Z=>{let Te;if(U.links.value.includes(Z))Te="var(--accent3)";else if(Z in U.resourceMultis.value)Te="var(--accent1)";else return;P.push({startNode:E,endNode:t.value[Z],stroke:ke(E)?Te:"var(--foreground)",strokeWidth:4})}),P})}return L.value!=null&&L.value.state.portals.filter(O=>s.value[O]!=null).forEach(O=>{P.push({startNode:L.value,endNode:s.value[O],stroke:ke(L.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),ce.value!=null&&ce.value.state.portals.filter(O=>s.value[O]!=null).forEach(O=>{P.push({startNode:ce.value,endNode:s.value[O],stroke:"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.filter(O=>s.value[O]!=null).forEach(O=>{P.push({startNode:le.value,endNode:s.value[O],stroke:"var(--foreground)",strokeWidth:4})}),ae.value!=null&&ae.value.state.portals.filter(O=>s.value[O]!=null).forEach(O=>{P.push({startNode:ae.value,endNode:s.value[O],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(i.value).forEach(O=>{const E=O.state;(E.type==="increaseResources"||E.type==="decreaseResources")&&E.data.forEach(U=>{P.push({startNode:O,endNode:t.value[U],stroke:"var(--foreground)",strokeWidth:4})})}),P}})),k=y(()=>m.types.mine.nodes.value[0]),C=y(()=>m.types.factory.nodes.value[0]),$=y(()=>n.value.sand),x=y(()=>n.value.wood),I=y(()=>n.value.coal),R=y(()=>n.value.iron),L=y(()=>n.value.gold),ce=y(()=>n.value.platinum),le=y(()=>n.value.berylium),ae=y(()=>n.value.ultimatum),J=[k,$,x,I,L,ce,le,ae];function Ie(D,P){let O=t.value[D];if(P=o.times(P,qn[D].computedModifier.value),O==null)O={id:An(m),position:{...k.value.position},type:"resource",state:{type:D,amount:P}},m.placeInAvailableSpace(O),m.nodes.value.push(O);else{const E=O.state;O.state={...E,amount:o.add(E.amount,P)}}}const he=y(()=>Object.keys(Tt).reduce((D,P)=>D+new o(tn[P].computedModifier.value).toNumber(),0)),Ue=y(()=>{const D={};return m.types.portal.nodes.value.forEach(P=>{if(!ke(P))return;const E=ge[P.state.id].resourceMultis.value;Object.keys(E).forEach(U=>{D[U]!=null?D[U]=o.times(D[U],E[U]):D[U]=E[U]})}),D}),vt=Mt(()=>Et.map(D=>Ht(()=>({description:()=>st(D),addend:()=>l.value[D],enabled:()=>o.gt(l.value[D],0)})))),K=y(()=>vt.apply(0)),$e=Mt(()=>[Ht(()=>({addend:K,description:"Resource Levels"})),Ce(()=>({multiplier:()=>o.pow(On.value,K.value),description:()=>`${Zt(On.value,3)}x per Resource Level`})),Ce(()=>({multiplier:()=>te("stone")?4:2,description:()=>(te("stone")?"Empowered ":"")+ze.stone.name,enabled:()=>n.value.stone!=null})),Ce(()=>({multiplier:()=>{var D;return(D=Ue.value.energy)!=null?D:1},description:"Planar Treasures",enabled:()=>{var D;return o.neq((D=Ue.value.energy)!=null?D:1,1)}})),Ht(()=>({addend:()=>o.pow(100,h.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(h.value,0)}))]),nt=y(()=>$e.apply(0)),ht=Mt(()=>[Ht(()=>({addend:()=>te("unobtainium")?2:1,description:()=>(te("unobtainium")?"Empowered ":"")+ze.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),pt=y(()=>ht.apply(0)),St=Mt(()=>[Ce(()=>({multiplier:()=>te("dirt")?4:2,description:()=>(te("dirt")?"Empowered ":"")+ze.dirt.name,enabled:()=>n.value.dirt!=null})),Ce(()=>({multiplier:()=>o.pow(r.value,te("woodRelic")?2:1),description:()=>(te("woodRelic")?"Empowered ":"")+Ft.wood,enabled:()=>n.value.woodRelic!=null}))]),Mr=y(()=>St.apply(1)),kn=Mt(()=>[Ce(()=>({multiplier:()=>te("gravel")?4:2,description:()=>(te("gravel")?"Empowered ":"")+ze.gravel.name,enabled:()=>n.value.gravel!=null}))]),rr=y(()=>kn.apply(1)),Fn=Mt(()=>[Ht(()=>({addend:()=>te("copper")?.004:.002,description:()=>(te("copper")?"Empowered ":"")+ze.copper.name,enabled:()=>n.value.copper!=null}))]),On=y(()=>Fn.apply(1.01)),tn=Object.keys(Tt).reduce((D,P)=>{const O=Mt(()=>[Ce(()=>({multiplier:2,description:"Dowsing",enabled:()=>$.value!=null&&ke($.value)&&$.value.state.resources.includes(P)}))]),E=y(()=>O.apply(Tt[P])),U={title:`${st(P)} Drop Rate`,modifier:O,base:Tt[P]};return D[P]={modifier:O,computedModifier:E,section:U},D},{}),qn=Object.keys(Tt).reduce((D,P)=>{const O=Mt(()=>[Ce(()=>({multiplier:()=>{var Z;return(Z=Ue.value[P])!=null?Z:1},description:"Planar Treasures",enabled:()=>{var Z;return o.neq((Z=Ue.value[P])!=null?Z:1,1)}}))]),E=y(()=>O.apply(1)),U={title:`${st(P)} Gain`,modifier:O};return D[P]={modifier:O,computedModifier:E,section:U},D},{}),ir=y(()=>{var P,O,E;const D=Et.indexOf((E=(O=(P=R.value)==null?void 0:P.state)==null?void 0:O.tier)!=null?E:"dirt");return o.add(D,1).times(D).div(2).add(9).pow10()}),ar=Mt(()=>[...Object.keys(yt).map(D=>Ce(()=>({multiplier:yt[D].cost,description:yt[D].display,enabled:()=>{var P,O,E;return(E=(O=(P=R.value)==null?void 0:P.state)==null?void 0:O.influences.includes(D))!=null?E:!1},smallerIsBetter:!0}))),Ce(()=>({multiplier:()=>te("emeraldRelic")?.05:.1,description:()=>(te("emeraldRelic")?"Empowered ":"")+Ft.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),ye=y(()=>ar.apply(ir.value)),[Ir,xr]=Un(()=>[{title:"Resource Levels",modifier:vt,base:0},{title:"Energy Gain",modifier:$e,base:0,unit:"/s"},{title:"Portal Cost",modifier:ar,base:ir,unit:" energy",baseText:()=>{var D,P,O;return`${st((O=(P=(D=R.value)==null?void 0:D.state)==null?void 0:P.tier)!=null?O:"dirt")}-tier Base Cost`},visible:()=>R.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:ht,base:0,visible:()=>o.gt(pt.value,0)}]),[$r,V]=Un(()=>[{title:"Mining Speed",modifier:St,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:kn,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:Fn,base:1.01,visible:()=>n.value.copper!=null}]),[z,De]=Un(()=>Object.values(tn).map(D=>D.section)),[rt,Sn]=Un(()=>Object.values(qn).map(D=>D.section)),We=Ji({general:()=>({display:"General",glowColor(){return We.activeTab.value===this.tab?"white":""},tab:Ir,energyTabCollapsed:xr}),mining:()=>({display:"Mine",glowColor(){return We.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(n.value).filter(D=>D!=null).length>0,tab:$r,miningTabCollapsed:V}),resources:()=>({display:"Ore Rates",glowColor(){return We.activeTab.value===this.tab?"white":""},visibility:()=>$.value!=null,tab:z,resourcesCollapsed:De}),resourcesGain:()=>({display:"Ore Gain",glowColor(){return We.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(qn).some(D=>o.neq(D.computedModifier.value,1)),tab:rt,resourceGainCollapsed:Sn})}),Rt=G(!1),Ut=j(()=>d(Lt,{modelValue:Rt.value,"onUpdate:modelValue":D=>Rt.value=D},{header:()=>d("h2",null,[w("Modifiers")]),body:()=>ot(We)})),xt={mine:Gd(),factory:Ud(),dowsing:Wd(),quarry:Hd(),empowerer:Yd(),portalGenerator:Zd(),booster:Xd(),upgrader:Jd(),automator:Kd(),investments:Qd()};xt.mine.showModal[Kt]=!0,xt.mine.showModal.value=!0,this.on("preUpdate",D=>{if(Object.keys(u).forEach(P=>{u[P]-=D,u[P]<=0&&delete u[P]}),Object.keys(c).forEach(P=>{c[P]-=D,c[P]<=0&&delete c[P]}),ke(k.value)){const P=o.add(k.value.state.progress,o.times(Mr.value,D)),O=P.floor();k.value.state={...k.value.state,progress:o.sub(P,O)};const E=O.div(he.value).floor();E.gt(0)&&Et.forEach(Z=>{Ie(Z,o.times(new o(tn[Z].computedModifier.value).toNumber(),E).times(rr.value)),u[Z]=.3});const U=o.sub(O,E).toNumber();for(let Z=0;Z0){let E=o.add(P,D);const U=o.div(P,b.value).floor();E=o.sub(E,o.times(U,b.value)),x.value.state={...x.value.state,progress:E},o.gt(U,0)&&O.forEach(Z=>{Ie(Z,U),c[Z]=.3})}}e.value=o.add(e.value,o.times(nt.value,D)),o.lt(e.value,0)&&(e.value=0,J.map(P=>P.value).filter(P=>P!=null).forEach(P=>{(P==null?void 0:P.state).powered=!1}),Object.values(s.value).forEach(P=>{P.state.powered=!1}),k.value.state={...k.value.state,powered:!1},Si.warning(d("div",null,[d("h3",null,[w("Ran out of energy!")]),d("div",null,[w("All machines have been turned off.")])])))});const it=y(()=>{var D,P;return m.selectedAction.value===m.types.brokenFactory.actions[0]?-100:m.selectedAction.value===m.types.factory.actions[1]?o.neg(ze[m.selectedNode.value.state].cost):((D=m.selectedAction.value)==null?void 0:D.id)==="moreConnections"?o.neg(m.selectedAction.value.formula.evaluate(((P=m.selectedNode.value)==null?void 0:P.state).maxConnections)):0}),Wt=hn(f.variable(0).add(e),()=>o.neq(it.value,0),it),nn=y(()=>{var D;return m.selectedAction.value===jt?((D=m.selectedNode.value)==null?void 0:D.state).powered?o.eq(p.value,1)?10:o.pow(100,p.value).div(10).times(.99):o.neg(g.value):0}),Dr=hn(f.variable(0).add(nt),()=>o.neq(nn.value,0),nn),Mn=y(()=>m.types.portal.nodes.value.filter(D=>ke(D))),fn=y(()=>Mn.value.sort((D,P)=>{var U,Z;const O=(U=ge[D.state.id])!=null&&U.minimized.value?1:0,E=(Z=ge[P.state.id])!=null&&Z.minimized.value?1:0;return O-E}).map(D=>D.state.id));return wt(fn,D=>{Xt(()=>{Y.tabs=["main",...D]})}),wt(pt,(D,P)=>{o.lt(D,P)&&(vn(D,$,"resources"),vn(D,x,"resources"),vn(D,I,"tools"),vn(D,L,"portals"),vn(D,ce,"portals"),vn(D,le,"portals"),vn(D,ae,"portals"))}),{name:"World",board:m,energy:e,modifierTabs:We,resourceNodes:t,toolNodes:n,influenceNodes:i,portalNodes:s,grantResource:Ie,activePortals:Mn,nextPowerCost:g,computedBonusConnectionsModifier:pt,quarryProgressRequired:b,dropRates:tn,dowsing:$,empowerer:I,booster:L,upgrader:ce,automator:le,investments:ae,resourceLevels:l,planarMultis:Ue,computedPortalCost:ye,helpModals:xt,display:j(()=>d(ne,null,[d(mr,{class:"nav-container"},{default:()=>[d("span",{class:"nav-segment"},[d("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[ot(Wt)])," ",w("energy")]),d("span",{class:"nav-segment"},[w("("),d("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(nt.value,0)?"+":"",ot(Dr)]),w("/s)")]),o.gt(p.value,0)?d("span",{class:"nav-segment"},[d("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[ut(p.value)])," ",o.eq(p.value,1)?"machine":"machines"," ",w("powered")]):null,d("span",{class:"nav-segment"},[d("button",{class:"button",style:"display: inline",onClick:()=>Rt.value=!0},[w("modifiers")])]),Y.devSpeed===0?d("span",{class:"nav-segment"},[w("Game Paused")]):Y.devSpeed!=null&&Y.devSpeed!==1?d("span",{class:"nav-segment"},[w("Dev Speed: "),xe(Y.devSpeed),w("x")]):null]}),ot(m),ot(Ut),Object.values(xt).map(({modal:D})=>D())]))}});Qe.on("loadSettings",e=>{oe(e,"lineVisibility",!0)});Oi(j(()=>d($t,{title:j(()=>d("span",{class:"option-title"},[w("Always show lines to resource nodes"),d("desc",null,[w("Otherwise, will only be visible when either end of the line is selected.")])])),modelValue:ie.lineVisibility,"onUpdate:modelValue":e=>ie.lineVisibility=e},null)));const Yp=e=>{var n,r,i,s,l;const t=[v];return(l=(s=(i=(r=(n=e.layers)==null?void 0:n.main)==null?void 0:r.board)==null?void 0:i.state)==null?void 0:s.nodes)==null||l.filter(u=>(u==null?void 0:u.type)==="portal").map(u=>{var c,p;return(p=(c=u==null?void 0:u.state)==null?void 0:c.id)!=null?p:""}).forEach(u=>{var p,h,g,b;const c=(p=e.layers)==null?void 0:p[u];t.push(sa(u,(h=c.tier)!=null?h:"dirt",(g=c.seed)!=null?g:Math.floor(Math.random()*4294967296),(b=c.influences)!=null?b:[]))}),t},ai=G(!1);function Zp(e,t){}var Xp=Object.freeze(Object.defineProperty({__proto__:null,main:v,getInitialLayers:Yp,hasWon:ai,fixOldSave:Zp},Symbol.toStringTag,{value:"Module"}));const nr=e=>(cn("data-v-4a50ce42"),e=e(),dn(),e),Jp={class:"game-over-modal-header"},Kp=["src","alt"],Qp={class:"game-over-modal-title"},ef=nr(()=>N("h2",null,"Congratulations!",-1)),tf={key:0},nf=nr(()=>N("br",null,null,-1)),rf=nr(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),af=nr(()=>N("br",null,null,-1)),sf=["href"],of=nr(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),lf=X({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:r,discordLink:i,versionNumber:s,versionTitle:l}=ve,u=y(()=>yr(Y.timePlayed)),c=y(()=>ai.value&&!Y.keepGoing),p=Jt(Y,"autosave");function h(){Y.keepGoing=!0}function g(){bn(Tn())}return(b,m)=>(S(),re(Lt,{"model-value":a(c)},{header:H(()=>[N("div",Jp,[a(n)?(S(),T("img",{key:0,class:"game-over-modal-logo",src:a(n),alt:a(t)},null,8,Kp)):B("",!0),N("div",Qp,[ef,N("h4",null,"You've beaten "+ee(a(t))+" v"+ee(a(s))+": "+ee(a(l)),1)])])]),body:H(({shown:k})=>[k?(S(),T("div",tf,[N("div",null,"It took you "+ee(a(u))+" to beat the game.",1),nf,rf,af,N("div",null,[N("a",{href:a(i),class:"game-over-modal-discord-link"},[of,w(" "+ee(a(r)),1)],8,sf)]),d($t,{title:"Autosave",modelValue:a(p),"onUpdate:modelValue":m[0]||(m[0]=C=>Ve(p)?p.value=C:null)},null,8,["modelValue"])])):B("",!0)]),footer:H(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:h,class:"button"},"Keep Going"),N("button",{onClick:g,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var uf=be(lf,[["__scopeId","data-v-4a50ce42"]]);const Sr=e=>(cn("data-v-2776d67d"),e=e(),dn(),e),cf=Sr(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),df={key:0},pf=Sr(()=>N("br",null,null,-1)),ff=["href"],gf=Sr(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),mf=Sr(()=>N("br",null,null,-1)),vf={class:"nan-footer"},hf=X({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=ve,r=G(!0),i=G(!0),s=Jt(Fe,"hasNaN"),l=G(null);wt(s,b=>{b?(r.value=Y.autosave,i.value=Y.devSpeed===0):(Y.autosave=r.value,Y.devSpeed=i.value?0:null)});const u=y(()=>{var b;return(b=Fe.NaNPath)==null?void 0:b.join(".")}),c=y(()=>Fe.NaNPersistent!=null?Fe.NaNPersistent.value:null);function p(){Fe.NaNPersistent!=null&&(Fe.NaNPersistent.value=new o(0),Fe.hasNaN=!1)}function h(){Fe.NaNPersistent&&(Fe.NaNPersistent.value=new o(1),Fe.hasNaN=!1)}function g(){Fe.NaNPersistent&&(Fe.NaNPersistent.value=new o(NaN),Fe.hasNaN=!1)}return(b,m)=>(S(),T(ne,null,[d(Lt,Vt({modelValue:a(s),"onUpdate:modelValue":m[4]||(m[4]=k=>Ve(s)?s.value=k:null)},b.$attrs),{header:H(()=>[cf]),body:H(()=>[N("div",null,[w(' Attempted to assign "'+ee(a(u))+'" to NaN',1),a(c)?(S(),T("span",df,ee(" ")+"(previously "+ee(a(xe)(a(c)))+")",1)):B("",!0),w(". Auto-saving has been "+ee(r.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),pf,N("div",null,[N("a",{href:a(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[gf,w(" "+ee(a(t)||"The Paper Pilot Community"),1)],8,ff)]),mf,d($t,{title:"Autosave",modelValue:r.value,"onUpdate:modelValue":m[0]||(m[0]=k=>r.value=k)},null,8,["modelValue"]),a(ve).enablePausing?(S(),re($t,{key:0,title:"Pause game",modelValue:i.value,"onUpdate:modelValue":m[1]||(m[1]=k=>i.value=k)},null,8,["modelValue"])):B("",!0)]),footer:H(()=>[N("div",vf,[N("button",{onClick:m[2]||(m[2]=k=>{var C;return(C=l.value)==null?void 0:C.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:p,class:"button"},"Set to 0"),N("button",{onClick:h,class:"button"},"Set to 1"),a(c)&&a(o).neq(a(c),0)&&a(o).neq(a(c),1)?(S(),T("button",{key:0,onClick:m[3]||(m[3]=k=>s.value=!1),class:"button"}," Set to previous ")):B("",!0),N("button",{onClick:g,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),d(Hi,{ref_key:"savesManager",ref:l},null,512)],64))}});var bf=be(hf,[["__scopeId","data-v-2776d67d"]]);const yf={key:0,class:"tpsDisplay"},wf=X({__name:"TPS",setup(e){const t=y(()=>o.div(Fe.lastTenTicks.length,Fe.lastTenTicks.reduce((n,r)=>n+r,0)));return(n,r)=>a(t).isNan()?B("",!0):(S(),T("div",yf,"TPS: "+ee(a(ut)(a(t))),1))}});var _f=be(wf,[["__scopeId","data-v-89b89152"]]);var Nf=X({__name:"App",setup(e){const t=ve.useHeader,n=y(()=>It[ie.theme].variables),r=Jt(ie,"showTPS"),i=Jt(Fe,"errors"),s=y(()=>fe(j(()=>d(ne,null,[Hs.map(ot)]))));return(l,u)=>a(i).length>0?(S(),T("div",{key:0,class:"error-container",style:Le(a(n))},[d(xi,{errors:a(i)},null,8,["errors"])],4)):(S(),T(ne,{key:1},[N("div",{id:"modal-root",style:Le(a(n))},null,4),N("div",{class:Ne(["app",{useHeader:a(t)}]),style:Le(a(n))},[a(t)?(S(),re(Yi,{key:0})):B("",!0),d(Ec),a(a(r))?(S(),re(_f,{key:1})):B("",!0),d(uf),d(bf),(S(),re(Ke(a(s))))],6)],64))}});var Cf=be(Nf,[["__scopeId","data-v-bf4e22ac"]]);function kf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:l}=e;let u,c,p,h;const g=async(m=!0)=>{await p,m&&(u==null||u.addEventListener("controlling",k=>{k.isUpdate&&window.location.reload()})),await(h==null?void 0:h())};async function b(){if("serviceWorker"in navigator){const{Workbox:m,messageSW:k}=await Hn(()=>import("./workbox-window.4a8794bb.js"),[]);h=async()=>{c&&c.waiting&&await k(c.waiting,{type:"SKIP_WAITING"})},u=new m("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",C=>{C.isUpdate||r==null||r()});{const C=()=>{n==null||n()};u.addEventListener("waiting",C),u.addEventListener("externalwaiting",C)}u.register({immediate:t}).then(C=>{c=C,s?s("./sw.js",C):i==null||i(C)}).catch(C=>{l==null||l(C)})}}return p=b(),g}function Sf(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:l}=e,u=G(!1),c=G(!1);return{updateServiceWorker:kf({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,r==null||r()},onRegistered:i,onRegisteredSW:s,onRegisterError:l}),offlineReady:c,needRefresh:u}}const si=console.error;console.error=function(...e){si(...e)};window.onerror=function(e,t,n,r,i){return Fe.errors.push(i instanceof Error?i:new Error(JSON.stringify(i))),si(i),!0};window.onunhandledrejection=function(e){Fe.errors.push(e.reason instanceof Error?e.reason:new Error(JSON.stringify(e.reason))),si(e.reason)};document.title=ve.title;window.projInfo=ve;ve.id===""&&console.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 js();const{globalBus:e}=await Hn(()=>Promise.resolve().then(function(){return Ls}),void 0),{startGameLoop:t}=await Hn(()=>import("./gameLoop.659c1ba3.js"),["assets/gameLoop.659c1ba3.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/lz-string.dccec454.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=ya(Cf);n.config.errorHandler=function(r,i,s){console.error(r,s,i)},e.emit("setupVue",n),n.mount("#app"),Xt(()=>{const r=hr(),{updateServiceWorker:i}=Sf({onNeedRefresh(){r.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(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{o as D,Hn as _,Fe as a,ve as b,Xp as c,Qe as g,zs as l,Y as p,ie as s}; diff --git a/index.html b/index.html index d5e2668..7053c8b 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Planar Pioneers - + @@ -31,7 +31,7 @@ - + diff --git a/sw.js b/sw.js index 46fbd40..1a35c0f 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.a8abe3ac.js",revision:null},{url:"assets/index.3f4ba557.js",revision:null},{url:"assets/index.8a0a226e.css",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"186be6449aa3f90bf90a7356e5cb32b6"},{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.659c1ba3.js",revision:null},{url:"assets/index.82a00c6b.css",revision:null},{url:"assets/index.a102b2d9.js",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"e8e766ec523f1a8cc893202443387cc4"},{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")))}));