mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-22 08:31:31 +00:00
18 lines
219 KiB
JavaScript
18 lines
219 KiB
JavaScript
/* empty css */import"./vue.c16a309b.js";import{_ as w,C as s,l as Oe,q as mn,t as U,b2 as vt,ab as Y,aF as M,a1 as A,a2 as N,aL as At,G as be,aD as Cr,w as ht,b3 as It,a9 as p,O as re,ap as ga,az as yi,as as Gt,aH as ui,A as Pe,$ as te,b7 as H,b9 as Ui,ar as Wt,bv as Tn,a8 as T,bt as ma,bc as Hn,T as va,u as Gi,j as ha,bw as Rt,aM as Mt,a0 as z,aO as Xe,J as ce,I as je,aI as hn,aG as bn,z as en,bo as ba,bs as ya,aK as Dn,bd as lr,am as pi,H as wa,bx as _a,bf as Na}from"./@vue.6b211d3c.js";import{c as kr}from"./nanoevents.1080beb7.js";import{L as Kt}from"./lz-string.dccec454.js";import{Y as Ca}from"./vue-next-select.ded54c4a.js";import{D as ka}from"./vuedraggable.1879de79.js";import{p as Ma}from"./vue-textarea-autosize.35804eaf.js";import{P as Sa}from"./vue-panzoom.8ce6f9b1.js";import{s as Ia,u as wi}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 xa=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};xa();const $a="modulepreload",ur={},Ea="./",Zn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${Ea}${i}`,i in ur)return;ur[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":$a,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Pa="./projInfo-schema.json",Ta="Planar Pioneers",Da="A game about controlling and exploiting planes!",Aa="planar-pioneers",Ra="thepaperpilot",Fa="",Oa="",qa="0.0",Va="Initial Commit",Ba=!1,La=!1,ja=2,za=!0,Ua=null,Ga="",Wa=["main"],Ha=3600,Za=0,Xa=!0,Ya="base64";var me={$schema:Pa,title:Ta,description:Da,id:Aa,author:Ra,discordName:Fa,discordLink:Oa,versionNumber:qa,versionTitle:Va,allowGoBack:Ba,defaultShowSmall:La,defaultDecimalsShown:ja,useHeader:za,banner:Ua,logo:Ga,initialTabs:Wa,maxTickLength:Ha,offlineLimit:Za,enablePausing:Xa,exportEncoding:Ya};class Ja{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const i=new Ka(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Ka{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Ai=17,Qa=9e15,es=Math.log10(9e15),ts=1/9e15,ns=308,is=-324,cr=5,rs=(1<<10)-1,as=function(){const e=[];for(let n=is+1;n<=ns;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),on=[2,Math.E,3,4,5,6,7,8,9,10],ss=[[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]],os=[[-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 k=function(t){return o.fromValue_noAlloc(t)},X=function(e,t,n){return o.fromComponents(e,t,n)},ne=function(t,n,i){return o.fromComponents_noNormalize(t,n,i)};const Yt=function(t,n){const i=n+1,r=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,i-r))*Math.pow(10,r-i);return parseFloat(a.toFixed(Math.max(i-r,0)))},Ri=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},ls=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const i=e*e;let r=e;return n=n+1/(12*r),r=r*i,n=n+1/(360*r),r=r*i,n=n+1/(1260*r),r=r*i,n=n+1/(1680*r),r=r*i,n=n+1/(1188*r),r=r*i,n=n+691/(360360*r),r=r*i,n=n+7/(1092*r),r=r*i,n=n+3617/(122400*r),Math.exp(n)/t},Mr=.5671432904097838,dr=function(e,t=1e-10){let n,i;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Mr;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let r=0;r<100;++r){if(i=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(i-n)<t*Math.abs(i))return i;n=i}throw Error(`Iteration failed to converge: ${e.toString()}`)};function fr(e,t=1e-10){let n,i,r,a;if(!Number.isFinite(e.mag)||e.eq(o.dZero))return e;if(e.eq(o.dOne))return o.fromNumber(Mr);n=o.ln(e);for(let l=0;l<100;++l){if(i=n.neg().exp(),r=n.sub(e.mul(i)),a=n.sub(r.div(n.add(1).sub(n.add(2).mul(r).div(o.mul(2,n).add(2))))),o.abs(a.sub(n)).lt(o.abs(a).mul(t)))return a;n=a}throw Error(`Iteration failed to converge: ${e.toString()}`)}const b=class{constructor(e){this.sign=0,this.mag=0,this.layer=0,e instanceof b?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"&&this.fromString(e)}get m(){if(this.sign===0)return 0;if(this.layer===0){const e=Math.floor(Math.log10(this.mag));let t;return this.mag===5e-324?t=5:t=this.mag/as(e),this.sign*t}else if(this.layer===1){const e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}else return this.sign}set m(e){this.layer<=2?this.fromMantissaExponent(e,this.e):(this.sign=Math.sign(e),this.sign===0&&(this.layer=0,this.exponent=0))}get e(){return this.sign===0?0:this.layer===0?Math.floor(Math.log10(this.mag)):this.layer===1?Math.floor(this.mag):this.layer===2?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY}set e(e){this.fromMantissaExponent(this.m,e)}get s(){return this.sign}set s(e){e===0?(this.sign=0,this.layer=0,this.mag=0):this.sign=e}get mantissa(){return this.m}set mantissa(e){this.m=e}get exponent(){return this.e}set exponent(e){this.e=e}static fromComponents(e,t,n){return new b().fromComponents(e,t,n)}static fromComponents_noNormalize(e,t,n){return new b().fromComponents_noNormalize(e,t,n)}static fromMantissaExponent(e,t){return new b().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new b().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new b().fromDecimal(e)}static fromNumber(e){return new b().fromNumber(e)}static fromString(e){return new b().fromString(e)}static fromValue(e){return new b().fromValue(e)}static fromValue_noAlloc(e){if(e instanceof b)return e;if(typeof e=="string"){const t=b.fromStringCache.get(e);return t!==void 0?t:b.fromString(e)}else return typeof e=="number"?b.fromNumber(e):b.dZero}static abs(e){return k(e).abs()}static neg(e){return k(e).neg()}static negate(e){return k(e).neg()}static negated(e){return k(e).neg()}static sign(e){return k(e).sign}static sgn(e){return k(e).sign}static round(e){return k(e).round()}static floor(e){return k(e).floor()}static ceil(e){return k(e).ceil()}static trunc(e){return k(e).trunc()}static add(e,t){return k(e).add(t)}static plus(e,t){return k(e).add(t)}static sub(e,t){return k(e).sub(t)}static subtract(e,t){return k(e).sub(t)}static minus(e,t){return k(e).sub(t)}static mul(e,t){return k(e).mul(t)}static multiply(e,t){return k(e).mul(t)}static times(e,t){return k(e).mul(t)}static div(e,t){return k(e).div(t)}static divide(e,t){return k(e).div(t)}static recip(e){return k(e).recip()}static reciprocal(e){return k(e).recip()}static reciprocate(e){return k(e).reciprocate()}static cmp(e,t){return k(e).cmp(t)}static cmpabs(e,t){return k(e).cmpabs(t)}static compare(e,t){return k(e).cmp(t)}static isNaN(e){return e=k(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=k(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return k(e).eq(t)}static equals(e,t){return k(e).eq(t)}static neq(e,t){return k(e).neq(t)}static notEquals(e,t){return k(e).notEquals(t)}static lt(e,t){return k(e).lt(t)}static lte(e,t){return k(e).lte(t)}static gt(e,t){return k(e).gt(t)}static gte(e,t){return k(e).gte(t)}static max(e,t){return k(e).max(t)}static min(e,t){return k(e).min(t)}static minabs(e,t){return k(e).minabs(t)}static maxabs(e,t){return k(e).maxabs(t)}static clamp(e,t,n){return k(e).clamp(t,n)}static clampMin(e,t){return k(e).clampMin(t)}static clampMax(e,t){return k(e).clampMax(t)}static cmp_tolerance(e,t,n){return k(e).cmp_tolerance(t,n)}static compare_tolerance(e,t,n){return k(e).cmp_tolerance(t,n)}static eq_tolerance(e,t,n){return k(e).eq_tolerance(t,n)}static equals_tolerance(e,t,n){return k(e).eq_tolerance(t,n)}static neq_tolerance(e,t,n){return k(e).neq_tolerance(t,n)}static notEquals_tolerance(e,t,n){return k(e).notEquals_tolerance(t,n)}static lt_tolerance(e,t,n){return k(e).lt_tolerance(t,n)}static lte_tolerance(e,t,n){return k(e).lte_tolerance(t,n)}static gt_tolerance(e,t,n){return k(e).gt_tolerance(t,n)}static gte_tolerance(e,t,n){return k(e).gte_tolerance(t,n)}static pLog10(e){return k(e).pLog10()}static absLog10(e){return k(e).absLog10()}static log10(e){return k(e).log10()}static log(e,t){return k(e).log(t)}static log2(e){return k(e).log2()}static ln(e){return k(e).ln()}static logarithm(e,t){return k(e).logarithm(t)}static pow(e,t){return k(e).pow(t)}static pow10(e){return k(e).pow10()}static pow_base(e,t){return k(e).pow_base(t)}static root(e,t){return k(e).root(t)}static factorial(e,t){return k(e).factorial()}static gamma(e,t){return k(e).gamma()}static lngamma(e,t){return k(e).lngamma()}static exp(e){return k(e).exp()}static sqr(e){return k(e).sqr()}static sqrt(e){return k(e).sqrt()}static cube(e){return k(e).cube()}static cbrt(e){return k(e).cbrt()}static tetrate(e,t=2,n=ne(1,0,1)){return k(e).tetrate(t,n)}static iteratedexp(e,t=2,n=ne(1,0,1)){return k(e).iteratedexp(t,n)}static iteratedlog(e,t=10,n=1){return k(e).iteratedlog(t,n)}static layeradd10(e,t){return k(e).layeradd10(t)}static layeradd(e,t,n=10){return k(e).layeradd(t,n)}static slog(e,t=10){return k(e).slog(t)}static lambertw(e){return k(e).lambertw()}static ssqrt(e){return k(e).ssqrt()}static pentate(e,t=2,n=ne(1,0,1)){return k(e).pentate(t,n)}static sin(e){return k(e).sin()}static cos(e){return k(e).cos()}static tan(e){return k(e).tan()}static asin(e){return k(e).asin()}static acos(e){return k(e).acos()}static atan(e){return k(e).atan()}static sinh(e){return k(e).sinh()}static cosh(e){return k(e).cosh()}static tanh(e){return k(e).tanh()}static asinh(e){return k(e).asinh()}static acosh(e){return k(e).acosh()}static atanh(e){return k(e).atanh()}static affordGeometricSeries(e,t,n,i){return this.affordGeometricSeries_core(k(e),k(t),k(n),i)}static sumGeometricSeries(e,t,n,i){return this.sumGeometricSeries_core(e,k(t),k(n),i)}static affordArithmeticSeries(e,t,n,i){return this.affordArithmeticSeries_core(k(e),k(t),k(n),k(i))}static sumArithmeticSeries(e,t,n,i){return this.sumArithmeticSeries_core(k(e),k(t),k(n),k(i))}static efficiencyOfPurchase(e,t,n){return this.efficiencyOfPurchase_core(k(e),k(t),k(n))}static randomDecimalForTesting(e){if(Math.random()*20<1)return ne(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return ne(t,0,1);const n=Math.floor(Math.random()*(e+1));let i=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(i=Math.trunc(i));let r=Math.pow(10,i);return Math.random()>.9&&(r=Math.trunc(r)),X(t,n,r)}static affordGeometricSeries_core(e,t,n,i){const r=t.mul(n.pow(i));return b.floor(e.div(r).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,i){return t.mul(n.pow(i)).mul(b.sub(1,n.pow(e))).div(b.sub(1,n))}static affordArithmeticSeries_core(e,t,n,i){const a=t.add(i.mul(n)).sub(n.div(2)),l=a.pow(2);return a.neg().add(l.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,i){const r=t.add(i.mul(n));return e.div(2).mul(r.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag<ts)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=Qa)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<es&&this.layer>0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=b.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const i=e.split("^^^");if(i.length===2){const C=parseFloat(i[0]),_=parseFloat(i[1]),I=i[1].split(";");let P=1;if(I.length===2&&(P=parseFloat(I[1]),isFinite(P)||(P=1)),isFinite(C)&&isFinite(_)){const S=b.pentate(C,_,P);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const r=e.split("^^");if(r.length===2){const C=parseFloat(r[0]),_=parseFloat(r[1]),I=r[1].split(";");let P=1;if(I.length===2&&(P=parseFloat(I[1]),isFinite(P)||(P=1)),isFinite(C)&&isFinite(_)){const S=b.tetrate(C,_,P);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const C=parseFloat(a[0]),_=parseFloat(a[1]);if(isFinite(C)&&isFinite(_)){const I=b.pow(C,_);return this.sign=I.sign,this.layer=I.layer,this.mag=I.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}e=e.trim().toLowerCase();let l,u,c=e.split("pt");if(c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let C=parseFloat(c[1]);if(isFinite(C)||(C=1),isFinite(l)&&isFinite(u)){const _=b.tetrate(l,u,C);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(c=e.split("p"),c.length===2){l=10,u=parseFloat(c[0]),c[1]=c[1].replace("(",""),c[1]=c[1].replace(")","");let C=parseFloat(c[1]);if(isFinite(C)||(C=1),isFinite(l)&&isFinite(u)){const _=b.tetrate(l,u,C);return this.sign=_.sign,this.layer=_.layer,this.mag=_.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}const d=e.split("e"),v=d.length-1;if(v===0){const C=parseFloat(e);if(isFinite(C))return this.fromNumber(C),b.fromStringCache.size>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else if(v===1){const C=parseFloat(e);if(isFinite(C)&&C!==0)return this.fromNumber(C),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}const f=e.split("e^");if(f.length===2){this.sign=1,f[0].charAt(0)=="-"&&(this.sign=-1);let C="";for(let _=0;_<f[1].length;++_){const I=f[1].charCodeAt(_);if(I>=43&&I<=57||I===101)C+=f[1].charAt(_);else return this.layer=parseFloat(C),this.mag=parseFloat(f[1].substr(_+1)),this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}}if(v<1)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;const h=parseFloat(d[0]);if(h===0)return this.sign=0,this.layer=0,this.mag=0,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this;let g=parseFloat(d[d.length-1]);if(v>=2){const C=parseFloat(d[d.length-2]);isFinite(C)&&(g*=Math.sign(C),g+=Ri(C))}if(!isFinite(h))this.sign=d[0]==="-"?-1:1,this.layer=v,this.mag=g;else if(v===1)this.sign=Math.sign(h),this.layer=1,this.mag=g+Math.log10(Math.abs(h));else if(this.sign=Math.sign(h),this.layer=v,v===2){const C=b.mul(X(1,2,g),k(h));return this.sign=C.sign,this.layer=C.layer,this.mag=C.mag,b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}else this.mag=g;return this.normalize(),b.fromStringCache.maxSize>=1&&b.fromStringCache.set(t,b.fromDecimal(this)),this}fromValue(e){return e instanceof b?this.fromDecimal(e):typeof e=="number"?this.fromNumber(e):typeof e=="string"?this.fromString(e):(this.sign=0,this.layer=0,this.mag=0,this)}toNumber(){return Number.isFinite(this.layer)?this.layer===0?this.sign*this.mag:this.layer===1?this.sign*Math.pow(10,this.mag):this.mag>0?this.sign>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:0:Number.NaN}mantissaWithDecimalPlaces(e){return isNaN(this.m)?Number.NaN:this.m===0?0:Yt(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Yt(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<=cr?(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):Yt(this.m,e)+"e"+Yt(this.e,e):this.layer===1?Yt(this.m,e)+"e"+Yt(this.e,e):this.layer<=cr?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Yt(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Yt(this.mag,e)}abs(){return ne(this.sign===0?0:1,this.layer,this.mag)}neg(){return ne(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?b.dZero:this.layer===0?X(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?b.dZero:this.layer===0?X(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?b.dZero:this.layer===0?X(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?b.dZero:this.layer===0?X(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=k(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 ne(0,0,0);let n,i;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(b.cmpabs(this,t)>0?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.fromNumber(n.sign*n.mag+i.sign*i.mag);const r=n.layer*Math.sign(n.mag),a=i.layer*Math.sign(i.mag);if(r-a>=2)return n;if(r===0&&a===-1){if(Math.abs(i.mag-Math.log10(n.mag))>Ai)return n;{const l=Math.pow(10,Math.log10(n.mag)-i.mag),u=i.sign+n.sign*l;return X(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}if(r===1&&a===0){if(Math.abs(n.mag-Math.log10(i.mag))>Ai)return n;{const l=Math.pow(10,n.mag-Math.log10(i.mag)),u=i.sign+n.sign*l;return X(Math.sign(u),1,Math.log10(i.mag)+Math.log10(Math.abs(u)))}}if(Math.abs(n.mag-i.mag)>Ai)return n;{const l=Math.pow(10,n.mag-i.mag),u=i.sign+n.sign*l;return X(Math.sign(u),1,i.mag+Math.log10(Math.abs(u)))}}plus(e){return this.add(e)}sub(e){return this.add(k(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=k(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return ne(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return ne(this.sign*t.sign,0,1);let n,i;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,i=t):(n=t,i=this),n.layer===0&&i.layer===0)return b.fromNumber(n.sign*i.sign*n.mag*i.mag);if(n.layer>=3||n.layer-i.layer>=2)return X(n.sign*i.sign,n.layer,n.mag);if(n.layer===1&&i.layer===0)return X(n.sign*i.sign,1,n.mag+Math.log10(i.mag));if(n.layer===1&&i.layer===1)return X(n.sign*i.sign,1,n.mag+i.mag);if(n.layer===2&&i.layer===1){const r=X(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(X(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return X(n.sign*i.sign,r.layer+1,r.sign*r.mag)}if(n.layer===2&&i.layer===2){const r=X(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(X(Math.sign(i.mag),i.layer-1,Math.abs(i.mag)));return X(n.sign*i.sign,r.layer+1,r.sign*r.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=k(e);return this.mul(t.recip())}divide(e){return this.div(e)}divideBy(e){return this.div(e)}dividedBy(e){return this.div(e)}recip(){return this.mag===0?b.dNaN:this.layer===0?X(this.sign,0,1/this.mag):X(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=k(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=k(e),n=this.mag>0?this.layer:-this.layer,i=t.mag>0?t.layer:-t.layer;return n>i?1:n<i?-1:this.mag>t.mag?1:this.mag<t.mag?-1:0}compare(e){return this.cmp(e)}isNan(){return isNaN(this.sign)||isNaN(this.layer)||isNaN(this.mag)}isFinite(){return isFinite(this.sign)&&isFinite(this.layer)&&isFinite(this.mag)}eq(e){const t=k(e);return this.sign===t.sign&&this.layer===t.layer&&this.mag===t.mag}equals(e){return this.eq(e)}neq(e){return!this.eq(e)}notEquals(e){return this.neq(e)}lt(e){return this.cmp(e)===-1}lte(e){return!this.gt(e)}gt(e){return this.cmp(e)===1}gte(e){return!this.lt(e)}max(e){const t=k(e);return this.lt(t)?t:this}min(e){const t=k(e);return this.gt(t)?t:this}maxabs(e){const t=k(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=k(e);return this.cmpabs(t)>0?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=k(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=k(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let i=this.mag,r=n.mag;return this.layer>n.layer&&(r=Ri(r)),this.layer<n.layer&&(i=Ri(i)),Math.abs(i-r)<=t*Math.max(Math.abs(i),Math.abs(r))}equals_tolerance(e,t){return this.eq_tolerance(e,t)}neq_tolerance(e,t){return!this.eq_tolerance(e,t)}notEquals_tolerance(e,t){return this.neq_tolerance(e,t)}lt_tolerance(e,t){const n=k(e);return!this.eq_tolerance(n,t)&&this.lt(n)}lte_tolerance(e,t){const n=k(e);return this.eq_tolerance(n,t)||this.lt(n)}gt_tolerance(e,t){const n=k(e);return!this.eq_tolerance(n,t)&&this.gt(n)}gte_tolerance(e,t){const n=k(e);return this.eq_tolerance(n,t)||this.gt(n)}pLog10(){return this.lt(b.dZero)?b.dZero:this.log10()}absLog10(){return this.sign===0?b.dNaN:this.layer>0?X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):X(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?b.dNaN:this.layer>0?X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):X(this.sign,0,Math.log10(this.mag))}log(e){return e=k(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?b.dNaN:this.layer===0&&e.layer===0?X(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):b.div(this.log10(),e.log10())}log2(){return this.sign<=0?b.dNaN:this.layer===0?X(this.sign,0,Math.log2(this.mag)):this.layer===1?X(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?X(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?b.dNaN:this.layer===0?X(this.sign,0,Math.log(this.mag)):this.layer===1?X(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?X(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):X(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=k(e),n=this,i=t;if(n.sign===0)return i.eq(0)?ne(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(i.sign===0)return ne(1,0,1);if(i.sign===1&&i.layer===0&&i.mag===1)return n;const r=n.absLog10().mul(i).pow10();return this.sign===-1?Math.abs(i.toNumber()%2)%2===1?r.neg():Math.abs(i.toNumber()%2)%2===0?r:b.dNaN:r}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return b.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return X(1,0,t);if(e.sign===0)return b.dOne;e=ne(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?X(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?X(-e.sign,e.layer+1,-e.mag):b.dOne}pow_base(e){return k(e).pow(this)}root(e){const t=k(e);return this.pow(t.recip())}factorial(){return this.mag<0?this.add(1).gamma():this.layer===0?this.add(1).gamma():this.layer===1?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(ne(1,0,24)))return b.fromNumber(ls(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let i=e,r=12*i,a=1/r,l=t+a;if(l===t||(t=l,i=i*n,r=360*i,a=1/r,l=t-a,l===t))return b.exp(t);t=l,i=i*n,r=1260*i;let u=1/r;return t=t+u,i=i*n,r=1680*i,u=1/r,t=t-u,b.exp(t)}else return this.layer===1?b.exp(b.mul(this,b.ln(this).sub(1))):b.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?b.dOne:this.layer===0&&this.mag<=709.7?b.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?X(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?X(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):X(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return b.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return X(1,2,Math.log10(this.mag)-.3010299956639812);{const e=b.div(ne(this.sign,this.layer-1,this.mag),ne(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=ne(1,0,1)){if(e===1)return b.pow(this,t);if(e===0)return new b(t);if(this.eq(b.dOne))return b.dOne;if(this.eq(-1))return b.pow(this,t);if(e===Number.POSITIVE_INFINITY){const r=this.toNumber();if(r<=1.444667861009766&&r>=.06598803584531254){if(r>1.444667861009099)return b.fromNumber(Math.E);const a=b.ln(this).neg();return a.lambertw().div(a)}else return r>1.444667861009766?b.fromNumber(Number.POSITIVE_INFINITY):b.dNaN}if(this.eq(b.dZero)){let r=Math.abs((e+1)%2);return r>1&&(r=2-r),b.fromNumber(r)}if(e<0)return b.iteratedlog(t,this,-e);t=k(t);const n=e;e=Math.trunc(e);const i=n-e;if(this.gt(b.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let r=0;r<e;++r){const a=t;if(t=this.pow(t),a.eq(t))return t}if(i!=0){const r=this.pow(t);return t.mul(1-i).add(r.mul(i))}return t}i!==0&&(t.eq(b.dOne)?this.gt(10)?t=this.pow(i):(t=b.fromNumber(b.tetrate_critical(this.toNumber(),i)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r<e;++r){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return ne(t.sign,t.layer+(e-r-1),t.mag);if(r>1e4)return t}return t}iteratedexp(e=2,t=ne(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return b.tetrate(e,-t,this);e=k(e);let n=b.fromDecimal(this);const i=t;t=Math.trunc(t);const r=i-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a<t;++a){if(n=n.log(e),!isFinite(n.layer)||!isFinite(n.mag))return n.normalize();if(a>1e4)return n}return r>0&&r<1&&(e.eq(10)?n=n.layeradd10(-r):n=n.layeradd(-r,e)),n}slog(e=10,t=100){let n=.001,i=!1,r=!1,a=this.slog_internal(e).toNumber();for(let l=1;l<t;++l){const c=new b(e).tetrate(a).gt(this);if(l>1&&r!=c&&(i=!0),r=c,i?n/=2:n*=2,n=Math.abs(n)*(c?-1:1),a+=n,n===0)break}return b.fromNumber(a)}slog_internal(e=10){if(e=k(e),e.lte(b.dZero)||e.eq(b.dOne))return b.dNaN;if(e.lt(b.dOne))return this.eq(b.dOne)?b.dZero:this.eq(b.dZero)?b.dNegOne:b.dNaN;if(this.mag<0||this.eq(b.dZero))return b.dNegOne;let t=0,n=b.fromDecimal(this);if(n.layer-e.layer>3){const i=n.layer-e.layer-3;t+=i,n.layer-=i}for(let i=0;i<100;++i)if(n.lt(b.dZero))n=b.pow(e,n),t-=1;else{if(n.lte(b.dOne))return b.fromNumber(t+b.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=b.log(n,e)}return b.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:b.critical_section(e,t,os)}static tetrate_critical(e,t){return b.critical_section(e,t,ss)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let i=0,r=0;for(let l=0;l<on.length;++l)if(on[l]==e){i=n[l][Math.floor(t)],r=n[l][Math.ceil(t)];break}else if(on[l]<e&&on[l+1]>e){const u=(e-on[l])/(on[l+1]-on[l]);i=n[l][Math.floor(t)]*(1-u)+n[l+1][Math.floor(t)]*u,r=n[l][Math.ceil(t)]*(1-u)+n[l+1][Math.ceil(t)]*u;break}const a=t-Math.floor(t);return i<=0||r<=0?i*(1-a)+r*a:Math.pow(e,Math.log(i)/Math.log(e)*(1-a)+Math.log(r)/Math.log(e)*a)}layeradd10(e){e=b.fromValue_noAlloc(e).toNumber();const t=b.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let i=0;i<100;++i){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const i=this.slog(t).toNumber()+e;return i>=0?b.tetrate(t,i):Number.isFinite(i)?i>=-1?b.log(b.tetrate(t,i+1),t):b.log(b.log(b.tetrate(t,i+2),t),t):b.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return b.fromNumber(dr(this.toNumber()));if(this.layer===0)return b.fromNumber(dr(this.sign*this.mag));if(this.layer===1)return fr(this);if(this.layer===2)return fr(this);if(this.layer>=3)return ne(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return ne(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=ne(1,0,1)){t=k(t);const n=e;e=Math.trunc(e);const i=n-e;i!==0&&(t.eq(b.dOne)?(++e,t=b.fromNumber(i)):this.eq(10)?t=t.layeradd10(i):t=t.layeradd(i,this));for(let r=0;r<e;++r){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(r>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.sin(this.sign*this.mag)):ne(0,0,0)}cos(){return this.mag<0?b.dOne:this.layer===0?b.fromNumber(Math.cos(this.sign*this.mag)):ne(0,0,0)}tan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.tan(this.sign*this.mag)):ne(0,0,0)}asin(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.asin(this.sign*this.mag)):ne(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?b.fromNumber(Math.acos(this.toNumber())):this.layer===0?b.fromNumber(Math.acos(this.sign*this.mag)):ne(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?b.fromNumber(Math.atan(this.sign*this.mag)):b.fromNumber(Math.atan(this.sign*(1/0)))}sinh(){return this.exp().sub(this.negate().exp()).div(2)}cosh(){return this.exp().add(this.negate().exp()).div(2)}tanh(){return this.sinh().div(this.cosh())}asinh(){return b.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return b.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?ne(Number.NaN,Number.NaN,Number.NaN):b.ln(this.add(1).div(b.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(b.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let o=b;o.fromStringCache=new Ja(rs);o.dZero=ne(0,0,0);o.dOne=ne(1,0,1);o.dNegOne=ne(-1,0,1);o.dTwo=ne(1,0,2);o.dTen=ne(1,0,10);o.dNaN=ne(Number.NaN,Number.NaN,Number.NaN);o.dInf=ne(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);o.dNegInf=ne(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);o.dNumberMax=X(1,0,Number.MAX_VALUE);o.dNumberMin=X(1,0,Number.MIN_VALUE);k=o.fromValue_noAlloc;X=o.fromComponents;ne=o.fromComponents_noNormalize;o.fromMantissaExponent;o.fromMantissaExponent_noNormalize;const us=new o(1);function zn(e,t,n=!0){let i=o.log10(e).floor(),r=o.div(e,o.pow(10,i));r.toStringWithDecimalPlaces(t)==="10"&&(r=us,i=i.add(1));const a=i.gte(1e9)?bt(i,Math.max(Math.max(t,3),me.defaultDecimalsShown)):i.gte(1e4)?gi(i,0):i.toStringWithDecimalPlaces(0);return n?r.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function gi(e,t){if(e==null)return"NaN";if(e=new o(e),e.mag<.001)return 0 .toFixed(t);const i=e.toStringWithDecimalPlaces(t).split(".");return i[0]=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),i.length==1?i[0]:i[0]+"."+i[1]}function Sr(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()),me.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const cs=new o("eeee1000"),ds=new o("e100000"),pr=new o("e1000"),Ir=new o(1e9),fs=new o(1e6),ps=new o(1e3),gs=new o(.98),ms=new o(.001),xr=new o(0);function bt(e,t,n){if(t==null&&(t=me.defaultDecimalsShown),n=n!=null?n:me.defaultShowSmall,e=new o(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+bt(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(cs)){const i=e.slog();return i.gte(fs)?"F"+bt(i.floor()):o.pow(10,i.sub(i.floor())).toStringWithDecimalPlaces(3)+"F"+gi(i.floor(),0)}else{if(e.gte(ds))return zn(e,0,!1);if(e.gte(pr))return zn(e,0);if(e.gte(Ir))return zn(e,t);if(e.gte(ps))return gi(e,0);if(e.gte(ms)||!n)return Sr(e,t);if(e.eq(xr))return 0 .toFixed(t)}return e=Er(e),e.lt(pr)?zn(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):bt(e,t)+"\u207B\xB9"}function Ze(e){return e=new o(e),e.sign<0?"-"+Ze(e.neg()):e.gte(Ir)||e.lte(gs)&&!e.eq(xr)?bt(e):bt(e,0)}function $r(e){return o.lt(e,0)?"-"+$r(o.neg(e)):o.gt(e,2**51)?bt(o.div(e,31536e3))+"y":(e=new o(e).toNumber(),e<60?bt(e)+"s":e<3600?Ze(Math.floor(e/60))+"m "+bt(e%60)+"s":e<86400?Ze(Math.floor(e/3600))+"h "+Ze(Math.floor(e/60)%60)+"m "+Ze(e%60)+"s":e<31536e3?Ze(Math.floor(e/84600)%365)+"d "+Ze(Math.floor(e/3600)%24)+"h "+Ze(Math.floor(e/60)%60)+"m":Ze(Math.floor(e/31536e3))+"y "+Ze(Math.floor(e/84600)%365)+"d "+Ze(Math.floor(e/3600)%24)+"h")}function vs(e,t,n){e=new o(e);let i=e.toStringWithDecimalPlaces(t);return new o(i).gte(n)&&(i=o.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),i}function hs(e,t){return bt(e,t,!0)}function Er(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 bs=Object.freeze(Object.defineProperty({__proto__:null,default:o,exponentialFormat:zn,commaFormat:gi,regularFormat:Sr,format:bt,formatWhole:Ze,formatTime:$r,toPlaces:vs,formatSmall:hs,invertOOM:Er},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:ys,commaFormat:ws,regularFormat:_s,format:Me,formatWhole:ft,formatTime:_i,toPlaces:Ns,formatSmall:Ut,invertOOM:Cs}=bs;window.Decimal=o;window.exponentialFormat=ys;window.commaFormat=ws;window.regularFormat=_s;window.format=Me;window.formatWhole=ft;window.formatTime=_i;window.toPlaces=Ns;window.formatSmall=Ut;window.invertOOM=Cs;function tt(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Xn(e){return typeof e=="function"}var G=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(G||{});const Yn=Symbol("DoNotCache");function $(e,t){const n=e[t];Xn(n)&&n.length===0&&!n[Yn]?e[t]=w(n.bind(e)):Xn(n)&&(e[t]=n.bind(e),e[t][Yn]=!0)}function ve(e){return Xn(e)&&!e[Yn]&&(e=w(e)),e}const yt=Symbol("Component"),pt=Symbol("GatherProps");let ks=0;function nn(e="feature-"){return e+ks++}var Ce=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(Ce||{});function Ge(e){const t=s(e);return t!==2&&t!==!1}function yn(e){return s(e)===1}function J(e){return e[Yn]=!0,e}function se(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Jn(e,...t){const n=[],i=r=>{Object.keys(r).forEach(a=>{const l=r[a];l!=null&&typeof l=="object"&&(t.includes(l.type)?n.push(l):!(l instanceof o)&&!Oe(l)&&i(l))})};return i(e),n}const ln={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 Wi=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(Wi||{}),Ct={classic:ln,paper:{...ln,variables:{...ln.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:{...ln,variables:{...ln.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:{...ln,variables:{...ln.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Ye=kr();"fonts"in document&&(document.fonts.onloadingdone=()=>Ye.emit("fontsLoaded"));var Ms=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Ye},Symbol.toStringTag,{value:"Module"}));const Ss=mn({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var K=window.player=Ss;function Pr(e){return JSON.stringify(e,(t,n)=>s(n))}function Tr(e={}){return Object.assign({id:`${me.id}-0`,name:"Default Save",tabs:me.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:me.id,modVersion:me.versionNumber,layers:{}},e)}function mt(e){const t=Kt.compressToUTF16(Pr(e!=null?e:K));return localStorage.setItem((e!=null?e:K).id,t),t}async function Is(){Es();try{let e=localStorage.getItem(ue.active);if(e==null){await dn(Pn());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Kt.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==me.id){await dn(Pn());return}t.id=ue.active,await dn(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
|
|
`,e),await dn(Pn())}}function Pn(){const e=fi(),t=Tr({id:e});return mt(t),ue.saves.push(e),t}function fi(){let e,t=0;do e=`${me.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const xs=U(!1);async function dn(e){console.info("Loading save",e),xs.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Zn(()=>Promise.resolve().then(function(){return Ks}),void 0),{fixOldSave:r,getInitialLayers:a}=await Zn(()=>Promise.resolve().then(function(){return Sf}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=Tr(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,me.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==me.versionNumber&&(r(e.modVersion,e),e.modVersion=me.versionNumber),Object.assign(K,e),ue.active=K.id,Ye.emit("onLoad")}setInterval(()=>{K.autosave&&mt()},1e3);window.onbeforeunload=()=>{K.autosave&&mt()};window.save=mt;const $s=window.hardReset=async()=>{await dn(Pn())};window.deleteLowerSaves=()=>{const e=Object.values(ue.saves).indexOf(K.id)+1;Object.values(ue.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ue.saves=ue.saves.slice(0,e)};const Kn=mn({active:"",saves:[],showTPS:!0,theme:Wi.Nordic,unthrottled:!1,alignUnits:!1});vt(Kn,e=>{const t=Kt.compressToUTF16(JSON.stringify(e));localStorage.setItem(me.id,t)},{deep:!0});var ue=window.settings=Kn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Wi.Nordic,alignUnits:!1};Ye.emit("loadSettings",e),Object.assign(Kn,e),$s()};function Es(){try{let e=localStorage.getItem(me.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Kt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Kn,t)}Ye.emit("loadSettings",Kn)}catch{}}const Dr=mn([]);function Ps(e){Dr.push(e)}const Ts=mn([]),Ds=mn([]),As={class:"table"},Rs=Y({__name:"Column",setup(e){const t=w(()=>Ct[ue.theme].mergeAdjacent);return(n,i)=>(M(),A("div",As,[N("div",{class:be(["col",{mergeAdjacent:s(t)}])},[At(n.$slots,"default")],2)]))}}),Fs={class:"table"},Os=Y({__name:"Row",setup(e){const t=w(()=>Ct[ue.theme].mergeAdjacent);return(n,i)=>(M(),A("div",Fs,[N("div",{class:be(["row",{mergeAdjacent:s(t)}])},[At(n.$slots,"default")],2)]))}});function Ar(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ga(e)}function de(e,t="span"){return typeof e=="function"?Y({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),Y({template:e})):Y({render:()=>({})}):e}function rt(e){if(xt(e))return typeof e=="function"?e():de(e);const t=e[yt];return p(t,e[pt](),null)}function Fi(...e){let t;return p(Os,null,Ar(t=e.map(rt))?t:{default:()=>[t]})}function qs(...e){let t;return p(Rs,null,Ar(t=e.map(rt))?t:{default:()=>[t]})}function kt(e){if(xt(e))return typeof e=="function"?e():typeof e=="string"?p(re,null,[e]):p(e,null,null);const t=e[yt];return p(t,e[pt](),null)}function gr(e,t){return e.reduce((n,i)=>p(re,null,[n,t,i]))}function xt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Yn]===!0}function Rr(e,t){const n=U(null),i=U(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Cr(a),{start:r,stop:a,handleHolding:l}}function Fr(e,t="div"){const n=ht();return It(()=>{n.value=de($e(e),t)}),n}function An(e,t="div"){const n=ht(null);return It(()=>{const i=$e(e);n.value=i==""||i==null?null:de(i,t)}),n}function $e(e){return s(s(e))}function O(...e){return e.includes(Object)||e.push(Object),e}function mr(e){const t=U(!1),n=e[pt].bind(e);return e[pt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var pe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Vs=Y({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=U({}),i=new ResizeObserver(u),r=U(null);yi(()=>{const f=r.value;f!=null&&i.observe(f)});let a=!0,l=U((v=r.value)==null?void 0:v.getBoundingClientRect());function u(){a&&(a=!1,Gt(()=>{var f;l.value=(f=r.value)==null?void 0:f.getBoundingClientRect(),Object.values(n.value).filter(h=>h).forEach(h=>h.rect=h.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}Ye.on("fontsLoaded",u);const c={attributes:!1,childList:!0,subtree:!1};ui(Hi,(f,h)=>{const g=new MutationObserver(()=>d(f));g.observe(h,c),n.value[f]={element:h,observer:g,rect:h.getBoundingClientRect()},u()}),ui(Zi,f=>{var h;(h=n.value[f])==null||h.observer.disconnect(),n.value[f]=void 0,u()}),ui(Xi,n),ui(Yi,l);function d(f){const h=n.value[f];h!=null&&(h.rect=h.element.getBoundingClientRect(),t("updateNodes",n.value))}return(f,h)=>(M(),A(re,null,[At(f.$slots,"default",{},void 0,!0),N("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var Or=pe(Vs,[["__scopeId","data-v-2b1dc1bc"]]);const Bs=["onPointerdown"],Ls={class:"modal-wrapper"},js={class:"modal-container"},zs={class:"modal-header"},Us={class:"modal-body"},Gs={class:"modal-footer"},Ws=N("div",{class:"modal-default-flex-grow"},null,-1),Ht=Y({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const r=Pe(e),a=w(()=>s(r.modelValue)||u.value);function l(){n("update:modelValue",!1)}const u=U(!1),c=U(null),d=w(()=>{var v,f;return(f=(v=c.value)==null?void 0:v.nodes)!=null?f:null});return t({isOpen:a,nodes:d}),(v,f)=>(M(),te(va,{to:"#modal-root"},[p(Hn,{name:"modal",onBeforeEnter:f[0]||(f[0]=h=>u.value=!0),onAfterLeave:f[1]||(f[1]=h=>u.value=!1)},{default:H(()=>[Ui(N("div",Wt({class:"modal-mask",onPointerdown:Tn(l,["self"])},v.$attrs),[N("div",Ls,[N("div",js,[N("div",zs,[At(v.$slots,"header",{shown:s(a)},()=>[T(" default header ")])]),N("div",Us,[p(Or,{ref_key:"contextRef",ref:c},{default:H(()=>[At(v.$slots,"body",{shown:s(a)},()=>[T(" default body ")])]),_:3},512)]),N("div",Gs,[At(v.$slots,"footer",{shown:s(a)},()=>[N("div",{class:"modal-default-footer"},[Ws,N("button",{class:"button modal-default-button",onClick:l}," Close ")])])])])])],16,Bs),[[ma,e.modelValue]])]),_:3})]))}}),Jt=Symbol("ProxyState");function Je(e,t={}){const n=t;let i=!1;function r(){return i||(Object.assign(n,e.call(n,n)),i=!0),n}return new Proxy(n,{get(a,l){if(l===Jt)return r();const u=r()[l];return u!=null&&typeof u=="object"&&Dt in u?u[Dt]:u},set(a,l,u){return r()[l]=u,!0},has(a,l){return l===Jt?!0:Reflect.has(r(),l)},ownKeys(){return Reflect.ownKeys(r())},getOwnPropertyDescriptor(a,l){return i||(Object.assign(n,e.call(n,n)),i=!0),Object.getOwnPropertyDescriptor(a,l)}})}var Ue=window.state=Gi({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const Qt=Symbol("PersistentState"),tn=Symbol("DefaultValue"),mi=Symbol("StackTrace"),vi=Symbol("Deleted"),Dt=Symbol("NonPersistent"),fn=Symbol("SaveDataPath"),ji=Symbol("SkipPersistence");function Hs(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(`
|
|
`).slice(3,5).map(n=>n.trim()).join(`
|
|
`))!=null?t:""}function vr(e,t){var n;if(o.isNaN(t))throw Ue.hasNaN||(K.autosave=!1,Ue.hasNaN=!0,Ue.NaNPath=e[fn],Ue.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[fn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[Qt].value=t}function dt(e,t=!0){const n=Oe(e)?e:U(e);Oe(e)&&(e=e.value);const i=w({get(){return n.value},set(a){t?vr(r,a):r[Qt].value=a}});i[tn]=e;const r={get value(){return n.value},set value(a){t?vr(r,a):r[Qt].value=a},__v_isRef:!0,[Qt]:n,[tn]:e,[mi]:Hs(),[vi]:!1,[Dt]:i,[fn]:void 0};return ct.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
|
|
Created at:
|
|
`+r[mi]):pn[ct[ct.length-1]].add(r),r}function Zs(e){return e!=null&&typeof e=="object"&&Qt in e}function In(e){return!(Jt in e)&&Dt in e?e[Dt]:new Proxy(e,{get(t,n){if(n!==Qt)return n===ji?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===Qt?!1:n==ji?!0:Reflect.has(t,n)}})}function qr(e){ct.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):pn[ct[ct.length-1]].delete(e),e[vi]=!0}Ye.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[ji]===!0)return;if(Jt in c&&(c=c[Jt]),Zs(c)){if(l=!0,c[vi]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
|
Created at:
|
|
`+c[mi]);return}pn[e.id].delete(c);const d=[e.id,...a,u];c[fn]!=null&&JSON.stringify(d)!==JSON.stringify(c[fn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[fn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[fn]=d;const v=a.reduce((h,g)=>(g in h||(h[g]={}),h[g]),t),f=v[u];v[u]=c[Qt],ha(v)?f!=null?v[u]=f:v[u]=c[tn]:f!=null?v[u].value=f:v[u].value=c[tn]}else!(c instanceof o)&&!Oe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(Rt(c)&&!Rt(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",Jt in r?r[Jt]:r,u):l=!0))}}),l};i(e[Jt]),pn[e.id].forEach(r=>{r[vi]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,`
|
|
Created at:
|
|
`+r[mi])}),pn[e.id].clear()});const Hi=Symbol("RegisterNode"),Zi=Symbol("UnregisterNode"),Xi=Symbol("Nodes"),Yi=Symbol("Bounds"),he=Gi({});window.layers=he;const pn={},ct=[];function Ji(e,t){return Je(()=>{const n={},i=n.emitter=kr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=U({}),n.id=e,ct.push(e),pn[e]=new Set,n.minimized=dt(!1,!1),Object.assign(n,t.call(n,n)),ct[ct.length-1]==null||ct[ct.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
|
|
Stack: ${ct}
|
|
Trying to pop ${n.id}`;ct.pop(),$(n,"color"),$(n,"display"),$(n,"classes"),$(n,"style"),$(n,"name"),se(n,"name",n.id),$(n,"minWidth"),se(n,"minWidth",600),$(n,"minimizable"),se(n,"minimizable",!0),$(n,"minimizedDisplay");const r=n.style;return n.style=w(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Ki(e,t){if(console.info("Adding layer",e.id),he[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,he[e.id]);return}se(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),he[e.id]=e,Ye.emit("addLayer",e,t.layers[e.id])}function Xs(e){return he[e]}function Vr(e){console.info("Removing layer",e.id),Ye.emit("removeLayer",e),he[e.id]=void 0}function Ys(e){Vr(e),Ki(e,K)}function Js(e){const t=U(!1);return{openModal:()=>t.value=!0,modal:J(()=>p(Ht,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(e.display)}))}}Ye.on("update",function(t){Object.values(he).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(he).forEach(n=>{n==null||n.emit("update",t)}),Object.values(he).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Ks=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Hi,UnregisterNodeInjectionKey:Zi,NodesInjectionKey:Xi,BoundsInjectionKey:Yi,layers:he,persistentRefs:pn,addingLayers:ct,createLayer:Ji,addLayer:Ki,getLayer:Xs,removeLayer:Vr,reloadLayer:Ys,setupLayerModal:Js},Symbol.toStringTag,{value:"Module"}));const Qs=Y({components:{Context:Or},props:{index:{type:Number,required:!0},display:{type:O(Object,String,Function),required:!0},minimizedDisplay:O(Object,String,Function),minimized:{type:Object,required:!0},name:{type:O(String),required:!0},color:O(String),minimizable:O(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=Pe(e),a=Fr(t),l=An(r),u=w(()=>me.allowGoBack&&n.value>0&&!$e(i));function c(){K.tabs.splice(s(e.index),1/0)}function d(v){e.nodes.value=v}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:d,unref:s,goBack:c}}}),eo={key:1};function to(e,t,n,i,r,a){const l=Mt("Context");return M(),A("div",{class:"layer-container",style:je({"--layer-color":e.unref(e.color)})},[e.showGoBack?(M(),A("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):z("",!0),e.unref(e.minimized)?(M(),A("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),te(Xe(e.minimizedComponent),{key:0})):(M(),A("div",eo,ce(e.unref(e.name)),1))])):(M(),A("div",{key:2,class:be(["layer-tab",{showGoBack:e.showGoBack}])},[p(l,{onUpdateNodes:e.updateNodes},{default:H(()=>[(M(),te(Xe(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),A("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):z("",!0)],4)}var no=pe(Qs,[["render",to],["__scopeId","data-v-72dd78b1"]]);const Br=e=>(hn("data-v-4b4bda40"),e=e(),bn(),e),io=Br(()=>N("h2",null,"Changelog",-1)),ro=Br(()=>N("details",{open:""},[N("summary",null,[T("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),T(" 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)),ao=Y({__name:"Changelog",setup(e,{expose:t}){const n=U(!1);return t({open(){n.value=!0}}),(i,r)=>(M(),te(Ht,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:H(()=>[io]),body:H(()=>[ro]),_:1},8,["modelValue"]))}});var so=pe(ao,[["__scopeId","data-v-4b4bda40"]]),oo=Y({props:{element:Object,display:{type:O(Object,String,Function),required:!0},style:O(Object,String,Array),classes:O(Object),direction:O(String),xoffset:O(String),yoffset:O(String),pinned:Object},setup(e){const{element:t,display:n,pinned:i}=Pe(e),r=U(!1),a=w(()=>($e(i)||r.value)&&l.value),l=An(n),u=ht(de(J(()=>{const v=$e(t);return v==null?"":kt(v)})));function c(v){const f=i;v.shiftKey&&f&&(f.value=!f.value,v.stopPropagation(),v.preventDefault())}const d=w(()=>$e(i)&&Ct[ue.theme].showPin);return{Direction:G,isHovered:r,isShown:a,comp:l,elementComp:u,unref:s,togglePinned:c,showPin:d}}});const lo={key:0,class:"material-icons pinned"};function uo(e,t,n,i,r,a){return M(),A("div",{class:be(["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))},[At(e.$slots,"default",{},void 0,!0),e.elementComp?(M(),te(Xe(e.elementComp),{key:0})):z("",!0),p(Hn,{name:"fade"},{default:H(()=>{var l;return[e.isShown?(M(),A("div",{key:0,class:be(["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:je([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(l=e.unref(e.style))!=null?l:{}])},[e.showPin?(M(),A("span",lo,"push_pin")):z("",!0),e.comp?(M(),te(Xe(e.comp),{key:1})):z("",!0)],6)):z("",!0)]}),_:1})],34)}var Fe=pe(oo,[["render",uo],["__scopeId","data-v-6102fa3a"]]);const wn=e=>(hn("data-v-4f97aa40"),e=e(),bn(),e),co={class:"info-modal-header"},fo=["src","alt"],po={class:"info-modal-title"},go={key:0},mo={key:0},vo={key:0},ho=wn(()=>N("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),bo=wn(()=>N("br",null,null,-1)),yo=wn(()=>N("br",null,null,-1)),wo=["href"],_o=wn(()=>N("span",{class:"material-icons info-modal-discord"},"discord",-1)),No=wn(()=>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"),T(" The Paper Pilot Community ")])],-1)),Co=wn(()=>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"),T(" The Modding Tree ")])],-1)),ko=wn(()=>N("br",null,null,-1));var Mo=Y({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:i,logo:r,author:a,discordName:l,discordLink:u,versionNumber:c,versionTitle:d}=me,v=Pe(n),f=U(!1),h=w(()=>_i(K.timePlayed)),g=w(()=>de(J(()=>p(re,null,[Ts.map(rt)]))));t({open(){f.value=!0}});function C(){var _;(_=s(v.changelog))==null||_.open()}return(_,I)=>(M(),te(Ht,{modelValue:f.value,"onUpdate:modelValue":I[0]||(I[0]=P=>f.value=P)},{header:H(()=>[N("div",co,[s(r)?(M(),A("img",{key:0,class:"info-modal-logo",src:s(r),alt:s(i)},null,8,fo)):z("",!0),N("div",po,[N("h2",null,ce(s(i)),1),N("h4",null,[T(" v"+ce(s(c)),1),s(d)?(M(),A("span",go,": "+ce(s(d)),1)):z("",!0)])])])]),body:H(({shown:P})=>[P?(M(),A("div",mo,[s(a)?(M(),A("div",vo,"By "+ce(s(a)),1)):z("",!0),ho,bo,N("div",{class:"link",onClick:C},"Changelog"),yo,N("div",null,[s(u)?(M(),A("a",{key:0,href:s(u),class:"info-modal-discord-link",target:"_blank"},[_o,T(" "+ce(s(l)),1)],8,wo)):z("",!0)]),No,Co,ko,N("div",null,"Time Played: "+ce(s(h)),1),(M(),te(Xe(s(g))))])):z("",!0)]),_:1},8,["modelValue"]))}});var So=pe(Mo,[["__scopeId","data-v-4f97aa40"]]);const Io={class:"field"},xo={key:0,class:"field-title"},Qi=Y({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var l;const n=e,i=An(en(n,"title"),"span"),r=U((l=n.options.find(u=>u.value===n.modelValue))!=null?l:null);vt(en(n,"modelValue"),u=>{var c;$e(r)!==u&&(r.value=(c=n.options.find(d=>d.value===u))!=null?c:null)});function a(u){t("update:modelValue",u.value)}return(u,c)=>(M(),A("div",Io,[s(i)?(M(),A("span",xo,[(M(),te(Xe(s(i))))])):z("",!0),p(s(Ca),{options:e.options,modelValue:r.value,"onUpdate:modelValue":[c[0]||(c[0]=d=>r.value=d),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const $o={class:"field"},Eo=Y({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=w(()=>{var a;return de((a=s(n.title))!=null?a:"<span></span>","span")}),r=w({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,l)=>(M(),A("label",$o,[Ui(N("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":l[0]||(l[0]=u=>Oe(r)?r.value=u:null)},null,512),[[ba,s(r)]]),(M(),te(Xe(s(i))))]))}});var jt=pe(Eo,[["__scopeId","data-v-11046116"]]);const Po=["onClick"],To=Y({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=U(!1),i=U(null);function r(){t("click"),i.value&&clearTimeout(i.value),n.value=!1,Gt(()=>{n.value=!0,i.value=setTimeout(()=>n.value=!1,500)})}return(a,l)=>(M(),A("button",{onClick:Tn(r,["stop"]),class:be(["feedback",{activated:n.value,left:e.left}])},[At(a.$slots,"default",{},void 0,!0)],10,Po))}});var Lr=pe(To,[["__scopeId","data-v-01a1b95c"]]);const Do={class:"header"},Ao=N("h2",null,"Settings",-1),Ro={class:"option-tabs"},Fo={key:0},Oo={key:1};var qo=Y({__name:"Options",setup(e,{expose:t}){const n=U(!1),i=U("behaviour");function r(le){return le==i.value}function a(le){i.value=le}t({isTab:r,setTab:a,save:mt,open(){n.value=!0}});const l=Object.keys(Ct).map(le=>({label:tt(le),value:le})),u=w(()=>de(J(()=>p(re,null,[Dr.map(rt)])))),{showTPS:c,theme:d,unthrottled:v,alignUnits:f}=Pe(ue),{autosave:h,offlineProd:g}=Pe(K),C=w({get(){return K.devSpeed===0},set(le){K.devSpeed=le?0:null}}),_=J(()=>p("span",{class:"option-title"},[T("Unthrottled"),p("desc",null,[T("Allow the game to run as fast as possible. Not battery friendly.")])])),I=J(()=>p("span",{class:"option-title"},[T("Offline Production"),p(Fe,{display:"Save-specific",direction:G.Right},{default:()=>[T("*")]}),p("desc",null,[T("Simulate production that occurs while the game is closed.")])])),P=J(()=>p("span",{class:"option-title"},[T("Autosave"),p(Fe,{display:"Save-specific",direction:G.Right},{default:()=>[T("*")]}),p("desc",null,[T("Automatically save the game every second or when the game is closed.")])])),S=J(()=>p("span",{class:"option-title"},[T("Pause game"),p(Fe,{display:"Save-specific",direction:G.Right},{default:()=>[T("*")]}),p("desc",null,[T("Stop everything from moving.")])])),D=J(()=>p("span",{class:"option-title"},[T("Theme"),p("desc",null,[T("How the game looks.")])])),V=J(()=>p("span",{class:"option-title"},[T("Show TPS"),p("desc",null,[T("Show TPS meter at the bottom-left corner of the page.")])])),oe=J(()=>p("span",{class:"option-title"},[T("Align modifier units"),p("desc",null,[T("Align numbers to the beginning of the unit in modifier view.")])]));return(le,Q)=>(M(),te(Ht,{modelValue:n.value,"onUpdate:modelValue":Q[10]||(Q[10]=Z=>n.value=Z)},{header:H(()=>[N("div",Do,[Ao,N("div",Ro,[N("button",{class:be({selected:r("behaviour")}),onClick:Q[0]||(Q[0]=Z=>a("behaviour"))},"Behaviour",2),N("button",{class:be({selected:r("appearance")}),onClick:Q[1]||(Q[1]=Z=>a("appearance"))},"Appearance",2)])])]),body:H(()=>[r("behaviour")?(M(),A("div",Fo,[p(jt,{title:s(_),modelValue:s(v),"onUpdate:modelValue":Q[2]||(Q[2]=Z=>Oe(v)?v.value=Z:null)},null,8,["title","modelValue"]),s(me).enablePausing?(M(),te(jt,{key:0,title:s(S),modelValue:s(C),"onUpdate:modelValue":Q[3]||(Q[3]=Z=>Oe(C)?C.value=Z:null)},null,8,["title","modelValue"])):z("",!0),p(jt,{title:s(I),modelValue:s(g),"onUpdate:modelValue":Q[4]||(Q[4]=Z=>Oe(g)?g.value=Z:null)},null,8,["title","modelValue"]),p(jt,{title:s(P),modelValue:s(h),"onUpdate:modelValue":Q[5]||(Q[5]=Z=>Oe(h)?h.value=Z:null)},null,8,["title","modelValue"]),s(h)?z("",!0):(M(),te(Lr,{key:1,class:"button save-button",onClick:Q[6]||(Q[6]=Z=>s(mt)())},{default:H(()=>[T("Manually save")]),_:1}))])):z("",!0),r("appearance")?(M(),A("div",Oo,[p(Qi,{title:s(D),options:s(l),modelValue:s(d),"onUpdate:modelValue":Q[7]||(Q[7]=Z=>Oe(d)?d.value=Z:null)},null,8,["title","options","modelValue"]),(M(),te(Xe(s(u)))),p(jt,{title:s(V),modelValue:s(c),"onUpdate:modelValue":Q[8]||(Q[8]=Z=>Oe(c)?c.value=Z:null)},null,8,["title","modelValue"]),p(jt,{title:s(oe),modelValue:s(f),"onUpdate:modelValue":Q[9]||(Q[9]=Z=>Oe(f)?f.value=Z:null)},null,8,["title","modelValue"])])):z("",!0)]),_:1},8,["modelValue"]))}});const Vo=["onSubmit"],Bo={class:"field"},Lo={key:0,class:"field-title"},jo=["placeholder"],zo=Y({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,i=An(en(n,"title"),"span"),r=ht(null);yi(()=>{var c;(c=r.value)==null||c.focus()});const a=w({get(){var c;return(c=s(n.modelValue))!=null?c:""},set(c){t("update:modelValue",c)}});function l(){t("submit")}function u(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(c,d)=>(M(),A("form",{onSubmit:Tn(l,["prevent"])},[N("div",Bo,[s(i)?(M(),A("span",Lo,[(M(),te(Xe(s(i))))])):z("",!0),e.textArea?(M(),te(s(Ma),{key:1,modelValue:s(a),"onUpdate:modelValue":d[0]||(d[0]=v=>Oe(a)?a.value=v:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:u,ref_key:"field",ref:r},null,8,["modelValue","placeholder","maxHeight"])):Ui((M(),A("input",{key:2,type:"text","onUpdate:modelValue":d[1]||(d[1]=v=>Oe(a)?a.value=v:null),placeholder:e.placeholder,class:be({fullWidth:!e.title}),onBlur:u,ref_key:"field",ref:r},null,42,jo)),[[ya,s(a)]])])],40,Vo))}});var jr=pe(zo,[["__scopeId","data-v-90bd4994"]]);const Uo={key:0},Go=["onClick","disabled"],Wo={key:0},Ho=["onClick"],Zo=Y({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const i=Pe(e),r=U(!1);vt(r,u=>{t("confirmingChanged",u)});function a(){if(s(i.skipConfirm)){t("click");return}r.value&&t("click"),r.value=!r.value}function l(){r.value=!1}return(u,c)=>(M(),A("span",{class:be(["container",{confirming:r.value}])},[r.value?(M(),A("span",Uo,"Are you sure?")):z("",!0),N("button",{onClick:Tn(a,["stop"]),class:"button danger",disabled:e.disabled},[r.value?(M(),A("span",Wo,"Yes")):At(u.$slots,"default",{key:1},void 0,!0)],8,Go),r.value?(M(),A("button",{key:1,class:"button",onClick:Tn(l,["stop"])},"No",8,Ho)):z("",!0)],2))}});var Xo=pe(Zo,[["__scopeId","data-v-2f8ef34c"]]);const Zt=e=>(hn("data-v-32313015"),e=e(),bn(),e),Yo=Zt(()=>N("div",{class:"handle material-icons"},"drag_handle",-1)),Jo={key:0,class:"actions"},Ko=Zt(()=>N("span",{class:"material-icons"},"content_paste",-1)),Qo=Zt(()=>N("span",{class:"material-icons"},"content_copy",-1)),el=Zt(()=>N("span",{class:"material-icons"},"edit",-1)),tl=Zt(()=>N("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),nl={key:1,class:"actions"},il=Zt(()=>N("span",{class:"material-icons"},"check",-1)),rl=Zt(()=>N("span",{class:"material-icons"},"close",-1)),al={key:2,class:"details"},sl={class:"save-version"},ol=Zt(()=>N("br",null,null,-1)),ll={key:0},ul={key:3,class:"details"},cl={key:4,class:"details error"},dl=Zt(()=>N("br",null,null,-1)),fl=Y({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:i}=Pe(n),r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=U(!1),l=U(!1),u=U("");vt(a,()=>{var f;return u.value=(f=i.value.name)!=null?f:""});const c=w(()=>i.value!=null&&i.value.id===K.id),d=w(()=>{var f;return c.value?K.time:(f=i.value!=null&&i.value.time)!=null?f:0});function v(){t("editName",u.value),a.value=!1}return(f,h)=>(M(),A("div",{class:be(["save",{active:s(c)}])},[Yo,a.value?(M(),A("div",nl,[N("button",{onClick:v,class:"button"},[p(Fe,{display:"Save",direction:s(G).Left,class:"info"},{default:H(()=>[il]),_:1},8,["direction"])]),N("button",{onClick:h[5]||(h[5]=g=>a.value=!a.value),class:"button"},[p(Fe,{display:"Cancel",direction:s(G).Left,class:"info"},{default:H(()=>[rl]),_:1},8,["direction"])])])):(M(),A("div",Jo,[s(i).error==null&&!l.value?(M(),te(Lr,{key:0,onClick:h[0]||(h[0]=g=>t("export")),class:"button",left:""},{default:H(()=>[p(Fe,{display:"Export",direction:s(G).Left,class:"info"},{default:H(()=>[Ko]),_:1},8,["direction"])]),_:1})):z("",!0),s(i).error==null&&!l.value?(M(),A("button",{key:1,onClick:h[1]||(h[1]=g=>t("duplicate")),class:"button"},[p(Fe,{display:"Duplicate",direction:s(G).Left,class:"info"},{default:H(()=>[Qo]),_:1},8,["direction"])])):z("",!0),s(i).error==null&&!l.value?(M(),A("button",{key:2,onClick:h[2]||(h[2]=g=>a.value=!a.value),class:"button"},[p(Fe,{display:"Edit Name",direction:s(G).Left,class:"info"},{default:H(()=>[el]),_:1},8,["direction"])])):z("",!0),p(Xo,{disabled:s(c),onClick:h[3]||(h[3]=g=>t("delete")),onConfirmingChanged:h[4]||(h[4]=g=>l.value=g)},{default:H(()=>[p(Fe,{display:"Delete",direction:s(G).Left,class:"info"},{default:H(()=>[tl]),_:1},8,["direction"])]),_:1},8,["disabled"])])),s(i).error==null&&!a.value?(M(),A("div",al,[N("button",{class:"button open",onClick:h[6]||(h[6]=g=>t("open"))},[N("h3",null,ce(s(i).name),1)]),N("span",sl,"v"+ce(s(i).modVersion),1),ol,s(d)?(M(),A("div",ll,"Last played "+ce(s(r).format(s(d))),1)):z("",!0)])):s(i).error==null&&a.value?(M(),A("div",ul,[p(jr,{modelValue:u.value,"onUpdate:modelValue":h[7]||(h[7]=g=>u.value=g),class:"editname",onSubmit:v},null,8,["modelValue"])])):(M(),A("div",cl,[T(" Error: Failed to load save with id "+ce(s(i).id),1),dl,T(ce(s(i).error),1)]))],2))}});var pl=pe(fl,[["__scopeId","data-v-32313015"]]);const er=e=>(hn("data-v-2a4275be"),e=e(),bn(),e),gl=er(()=>N("h2",null,"Saves Manager",-1)),ml={class:"modal-footer"},vl={class:"field"},hl=er(()=>N("span",{class:"field-title"},"Create Save",-1)),bl={class:"field-buttons"},yl={class:"footer"},wl=er(()=>N("div",{style:{"flex-grow":"1"}},null,-1)),_l=Y({__name:"SavesManager",setup(e,{expose:t}){const n=U(!1),i=U(null);t({open(){n.value=!0}});const r=U(!1),a=U(""),l=U(null);vt(a,S=>{S?Gt(()=>{try{if(S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Kt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S),r.value=!0;return}const D=JSON.parse(S);if(typeof D!="object"){r.value=!0;return}const V=fi();D.id=V,mt(D),a.value="",r.value=!1,ue.saves.push(V)}catch{r.value=!0}}):r.value=!1});let u={},c=U(Object.keys(u).reduce((S,D)=>(S.push({label:D.split("/").slice(-1)[0].slice(0,-4),value:u[D]}),S),[]));const d=Gi({});function v(S){if(d[S]==null){let D=localStorage.getItem(S);if(D==null)d[S]={error:"Save doesn't exist in localStorage",id:S};else if(D==="dW5kZWZpbmVk")d[S]={error:"Save is undefined",id:S};else try{if(D[0]!=="{")if(D[0]==="e")D=decodeURIComponent(escape(atob(D)));else if(D[0]==="\u1BE1")D=Kt.decompressFromUTF16(D);else return console.warn("Unable to determine preset encoding",D),r.value=!0,d[S]={error:"Unable to determine preset encoding",id:S},d[S];d[S]={...JSON.parse(D),id:S}}catch(V){d[S]={error:V,id:S},console.warn(`SavesManager: Failed to load info about save with id ${S}:
|
|
${V}
|
|
${D}`)}}return d[S]}vt(n,S=>{S&&Object.keys(d).forEach(D=>delete d[D])});const f=w(()=>ue.saves.reduce((S,D)=>(S[D]=v(D),S),{}));function h(S){let D;switch(K.id===S?D=Pr(K):D=JSON.stringify(f.value[S]),me.exportEncoding){default:console.warn(`Unknown save encoding: ${me.exportEncoding}. Defaulting to lz`);case"lz":D=Kt.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const V=document.createElement("textarea");V.value=D,document.body.appendChild(V),V.select(),V.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(V)}function g(S){K.id===S&&mt();const D={...f.value[S],id:fi()};mt(D),ue.saves.push(D.id)}function C(S){ue.saves=ue.saves.filter(D=>D!==S),localStorage.removeItem(S),d[S]=void 0}function _(S){f.value[K.id].time=K.time,mt(),d[K.id]=void 0,dn(f.value[S]),d[S]=void 0}function I(S){if(l.value=S,Gt(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Kt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const D=JSON.parse(S);D.id=fi(),mt(D),ue.saves.push(D.id),_(D.id)}function P(S,D){const V=f.value[S];V!=null&&(V.name=D,K.id===S?(K.name=D,mt()):(mt(V),d[S]=void 0))}return(S,D)=>(M(),te(Ht,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=V=>n.value=V),ref_key:"modal",ref:i},{header:H(()=>[gl]),body:H(({shown:V})=>[V?(M(),te(s(ka),{key:0,list:s(ue).saves,handle:".handle",itemKey:oe=>oe},{item:H(({element:oe})=>[p(pl,{save:s(f)[oe],onOpen:le=>_(oe),onExport:le=>h(oe),onEditName:le=>P(oe,le),onDuplicate:le=>g(oe),onDelete:le=>C(oe)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):z("",!0)]),footer:H(()=>[N("div",ml,[p(jr,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=V=>a.value=V),title:"Import Save",placeholder:"Paste your save here!",class:be({importingFailed:r.value})},null,8,["modelValue","class"]),N("div",vl,[hl,N("div",bl,[N("button",{class:"button",onClick:D[1]||(D[1]=V=>_(s(Pn)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),te(Qi,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":D[2]||(D[2]=V=>I(V)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):z("",!0)])]),N("div",yl,[wl,N("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=V=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zr=pe(_l,[["__scopeId","data-v-2a4275be"]]);const wt=e=>(hn("data-v-318a1c31"),e=e(),bn(),e),Nl=["src","alt"],Cl={key:1,class:"title"},kl=wt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Ml={class:"discord"},Sl={class:"discord-links"},Il={key:0},xl=["href"],$l=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),El=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Pl={href:"https://forums.moddingtree.com/",target:"_blank"},Tl=wt(()=>N("span",{class:"material-icons"},"forum",-1)),Dl=wt(()=>N("span",{class:"material-icons"},"info",-1)),Al=wt(()=>N("span",{class:"material-icons"},"library_books",-1)),Rl=wt(()=>N("span",{class:"material-icons"},"settings",-1)),Fl=wt(()=>N("span",{class:"material-icons"},"library_books",-1)),Ol=wt(()=>N("span",{class:"material-icons"},"settings",-1)),ql=wt(()=>N("span",{class:"material-icons"},"info",-1)),Vl={href:"https://forums.moddingtree.com/",target:"_blank"},Bl=wt(()=>N("span",{class:"material-icons"},"forum",-1)),Ll={class:"discord"},jl={class:"discord-links"},zl={key:0},Ul=["href"],Gl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Wl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Hl=Y({__name:"Nav",setup(e){const t=U(null),n=U(null),i=U(null),r=U(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:d,versionNumber:v}=me;function f(){window.open(d,"mywindow")}return(h,g)=>(M(),A(re,null,[s(a)?(M(),A("div",Wt({key:0,class:"nav"},h.$attrs),[s(l)?(M(),A("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,Nl)):(M(),A("div",Cl,ce(s(u)),1)),N("div",{onClick:g[0]||(g[0]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(Fe,{display:"Changelog",direction:s(G).Down,class:"version"},{default:H(()=>[N("span",null,"v"+ce(s(v)),1)]),_:1},8,["direction"])]),kl,N("div",Ml,[N("span",{onClick:f,class:"material-icons"},"discord"),N("ul",Sl,[s(d)?(M(),A("li",Il,[N("a",{href:s(d),target:"_blank"},ce(s(c)),9,xl)])):z("",!0),$l,El])]),N("div",null,[N("a",Pl,[p(Fe,{display:"Forums",direction:s(G).Down,yoffset:"5px"},{default:H(()=>[Tl]),_:1},8,["direction"])])]),N("div",{onClick:g[1]||(g[1]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(Fe,{display:"Info",direction:s(G).Down,class:"info"},{default:H(()=>[Dl]),_:1},8,["direction"])]),N("div",{onClick:g[2]||(g[2]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(Fe,{display:"Saves",direction:s(G).Down,xoffset:"-20px"},{default:H(()=>[Al]),_:1},8,["direction"])]),N("div",{onClick:g[3]||(g[3]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(Fe,{display:"Settings",direction:s(G).Down,xoffset:"-66px"},{default:H(()=>[Rl]),_:1},8,["direction"])])],16)):(M(),A("div",Wt({key:1,class:"overlay-nav"},h.$attrs),[N("div",{onClick:g[4]||(g[4]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(Fe,{display:"Changelog",direction:s(G).Right,xoffset:"25%",class:"version"},{default:H(()=>[N("span",null,"v"+ce(s(v)),1)]),_:1},8,["direction"])]),N("div",{onClick:g[5]||(g[5]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(Fe,{display:"Saves",direction:s(G).Right},{default:H(()=>[Fl]),_:1},8,["direction"])]),N("div",{onClick:g[6]||(g[6]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(Fe,{display:"Settings",direction:s(G).Right},{default:H(()=>[Ol]),_:1},8,["direction"])]),N("div",{onClick:g[7]||(g[7]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(Fe,{display:"Info",direction:s(G).Right},{default:H(()=>[ql]),_:1},8,["direction"])]),N("div",null,[N("a",Vl,[p(Fe,{display:"Forums",direction:s(G).Right,xoffset:"7px"},{default:H(()=>[Bl]),_:1},8,["direction"])])]),N("div",Ll,[N("span",{onClick:f,class:"material-icons"},"discord"),N("ul",jl,[s(d)?(M(),A("li",zl,[N("a",{href:s(d),target:"_blank"},ce(s(c)),9,Ul)])):z("",!0),Gl,Wl])])],16)),p(So,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(zr,{ref_key:"savesManager",ref:n},null,512),p(qo,{ref_key:"options",ref:i},null,512),p(so,{ref_key:"changelog",ref:r},null,512)],64))}});var Ur=pe(Hl,[["__scopeId","data-v-318a1c31"]]);const Zl={class:"inner-tab"},Xl=Y({__name:"Game",setup(e){const t=en(K,"tabs"),n=w(()=>Object.keys(he)),i=me.useHeader;function r(a){const{display:l,minimized:u,name:c,color:d,minimizable:v,nodes:f,minimizedDisplay:h}=a;return{display:l,minimized:u,name:c,color:d,minimizable:v,nodes:f,minimizedDisplay:h}}return(a,l)=>(M(),A("div",{class:be(["tabs-container",{useHeader:s(i)}])},[(M(!0),A(re,null,Dn(s(t),(u,c)=>{var d,v;return M(),A("div",{key:c,class:be(["tab",s((d=s(he)[u])==null?void 0:d.classes)]),style:je(s((v=s(he)[u])==null?void 0:v.style))},[c===0&&!s(i)?(M(),te(Ur,{key:0})):z("",!0),N("div",Zl,[s(n).includes(u)?(M(),te(no,Wt({key:0},r(s(he)[u]),{index:c,onSetMinimized:f=>s(he)[u].minimized.value=f}),null,16,["index","onSetMinimized"])):(M(),te(Xe(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Yl=pe(Xl,[["__scopeId","data-v-dcd207b4"]]);const Jl=Y({__name:"Sticky",setup(e){const t=U("0"),n=new ResizeObserver(r),i=ht(null);function r(){let a=i.value;if(a==null)return;let l=0;for(;a.previousSibling;){const u=a.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),a=u}t.value=l+"px"}return Gt(r),document.fonts.ready.then(r),yi(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(M(),A("div",{class:"sticky",style:je({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[At(a.$slots,"default",{},void 0,!0)],4))}});var hi=pe(Jl,[["__scopeId","data-v-cccac690"]]);const Kl=["x1","y1","x2","y2"],Ql=Y({__name:"BoardLink",props:{link:null},setup(e){const n=Pe(e),i=w(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=w(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,l)=>(M(),A("line",Wt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Kl))}});var eu=pe(Ql,[["__scopeId","data-v-57c4970a"]]);const tu={key:0},nu=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],iu=["fill","stroke-width","stroke"],ru=["fill"],au=Y({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Pe(e),r=w(()=>ge(i.nodeType.value.size,s(i.node))),a=w(()=>{var v;return(v=ge(i.nodeType.value.outlineColor,s(i.node)))!=null?v:Ct[ue.theme].variables["--outline"]}),l=w(()=>{var v;return(v=ge(i.nodeType.value.titleColor,s(i.node)))!=null?v:Ct[ue.theme].variables["--foreground"]}),u=w(()=>ge(i.nodeType.value.actionDistance,s(i.node)));function c(v,f){t("clickAction",f.id),v.preventDefault(),v.stopPropagation()}function d(v,f){var h;((h=s(i.selectedAction))==null?void 0:h.id)===f.id&&(v.preventDefault(),v.stopPropagation())}return(v,f)=>(M(),te(Hn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(M(),A("g",tu,[(M(!0),A(re,null,Dn(e.actions,(h,g)=>{var C,_;return M(),A("g",{key:h.id,class:be(["action",{selected:((C=e.selectedAction)==null?void 0:C.id)===h.id}]),transform:`translate(
|
|
${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-g)*s(u))},
|
|
${(s(r)+30)*Math.cos(((e.actions.length-1)/2-g)*s(u))}
|
|
)`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:Tn(I=>d(I,h),["stop"])},[N("circle",{fill:s(ge)(h.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===h.id?4:0,stroke:s(a)},null,8,iu),N("text",{fill:s(l),class:"material-icons"},ce(s(ge)(h.icon,e.node)),9,ru)],42,nu)}),128))])):z("",!0)]),_:1}))}});var su=pe(au,[["__scopeId","data-v-9efb2a56"]]);const ou=["transform"],lu={key:0},uu=["r","fill","stroke"],cu=["r","fill","stroke"],du=["r","fill"],fu=["r","stroke-dasharray","stroke-dashoffset","stroke"],pu={key:1,transform:"rotate(45, 0, 0)"},gu=["width","height","transform","fill","stroke"],mu=["width","height","transform","fill","stroke"],vu=["width","height","transform","fill"],hu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],bu=["fill","y"],yu=["fill"],wu={key:0},_u=["fill","y"],Nu=["fill","y"],Cu=Y({__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,i=Math.sqrt(2),r=Pe(n),a=w(()=>ge(r.nodeType.value.draggable,s(r.node)));vt(a,B=>{const ae=s(r.node);s(r.dragging)===ae&&!B&&t("endDragging",ae)});const l=w(()=>{var ae;const B=s(r.node);return(ae=ge(r.nodeType.value.actions,B))==null?void 0:ae.filter(Te=>Ge(ge(Te.visibility,B)))}),u=w(()=>{var ae;const B=s(r.node);if(ge(r.nodeType.value.draggable,B)&&((ae=s(r.dragging))==null?void 0:ae.id)===B.id&&s(r.dragged)!=null){const{x:Te,y:He}=s(r.dragged);return{x:B.position.x+Math.round(Te/25)*25,y:B.position.y+Math.round(He/25)*25}}return B.position}),c=w(()=>ge(r.nodeType.value.shape,s(r.node))),d=w(()=>ge(r.nodeType.value.title,s(r.node))),v=w(()=>ge(r.nodeType.value.subtitle,s(r.node))),f=w(()=>{var B;return(B=r.isSelected.value?s(r.selectedAction)&&ge(s(r.selectedAction).tooltip,s(r.node)):null)!=null?B:ge(r.nodeType.value.label,s(r.node))}),h=w(()=>{var B,ae;return ge((ae=(B=s(r.selectedAction))==null?void 0:B.confirmationLabel)!=null?ae:{text:"Tap again to confirm"},s(r.node))}),g=w(()=>ge(r.nodeType.value.size,s(r.node))),C=w(()=>{var B;return(B=ge(r.nodeType.value.progress,s(r.node)))!=null?B:0}),_=w(()=>Ct[ue.theme].variables["--background"]),I=w(()=>{var B;return(B=ge(r.nodeType.value.outlineColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--outline"]}),P=w(()=>{var B;return(B=ge(r.nodeType.value.fillColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--raised-background"]}),S=w(()=>ge(r.nodeType.value.progressColor,s(r.node))),D=w(()=>{var B;return(B=ge(r.nodeType.value.titleColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--foreground"]}),V=w(()=>ge(r.nodeType.value.progressDisplay,s(r.node))),oe=w(()=>r.dragging.value!=null&&s(r.hasDragged)&&ge(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),le=w(()=>ge(r.nodeType.value.style,s(r.node))),Q=w(()=>ge(r.nodeType.value.classes,s(r.node)));function Z(B){t("mouseDown",B,r.node.value,a.value)}function fe(B){var ae,Te,He;(ae=r.hasDragged)!=null&&ae.value||(t("endDragging",r.node.value),(He=(Te=r.nodeType.value).onClick)==null||He.call(Te,r.node.value),B.stopPropagation())}return(B,ae)=>{var Te,He,Xt;return M(),A("g",{class:be(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(Q)}]),style:je([{opacity:((Te=e.dragging)==null?void 0:Te.id)===e.node.id&&e.hasDragged?.5:1},(He=s(le))!=null?He:[]]),transform:`translate(${s(u).x},${s(u).y})${e.isSelected?" scale(1.2)":""}`},[p(su,{actions:(Xt=s(l))!=null?Xt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ae[0]||(ae[0]=at=>t("clickAction",at))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:Z,onTouchstartPassive:Z,onMouseup:fe,onTouchendPassive:fe},[s(c)===s(We).Circle?(M(),A("g",lu,[s(oe)?(M(),A("circle",{key:0,class:"receiver",r:s(g)+8,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,uu)):z("",!0),N("circle",{class:"body",r:s(g),fill:s(P),stroke:s(I),"stroke-width":4},null,8,cu),s(V)===s(vn).Fill?(M(),A("circle",{key:1,class:"progress progressFill",r:Math.max(s(g)*s(C)-2,0),fill:s(S)},null,8,du)):(M(),A("circle",{key:2,r:s(g)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(g)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(g)+4.5)*2*Math.PI-s(C)*(s(g)+4.5)*2*Math.PI,stroke:s(S)},null,8,fu))])):s(c)===s(We).Diamond?(M(),A("g",pu,[s(oe)?(M(),A("rect",{key:0,class:"receiver",width:s(g)*s(i)+16,height:s(g)*s(i)+16,transform:`translate(${-(s(g)*s(i)+16)/2}, ${-(s(g)*s(i)+16)/2})`,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,gu)):z("",!0),N("rect",{class:"body",width:s(g)*s(i),height:s(g)*s(i),transform:`translate(${-s(g)*s(i)/2}, ${-s(g)*s(i)/2})`,fill:s(P),stroke:s(I),"stroke-width":4},null,8,mu),s(V)===s(vn).Fill?(M(),A("rect",{key:1,class:"progress progressFill",width:Math.max(s(g)*s(i)*s(C)-2,0),height:Math.max(s(g)*s(i)*s(C)-2,0),transform:`translate(${-Math.max(s(g)*s(i)*s(C)-2,0)/2}, ${-Math.max(s(g)*s(i)*s(C)-2,0)/2})`,fill:s(S)},null,8,vu)):(M(),A("rect",{key:2,class:"progress progressDiamond",width:s(g)*s(i)+9,height:s(g)*s(i)+9,transform:`translate(${-(s(g)*s(i)+9)/2}, ${-(s(g)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(g)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(g)*s(i)+9)*4-s(C)*(s(g)*s(i)+9)*4,stroke:s(S)},null,8,hu))])):z("",!0),N("text",{fill:s(D),class:"node-title",y:s(v)?10:0},ce(s(d)),9,bu),s(v)?(M(),A("text",{key:2,fill:s(D),class:"node-subtitle",y:"-15"},ce(s(v)),9,yu)):z("",!0)],32),p(Hn,{name:"fade",appear:""},{default:H(()=>{var at;return[s(f)?(M(),A("g",wu,[N("text",{fill:(at=s(f).color)!=null?at:s(D),class:be(["node-title",{pulsing:s(f).pulsing}]),y:-s(g)-20},ce(s(f).text),11,_u)])):z("",!0)]}),_:1}),p(Hn,{name:"fade",appear:""},{default:H(()=>{var at;return[e.isSelected&&e.selectedAction?(M(),A("text",{key:0,fill:(at=s(h).color)!=null?at:s(D),class:be(["node-title",{pulsing:s(h).pulsing}]),y:s(g)+75},ce(s(h).text),11,Nu)):z("",!0)]}),_:1})],14,ou)}}});var ku=pe(Cu,[["__scopeId","data-v-518d7a7f"]]);const Mu={class:"stage",width:"100%",height:"100%"},Su={class:"g1"},Iu=Y({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Pe(e),i=U({x:0,y:0}),r=U({x:0,y:0}),a=U(!1),l=U(null),u=w(()=>{const g=n.nodes.value.slice();if(n.selectedNode.value){const C=g.splice(g.indexOf(n.selectedNode.value),1)[0];g.push(C)}if(n.draggingNode.value){const C=g.splice(g.indexOf(n.draggingNode.value),1)[0];g.push(C)}return g});It(()=>{const g=n.draggingNode.value;if(g==null)return null;const C={x:g.position.x+r.value.x,y:g.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,P)=>{if(P.id===g.id)return I;const S=n.types.value[P.type];if(!ge(S.canAccept,P,g))return I;const V=Math.pow(C.x-P.position.x,2)+Math.pow(C.y-P.position.y,2);let oe=ge(S.size,P);return V>_||V>oe*oe?I:(_=V,P)},null))});function c(g){g.setTransformOrigin(null),g.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(g,C=null,_=!1){if(n.draggingNode.value==null){g.preventDefault(),g.stopPropagation();let I,P;if("touches"in g)if(g.touches.length===1)I=g.touches[0].clientX,P=g.touches[0].clientY;else return;else I=g.clientX,P=g.clientY;i.value={x:I,y:P},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(C)}C!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(g){const{x:C,y:_,scale:I}=l.value.panZoomInstance.getTransform();let P,S;if("touches"in g)if(g.touches.length===1)P=g.touches[0].clientX,S=g.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else P=g.clientX,S=g.clientY;n.mousePosition.value={x:(P-C)/I,y:(S-_)/I},r.value={x:r.value.x+(P-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:P,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(g.preventDefault(),g.stopPropagation())}function f(g,C=!1){var _,I;if(n.draggingNode.value!=null&&n.draggingNode.value===g){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const P=n.nodes.value;P.push(P.splice(P.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!C&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(g,C){n.state.value.selectedAction===C?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:C}}return(g,C)=>{const _=Mt("panZoom");return s(Ge)(e.visibility)?(M(),te(_,{key:0,style:je([{width:e.width,height:e.height},e.style]),class:be(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:v,onTouchmove:v,onMousedown:C[0]||(C[0]=I=>d(I)),onTouchstart:C[1]||(C[1]=I=>d(I)),onMouseup:C[2]||(C[2]=()=>f(s(e.draggingNode))),onTouchendPassive:C[3]||(C[3]=()=>f(s(e.draggingNode))),onMouseleave:C[4]||(C[4]=()=>f(s(e.draggingNode),!0))},{default:H(()=>[(M(),A("svg",Mu,[N("g",Su,[p(lr,{name:"link",appear:""},{default:H(()=>[(M(!0),A(re,null,Dn(s(e.links)||[],I=>(M(),A("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(eu,{link:I},null,8,["link"])]))),128))]),_:1}),p(lr,{name:"grow",duration:500,appear:""},{default:H(()=>[(M(!0),A(re,null,Dn(s(u),I=>(M(),A("g",{key:I.id,style:{"transition-duration":"0s"}},[p(ku,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:s(e.draggingNode)==null?!1:a.value,receivingNode:s(e.receivingNode)===I,isSelected:s(e.selectedNode)===I,selectedAction:s(e.selectedNode)===I?s(e.selectedAction):null,onMouseDown:d,onEndDragging:f,onClickAction:P=>h(I,P)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):z("",!0)}}});Ye.on("setupVue",e=>Sa.install(e));const Gr=Symbol("Board");var vn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(vn||{}),We=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(We||{});function xu(e){const t=dt({nodes:[],selectedNode:null,selectedAction:null},!1);return Je(n=>{const i=e.call(n,n);i.id=nn("board-"),i.type=Gr,i[yt]=Iu,i.state?(qr(t),$(i,"state")):(t[tn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=w(()=>s(l.state).nodes),i.selectedNode=w({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;Oe(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=w({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;Oe(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=U(null),i.links?$(i,"links"):i.links=w(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?ge(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=U(null),i.receivingNode=U(null),$(i,"visibility"),se(i,"visibility",Ce.Visible),$(i,"width"),se(i,"width","100%"),$(i,"height"),se(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),se(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),se(c,"draggable",!1),$(c,"shape"),se(c,"shape","Circle"),$(c,"canAccept"),se(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),se(c,"progressDisplay","Fill"),$(c,"progressColor"),se(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),se(c,"actionDistance",Math.PI/6),c.nodes=w(()=>s(l.state).nodes.filter(d=>d.type===u)),se(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),se(d,"visibility",Ce.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),se(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=G.Right){const v=l.nodes.value.slice().filter(f=>f===u||(d===G.Down||d===G.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===G.Left||d===G.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===G.Right&&f.position.x<u.position.x-c||d===G.Left&&f.position.x>u.position.x+c||d===G.Up&&f.position.y>u.position.y+c||d===G.Down&&f.position.y<u.position.y-c)).sort(d===G.Right?(f,h)=>f.position.x-h.position.x:d===G.Left?(f,h)=>h.position.x-f.position.x:d===G.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f<v.length;f++){const h=v[f],g=d===G.Right||d===G.Left?Math.abs(u.position.x-h.position.x):Math.abs(u.position.y-h.position.y);if(g<c)d===G.Right?u.position.x=h.position.x+c:d===G.Left?u.position.x=h.position.x-c:d===G.Up?u.position.y=h.position.y-c:d===G.Down&&(u.position.y=h.position.y+c);else if(f>0&&g>c)break}},i[pt]=function(){const{nodes:u,types:c,state:d,visibility:v,width:f,height:h,style:g,classes:C,links:_,selectedAction:I,selectedNode:P,mousePosition:S,draggingNode:D,receivingNode:V}=this;return{nodes:u,types:c,state:d,visibility:v,width:f,height:h,style:s(g),classes:C,links:_,selectedAction:I,selectedNode:P,mousePosition:S,draggingNode:D,receivingNode:V,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function ge(e,t,...n){return Xn(e)?e(t,...n):s(e)}function Qn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Un={};Ye.on("addLayer",e=>{const t=Jn(e,Gr);Un[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});Ye.on("removeLayer",e=>{var t;(t=Un[e.id])==null||t.call(Un),Un[e.id]=void 0});function $n(e,t="points",n=0,i=void 0){const r=Oe(e)?e:dt(e);if(r.displayName=t,r.precision=n,r.small=i,!Oe(e)){const a=r[Dt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function bi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?ft(e.small?n:o.floor(n)):Me(n,e.precision,e.small)}Ye.on("setupVue",e=>e.use(Ia));function $u(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 Eu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:{type:O(Object,String,Function),required:!0},style:O(String,Object,Array),classes:O(Object),glowColor:O(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Pe(e),a=Fr(n),l=w(()=>{const c=$e(i);return c==null||c===""?{}:s(r)?$u(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Pu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(M(),A("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:be(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(M(),te(Xe(e.component)))],6)):z("",!0)}var Wr=pe(Eu,[["render",Pu],["__scopeId","data-v-21427abb"]]);const Tu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},activeTab:{type:O(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:O(Object),required:!0},style:O(String,Object,Array),classes:O(Object),buttonContainerStyle:O(String,Object,Array),buttonContainerClasses:O(Object)},components:{Sticky:hi,TabButton:Wr},setup(e){const{activeTab:t}=Pe(e),n=w(()=>Ct[ue.theme].floatingTabs),i=ht("");It(()=>{const u=$e(t);if(u==null){i.value="";return}if(xt(u)){i.value=de(u);return}i.value=de(s(u.display))});const r=w(()=>{const u=$e(t);return xt(u)||!u?void 0:s(u.classes)}),a=w(()=>{const u=$e(t);return xt(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:v,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:v,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:Ce,component:i,gatherButtonProps:l,unref:s,isVisible:Ge,isHidden:yn}}});function Du(e,t,n,i,r,a){var c,d;const l=Mt("TabButton"),u=Mt("Sticky");return e.isVisible(e.visibility)?(M(),A("div",{key:0,class:be(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:be(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:je(e.unref(e.buttonContainerStyle))},{default:H(()=>[N("div",{class:be(["tab-buttons",{floating:e.floating}])},[(M(!0),A(re,null,Dn(e.unref(e.tabs),(v,f)=>(M(),te(l,Wt({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(v.tab)===e.unref(e.activeTab)},e.gatherButtonProps(v)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),te(Xe(e.unref(e.component)),{key:0})):z("",!0)],6)):z("",!0)}var Au=pe(Tu,[["render",Du],["__scopeId","data-v-58dbf83a"]]);const Ru=Symbol("TabButton"),Fu=Symbol("TabFamily");function Ou(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=dt(Object.keys(e)[0],!1);return Je(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=nn("tabFamily-"),r.type=Fu,r[yt]=Au,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=Ru,d[yt]=Wr,$(d,"visibility"),se(d,"visibility",Ce.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=w(()=>{const u=s(a.tabs);if(n.value in u&&Ge(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(d=>Ge(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[pt]=function(){const{visibility:u,activeTab:c,selected:d,tabs:v,style:f,classes:h,buttonContainerClasses:g,buttonContainerStyle:C}=this;return{visibility:u,activeTab:c,selected:d,tabs:v,style:s(f),classes:h,buttonContainerClasses:g,buttonContainerStyle:C}};const a=r;return a})}const Hr=o.ln(10);function Gn(e){return e}function qu(e,t){if(R(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Vu(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Bu(e){return m.neg(e)}function Lu(e,t,n){if(R(t))return t.invert(o.sub(e,ke(n)));if(R(n))return n.invert(o.sub(e,ke(t)));throw new Error("Could not invert due to no input being a variable")}function ju(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function zu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t,n){if(R(t))return t.invert(o.add(e,ke(n)));if(R(n))return n.invert(o.sub(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Wu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Hu(e,t,n){if(R(t))return t.invert(o.div(e,ke(n)));if(R(n))return n.invert(o.div(e,ke(t)));throw new Error("Could not invert due to no input being a variable")}function Zu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Xu(e,t,n){if(R(t))return m.div(e,n);if(R(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Yu(e,t,n){if(R(t))return t.invert(o.mul(e,ke(n)));if(R(n))return n.invert(o.div(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Ju(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Ku(e,t,n){if(R(t))return m.mul(e,n);if(R(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Qu(e,t){if(R(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function ec(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t){if(R(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function nc(e){return o.ln(e).sub(1).times(e).div(Hr)}function ic(e,t){if(R(t)){const n=Hr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function rc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:nc,invert:ic})}throw new Error("Could not integrate due to no input being a variable")}function ac(e,t,n){if(R(t))return t.invert(o.pow(ke(n),e));if(R(n))return n.invert(o.root(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function sc(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function oc(e,t,n){if(R(t)){const i=o.ln(ke(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function lc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:sc,invert:oc})}throw new Error("Could not integrate due to no input being a variable")}function uc(e,t){if(R(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function cc(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function dc(e,t){if(R(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function fc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:cc,invert:dc})}throw new Error("Could not integrate due to no input being a variable")}function pc(e,t){if(R(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function gc(e){return o.ln(e).sub(1).times(e)}function mc(e,t){if(R(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function vc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:gc,invert:mc})}throw new Error("Could not integrate due to no input being a variable")}function hc(e,t,n){if(R(t))return t.invert(o.root(e,ke(n)));if(R(n))return n.invert(o.ln(e).div(o.ln(ke(t))));throw new Error("Could not invert due to no input being a variable")}function bc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function yc(e,t){if(R(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function wc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function _c(e,t,n){if(R(t))return t.invert(o.ln(e).div(o.ln(ke(n))));if(R(n))return n.invert(o.root(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Nc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Cc(e,t,n){if(R(t))return t.invert(o.root(e,o.recip(ke(n))));if(R(n))return n.invert(o.ln(ke(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function kc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Mc(e,t){if(R(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function Sc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Ic(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function xc(e,t,n,i){if(R(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function $c(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function Ec(e,t,n,i){if(R(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,ke(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Pc(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function Tc(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function Dc(e,t,n){if(R(t))return t.invert(o.tetrate(e,o.minabs(1e308,ke(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ac(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Rc(e,t,n,i){if(R(t))return t.invert(o.layeradd(e,o.minabs(1e308,ke(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Fc(e,t){if(R(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Oc(e,t){if(R(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function qc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Vc(e,t){if(R(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Bc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Lc(e,t){if(R(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function jc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function zc(e,t){if(R(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Uc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Gc(e,t){if(R(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Wc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Hc(e,t){if(R(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function Zc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Xc(e,t){if(R(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Yc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Jc(e,t){if(R(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Kc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Qc(e,t){if(R(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function ed(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function td(e,t){if(R(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function nd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function id(e,t){if(R(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function rd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function ad(e,t){if(R(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function sd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function od(e,t){if(R(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function ld(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Rn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:Gn})}function R(e){return e instanceof Ee&&e.hasVariable()}function ke(e,t){return e instanceof Ee?e.evaluate(t):s(e)}function ud(){return m.pow(this,2).div(2)}function cd(){return this}const qe=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"&&Dt in n?n[Dt]:n)),"variable"in e?(typeof e.variable=="object"&&Dt in e.variable&&(e.variable=e.variable[Dt]),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:ud,internalIntegrateInner:cd,applySubstitution:Gn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var h,g;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((C,_)=>C+(_ instanceof qe?_.internalVariables:0),0),c=t.find(C=>C instanceof qe&&C.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,v=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(g=c==null?void 0:c.isIntegrable())!=null?g:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>ke(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:ke(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof qe&&e.inputs[n]instanceof qe?t.equals(e.inputs[n]):!(t instanceof qe)&&!(e.inputs[n]instanceof qe)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=n(m.variable(0)),r=ve(t);function a(u){return o.lt(u,s(r))?u:o.add(i.evaluate(o.sub(u,s(r))),s(r))}function l(u,c){if(R(c)&&i.isInvertible())return o.gt(u,s(r))&&(u=o.add(i.invert(o.sub(u,s(r))),s(r))),c.invert(u);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:a,invert:i.isInvertible()&&i.hasVariable()?l:void 0})}static if(e,t,n,i){const r=U(0),a=m.variable(r),l=n(a),u=i==null?void 0:i(a),c=ve(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function v(f,h){if(!R(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new m({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?v:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:qu,applySubstitution:Bu,integrate:Vu})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:Lu,integrate:ju,integrateInner:zu,applySubstitution:Gn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Uu,integrate:Gu,integrateInner:Wu,applySubstitution:Gn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:Hu,integrate:Zu,applySubstitution:Xu})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:Yu,integrate:Ju,applySubstitution:Ku})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Qu,integrate:ec})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:Gn})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:tc,integrate:rc})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:ac,integrate:lc})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:uc,integrate:fc})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:pc,integrate:vc})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:hc,integrate:bc})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:yc,integrate:wc})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:_c,integrate:Nc})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:Cc,integrate:kc})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:Mc,integrate:Sc})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Ic,invert:xc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:$c,invert:Ec})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Pc})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:Tc,invert:Dc})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:Ac,invert:Rc})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Fc})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Oc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:qc})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Gc,integrate:Bc})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:Hc,integrate:jc})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Xc,integrate:Uc})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:Vc,integrate:Wc})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Lc,integrate:Zc})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:zc,integrate:Yc})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:id,integrate:Kc})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:ad,integrate:ed})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:od,integrate:nd})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Jc,integrate:rd})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Qc,integrate:sd})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:td,integrate:ld})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Ee=qe;Ee.negate=qe.neg;Ee.negated=qe.neg;Ee.sgn=qe.sign;Ee.plus=qe.add;Ee.subtract=qe.sub;Ee.minus=qe.sub;Ee.multiply=qe.mul;Ee.times=qe.mul;Ee.divide=qe.div;Ee.divideBy=qe.div;Ee.dividedBy=qe.div;Ee.reciprocal=qe.recip;Ee.reciprocate=qe.recip;Ee.max=Rn(o.max);Ee.min=Rn(o.min);Ee.minabs=Rn(o.minabs);Ee.maxabs=Rn(o.maxabs);Ee.clampMin=Rn(o.clampMin);Ee.clampMax=Rn(o.clampMax);Ee.logarithm=qe.log;class m extends Ee{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Zr(e,t,n=!0,i,r=o.dInf){const a=ve(n),l=ve(i),u=ve(r);return w(()=>{var h,g,C,_;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),v=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,v)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((g=s(e.innermostVariable))!=null?g:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),v>0){f=o.sub(f,v).clampMin(0);let I;for(d?I=gn(e,f,!0,0):I=e.evaluate(o.add((C=s(e.innermostVariable))!=null?C:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER)&&o.add(v,1).gte(f);){const P=e.evaluate(f.add((_=s(e.innermostVariable))!=null?_:0));if(o.add(I,P).lte(t.value))f=f.add(1),I=o.add(I,P);else break}}return f})}function gn(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)))}else if(u=e.evaluate(a),a=a.add(1),l.gt(1e308))return o.sub(l,a).add(1).times(u)}for(let d=a.toNumber();d<l.toNumber();d++)u=o.add(u,e.evaluate(d));return u}function zt(e){return Je(t=>{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>m.add(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[kt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",Ut(s(l))])]))}})}function we(e){return Je(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>m.times(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[kt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[T("\xD7"),Ut(s(l))])]))}})}function dd(e){return Je(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=ve(n),c=ve(i),d=r==null?void 0:ve(r);return{apply:v=>{let f=v;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:v=>{let f=v;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:v=>a?m.add(v,1).pow(u).sub(1):m.pow(v,u),enabled:d,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[kt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[T("^"),Ut(s(u))])]))}})}function _t(e){return Je(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?w(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?J(()=>p(re,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(kt)])):void 0}})}const zi=m.variable(0).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).step(o.pow(1500,1.5).pow(1.5).add(o.pow(900,1.5).add(100)),e=>e.pow(2)).pow(1.5),rn={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:[]}),y.board.selectedAction.value=null,y.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}},Ft={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${ft(y.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},y.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function _n(e,t=1/0){const n=e(m.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${ft(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(y.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(y.energy.value,r)&&(y.energy.value=o.sub(y.energy.value,r),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},y.board.selectedAction.value=null)},visibility:i=>o.add(i.state.maxConnections,y.computedBonusConnectionsModifier.value).lt(t)}}function Xr(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=y.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function fd(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=y.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Ni(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=y.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Yr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function Jr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},y.board.selectedNode.value=e}function pd(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function gd(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},y.board.selectedNode.value=e}function Ci(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function ki(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},y.board.selectedNode.value=e}function ye(e){return e===y.board.selectedNode.value||e.state.powered}function ie(e){return y.empowerer.value!=null&&ye(y.empowerer.value)&&y.empowerer.value.state.tools.includes(e)}function md(e){var a,l,u;const t=(u=(l=(a=y.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=y.resourceLevels.value[e],i=zi.evaluate(n),r=zi.evaluate(o.add(n,1));return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function un(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.gt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const vd={key:0},hd={key:0,class:"mark star"},bd=["src"],yd=Y({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),A("div",vd,[e.mark===!0?(M(),A("div",hd)):(M(),A("img",{key:1,class:"mark",src:e.mark},null,8,bd))])):z("",!0)}});var ei=pe(yd,[["__scopeId","data-v-2207999f"]]);const wd=Y({__name:"Node",props:{id:null},setup(e){const n=Pe(e),i=pi(Hi,()=>{}),r=pi(Zi,()=>{}),a=ht(null),l=w(()=>a.value&&a.value.parentElement);return vt([l,n.id],([u,c],[d,v])=>{d&&r(s(v)),u&&i(c,u)}),Cr(()=>r(s(n.id))),(u,c)=>(M(),A("div",{class:"node",ref_key:"node",ref:a},null,512))}});var ti=pe(wd,[["__scopeId","data-v-a48cb382"]]),_d=Y({props:{display:{type:O(Object,String,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),onClick:Function,onHold:Function,canClick:{type:O(Boolean),required:!0},small:Boolean,mark:O(Boolean,String),id:{type:String,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,onClick:n,onHold:i}=Pe(e),r=ht("");It(()=>{var v;const u=$e(t);if(u==null){r.value="";return}if(xt(u)){r.value=de(u);return}const c=de((v=u.title)!=null?v:"","h3"),d=de(u.description,"div");r.value=de(J(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=Rr(n,i);return{start:a,stop:l,comp:r,Visibility:Ce,isVisible:Ge,isHidden:yn,unref:s}}});function Nd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:be({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)?(M(),te(Xe(e.unref(e.comp)),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):z("",!0)}var Kr=pe(_d,[["render",Nd],["__scopeId","data-v-211328c0"]]);const Qr=Symbol("Clickable");function Cd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Je(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=nn("clickable-"),r.type=Qr,r[yt]=Kr;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"canClick"),se(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(v){s(r.canClick)!==!1&&d(v)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,v)=>{var f;return Object.assign(d,(f=v.getGatheredProps)==null?void 0:f.call(v,r))},{});return r[pt]=function(){const{display:d,visibility:v,style:f,classes:h,onClick:g,onHold:C,canClick:_,small:I,mark:P,id:S}=this;return{display:d,visibility:v,style:s(f),classes:h,onClick:g,onHold:C,canClick:_,small:I,mark:P,id:S,...a}},r})}function kd(e,t,n=[]){n=n.length===0?Jn(e,Qr):n;const i=typeof t=="function"?w(t):t;return e.on("update",()=>{s(i)&&n.filter(r=>s(r.canClick)).forEach(r=>{var a;return(a=r.onClick)==null?void 0:a.call(r)})})}const Md=["x1","y1","x2","y2"],Sd=Y({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Pe(e),i=w(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=w(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(M(),A("line",Wt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Md))}});const Id=Y({__name:"Links",props:{links:null},setup(e){var c;const n=en(e,"links"),i=U(null),r=pi(Xi,U({})),a=pi(Yi,U(void 0)),l=U((c=i.value)==null?void 0:c.getBoundingClientRect());vt(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),yi(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=w(()=>{var v,f;const d=r.value;return(f=(v=n.value)==null?void 0:v.filter(h=>{var g,C;return((g=d[h.startNode.id])==null?void 0:g.rect)&&((C=d[h.startNode.id])==null?void 0:C.rect)}))!=null?f:[]});return(d,v)=>(M(),A(re,null,[s(u)?(M(),A("svg",wa(Wt({key:0},d.$attrs)),[(M(!0),A(re,null,Dn(s(u),(f,h)=>(M(),te(Sd,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):z("",!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var xd=pe(Id,[["__scopeId","data-v-063f6d6b"]]);Y({props:{nodes:{type:O(Array),required:!0},leftSideNodes:O(Array),rightSideNodes:O(Array),branches:O(Array)},components:{Links:xd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Pe(e),r=ht();It(()=>{const u=$e(t);r.value=de(J(()=>p(re,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(kt)]))])))});const a=ht();It(()=>{const u=$e(n);a.value=u?de(J(()=>p("span",{class:"left-side-nodes small"},[u.map(kt)]))):""});const l=ht();return It(()=>{const u=$e(i);l.value=u?de(J(()=>p("span",{class:"side-nodes small"},[u.map(kt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});Y({props:{display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),onClick:Function,onHold:Function,color:O(String),glowColor:O(String),canClick:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ei,Node:ti},setup(e){const{onClick:t,onHold:n,display:i}=Pe(e),r=An(i),{start:a,stop:l}=Rr(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:Ce,isCoercableComponent:xt,isVisible:Ge,isHidden:yn}}});function Wn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>ve(u.base)),n.baseText=t.map(u=>ve(u.baseText)),n.visible=t.map(u=>ve(u.visible)),n.title=t.map(u=>ve(u.title)),n.subtitle=t.map(u=>ve(u.subtitle)),i=!0),t}const a=dt({},!1);return[J(()=>{const u=r();let c=!0;const d=u.map((v,f)=>{var P,S,D;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[T("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[T(" ("),s(n.subtitle[f]),T(")")]):null]),g=s(a.value[f])?null:p(re,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[kt((P=s(n.baseText[f]))!=null?P:"Base")]),p("span",{class:"modifier-amount"},[Me((S=s(n.base[f]))!=null?S:1),v.unit])]),v.modifier.description==null?null:kt(s(v.modifier.description))]),C=!c;c=!1;const _=(D=s(n.base[f]))!=null?D:1,I=v.modifier.apply(_);return p(re,null,[C?p("br",null,null):null,p("div",{style:{"--unit":ue.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[h,p("br",null,null),g,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[T("Total")]),p("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(I,_!=null?_:1):o.lt(I,_!=null?_:1))?"color: var(--danger)":""},[Ut(I),v.unit])])])])});return p(re,null,[d])}),a]}function Oi(e,t,n){const i=ve(t),r=ve(n);return w(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":_i(o.sub(l,e.value).div(a))})}function cn(e,t,n=1){const i=ve(t),r=ve(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return J(()=>{var a;if(s(i)){const l=Ut(e.evaluate()),u=Ut(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(re,null,[p("b",null,[p("i",null,[l,T(" \u2192 "),u])])])}return p(re,null,[Ut(e.evaluate())])})}const St={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},Lt=Object.keys(St),Le={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Tt={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Networks",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:"Overclocked Portals",ultimatum:"Rebates"},$d={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 +20% XP gain":"Each treasure gives +10% 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 planar speed":"log(energy)^0.25 boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Nt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},qi=m.variable(0).add(8).times(2).pow10();const Ed=Y({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),A("div",{style:je({width:e.width,height:e.height})},null,4))}});function Ln(e){return Je(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[bi(n.resource,n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",bi(n.resource,n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),se(n,"visibility",Ce.Visible),$(n,"cost"),$(n,"requiresPay"),se(n,"requiresPay",!0),$(n,"cumulativeCost"),se(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),se(n,"maxBulkAmount",1),$(n,"directSum"),se(n,"pay",function(r){const a=n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=w(()=>{var u;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),l=(u=s(n.directSum))!=null?u:a?10:0;return o.lte(r,l)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=Zr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=w(()=>o.gte(n.resource.value,s(n.cost))),n})}function tr(e){return Je(()=>({requirementMet:w(()=>Ge(e.visibility)),visibility:Ce.None,requiresPay:!1}))}function Pd(e,t){return Je(()=>({requirementMet:ve(e),partialDisplay:t==null?void 0:J(()=>kt(t)),display:t==null?void 0:J(()=>p(re,null,[T("Req: "),kt(t)])),visibility:t==null?Ce.None:Ce.Visible,requiresPay:!1}))}function Mi(e){if(Rt(e))return e.every(Mi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function ea(e){if(Rt(e))return e.map(ea).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 Si(e,t=1){var n,i;if(Rt(e)&&(e=e.filter(r=>Ge(r.visibility)),e.length===1&&(e=e[0])),Rt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(re,null,[r.length>0?p("div",null,[T("Costs:")," ",gr(r.map(l=>l.partialDisplay(t)),p(re,null,[T(", ")]))]):null,a.length>0?p("div",null,[T("Requires:")," ",gr(a.map(l=>l.partialDisplay(t)),p(re,null,[T(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(re,null,null)}function ta(e,t=1){var n;Rt(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var Td=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:O(Object,String,Function),earned:{type:O(Boolean),required:!0},requirements:O(Object,Array),image:O(String),style:O(String,Object,Array),classes:O(Object),mark:O(Boolean,String),small:O(Boolean),id:{type:String,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,requirements:n,earned:i}=Pe(e),r=ht("");return It(()=>{const a=$e(t);if(a==null){r.value="";return}if(xt(a)){r.value=de(a);return}const l=de(a.requirement?a.requirement:J(()=>{var d;return Si((d=$e(n))!=null?d:[])}),"h3"),u=de(a.effectDisplay||"","b"),c=$e(i)?de(a.optionsDisplay||"","span"):"";r.value=de(J(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Dd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:be({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?(M(),te(Xe(e.comp),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):z("",!0)}var Ad=pe(Td,[["render",Dd],["__scopeId","data-v-5673325a"]]);const Rd=wi(),Fd=Symbol("Achievement");let En=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Od(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var c,d,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=nn("achievement-"),a.type=Fd,a[yt]=Ad;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,g;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const C=s(f.display);let _;xt(C)?_=de(C):C.requirement!=null?_=de(C.requirement):_=Si((g=f.requirements)!=null?g:[]),Rd.info(p("div",null,[p("h3",null,[T("Treasure earned!")]),p("div",null,[p(_,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),se(a,"visibility",Ce.Visible);const l=a.visibility;a.visibility=_a(()=>{const f=s(a.display);switch(ue.msDisplay){default:case En.All:return s(l);case En.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?Ce.None:s(l);case En.Incomplete:return s(a.earned)?Ce.None:s(l);case En.None:return Ce.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),se(a,"showPopups",!0);for(const f of t)(v=f.postConstruct)==null||v.call(f,a);const u=t.reduce((f,h)=>{var g;return Object.assign(f,(g=h.getGatheredProps)==null?void 0:g.call(h,a))},{});if(a[pt]=function(){const{visibility:f,display:h,requirements:g,earned:C,image:_,style:I,classes:P,mark:S,small:D,id:V}=this;return{visibility:f,display:h,requirements:g,earned:C,image:_,style:s(I),classes:P,mark:S,small:D,id:V,...u}},a.requirements){const f=a,h=[tr(f),Pd(()=>!f.earned.value),...Rt(a.requirements)?a.requirements:[a.requirements]];It(()=>{ue.active===K.id&&Mi(h)&&f.complete()})}return a})}Ye.on("loadSettings",e=>{se(e,"msDisplay",En.All)});const qd=Object.values(En).map(e=>({label:tt(e),value:e}));Ps(J(()=>p(Qi,{title:J(()=>p("span",{class:"option-title"},[T("Show achievements"),p("desc",null,[T("Select which achievements to display based on criterias.")])])),options:qd,"onUpdate:modelValue":e=>ue.msDisplay=e,modelValue:ue.msDisplay},null)));const Vd=Y({props:{progress:{type:O(String,Object,Number),required:!0},width:{type:O(Number),required:!0},height:{type:O(Number),required:!0},direction:{type:O(String),required:!0},display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),borderStyle:O(Object,String,Array),textStyle:O(Object,String,Array),baseStyle:O(Object,String,Array),fillStyle:O(Object,String,Array),mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ei,Node:ti},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=Pe(e),l=w(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=w(()=>{const d={width:$e(n)+.5+"px",height:$e(i)+.5+"px"};switch(s(r)){case G.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=$e(n)+1+"px";break;case G.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=$e(n)+1+"px";break;case G.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case G.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case G.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=An(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Bd(e,t,n,i,r,a){var c,d,v,f,h,g,C;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:je([{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:be({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),A("span",{key:0,class:"overlayText",style:je(e.unref(e.textStyle))},[(M(),te(Xe(e.component)))],4)):z("",!0)],4),N("div",{class:"border",style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(v=e.unref(e.style))!=null?v:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[N("div",{class:"fill",style:je([e.barStyle,(g=e.unref(e.style))!=null?g:{},(C=e.unref(e.fillStyle))!=null?C:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):z("",!0)}var Ld=pe(Vd,[["render",Bd],["__scopeId","data-v-6bd06b56"]]);const jd=Symbol("Bar");function zd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Je(i=>{var l,u;const r=e.call(i,i);r.id=nn("bar-"),r.type=jd,r[yt]=Ld;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var v;return Object.assign(c,(v=d.getGatheredProps)==null?void 0:v.call(d,r))},{});return r[pt]=function(){const{progress:c,width:d,height:v,direction:f,display:h,visibility:g,style:C,classes:_,borderStyle:I,textStyle:P,baseStyle:S,fillStyle:D,mark:V,id:oe}=this;return{progress:c,width:d,height:v,direction:f,display:h,visibility:g,style:s(C),classes:_,borderStyle:I,textStyle:P,baseStyle:S,fillStyle:D,mark:V,id:oe,...a}},r})}function Ud(e,...t){return Je(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=w(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=w(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=w(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),se(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function Gd(e){return Ud(e)}function Wd(e,t,n=1,i=o.dInf){const r=ve(n),a=ve(i);e.on("preUpdate",l=>{const u=s(r);o.neq(u,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(u,l).times(o.ceil(s(t.actualGain)))).min(s(a)).max(t.gainResource.value))})}const Hd={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),$(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=w(()=>{var t;return o.add(s((t=e.amount)!=null?t:0),s(e.bonusAmount))}))}},na=Symbol("Repeatable");function hr(e,...t){const n=dt(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var h,g,C;const a=e.call(r,r);a.id=nn("repeatable-"),a.type=na,a[yt]=Kr;for(const _ of t)(h=_.preConstruct)==null||h.call(_,a);a.amount=n,a.amount[tn]=(g=a.initialAmount)!=null?g:0,Object.assign(a,i);const l={requirementMet:w(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:Ce.None,canMaximize:!0},u=tr(a);Rt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=w(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=w(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=w(()=>o.clampMin(ea(a.requirements),1)),a.canClick=w(()=>Mi(a.requirements));const d=a.onClick;a.onClick=function(_){var S;const I=a;if(!s(I.canClick))return;const P=(S=s(a.amountToIncrease))!=null?S:1;ta(a.requirements,P),I.amount.value=o.add(I.amount.value,P),d==null||d(_)},$(a,"display");const v=a.display;a.display=J(()=>{var I,P,S;const _=s(v);if(xt(_)){const D=de(_);return p(D,null,null)}if(_!=null){const D=a,V=de((I=_.title)!=null?I:"","h3"),oe=de((P=_.description)!=null?P:""),le=de((S=_.effectDisplay)!=null?S:"");return p("span",null,[_.title==null?null:p("div",null,[p(V,null,null)]),_.description==null?null:p(oe,null,null),_.showAmount===!1?null:p("div",null,[p("br",null,null),p(re,null,[T("Amount: "),ft(D.amount.value)]),o.isFinite(s(D.limit))?p(re,null,[T(" / "),ft(s(D.limit))]):void 0]),_.effectDisplay==null?null:p("div",null,[p("br",null,null),T("Currently: "),p(le,null,null)]),D.maxed.value?null:p("div",null,[p("br",null,null),Si(D.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),se(a,"visibility",Ce.Visible),$(a,"limit"),se(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const _ of t)(C=_.postConstruct)==null||C.call(_,a);const f=t.reduce((_,I)=>{var P;return Object.assign(_,(P=I.getGatheredProps)==null?void 0:P.call(I,a))},{});return a[pt]=function(){const{display:_,visibility:I,style:P,classes:S,onClick:D,canClick:V,small:oe,mark:le,id:Q}=this;return{display:_,visibility:I,style:s(P),classes:S,onClick:D,canClick:V,small:oe,mark:le,id:Q,...f}},a})}const Zd=Symbol("Reset");function Xd(e){return Je(t=>{const n=e.call(t,t);return n.id=nn("reset-"),n.type=Zd,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object")if(tn in a){const l=a;l.value=l[tn]}else!(a instanceof o)&&!Oe(a)&&Object.values(a).forEach(l=>i(l))};s(n.thingsToReset).forEach(i),Ye.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const ci={};Ye.on("removeLayer",e=>{var t;(t=ci[e.id])==null||t.call(ci),ci[e.id]=void 0});function Vi(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),se(t,"direction",G.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=dt(!1,!1)),Gt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,qr(t.pinned)):e.pinned=t.pinned);const n=e[yt];e[yt]=Fe;const i=e[pt].bind(e);e[pt]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:v,pinned:f}=this;return{element:{[yt]:n,[pt]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:v,pinned:f}}.bind(t)}),t}var Yd=Y({props:{display:{type:O(String,Object,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),requirements:{type:Object,required:!0},canPurchase:{type:O(Boolean),required:!0},bought:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,requirements:n,bought:i}=Pe(e),r=ht("");return It(()=>{const a=$e(t);if(a==null){r.value="";return}if(xt(a)){r.value=de(a);return}const l=de(a.title||"","h3"),u=de(a.description,"div"),c=de(a.effectDisplay||"");r.value=de(J(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[T("Currently: "),p(c,null,null)]):null,i.value?null:p(re,null,[p("br",null,null),Si(n.value)])])))}),{component:r,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});const Jd=["disabled"];function Kd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:be({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)?(M(),te(Xe(e.unref(e.component)),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Jd)):z("",!0)}var Qd=pe(Yd,[["render",Kd],["__scopeId","data-v-9be6bac0"]]);const nr=Symbol("Upgrade");function br(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var c,d;const a=e.call(r,r);a.id=nn("upgrade-"),a.type=nr,a[yt]=Qd;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=w(()=>!n.value&&Mi(a.requirements)),a.purchase=function(){var f;const v=a;!s(v.canPurchase)||(ta(a.requirements),n.value=!0,(f=v.onPurchase)==null||f.call(v))};const l=tr(a);Rt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),se(a,"visibility",Ce.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const v of t)(d=v.postConstruct)==null||d.call(v,a);const u=t.reduce((v,f)=>{var h;return Object.assign(v,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[pt]=function(){const{display:v,visibility:f,style:h,classes:g,requirements:C,canPurchase:_,bought:I,mark:P,id:S,purchase:D}=this;return{display:v,visibility:f,style:s(h),classes:g,requirements:C,canPurchase:_,bought:I,mark:P,id:S,purchase:D,...u}},a})}function ef(e,t,n=[]){n=n.length===0?Jn(e,nr):n;const i=Xn(t)?w(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function tf(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const nf={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"]},yr=[[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 Bi(e){const t=yr[Math.floor(e()*yr.length)];let n="";for(let i=0;i<t.length;i++){const r=nf[t[i]];n+=r[Math.floor(e()*r.length)]}return tt(n)}const rf={1:["a","e","i","o","u"],2:["ph","th","ch","sh","br","cr","dr","fr","gr","pr","tr","str","sc","sk","sm","sn","sp","st","sw"],3:["ae","ai","ao","au","ay","ea","ei","eo","eu","ey","ua","ue","ui","uo","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","oy"],4:["morp","flux","syn","void","rift","dyn","nov","chron","lum","par","ter","psy","phan","man","grav","pyr","cry","hydr","elec","kin","nan","omni"],5:["ance","ation","esis","ergy","tide","al","ism","ity","mancy","urgy","pathy","port","shift","burst","pulse","wave","field","storm","force","blade"]},wr=[[1,2,1,4,5],[1,4,5],[2,1,4,5],[1,2,3,4,5],[3,4,5]];function xn(e){const t=wr[Math.floor(e()*wr.length)];let n="";for(let i=0;i<t.length;i++){const r=rf[t[i]];n+=r[Math.floor(e()*r.length)]}return tt(n)}function jn(e,t){const[n,i,r]=af(...e),[a,l,u]=sf(Math.floor(t()*360),i,r);return`rgb(${a*255}, ${l*255}, ${u*255})`}function af(e,t,n){const i=Math.max(e,t,n),r=i-Math.min(e,t,n),a=r&&(i==e?(t-n)/r:i==t?2+(n-e)/r:4+(e-t)/r);return[60*(a<0?a+6:a),i&&r/i,i]}function sf(e,t,n){const i=(r,a=(r+e/60)%6)=>n-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const _r=wi();function ia(e,t,n,i){return Ji(e,function(){const r=tf(0,n>>0,n>>32,1);for(let q=0;q<12;q++)r();const a=Bi(r),l=jn([.64,.75,.55],r),u=jn([.18,.2,.25],r),c=$n(0,Bi(r)),d=dt(0),v=Lt.indexOf(t);let f=r();const h=i.reduce((q,L)=>(q[L.type]=L.data,q),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const g=f+v+1,C=y.toolNodes.value.sandRelic!=null?ie("sandRelic")?2:1:0,_=dt(C),I=w(()=>("increaseRewards"in h?g+1:g)+_.value);let P="relic"in h?v+2:Math.ceil(r()*(v+2));"increaseLength"in h&&P++;const S=[],D=_t(()=>S),V=w(()=>D.apply(0)),oe=[],le={};function Q({feature:q,canClick:L,modifier:Se,cost:Qe,previewModifier:kn,showETA:ze,previewCost:$t}){L=ve(L),ze=ve(ze);const Vt=mr(q);oe.push({shouldShowPreview:w(()=>s(L)&&Vt.value),modifier:_t(()=>{const Et=S.slice();return Et.splice(Et.indexOf(Se),1,kn),Et}),cost:$t!=null?$t:Qe}),S.push(Se);const Bt=Oi(c,V,()=>ke(Qe)),nt=Vi(q,{display:ze==null?Bt:()=>s(ze)?Bt.value:"",direction:G.Down});return{isHovering:Vt,eta:Bt,tooltip:nt}}const Z=[],fe=U(0);let B=m.variable(fe).times(0);const ae={};let Te=!0;const He=w(()=>o.add(g,r()-.5).pow_base(2).times(10).times(B.evaluate())),Xt=[];for(let q=0;q<P;q++){const L={upgrades:32,repeatables:q<=1?0:16,conversion:q<=3?0:8,xp:q<=5?0:4,dimensions:q<=7?0:2,prestige:q<=7||q>=P-1?0:1};switch(di(L,r)){case"upgrades":const F=[];for(let Ie=0;Ie<4;Ie++){const ot=di({add:1,mult:q===0&&Ie===0?0:1},r),et=He.value,lt=xn(r);let gt="",De,Ae;const Re=fe.value;switch(ot){case"add":{const _e=o.add(et,10).pow(r()/4+.875);gt=`Gain ${Me(_e)} ${c.displayName}/s`,B=B.add(_e),De=it=>zt(()=>({addend:_e,description:lt,enabled:it==null?Be.bought:()=>it()&&Be.bought.value})),Ae=zt(()=>({addend:_e}));break}case"mult":{const _e=r()*5+1;gt=`Multiply previous ${c.displayName} gain by x${Me(_e)}.`,B=B.add(o.sub(_e,1).times(ae[Re-1])),De=it=>we(()=>({multiplier:_e,description:lt,enabled:it==null?Be.bought:()=>it()&&Be.bought.value})),Ae=we(()=>({multiplier:_e}));break}}ae[fe.value]=B.evaluate(),fe.value++;const Ve=Te,Be=br(()=>({requirements:Ln(()=>({resource:In(c),cost:et})),display:{title:lt,description:gt},visibility:Ve}));Q({feature:Be,canClick:()=>Be.canPurchase.value,modifier:De(),cost:et,showETA:()=>!Be.bought.value,previewModifier:Ae}),S.push(De(()=>ot==="add"?y.toolNodes.value.stoneRelic!=null:ie("stoneRelic"))),F.push(Be)}Z.push(F);break;case"repeatables":const j=[];for(let Ie=0;Ie<3;Ie++){const ot=di({add:1.5,mult:3},r),et=fe.value,lt=He.value,gt=xn(r);let De="",Ae,Re,Ve,Be;const _e=m.variable(w(()=>Ne.amount.value)).times(2);switch(ot){case"add":{const xe=o.add(lt,10).times(r()+.5);De=`Gain ${Me(xe)} ${c.displayName}/s`,Be=_e.add(1).times(1.5).times(lt),B=B.add(w(()=>o.sub(fe.value,et).add(1).times(5).times(xe))),Ae=w(()=>Me(o.times(xe,s(Ne.totalAmount)))+"/s"),Re=zt(()=>({addend:()=>o.times(xe,s(Ne.totalAmount)),description:gt,enabled:()=>o.gt(s(Ne.totalAmount),0)})),Ve=zt(()=>({addend:()=>o.add(s(Ne.totalAmount),Ne.amountToIncrease.value).times(xe)}));break}case"mult":{const xe=r()*.75+1.25;De=`Multiply previous ${c.displayName} gain by x${Me(xe)}.`,Be=_e.pow_base(o.times(xe,1.5)).times(lt),B=B.add(w(()=>o.sub(fe.value,et).add(1).times(5).pow_base(xe).sub(1).times(ae[et-1]))),Ae=w(()=>"x"+Me(o.pow(xe,s(Ne.totalAmount)))),Re=we(()=>({multiplier:()=>o.pow(xe,s(Ne.totalAmount)),description:gt,enabled:()=>o.gt(s(Ne.totalAmount),0)})),Ve=we(()=>({multiplier:()=>o.add(s(Ne.totalAmount),Ne.amountToIncrease.value).pow_base(xe)}));break}}ae[fe.value]=B.evaluate(),fe.value++;const it=Te,Ne=hr(()=>({requirements:Ln(()=>({resource:In(c),cost:Be,maxBulkAmount:()=>y.toolNodes.value.diamondRelic!=null?o.dInf:1})),display:()=>({title:gt,description:`${De}<br/><br/>Amount: ${ft(Ne.amount.value)}${o.gt(s(Ne.bonusAmount),0)?` [+${ft(s(Ne.bonusAmount))}]`:""}`,effectDisplay:s(Ae),showAmount:!1}),visibility:it,limit:100,bonusAmount:()=>o.gt(Ne.amount.value,0)?ie("dirtRelic")?2:y.toolNodes.value.dirtRelic!=null?1:0:0}),Hd);Q({feature:Ne,canClick:()=>s(Ne.canClick),modifier:Re,cost:w(()=>gn(Be,Ne.amountToIncrease.value)),previewModifier:Ve,showETA:()=>!Ne.maxed.value}),j.push(Ne)}Z.push(j);break;case"conversion":const W=$n(0,Bi(r)),ee=jn([.64,.75,.55],r),sn=He.value,li=r()/2+.25,Bn=r()/2+.25,Mn=fe.value;B=B.add(w(()=>o.sub(fe.value,Mn).add(1).pow10().times(ae[Mn-1])));const Pt=Gd(()=>({baseResource:In(c),gainResource:W,formula:Ie=>Ie.div(sn).pow(li).times(w(()=>y.toolNodes.value.ironRelic!=null?ie("ironRelic")?4:2:1)),spend(){c.value=0}}));ae[fe.value]=B.evaluate(),fe.value+=4;const ra=Te,rr=xn(r),Ti=m.variable(W).pow(Bn).add(1),aa=we(()=>({multiplier:()=>Ti.evaluate(),description:rr,enabled:()=>o.gt(W.value,0)})),sa=we(()=>({multiplier:()=>Ti.evaluate(o.add(W.value,Pt.actualGain.value))})),Sn=Cd(()=>({display:{title:rr,description:J(()=>p("span",null,[T("Reset "),c.displayName,T(" for")," ",bi(W,o.clampMin(Pt.actualGain.value,1))," ",W.displayName,p("br",null,null),p("div",null,[T("Next:")," ",bi(c,o.lt(Pt.actualGain.value,1)?Pt.currentAt.value:Pt.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(Pt.actualGain.value,1),prestigeResource:W,onClick:Pt.convert,visibility:ra})),{isHovering:oa}=Q({feature:Sn,canClick:()=>s(Sn.canClick),modifier:aa,cost:sn,previewCost:c,previewModifier:sa}),ar=w(()=>oa.value&&Sn.canClick.value);Z.push([Sn]);const la=cn(m.variable(W),ar,Pt.actualGain),ua=cn(Ti,ar,Pt.actualGain);le[q*2]=J(()=>p(re,null,[Ge(Sn.visibility)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:ee,textShadow:`0px 0px 10px ${ee}`}},[la()])," ",W.displayName,T(","),p("br",null,null),T("providing a "),ua(),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,Fi(Sn)])),Wd(this,Pt,()=>Ke.value.length<P&&y.investments.value!=null&&ye(y.investments.value)&&y.investments.value.state.portals.includes(e)?.01:0);break;case"xp":{const Ie=$n(0),st=Te,ot=fe.value,et=xn(r),lt=o.add(g,r()-.5).pow_base(2).times(10),gt=r()/4+1.125,De=r()/2+1.25,Ae=m.variable(0).pow(gt).times(lt),Re=Zr(Ae,Ie,!0,10,o.dInf),Ve=w(()=>gn(Ae,Re.value,!0,10)),Be=w(()=>gn(Ae,o.add(Re.value,1),!0,10)),_e=w(()=>o.pow(De,Re.value)),it=we(()=>({multiplier:_e,description:et,enabled:()=>Ge(xe.visibility)}));B=B.add(w(()=>o.sub(fe.value,ot).add(1).times(3).pow(De).times(ae[ot-1]))),ae[fe.value]=B.evaluate(),fe.value+=3;const Ne=jn([.18,.2,.25],r),xe=zd(()=>({direction:G.Right,width:300,height:20,progress:()=>o.sub(Ie.value,Ve.value).div(o.sub(Be.value,Ve.value)).toNumber(),visibility:st,xp:Ie,display:J(()=>p("span",null,[Me(Ie.value),T("/"),Me(Be.value)])),fillStyle:`background-color: ${Ne}`}));this.on("preUpdate",Di=>{if(Ke.value.length<P&&y.activePortals.value.some(ut=>ut.state.id===e)&&Ge(xe.visibility)){let ut=o.times(Ot.value,Di);y.toolNodes.value.goldRelic!=null&&(ut=o.times(ie("goldRelic")?.2:.1,Ke.value.length).add(1).times(ut)),Ie.value=o.add(ut,Ie.value)}}),S.push(it),Z.push([xe]),le[q*2]=J(()=>p(re,null,[Ge(xe.visibility)?p("div",{style:"margin: 10px"},[T("You have "),p("h3",null,[et]),T(" Lv. "),ft(Re.value),T(","),p("br",null,null),T("providing a "),Me(_e.value),T("x multiplier to previous")," ",c.displayName,T(" gain"),p("br",null,null)]):null,Fi(xe)]));break}case"dimensions":{const Ie=xn(r),st=$n(0,Ie+" energy"),ot=jn([.64,.75,.55],r),et=fe.value;B=B.add(w(()=>o.sub(fe.value,et).add(1).pow_base(32).add(1).log2().add(1).times(ae[et-1])));const lt=w(()=>o.add(st.value,1).log2().add(1)),gt=we(()=>({multiplier:lt,description:Ie,enabled:()=>o.gt(st.value,0)}));S.push(gt);const De=Te,Ae=[];for(let Re=0;Re<4;Re++){const Ve=o.add(g,r()-.5).pow_base(2).times(10).recip(),Be=He.value,_e=m.variable(w(()=>ut.amount.value)),it=_e.pow_base(o.pow10(Re+1)).times(Be),Ne=["First","Second","Third","Fourth"][Re]+" "+Ie+" Dimension",xe=$n(0,Ne),Di=_e.sub(1).pow_base(2).times(Ve).times(w(()=>o.add(ut.amount.value,xe.value))),ut=hr(()=>({display:{title:Ne,description:J(()=>p("div",null,[p("div",null,[T("Amount:")," ",Me(o.add(xe.value,ut.amount.value))," ",T("["),ft(ut.amount.value),T("]")])])),effectDisplay:J(()=>p("span",null,[fa()," ",Re===0?st.displayName:["First","Second","Third","Fourth"][Re-1]+" "+Ie+" Dimension",T("/s")])),showAmount:!1},style:{width:"400px"},effect:Di,dimensions:xe,limit:100,energy:Re===0?st:void 0,requirements:Ln(()=>({resource:In(c),cost:it,maxBulkAmount:()=>ie("diamondRelic")!=null?o.dInf:1})),visibility:De}));Ae.push(ut);const ca=mr(ut),sr=w(()=>s(ut.canClick)&&ca.value),da=new m({inputs:[_e],evaluate(or){return o.sub(or,1).pow_base(2).times(Ve).times(o.add(or,xe.value))}}),fa=cn(da,sr);oe.push({shouldShowPreview:sr,cost:it});const pa=Oi(c,V,()=>ke(it));Vi(ut,{display:pa,direction:G.Down}),ae[fe.value]=B.evaluate(),fe.value++}this.on("preUpdate",Re=>{if(Ke.value.length<P&&y.activePortals.value.some(Ve=>Ve.state.id===e)&&Ge(De)){let Ve=o.times(Ot.value,Re);y.toolNodes.value.platinumRelic!=null&&(Ve=o.times(ie("platinumRelic")?4:2,Ve));const Be=Ae[0].effect.evaluate();st.value=o.times(Be,Ve).add(st.value);for(let _e=1;_e<4;_e++){const it=Ae[_e].effect.evaluate();Ae[_e-1].dimensions.value=o.times(it,Ve).add(Ae[_e-1].dimensions.value)}}}),Z.push(Ae),le[q*2]=J(()=>p(re,null,[Ge(De)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:ot,textShadow:`0px 0px 10px ${ot}`}},[Me(st.value)])," ",st.displayName,T(","),p("br",null,null),T("providing a "),Me(lt.value),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,qs(...Ae)]));break}case"prestige":{const Ie=xn(r),st=Te,ot=r()/2+1.25,et=He.value;B=B.pow(ot);const lt=dd(()=>({exponent:ot,description:Ie,enabled:De.bought}));ae[fe.value]=B.evaluate(),fe.value++;const gt=Xd(()=>({thingsToReset:Z.filter((Re,Ve)=>Ve%2===0),onReset(){c.value=0}})),De=br(()=>({display:{title:Ie,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${Me(ot)}`},style:{width:"200px",minHeight:"100px"},onPurchase:gt.reset,visibility:st,requirements:Ln(()=>({resource:In(c),cost:et}))})),Ae=we(()=>({multiplier:0}));Q({feature:De,canClick:()=>s(De.canPurchase),modifier:lt,cost:et,previewCost:c,previewModifier:Ae,showETA:()=>!s(De.bought)}),Z.push([De]);break}}const Qe={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(y.influenceNodes.value).length+Xt.length===Object.keys(Nt).length?0:"increaseInfluences"in h?20:2,relic:0};let kn=di(Qe,r);q===P-1&&"relic"in h&&(kn="relic");let ze="",$t,Vt,Bt,nt,Et,an;switch(kn){case"cache":nt=Li(r,i),ze=`Gain ${Me(o.div(I.value,12))}x your current ${nt} (no modifiers).`,Vt=()=>{var W,ee,sn;return y.grantResource(nt,o.times((sn=(ee=(W=y.resourceNodes.value[nt])==null?void 0:W.state)==null?void 0:ee.amount)!=null?sn:0,o.div(I.value,12)))};break;case"generation":nt=Li(r,i);const F=o.div(I.value,40).times(St[nt]);ze=`Gain ${Me(F)} ${nt}/s while plane is active.`,$t=W=>y.grantResource(nt,o.times(W,F)),Bt=w(()=>y.resourceNodes.value[nt]);break;case"resourceMulti":Et=nt=Li(r,i),an=o.div(I.value,10).pow_base(2),ze=`Gain ${Me(an)}x ${nt} while plane is active.`;break;case"energyMulti":Et="energy",an=o.div(I.value,8).add(1),ze=`Gain ${Me(an)}x energy while plane is active.`;break;case"influences":const j=Object.keys(Nt)[Math.floor(r()*Object.keys(Nt).length)];Xt.push(j),ze=`Gain a new portal influence (${Nt[j].display})`,Vt=()=>{if(j in y.influenceNodes.value){_r.warning(`Error: ignoring duplicate portal influence (${Nt[j].display})`);return}const W={id:Qn(y.board),position:{...y.board.types.portal.nodes.value.find(ee=>ee.state.id===e).position},type:"influence",state:{type:j,data:Nt[j].initialData}};y.board.placeInAvailableSpace(W),y.board.nodes.value.push(W)};break;case"relic":ze=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Tt[t]})`,Vt=()=>{if(t==="ultimatum"){ir.value=!0;return}if(`${t}Relic`in y.toolNodes.value)_r.warning(`Error: ignoring duplicate relic (${Tt[t]})`);else{const W={id:Qn(y.board),position:{...y.board.types.portal.nodes.value.find(ee=>ee.state.id===e).position},type:"passive",state:`${t}Relic`};y.board.placeInAvailableSpace(W),y.board.nodes.value.push(W)}}}const oi=Te,Vn=He.value,x=Od(()=>({requirements:Ln(()=>({resource:In(c),cost:Vn})),visibility:oi,display:{requirement:`${Me(Vn)} ${c.displayName}`,effectDisplay:ze},style:"width: 100%",classes:{final:q===P-1},update:$t,onComplete:Vt,link:Bt,effectedResource:Et,resourceMulti:an})),E=Oi(c,V,Vn);Vi(x,{display:()=>x.earned.value?"":E.value,direction:G.Down}),Z.push([x]),Te=x.earned}const at=Jn(Z,nr),Fn=Jn(Z,na);S.push(we(()=>({multiplier:()=>ie("silver")?4:2,description:()=>(ie("silver")?"Empowered ":"")+Le.silver.name,enabled:()=>y.toolNodes.value.silver!=null})),we(()=>({multiplier:()=>o.add(1,(ie("diamond")?2:1)*at.filter(q=>q.bought.value).length/10),description:()=>(ie("diamond")?"Empowered ":"")+Le.diamond.name,enabled:()=>y.toolNodes.value.diamond!=null})),we(()=>({multiplier:()=>o.div(d.value,6e3).times(ie("emerald")?2:1).add(1),description:()=>(ie("emerald")?"Empowered ":"")+Le.emerald.name,enabled:()=>y.toolNodes.value.emerald!=null})),we(()=>({multiplier:()=>o.div(Fn.reduce((q,L)=>q.add(s(L.totalAmount)),o.dZero),100).times(ie("gravelRelic")?2:1).add(1).pow(.75),description:()=>(ie("gravelRelic")?"Empowered ":"")+Tt.gravel,enabled:()=>y.toolNodes.value.gravelRelic!=null})));const Nn=_t(()=>[we(()=>({multiplier:()=>{var q,L,Se;return o.add((Se=(L=(q=y.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:L.level)!=null?Se:0,1)},description:"Booster",enabled:()=>{var q,L,Se;return(Se=(L=(q=y.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:L.portals.includes(e))!=null?Se:!1}})),we(()=>({multiplier:()=>o.times(ie("coalRelic")?.2:.1,Ke.value.length).add(1),description:()=>(ie("coalRelic")?"Empowered ":"")+Tt.coal,enabled:()=>y.toolNodes.value.coalRelic!=null})),we(()=>({multiplier:()=>o.add(y.energy.value,1).log10().add(1).pow(ie("beryliumRelic")?.5:.25),description:()=>(ie("beryliumRelic")?"Empowered ":"")+Tt.berylium,enabled:()=>y.toolNodes.value.beryliumRelic!=null}))]),Ot=w(()=>Nn.apply(1)),[xi,ii]=Wn(()=>[{title:`${tt(c.displayName)} Gain`,modifier:D,base:0,unit:"/s"},{title:`${tt(c.displayName)} Time Speed`,modifier:Nn,base:1,visible:()=>o.gt(Ot.value,1)}]),Cn=U(!1),ri=J(()=>p(Ht,{modelValue:Cn.value,"onUpdate:modelValue":q=>Cn.value=q},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>rt(xi)}));this.on("preUpdate",q=>{if(!y.activePortals.value.some(Se=>Se.state.id===e))return;const L=o.times(Ot.value,q);d.value=o.add(d.value,L),Ke.value.length<P&&(c.value=o.times(V.value,L).add(c.value)),Ke.value.forEach(Se=>{var Qe;(Qe=Se.update)==null||Qe.call(Se,L)})}),ef(this,()=>Ke.value.length<P&&y.upgrader.value!=null&&ye(y.upgrader.value)&&y.upgrader.value.state.portals.includes(e),at),kd(this,()=>Ke.value.length<P&&y.automator.value!=null&&ye(y.automator.value)&&y.automator.value.state.portals.includes(e),Fn);const On=w(()=>{const q=oe.find(L=>L.shouldShowPreview.value);return q?o.neg(ke(q.cost)):0}),qt=w(()=>{const q=oe.find(L=>L.shouldShowPreview.value);return q&&q.modifier?o.sub(q.modifier.apply(0),V.value):0}),qn=cn(m.variable(0).add(c),()=>o.neq(On.value,0),On),ai=cn(m.variable(0).add(V),()=>o.neq(qt.value,0),qt),si=w(()=>{const q=[];return Ke.value.forEach(L=>{L.link&&q.push(L.link)}),q}),$i=w(()=>{const q={};return Ke.value.forEach(L=>{L.effectedResource!=null&&L.resourceMulti!=null&&(q[L.effectedResource]!=null?q[L.effectedResource]=o.times(q[L.effectedResource],L.resourceMulti):q[L.effectedResource]=L.resourceMulti)}),q}),Ke=w(()=>{const q=[];for(let L=1;L<Z.length;L+=2){const Se=Z[L][0];Se.earned.value&&q.push(Se)}return q}),Ei=w(()=>o.lt(Ke.value.length,P)&&Z.some(q=>q.some(L=>"earned"in L&&s(L.earned)||"bought"in L&&s(L.bought)?!1:("canClick"in L&&s(L.canClick)||"canPurchase"in L&&s(L.canPurchase),!0)))),Pi=w(()=>{const q=Z.findIndex((Se,Qe)=>Qe>0&&Qe%2===0&&!Z[Qe-1][0].earned.value);let L;return q===-1?L=Z:L=Z.slice(0,q),L.map((Se,Qe)=>Qe in le?rt(le[Qe]):Fi(...Se))});return{tier:dt(t),seed:dt(n),influences:dt(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:Z,resourceTabCollapsed:ii,links:si,resourceMultis:$i,earnedTreasures:Ke,showNotif:Ei,timeActive:d,bonusRewardsLevel:_,display:J(()=>p(re,null,[p(hi,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,T("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Fe,{display:i.map(q=>{const L=Nt[q.type].description;return typeof L=="function"?L(q):L}).join("<br/>"),direction:G.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,T(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>Cn.value=!0},[T("modifiers")])])]}),p(hi,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[rt(qn)])," ",c.displayName]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(V.value,0)?"+":"",rt(ai)]),T("/s)")]),o.neq(Ot.value,1)?p("span",{class:"nav-segment"},[T("Speed: "),Me(Ot.value),T("x")]):null]}),p(Ed,{height:"60px"},null),Pi.value,rt(ri)])),minimizedDisplay:J(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",Ke.value.length,T("/"),P,T(" treasures")])]))}})}function Li(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(St).reduce((u,c)=>{let d=St[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(St),r=Math.floor(e()*n);let a=0,l;for(let u=0;u<i.length;u++){const c=i[u];if(a+=St[c],r<a){l=c;break}}return l}function di(e,t){const n=Object.values(e).reduce((u,c)=>u+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;u<i.length;u++){const c=i[u];if(r+=e[c],l<r){a=c;break}}if(a==null)throw new Error("Failed to pick random. This should not happen");return a}const of={shape:We.Diamond,size:50,title:"\u{1FAA8}",label:e=>e===y.board.selectedNode.value?{text:"Mining"}:Object.keys(y.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[Ft],progress:e=>ye(e)?new o(e.state.progress).toNumber():0,progressDisplay:vn.Outline,progressColor:"var(--accent2)",classes:e=>({running:ye(e)}),draggable:!0},lf={shape:We.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===y.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(y.energy.value,100)&&(e.type="factory",y.energy.value=o.sub(y.energy.value,100))},confirmationLabel:()=>o.gte(y.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},uf={shape:We.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===y.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Le[e.state].name}`};if(((t=y.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=y.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":Le[i].name,a=e.state===i||y.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Le[e.state].name} - ${Ze(Le[e.state].cost)} energy`}),onClick(e){const t=Le[e.state];if(o.gte(y.energy.value,t.cost)&&y.toolNodes.value[e.state]==null){y.energy.value=o.sub(y.energy.value,t.cost);const n={id:Qn(y.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};y.board.placeInAvailableSpace(n),y.board.nodes.value.push(n),y.board.selectedAction.value=null,y.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(y.energy.value,Le[e.state].cost)&&y.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(y.energy.value,Le[e.state].cost)?y.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||y.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(y.energy.value),o.sqrt(Le[e.state].cost)).clampMax(1).toNumber(),progressDisplay:vn.Fill,progressColor:e=>e.state!=null&&o.gte(y.energy.value,Le[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,y.board.selectedNode.value=e},draggable:!0},cf=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],df={shape:We.Circle,size:50,title:e=>tt(e.state.type)+" ("+cf[Lt.indexOf(e.state.type)]+")",subtitle:e=>Ze(e.state.amount),progress:e=>md(e.state.type),onClick(){},progressDisplay:vn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":y.dowsing.value!=null&&ye(y.dowsing.value)&&y.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=y.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},ff={shape:We.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Tt[t.slice(0,-5)]:Le[t].name},label:e=>e===y.board.selectedNode.value?{text:$d[e.state].description(ie(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":ie(e.state)}),draggable:!0},pf={shape:We.Diamond,size:50,title:"\u{1F962}",label:e=>e===y.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,y.computedBonusConnectionsModifier.value)})`}:Xr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(2).pow_base(100),16),Ft],classes:e=>({running:ye(e)}),canAccept:Yr,onDrop:Jr,draggable:!0},gf={shape:We.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===y.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,y.computedBonusConnectionsModifier.value)})`}:Xr(e,t=>`Gather ${bt(o.div(y.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(2).pow_base(1e4),16),Ft],progress:e=>ye(e)?o.eq(y.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(y.quarryProgressRequired.value).toNumber():0,progressDisplay:vn.Outline,progressColor:"var(--accent2)",canAccept:Yr,onDrop:Jr,classes:e=>({running:ye(e)}),draggable:!0},mf={shape:We.Diamond,size:50,title:"\u{1F50C}",label:e=>e===y.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,y.computedBonusConnectionsModifier.value)})`}:fd(e,t=>t.includes("Relic")?`Double ${Tt[t.slice(0,-5)]}'s effect`:`Double ${Le[t].name}'s effect`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(3).pow_base(1e3),24),Ft],canAccept:pd,onDrop:gd,classes:e=>({running:ye(e)}),draggable:!0},vf={shape:We.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===y.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=y.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${tt(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},y.board.selectedAction.value=null,y.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 - ${Ze(y.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(y.energy.value,y.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(y.energy.value,y.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(y.energy.value,y.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in he;)t++;y.energy.value=o.sub(y.energy.value,y.computedPortalCost.value);const{tier:n,influences:i}=e.state;Ki(ia(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>y.influenceNodes.value[a].state)),K);const r={id:Qn(y.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};y.board.placeInAvailableSpace(r),y.board.nodes.value.push(r),y.board.selectedAction.value=null,y.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}y.board.selectedNode.value=e},draggable:!0},hf={shape:We.Diamond,size:50,title:"\u{1F300}",label:e=>e===y.board.selectedNode.value?{text:`Portal to ${he[e.state.id].name}`,color:he[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[Ft],classes:e=>({running:ye(e),showNotif:he[e.state.id].showNotif.value,"affected-node":y.booster.value!=null&&ye(y.booster.value)&&y.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>he[e.state.id].background,draggable:!0},bf={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?We.Diamond:We.Circle,size:50,title:e=>Nt[e.state.type].display,label:e=>{if(e===y.board.selectedNode.value){const n=e.state,i=Nt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=y.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${tt(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${tt(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[rn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},y.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},yf={shape:We.Diamond,size:50,title:"\u231B",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ze(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Boost ${he[t].name}'s speed`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ze(qi.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(y.energy.value,qi.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=qi.evaluate(e.state.level);o.gte(y.energy.value,t)&&(y.energy.value=o.sub(y.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},y.board.selectedAction.value=null)}},Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},wf={shape:We.Diamond,size:50,title:"\u{1F916}",label:e=>e===y.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,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(4).pow_base(1e6)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},_f={shape:We.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===y.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,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(4).pow_base(1e6)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},Nf={shape:We.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===y.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,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(3).pow_base(1e8)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},Nr=wi(),Cf={mine:of,brokenFactory:lf,factory:uf,resource:df,passive:ff,dowsing:pf,quarry:gf,empowerer:mf,portalGenerator:vf,portal:hf,influence:bf,booster:yf,upgrader:wf,automator:_f,investments:Nf},y=Ji("main",function(){const e=$n(0,"energy"),t=w(()=>g.types.resource.nodes.value.reduce((x,E)=>(x[E.state.type]=E,x),{})),n=w(()=>({...g.types.passive.nodes.value.reduce((x,E)=>(x[E.state]=E,x),{}),sand:g.types.dowsing.nodes.value[0],wood:g.types.quarry.nodes.value[0],coal:g.types.empowerer.nodes.value[0],iron:g.types.portalGenerator.nodes.value[0],gold:g.types.booster.nodes.value[0],platinum:g.types.upgrader.nodes.value[0],berylium:g.types.automator.nodes.value[0],ultimatum:g.types.investments.nodes.value[0]})),i=w(()=>Object.keys(Tt).filter(x=>`${x}Relic`in n.value).length),r=w(()=>({...g.types.influence.nodes.value.reduce((x,E)=>(x[E.state.type]=E,x),{})})),a=w(()=>({...g.types.portal.nodes.value.reduce((x,E)=>(x[E.state.id]=E,x),{})})),l=w(()=>Lt.reduce((x,E)=>{var j,W,ee;const F=(ee=(W=(j=t.value[E])==null?void 0:j.state)==null?void 0:W.amount)!=null?ee:0;return x[E]=o.floor(zi.invert(F)),x},{})),u=mn({}),c=mn({});Gt(()=>{Lt.forEach(x=>{vt(()=>l.value[x],(E,F)=>{const j=o.sub(E,F);o.gt(j,0)&&(o.gt(j,1)||o.lt(F,100))&&ue.active===K.id&&Nr.info(p("div",null,[p("h3",null,[o.eq(E,1)?`${tt(x)} discovered`:`${tt(x)} is now Level ${ft(E)}`,T("!")]),o.gt(j,1)?p("div",null,[T("Gained "),ft(j),T(" levels")]):null]))})})});const d=w(()=>Z.filter(x=>{var E,F;return(F=(E=x.value)==null?void 0:E.state)==null?void 0:F.powered}).length+g.types.portal.nodes.value.filter(x=>x.state.powered).length),v=w(()=>{let x=d.value;return n.value.copperRelic!=null&&(x--,ie("copperRelic")&&x--),x}),f=w(()=>{const x=v.value;return o.lt(x,0)?0:o.eq(x,0)?10:o.add(x,1).pow_base(100).div(10).times(.99)}),h=w(()=>{if(P.value==null)return 0;let E=P.value.state.resources.reduce((F,j)=>o.div(100,qt[j].computedModifier.value).add(F),o.dZero);return n.value.silverRelic!=null&&(E=o.div(E,o.add(d.value,1)),ie("silverRelic")&&(E=o.div(E,o.add(d.value,1)))),E}),g=xu(x=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:Cf,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const E=[];if(E.push(...Object.keys(u).map(F=>({startNode:C.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),_.value!=null&&_.value.state!=null&&E.push({startNode:_.value,endNode:t.value[_.value.state],stroke:"var(--foreground)",strokeWidth:4}),I.value!=null&&I.value.state.resources.forEach(F=>{E.push({startNode:I.value,endNode:t.value[F],stroke:ye(I.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),P.value!=null&&P.value.state.resources.forEach(F=>{E.push({startNode:P.value,endNode:t.value[F],stroke:"var(--foreground)",strokeWidth:4})}),E.push(...Object.keys(c).map(F=>({startNode:P.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),S.value!=null&&S.value.state.tools.forEach(F=>{E.push({startNode:S.value,endNode:n.value[F],stroke:ye(S.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D.value!=null){const F=D.value.state;F.tier!=null&&E.push({startNode:D.value,endNode:t.value[F.tier],stroke:"var(--foreground)",strokeWidth:4}),F.influences.forEach(j=>{E.push({startNode:D.value,endNode:r.value[j],stroke:"var(--foreground)",strokeWidth:4})}),x.types.portal.nodes.value.forEach(j=>{const W=he[j.state.id];return W.links.value.forEach(ee=>{ee.value!=null&&E.push({startNode:j,endNode:ee.value,stroke:ye(j)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(W.resourceMultis.value).forEach(ee=>{ee!=="energy"&&ee in t.value&&E.push({startNode:j,endNode:t.value[ee],stroke:ye(j)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),E})}return V.value!=null&&V.value.state.portals.forEach(F=>{E.push({startNode:V.value,endNode:a.value[F],stroke:ye(V.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),oe.value!=null&&oe.value.state.portals.forEach(F=>{E.push({startNode:oe.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.forEach(F=>{E.push({startNode:le.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Q.value!=null&&Q.value.state.portals.forEach(F=>{E.push({startNode:Q.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(F=>{const j=F.state;(j.type==="increaseResources"||j.type==="decreaseResources")&&j.data.forEach(W=>{E.push({startNode:F,endNode:t.value[W],stroke:"var(--foreground)",strokeWidth:4})})}),E}})),C=w(()=>g.types.mine.nodes.value[0]),_=w(()=>g.types.factory.nodes.value[0]),I=w(()=>n.value.sand),P=w(()=>n.value.wood),S=w(()=>n.value.coal),D=w(()=>n.value.iron),V=w(()=>n.value.gold),oe=w(()=>n.value.platinum),le=w(()=>n.value.berylium),Q=w(()=>n.value.ultimatum),Z=[C,I,P,S,V,oe,le,Q];function fe(x,E){let F=t.value[x];if(E=o.times(E,qn[x].computedModifier.value),F==null)F={id:Qn(g),position:{...C.value.position},type:"resource",state:{type:x,amount:E}},g.placeInAvailableSpace(F),g.nodes.value.push(F);else{const j=F.state;F.state={...j,amount:o.add(j.amount,E)}}}const B=w(()=>Object.keys(St).reduce((x,E)=>x+new o(qt[E].computedModifier.value).toNumber(),0)),ae=w(()=>{const x={};return g.types.portal.nodes.value.forEach(E=>{if(!ye(E))return;const j=he[E.state.id].resourceMultis.value;Object.keys(j).forEach(W=>{x[W]!=null?x[W]=o.times(x[W],j[W]):x[W]=j[W]})}),x}),Te=_t(()=>Lt.map(x=>zt(()=>({description:()=>tt(x),addend:()=>l.value[x],enabled:()=>o.gt(l.value[x],0)})))),He=w(()=>Te.apply(0)),Xt=_t(()=>[zt(()=>({addend:He,description:"Resource Levels"})),we(()=>({multiplier:()=>o.pow(On.value,He.value),description:()=>`${Ut(On.value,3)}x per Resource Level`})),we(()=>({multiplier:()=>ie("stone")?4:2,description:()=>(ie("stone")?"Empowered ":"")+Le.stone.name,enabled:()=>n.value.stone!=null})),we(()=>({multiplier:()=>{var x;return(x=ae.value.energy)!=null?x:1},description:"Planar Treasures",enabled:()=>{var x;return o.neq((x=ae.value.energy)!=null?x:1,1)}})),zt(()=>({addend:()=>o.pow(100,v.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(v.value,0)}))]),at=w(()=>Xt.apply(0)),Fn=_t(()=>[zt(()=>({addend:()=>ie("unobtainium")?2:1,description:()=>(ie("unobtainium")?"Empowered ":"")+Le.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),Nn=w(()=>Fn.apply(0)),Ot=_t(()=>[we(()=>({multiplier:()=>ie("dirt")?4:2,description:()=>(ie("dirt")?"Empowered ":"")+Le.dirt.name,enabled:()=>n.value.dirt!=null})),we(()=>({multiplier:()=>o.pow(i.value,ie("woodRelic")?2:1),description:()=>(ie("woodRelic")?"Empowered ":"")+Tt.wood,enabled:()=>n.value.woodRelic!=null}))]),xi=w(()=>Ot.apply(1)),ii=_t(()=>[we(()=>({multiplier:()=>ie("gravel")?4:2,description:()=>(ie("gravel")?"Empowered ":"")+Le.gravel.name,enabled:()=>n.value.gravel!=null}))]),Cn=w(()=>ii.apply(1)),ri=_t(()=>[zt(()=>({addend:()=>ie("copper")?.004:.002,description:()=>(ie("copper")?"Empowered ":"")+Le.copper.name,enabled:()=>n.value.copper!=null}))]),On=w(()=>ri.apply(1.01)),qt=Object.keys(St).reduce((x,E)=>{const F=_t(()=>[we(()=>({multiplier:2,description:"Dowsing",enabled:()=>I.value!=null&&ye(I.value)&&I.value.state.resources.includes(E)}))]),j=w(()=>F.apply(St[E])),W={title:`${tt(E)} Drop Rate`,modifier:F,base:St[E]};return x[E]={modifier:F,computedModifier:j,section:W},x},{}),qn=Object.keys(St).reduce((x,E)=>{const F=_t(()=>[we(()=>({multiplier:()=>{var ee;return(ee=ae.value[E])!=null?ee:1},description:"Planar Treasures",enabled:()=>{var ee;return o.neq((ee=ae.value[E])!=null?ee:1,1)}}))]),j=w(()=>F.apply(1)),W={title:`${tt(E)} Gain`,modifier:F};return x[E]={modifier:F,computedModifier:j,section:W},x},{}),ai=w(()=>{var E,F,j;const x=Lt.indexOf((j=(F=(E=D.value)==null?void 0:E.state)==null?void 0:F.tier)!=null?j:"dirt");return o.add(x,1).times(x).div(2).add(9).pow10()}),si=_t(()=>[...Object.keys(Nt).map(x=>we(()=>({multiplier:Nt[x].cost,description:Nt[x].display,enabled:()=>{var E,F,j;return(j=(F=(E=D.value)==null?void 0:E.state)==null?void 0:F.influences.includes(x))!=null?j:!1},smallerIsBetter:!0}))),we(()=>({multiplier:()=>ie("emeraldRelic")?.05:.1,description:()=>(ie("emeraldRelic")?"Empowered ":"")+Tt.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),$i=w(()=>si.apply(ai.value)),[Ke,Ei]=Wn(()=>[{title:"Resource Levels",modifier:Te,base:0},{title:"Energy Gain",modifier:Xt,base:0,unit:"/s"},{title:"Portal Cost",modifier:si,base:ai,unit:" energy",baseText:()=>{var x,E,F;return`${tt((F=(E=(x=D.value)==null?void 0:x.state)==null?void 0:E.tier)!=null?F:"dirt")}-tier Base Cost`},visible:()=>D.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:Fn,base:0,visible:()=>o.gt(Nn.value,0)}]),[Pi,q]=Wn(()=>[{title:"Mining Speed",modifier:Ot,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:ii,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ri,base:1.01,visible:()=>n.value.copper!=null}]),[L,Se]=Wn(()=>Object.values(qt).map(x=>x.section)),[Qe,kn]=Wn(()=>Object.values(qn).map(x=>x.section)),ze=Ou({general:()=>({display:"General",glowColor(){return ze.activeTab.value===this.tab?"white":""},tab:Ke,energyTabCollapsed:Ei}),mining:()=>({display:"Mine",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Pi,miningTabCollapsed:q}),resources:()=>({display:"Mine Rates",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>I.value!=null,tab:L,resourcesCollapsed:Se}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(qn).some(x=>o.neq(x.computedModifier.value,1)),tab:Qe,resourceGainCollapsed:kn})}),$t=U(!1),Vt=J(()=>p(Ht,{modelValue:$t.value,"onUpdate:modelValue":x=>$t.value=x},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>rt(ze)}));this.on("preUpdate",x=>{if(Object.keys(u).forEach(E=>{u[E]-=x,u[E]<=0&&delete u[E]}),Object.keys(c).forEach(E=>{c[E]-=x,c[E]<=0&&delete c[E]}),ye(C.value)){const E=o.add(C.value.state.progress,o.times(xi.value,x)),F=E.floor();C.value.state={...C.value.state,progress:o.sub(E,F)};const j=F.div(B.value).floor();j.gt(0)&&Lt.forEach(ee=>{fe(ee,o.times(new o(qt[ee].computedModifier.value).toNumber(),j).times(Cn.value)),u[ee]=.3});const W=o.sub(F,j).toNumber();for(let ee=0;ee<W;ee++){const sn=Math.floor(Math.random()*B.value);let li=0;for(let Bn=0;Bn<Lt.length;Bn++){const Mn=Lt[Bn];if(li+=new o(qt[Mn].computedModifier.value).toNumber(),sn<li){fe(Mn,Cn.value),u[Mn]=.3;break}}}}if(P.value!=null&&ye(P.value)){const{progress:E,resources:F}=P.value.state;if(F.length>0){let j=o.add(E,x);const W=o.div(E,h.value).floor();j=o.sub(j,o.times(W,h.value)),P.value.state={...P.value.state,progress:j},o.gt(W,0)&&F.forEach(ee=>{fe(ee,W),c[ee]=.3})}}e.value=o.add(e.value,o.times(at.value,x)),o.lt(e.value,0)&&(e.value=0,Z.forEach(E=>{var F;((F=E.value)==null?void 0:F.state).powered=!1}),Object.values(a.value).forEach(E=>{E.state.powered=!1}),C.value.state={...C.value.state,powered:!1},Nr.warning(p("div",null,[p("h3",null,[T("Ran out of energy!")]),p("div",null,[T("All machines have been turned off.")])])))});const Bt=w(()=>{var x,E;return g.selectedAction.value===g.types.brokenFactory.actions[0]?-100:g.selectedAction.value===g.types.factory.actions[1]?o.neg(Le[g.selectedNode.value.state].cost):((x=g.selectedAction.value)==null?void 0:x.id)==="moreConnections"?o.neg(g.selectedAction.value.formula.evaluate(((E=g.selectedNode.value)==null?void 0:E.state).maxConnections)):0}),nt=cn(m.variable(0).add(e),()=>o.neq(Bt.value,0),Bt),Et=w(()=>{var x;return g.selectedAction.value===Ft?((x=g.selectedNode.value)==null?void 0:x.state).powered?o.eq(d.value,1)?10:o.pow(100,d.value).div(10).times(.99):o.neg(f.value):0}),an=cn(m.variable(0).add(at),()=>o.neq(Et.value,0),Et),oi=w(()=>g.types.portal.nodes.value.filter(x=>ye(x))),Vn=w(()=>oi.value.sort((x,E)=>{var W,ee;const F=(W=he[x.state.id])!=null&&W.minimized.value?1:0,j=(ee=he[E.state.id])!=null&&ee.minimized.value?1:0;return F-j}).map(x=>x.state.id));return vt(Vn,x=>{Gt(()=>{K.tabs=["main",...x]})}),vt(Nn,(x,E)=>{o.lt(x,E)&&(un(x,I,"resources"),un(x,P,"resources"),un(x,S,"tools"),un(x,V,"portals"),un(x,oe,"portals"),un(x,le,"portals"),un(x,Q,"portals"))}),{name:"World",board:g,energy:e,modifierTabs:ze,resourceNodes:t,toolNodes:n,influenceNodes:r,grantResource:fe,activePortals:oi,nextPowerCost:f,computedBonusConnectionsModifier:Nn,quarryProgressRequired:h,dropRates:qt,dowsing:I,empowerer:S,booster:V,upgrader:oe,automator:le,investments:Q,resourceLevels:l,planarMultis:ae,computedPortalCost:$i,display:J(()=>p(re,null,[p(hi,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[rt(nt)])," ",T("energy")]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(at.value,0)?"+":"",rt(an)]),T("/s)")]),o.gt(d.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[ft(d.value)])," ",T("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>$t.value=!0},[T("modifiers")])]),K.devSpeed===0?p("span",{class:"nav-segment"},[T("Game Paused")]):K.devSpeed!=null&&K.devSpeed!==1?p("span",{class:"nav-segment"},[T("Dev Speed: "),Me(K.devSpeed),T("x")]):null]}),rt(g),rt(Vt)]))}}),kf=e=>{var i,r,a,l,u;const t=[y];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(ia(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},ir=U(!1);function Mf(e,t){}var Sf=Object.freeze(Object.defineProperty({__proto__:null,main:y,getInitialLayers:kf,hasWon:ir,fixOldSave:Mf},Symbol.toStringTag,{value:"Module"}));const ni=e=>(hn("data-v-4a50ce42"),e=e(),bn(),e),If={class:"game-over-modal-header"},xf=["src","alt"],$f={class:"game-over-modal-title"},Ef=ni(()=>N("h2",null,"Congratulations!",-1)),Pf={key:0},Tf=ni(()=>N("br",null,null,-1)),Df=ni(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Af=ni(()=>N("br",null,null,-1)),Rf=["href"],Ff=ni(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Of=Y({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=me,u=w(()=>_i(K.timePlayed)),c=w(()=>ir.value&&!K.keepGoing),d=en(K,"autosave");function v(){K.keepGoing=!0}function f(){dn(Pn())}return(h,g)=>(M(),te(Ht,{"model-value":s(c)},{header:H(()=>[N("div",If,[s(n)?(M(),A("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,xf)):z("",!0),N("div",$f,[Ef,N("h4",null,"You've beaten "+ce(s(t))+" v"+ce(s(a))+": "+ce(s(l)),1)])])]),body:H(({shown:C})=>[C?(M(),A("div",Pf,[N("div",null,"It took you "+ce(s(u))+" to beat the game.",1),Tf,Df,Af,N("div",null,[N("a",{href:s(r),class:"game-over-modal-discord-link"},[Ff,T(" "+ce(s(i)),1)],8,Rf)]),p(jt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":g[0]||(g[0]=_=>Oe(d)?d.value=_:null)},null,8,["modelValue"])])):z("",!0)]),footer:H(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:v,class:"button"},"Keep Going"),N("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var qf=pe(Of,[["__scopeId","data-v-4a50ce42"]]);const Ii=e=>(hn("data-v-2776d67d"),e=e(),bn(),e),Vf=Ii(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),Bf={key:0},Lf=Ii(()=>N("br",null,null,-1)),jf=["href"],zf=Ii(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Uf=Ii(()=>N("br",null,null,-1)),Gf={class:"nan-footer"},Wf=Y({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=me,i=U(!0),r=U(!0),a=en(Ue,"hasNaN"),l=U(null);vt(a,h=>{h?(i.value=K.autosave,r.value=K.devSpeed===0):(K.autosave=i.value,K.devSpeed=r.value?0:null)});const u=w(()=>{var h;return(h=Ue.NaNPath)==null?void 0:h.join(".")}),c=w(()=>Ue.NaNPersistent!=null?Ue.NaNPersistent.value:null);function d(){Ue.NaNPersistent!=null&&(Ue.NaNPersistent.value=new o(0),Ue.hasNaN=!1)}function v(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(1),Ue.hasNaN=!1)}function f(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(NaN),Ue.hasNaN=!1)}return(h,g)=>(M(),A(re,null,[p(Ht,Wt({modelValue:s(a),"onUpdate:modelValue":g[4]||(g[4]=C=>Oe(a)?a.value=C:null)},h.$attrs),{header:H(()=>[Vf]),body:H(()=>[N("div",null,[T(' Attempted to assign "'+ce(s(u))+'" to NaN',1),s(c)?(M(),A("span",Bf,ce(" ")+"(previously "+ce(s(Me)(s(c)))+")",1)):z("",!0),T(". Auto-saving has been "+ce(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Lf,N("div",null,[N("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[zf,T(" "+ce(s(t)||"The Paper Pilot Community"),1)],8,jf)]),Uf,p(jt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=C=>i.value=C)},null,8,["modelValue"]),s(me).enablePausing?(M(),te(jt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":g[1]||(g[1]=C=>r.value=C)},null,8,["modelValue"])):z("",!0)]),footer:H(()=>[N("div",Gf,[N("button",{onClick:g[2]||(g[2]=C=>{var _;return(_=l.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:d,class:"button"},"Set to 0"),N("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),A("button",{key:0,onClick:g[3]||(g[3]=C=>a.value=!1),class:"button"}," Set to previous ")):z("",!0),N("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(zr,{ref_key:"savesManager",ref:l},null,512)],64))}});var Hf=pe(Wf,[["__scopeId","data-v-2776d67d"]]);const Zf={key:0,class:"tpsDisplay"},Xf=Y({__name:"TPS",setup(e){const t=w(()=>o.div(Ue.lastTenTicks.length,Ue.lastTenTicks.reduce((n,i)=>n+i,0)));return(n,i)=>s(t).isNan()?z("",!0):(M(),A("div",Zf,"TPS: "+ce(s(ft)(s(t))),1))}});var Yf=pe(Xf,[["__scopeId","data-v-89b89152"]]);var Jf=Y({__name:"App",setup(e){const t=me.useHeader,n=w(()=>Ct[ue.theme].variables),i=en(ue,"showTPS"),r=w(()=>de(J(()=>p(re,null,[Ds.map(rt)]))));return(a,l)=>(M(),A(re,null,[N("div",{id:"modal-root",style:je(s(n))},null,4),N("div",{class:be(["app",{useHeader:s(t)}]),style:je(s(n))},[s(t)?(M(),te(Ur,{key:0})):z("",!0),p(Yl),s(s(i))?(M(),te(Yf,{key:1})):z("",!0),p(qf),p(Hf),(M(),te(Xe(s(r))))],6)],64))}});var Kf=pe(Jf,[["__scopeId","data-v-41d15e5e"]]);function Qf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,v;const f=async(g=!0)=>{await d,g&&(u==null||u.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function h(){if("serviceWorker"in navigator){const{Workbox:g,messageSW:C}=await Zn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await C(c.waiting,{type:"SKIP_WAITING"})},u=new g("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",_=>{_.isUpdate||i==null||i()});{const _=()=>{n==null||n()};u.addEventListener("waiting",_),u.addEventListener("externalwaiting",_)}u.register({immediate:t}).then(_=>{c=_,a?a("./sw.js",_):r==null||r(_)}).catch(_=>{l==null||l(_)})}}return d=h(),f}function ep(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=U(!1),c=U(!1);return{updateServiceWorker:Qf({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=me.title;window.projInfo=me;if(me.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c
|
|
Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Is();const{globalBus:e}=await Zn(()=>Promise.resolve().then(function(){return Ms}),void 0),{startGameLoop:t}=await Zn(()=>import("./gameLoop.c3596ec6.js"),["assets/gameLoop.c3596ec6.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=Na(Kf);e.emit("setupVue",n),n.mount("#app"),Gt(()=>{const i=wi(),{updateServiceWorker:r}=ep({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Zn as _,Ue as a,me as b,Sf as c,Ye as g,xs as l,K as p,ue as s};
|