pages/ludwig/assets/index.624ae6e9.js

15 lines
121 KiB
JavaScript

/* empty css */import"./vue.5bd9f35e.js";import{Z as x,q as $e,C as u,t as _,b1 as de,aa as U,aE as m,a0 as E,a1 as c,aK as pe,G as $,w as et,b2 as Et,a8 as A,O as ne,ay as zt,ar as Xe,aG as at,A as ye,_ as z,b6 as T,b8 as Bt,bs as va,aq as je,bu as He,bb as Ut,T as pa,a7 as I,u as _t,j as ya,l as ge,bv as vt,aL as ba,$ as M,aN as Ae,J as G,I as Fe,aH as be,aF as Ne,z as Me,br as Na,aJ as Ca,bc as nt,ao as Ea,bn as Ba,be as _a}from"./@vue.4ce677c2.js";import{c as Ot}from"./nanoevents.1080beb7.js";import{L as ve}from"./lz-string.f2f3b7cf.js";import{D as wa}from"./vuedraggable.832ed13e.js";import{Y as Ia}from"./vue-next-select.8d9e0122.js";import{p as Sa}from"./vue-textarea-autosize.35804eaf.js";import{s as Qa}from"./semver.d101e2be.js";import{l as Ma}from"./socket.io-client.79ce0df5.js";import{u as Yt,s as ka}from"./vue-toastification.b272a510.js";import{v as Ta,n as Da}from"./workbox-window.8d14e8b7.js";import"./lru-cache.9506e0ec.js";import"./yallist.fd762fe7.js";import"./sortablejs.80af5380.js";import"./engine.io-client.58517560.js";import"./engine.io-parser.3f360695.js";import"./@socket.io.aec831e2.js";import"./socket.io-parser.544e37d1.js";const Ra=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function a(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=a(i);fetch(i.href,s)}};Ra();const Va="modulepreload",Tt={},qa="./",ot=function(t,a){return!a||a.length===0?t():Promise.all(a.map(n=>{if(n=`${qa}${n}`,n in Tt)return;Tt[n]=!0;const i=n.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${s}`))return;const o=document.createElement("link");if(o.rel=i?"stylesheet":Va,i||(o.as="script",o.crossOrigin=""),o.href=n,document.head.appendChild(o),i)return new Promise((l,g)=>{o.addEventListener("load",l),o.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Ga="./projInfo-schema.json",Pa="Super Auto Coots",xa="A project made in Profectus",Fa="superautocoots",za="thepaperpilot and crea",Ua="",Oa="",Ya="0.0.0",Ja="Initial Commit",La=!1,Wa=!1,Xa=2,ja=!0,Ha=null,Ka="",Za=["main"],$a=3600,en=1,tn=!0,an="base64";var P={$schema:Ga,title:Pa,description:xa,id:Fa,author:za,discordName:Ua,discordLink:Oa,versionNumber:Ya,versionTitle:Ja,allowGoBack:La,defaultShowSmall:Wa,defaultDecimalsShown:Xa,useHeader:ja,banner:Ha,logo:Ka,initialTabs:Za,maxTickLength:$a,offlineLimit:en,enablePausing:tn,exportEncoding:an};class nn{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 a=this.map.get(t);if(a!==void 0)return a!==this.first&&(a===this.last?(this.last=a.prev,this.last.next=void 0):(a.prev.next=a.next,a.next.prev=a.prev),a.next=this.first,this.first.prev=a,this.first=a),a.value}set(t,a){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const n=new sn(t,a);for(this.first===void 0?(this.first=n,this.last=n):(n.next=this.first,this.first.prev=n,this.first=n),this.map.set(t,n);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class sn{constructor(t,a){this.next=void 0,this.prev=void 0,this.key=t,this.value=a}}const ft=17,rn=9e15,on=Math.log10(9e15),ln=1/9e15,An=308,un=-324,Dt=5,cn=(1<<10)-1,dn=function(){const e=[];for(let a=un+1;a<=An;a++)e.push(Number("1e"+a));const t=323;return function(a){return e[a+t]}}(),Ee=[2,Math.E,3,4,5,6,7,8,9,10],gn=[[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]],mn=[[-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 d=function(t){return C.fromValue_noAlloc(t)},Q=function(e,t,a){return C.fromComponents(e,t,a)},k=function(t,a,n){return C.fromComponents_noNormalize(t,a,n)};const he=function(t,a){const n=a+1,i=Math.ceil(Math.log10(Math.abs(t))),s=Math.round(t*Math.pow(10,n-i))*Math.pow(10,i-n);return parseFloat(s.toFixed(Math.max(n-i,0)))},ht=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},fn=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 a=.9189385332046727;a=a+(e+.5)*Math.log(e),a=a-e;const n=e*e;let i=e;return a=a+1/(12*i),i=i*n,a=a+1/(360*i),i=i*n,a=a+1/(1260*i),i=i*n,a=a+1/(1680*i),i=i*n,a=a+1/(1188*i),i=i*n,a=a+691/(360360*i),i=i*n,a=a+7/(1092*i),i=i*n,a=a+3617/(122400*i),Math.exp(a)/t},Jt=.5671432904097838,Rt=function(e,t=1e-10){let a,n;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Jt;e<10?a=0:a=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(n=(e*Math.exp(-a)+a*a)/(a+1),Math.abs(n-a)<t*Math.abs(n))return n;a=n}throw Error(`Iteration failed to converge: ${e.toString()}`)};function Vt(e,t=1e-10){let a,n,i,s;if(!Number.isFinite(e.mag)||e.eq(C.dZero))return e;if(e.eq(C.dOne))return C.fromNumber(Jt);a=C.ln(e);for(let o=0;o<100;++o){if(n=a.neg().exp(),i=a.sub(e.mul(n)),s=a.sub(i.div(a.add(1).sub(a.add(2).mul(i).div(C.mul(2,a).add(2))))),C.abs(s.sub(a)).lt(C.abs(s).mul(t)))return s;a=s}throw Error(`Iteration failed to converge: ${e.toString()}`)}const r=class{constructor(e){this.sign=0,this.mag=0,this.layer=0,e instanceof r?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/dn(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,a){return new r().fromComponents(e,t,a)}static fromComponents_noNormalize(e,t,a){return new r().fromComponents_noNormalize(e,t,a)}static fromMantissaExponent(e,t){return new r().fromMantissaExponent(e,t)}static fromMantissaExponent_noNormalize(e,t){return new r().fromMantissaExponent_noNormalize(e,t)}static fromDecimal(e){return new r().fromDecimal(e)}static fromNumber(e){return new r().fromNumber(e)}static fromString(e){return new r().fromString(e)}static fromValue(e){return new r().fromValue(e)}static fromValue_noAlloc(e){if(e instanceof r)return e;if(typeof e=="string"){const t=r.fromStringCache.get(e);return t!==void 0?t:r.fromString(e)}else return typeof e=="number"?r.fromNumber(e):r.dZero}static abs(e){return d(e).abs()}static neg(e){return d(e).neg()}static negate(e){return d(e).neg()}static negated(e){return d(e).neg()}static sign(e){return d(e).sign}static sgn(e){return d(e).sign}static round(e){return d(e).round()}static floor(e){return d(e).floor()}static ceil(e){return d(e).ceil()}static trunc(e){return d(e).trunc()}static add(e,t){return d(e).add(t)}static plus(e,t){return d(e).add(t)}static sub(e,t){return d(e).sub(t)}static subtract(e,t){return d(e).sub(t)}static minus(e,t){return d(e).sub(t)}static mul(e,t){return d(e).mul(t)}static multiply(e,t){return d(e).mul(t)}static times(e,t){return d(e).mul(t)}static div(e,t){return d(e).div(t)}static divide(e,t){return d(e).div(t)}static recip(e){return d(e).recip()}static reciprocal(e){return d(e).recip()}static reciprocate(e){return d(e).reciprocate()}static cmp(e,t){return d(e).cmp(t)}static cmpabs(e,t){return d(e).cmpabs(t)}static compare(e,t){return d(e).cmp(t)}static isNaN(e){return e=d(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag)}static isFinite(e){return e=d(e),isFinite(e.sign)&&isFinite(e.layer)&&isFinite(e.mag)}static eq(e,t){return d(e).eq(t)}static equals(e,t){return d(e).eq(t)}static neq(e,t){return d(e).neq(t)}static notEquals(e,t){return d(e).notEquals(t)}static lt(e,t){return d(e).lt(t)}static lte(e,t){return d(e).lte(t)}static gt(e,t){return d(e).gt(t)}static gte(e,t){return d(e).gte(t)}static max(e,t){return d(e).max(t)}static min(e,t){return d(e).min(t)}static minabs(e,t){return d(e).minabs(t)}static maxabs(e,t){return d(e).maxabs(t)}static clamp(e,t,a){return d(e).clamp(t,a)}static clampMin(e,t){return d(e).clampMin(t)}static clampMax(e,t){return d(e).clampMax(t)}static cmp_tolerance(e,t,a){return d(e).cmp_tolerance(t,a)}static compare_tolerance(e,t,a){return d(e).cmp_tolerance(t,a)}static eq_tolerance(e,t,a){return d(e).eq_tolerance(t,a)}static equals_tolerance(e,t,a){return d(e).eq_tolerance(t,a)}static neq_tolerance(e,t,a){return d(e).neq_tolerance(t,a)}static notEquals_tolerance(e,t,a){return d(e).notEquals_tolerance(t,a)}static lt_tolerance(e,t,a){return d(e).lt_tolerance(t,a)}static lte_tolerance(e,t,a){return d(e).lte_tolerance(t,a)}static gt_tolerance(e,t,a){return d(e).gt_tolerance(t,a)}static gte_tolerance(e,t,a){return d(e).gte_tolerance(t,a)}static pLog10(e){return d(e).pLog10()}static absLog10(e){return d(e).absLog10()}static log10(e){return d(e).log10()}static log(e,t){return d(e).log(t)}static log2(e){return d(e).log2()}static ln(e){return d(e).ln()}static logarithm(e,t){return d(e).logarithm(t)}static pow(e,t){return d(e).pow(t)}static pow10(e){return d(e).pow10()}static pow_base(e,t){return d(e).pow_base(t)}static root(e,t){return d(e).root(t)}static factorial(e,t){return d(e).factorial()}static gamma(e,t){return d(e).gamma()}static lngamma(e,t){return d(e).lngamma()}static exp(e){return d(e).exp()}static sqr(e){return d(e).sqr()}static sqrt(e){return d(e).sqrt()}static cube(e){return d(e).cube()}static cbrt(e){return d(e).cbrt()}static tetrate(e,t=2,a=k(1,0,1)){return d(e).tetrate(t,a)}static iteratedexp(e,t=2,a=k(1,0,1)){return d(e).iteratedexp(t,a)}static iteratedlog(e,t=10,a=1){return d(e).iteratedlog(t,a)}static layeradd10(e,t){return d(e).layeradd10(t)}static layeradd(e,t,a=10){return d(e).layeradd(t,a)}static slog(e,t=10){return d(e).slog(t)}static lambertw(e){return d(e).lambertw()}static ssqrt(e){return d(e).ssqrt()}static pentate(e,t=2,a=k(1,0,1)){return d(e).pentate(t,a)}static sin(e){return d(e).sin()}static cos(e){return d(e).cos()}static tan(e){return d(e).tan()}static asin(e){return d(e).asin()}static acos(e){return d(e).acos()}static atan(e){return d(e).atan()}static sinh(e){return d(e).sinh()}static cosh(e){return d(e).cosh()}static tanh(e){return d(e).tanh()}static asinh(e){return d(e).asinh()}static acosh(e){return d(e).acosh()}static atanh(e){return d(e).atanh()}static affordGeometricSeries(e,t,a,n){return this.affordGeometricSeries_core(d(e),d(t),d(a),n)}static sumGeometricSeries(e,t,a,n){return this.sumGeometricSeries_core(e,d(t),d(a),n)}static affordArithmeticSeries(e,t,a,n){return this.affordArithmeticSeries_core(d(e),d(t),d(a),d(n))}static sumArithmeticSeries(e,t,a,n){return this.sumArithmeticSeries_core(d(e),d(t),d(a),d(n))}static efficiencyOfPurchase(e,t,a){return this.efficiencyOfPurchase_core(d(e),d(t),d(a))}static randomDecimalForTesting(e){if(Math.random()*20<1)return k(0,0,0);const t=Math.random()>.5?1:-1;if(Math.random()*20<1)return k(t,0,1);const a=Math.floor(Math.random()*(e+1));let n=a===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(n=Math.trunc(n));let i=Math.pow(10,n);return Math.random()>.9&&(i=Math.trunc(i)),Q(t,a,i)}static affordGeometricSeries_core(e,t,a,n){const i=t.mul(a.pow(n));return r.floor(e.div(i).mul(a.sub(1)).add(1).log10().div(a.log10()))}static sumGeometricSeries_core(e,t,a,n){return t.mul(a.pow(n)).mul(r.sub(1,a.pow(e))).div(r.sub(1,a))}static affordArithmeticSeries_core(e,t,a,n){const s=t.add(n.mul(a)).sub(a.div(2)),o=s.pow(2);return s.neg().add(o.add(a.mul(e).mul(2)).sqrt()).div(a).floor()}static sumArithmeticSeries_core(e,t,a,n){const i=t.add(n.mul(a));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(a)))}static efficiencyOfPurchase_core(e,t,a){return e.div(t).add(e.div(a))}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<ln)return this.layer+=1,this.mag=Math.log10(this.mag),this;let e=Math.abs(this.mag),t=Math.sign(this.mag);if(e>=rn)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e<on&&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,a){return this.sign=e,this.layer=t,this.mag=a,this.normalize(),this}fromComponents_noNormalize(e,t,a){return this.sign=e,this.layer=t,this.mag=a,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,a=r.fromStringCache.get(t);if(a!==void 0)return this.fromDecimal(a);e=e.replace(",","");const n=e.split("^^^");if(n.length===2){const h=parseFloat(n[0]),w=parseFloat(n[1]),O=n[1].split(";");let W=1;if(O.length===2&&(W=parseFloat(O[1]),isFinite(W)||(W=1)),isFinite(h)&&isFinite(w)){const p=r.pentate(h,w,W);return this.sign=p.sign,this.layer=p.layer,this.mag=p.mag,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}}const i=e.split("^^");if(i.length===2){const h=parseFloat(i[0]),w=parseFloat(i[1]),O=i[1].split(";");let W=1;if(O.length===2&&(W=parseFloat(O[1]),isFinite(W)||(W=1)),isFinite(h)&&isFinite(w)){const p=r.tetrate(h,w,W);return this.sign=p.sign,this.layer=p.layer,this.mag=p.mag,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}}const s=e.split("^");if(s.length===2){const h=parseFloat(s[0]),w=parseFloat(s[1]);if(isFinite(h)&&isFinite(w)){const O=r.pow(h,w);return this.sign=O.sign,this.layer=O.layer,this.mag=O.mag,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}}e=e.trim().toLowerCase();let o,l,g=e.split("pt");if(g.length===2){o=10,l=parseFloat(g[0]),g[1]=g[1].replace("(",""),g[1]=g[1].replace(")","");let h=parseFloat(g[1]);if(isFinite(h)||(h=1),isFinite(o)&&isFinite(l)){const w=r.tetrate(o,l,h);return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}}if(g=e.split("p"),g.length===2){o=10,l=parseFloat(g[0]),g[1]=g[1].replace("(",""),g[1]=g[1].replace(")","");let h=parseFloat(g[1]);if(isFinite(h)||(h=1),isFinite(o)&&isFinite(l)){const w=r.tetrate(o,l,h);return this.sign=w.sign,this.layer=w.layer,this.mag=w.mag,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}}const f=e.split("e"),b=f.length-1;if(b===0){const h=parseFloat(e);if(isFinite(h))return this.fromNumber(h),r.fromStringCache.size>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}else if(b===1){const h=parseFloat(e);if(isFinite(h)&&h!==0)return this.fromNumber(h),r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}const v=e.split("e^");if(v.length===2){this.sign=1,v[0].charAt(0)=="-"&&(this.sign=-1);let h="";for(let w=0;w<v[1].length;++w){const O=v[1].charCodeAt(w);if(O>=43&&O<=57||O===101)h+=v[1].charAt(w);else return this.layer=parseFloat(h),this.mag=parseFloat(v[1].substr(w+1)),this.normalize(),r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}}if(b<1)return this.sign=0,this.layer=0,this.mag=0,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this;const y=parseFloat(f[0]);if(y===0)return this.sign=0,this.layer=0,this.mag=0,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this;let N=parseFloat(f[f.length-1]);if(b>=2){const h=parseFloat(f[f.length-2]);isFinite(h)&&(N*=Math.sign(h),N+=ht(h))}if(!isFinite(y))this.sign=f[0]==="-"?-1:1,this.layer=b,this.mag=N;else if(b===1)this.sign=Math.sign(y),this.layer=1,this.mag=N+Math.log10(Math.abs(y));else if(this.sign=Math.sign(y),this.layer=b,b===2){const h=r.mul(Q(1,2,N),d(y));return this.sign=h.sign,this.layer=h.layer,this.mag=h.mag,r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}else this.mag=N;return this.normalize(),r.fromStringCache.maxSize>=1&&r.fromStringCache.set(t,r.fromDecimal(this)),this}fromValue(e){return e instanceof r?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:he(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:he(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<=Dt?(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):he(this.m,e)+"e"+he(this.e,e):this.layer===1?he(this.m,e)+"e"+he(this.e,e):this.layer<=Dt?(this.sign===-1?"-":"")+"e".repeat(this.layer)+he(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+he(this.mag,e)}abs(){return k(this.sign===0?0:1,this.layer,this.mag)}neg(){return k(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?r.dZero:this.layer===0?Q(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?r.dZero:this.layer===0?Q(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?r.dZero:this.layer===0?Q(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?r.dZero:this.layer===0?Q(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=d(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 k(0,0,0);let a,n;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(r.cmpabs(this,t)>0?(a=this,n=t):(a=t,n=this),a.layer===0&&n.layer===0)return r.fromNumber(a.sign*a.mag+n.sign*n.mag);const i=a.layer*Math.sign(a.mag),s=n.layer*Math.sign(n.mag);if(i-s>=2)return a;if(i===0&&s===-1){if(Math.abs(n.mag-Math.log10(a.mag))>ft)return a;{const o=Math.pow(10,Math.log10(a.mag)-n.mag),l=n.sign+a.sign*o;return Q(Math.sign(l),1,n.mag+Math.log10(Math.abs(l)))}}if(i===1&&s===0){if(Math.abs(a.mag-Math.log10(n.mag))>ft)return a;{const o=Math.pow(10,a.mag-Math.log10(n.mag)),l=n.sign+a.sign*o;return Q(Math.sign(l),1,Math.log10(n.mag)+Math.log10(Math.abs(l)))}}if(Math.abs(a.mag-n.mag)>ft)return a;{const o=Math.pow(10,a.mag-n.mag),l=n.sign+a.sign*o;return Q(Math.sign(l),1,n.mag+Math.log10(Math.abs(l)))}}plus(e){return this.add(e)}sub(e){return this.add(d(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=d(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return k(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return k(this.sign*t.sign,0,1);let a,n;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(a=this,n=t):(a=t,n=this),a.layer===0&&n.layer===0)return r.fromNumber(a.sign*n.sign*a.mag*n.mag);if(a.layer>=3||a.layer-n.layer>=2)return Q(a.sign*n.sign,a.layer,a.mag);if(a.layer===1&&n.layer===0)return Q(a.sign*n.sign,1,a.mag+Math.log10(n.mag));if(a.layer===1&&n.layer===1)return Q(a.sign*n.sign,1,a.mag+n.mag);if(a.layer===2&&n.layer===1){const i=Q(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)).add(Q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)));return Q(a.sign*n.sign,i.layer+1,i.sign*i.mag)}if(a.layer===2&&n.layer===2){const i=Q(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)).add(Q(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)));return Q(a.sign*n.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=d(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?r.dNaN:this.layer===0?Q(this.sign,0,1/this.mag):Q(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=d(e);return this.sign>t.sign?1:this.sign<t.sign?-1:this.sign*this.cmpabs(e)}cmpabs(e){const t=d(e),a=this.mag>0?this.layer:-this.layer,n=t.mag>0?t.layer:-t.layer;return a>n?1:a<n?-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=d(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=d(e);return this.lt(t)?t:this}min(e){const t=d(e);return this.gt(t)?t:this}maxabs(e){const t=d(e);return this.cmpabs(t)<0?t:this}minabs(e){const t=d(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 a=d(e);return this.eq_tolerance(a,t)?0:this.cmp(a)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const a=d(e);if(t==null&&(t=1e-7),this.sign!==a.sign||Math.abs(this.layer-a.layer)>1)return!1;let n=this.mag,i=a.mag;return this.layer>a.layer&&(i=ht(i)),this.layer<a.layer&&(n=ht(n)),Math.abs(n-i)<=t*Math.max(Math.abs(n),Math.abs(i))}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 a=d(e);return!this.eq_tolerance(a,t)&&this.lt(a)}lte_tolerance(e,t){const a=d(e);return this.eq_tolerance(a,t)||this.lt(a)}gt_tolerance(e,t){const a=d(e);return!this.eq_tolerance(a,t)&&this.gt(a)}gte_tolerance(e,t){const a=d(e);return this.eq_tolerance(a,t)||this.gt(a)}pLog10(){return this.lt(r.dZero)?r.dZero:this.log10()}absLog10(){return this.sign===0?r.dNaN:this.layer>0?Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Q(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?r.dNaN:this.layer>0?Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):Q(this.sign,0,Math.log10(this.mag))}log(e){return e=d(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?r.dNaN:this.layer===0&&e.layer===0?Q(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):r.div(this.log10(),e.log10())}log2(){return this.sign<=0?r.dNaN:this.layer===0?Q(this.sign,0,Math.log2(this.mag)):this.layer===1?Q(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?Q(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?r.dNaN:this.layer===0?Q(this.sign,0,Math.log(this.mag)):this.layer===1?Q(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?Q(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):Q(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=d(e),a=this,n=t;if(a.sign===0)return n.eq(0)?k(1,0,1):a;if(a.sign===1&&a.layer===0&&a.mag===1)return a;if(n.sign===0)return k(1,0,1);if(n.sign===1&&n.layer===0&&n.mag===1)return a;const i=a.absLog10().mul(n).pow10();return this.sign===-1?Math.abs(n.toNumber()%2)%2===1?i.neg():Math.abs(n.toNumber()%2)%2===0?i:r.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return r.dNaN;let e=this;if(e.layer===0){const t=Math.pow(10,e.sign*e.mag);if(Number.isFinite(t)&&Math.abs(t)>=.1)return Q(1,0,t);if(e.sign===0)return r.dOne;e=k(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?Q(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?Q(-e.sign,e.layer+1,-e.mag):r.dOne}pow_base(e){return d(e).pow(this)}root(e){const t=d(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?r.exp(r.mul(this,r.ln(this).sub(1))):r.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(k(1,0,24)))return r.fromNumber(fn(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const a=e*e;let n=e,i=12*n,s=1/i,o=t+s;if(o===t||(t=o,n=n*a,i=360*n,s=1/i,o=t-s,o===t))return r.exp(t);t=o,n=n*a,i=1260*n;let l=1/i;return t=t+l,n=n*a,i=1680*n,l=1/i,t=t-l,r.exp(t)}else return this.layer===1?r.exp(r.mul(this,r.ln(this).sub(1))):r.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?r.dOne:this.layer===0&&this.mag<=709.7?r.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?Q(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?Q(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):Q(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return r.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return Q(1,2,Math.log10(this.mag)-.3010299956639812);{const e=r.div(k(this.sign,this.layer-1,this.mag),k(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=k(1,0,1)){if(e===1)return r.pow(this,t);if(e===0)return new r(t);if(this.eq(r.dOne))return r.dOne;if(this.eq(-1))return r.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return r.fromNumber(Math.E);const s=r.ln(this).neg();return s.lambertw().div(s)}else return i>1.444667861009766?r.fromNumber(Number.POSITIVE_INFINITY):r.dNaN}if(this.eq(r.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),r.fromNumber(i)}if(e<0)return r.iteratedlog(t,this,-e);t=d(t);const a=e;e=Math.trunc(e);const n=a-e;if(this.gt(r.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i<e;++i){const s=t;if(t=this.pow(t),s.eq(t))return t}if(n!=0){const i=this.pow(t);return t.mul(1-n).add(i.mul(n))}return t}n!==0&&(t.eq(r.dOne)?this.gt(10)?t=this.pow(n):(t=r.fromNumber(r.tetrate_critical(this.toNumber(),n)),this.lt(2)&&(t=t.sub(1).mul(this.minus(1)).plus(1))):this.eq(10)?t=t.layeradd10(n):t=t.layeradd(n,this));for(let i=0;i<e;++i){if(t=this.pow(t),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(t.layer-this.layer>3)return k(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=k(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return r.tetrate(e,-t,this);e=d(e);let a=r.fromDecimal(this);const n=t;t=Math.trunc(t);const i=n-t;if(a.layer-e.layer>3){const s=Math.min(t,a.layer-e.layer-3);t-=s,a.layer-=s}for(let s=0;s<t;++s){if(a=a.log(e),!isFinite(a.layer)||!isFinite(a.mag))return a.normalize();if(s>1e4)return a}return i>0&&i<1&&(e.eq(10)?a=a.layeradd10(-i):a=a.layeradd(-i,e)),a}slog(e=10,t=100){let a=.001,n=!1,i=!1,s=this.slog_internal(e).toNumber();for(let o=1;o<t;++o){const g=new r(e).tetrate(s).gt(this);if(o>1&&i!=g&&(n=!0),i=g,n?a/=2:a*=2,a=Math.abs(a)*(g?-1:1),s+=a,a===0)break}return r.fromNumber(s)}slog_internal(e=10){if(e=d(e),e.lte(r.dZero)||e.eq(r.dOne))return r.dNaN;if(e.lt(r.dOne))return this.eq(r.dOne)?r.dZero:this.eq(r.dZero)?r.dNegOne:r.dNaN;if(this.mag<0||this.eq(r.dZero))return r.dNegOne;let t=0,a=r.fromDecimal(this);if(a.layer-e.layer>3){const n=a.layer-e.layer-3;t+=n,a.layer-=n}for(let n=0;n<100;++n)if(a.lt(r.dZero))a=r.pow(e,a),t-=1;else{if(a.lte(r.dOne))return r.fromNumber(t+r.slog_critical(e.toNumber(),a.toNumber()));t+=1,a=r.log(a,e)}return r.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:r.critical_section(e,t,mn)}static tetrate_critical(e,t){return r.critical_section(e,t,gn)}static critical_section(e,t,a){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let n=0,i=0;for(let o=0;o<Ee.length;++o)if(Ee[o]==e){n=a[o][Math.floor(t)],i=a[o][Math.ceil(t)];break}else if(Ee[o]<e&&Ee[o+1]>e){const l=(e-Ee[o])/(Ee[o+1]-Ee[o]);n=a[o][Math.floor(t)]*(1-l)+a[o+1][Math.floor(t)]*l,i=a[o][Math.ceil(t)]*(1-l)+a[o+1][Math.ceil(t)]*l;break}const s=t-Math.floor(t);return n<=0||i<=0?n*(1-s)+i*s:Math.pow(e,Math.log(n)/Math.log(e)*(1-s)+Math.log(i)/Math.log(e)*s)}layeradd10(e){e=r.fromValue_noAlloc(e).toNumber();const t=r.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 a=Math.trunc(e);e-=a,t.layer+=a}if(e<=-1){const a=Math.trunc(e);if(e-=a,t.layer+=a,t.layer<0)for(let n=0;n<100;++n){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 n=this.slog(t).toNumber()+e;return n>=0?r.tetrate(t,n):Number.isFinite(n)?n>=-1?r.log(r.tetrate(t,n+1),t):r.log(r.log(r.tetrate(t,n+2),t),t):r.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return r.fromNumber(Rt(this.toNumber()));if(this.layer===0)return r.fromNumber(Rt(this.sign*this.mag));if(this.layer===1)return Vt(this);if(this.layer===2)return Vt(this);if(this.layer>=3)return k(this.sign,this.layer-1,this.mag);throw"Unhandled behavior in lambertw()"}ssqrt(){if(this.sign==1&&this.layer>=3)return k(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=k(1,0,1)){t=d(t);const a=e;e=Math.trunc(e);const n=a-e;n!==0&&(t.eq(r.dOne)?(++e,t=r.fromNumber(n)):this.eq(10)?t=t.layeradd10(n):t=t.layeradd(n,this));for(let i=0;i<e;++i){if(t=this.tetrate(t.toNumber()),!isFinite(t.layer)||!isFinite(t.mag))return t.normalize();if(i>10)return t}return t}sin(){return this.mag<0?this:this.layer===0?r.fromNumber(Math.sin(this.sign*this.mag)):k(0,0,0)}cos(){return this.mag<0?r.dOne:this.layer===0?r.fromNumber(Math.cos(this.sign*this.mag)):k(0,0,0)}tan(){return this.mag<0?this:this.layer===0?r.fromNumber(Math.tan(this.sign*this.mag)):k(0,0,0)}asin(){return this.mag<0?this:this.layer===0?r.fromNumber(Math.asin(this.sign*this.mag)):k(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?r.fromNumber(Math.acos(this.toNumber())):this.layer===0?r.fromNumber(Math.acos(this.sign*this.mag)):k(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?r.fromNumber(Math.atan(this.sign*this.mag)):r.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 r.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return r.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?k(Number.NaN,Number.NaN,Number.NaN):r.ln(this.add(1).div(r.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(r.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 C=r;C.fromStringCache=new nn(cn);C.dZero=k(0,0,0);C.dOne=k(1,0,1);C.dNegOne=k(-1,0,1);C.dTwo=k(1,0,2);C.dTen=k(1,0,10);C.dNaN=k(Number.NaN,Number.NaN,Number.NaN);C.dInf=k(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);C.dNegInf=k(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);C.dNumberMax=Q(1,0,Number.MAX_VALUE);C.dNumberMin=Q(1,0,Number.MIN_VALUE);d=C.fromValue_noAlloc;Q=C.fromComponents;k=C.fromComponents_noNormalize;C.fromMantissaExponent;C.fromMantissaExponent_noNormalize;const hn=new C(1);function Le(e,t,a=!0){let n=C.log10(e).floor(),i=C.div(e,C.pow(10,n));i.toStringWithDecimalPlaces(t)==="10"&&(i=hn,n=n.add(1));const s=n.gte(1e9)?ae(n,Math.max(Math.max(t,3),P.defaultDecimalsShown)):n.gte(1e4)?lt(n,0):n.toStringWithDecimalPlaces(0);return a?i.toStringWithDecimalPlaces(t)+"e"+s:"e"+s}function lt(e,t){if(e==null)return"NaN";if(e=new C(e),e.mag<.001)return 0 .toFixed(t);const n=e.toStringWithDecimalPlaces(t).split(".");return n[0]=n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),n.length==1?n[0]:n[0]+"."+n[1]}function Lt(e,t){return e==null?"NaN":(e=new C(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),P.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const vn=new C("eeee1000"),pn=new C("e100000"),qt=new C("e1000"),Wt=new C(1e9),yn=new C(1e6),bn=new C(1e3),Nn=new C(.98),Cn=new C(.001),Xt=new C(0);function ae(e,t,a){if(t==null&&(t=P.defaultDecimalsShown),a=a!=null?a:P.defaultShowSmall,e=new C(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ae(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(vn)){const n=e.slog();return n.gte(yn)?"F"+ae(n.floor()):C.pow(10,n.sub(n.floor())).toStringWithDecimalPlaces(3)+"F"+lt(n.floor(),0)}else{if(e.gte(pn))return Le(e,0,!1);if(e.gte(qt))return Le(e,0);if(e.gte(Wt))return Le(e,t);if(e.gte(bn))return lt(e,0);if(e.gte(Cn)||!a)return Lt(e,t);if(e.eq(Xt))return 0 .toFixed(t)}return e=Ht(e),e.lt(qt)?Le(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ae(e,t)+"\u207B\xB9"}function ee(e){return e=new C(e),e.sign<0?"-"+ee(e.neg()):e.gte(Wt)||e.lte(Nn)&&!e.eq(Xt)?ae(e):ae(e,0)}function jt(e){return C.lt(e,0)?"-"+jt(C.neg(e)):C.gt(e,2**51)?ae(C.div(e,31536e3))+"y":(e=new C(e).toNumber(),e<60?ae(e)+"s":e<3600?ee(Math.floor(e/60))+"m "+ae(e%60)+"s":e<86400?ee(Math.floor(e/3600))+"h "+ee(Math.floor(e/60)%60)+"m "+ee(e%60)+"s":e<31536e3?ee(Math.floor(e/84600)%365)+"d "+ee(Math.floor(e/3600)%24)+"h "+ee(Math.floor(e/60)%60)+"m":ee(Math.floor(e/31536e3))+"y "+ee(Math.floor(e/84600)%365)+"d "+ee(Math.floor(e/3600)%24)+"h")}function En(e,t,a){e=new C(e);let n=e.toStringWithDecimalPlaces(t);return new C(n).gte(a)&&(n=C.sub(a,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),n}function Bn(e,t){return ae(e,t,!0)}function Ht(e){let t=C.log10(e).ceil();const a=C.div(e,C.pow(10,t));return t=t.neg(),e=new C(10).pow(t).times(a),e}var _n=Object.freeze(Object.defineProperty({__proto__:null,default:C,exponentialFormat:Le,commaFormat:lt,regularFormat:Lt,format:ae,formatWhole:ee,formatTime:jt,toPlaces:En,formatSmall:Bn,invertOOM:Ht},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:wn,commaFormat:In,regularFormat:Sn,format:Kt,formatWhole:pt,formatTime:wt,toPlaces:Qn,formatSmall:Mn,invertOOM:kn}=_n;window.Decimal=C;window.exponentialFormat=wn;window.commaFormat=In;window.regularFormat=Sn;window.format=Kt;window.formatWhole=pt;window.formatTime=wt;window.toPlaces=Qn;window.formatSmall=Mn;window.invertOOM=kn;function Tn(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function Gt(e){return typeof e=="function"}var J=(e=>(e.Up="Up",e.Down="Down",e.Left="Left",e.Right="Right",e.Default="Up",e))(J||{});const At=Symbol("DoNotCache");function ce(e,t){const a=e[t];Gt(a)&&a.length===0&&!a[At]?e[t]=x(a.bind(e)):Gt(a)&&(e[t]=a.bind(e),e[t][At]=!0)}const Zt=Symbol("Component"),$t=Symbol("GatherProps");let Dn=0;function Rn(e="feature-"){return e+Dn++}function H(e){return e[At]=!0,e}function We(e,t,a){e[t]===void 0&&a!=null&&(e[t]=a)}const Be={variables:{"--foreground":"#dfdfdf","--background":"#0f0f0f","--feature-foreground":"#0f0f0f","--tooltip-background":"rgba(0, 0, 0, 0.75)","--raised-background":"#0f0f0f","--points":"#ffffff","--locked":"#bf8f8f","--highlighted":"#333","--bought":"#77bf5f","--danger":"rgb(220, 53, 69)","--link":"#02f2f2","--outline":"#dfdfdf","--accent1":"#627a82","--accent2":"#658262","--accent3":"#7c6282","--border-radius":"15px","--modal-border":"solid 2px var(--color)","--feature-margin":"0px"},floatingTabs:!0,mergeAdjacent:!0,showPin:!0};var It=(e=>(e.Classic="classic",e.Paper="paper",e.Nordic="nordic",e.Aqua="aqua",e))(It||{}),ct={classic:Be,paper:{...Be,variables:{...Be.variables,"--background":"#2a323d","--feature-foreground":"#000","--raised-background":"#333c4a","--locked":"#3a3e45","--bought":"#5C8A58","--outline":"#333c4a","--border-radius":"4px","--modal-border":"","--feature-margin":"5px"},floatingTabs:!1},nordic:{...Be,variables:{...Be.variables,"--foreground":"#D8DEE9","--background":"#2E3440","--feature-foreground":"#000","--raised-background":"#3B4252","--points":"#E5E9F0","--locked":"#4c566a","--highlighted":"#434c5e","--bought":"#8FBCBB","--danger":"#D08770","--link":"#88C0D0","--outline":"#3B4252","--accent1":"#B48EAD","--accent2":"#A3BE8C","--accent3":"#EBCB8B","--border-radius":"4px","--modal-border":"solid 2px #3B4252","--feature-margin":"5px"},floatingTabs:!1},aqua:{...Be,variables:{...Be.variables,"--foreground":"#bfdfff","--background":"#001f3f","--tooltip-background":"rgba(0, 15, 31, 0.75)","--raised-background":"#001f3f","--points":"#dfefff","--locked":"#c4a7b3","--outline":"#bfdfff"}}};const Z=Ot();"fonts"in document&&(document.fonts.onloadingdone=()=>Z.emit("fontsLoaded"));var Vn=Object.freeze(Object.defineProperty({__proto__:null,globalBus:Z},Symbol.toStringTag,{value:"Module"}));const qn=$e({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var R=window.player=qn;function ea(e){return JSON.stringify(e,(t,a)=>u(a))}function ta(e={}){return Object.assign({id:`${P.id}-0`,name:"Default Save",tabs:P.initialTabs.slice(),time:Date.now(),autosave:!0,offlineProd:!0,offlineTime:0,timePlayed:0,keepGoing:!1,modID:P.id,modVersion:P.versionNumber,layers:{}},e)}function te(e){const t=ve.compressToUTF16(ea(e!=null?e:R));return localStorage.setItem((e!=null?e:R).id,t),t}async function Gn(){Fn();try{let e=localStorage.getItem(q.active);if(e==null){await Ie(qe());return}if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=ve.decompressFromUTF16(e);else throw"Unable to determine save encoding";const t=JSON.parse(e);if(t.modID!==P.id){await Ie(qe());return}t.id=q.active,await Ie(t)}catch(e){console.error(`Failed to load save. Falling back to new save.
`,e),await Ie(qe())}}function qe(){const e=st(),t=ta({id:e});return te(t),q.saves.push(e),t}function st(){let e,t=0;do e=`${P.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Pn=_(!1);async function Ie(e){console.info("Loading save",e),Pn.value=!0;const{layers:t,removeLayer:a,addLayer:n}=await ot(()=>Promise.resolve().then(function(){return Ai}),void 0),{fixOldSave:i,getInitialLayers:s}=await ot(()=>Promise.resolve().then(function(){return Or}),void 0);for(const o in t){const l=t[o];l&&a(l)}s(e).forEach(o=>n(o,e)),e=ta(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,P.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==P.versionNumber&&(i(e.modVersion,e),e.modVersion=P.versionNumber),Object.assign(R,e),q.active=R.id,Z.emit("onLoad")}setInterval(()=>{R.autosave&&te()},1e3);window.onbeforeunload=()=>{R.autosave&&te()};window.save=te;const xn=window.hardReset=async()=>{await Ie(qe())};window.deleteLowerSaves=()=>{const e=Object.values(q.saves).indexOf(R.id)+1;Object.values(q.saves).slice(e).forEach(t=>localStorage.removeItem(t)),q.saves=q.saves.slice(0,e)};const Ke=$e({active:"",saves:[],showTPS:!0,theme:It.Nordic,unthrottled:!1,alignUnits:!1,autoplay:!1,fast:!1});de(Ke,e=>{const t=ve.compressToUTF16(JSON.stringify(e));localStorage.setItem(P.id,t)},{deep:!0});var q=window.settings=Ke;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:It.Nordic,alignUnits:!1,autoplay:!1,fast:!1};Z.emit("loadSettings",e),Object.assign(Ke,e),xn()};function Fn(){try{let e=localStorage.getItem(P.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=ve.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Ke,t)}Z.emit("loadSettings",Ke)}catch{}}const aa=$e([]);function zn(e){aa.push(e)}const Un=$e([]),On=$e([]),Yn={class:"table"},_e=U({__name:"Row",setup(e){const t=x(()=>ct[q.theme].mergeAdjacent);return(a,n)=>(m(),E("div",Yn,[c("div",{class:$(["row",{mergeAdjacent:u(t)}])},[pe(a.$slots,"default")],2)]))}});function me(e,t="span"){return typeof e=="function"?U({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),U({template:e})):U({render:()=>({})}):e}function St(e){if(na(e))return typeof e=="function"?e():me(e);const t=e[Zt];return A(t,e[$t](),null)}function Jn(e){if(na(e))return typeof e=="function"?e():typeof e=="string"?A(ne,null,[e]):A(e,null,null);const t=e[Zt];return A(t,e[$t](),null)}function na(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[At]===!0}function Ln(e,t="div"){const a=et();return Et(()=>{a.value=me(Qe(e),t)}),a}function dt(e,t="div"){const a=et(null);return Et(()=>{const n=Qe(e);a.value=n==""||n==null?null:me(n,t)}),a}function Qe(e){return u(u(e))}function oe(...e){return e.includes(Object)||e.push(Object),e}var j=(e,t)=>{const a=e.__vccOpts||e;for(const[n,i]of t)a[n]=i;return a};const Wn=U({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var b;const a=_({}),n=new ResizeObserver(l),i=_(null);zt(()=>{const v=i.value;v!=null&&n.observe(v)});let s=!0,o=_((b=i.value)==null?void 0:b.getBoundingClientRect());function l(){s&&(s=!1,Xe(()=>{var v;o.value=(v=i.value)==null?void 0:v.getBoundingClientRect(),Object.values(a.value).filter(y=>y).forEach(y=>y.rect=y.element.getBoundingClientRect()),t("updateNodes",a.value),s=!0}))}Z.on("fontsLoaded",l);const g={attributes:!1,childList:!0,subtree:!1};at(ra,(v,y)=>{const N=new MutationObserver(()=>f(v));N.observe(y,g),a.value[v]={element:y,observer:N,rect:y.getBoundingClientRect()},l()}),at(oa,v=>{var y;(y=a.value[v])==null||y.observer.disconnect(),a.value[v]=void 0,l()}),at(la,a),at(Aa,o);function f(v){const y=a.value[v];y!=null&&(y.rect=y.element.getBoundingClientRect(),t("updateNodes",a.value))}return(v,y)=>(m(),E(ne,null,[pe(v.$slots,"default",{},void 0,!0),c("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var ia=j(Wn,[["__scopeId","data-v-2b1dc1bc"]]);const Xn=["onPointerdown"],jn={class:"modal-wrapper"},Hn={class:"modal-container"},Kn={class:"modal-header"},Zn=I(" default header "),$n={class:"modal-body"},ei=I(" default body "),ti={class:"modal-footer"},ai=c("div",{class:"modal-default-flex-grow"},null,-1),ke=U({__name:"Modal",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){const i=ye(e),s=x(()=>u(i.modelValue)||l.value);function o(){a("update:modelValue",!1)}const l=_(!1),g=_(null),f=x(()=>{var b,v;return(v=(b=g.value)==null?void 0:b.nodes)!=null?v:null});return t({isOpen:s,nodes:f}),(b,v)=>(m(),z(pa,{to:"#modal-root"},[A(Ut,{name:"modal",onBeforeEnter:v[0]||(v[0]=y=>l.value=!0),onAfterLeave:v[1]||(v[1]=y=>l.value=!1)},{default:T(()=>[Bt(c("div",je({class:"modal-mask",onPointerdown:He(o,["self"])},b.$attrs),[c("div",jn,[c("div",Hn,[c("div",Kn,[pe(b.$slots,"header",{shown:u(s)},()=>[Zn])]),c("div",$n,[A(ia,{ref_key:"contextRef",ref:g},{default:T(()=>[pe(b.$slots,"body",{shown:u(s)},()=>[ei])]),_:3},512)]),c("div",ti,[pe(b.$slots,"footer",{shown:u(s)},()=>[c("div",{class:"modal-default-footer"},[ai,c("button",{class:"button modal-default-button",onClick:o}," Close ")])])])])])],16,Xn),[[va,e.modelValue]])]),_:3})]))}}),we=Symbol("ProxyState");function sa(e,t={}){const a=t;let n=!1;function i(){return n||(Object.assign(a,e(a)),n=!0),a}return new Proxy(a,{get(s,o){if(o===we)return i();const l=i()[o];return l!=null&&typeof l=="object"&&bt in l?l[bt]:l},set(s,o,l){return i()[o]=l,!0},has(s,o){return o===we?!0:Reflect.has(i(),o)},ownKeys(){return Reflect.ownKeys(i())},getOwnPropertyDescriptor(s,o){return n||(Object.assign(a,e(a)),n=!0),Object.getOwnPropertyDescriptor(s,o)}})}var X=window.state=_t({lastTenTicks:[],hasNaN:!1,NaNPath:[]});const gt=Symbol("PersistentState"),ze=Symbol("DefaultValue"),ut=Symbol("StackTrace"),yt=Symbol("Deleted"),bt=Symbol("NonPersistent"),Se=Symbol("SaveDataPath");function ni(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(`
`).slice(3,5).map(a=>a.trim()).join(`
`))!=null?t:""}function Pt(e,t){var a;if(C.isNaN(t))throw X.hasNaN||(R.autosave=!1,X.hasNaN=!0,X.NaNPath=e[Se],X.NaNPersistent=e),console.error("Attempted to save NaN value to",(a=e[Se])==null?void 0:a.join("."),e),"Attempted to set NaN value. See above for details";e[gt].value=t}function ii(e){const t=ge(e)?e:_(e);ge(e)&&(e=e.value);const a=x({get(){return t.value},set(i){Pt(n,i)}});a[ze]=e;const n={get value(){return t.value},set value(i){Pt(n,i)},__v_isRef:!0,[gt]:t,[ze]:e,[ut]:ni(),[yt]:!1,[bt]:a,[Se]:void 0};return re.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",n,`
Created at:
`+n[ut]):Ge[re[re.length-1]].add(n),n}function si(e){return e!=null&&typeof e=="object"&&gt in e}Z.on("addLayer",(e,t)=>{const a=[],n=(i,s=[])=>{let o=!1;return Object.keys(i).forEach(l=>{let g=i[l];if(g!=null&&typeof g=="object")if(we in g&&(g=g[we]),si(g)){if(o=!0,g[yt]){console.warn("Deleted persistent ref present in returned object. Ignoring...",g,`
Created at:
`+g[ut]);return}Ge[e.id].delete(g);const f=[e.id,...s,l];g[Se]!=null&&JSON.stringify(f)!==JSON.stringify(g[Se])&&console.error(`Persistent ref is being saved to \`${f.join(".")}\` when it's already present at \`${g[Se].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,g),g[Se]=f;const b=s.reduce((y,N)=>(N in y||(y[N]={}),y[N]),t),v=b[l];b[l]=g[gt],ya(b)?v!=null?b[l]=v:b[l]=g[ze]:v!=null?b[l].value=v:b[l].value=g[ze]}else!(g instanceof C)&&!ge(g)&&!a.includes(g)&&(typeof g.type=="symbol"&&a.push(g),n(g,[...s,l])&&(vt(g)&&!vt(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",we in i?i[we]:i,l):o=!0))}),o};n(e[we]),Ge[e.id].forEach(i=>{i[yt]||console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,i,`
Created at:
`+i[ut])}),Ge[e.id].clear()});const ra=Symbol("RegisterNode"),oa=Symbol("UnregisterNode"),la=Symbol("Nodes"),Aa=Symbol("Bounds"),K=_t({});window.layers=K;const Ge={},re=[];function ua(e,t){return sa(()=>{const a={},n=a.emitter=Ot();if(a.on=n.on.bind(n),a.emit=n.emit.bind(n),a.nodes=_({}),a.id=e,re.push(e),Ge[e]=new Set,a.minimized=ii(!1),Object.assign(a,t.call(a)),re[re.length-1]==null||re[re.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${re}
Trying to pop ${a.id}`;re.pop(),ce(a,"color"),ce(a,"display"),ce(a,"classes"),ce(a,"style"),ce(a,"name"),We(a,"name",a.id),ce(a,"minWidth"),We(a,"minWidth",600),ce(a,"minimizable"),We(a,"minimizable",!0),ce(a,"minimizedDisplay");const i=a.style;return a.style=x(()=>{var o,l;let s=u(a.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(o=u(i))!=null?o:"",(l=a.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),a})}function ca(e,t){if(console.info("Adding layer",e.id),K[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,K[e.id]);return}We(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),K[e.id]=e,Z.emit("addLayer",e,t.layers[e.id])}function ri(e){return K[e]}function da(e){console.info("Removing layer",e.id),Z.emit("removeLayer",e),K[e.id]=void 0}function oi(e){da(e),ca(e,R)}function li(e){const t=_(!1);return{openModal:()=>t.value=!0,modal:H(()=>A(ke,{modelValue:t.value,"onUpdate:modelValue":a=>t.value=a},{header:()=>A("h2",null,[u(e.name)]),body:u(e.display)}))}}Z.on("update",function(t){Object.values(K).forEach(a=>{a==null||a.emit("preUpdate",t)}),Object.values(K).forEach(a=>{a==null||a.emit("update",t)}),Object.values(K).forEach(a=>{a==null||a.emit("postUpdate",t)})});var Ai=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:ra,UnregisterNodeInjectionKey:oa,NodesInjectionKey:la,BoundsInjectionKey:Aa,layers:K,persistentRefs:Ge,addingLayers:re,createLayer:ua,addLayer:ca,getLayer:ri,removeLayer:da,reloadLayer:oi,setupLayerModal:li},Symbol.toStringTag,{value:"Module"}));const ui=U({components:{Context:ia},props:{index:{type:Number,required:!0},display:{type:oe(Object,String,Function),required:!0},minimizedDisplay:oe(Object,String,Function),minimized:{type:Object,required:!0},name:{type:oe(String),required:!0},color:oe(String),minimizable:oe(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:a,minimized:n,minimizedDisplay:i}=ye(e),s=Ln(t),o=dt(i),l=x(()=>P.allowGoBack&&a.value>0&&!Qe(n));function g(){R.tabs.splice(u(e.index),1/0)}function f(b){e.nodes.value=b}return{component:s,minimizedComponent:o,showGoBack:l,updateNodes:f,unref:u,goBack:g}}}),ci={key:1};function di(e,t,a,n,i,s){const o=ba("Context");return m(),E("div",{class:"layer-container",style:Fe({"--layer-color":e.unref(e.color)})},[e.showGoBack?(m(),E("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):M("",!0),e.unref(e.minimized)?(m(),E("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(m(),z(Ae(e.minimizedComponent),{key:0})):(m(),E("div",ci,G(e.unref(e.name)),1))])):(m(),E("div",{key:2,class:$(["layer-tab",{showGoBack:e.showGoBack}])},[A(o,{onUpdateNodes:e.updateNodes},{default:T(()=>[(m(),z(Ae(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(m(),E("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):M("",!0)],4)}var gi=j(ui,[["render",di],["__scopeId","data-v-a592996e"]]);const ga=e=>(be("data-v-4b4bda40"),e=e(),Ne(),e),mi=ga(()=>c("h2",null,"Changelog",-1)),fi=ga(()=>c("details",{open:""},[c("summary",null,[I("v0.0 Initial Commit - "),c("time",null,"2021-09-04")]),I(" This is the first release :D "),c("ul",null,[c("li",{class:"feature"},"Did everything"),c("li",{class:"fix"},"Had some fun"),c("li",{class:"breaking"},"Removed everything"),c("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),hi=U({__name:"Changelog",setup(e,{expose:t}){const a=_(!1);return t({open(){a.value=!0}}),(n,i)=>(m(),z(ke,{modelValue:a.value,"onUpdate:modelValue":i[0]||(i[0]=s=>a.value=s)},{header:T(()=>[mi]),body:T(()=>[fi]),_:1},8,["modelValue"]))}});var vi=j(hi,[["__scopeId","data-v-4b4bda40"]]),pi=U({props:{element:Object,display:{type:oe(Object,String,Function),required:!0},style:oe(Object,String,Array),classes:oe(Object),direction:oe(String),xoffset:oe(String),yoffset:oe(String),pinned:Object},setup(e){const{element:t,display:a,pinned:n}=ye(e),i=_(!1),s=x(()=>(Qe(n)||i.value)&&o.value),o=dt(a),l=et(me(H(()=>{const b=Qe(t);return b==null?"":Jn(b)})));function g(b){const v=n;b.shiftKey&&v&&(v.value=!v.value,b.stopPropagation(),b.preventDefault())}const f=x(()=>Qe(n)&&ct[q.theme].showPin);return{Direction:J,isHovered:i,isShown:s,comp:o,elementComp:l,unref:u,togglePinned:g,showPin:f}}});const yi={key:0,class:"material-icons pinned"};function bi(e,t,a,n,i,s){return m(),E("div",{class:$(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=o=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=o=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...o)=>e.togglePinned&&e.togglePinned(...o))},[pe(e.$slots,"default",{},void 0,!0),e.elementComp?(m(),z(Ae(e.elementComp),{key:0})):M("",!0),A(Ut,{name:"fade",css:!!e.comp},{default:T(()=>{var o;return[e.isShown?(m(),E("div",{key:0,class:$(["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:Fe([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(o=e.unref(e.style))!=null?o:{}])},[e.showPin?(m(),E("span",yi,"push_pin")):M("",!0),e.comp?(m(),z(Ae(e.comp),{key:1})):M("",!0)],6)):M("",!0)]}),_:1},8,["css"])],34)}var L=j(pi,[["render",bi],["__scopeId","data-v-638848c0"]]);const Te=e=>(be("data-v-5d3cb6f4"),e=e(),Ne(),e),Ni={class:"info-modal-header"},Ci=["src","alt"],Ei={class:"info-modal-title"},Bi={key:0},_i={key:0},wi={key:0},Ii=Te(()=>c("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),Si=Te(()=>c("br",null,null,-1)),Qi=Te(()=>c("br",null,null,-1)),Mi=["href"],ki=Te(()=>c("span",{class:"material-icons info-modal-discord"},"discord",-1)),Ti=Te(()=>c("div",null,[c("a",{href:"https://discord.gg/WzejVAx",class:"info-modal-discord-link",target:"_blank"},[c("span",{class:"material-icons info-modal-discord"},"discord"),I(" The Paper Pilot Community ")])],-1)),Di=Te(()=>c("div",null,[c("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[c("span",{class:"material-icons info-modal-discord"},"discord"),I(" The Modding Tree ")])],-1)),Ri=Te(()=>c("br",null,null,-1));var Vi=U({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const a=e,{title:n,logo:i,author:s,discordName:o,discordLink:l,versionNumber:g,versionTitle:f}=P,b=ye(a),v=_(!1),y=x(()=>wt(R.timePlayed)),N=x(()=>me(H(()=>A(ne,null,[Un.map(St)]))));t({open(){v.value=!0}});function h(){var w;(w=u(b.changelog))==null||w.open()}return(w,O)=>(m(),z(ke,{modelValue:v.value,"onUpdate:modelValue":O[0]||(O[0]=W=>v.value=W)},{header:T(()=>[c("div",Ni,[u(i)?(m(),E("img",{key:0,class:"info-modal-logo",src:u(i),alt:u(n)},null,8,Ci)):M("",!0),c("div",Ei,[c("h2",null,G(u(n)),1),c("h4",null,[I(" v"+G(u(g)),1),u(f)?(m(),E("span",Bi,": "+G(u(f)),1)):M("",!0)])])])]),body:T(({shown:W})=>[W?(m(),E("div",_i,[u(s)?(m(),E("div",wi,"By "+G(u(s)),1)):M("",!0),Ii,Si,c("div",{class:"link",onClick:h},"Changelog"),Qi,c("div",null,[u(l)?(m(),E("a",{key:0,href:u(l),class:"info-modal-discord-link",target:"_blank"},[ki,I(" "+G(u(o)),1)],8,Mi)):M("",!0)]),Ti,Di,Ri,c("div",null,"Time Played: "+G(u(y)),1),(m(),z(Ae(u(N))))])):M("",!0)]),_:1},8,["modelValue"]))}});var qi=j(Vi,[["__scopeId","data-v-5d3cb6f4"]]);const Gi=c("h2",null,"Settings",-1);var Pi=U({__name:"Options",setup(e,{expose:t}){const a=_(!1),n=_("behaviour");function i(l){return l==n.value}function s(l){n.value=l}t({isTab:i,setTab:s,save:te,open(){a.value=!0}}),Object.keys(ct).map(l=>({label:Tn(l),value:l}));const o=x(()=>me(H(()=>A(ne,null,[aa.map(St)]))));return ye(q),ye(R),x({get(){return R.devSpeed===0},set(l){R.devSpeed=l?0:null}}),H(()=>A("span",{class:"option-title"},[I("Unthrottled"),A("desc",null,[I("Allow the game to run as fast as possible. Not battery friendly.")])])),H(()=>A("span",{class:"option-title"},[I("Offline Production"),A(L,{display:"Save-specific",direction:J.Right},{default:()=>[I("*")]}),A("desc",null,[I("Simulate production that occurs while the game is closed.")])])),H(()=>A("span",{class:"option-title"},[I("Autosave"),A(L,{display:"Save-specific",direction:J.Right},{default:()=>[I("*")]}),A("desc",null,[I("Automatically save the game every second or when the game is closed.")])])),H(()=>A("span",{class:"option-title"},[I("Pause game"),A(L,{display:"Save-specific",direction:J.Right},{default:()=>[I("*")]}),A("desc",null,[I("Stop everything from moving.")])])),H(()=>A("span",{class:"option-title"},[I("Theme"),A("desc",null,[I("How the game looks.")])])),H(()=>A("span",{class:"option-title"},[I("Show TPS"),A("desc",null,[I("Show TPS meter at the bottom-left corner of the page.")])])),H(()=>A("span",{class:"option-title"},[I("Align modifier units"),A("desc",null,[I("Align numbers to the beginning of the unit in modifier view.")])])),(l,g)=>(m(),z(ke,{modelValue:a.value,"onUpdate:modelValue":g[0]||(g[0]=f=>a.value=f)},{header:T(()=>[Gi]),body:T(()=>[(m(),z(Ae(u(o))))]),_:1},8,["modelValue"]))}});const xi={class:"field"},Fi={key:0,class:"field-title"},zi=U({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var o;const a=e,n=dt(Me(a,"title"),"span"),i=_((o=a.options.find(l=>l.value===a.modelValue))!=null?o:null);de(Me(a,"modelValue"),l=>{var g;Qe(i)!==l&&(i.value=(g=a.options.find(f=>f.value===l))!=null?g:null)});function s(l){t("update:modelValue",l.value)}return(l,g)=>(m(),E("div",xi,[u(n)?(m(),E("span",Fi,[(m(),z(Ae(u(n))))])):M("",!0),A(u(Ia),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[g[0]||(g[0]=f=>i.value=f),s],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const Ui=["onSubmit"],Oi={class:"field"},Yi={key:0,class:"field-title"},Ji=["placeholder"],Li=U({__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 a=e,n=dt(Me(a,"title"),"span"),i=et(null);zt(()=>{var g;(g=i.value)==null||g.focus()});const s=x({get(){var g;return(g=u(a.modelValue))!=null?g:""},set(g){t("update:modelValue",g)}});function o(){t("submit")}function l(){a.submitOnBlur!==!1?t("submit"):t("cancel")}return(g,f)=>(m(),E("form",{onSubmit:He(o,["prevent"])},[c("div",Oi,[u(n)?(m(),E("span",Yi,[(m(),z(Ae(u(n))))])):M("",!0),e.textArea?(m(),z(u(Sa),{key:1,modelValue:u(s),"onUpdate:modelValue":f[0]||(f[0]=b=>ge(s)?s.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:l,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):Bt((m(),E("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=b=>ge(s)?s.value=b:null),placeholder:e.placeholder,class:$({fullWidth:!e.title}),onBlur:l,ref_key:"field",ref:i},null,42,Ji)),[[Na,u(s)]])])],40,Ui))}});var Qt=j(Li,[["__scopeId","data-v-90bd4994"]]);const Wi={key:0},Xi=["onClick","disabled"],ji={key:0},Hi=["onClick"],Ki=U({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const n=ye(e),i=_(!1);de(i,l=>{t("confirmingChanged",l)});function s(){if(u(n.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function o(){i.value=!1}return(l,g)=>(m(),E("span",{class:$(["container",{confirming:i.value}])},[i.value?(m(),E("span",Wi,"Are you sure?")):M("",!0),c("button",{onClick:He(s,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(m(),E("span",ji,"Yes")):pe(l.$slots,"default",{key:1},void 0,!0)],8,Xi),i.value?(m(),E("button",{key:1,class:"button",onClick:He(o,["stop"])},"No",8,Hi)):M("",!0)],2))}});var Zi=j(Ki,[["__scopeId","data-v-2f8ef34c"]]);const $i=["onClick"],es=U({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const a=_(!1),n=_(null);function i(){t("click"),n.value&&clearTimeout(n.value),a.value=!1,Xe(()=>{a.value=!0,n.value=setTimeout(()=>a.value=!1,500)})}return(s,o)=>(m(),E("button",{onClick:He(i,["stop"]),class:$(["feedback",{activated:a.value,left:e.left}])},[pe(s.$slots,"default",{},void 0,!0)],10,$i))}});var ts=j(es,[["__scopeId","data-v-01a1b95c"]]);const fe=e=>(be("data-v-c3447434"),e=e(),Ne(),e),as=fe(()=>c("div",{class:"handle material-icons"},"drag_handle",-1)),ns={key:0,class:"actions"},is=fe(()=>c("span",{class:"material-icons"},"content_paste",-1)),ss=fe(()=>c("span",{class:"material-icons"},"content_copy",-1)),rs=fe(()=>c("span",{class:"material-icons"},"edit",-1)),os=fe(()=>c("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),ls={key:1,class:"actions"},As=fe(()=>c("span",{class:"material-icons"},"check",-1)),us=fe(()=>c("span",{class:"material-icons"},"close",-1)),cs={key:2,class:"details"},ds={class:"save-version"},gs=fe(()=>c("br",null,null,-1)),ms={key:0},fs={key:3,class:"details"},hs={key:4,class:"details error"},vs=fe(()=>c("br",null,null,-1)),ps=U({__name:"Save",props:{save:null},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const a=e,{save:n}=ye(a),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=_(!1),o=_(!1),l=_("");de(s,()=>{var v;return l.value=(v=n.value.name)!=null?v:""});const g=x(()=>n.value!=null&&n.value.id===R.id),f=x(()=>{var v;return g.value?R.time:(v=n.value!=null&&n.value.time)!=null?v:0});function b(){t("editName",l.value),s.value=!1}return(v,y)=>(m(),E("div",{class:$(["save",{active:u(g)}])},[as,s.value?(m(),E("div",ls,[c("button",{onClick:b,class:"button"},[A(L,{display:"Save",direction:u(J).Left,class:"info"},{default:T(()=>[As]),_:1},8,["direction"])]),c("button",{onClick:y[5]||(y[5]=N=>s.value=!s.value),class:"button"},[A(L,{display:"Cancel",direction:u(J).Left,class:"info"},{default:T(()=>[us]),_:1},8,["direction"])])])):(m(),E("div",ns,[u(n).error==null&&!o.value?(m(),z(ts,{key:0,onClick:y[0]||(y[0]=N=>t("export")),class:"button",left:""},{default:T(()=>[A(L,{display:"Export",direction:u(J).Left,class:"info"},{default:T(()=>[is]),_:1},8,["direction"])]),_:1})):M("",!0),u(n).error==null&&!o.value?(m(),E("button",{key:1,onClick:y[1]||(y[1]=N=>t("duplicate")),class:"button"},[A(L,{display:"Duplicate",direction:u(J).Left,class:"info"},{default:T(()=>[ss]),_:1},8,["direction"])])):M("",!0),u(n).error==null&&!o.value?(m(),E("button",{key:2,onClick:y[2]||(y[2]=N=>s.value=!s.value),class:"button"},[A(L,{display:"Edit Name",direction:u(J).Left,class:"info"},{default:T(()=>[rs]),_:1},8,["direction"])])):M("",!0),A(Zi,{disabled:u(g),onClick:y[3]||(y[3]=N=>t("delete")),onConfirmingChanged:y[4]||(y[4]=N=>o.value=N)},{default:T(()=>[A(L,{display:"Delete",direction:u(J).Left,class:"info"},{default:T(()=>[os]),_:1},8,["direction"])]),_:1},8,["disabled"])])),u(n).error==null&&!s.value?(m(),E("div",cs,[c("button",{class:"button open",onClick:y[6]||(y[6]=N=>t("open"))},[c("h3",null,G(u(n).name),1)]),c("span",ds,"v"+G(u(n).modVersion),1),gs,u(f)?(m(),E("div",ms,"Last played "+G(u(i).format(u(f))),1)):M("",!0)])):u(n).error==null&&s.value?(m(),E("div",fs,[A(Qt,{modelValue:l.value,"onUpdate:modelValue":y[7]||(y[7]=N=>l.value=N),class:"editname",onSubmit:b},null,8,["modelValue"])])):(m(),E("div",hs,[I(" Error: Failed to load save with id "+G(u(n).id),1),vs,I(G(u(n).error),1)]))],2))}});var ys=j(ps,[["__scopeId","data-v-c3447434"]]);const Mt=e=>(be("data-v-5b5b1604"),e=e(),Ne(),e),bs=Mt(()=>c("h2",null,"Saves Manager",-1)),Ns={class:"modal-footer"},Cs={class:"field"},Es=Mt(()=>c("span",{class:"field-title"},"Create Save",-1)),Bs={class:"field-buttons"},_s={class:"footer"},ws=Mt(()=>c("div",{style:{"flex-grow":"1"}},null,-1)),Is=U({__name:"SavesManager",setup(e,{expose:t}){const a=_(!1),n=_(null);t({open(){a.value=!0}});const i=_(!1),s=_(""),o=_(null);de(s,p=>{p?Xe(()=>{try{if(p[0]!=="{")if(p[0]==="e")p=decodeURIComponent(escape(atob(p)));else if(p[0]==="\u1BE1")p=ve.decompressFromUTF16(p);else{console.warn("Unable to determine preset encoding",p),i.value=!0;return}const B=JSON.parse(p);if(typeof B!="object"){i.value=!0;return}const D=st();B.id=D,te(B),s.value="",i.value=!1,q.saves.push(D)}catch{i.value=!0}}):i.value=!1});let l={},g=_(Object.keys(l).reduce((p,B)=>(p.push({label:B.split("/").slice(-1)[0].slice(0,-4),value:l[B]}),p),[]));const f=_t({});function b(p){if(f[p]==null){let B=localStorage.getItem(p);if(B==null)f[p]={error:"Save doesn't exist in localStorage",id:p};else if(B==="dW5kZWZpbmVk")f[p]={error:"Save is undefined",id:p};else try{if(B[0]!=="{")if(B[0]==="e")B=decodeURIComponent(escape(atob(B)));else if(B[0]==="\u1BE1")B=ve.decompressFromUTF16(B);else return console.warn("Unable to determine preset encoding",B),i.value=!0,f[p]={error:"Unable to determine preset encoding",id:p},f[p];f[p]={...JSON.parse(B),id:p}}catch(D){f[p]={error:D,id:p},console.warn(`SavesManager: Failed to load info about save with id ${p}:
${D}
${B}`)}}return f[p]}de(a,p=>{p&&Object.keys(f).forEach(B=>delete f[B])});const v=x(()=>q.saves.reduce((p,B)=>(p[B]=b(B),p),{}));function y(p){let B;switch(R.id===p?B=ea(R):B=JSON.stringify(v.value[p]),P.exportEncoding){default:console.warn(`Unknown save encoding: ${P.exportEncoding}. Defaulting to lz`);case"lz":B=ve.compressToUTF16(B);break;case"base64":B=btoa(unescape(encodeURIComponent(B)));break;case"plain":break}const D=document.createElement("textarea");D.value=B,document.body.appendChild(D),D.select(),D.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(D)}function N(p){R.id===p&&te();const B={...v.value[p],id:st()};te(B),q.saves.push(B.id)}function h(p){q.saves=q.saves.filter(B=>B!==p),localStorage.removeItem(p),f[p]=void 0}function w(p){v.value[R.id].time=R.time,te(),f[R.id]=void 0,Ie(v.value[p]),f[p]=void 0}function O(p){if(o.value=p,Xe(()=>{o.value=null}),p[0]!=="{")if(p[0]==="e")p=decodeURIComponent(escape(atob(p)));else if(p[0]==="\u1BE1")p=ve.decompressFromUTF16(p);else{console.warn("Unable to determine preset encoding",p);return}const B=JSON.parse(p);B.id=st(),te(B),q.saves.push(B.id),w(B.id)}function W(p,B){const D=v.value[p];D!=null&&(D.name=B,R.id===p?(R.name=B,te()):(te(D),f[p]=void 0))}return(p,B)=>(m(),z(ke,{modelValue:a.value,"onUpdate:modelValue":B[4]||(B[4]=D=>a.value=D),ref_key:"modal",ref:n},{header:T(()=>[bs]),body:T(({shown:D})=>[D?(m(),z(u(wa),{key:0,list:u(q).saves,handle:".handle",itemKey:F=>F},{item:T(({element:F})=>[A(ys,{save:u(v)[F],onOpen:V=>w(F),onExport:V=>y(F),onEditName:V=>W(F,V),onDuplicate:V=>N(F),onDelete:V=>h(F)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):M("",!0)]),footer:T(()=>[c("div",Ns,[A(Qt,{modelValue:s.value,"onUpdate:modelValue":B[0]||(B[0]=D=>s.value=D),title:"Import Save",placeholder:"Paste your save here!",class:$({importingFailed:i.value})},null,8,["modelValue","class"]),c("div",Cs,[Es,c("div",Bs,[c("button",{class:"button",onClick:B[1]||(B[1]=D=>w(u(qe)().id))},"New Game"),Object.keys(u(g)).length>0?(m(),z(zi,{key:0,options:u(g),modelValue:o.value,"onUpdate:modelValue":B[2]||(B[2]=D=>O(D)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):M("",!0)])]),c("div",_s,[ws,c("button",{class:"button modal-default-button",onClick:B[3]||(B[3]=D=>a.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var ma=j(Is,[["__scopeId","data-v-5b5b1604"]]);const ue=e=>(be("data-v-269f7a94"),e=e(),Ne(),e),Ss=["src","alt"],Qs={key:1,class:"title"},Ms=ue(()=>c("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),ks={class:"discord"},Ts={class:"discord-links"},Ds={key:0},Rs=["href"],Vs=ue(()=>c("li",null,[c("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),qs=ue(()=>c("li",null,[c("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Gs={href:"https://forums.moddingtree.com/",target:"_blank"},Ps=ue(()=>c("span",{class:"material-icons"},"forum",-1)),xs=ue(()=>c("span",{class:"material-icons"},"info",-1)),Fs=ue(()=>c("span",{class:"material-icons"},"settings",-1)),zs=ue(()=>c("span",{class:"material-icons"},"settings",-1)),Us=ue(()=>c("span",{class:"material-icons"},"info",-1)),Os={href:"https://forums.moddingtree.com/",target:"_blank"},Ys=ue(()=>c("span",{class:"material-icons"},"forum",-1)),Js={class:"discord"},Ls={class:"discord-links"},Ws={key:0},Xs=["href"],js=ue(()=>c("li",null,[c("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Hs=ue(()=>c("li",null,[c("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Ks=U({__name:"Nav",setup(e){const t=_(null),a=_(null),n=_(null),i=_(null),{useHeader:s,banner:o,title:l,discordName:g,discordLink:f,versionNumber:b}=P;function v(){window.open(f,"mywindow")}return(y,N)=>(m(),E(ne,null,[u(s)?(m(),E("div",je({key:0,class:"nav"},y.$attrs),[u(o)?(m(),E("img",{key:0,src:u(o),class:"banner",alt:u(l)},null,8,Ss)):(m(),E("div",Qs,G(u(l)),1)),c("div",{onClick:N[0]||(N[0]=h=>{var w;return(w=i.value)==null?void 0:w.open()}),class:"version-container"},[A(L,{display:"Changelog",direction:u(J).Down,class:"version"},{default:T(()=>[c("span",null,"v"+G(u(b)),1)]),_:1},8,["direction"])]),Ms,c("div",ks,[c("span",{onClick:v,class:"material-icons"},"discord"),c("ul",Ts,[u(f)?(m(),E("li",Ds,[c("a",{href:u(f),target:"_blank"},G(u(g)),9,Rs)])):M("",!0),Vs,qs])]),c("div",null,[c("a",Gs,[A(L,{display:"Forums",direction:u(J).Down,yoffset:"5px"},{default:T(()=>[Ps]),_:1},8,["direction"])])]),c("div",{onClick:N[1]||(N[1]=h=>{var w;return(w=t.value)==null?void 0:w.open()})},[A(L,{display:"Info",direction:u(J).Down,class:"info"},{default:T(()=>[xs]),_:1},8,["direction"])]),c("div",{onClick:N[2]||(N[2]=h=>{var w;return(w=n.value)==null?void 0:w.open()})},[A(L,{display:"Settings",direction:u(J).Down,xoffset:"-66px"},{default:T(()=>[Fs]),_:1},8,["direction"])])],16)):(m(),E("div",je({key:1,class:"overlay-nav"},y.$attrs),[c("div",{onClick:N[3]||(N[3]=h=>{var w;return(w=i.value)==null?void 0:w.open()}),class:"version-container"},[A(L,{display:"Changelog",direction:u(J).Right,xoffset:"25%",class:"version"},{default:T(()=>[c("span",null,"v"+G(u(b)),1)]),_:1},8,["direction"])]),c("div",{onClick:N[4]||(N[4]=h=>{var w;return(w=n.value)==null?void 0:w.open()})},[A(L,{display:"Settings",direction:u(J).Right},{default:T(()=>[zs]),_:1},8,["direction"])]),c("div",{onClick:N[5]||(N[5]=h=>{var w;return(w=t.value)==null?void 0:w.open()})},[A(L,{display:"Info",direction:u(J).Right},{default:T(()=>[Us]),_:1},8,["direction"])]),c("div",null,[c("a",Os,[A(L,{display:"Forums",direction:u(J).Right,xoffset:"7px"},{default:T(()=>[Ys]),_:1},8,["direction"])])]),c("div",Js,[c("span",{onClick:v,class:"material-icons"},"discord"),c("ul",Ls,[u(f)?(m(),E("li",Ws,[c("a",{href:u(f),target:"_blank"},G(u(g)),9,Xs)])):M("",!0),js,Hs])])],16)),A(qi,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),A(ma,{ref_key:"savesManager",ref:a},null,512),A(Pi,{ref_key:"options",ref:n},null,512),A(vi,{ref_key:"changelog",ref:i},null,512)],64))}});var fa=j(Ks,[["__scopeId","data-v-269f7a94"]]);const Zs={class:"inner-tab"},$s=U({__name:"Game",setup(e){const t=Me(R,"tabs"),a=x(()=>Object.keys(K)),n=P.useHeader;function i(s){const{display:o,minimized:l,name:g,color:f,minimizable:b,nodes:v,minimizedDisplay:y}=s;return{display:o,minimized:l,name:g,color:f,minimizable:b,nodes:v,minimizedDisplay:y}}return(s,o)=>(m(),E("div",{class:$(["tabs-container",{useHeader:u(n)}])},[(m(!0),E(ne,null,Ca(u(t),(l,g)=>{var f,b;return m(),E("div",{key:g,class:$(["tab",u((f=u(K)[l])==null?void 0:f.classes)]),style:Fe(u((b=u(K)[l])==null?void 0:b.style))},[g===0&&!u(n)?(m(),z(fa,{key:0})):M("",!0),c("div",Zs,[u(a).includes(l)?(m(),z(gi,je({key:0},i(u(K)[l]),{index:g,onSetMinimized:v=>u(K)[l].minimized.value=v}),null,16,["index","onSetMinimized"])):(m(),z(Ae(l),{key:1,index:g},null,8,["index"]))])],6)}),128))],2))}});var er=j($s,[["__scopeId","data-v-3e0f1aab"]]);const tr=U({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,a)=>(m(),E("div",{style:Fe({width:e.width,height:e.height})},null,4))}});var rt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHA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JWqtjpmgWAgASCaABBNAIgmAETTAh2J0TM/vT5fZRYIBhIAogkA0QSAaAJANG+HnpT/UPs7/xEGHQgA0QSAaAJANAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK7ILzj6vECOPLAcAAAAAElFTkSuQmCC";const kt=e=>(be("data-v-525c924f"),e=e(),Ne(),e),lr=["ondragstart","ondragend","ondragenter","ondragleave","ondragover","ondrop"],Ar={key:0,class:"move-indicator"},ur=kt(()=>c("span",{class:"material-icons"},"straight",-1)),cr=[ur],dr={key:1,class:"move-indicator"},gr=kt(()=>c("span",{class:"material-icons"},"merge",-1)),mr=[gr],fr={key:2,class:"character-display"},hr=["src"],vr={key:3,class:"relevancy-display"},pr=["src"],yr={key:4,class:"presence-display"},br=kt(()=>c("span",{class:"material-icons"}," extension ",-1)),Nr={key:5,class:"level-display"},Cr=["src"],Er=["src"],Br=["src"],_r=["src"],wr=["src"],Ir=["src"];var Sr=U({__name:"CharacterSlot",props:{character:null,isSelected:{type:Boolean},isShop:{type:Boolean},isDragging:{type:Boolean},selected:null,shake:{type:Boolean}},emits:["dragstart","dragend","drop"],setup(e,{emit:t}){const a=e,n=_(!1),i=_(!1);de(n,o=>{t(o?"dragstart":"dragend")});const s=et("");return Et(()=>{if(a.character==null||a.selected!=null||n.value){s.value="";return}const o=me(le[a.character.type].abilityDescription);s.value=H(()=>A(ne,null,[A("b",null,[le[a.character.type].nickname]),A("br",null,null),A(o,null,null)]))}),(o,l)=>(m(),z(L,{display:u(s),direction:u(J).Up},{default:T(()=>{var g,f,b;return[c("div",{class:$(["character",{selected:e.isSelected,empty:e.character==null&&e.selected==null,dragging:n.value,isDragging:e.isDragging,draggingOver:i.value,shake:e.shake}]),draggable:"true",ondragstart:()=>n.value=!0,ondragend:()=>n.value=!1,ondragenter:()=>i.value=!0,ondragleave:()=>i.value=!1,ondragover:v=>{var y;e.selected!=null&&!e.isShop&&(((y=e.character)==null?void 0:y.type)!==e.selected.type||e.isSelected)&&v.preventDefault(),e.character!=null&&e.selected!=null&&!e.isSelected&&e.character.type===e.selected.type&&e.character.exp<6&&v.preventDefault()},ondrop:()=>{i.value=!1,t("drop")}},[e.selected!=null&&!e.isShop&&(((g=e.character)==null?void 0:g.type)!==e.selected.type||e.isSelected)&&n.value===!1?(m(),E("span",Ar,cr)):M("",!0),e.character!=null&&e.selected!=null&&!e.isSelected&&e.character.type===e.selected.type&&e.character.exp<6?(m(),E("span",dr,mr)):M("",!0),e.character!=null?(m(),E("span",fr,[c("img",{src:u(le)[e.character.type].display},null,8,hr)])):M("",!0),e.character!=null?(m(),E("span",vr,[c("img",{src:u(rt)},null,8,pr),c("span",null,G((f=e.character)==null?void 0:f.relevancy),1)])):M("",!0),e.character!=null?(m(),E("span",yr,[br,c("span",null,G((b=e.character)==null?void 0:b.presence),1)])):M("",!0),e.character!=null?(m(),E("span",Nr,[e.character.exp===1?(m(),E("img",{key:0,src:u(ar)},null,8,Cr)):M("",!0),e.character.exp===2?(m(),E("img",{key:1,src:u(nr)},null,8,Er)):M("",!0),e.character.exp===3?(m(),E("img",{key:2,src:u(ir)},null,8,Br)):M("",!0),e.character.exp===4?(m(),E("img",{key:3,src:u(sr)},null,8,_r)):M("",!0),e.character.exp===5?(m(),E("img",{key:4,src:u(rr)},null,8,wr)):M("",!0),e.character.exp===6?(m(),E("img",{key:5,src:u(or)},null,8,Ir)):M("",!0)])):M("",!0)],10,lr)]}),_:1},8,["display","direction"]))}});var Re=j(Sr,[["__scopeId","data-v-525c924f"]]);const Ze=_(!1),Nt=_(""),xt=Yt(),Ve=_(),Pe=_("");function xe(e,...t){var a;!Ze.value||(a=Ve.value)==null||a.emit(e,...t)}Z.on("loadSettings",e=>{We(e,"server","https://Super-Auto-Coots.thepaperpilot.repl.co"),de(()=>e.server,t=>{Ve.value&&Ve.value.close(),Ve.value=Ma(t),Qr(Ve.value),Ze.value=!1,Pe.value="",Ve.value.connect()},{immediate:!0}),zn(H(()=>A(ne,null,[A(Qt,{title:"Server URL","onUpdate:modelValue":t=>e.server=t,modelValue:e.server},null),A("div",{style:"font-style: italic; font-size: small; margin-top: -10px;"},[Ze.value?A("span",null,[I("Connected!")]):Pe.value?A("span",{style:"color: red"},[Pe.value]):A("span",null,[I("Connecting...")])])])))});function Qr(e){e.on("connect",()=>{Pe.value="",Ze.value=!0,S.reset.reset()}),e.on("connect_error",t=>{Pe.value=`${t.name}: ${t.message}`}),e.on("disconnect",(t,a)=>{var n;Pe.value=a instanceof Error?`${a.name}: ${a.message}`:(n=a==null?void 0:a.description)!=null?n:t,Ze.value=!1}),e.on("server version",t=>{Qa(P.versionNumber,t)||(xt.info("Server only accepts game versions in range: "+t),e.disconnect())}),e.on("info",t=>{xt.info(t),t==="Failed to start streaming"&&(S.findingMatch.value=!1)}),e.on("nickname",t=>{Nt.value=t}),e.on("newTurn",t=>{S.gold.value=10,S.turn.value++,S.battle.value=null,S.shop.value=t.map(a=>({type:a,relevancy:le[a].initialRelevancy,presence:le[a].initialPresence,exp:1}))}),e.on("reroll",t=>{S.gold.value--,S.shop.value=t.map(a=>({type:a,relevancy:le[a].initialRelevancy,presence:le[a].initialPresence,exp:1}))}),e.on("buy",(t,a,n)=>{S.team.value[a]=n,S.shop.value[t]=null,S.gold.value-=3}),e.on("move",(t,a)=>{const n=S.team.value[t];S.team.value[t]=S.team.value[a],S.team.value[a]=n}),e.on("merge",(t,a,n)=>{S.team.value[t]=null,S.team.value[a]=n}),e.on("stream",(t,a)=>{S.findingMatch.value=!1,S.battle.value={team:JSON.parse(JSON.stringify(S.team.value.filter(n=>n!=null))),streamers:[],enemyTeam:t.team,enemyStreamers:[],enemyNickname:t.nickname,enemyLives:t.lives,enemyWins:t.wins,enemyTurn:t.turn},S.outcome.value=a,S.showingOutcome.value=!1,S.playClicked.value=!1,setTimeout(S.prepareMove,1e3)})}var Mr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAAAXNSR0IArs4c6QAABTlJREFUeJzt3U2oVVUY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ld65l9W0tk6K+/+wp0121Q8wAsEYAYI0AwBoBgDUCAGu9Ox062ypk24bz6SeKqbVJrdshJXsKdNXOL2Uob5xnBoA1AgBrBADWCACsEQBY693p0H+N1sJx1d78vhK/qVytLcm2Rop6ntbtkPp+tu6/P3UdRZ4CLd4RtrbyXcl9t4y2huOt3zjPDABrBADWCACsEQBYIwCw1tmOMNVmvPPW8XD85ddeCccXDjwXjk8W3wvH9ywdCsf7Ru1c66rt+Vp8n+r7z5osnwrH2REGNEQAYI0AwBoBgDUCAGvpFqiq7VFWL3wbjmfbIUW1GVlVbUzVG+SV1m3P6fWz0z3YLV6/dTvEDABrBADWCACsEQBYIwCw1tm5QNn/9Y8WxPCC+IfGJiuTcFztbMpSO8jUjjN1zs+DO3eH41VrotQOO9Umyfueu1HyPFnMALBGAGCNAMAaAYA1AgBrvTsdWq2xUa3LUFS96V6trVpbicdV63Jm8aPUfXeMd4TjV25cTt03e/3RcuoyacwAsEYAYI0AwBoBgDUCAGslJ+yORnU7xVqfM6Nk76uur9YCqdOqW1Ntjzp1Oft7vXny7eke7F9ef/FION761GhmAFgjALBGAGCNAMAaAYC1shZIaX2OkJLdmZW9b7adyL7JvUq2Lenb78U7woCGCACsEQBYIwCwRgBgrXkLpGTbhizVHijZ+1a1K61VtSVd/V5Vz68wA8AaAYA1AgBrBADWCACsddYCKVVtSbY9yN63dTsxFF39XlWYAWCNAMAaAYA1AgBrBADW/gYSpT1chMivagAAAABJRU5ErkJggg==",Pr="./assets/start stream.dd66a6ec.png";const xr=Symbol("Reset");function Fr(e){return sa(()=>{const t=e();return t.id=Rn("reset-"),t.type=xr,t.reset=function(){var i;const a=s=>{if(s!=null&&typeof s=="object")if(ze in s){const o=s;o.value=o[ze]}else!(s instanceof C)&&!ge(s)&&Object.values(s).forEach(o=>a(o))},n=u(t.thingsToReset);vt(n)?n.forEach(a):a(n),Z.emit("reset",t),(i=t.onReset)==null||i.call(t)},ce(t,"thingsToReset"),t})}const it={};Z.on("removeLayer",e=>{var t;(t=it[e.id])==null||t.call(it),it[e.id]=void 0});function Je(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Ea(e)}const le={coots:{nickname:"Coots",initialRelevancy:1,initialPresence:1,display:Rr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}},ludwig:{nickname:"Ludwig Coots",initialRelevancy:1,initialPresence:1,display:Mr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}},qt:{nickname:"Qt Coots",initialRelevancy:1,initialPresence:1,display:Vr,abilityType:"LivestreamJoined",abilityDescription:H(()=>A(ne,null,[A("i",null,[I("Livestream joined")]),I(": Set both stats to 100")])),performAbility(e){e.presence=100,e.relevancy=100}},maid:{nickname:"Maid Coots",initialRelevancy:1,initialPresence:1,display:kr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}},mail:{nickname:"Mogul Mail Coots",initialRelevancy:1,initialPresence:1,display:Tr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}},stanz:{nickname:"Stanz Coots",initialRelevancy:1,initialPresence:1,display:qr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}},money:{nickname:"Mogul Money Coots",initialRelevancy:1,initialPresence:1,display:Dr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}},vespa:{nickname:"Vespa Coots",initialRelevancy:1,initialPresence:1,display:Gr,abilityType:"LivestreamJoined",abilityDescription:"Do nothing",performAbility(){}}},S=ua("main",function(){const e=_(3),t=_(0),a=_(0),n=_(0),i=_([null,null,null]),s=_([]),o=_(null),l=_(null),g=_(!1),f=_(""),b=_(!1),v=_(!1),y=_(!1),N=_([]),h=_(null),w=x(()=>h.value==null?0:h.value.streamers.reduce((D,F)=>D+Math.max(0,F.presence)*Math.max(0,F.relevancy),0)*100),O=x(()=>h.value==null?0:h.value.enemyStreamers.reduce((D,F)=>D+Math.max(0,F.presence)*Math.max(0,F.relevancy),0)*100),W=Fr(()=>({onReset(){e.value=3,t.value=0,a.value=0,n.value=0,i.value=[null,null,null],s.value=[],o.value=null,l.value=null,g.value=!1,h.value=null,f.value="",b.value=!1,y.value=!1,N.value=[]}})),p=_(!1);function B(){var D,F;if(h.value==null)throw"Preparing move while not in battle";if(N.value.length===0&&h.value.team.length===0&&h.value.enemyTeam.length===0){f.value==="Victory"?t.value++:f.value==="Defeat"&&e.value--,b.value=!0;return}if(N.value.length===0?N.value.push({action:"join"}):N.value.length>1&&(N.value=N.value.sort((V,Y)=>V.action!==Y.action?1:V.target!=null&&Y.target!=null?Y.target.relevancy-V.target.relevancy:0)),q.autoplay===!1&&y.value===!1)v.value=!0;else{v.value=!1;const V=N.value.shift();switch(V.action){case"join":if(((D=h.value.team.length)!=null?D:0)>0){const Y=h.value.team.pop();h.value.streamers.push(Y),le[Y.type].abilityType==="LivestreamJoined"&&N.value.unshift({action:"LivestreamJoined",target:Y})}if(((F=h.value.enemyTeam.length)!=null?F:0)>0){const Y=h.value.enemyTeam.pop();h.value.enemyStreamers.push(Y),le[Y.type].abilityType==="LivestreamJoined"&&N.value.unshift({action:"LivestreamJoined",target:Y})}break;default:if(V.target==null){console.error("Invalid action",V);break}le[V.target.type].performAbility(V.target);break}y.value=!1,setTimeout(B,q.fast?750:1250)}}return{name:"Game",minimizable:!1,display:H(()=>{let D;if(h.value!=null){let F,V,Y,De;return A("div",{class:{["battle-container"]:!0,fast:q.fast}},[A("div",{class:"battle-controls"},[A("button",{class:"button",onClick:()=>{y.value=!0,B()}},[A("span",{class:"material-icons"},[I("play_arrow")]),A("span",null,[I("Play")])]),A("button",{class:{button:!0,active:q.autoplay},onClick:()=>{q.autoplay=!q.autoplay,v.value&&B()}},[A("span",{class:"material-icons"},[I("all_inclusive")]),A("span",null,[I("Autoplay")])]),A("button",{class:{button:!0,active:q.fast},onClick:()=>q.fast=!q.fast},[A("span",{class:"material-icons"},[I("fast_forward")]),A("span",null,[I("Fast")])])]),A("div",{class:"teams-container",style:b.value?"pointer-events: none;":""},[A("div",{class:"team-container"},[A("div",{class:"stream-container"},[A("div",{class:"stream-details",style:"left: 1vmin"},[A("span",{style:"margin-left: 0"},[Nt.value,I(" (YOU)")]),A("div",{class:"stats",style:"margin-left: 0"},[A("div",{class:"resource-box"},[A("img",{src:rt},null),A("span",null,[e.value])]),A("div",{class:"resource-box"},[A("span",{class:"material-icons"},[I("emoji_events")]),A("span",null,[t.value,I("/5")])])])]),A("div",{class:"view-counter",style:"right: 1vmin"},[pt(w.value),I(" Views")]),A(_e,{class:"streamers-container"},{default:()=>[A(nt,{name:"character-transition"},Je(F=h.value.streamers.slice().reverse().map((ie,Ce)=>{var se;return A(Re,{key:h.value.streamers.length-Ce,character:ie,shake:v.value&&((se=N.value[0])==null?void 0:se.target)===ie},null)}))?F:{default:()=>[F]})]})]),A(_e,{class:"members-container",style:"margin-left: 0"},{default:()=>[A(nt,{name:"character-transition"},Je(V=h.value.team.map((ie,Ce)=>{var se,Ue,Oe,Ye;return A(Re,{character:ie,key:Ce,shake:v.value&&((se=N.value[0])==null?void 0:se.action)==="join"&&ie===((Ye=h.value)==null?void 0:Ye.team[((Oe=(Ue=h.value)==null?void 0:Ue.team.length)!=null?Oe:0)-1])},null)}))?V:{default:()=>[V]})]})]),A("div",{class:"team-container"},[A("div",{class:"stream-container"},[A("div",{class:"stream-details",style:"right: 1vmin"},[A("span",{style:"margin-right: 0"},[h.value.enemyNickname]),A("div",{class:"stats",style:"margin-right: 0"},[A("div",{class:"resource-box"},[A("img",{src:rt},null),A("span",null,[h.value.enemyLives])]),A("div",{class:"resource-box"},[A("span",{class:"material-icons"},[I("emoji_events")]),A("span",null,[h.value.enemyWins,I("/5")])])])]),A("div",{class:"view-counter",style:"left: 1vmin"},[pt(O.value),I(" Views")]),A(_e,{class:"streamers-container"},{default:()=>[A(nt,{name:"character-transition"},Je(Y=h.value.enemyStreamers.map((ie,Ce)=>{var se;return A(Re,{key:Ce,character:ie,shake:v.value&&((se=N.value[0])==null?void 0:se.target)===ie},null)}))?Y:{default:()=>[Y]})]})]),A(_e,{class:"members-container",style:"margin-right: 0"},{default:()=>[A(nt,{name:"character-transition"},Je(De=h.value.enemyTeam.slice().reverse().map((ie,Ce)=>{var se,Ue,Oe,Ye;return A(Re,{character:ie,key:h.value.enemyStreamers.length+Ce,shake:v.value&&((se=N.value[0])==null?void 0:se.action)==="join"&&ie===((Ye=h.value)==null?void 0:Ye.enemyTeam[((Oe=(Ue=h.value)==null?void 0:Ue.enemyTeam.length)!=null?Oe:0)-1])},null)}))?De:{default:()=>[De]})]})])]),b.value?A("div",{class:"outcome",onClick:()=>xe("newTurn")},[A("span",null,[f.value]),A("span",{style:"font-size: 2vmin"},[I("Next Turn")])]):null])}return A("div",{class:"game-container",style:g.value?"pointer-events: none":"",onClick:()=>{o.value=null,l.value=null}},[A(_e,{style:"position: absolute; top: 10px; left: -5px"},{default:()=>[A("div",{class:"resource-box"},[A("span",{class:"material-icons"},[I("credit_card")]),n.value]),A("div",{class:"resource-box"},[A("img",{src:rt},null),e.value]),A("div",{class:"resource-box"},[A("span",{class:"material-icons"},[I("emoji_events")]),t.value,I("/5")])]}),A("h2",{style:"font-size: 3vmin"},[Nt.value]),A(_e,{style:"margin-top: 10vh"},Je(D=new Array(3).fill(0).map((F,V)=>{var Y,De;return A(Re,{character:i.value[V],isSelected:o.value===V,selected:o.value==null?l.value==null||i.value[V]!=null&&((Y=s.value[l.value])==null?void 0:Y.type)!==((De=i.value[V])==null?void 0:De.type)||n.value<3?null:s.value[l.value]:i.value[o.value],isDragging:p.value,onClick:Ft(V),onDragstart:()=>{p.value=!0,o.value=V,l.value=null},onDragend:()=>{p.value=!1,o.value=null,l.value=null},onDrop:()=>Ft(V)()},null)}))?D:{default:()=>[D]}),A(_e,{style:"margin-top: 10vh"},{default:()=>[A("div",{class:"reroll",style:n.value>0?"":"color: var(--locked); cursor: not-allowed",onClick:()=>{n.value>0&&xe("reroll")}},[A("span",{class:"material-icons",style:"font-size: 8vmin"},[I("casino")]),A("span",{style:"font-size: 2vmin"},[I("Roll")])]),s.value.map((F,V)=>A(Re,{character:F==null?void 0:F,isSelected:l.value===V,isShop:!0,isDragging:p.value,onClick:Y=>{F!=null&&(l.value=l.value===V?null:V,o.value=null,Y.stopPropagation())},onDragstart:()=>{p.value=!0,o.value=null,l.value=V},onDragend:()=>{p.value=!1,o.value=null,l.value=null}},null))]}),A(tr,{height:"4vh"},null),g.value?A("div",{class:"waiting"},[I("Finding opposing team...")]):A("img",{class:"startStream",draggable:"false",onClick:()=>{xe("stream"),g.value=!0},src:Pr},null)])}),lives:e,wins:t,turn:a,gold:n,team:i,shop:s,selectedCharacter:o,selectedShopItem:l,findingMatch:g,showingOutcome:b,outcome:f,reset:W,battle:h,playClicked:y,prepareMove:B}});function Ft(e){return t=>{var a,n,i,s,o,l,g;S.selectedCharacter.value!=null&&S.selectedCharacter.value!==e?((a=S.team.value[S.selectedCharacter.value])==null?void 0:a.type)===((n=S.team.value[e])==null?void 0:n.type)&&((s=(i=S.team.value[S.selectedCharacter.value])==null?void 0:i.exp)!=null?s:0)<6&&((l=(o=S.team.value[e])==null?void 0:o.exp)!=null?l:0)<6?(xe("merge",S.selectedCharacter.value,e),S.selectedCharacter.value=null):(xe("move",S.selectedCharacter.value,e),S.selectedCharacter.value=null):S.selectedCharacter.value===e?S.selectedCharacter.value=null:S.selectedShopItem.value!==null?((S.team.value[e]==null||S.team.value[e].type===((g=S.shop.value[S.selectedShopItem.value])==null?void 0:g.type)&&S.team.value[e].exp<6)&&S.gold.value>=3&&xe("buy",S.selectedShopItem.value,e),S.selectedShopItem.value=null):S.selectedCharacter.value=e,t==null||t.stopPropagation()}}const zr=e=>[S],ha=x(()=>!1);function Ur(e,t){}var Or=Object.freeze(Object.defineProperty({__proto__:null,characters:le,main:S,getInitialLayers:zr,hasWon:ha,fixOldSave:Ur},Symbol.toStringTag,{value:"Module"}));const Yr={class:"field"},Jr=U({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=x(()=>{var s;return me((s=u(a.title))!=null?s:"<span></span>","span")}),i=x({get(){return!!a.modelValue},set(s){t("update:modelValue",s)}});return(s,o)=>(m(),E("label",Yr,[Bt(c("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":o[0]||(o[0]=l=>ge(i)?i.value=l:null)},null,512),[[Ba,u(i)]]),(m(),z(Ae(u(n))))]))}});var Ct=j(Jr,[["__scopeId","data-v-11046116"]]);const tt=e=>(be("data-v-4a50ce42"),e=e(),Ne(),e),Lr={class:"game-over-modal-header"},Wr=["src","alt"],Xr={class:"game-over-modal-title"},jr=tt(()=>c("h2",null,"Congratulations!",-1)),Hr={key:0},Kr=tt(()=>c("br",null,null,-1)),Zr=tt(()=>c("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),$r=tt(()=>c("br",null,null,-1)),eo=["href"],to=tt(()=>c("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),ao=U({__name:"GameOverScreen",setup(e){const{title:t,logo:a,discordName:n,discordLink:i,versionNumber:s,versionTitle:o}=P,l=x(()=>wt(R.timePlayed)),g=x(()=>ha.value&&!R.keepGoing),f=Me(R,"autosave");function b(){R.keepGoing=!0}function v(){Ie(qe())}return(y,N)=>(m(),z(ke,{"model-value":u(g)},{header:T(()=>[c("div",Lr,[u(a)?(m(),E("img",{key:0,class:"game-over-modal-logo",src:u(a),alt:u(t)},null,8,Wr)):M("",!0),c("div",Xr,[jr,c("h4",null,"You've beaten "+G(u(t))+" v"+G(u(s))+": "+G(u(o)),1)])])]),body:T(({shown:h})=>[h?(m(),E("div",Hr,[c("div",null,"It took you "+G(u(l))+" to beat the game.",1),Kr,Zr,$r,c("div",null,[c("a",{href:u(i),class:"game-over-modal-discord-link"},[to,I(" "+G(u(n)),1)],8,eo)]),A(Ct,{title:"Autosave",modelValue:u(f),"onUpdate:modelValue":N[0]||(N[0]=w=>ge(f)?f.value=w:null)},null,8,["modelValue"])])):M("",!0)]),footer:T(()=>[c("div",{class:"game-over-footer"},[c("button",{onClick:b,class:"button"},"Keep Going"),c("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var no=j(ao,[["__scopeId","data-v-4a50ce42"]]);const mt=e=>(be("data-v-336bf74f"),e=e(),Ne(),e),io=mt(()=>c("div",{class:"nan-modal-header"},[c("h2",null,"NaN value detected!")],-1)),so={key:0},ro=mt(()=>c("br",null,null,-1)),oo=["href"],lo=mt(()=>c("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Ao=mt(()=>c("br",null,null,-1)),uo={class:"nan-footer"},co=U({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:a}=P,n=_(!0),i=_(!0),s=Me(X,"hasNaN"),o=_(null);de(s,y=>{y?(n.value=R.autosave,i.value=R.devSpeed===0):(R.autosave=n.value,R.devSpeed=i.value?0:null)});const l=x(()=>{var y;return(y=X.NaNPath)==null?void 0:y.join(".")}),g=x(()=>X.NaNPersistent!=null?X.NaNPersistent.value:null);function f(){X.NaNPersistent!=null&&(X.NaNPersistent.value=new C(0),X.hasNaN=!1)}function b(){X.NaNPersistent&&(X.NaNPersistent.value=new C(1),X.hasNaN=!1)}function v(){X.NaNPersistent&&(X.NaNPersistent.value=new C(NaN),X.hasNaN=!1)}return(y,N)=>(m(),E(ne,null,[A(ke,je({modelValue:u(s),"onUpdate:modelValue":N[4]||(N[4]=h=>ge(s)?s.value=h:null)},y.$attrs),{header:T(()=>[io]),body:T(()=>[c("div",null,[I(' Attempted to assign "'+G(u(l))+'" to NaN',1),u(g)?(m(),E("span",so,G(" ")+"(previously "+G(u(Kt)(u(g)))+")",1)):M("",!0),I(". Auto-saving has been "+G(n.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),ro,c("div",null,[c("a",{href:u(a)||"https://discord.gg/WzejVAx",class:"nan-modal-discord-link"},[lo,I(" "+G(u(t)||"The Paper Pilot Community"),1)],8,oo)]),Ao,A(Ct,{title:"Autosave",modelValue:n.value,"onUpdate:modelValue":N[0]||(N[0]=h=>n.value=h)},null,8,["modelValue"]),u(P).enablePausing?(m(),z(Ct,{key:0,title:"Pause game",modelValue:i.value,"onUpdate:modelValue":N[1]||(N[1]=h=>i.value=h)},null,8,["modelValue"])):M("",!0)]),footer:T(()=>[c("div",uo,[c("button",{onClick:N[2]||(N[2]=h=>{var w;return(w=o.value)==null?void 0:w.open()}),class:"button"},"Open Saves Manager"),c("button",{onClick:f,class:"button"},"Set to 0"),c("button",{onClick:b,class:"button"},"Set to 1"),u(g)&&u(C).neq(u(g),0)&&u(C).neq(u(g),1)?(m(),E("button",{key:0,onClick:N[3]||(N[3]=h=>s.value=!1),class:"button"}," Set to previous ")):M("",!0),c("button",{onClick:v,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),A(ma,{ref_key:"savesManager",ref:o},null,512)],64))}});var go=j(co,[["__scopeId","data-v-336bf74f"]]);var mo=U({__name:"App",setup(e){const t=P.useHeader,a=x(()=>ct[q.theme].variables);Me(q,"showTPS");const n=x(()=>me(H(()=>A(ne,null,[On.map(St)]))));return(i,s)=>(m(),E(ne,null,[c("div",{id:"modal-root",style:Fe(u(a))},null,4),c("div",{class:$(["app",{useHeader:u(t)}]),style:Fe(u(a))},[u(t)?(m(),z(fa,{key:0})):M("",!0),A(er),A(no),A(go),(m(),z(Ae(u(n))))],6)],64))}});var fo=j(mo,[["__scopeId","data-v-ff7f8b84"]]);Z.on("setupVue",e=>e.use(ka));function ho(e={}){const{immediate:t=!1,onNeedRefresh:a,onOfflineReady:n,onRegistered:i,onRegisterError:s}=e;let o,l;const g=async(f=!0)=>{f&&(o==null||o.addEventListener("controlling",b=>{b.isUpdate&&window.location.reload()})),l&&l.waiting&&await Da(l.waiting,{type:"SKIP_WAITING"})};if("serviceWorker"in navigator){o=new Ta("./sw.js",{scope:"./",type:"classic"}),o.addEventListener("activated",f=>{f.isUpdate||n==null||n()});{const f=()=>{a==null||a()};o.addEventListener("waiting",f),o.addEventListener("externalwaiting",f)}o.register({immediate:t}).then(f=>{l=f,i==null||i(f)}).catch(f=>{s==null||s(f)})}return g}function vo(e={}){const{immediate:t=!0,onNeedRefresh:a,onOfflineReady:n,onRegistered:i,onRegisterError:s}=e,o=_(!1),l=_(!1);return{updateServiceWorker:ho({immediate:t,onNeedRefresh(){o.value=!0,a==null||a()},onOfflineReady(){l.value=!0,n==null||n()},onRegistered:i,onRegisterError:s}),offlineReady:l,needRefresh:o}}document.title=P.title;window.projInfo=P;if(P.id==="")throw"Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json";requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c
Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Gn();const{globalBus:e}=await ot(()=>Promise.resolve().then(function(){return Vn}),void 0),{startGameLoop:t}=await ot(()=>import("./gameLoop.ed7f4ea7.js"),["assets/gameLoop.ed7f4ea7.js","assets/@fontsource.f66d05e7.css","assets/vue.5bd9f35e.js","assets/lru-cache.9506e0ec.js","assets/yallist.fd762fe7.js","assets/@vue.4ce677c2.js","assets/nanoevents.1080beb7.js","assets/lz-string.f2f3b7cf.js","assets/vuedraggable.832ed13e.js","assets/sortablejs.80af5380.js","assets/vue-next-select.8d9e0122.js","assets/vue-next-select.9e6f4164.css","assets/vue-textarea-autosize.35804eaf.js","assets/semver.d101e2be.js","assets/socket.io-client.79ce0df5.js","assets/engine.io-client.58517560.js","assets/engine.io-parser.3f360695.js","assets/@socket.io.aec831e2.js","assets/socket.io-parser.544e37d1.js","assets/vue-toastification.b272a510.js","assets/vue-toastification.4b5f8ac8.css","assets/workbox-window.8d14e8b7.js"]),a=window.vue=_a(fo);e.emit("setupVue",a),a.mount("#app"),Xe(()=>{const n=Yt(),{updateServiceWorker:i}=vo({onNeedRefresh(){n.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){n.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{C as D,ot as _,X as a,P as b,Or as c,Z as g,Pn as l,R as p,q as s};