From 5a0af06bb262b376bc373e5ab7a7c5884214c63c Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 29 Mar 2024 04:52:17 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20pages=20from=20@=20profectus/P?= =?UTF-8?q?rofectus@dfb14acc6e80bd02d16034f675089968b62e1bfa=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{gameLoop.f446598b.js => gameLoop.fd6e5459.js} | 2 +- assets/{index.0c166c16.js => index.2cbf0746.js} | 4 ++-- index.html | 2 +- sw.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename assets/{gameLoop.f446598b.js => gameLoop.fd6e5459.js} (90%) rename assets/{index.0c166c16.js => index.2cbf0746.js} (98%) diff --git a/assets/gameLoop.f446598b.js b/assets/gameLoop.fd6e5459.js similarity index 90% rename from assets/gameLoop.f446598b.js rename to assets/gameLoop.fd6e5459.js index f605489..41b6320 100644 --- a/assets/gameLoop.f446598b.js +++ b/assets/gameLoop.fd6e5459.js @@ -1 +1 @@ -import{_ as d,s as u,p as e,a as f,l as T,D as o,b as m,g as p}from"./index.0c166c16.js";import"./vue.359c6955.js";import{b2 as c}from"./@vue.6f8187b0.js";/* empty css */import"./lz-string.bfbf8ec3.js";import"./nanoevents.1080beb7.js";import"./unofficial-galaxy-sdk.21372393.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-next-select.68e0c605.js";import"./vuedraggable.055200e5.js";import"./sortablejs.20039f18.js";import"./vue-toastification.45d39007.js";let n=null,l=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(f.lastTenTicks.push(r),f.lastTenTicks.length>10&&(f.lastTenTicks=f.lastTenTicks.slice(1)),!((l==null?void 0:l.value)&&!e.keepGoing)&&!f.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(o.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),o.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||o.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!o.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),p.emit("update",i,r),u.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function w(){l=(await d(()=>import("./index.0c166c16.js").then(function(t){return t.c}),["assets/index.0c166c16.js","assets/index.e930493e.css","assets/@fontsource.f66d05e7.css","assets/vue.359c6955.js","assets/lz-string.bfbf8ec3.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/unofficial-galaxy-sdk.21372393.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-next-select.68e0c605.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.055200e5.js","assets/sortablejs.20039f18.js","assets/vue-toastification.45d39007.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(l,t=>{t&&p.emit("gameWon")}),u.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{w as startGameLoop}; +import{_ as d,s as u,p as e,a as f,l as T,D as o,b as m,g as p}from"./index.2cbf0746.js";import"./vue.359c6955.js";import{b2 as c}from"./@vue.6f8187b0.js";/* empty css */import"./lz-string.bfbf8ec3.js";import"./nanoevents.1080beb7.js";import"./unofficial-galaxy-sdk.21372393.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-next-select.68e0c605.js";import"./vuedraggable.055200e5.js";import"./sortablejs.20039f18.js";import"./vue-toastification.45d39007.js";let n=null,l=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(f.lastTenTicks.push(r),f.lastTenTicks.length>10&&(f.lastTenTicks=f.lastTenTicks.slice(1)),!((l==null?void 0:l.value)&&!e.keepGoing)&&!f.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(o.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),o.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||o.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!o.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),p.emit("update",i,r),u.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function w(){l=(await d(()=>import("./index.2cbf0746.js").then(function(t){return t.c}),["assets/index.2cbf0746.js","assets/index.e930493e.css","assets/@fontsource.f66d05e7.css","assets/vue.359c6955.js","assets/lz-string.bfbf8ec3.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/unofficial-galaxy-sdk.21372393.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-next-select.68e0c605.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.055200e5.js","assets/sortablejs.20039f18.js","assets/vue-toastification.45d39007.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(l,t=>{t&&p.emit("gameWon")}),u.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{w as startGameLoop}; diff --git a/assets/index.0c166c16.js b/assets/index.2cbf0746.js similarity index 98% rename from assets/index.0c166c16.js rename to assets/index.2cbf0746.js index 272dcca..c64e642 100644 --- a/assets/index.0c166c16.js +++ b/assets/index.2cbf0746.js @@ -1,4 +1,4 @@ -/* empty css */import"./vue.359c6955.js";import{q as it,C as l,ab as B,t as x,aF as h,a1 as w,aL as Le,bv as ft,G as ee,as as Je,_ as F,az as bt,a2 as m,J as V,O as W,aK as Oe,a0 as M,I as me,a8 as E,a9 as _,b7 as O,aI as Se,aG as Ie,l as ie,u as Et,j as Jn,bw as ln,aH as wt,A as de,$ as R,b9 as Ht,ar as Ae,bt as Kn,bc as yn,T as Zn,b2 as he,aD as _n,w as Ne,b3 as We,aO as se,z as Pe,bs as Yn,ay as Xn,aM as Ke,bo as Qn,am as Mt,H as er,y as un,bf as tr}from"./@vue.6f8187b0.js";import{L as Be}from"./lz-string.bfbf8ec3.js";import{c as Nn}from"./nanoevents.1080beb7.js";import{i as nr}from"./unofficial-galaxy-sdk.21372393.js";import{p as rr}from"./vue-textarea-autosize.35804eaf.js";import{Y as ir}from"./vue-next-select.68e0c605.js";import{D as ar}from"./vuedraggable.055200e5.js";import{s as sr,u as or}from"./vue-toastification.45d39007.js";import"./sortablejs.20039f18.js";const lr=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}};lr();const ur="modulepreload",cn={},cr="./",gt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${cr}${r}`,r in cn)return;cn[r]=!0;const i=r.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${a}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":ur,i||(s.as="script",s.crossOrigin=""),s.href=r,document.head.appendChild(s),i)return new Promise((c,d)=>{s.addEventListener("load",c),s.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},dr="./projInfo-schema.json",fr="Profectus",gr="A project made in Profectus",mr="",hr="",pr="",vr="",br="0.0",yr="Initial Commit",_r=!0,Nr=!1,wr=2,Cr=!0,kr=null,Sr="",Ir=["main"],Mr=3600,$r=1,xr=!0,Pr="base64";var z={$schema:dr,title:fr,description:gr,id:mr,author:hr,discordName:pr,discordLink:vr,versionNumber:br,versionTitle:yr,allowGoBack:_r,defaultShowSmall:Nr,defaultDecimalsShown:wr,useHeader:Cr,banner:kr,logo:Sr,initialTabs:Ir,maxTickLength:Mr,offlineLimit:$r,enablePausing:xr,exportEncoding:Pr};const Tr=it({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var T=window.player=Tr;function rt(e){return JSON.stringify(e,(t,n)=>l(n))}var G=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Fr=["onClick"],Er=B({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=x(!1),r=x(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Je(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(a,s)=>(h(),w("button",{onClick:ft(i,["stop"]),class:ee(["feedback",{activated:n.value,left:e.left}])},[Le(a.$slots,"default",{},void 0,!0)],10,Fr))}});var Wt=G(Er,[["__scopeId","data-v-01a1b95c"]]);const Ot=e=>(Se("data-v-ac351c02"),e=e(),Ie(),e),Or={class:"error"},Vr={class:"error-title"},Lr={class:"error-details",style:{"margin-top":"-10px"}},Dr={key:0},Rr={class:"instructions"},qr=["href"],Ar=Ot(()=>m("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),Br=Ot(()=>m("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),zr=Ot(()=>m("br",null,null,-1)),Ur={key:0,style:{"margin-top":"20px"}},Gr=Ot(()=>m("h3",null,"Other errors",-1)),jr=[Gr],Hr={class:"error-details"},Wr={key:0,style:{"margin-top":"10px"}},Jr={key:1,style:{"margin-top":"10px"}},Kr=B({__name:"Error",props:{errors:null},setup(e){const t=e,n=F(()=>t.errors[0]),r=F(()=>t.errors.map(s=>s.stack==null?[]:s.stack.split(` +/* empty css */import"./vue.359c6955.js";import{q as it,C as l,ab as B,t as x,aF as h,a1 as w,aL as Le,bv as ft,G as ee,as as Je,_ as F,az as bt,a2 as m,J as V,O as W,aK as Oe,a0 as M,I as me,a8 as E,a9 as _,b7 as O,aI as Se,aG as Ie,l as ie,u as Et,j as Jn,bw as ln,aH as wt,A as de,$ as R,b9 as Ht,ar as Ae,bt as Kn,bc as yn,T as Zn,b2 as he,aD as _n,w as Ne,b3 as We,aO as se,z as Pe,bs as Yn,ay as Xn,aM as Ke,bo as Qn,am as Mt,H as er,y as un,bf as tr}from"./@vue.6f8187b0.js";import{L as Be}from"./lz-string.bfbf8ec3.js";import{c as Nn}from"./nanoevents.1080beb7.js";import{i as nr}from"./unofficial-galaxy-sdk.21372393.js";import{p as rr}from"./vue-textarea-autosize.35804eaf.js";import{Y as ir}from"./vue-next-select.68e0c605.js";import{D as ar}from"./vuedraggable.055200e5.js";import{s as sr,u as or}from"./vue-toastification.45d39007.js";import"./sortablejs.20039f18.js";const lr=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}};lr();const ur="modulepreload",cn={},cr="./",gt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${cr}${r}`,r in cn)return;cn[r]=!0;const i=r.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${a}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":ur,i||(s.as="script",s.crossOrigin=""),s.href=r,document.head.appendChild(s),i)return new Promise((c,d)=>{s.addEventListener("load",c),s.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},dr="./projInfo-schema.json",fr="Profectus",gr="A project made in Profectus",mr="",hr="",pr="",vr="",br="0.0",yr="Initial Commit",_r=!0,Nr=!1,wr=2,Cr=!0,kr=null,Sr="",Ir=["main"],Mr=3600,$r=1,xr=!0,Pr="base64";var z={$schema:dr,title:fr,description:gr,id:mr,author:hr,discordName:pr,discordLink:vr,versionNumber:br,versionTitle:yr,allowGoBack:_r,defaultShowSmall:Nr,defaultDecimalsShown:wr,useHeader:Cr,banner:kr,logo:Sr,initialTabs:Ir,maxTickLength:Mr,offlineLimit:$r,enablePausing:xr,exportEncoding:Pr};const Tr=it({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var T=window.player=Tr;function rt(e){return JSON.stringify(e,(t,n)=>{var r;return(r=l(n))!=null?r:null})}var G=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Fr=["onClick"],Er=B({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=x(!1),r=x(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Je(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(a,s)=>(h(),w("button",{onClick:ft(i,["stop"]),class:ee(["feedback",{activated:n.value,left:e.left}])},[Le(a.$slots,"default",{},void 0,!0)],10,Fr))}});var Wt=G(Er,[["__scopeId","data-v-01a1b95c"]]);const Ot=e=>(Se("data-v-ac351c02"),e=e(),Ie(),e),Or={class:"error"},Vr={class:"error-title"},Lr={class:"error-details",style:{"margin-top":"-10px"}},Dr={key:0},Rr={class:"instructions"},qr=["href"],Ar=Ot(()=>m("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),Br=Ot(()=>m("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),zr=Ot(()=>m("br",null,null,-1)),Ur={key:0,style:{"margin-top":"20px"}},Gr=Ot(()=>m("h3",null,"Other errors",-1)),jr=[Gr],Hr={class:"error-details"},Wr={key:0,style:{"margin-top":"10px"}},Jr={key:1,style:{"margin-top":"10px"}},Kr=B({__name:"Error",props:{errors:null},setup(e){const t=e,n=F(()=>t.errors[0]),r=F(()=>t.errors.map(s=>s.stack==null?[]:s.stack.split(` `))),i=F(()=>t.errors.map(s=>s.cause==null?[]:(typeof s.cause=="string"?s.cause:JSON.stringify(s.cause)).split(` `)));function a(){let s=rt(T);switch(z.exportEncoding){default:console.warn(`Unknown save encoding: ${z.exportEncoding}. Defaulting to lz`);case"lz":s=Be.compressToUTF16(s);break;case"base64":s=btoa(unescape(encodeURIComponent(s)));break;case"plain":break}console.log(s);const c=document.createElement("textarea");c.value=s,document.body.appendChild(c),c.select(),c.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(c)}return bt(()=>{T.autosave=!1,T.devSpeed=0}),(s,c)=>(h(),w("div",Or,[m("h1",Vr,V(l(n).name)+": "+V(l(n).message),1),m("div",Lr,[l(n).cause?(h(),w("div",Dr,[(h(!0),w(W,null,Oe(l(i)[0],d=>(h(),w("div",{key:d},V(d),1))),128))])):M("",!0),l(n).stack?(h(),w("div",{key:1,style:me(l(n).cause?"margin-top: 10px":"")},[(h(!0),w(W,null,Oe(l(r)[0],d=>(h(),w("div",{key:d},V(d),1))),128))],4)):M("",!0)]),m("div",Rr,[E(" Check the console for more details, and consider sharing it with the developers on "),m("a",{href:l(z).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,qr),E("! "),_(Wt,{onClick:a,class:"button",style:{display:"inline-flex"}},{default:O(()=>[Ar,Br]),_:1}),zr,e.errors.length>1?(h(),w("div",Ur,jr)):M("",!0),(h(!0),w(W,null,Oe(e.errors.slice(1),(d,f)=>(h(),w("div",{key:f,style:{"margin-top":"20px"}},[m("details",Hr,[m("summary",null,V(d.name)+": "+V(d.message),1),d.cause?(h(),w("div",Wr,[(h(!0),w(W,null,Oe(l(i)[f+1],b=>(h(),w("div",{key:b},V(b),1))),128))])):M("",!0),d.stack?(h(),w("div",Jr,[(h(!0),w(W,null,Oe(l(r)[f+1],b=>(h(),w("div",{key:b},V(b),1))),128))])):M("",!0)])]))),128))])]))}});var wn=G(Kr,[["__scopeId","data-v-ac351c02"]]);class Zr{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const r=new Yr(t,n);for(this.first===void 0?(this.first=r,this.last=r):(r.next=this.first,this.first.prev=r,this.first=r),this.map.set(t,r);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class Yr{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const qt=17,Xr=9e15,Qr=Math.log10(9e15),ei=1/9e15,ti=308,ni=-324,dn=5,ri=(1<<10)-1,ii=function(){const e=[];for(let n=ni+1;n<=ti;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Ue=[2,Math.E,3,4,5,6,7,8,9,10],ai=[[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]],si=[[-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 p=function(t){return u.fromValue_noAlloc(t)},D=function(e,t,n){return u.fromComponents(e,t,n)},A=function(t,n,r){return u.fromComponents_noNormalize(t,n,r)};const Ee=function(t,n){const r=n+1,i=Math.ceil(Math.log10(Math.abs(t))),a=Math.round(t*Math.pow(10,r-i))*Math.pow(10,i-r);return parseFloat(a.toFixed(Math.max(r-i,0)))},At=function(e){return Math.sign(e)*Math.log10(Math.abs(e))},oi=function(e){if(!isFinite(e))return e;if(e<-50)return e===Math.trunc(e)?Number.NEGATIVE_INFINITY:0;let t=1;for(;e<10;)t=t*e,++e;e-=1;let n=.9189385332046727;n=n+(e+.5)*Math.log(e),n=n-e;const r=e*e;let i=e;return n=n+1/(12*i),i=i*r,n=n+1/(360*i),i=i*r,n=n+1/(1260*i),i=i*r,n=n+1/(1680*i),i=i*r,n=n+1/(1188*i),i=i*r,n=n+691/(360360*i),i=i*r,n=n+7/(1092*i),i=i*r,n=n+3617/(122400*i),Math.exp(n)/t},Cn=.5671432904097838,fn=function(e,t=1e-10){let n,r;if(!Number.isFinite(e)||e===0)return e;if(e===1)return Cn;e<10?n=0:n=Math.log(e)-Math.log(Math.log(e));for(let i=0;i<100;++i){if(r=(e*Math.exp(-n)+n*n)/(n+1),Math.abs(r-n).5?1:-1;if(Math.random()*20<1)return A(t,0,1);const n=Math.floor(Math.random()*(e+1));let r=n===0?Math.random()*616-308:Math.random()*16;Math.random()>.9&&(r=Math.trunc(r));let i=Math.pow(10,r);return Math.random()>.9&&(i=Math.trunc(i)),D(t,n,i)}static affordGeometricSeries_core(e,t,n,r){const i=t.mul(n.pow(r));return g.floor(e.div(i).mul(n.sub(1)).add(1).log10().div(n.log10()))}static sumGeometricSeries_core(e,t,n,r){return t.mul(n.pow(r)).mul(g.sub(1,n.pow(e))).div(g.sub(1,n))}static affordArithmeticSeries_core(e,t,n,r){const a=t.add(r.mul(n)).sub(n.div(2)),s=a.pow(2);return a.neg().add(s.add(n.mul(e).mul(2)).sqrt()).div(n).floor()}static sumArithmeticSeries_core(e,t,n,r){const i=t.add(r.mul(n));return e.div(2).mul(i.mul(2).plus(e.sub(1).mul(n)))}static efficiencyOfPurchase_core(e,t,n){return e.div(t).add(e.div(n))}normalize(){if(this.sign===0||this.mag===0&&this.layer===0)return this.sign=0,this.mag=0,this.layer=0,this;if(this.layer===0&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),this.layer===0&&this.mag=Xr)return this.layer+=1,this.mag=t*Math.log10(e),this;for(;e0;)this.layer-=1,this.layer===0?this.mag=Math.pow(10,this.mag):(this.mag=t*Math.pow(10,e),e=Math.abs(this.mag),t=Math.sign(this.mag));return this.layer===0&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):this.mag===0&&(this.sign=0)),this}fromComponents(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this.normalize(),this}fromComponents_noNormalize(e,t,n){return this.sign=e,this.layer=t,this.mag=n,this}fromMantissaExponent(e,t){return this.layer=1,this.sign=Math.sign(e),e=Math.abs(e),this.mag=t+Math.log10(e),this.normalize(),this}fromMantissaExponent_noNormalize(e,t){return this.fromMantissaExponent(e,t),this}fromDecimal(e){return this.sign=e.sign,this.layer=e.layer,this.mag=e.mag,this}fromNumber(e){return this.mag=Math.abs(e),this.sign=Math.sign(e),this.layer=0,this.normalize(),this}fromString(e){const t=e,n=g.fromStringCache.get(t);if(n!==void 0)return this.fromDecimal(n);e=e.replace(",","");const r=e.split("^^^");if(r.length===2){const y=parseFloat(r[0]),S=parseFloat(r[1]),P=r[1].split(";");let I=1;if(P.length===2&&(I=parseFloat(P[1]),isFinite(I)||(I=1)),isFinite(y)&&isFinite(S)){const $=g.pentate(y,S,I);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}}const i=e.split("^^");if(i.length===2){const y=parseFloat(i[0]),S=parseFloat(i[1]),P=i[1].split(";");let I=1;if(P.length===2&&(I=parseFloat(P[1]),isFinite(I)||(I=1)),isFinite(y)&&isFinite(S)){const $=g.tetrate(y,S,I);return this.sign=$.sign,this.layer=$.layer,this.mag=$.mag,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}}const a=e.split("^");if(a.length===2){const y=parseFloat(a[0]),S=parseFloat(a[1]);if(isFinite(y)&&isFinite(S)){const P=g.pow(y,S);return this.sign=P.sign,this.layer=P.layer,this.mag=P.mag,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}}e=e.trim().toLowerCase();let s,c,d=e.split("pt");if(d.length===2){s=10,c=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let y=parseFloat(d[1]);if(isFinite(y)||(y=1),isFinite(s)&&isFinite(c)){const S=g.tetrate(s,c,y);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}}if(d=e.split("p"),d.length===2){s=10,c=parseFloat(d[0]),d[1]=d[1].replace("(",""),d[1]=d[1].replace(")","");let y=parseFloat(d[1]);if(isFinite(y)||(y=1),isFinite(s)&&isFinite(c)){const S=g.tetrate(s,c,y);return this.sign=S.sign,this.layer=S.layer,this.mag=S.mag,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}}const f=e.split("e"),b=f.length-1;if(b===0){const y=parseFloat(e);if(isFinite(y))return this.fromNumber(y),g.fromStringCache.size>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}else if(b===1){const y=parseFloat(e);if(isFinite(y)&&y!==0)return this.fromNumber(y),g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}const v=e.split("e^");if(v.length===2){this.sign=1,v[0].charAt(0)=="-"&&(this.sign=-1);let y="";for(let S=0;S=43&&P<=57||P===101)y+=v[1].charAt(S);else return this.layer=parseFloat(y),this.mag=parseFloat(v[1].substr(S+1)),this.normalize(),g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}}if(b<1)return this.sign=0,this.layer=0,this.mag=0,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this;const N=parseFloat(f[0]);if(N===0)return this.sign=0,this.layer=0,this.mag=0,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this;let k=parseFloat(f[f.length-1]);if(b>=2){const y=parseFloat(f[f.length-2]);isFinite(y)&&(k*=Math.sign(y),k+=At(y))}if(!isFinite(N))this.sign=f[0]==="-"?-1:1,this.layer=b,this.mag=k;else if(b===1)this.sign=Math.sign(N),this.layer=1,this.mag=k+Math.log10(Math.abs(N));else if(this.sign=Math.sign(N),this.layer=b,b===2){const y=g.mul(D(1,2,k),p(N));return this.sign=y.sign,this.layer=y.layer,this.mag=y.mag,g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}else this.mag=k;return this.normalize(),g.fromStringCache.maxSize>=1&&g.fromStringCache.set(t,g.fromDecimal(this)),this}fromValue(e){return e instanceof g?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:Ee(this.m,e)}magnitudeWithDecimalPlaces(e){return isNaN(this.mag)?Number.NaN:this.mag===0?0:Ee(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<=dn?(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):Ee(this.m,e)+"e"+Ee(this.e,e):this.layer===1?Ee(this.m,e)+"e"+Ee(this.e,e):this.layer<=dn?(this.sign===-1?"-":"")+"e".repeat(this.layer)+Ee(this.mag,e):(this.sign===-1?"-":"")+"(e^"+this.layer+")"+Ee(this.mag,e)}abs(){return A(this.sign===0?0:1,this.layer,this.mag)}neg(){return A(-this.sign,this.layer,this.mag)}negate(){return this.neg()}negated(){return this.neg()}sgn(){return this.sign}round(){return this.mag<0?g.dZero:this.layer===0?D(this.sign,0,Math.round(this.mag)):this}floor(){return this.mag<0?g.dZero:this.layer===0?D(this.sign,0,Math.floor(this.mag)):this}ceil(){return this.mag<0?g.dZero:this.layer===0?D(this.sign,0,Math.ceil(this.mag)):this}trunc(){return this.mag<0?g.dZero:this.layer===0?D(this.sign,0,Math.trunc(this.mag)):this}add(e){const t=p(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 A(0,0,0);let n,r;if(this.layer>=2||t.layer>=2)return this.maxabs(t);if(g.cmpabs(this,t)>0?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return g.fromNumber(n.sign*n.mag+r.sign*r.mag);const i=n.layer*Math.sign(n.mag),a=r.layer*Math.sign(r.mag);if(i-a>=2)return n;if(i===0&&a===-1){if(Math.abs(r.mag-Math.log10(n.mag))>qt)return n;{const s=Math.pow(10,Math.log10(n.mag)-r.mag),c=r.sign+n.sign*s;return D(Math.sign(c),1,r.mag+Math.log10(Math.abs(c)))}}if(i===1&&a===0){if(Math.abs(n.mag-Math.log10(r.mag))>qt)return n;{const s=Math.pow(10,n.mag-Math.log10(r.mag)),c=r.sign+n.sign*s;return D(Math.sign(c),1,Math.log10(r.mag)+Math.log10(Math.abs(c)))}}if(Math.abs(n.mag-r.mag)>qt)return n;{const s=Math.pow(10,n.mag-r.mag),c=r.sign+n.sign*s;return D(Math.sign(c),1,r.mag+Math.log10(Math.abs(c)))}}plus(e){return this.add(e)}sub(e){return this.add(p(e).neg())}subtract(e){return this.sub(e)}minus(e){return this.sub(e)}mul(e){const t=p(e);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(t.layer))return t;if(this.sign===0||t.sign===0)return A(0,0,0);if(this.layer===t.layer&&this.mag===-t.mag)return A(this.sign*t.sign,0,1);let n,r;if(this.layer>t.layer||this.layer==t.layer&&Math.abs(this.mag)>Math.abs(t.mag)?(n=this,r=t):(n=t,r=this),n.layer===0&&r.layer===0)return g.fromNumber(n.sign*r.sign*n.mag*r.mag);if(n.layer>=3||n.layer-r.layer>=2)return D(n.sign*r.sign,n.layer,n.mag);if(n.layer===1&&r.layer===0)return D(n.sign*r.sign,1,n.mag+Math.log10(r.mag));if(n.layer===1&&r.layer===1)return D(n.sign*r.sign,1,n.mag+r.mag);if(n.layer===2&&r.layer===1){const i=D(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(D(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return D(n.sign*r.sign,i.layer+1,i.sign*i.mag)}if(n.layer===2&&r.layer===2){const i=D(Math.sign(n.mag),n.layer-1,Math.abs(n.mag)).add(D(Math.sign(r.mag),r.layer-1,Math.abs(r.mag)));return D(n.sign*r.sign,i.layer+1,i.sign*i.mag)}throw Error("Bad arguments to mul: "+this+", "+e)}multiply(e){return this.mul(e)}times(e){return this.mul(e)}div(e){const t=p(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?g.dNaN:this.layer===0?D(this.sign,0,1/this.mag):D(this.sign,this.layer,-this.mag)}reciprocal(){return this.recip()}reciprocate(){return this.recip()}cmp(e){const t=p(e);return this.sign>t.sign?1:this.sign0?this.layer:-this.layer,r=t.mag>0?t.layer:-t.layer;return n>r?1:nt.mag?1:this.mag0?t:this}clamp(e,t){return this.max(e).min(t)}clampMin(e){return this.max(e)}clampMax(e){return this.min(e)}cmp_tolerance(e,t){const n=p(e);return this.eq_tolerance(n,t)?0:this.cmp(n)}compare_tolerance(e,t){return this.cmp_tolerance(e,t)}eq_tolerance(e,t){const n=p(e);if(t==null&&(t=1e-7),this.sign!==n.sign||Math.abs(this.layer-n.layer)>1)return!1;let r=this.mag,i=n.mag;return this.layer>n.layer&&(i=At(i)),this.layer0?D(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):D(1,0,Math.log10(this.mag))}log10(){return this.sign<=0?g.dNaN:this.layer>0?D(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):D(this.sign,0,Math.log10(this.mag))}log(e){return e=p(e),this.sign<=0||e.sign<=0||e.sign===1&&e.layer===0&&e.mag===1?g.dNaN:this.layer===0&&e.layer===0?D(this.sign,0,Math.log(this.mag)/Math.log(e.mag)):g.div(this.log10(),e.log10())}log2(){return this.sign<=0?g.dNaN:this.layer===0?D(this.sign,0,Math.log2(this.mag)):this.layer===1?D(Math.sign(this.mag),0,Math.abs(this.mag)*3.321928094887362):this.layer===2?D(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):D(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}ln(){return this.sign<=0?g.dNaN:this.layer===0?D(this.sign,0,Math.log(this.mag)):this.layer===1?D(Math.sign(this.mag),0,Math.abs(this.mag)*2.302585092994046):this.layer===2?D(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):D(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))}logarithm(e){return this.log(e)}pow(e){const t=p(e),n=this,r=t;if(n.sign===0)return r.eq(0)?A(1,0,1):n;if(n.sign===1&&n.layer===0&&n.mag===1)return n;if(r.sign===0)return A(1,0,1);if(r.sign===1&&r.layer===0&&r.mag===1)return n;const i=n.absLog10().mul(r).pow10();return this.sign===-1?Math.abs(r.toNumber()%2)%2===1?i.neg():Math.abs(r.toNumber()%2)%2===0?i:g.dNaN:i}pow10(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return g.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 D(1,0,t);if(e.sign===0)return g.dOne;e=A(e.sign,e.layer+1,Math.log10(e.mag))}return e.sign>0&&e.mag>=0?D(e.sign,e.layer+1,e.mag):e.sign<0&&e.mag>=0?D(-e.sign,e.layer+1,-e.mag):g.dOne}pow_base(e){return p(e).pow(this)}root(e){const t=p(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?g.exp(g.mul(this,g.ln(this).sub(1))):g.exp(this)}gamma(){if(this.mag<0)return this.recip();if(this.layer===0){if(this.lt(A(1,0,24)))return g.fromNumber(oi(this.sign*this.mag));const e=this.mag-1;let t=.9189385332046727;t=t+(e+.5)*Math.log(e),t=t-e;const n=e*e;let r=e,i=12*r,a=1/i,s=t+a;if(s===t||(t=s,r=r*n,i=360*r,a=1/i,s=t-a,s===t))return g.exp(t);t=s,r=r*n,i=1260*r;let c=1/i;return t=t+c,r=r*n,i=1680*r,c=1/i,t=t-c,g.exp(t)}else return this.layer===1?g.exp(g.mul(this,g.ln(this).sub(1))):g.exp(this)}lngamma(){return this.gamma().ln()}exp(){return this.mag<0?g.dOne:this.layer===0&&this.mag<=709.7?g.fromNumber(Math.exp(this.sign*this.mag)):this.layer===0?D(1,1,this.sign*Math.log10(Math.E)*this.mag):this.layer===1?D(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):D(1,this.layer+1,this.sign*this.mag)}sqr(){return this.pow(2)}sqrt(){if(this.layer===0)return g.fromNumber(Math.sqrt(this.sign*this.mag));if(this.layer===1)return D(1,2,Math.log10(this.mag)-.3010299956639812);{const e=g.div(A(this.sign,this.layer-1,this.mag),A(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=A(1,0,1)){if(e===1)return g.pow(this,t);if(e===0)return new g(t);if(this.eq(g.dOne))return g.dOne;if(this.eq(-1))return g.pow(this,t);if(e===Number.POSITIVE_INFINITY){const i=this.toNumber();if(i<=1.444667861009766&&i>=.06598803584531254){if(i>1.444667861009099)return g.fromNumber(Math.E);const a=g.ln(this).neg();return a.lambertw().div(a)}else return i>1.444667861009766?g.fromNumber(Number.POSITIVE_INFINITY):g.dNaN}if(this.eq(g.dZero)){let i=Math.abs((e+1)%2);return i>1&&(i=2-i),g.fromNumber(i)}if(e<0)return g.iteratedlog(t,this,-e);t=p(t);const n=e;e=Math.trunc(e);const r=n-e;if(this.gt(g.dZero)&&this.lte(1.444667861009766)){e=Math.min(1e4,e);for(let i=0;i3)return A(t.sign,t.layer+(e-i-1),t.mag);if(i>1e4)return t}return t}iteratedexp(e=2,t=A(1,0,1)){return this.tetrate(e,t)}iteratedlog(e=10,t=1){if(t<0)return g.tetrate(e,-t,this);e=p(e);let n=g.fromDecimal(this);const r=t;t=Math.trunc(t);const i=r-t;if(n.layer-e.layer>3){const a=Math.min(t,n.layer-e.layer-3);t-=a,n.layer-=a}for(let a=0;a1e4)return n}return i>0&&i<1&&(e.eq(10)?n=n.layeradd10(-i):n=n.layeradd(-i,e)),n}slog(e=10,t=100){let n=.001,r=!1,i=!1,a=this.slog_internal(e).toNumber();for(let s=1;s1&&i!=d&&(r=!0),i=d,r?n/=2:n*=2,n=Math.abs(n)*(d?-1:1),a+=n,n===0)break}return g.fromNumber(a)}slog_internal(e=10){if(e=p(e),e.lte(g.dZero)||e.eq(g.dOne))return g.dNaN;if(e.lt(g.dOne))return this.eq(g.dOne)?g.dZero:this.eq(g.dZero)?g.dNegOne:g.dNaN;if(this.mag<0||this.eq(g.dZero))return g.dNegOne;let t=0,n=g.fromDecimal(this);if(n.layer-e.layer>3){const r=n.layer-e.layer-3;t+=r,n.layer-=r}for(let r=0;r<100;++r)if(n.lt(g.dZero))n=g.pow(e,n),t-=1;else{if(n.lte(g.dOne))return g.fromNumber(t+g.slog_critical(e.toNumber(),n.toNumber()));t+=1,n=g.log(n,e)}return g.fromNumber(t)}static slog_critical(e,t){return e>10?t-1:g.critical_section(e,t,si)}static tetrate_critical(e,t){return g.critical_section(e,t,ai)}static critical_section(e,t,n){t*=10,t<0&&(t=0),t>10&&(t=10),e<2&&(e=2),e>10&&(e=10);let r=0,i=0;for(let s=0;se){const c=(e-Ue[s])/(Ue[s+1]-Ue[s]);r=n[s][Math.floor(t)]*(1-c)+n[s+1][Math.floor(t)]*c,i=n[s][Math.ceil(t)]*(1-c)+n[s+1][Math.ceil(t)]*c;break}const a=t-Math.floor(t);return r<=0||i<=0?r*(1-a)+i*a:Math.pow(e,Math.log(r)/Math.log(e)*(1-a)+Math.log(i)/Math.log(e)*a)}layeradd10(e){e=g.fromValue_noAlloc(e).toNumber();const t=g.fromDecimal(this);if(e>=1){t.mag<0&&t.layer>0?(t.sign=0,t.mag=0,t.layer=0):t.sign===-1&&t.layer==0&&(t.sign=1,t.mag=-t.mag);const n=Math.trunc(e);e-=n,t.layer+=n}if(e<=-1){const n=Math.trunc(e);if(e-=n,t.layer+=n,t.layer<0)for(let r=0;r<100;++r){if(t.layer++,t.mag=Math.log10(t.mag),!isFinite(t.mag))return t.sign===0&&(t.sign=1),t.layer<0&&(t.layer=0),t.normalize();if(t.layer>=0)break}}for(;t.layer<0;)t.layer++,t.mag=Math.log10(t.mag);return t.sign===0&&(t.sign=1,t.mag===0&&t.layer>=1&&(t.layer-=1,t.mag=1)),t.normalize(),e!==0?t.layeradd(e,10):t}layeradd(e,t){const r=this.slog(t).toNumber()+e;return r>=0?g.tetrate(t,r):Number.isFinite(r)?r>=-1?g.log(g.tetrate(t,r+1),t):g.log(g.log(g.tetrate(t,r+2),t),t):g.dNaN}lambertw(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");if(this.mag<0)return g.fromNumber(fn(this.toNumber()));if(this.layer===0)return g.fromNumber(fn(this.sign*this.mag));if(this.layer===1)return gn(this);if(this.layer===2)return gn(this);if(this.layer>=3)return A(this.sign,this.layer-1,this.mag);throw new Error("Unhandled behavior in lambertw()")}ssqrt(){if(this.sign==1&&this.layer>=3)return A(this.sign,this.layer-1,this.mag);const e=this.ln();return e.div(e.lambertw())}pentate(e=2,t=A(1,0,1)){t=p(t);const n=e;e=Math.trunc(e);const r=n-e;r!==0&&(t.eq(g.dOne)?(++e,t=g.fromNumber(r)):this.eq(10)?t=t.layeradd10(r):t=t.layeradd(r,this));for(let i=0;i10)return t}return t}sin(){return this.mag<0?this:this.layer===0?g.fromNumber(Math.sin(this.sign*this.mag)):A(0,0,0)}cos(){return this.mag<0?g.dOne:this.layer===0?g.fromNumber(Math.cos(this.sign*this.mag)):A(0,0,0)}tan(){return this.mag<0?this:this.layer===0?g.fromNumber(Math.tan(this.sign*this.mag)):A(0,0,0)}asin(){return this.mag<0?this:this.layer===0?g.fromNumber(Math.asin(this.sign*this.mag)):A(Number.NaN,Number.NaN,Number.NaN)}acos(){return this.mag<0?g.fromNumber(Math.acos(this.toNumber())):this.layer===0?g.fromNumber(Math.acos(this.sign*this.mag)):A(Number.NaN,Number.NaN,Number.NaN)}atan(){return this.mag<0?this:this.layer===0?g.fromNumber(Math.atan(this.sign*this.mag)):g.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 g.ln(this.add(this.sqr().add(1).sqrt()))}acosh(){return g.ln(this.add(this.sqr().sub(1).sqrt()))}atanh(){return this.abs().gte(1)?A(Number.NaN,Number.NaN,Number.NaN):g.ln(this.add(1).div(g.fromNumber(1).sub(this))).div(2)}ascensionPenalty(e){return e===0?this:this.root(g.pow(10,e))}egg(){return this.add(9)}lessThanOrEqualTo(e){return this.cmp(e)<1}lessThan(e){return this.cmp(e)<0}greaterThanOrEqualTo(e){return this.cmp(e)>-1}greaterThan(e){return this.cmp(e)>0}};let u=g;u.fromStringCache=new Zr(ri);u.dZero=A(0,0,0);u.dOne=A(1,0,1);u.dNegOne=A(-1,0,1);u.dTwo=A(1,0,2);u.dTen=A(1,0,10);u.dNaN=A(Number.NaN,Number.NaN,Number.NaN);u.dInf=A(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY);u.dNegInf=A(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);u.dNumberMax=D(1,0,Number.MAX_VALUE);u.dNumberMin=D(1,0,Number.MIN_VALUE);p=u.fromValue_noAlloc;D=u.fromComponents;A=u.fromComponents_noNormalize;u.fromMantissaExponent;u.fromMantissaExponent_noNormalize;const li=new u(1);function ct(e,t,n=!0){let r=u.log10(e).floor(),i=u.div(e,u.pow(10,r));i.toStringWithDecimalPlaces(t)==="10"&&(i=li,r=r.add(1));const a=r.gte(1e9)?ve(r,Math.max(Math.max(t,3),z.defaultDecimalsShown)):r.gte(1e4)?$t(r,0):r.toStringWithDecimalPlaces(0);return n?i.toStringWithDecimalPlaces(t)+"e"+a:"e"+a}function $t(e,t){if(e==null)return"NaN";if(e=new u(e),e.mag<.001)return 0 .toFixed(t);const r=e.toStringWithDecimalPlaces(t).split(".");return r[0]=r[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"),r.length==1?r[0]:r[0]+"."+r[1]}function kn(e,t){return e==null?"NaN":(e=new u(e),e.mag<1e-4?0 .toFixed(t):(e.mag<.1&&t!==0&&(t=Math.max(Math.max(t,e.log10().negate().ceil().toNumber()),z.defaultDecimalsShown)),e.toStringWithDecimalPlaces(t)))}const ui=new u("eeee1000"),ci=new u("e100000"),mn=new u("e1000"),Sn=new u(1e9),di=new u(1e6),fi=new u(1e3),gi=new u(.98),mi=new u(.001),In=new u(0);function ve(e,t,n){if(t==null&&(t=z.defaultDecimalsShown),n=n!=null?n:z.defaultShowSmall,e=new u(e),isNaN(e.sign)||isNaN(e.layer)||isNaN(e.mag))return"NaN";if(e.sign<0)return"-"+ve(e.neg(),t);if(e.mag===Number.POSITIVE_INFINITY)return"Infinity";if(e.gte(ui)){const r=e.slog();return r.gte(di)?"F"+ve(r.floor()):u.pow(10,r.sub(r.floor())).toStringWithDecimalPlaces(3)+"F"+$t(r.floor(),0)}else{if(e.gte(ci))return ct(e,0,!1);if(e.gte(mn))return ct(e,0);if(e.gte(Sn))return ct(e,t);if(e.gte(fi))return $t(e,0);if(e.gte(mi)||!n)return kn(e,t);if(e.eq(In))return 0 .toFixed(t)}return e=$n(e),e.lt(mn)?ct(e,t).replace(/([^(?:e|F)]*)$/,"-$1"):ve(e,t)+"\u207B\xB9"}function pe(e){return e=new u(e),e.sign<0?"-"+pe(e.neg()):e.gte(Sn)||e.lte(gi)&&!e.eq(In)?ve(e):ve(e,0)}function Mn(e){return u.lt(e,0)?"-"+Mn(u.neg(e)):u.gt(e,2**51)?ve(u.div(e,31536e3))+"y":(e=new u(e).toNumber(),e<60?ve(e)+"s":e<3600?pe(Math.floor(e/60))+"m "+ve(e%60)+"s":e<86400?pe(Math.floor(e/3600))+"h "+pe(Math.floor(e/60)%60)+"m "+pe(e%60)+"s":e<31536e3?pe(Math.floor(e/84600)%365)+"d "+pe(Math.floor(e/3600)%24)+"h "+pe(Math.floor(e/60)%60)+"m":pe(Math.floor(e/31536e3))+"y "+pe(Math.floor(e/84600)%365)+"d "+pe(Math.floor(e/3600)%24)+"h")}function hi(e,t,n){e=new u(e);let r=e.toStringWithDecimalPlaces(t);return new u(r).gte(n)&&(r=u.sub(n,Math.pow(.1,t)).toStringWithDecimalPlaces(t)),r}function pi(e,t){return ve(e,t,!0)}function $n(e){let t=u.log10(e).ceil();const n=u.div(e,u.pow(10,t));return t=t.neg(),e=new u(10).pow(t).times(n),e}var vi=Object.freeze(Object.defineProperty({__proto__:null,default:u,exponentialFormat:ct,commaFormat:$t,regularFormat:kn,format:ve,formatWhole:pe,formatTime:Mn,toPlaces:hi,formatSmall:pi,invertOOM:$n},Symbol.toStringTag,{value:"Module"}));const{exponentialFormat:bi,commaFormat:yi,regularFormat:_i,format:Te,formatWhole:mt,formatTime:Vt,toPlaces:Ni,formatSmall:wi,invertOOM:Ci}=vi;window.Decimal=u;window.exponentialFormat=bi;window.commaFormat=yi;window.regularFormat=_i;window.format=Te;window.formatWhole=mt;window.formatTime=Vt;window.toPlaces=Ni;window.formatSmall=wi;window.invertOOM=Ci;function xn(e){let t=e.replace(/([A-Z])/g," $1");return t=t.charAt(0).toUpperCase()+t.slice(1),t}function ki(e){return(e[0]+e.slice(1).replace(/[A-Z]/g,t=>`-${t}`)).toLowerCase()}function Bt(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 ht=Symbol("DoNotCache");function L(e,t){const n=e[t];Bt(n)&&n.length===0&&!n[ht]?e[t]=F(n.bind(e)):Bt(n)&&(e[t]=n.bind(e),e[t][ht]=!0)}function zt(e){return Bt(e)&&!e[ht]&&(e=F(e)),e}const De=Symbol("Component"),Re=Symbol("GatherProps");let Si=0;function Lt(e="feature-"){return e+Si++}var at=(e=>(e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden",e[e.None=2]="None",e))(at||{});function Pn(e){const t=l(e);return t!==2&&t!==!1}function Tn(e){return l(e)===1}function te(e){return e[ht]=!0,e}function ce(e,t,n){e[t]===void 0&&n!=null&&(e[t]=n)}function Fn(e,...t){const n=[],r=i=>{Object.keys(i).forEach(a=>{const s=i[a];s!=null&&typeof s=="object"&&(t.includes(s.type)?n.push(s):!(s instanceof u)&&!ie(s)&&r(s))})};return r(e),n}const oe=Nn();"fonts"in document&&(document.fonts.onloadingdone=()=>oe.emit("fontsLoaded"));var Ii=Object.freeze(Object.defineProperty({__proto__:null,globalBus:oe},Symbol.toStringTag,{value:"Module"}));const je=Symbol("ProxyState");function Ye(e,t={}){const n=t;let r=!1,i=!1;function a(){return r||(i&&console.error("Cyclical dependency detected. Cannot evaluate lazy proxy."),i=!0,Object.assign(n,e.call(n,n)),r=!0),n}return new Proxy(n,{get(s,c){if(c===je)return a();const d=a()[c];return d!=null&&typeof d=="object"&&Ve in d?d[Ve]:d},set(s,c,d){return a()[c]=d,!0},has(s,c){return c===je?!0:Reflect.has(a(),c)},ownKeys(){return Reflect.ownKeys(a())},getOwnPropertyDescriptor(s,c){return r||(Object.assign(n,e.call(n,n)),r=!0),Object.getOwnPropertyDescriptor(s,c)}})}var Z=window.state=Et({lastTenTicks:[],hasNaN:!1,NaNPath:[],errors:it([])});const En=u.ln(10);function St(e){return e}function ut(e,...t){const n=t.find(r=>C(r));return n==null?(console.error("Could not invert due to no input being a variable"),0):n.invert(e)}function Mi(e,t){return C(t)?t.invert(u.neg(e)):(console.error("Could not invert due to no input being a variable"),0)}function $i(e,t){return C(t)?t.isIntegrable()?o.neg(t.getIntegralFormula(e)):(console.error("Could not integrate due to variable not being integrable"),o.constant(0)):(console.error("Could not integrate due to no input being a variable"),o.constant(0))}function xi(e){return o.neg(e)}function Pi(e,t,n){return C(t)?t.invert(u.sub(e,Y(n))):C(n)?n.invert(u.sub(e,Y(t))):(console.error("Could not invert due to no input being a variable"),0)}function Ti(e,t,n){var r,i;if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const a=t.getIntegralFormula(e);return o.times(n,(r=t.innermostVariable)!=null?r:0).add(a)}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const a=n.getIntegralFormula(e);return o.times(t,(i=n.innermostVariable)!=null?i:0).add(a)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Fi(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e);return o.add(r,n)}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=n.getIntegralFormula(e);return o.add(r,t)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Ei(e,t,n){return C(t)?t.invert(u.add(e,Y(n))):C(n)?n.invert(u.sub(Y(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Oi(e,t,n){var r,i;if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const a=t.getIntegralFormula(e);return o.sub(a,o.times(n,(r=t.innermostVariable)!=null?r:0))}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const a=n.getIntegralFormula(e);return o.times(t,(i=n.innermostVariable)!=null?i:0).sub(a)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Vi(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e);return o.sub(r,n)}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=n.getIntegralFormula(e);return o.sub(r,t)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Li(e,t,n){return C(t)?t.invert(u.div(e,Y(n))):C(n)?n.invert(u.div(e,Y(t))):(console.error("Could not invert due to no input being a variable"),0)}function Di(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e);return o.times(r,n)}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=n.getIntegralFormula(e);return o.times(r,t)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Ri(e,t,n){return C(t)?o.div(e,n):C(n)?o.div(e,t):(console.error("Could not apply substitution due to no input being a variable"),o.constant(0))}function qi(e,t,n){return C(t)?t.invert(u.mul(e,Y(n))):C(n)?n.invert(u.div(Y(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Ai(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e);return o.div(r,n)}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=n.getIntegralFormula(e);return o.div(t,r)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Bi(e,t,n){return C(t)?o.mul(e,n):C(n)?o.mul(e,t):(console.error("Could not apply substitution due to no input being a variable"),o.constant(0))}function zi(e,t){return C(t)?t.invert(u.recip(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ui(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.ln(n)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Gi(e,t){return C(t)?t.invert(u.pow10(e)):(console.error("Could not invert due to no input being a variable"),0)}function ji(e){return u.ln(e).sub(1).times(e).div(En)}function Hi(e,t){if(C(t)){const n=En.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Wi(e,t){return C(t)?t.isIntegrable()?new o({inputs:[t.getIntegralFormula(e)],evaluate:ji,invert:Hi}):(console.error("Could not integrate due to variable not being integrable"),o.constant(0)):(console.error("Could not integrate due to no input being a variable"),o.constant(0))}function Ji(e,t,n){return C(t)?t.invert(u.pow(Y(n),e)):C(n)?n.invert(u.root(Y(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function Ki(e,t){return u.ln(e).sub(1).times(e).div(u.ln(t))}function Zi(e,t,n){if(C(t)){const r=u.ln(Y(n)).times(e);return t.invert(r.div(r.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function Yi(e,t,n){return C(t)?t.isIntegrable()?new o({inputs:[t.getIntegralFormula(e),n],evaluate:Ki,invert:Zi}):(console.error("Could not integrate due to variable not being integrable"),o.constant(0)):(console.error("Could not integrate due to no input being a variable"),o.constant(0))}function Xi(e,t){return C(t)?t.invert(u.pow(2,e)):(console.error("Could not invert due to no input being a variable"),0)}function Qi(e){return u.ln(e).sub(1).times(e).div(u.ln(2))}function ea(e,t){if(C(t)){const n=u.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}return console.error("Could not invert due to no input being a variable"),0}function ta(e,t){return C(t)?t.isIntegrable()?new o({inputs:[t.getIntegralFormula(e)],evaluate:Qi,invert:ea}):(console.error("Could not integrate due to variable not being integrable"),o.constant(0)):(console.error("Could not integrate due to no input being a variable"),o.constant(0))}function na(e,t){return C(t)?t.invert(u.exp(e)):(console.error("Could not invert due to no input being a variable"),0)}function ra(e){return u.ln(e).sub(1).times(e)}function ia(e,t){return C(t)?t.invert(u.div(e,u.div(e,Math.E).lambertw())):(console.error("Could not invert due to no input being a variable"),0)}function aa(e,t){return C(t)?t.isIntegrable()?new o({inputs:[t.getIntegralFormula(e)],evaluate:ra,invert:ia}):(console.error("Could not integrate due to variable not being integrable"),o.constant(0)):(console.error("Could not integrate due to no input being a variable"),o.constant(0))}function sa(e,t,n){return C(t)?t.invert(u.root(e,Y(n))):C(n)?n.invert(u.ln(e).div(u.ln(Y(t)))):(console.error("Could not invert due to no input being a variable"),0)}function oa(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e),i=o.add(n,1);return o.pow(r,i).div(i)}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=n.getIntegralFormula(e);return o.pow(t,r).div(o.ln(t))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function la(e,t){return C(t)?t.invert(u.root(e,10)):(console.error("Could not invert due to no input being a variable"),0)}function ua(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.pow10(n).div(o.ln(10))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function ca(e,t,n){return C(t)?t.invert(u.ln(e).div(u.ln(Y(n)))):C(n)?n.invert(u.root(Y(t),e)):(console.error("Could not invert due to no input being a variable"),0)}function da(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e);return o.pow(n,r).div(o.ln(n))}else if(C(n)){if(!n.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=n.getIntegralFormula(e),i=o.add(t,1);return o.pow(r,i).div(i)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function fa(e,t,n){return C(t)?t.invert(u.root(e,u.recip(Y(n)))):C(n)?n.invert(u.ln(Y(t)).div(u.ln(e))):(console.error("Could not invert due to no input being a variable"),0)}function ga(e,t,n){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const r=t.getIntegralFormula(e);return o.pow(r,o.recip(n).add(1)).times(n).div(o.add(n,1))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function ma(e,t){return C(t)?t.invert(u.ln(e)):(console.error("Could not invert due to no input being a variable"),0)}function ha(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.exp(n)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function pa(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const r=u.minabs(t,1e308).toNumber();return u.tetrate(e,r,n)}function va(e,t,n,r){return C(t)?t.invert(u.ssqrt(e)):(console.error("Could not invert due to no input being a variable"),0)}function ba(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){const r=u.minabs(t,1e308).toNumber();return u.iteratedexp(e,r,new u(n))}function ya(e,t,n,r){return C(t)?t.invert(u.iteratedlog(e,Math.E,u.minabs(1e308,Y(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function _a(e,t=10,n=2){const r=u.minabs(n,1e308).toNumber();return u.iteratedlog(e,t,r)}function Na(e,t=10){const n=u.minabs(t,1e308).toNumber();return u.slog(e,n)}function wa(e,t,n){return C(t)?t.invert(u.tetrate(e,u.minabs(1e308,Y(n)).toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function Ca(e,t,n){const r=u.minabs(t,1e308).toNumber();return u.layeradd(e,r,n)}function ka(e,t,n,r){return C(t)?t.invert(u.layeradd(e,u.minabs(1e308,Y(n)).negate().toNumber())):(console.error("Could not invert due to no input being a variable"),0)}function Sa(e,t){return C(t)?t.invert(u.pow(Math.E,e).times(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ia(e,t){return C(t)?t.invert(u.tetrate(e,2)):(console.error("Could not invert due to no input being a variable"),0)}function Ma(e,t,n){const r=u.minabs(t,1e308).toNumber();return u.pentate(e,r,n)}function $a(e,t){return C(t)?t.invert(u.asin(e)):(console.error("Could not invert due to no input being a variable"),0)}function xa(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.cos(n).neg()}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Pa(e,t){return C(t)?t.invert(u.acos(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ta(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.sin(n)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Fa(e,t){return C(t)?t.invert(u.atan(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ea(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.cos(n).ln().neg()}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Oa(e,t){return C(t)?t.invert(u.sin(e)):(console.error("Could not invert due to no input being a variable"),0)}function Va(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.asin(n).times(n).add(o.sqrt(o.sub(1,o.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function La(e,t){return C(t)?t.invert(u.cos(e)):(console.error("Could not invert due to no input being a variable"),0)}function Da(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.acos(n).times(n).sub(o.sqrt(o.sub(1,o.pow(n,2))))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Ra(e,t){return C(t)?t.invert(u.tan(e)):(console.error("Could not invert due to no input being a variable"),0)}function qa(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.atan(n).times(n).sub(o.ln(o.pow(n,2).add(1)).div(2))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Aa(e,t){return C(t)?t.invert(u.asinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ba(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.cosh(n)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function za(e,t){return C(t)?t.invert(u.acosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ua(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.sinh(n)}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Ga(e,t){return C(t)?t.invert(u.atanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function ja(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.cosh(n).ln()}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Ha(e,t){return C(t)?t.invert(u.sinh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Wa(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.asinh(n).times(n).sub(o.pow(n,2).add(1).sqrt())}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Ja(e,t){return C(t)?t.invert(u.cosh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ka(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.acosh(n).times(n).sub(o.add(n,1).sqrt().times(o.sub(n,1).sqrt()))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function Za(e,t){return C(t)?t.invert(u.tanh(e)):(console.error("Could not invert due to no input being a variable"),0)}function Ya(e,t){if(C(t)){if(!t.isIntegrable())return console.error("Could not integrate due to variable not being integrable"),o.constant(0);const n=t.getIntegralFormula(e);return o.atanh(n).times(n).add(o.sub(1,o.pow(n,2)).ln().div(2))}return console.error("Could not integrate due to no input being a variable"),o.constant(0)}function st(e){return(t,n)=>new o({inputs:[t,n],evaluate:e,invert:St})}function C(e){return e instanceof K&&e.hasVariable()}function Y(e,t){return e instanceof K?e.evaluate(t):l(e)}function Xa(){return o.pow(this,2).div(2)}function Qa(){return this}const Q=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Ve in n?n[Ve]:n)),"variable"in e?(typeof e.variable=="object"&&Ve in e.variable&&(e.variable=e.variable[Ve]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:Xa,internalIntegrateInner:Qa,applySubstitution:St}}setupConstant({inputs:e}){return e.length!==1&&console.error("Evaluate function is required if inputs is not length 1"),{inputs:e,internalVariables:0}}setupFormula(e){var N,k;const{inputs:t,evaluate:n,invert:r,integrate:i,integrateInner:a,applySubstitution:s}=e,c=t.reduce((y,S)=>y+(S instanceof Q?S.internalVariables:0),0),d=t.find(y=>y instanceof Q&&y.hasVariable()),f=c===1?d==null?void 0:d.innermostVariable:void 0,b=(N=d==null?void 0:d.isInvertible())!=null?N:!1,v=(k=d==null?void 0:d.isIntegrable())!=null?k:!1;return{inputs:t,internalEvaluate:n,internalInvert:b?r:void 0,internalIntegrate:v?i:void 0,internalIntegrateInner:a,applySubstitution:s,innermostVariable:f,internalVariables:c}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,r;return(r=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(i=>Y(i,e))))!=null?n:this.hasVariable()?e:null)!=null?r:Y(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof Q&&e.inputs[n]instanceof Q?t.equals(e.inputs[n]):!(t instanceof Q)&&!(e.inputs[n]instanceof Q)&&u.eq(l(t),l(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new o({inputs:[e]})}static variable(e){return new o({variable:e})}static step(e,t,n){const r=n(o.variable(0)),i=zt(t);function a(c){return u.lt(c,l(i))?c:u.add(r.evaluate(u.sub(c,l(i))),l(i))}function s(c,d){return C(d)&&r.isInvertible()?(u.gt(c,l(i))&&(c=u.add(r.invert(u.sub(c,l(i))),l(i))),d.invert(c)):(console.error("Could not invert due to no input being a variable"),0)}return new o({inputs:[e],evaluate:a,invert:r.isInvertible()&&r.hasVariable()?s:void 0})}static if(e,t,n,r){const i=x(0),a=o.variable(i),s=n(a),c=r==null?void 0:r(a),d=zt(t);function f(v){return l(d)?(i.value=v,s.evaluate()):c?(i.value=v,c.evaluate()):v}function b(v,N){return!C(N)||!s.isInvertible()||c!=null&&!c.isInvertible()?(console.error("Could not invert due to no input being a variable"),0):l(d)?N.invert(s.invert(v)):c?N.invert(c.invert(v)):N.invert(v)}return new o({inputs:[e],evaluate:f,invert:s.isInvertible()&&s.hasVariable()?b:void 0})}static conditional(e,t,n,r){return o.if(e,t,n,r)}static abs(e){return new o({inputs:[e],evaluate:u.abs})}static neg(e){return new o({inputs:[e],evaluate:u.neg,invert:Mi,applySubstitution:xi,integrate:$i})}static sign(e){return new o({inputs:[e],evaluate:u.sign})}static round(e){return new o({inputs:[e],evaluate:u.round,invert:ut})}static floor(e){return new o({inputs:[e],evaluate:u.floor,invert:ut})}static ceil(e){return new o({inputs:[e],evaluate:u.ceil,invert:ut})}static trunc(e){return new o({inputs:[e],evaluate:u.trunc,invert:ut})}static add(e,t){return new o({inputs:[e,t],evaluate:u.add,invert:Pi,integrate:Ti,integrateInner:Fi,applySubstitution:St})}static sub(e,t){return new o({inputs:[e,t],evaluate:u.sub,invert:Ei,integrate:Oi,integrateInner:Vi,applySubstitution:St})}static mul(e,t){return new o({inputs:[e,t],evaluate:u.mul,invert:Li,integrate:Di,applySubstitution:Ri})}static div(e,t){return new o({inputs:[e,t],evaluate:u.div,invert:qi,integrate:Ai,applySubstitution:Bi})}static recip(e){return new o({inputs:[e],evaluate:u.recip,invert:zi,integrate:Ui})}static clamp(e,t,n){return new o({inputs:[e,t,n],evaluate:u.clamp,invert:ut})}static pLog10(e){return new o({inputs:[e],evaluate:u.pLog10})}static absLog10(e){return new o({inputs:[e],evaluate:u.absLog10})}static log10(e){return new o({inputs:[e],evaluate:u.log10,invert:Gi,integrate:Wi})}static log(e,t){return new o({inputs:[e,t],evaluate:u.log,invert:Ji,integrate:Yi})}static log2(e){return new o({inputs:[e],evaluate:u.log2,invert:Xi,integrate:ta})}static ln(e){return new o({inputs:[e],evaluate:u.ln,invert:na,integrate:aa})}static pow(e,t){return new o({inputs:[e,t],evaluate:u.pow,invert:sa,integrate:oa})}static pow10(e){return new o({inputs:[e],evaluate:u.pow10,invert:la,integrate:ua})}static pow_base(e,t){return new o({inputs:[e,t],evaluate:u.pow_base,invert:ca,integrate:da})}static root(e,t){return new o({inputs:[e,t],evaluate:u.root,invert:fa,integrate:ga})}static factorial(e){return new o({inputs:[e],evaluate:u.factorial})}static gamma(e){return new o({inputs:[e],evaluate:u.gamma})}static lngamma(e){return new o({inputs:[e],evaluate:u.lngamma})}static exp(e){return new o({inputs:[e],evaluate:u.exp,invert:ma,integrate:ha})}static sqr(e){return o.pow(e,2)}static sqrt(e){return o.root(e,2)}static cube(e){return o.pow(e,3)}static cbrt(e){return o.root(e,3)}static tetrate(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new o({inputs:[e,t,n],evaluate:pa,invert:va})}static iteratedexp(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new o({inputs:[e,t,n],evaluate:ba,invert:ya})}static iteratedlog(e,t=10,n=1){return new o({inputs:[e,t,n],evaluate:_a})}static slog(e,t=10){return new o({inputs:[e,t],evaluate:Na,invert:wa})}static layeradd10(e,t){return new o({inputs:[e,t],evaluate:u.layeradd10})}static layeradd(e,t,n=10){return new o({inputs:[e,t,n],evaluate:Ca,invert:ka})}static lambertw(e){return new o({inputs:[e],evaluate:u.lambertw,invert:Sa})}static ssqrt(e){return new o({inputs:[e],evaluate:u.ssqrt,invert:Ia})}static pentate(e,t=2,n=u.fromComponents_noNormalize(1,0,1)){return new o({inputs:[e,t,n],evaluate:Ma})}static sin(e){return new o({inputs:[e],evaluate:u.sin,invert:Oa,integrate:xa})}static cos(e){return new o({inputs:[e],evaluate:u.cos,invert:La,integrate:Ta})}static tan(e){return new o({inputs:[e],evaluate:u.tan,invert:Ra,integrate:Ea})}static asin(e){return new o({inputs:[e],evaluate:u.asin,invert:$a,integrate:Va})}static acos(e){return new o({inputs:[e],evaluate:u.acos,invert:Pa,integrate:Da})}static atan(e){return new o({inputs:[e],evaluate:u.atan,invert:Fa,integrate:qa})}static sinh(e){return new o({inputs:[e],evaluate:u.sinh,invert:Ha,integrate:Ba})}static cosh(e){return new o({inputs:[e],evaluate:u.cosh,invert:Ja,integrate:Ua})}static tanh(e){return new o({inputs:[e],evaluate:u.tanh,invert:Za,integrate:ja})}static asinh(e){return new o({inputs:[e],evaluate:u.asinh,invert:Aa,integrate:Wa})}static acosh(e){return new o({inputs:[e],evaluate:u.acosh,invert:za,integrate:Ka})}static atanh(e){return new o({inputs:[e],evaluate:u.atanh,invert:Ga,integrate:Ya})}step(e,t){return o.step(this,e,t)}if(e,t){return o.if(this,e,t)}conditional(e,t){return o.if(this,e,t)}abs(){return o.abs(this)}neg(){return o.neg(this)}sign(){return o.sign(this)}round(){return o.round(this)}floor(){return o.floor(this)}ceil(){return o.ceil(this)}trunc(){return o.trunc(this)}add(e){return o.add(this,e)}sub(e){return o.sub(this,e)}mul(e){return o.mul(this,e)}div(e){return o.div(this,e)}recip(){return o.recip(this)}max(e){return o.max(this,e)}min(e){return o.min(this,e)}maxabs(e){return o.maxabs(this,e)}minabs(e){return o.minabs(this,e)}clamp(e,t){return o.clamp(this,e,t)}clampMin(e){return o.clampMin(this,e)}clampMax(e){return o.clampMax(this,e)}pLog10(){return o.pLog10(this)}absLog10(){return o.absLog10(this)}log10(){return o.log10(this)}log(e){return o.log(this,e)}log2(){return o.log2(this)}ln(){return o.ln(this)}pow(e){return o.pow(this,e)}pow10(){return o.pow10(this)}pow_base(e){return o.pow_base(this,e)}root(e){return o.root(this,e)}factorial(){return o.factorial(this)}gamma(){return o.gamma(this)}lngamma(){return o.lngamma(this)}exp(){return o.exp(this)}sqr(){return o.pow(this,2)}sqrt(){return o.root(this,2)}cube(){return o.pow(this,3)}cbrt(){return o.root(this,3)}tetrate(e=2,t=u.fromComponents_noNormalize(1,0,1)){return o.tetrate(this,e,t)}iteratedexp(e=2,t=u.fromComponents_noNormalize(1,0,1)){return o.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return o.iteratedlog(this,e,t)}slog(e=10){return o.slog(this,e)}layeradd10(e){return o.layeradd10(this,e)}layeradd(e,t){return o.layeradd(this,e,t)}lambertw(){return o.lambertw(this)}ssqrt(){return o.ssqrt(this)}pentate(e=2,t=u.fromComponents_noNormalize(1,0,1)){return o.pentate(this,e,t)}sin(){return o.sin(this)}cos(){return o.cos(this)}tan(){return o.tan(this)}asin(){return o.asin(this)}acos(){return o.acos(this)}atan(){return o.atan(this)}sinh(){return o.sinh(this)}cosh(){return o.cosh(this)}tanh(){return o.tanh(this)}asinh(){return o.asinh(this)}acosh(){return o.acosh(this)}atanh(){return o.atanh(this)}};let K=Q;K.negate=Q.neg;K.negated=Q.neg;K.sgn=Q.sign;K.plus=Q.add;K.subtract=Q.sub;K.minus=Q.sub;K.multiply=Q.mul;K.times=Q.mul;K.divide=Q.div;K.divideBy=Q.div;K.dividedBy=Q.div;K.reciprocal=Q.recip;K.reciprocate=Q.recip;K.max=st(u.max);K.min=st(u.min);K.minabs=st(u.minabs);K.maxabs=st(u.maxabs);K.clampMin=st(u.clampMin);K.clampMax=st(u.clampMax);K.logarithm=Q.log;class o extends K{invert(t){return this.internalInvert&&this.hasVariable()?this.internalInvert.call(this,t,...this.inputs):this.inputs.length===1&&this.hasVariable()?t:(console.error("Cannot invert non-invertible formula"),0)}evaluateIntegral(t){return this.isIntegrable()?this.getIntegralFormula().evaluate(t):(console.error("Cannot evaluate integral of formula without integral"),0)}invertIntegral(t){return!this.isIntegrable()||!this.getIntegralFormula().isInvertible()?(console.error("Cannot invert integral of formula without invertible integral"),0):this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=u.add(this.evaluate(0),this.evaluate(1)).div(2);return u.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)return console.error("Cannot integrate formula with non-integrable operation"),o.constant(0);let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(r=>n=r(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else return console.error("Cannot integrate formula without variable"),o.constant(0);return this.integralFormula}else return this.applySubstitution==null?(console.error("Cannot have two complex operations in an integrable formula"),o.constant(0)):(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner?this.internalIntegrateInner.call(this,t,...this.inputs):this.internalIntegrate?this.internalIntegrate.call(this,t,...this.inputs):this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable()?this:(console.error("Cannot integrate formula without variable"),o.constant(0)))}}const et=Symbol("PersistentState"),Ze=Symbol("DefaultValue"),xt=Symbol("StackTrace"),Ut=Symbol("Deleted"),Ve=Symbol("NonPersistent"),He=Symbol("SaveDataPath"),Gt=Symbol("SkipPersistence");function es(){var e,t;return(t=(e=new Error().stack)==null?void 0:e.split(` `).slice(3,5).map(n=>n.trim()).join(` @@ -15,4 +15,4 @@ Trying to pop ${n.id}`);_e.pop(),L(n,"color"),L(n,"display"),L(n,"classes"),L(n, `,e),await xe(nt())}}function qe(e){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Be.decompressFromUTF16(e);else return console.warn("Unable to determine preset encoding",e),null;return e}function nt(){const e=dt(),t=$e({id:e});return ae(t),j.saves.push(e),t}function dt(){let e,t=0;do e=`${z.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const tn=x(!1);async function xe(e){console.info("Loading save",e),tn.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await gt(()=>Promise.resolve().then(function(){return as}),void 0),{fixOldSave:i,getInitialLayers:a}=await gt(()=>Promise.resolve().then(function(){return Vu}),void 0);for(const s in t){const c=t[s];c&&n(c)}a(e).forEach(s=>r(s,e)),e=$e(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,z.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==z.versionNumber&&(i(e.modVersion,e),e.modVersion=z.versionNumber),Object.assign(T,e),j.active=T.id,oe.emit("onLoad")}const ye=Et({});function hs(e){if(ye[e]==null){let t=localStorage.getItem(e);if(t==null)ye[e]={error:"Save doesn't exist in localStorage",id:e};else if(t==="dW5kZWZpbmVk")ye[e]={error:"Save is undefined",id:e};else try{if(t=qe(t),t==null)return console.warn("Unable to determine preset encoding",t),ye[e]={error:"Unable to determine preset encoding",id:e},ye[e];ye[e]={...JSON.parse(t),id:e}}catch(n){ye[e]={error:n,id:e},console.warn(`Failed to load info about save with id ${e}: ${n} ${t}`)}}return ye[e]}function ps(){Object.keys(ye).forEach(e=>delete ye[e])}function Ct(e){ye[e]=void 0}setInterval(()=>{T.autosave&&ae()},1e3);window.onbeforeunload=()=>{T.autosave&&ae()};window.save=ae;const vs=window.hardReset=async()=>{await xe(nt())};window.deleteLowerSaves=()=>{const e=Object.values(j.saves).indexOf(T.id)+1;Object.values(j.saves).slice(e).forEach(t=>localStorage.removeItem(t)),j.saves=j.saves.slice(0,e)};const pt=it({active:"",saves:[],showTPS:!0,theme:Qt.Nordic,unthrottled:!1,alignUnits:!1});he(pt,e=>{const t=Be.compressToUTF16(JSON.stringify(e));localStorage.setItem(z.id,t)},{deep:!0});var j=window.settings=pt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Qt.Nordic,alignUnits:!1};oe.emit("loadSettings",e),Object.assign(pt,e),vs()};function bs(){try{let e=localStorage.getItem(z.id);if(e!=null&&e!==""){if(e=qe(e),e==null){console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(pt,t)}oe.emit("loadSettings",pt)}catch{}}const ys=it([]),Dn=it([]);function _s(e){Dn.push(e)}const Ns=it([]),ge=x(),ke=x([]),ot=x([]);function ws(){var e;((e=ge.value)==null?void 0:e.loggedIn)===!0&&(ke.value.length>0||ge.value.getSaveList().then(Rn).then(t=>{ot.value=t.map(n=>n.content.id)}).catch(console.error))}nr({supportsSaving:!0,supportsSaveManager:!0,onLoggedInChanged:pn}).then(e=>{ge.value=e,pn(e)}).catch(console.error);function pn(e){e.loggedIn===!0&&(ke.value.length>0||(e.getSaveList().then(t=>{const n=Rn(t);if(ot.value=n.map(r=>r.content.id),T.timePlayed<120*1e3&&n.length>0){const r=n.reduce((i,a)=>i.content.timea)),r=Object.keys(e).map(i=>{var c;const{label:a,content:s}=e[i];try{return{slot:parseInt(i),label:a,content:JSON.parse((c=qe(s))!=null?c:"")}}catch{return null}}).filter(i=>i!=null&&typeof i.content.id=="string"&&typeof i.content.time=="number"&&typeof i.content.timePlayed=="number").filter(i=>{var s,c,d,f,b,v;i.label!=null&&(i.content.name=i.label),n.delete(i.slot);const a=j.saves.find(N=>N===i.content.id);if(a==null)j.saves.push(i.content.id),ae($e(i.content));else{t.delete(a);try{const N=JSON.parse((c=qe((s=localStorage.getItem(a))!=null?s:""))!=null?c:"");if(N==null)return!1;N.id=a,N.time=(d=N.time)!=null?d:0,N.timePlayed=(f=N.timePlayed)!=null?f:0;const k=Math.abs(N.timePlayed-i.content.timePlayed),y=Math.abs(N.time-i.content.time);k<120*1e3&&y<120*1e3?N.time{var a,s,c;try{if(n.size>0){const d=(a=localStorage.getItem(i))!=null?a:"",f=JSON.parse((s=qe(d))!=null?s:""),b=n.values().next().value;(c=ge.value)==null||c.save(b,d,f.name).then(()=>ot.value.push(f.id)).catch(console.error),n.delete(b)}}catch{}}),r}function ue(e,t="span"){return typeof e=="function"?B({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}`),B({template:e})):B({render:()=>({})}):e}function _t(e){if(Dt(e))return typeof e=="function"?e():ue(e);const t=e[De];return _(t,e[Re](),null)}function It(e){if(Dt(e))return typeof e=="function"?e():typeof e=="string"?_(W,null,[e]):_(e,null,null);const t=e[De];return _(t,e[Re](),null)}function Dt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[ht]===!0}function qn(e,t){const n=x(null),r=x(void 0);function i(c){n.value||(n.value=setInterval(s,250)),r.value=c}function a(){n.value&&(clearInterval(n.value),n.value=null)}function s(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return _n(a),{start:i,stop:a,handleHolding:s}}function Cs(e,t="div"){const n=Ne();return We(()=>{n.value=ue(we(e),t)}),n}function lt(e,t="div"){const n=Ne(null);return We(()=>{const r=we(e);n.value=r==""||r==null?null:ue(r,t)}),n}function we(e){return l(l(e))}function U(...e){return e.includes(Object)||e.push(Object),e}function ks(e){return Object.keys(e).reduce((t,n)=>(t[ki(n)]=e[n],t),{})}var Ss=B({props:{element:Object,display:{type:U(Object,String,Function),required:!0},style:U(Object,String,Array),classes:U(Object),direction:U(String),xoffset:U(String),yoffset:U(String),pinned:Object},setup(e){const{element:t,display:n,pinned:r}=de(e),i=x(!1),a=F(()=>(we(r)||i.value)&&s.value),s=lt(n),c=Ne(ue(te(()=>{const b=we(t);return b==null?"":It(b)})));function d(b){const v=r;b.shiftKey&&v&&(v.value=!v.value,b.stopPropagation(),b.preventDefault())}const f=F(()=>we(r)&&en[j.theme].showPin);return{Direction:J,isHovered:i,isShown:a,comp:s,elementComp:c,unref:l,togglePinned:d,showPin:f}}});const Is={key:0,class:"material-icons pinned"};function Ms(e,t,n,r,i,a){return h(),w("div",{class:ee(["tooltip-container",{shown:e.isShown}]),onMouseenter:t[0]||(t[0]=s=>e.isHovered=!0),onMouseleave:t[1]||(t[1]=s=>e.isHovered=!1),onClickCapture:t[2]||(t[2]=(...s)=>e.togglePinned&&e.togglePinned(...s))},[Le(e.$slots,"default",{},void 0,!0),e.elementComp?(h(),R(se(e.elementComp),{key:0})):M("",!0),_(yn,{name:"fade"},{default:O(()=>{var s;return[e.isShown?(h(),w("div",{key:0,class:ee(["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:me([{"--xoffset":e.unref(e.xoffset)||"0px","--yoffset":e.unref(e.yoffset)||"0px"},(s=e.unref(e.style))!=null?s:{}])},[e.showPin?(h(),w("span",Is,"push_pin")):M("",!0),e.comp?(h(),R(se(e.comp),{key:1})):M("",!0)],6)):M("",!0)]}),_:1})],34)}var X=G(Ss,[["render",Ms],["__scopeId","data-v-6102fa3a"]]);const $s={key:0},xs=["onClick","disabled"],Ps={key:0},Ts=["onClick"],Fs=B({__name:"DangerButton",props:{disabled:{type:Boolean},skipConfirm:{type:Boolean}},emits:["click","confirmingChanged"],setup(e,{emit:t}){const r=de(e),i=x(!1);he(i,c=>{t("confirmingChanged",c)});function a(){if(l(r.skipConfirm)){t("click");return}i.value&&t("click"),i.value=!i.value}function s(){i.value=!1}return(c,d)=>(h(),w("span",{class:ee(["container",{confirming:i.value}])},[i.value?(h(),w("span",$s,"Are you sure?")):M("",!0),m("button",{onClick:ft(a,["stop"]),class:"button danger",disabled:e.disabled},[i.value?(h(),w("span",Ps,"Yes")):Le(c.$slots,"default",{key:1},void 0,!0)],8,xs),i.value?(h(),w("button",{key:1,class:"button",onClick:ft(s,["stop"])},"No",8,Ts)):M("",!0)],2))}});var Es=G(Fs,[["__scopeId","data-v-2f8ef34c"]]);const Os=["onSubmit"],Vs={class:"field"},Ls={key:0,class:"field-title"},Ds=["placeholder"],Rs=B({__name:"Text",props:{title:null,modelValue:null,textArea:{type:Boolean},placeholder:null,maxHeight:null,submitOnBlur:{type:Boolean}},emits:["update:modelValue","submit","cancel"],setup(e,{emit:t}){const n=e,r=lt(Pe(n,"title"),"span"),i=Ne(null);bt(()=>{var d;(d=i.value)==null||d.focus()});const a=F({get(){var d;return(d=l(n.modelValue))!=null?d:""},set(d){t("update:modelValue",d)}});function s(){t("submit")}function c(){n.submitOnBlur!==!1?t("submit"):t("cancel")}return(d,f)=>(h(),w("form",{onSubmit:ft(s,["prevent"])},[m("div",Vs,[l(r)?(h(),w("span",Ls,[(h(),R(se(l(r))))])):M("",!0),e.textArea?(h(),R(l(rr),{key:1,modelValue:l(a),"onUpdate:modelValue":f[0]||(f[0]=b=>ie(a)?a.value=b:null),placeholder:e.placeholder,maxHeight:e.maxHeight,onBlur:c,ref_key:"field",ref:i},null,8,["modelValue","placeholder","maxHeight"])):Ht((h(),w("input",{key:2,type:"text","onUpdate:modelValue":f[1]||(f[1]=b=>ie(a)?a.value=b:null),placeholder:e.placeholder,class:ee({fullWidth:!e.title}),onBlur:c,ref_key:"field",ref:i},null,42,Ds)),[[Yn,l(a)]])])],40,Os))}});var An=G(Rs,[["__scopeId","data-v-90bd4994"]]);const Fe=e=>(Se("data-v-2fbabe5d"),e=e(),Ie(),e),qs={key:0,class:"handle material-icons"},As={key:1,class:"actions"},Bs=Fe(()=>m("span",{class:"material-icons"},"content_paste",-1)),zs=Fe(()=>m("span",{class:"material-icons"},"content_copy",-1)),Us=Fe(()=>m("span",{class:"material-icons"},"edit",-1)),Gs=Fe(()=>m("span",{class:"material-icons",style:{margin:"-2px"}},"delete",-1)),js={key:2,class:"actions"},Hs=Fe(()=>m("span",{class:"material-icons"},"check",-1)),Ws=Fe(()=>m("span",{class:"material-icons"},"close",-1)),Js={key:3,class:"details"},Ks=Fe(()=>m("span",{class:"material-icons synced"},"cloud",-1)),Zs=["disabled"],Ys={class:"save-version"},Xs=Fe(()=>m("br",null,null,-1)),Qs={key:1,class:"time"},eo={key:4,class:"details"},to={key:5,class:"details error"},no=Fe(()=>m("br",null,null,-1)),ro=B({__name:"Save",props:{save:null,readonly:{type:Boolean}},emits:["export","open","duplicate","delete","editName"],setup(e,{emit:t}){const n=e,{save:r,readonly:i}=de(n),a=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s=x(!1),c=x(!1),d=x("");he(s,()=>{var k;return d.value=(k=r.value.name)!=null?k:""});const f=F(()=>r.value!=null&&r.value.id===T.id&&!l(i)),b=F(()=>{var k;return f.value?T.time:(k=r.value!=null&&r.value.time)!=null?k:0}),v=F(()=>{var k;return!l(i)&&((k=ge.value)==null?void 0:k.loggedIn)===!0&&ot.value.includes(r.value.id)});function N(){t("editName",d.value),s.value=!1}return(k,y)=>(h(),w("div",{class:ee(["save",{active:l(f),readonly:l(i)}])},[l(i)!==!0?(h(),w("div",qs,"drag_handle")):M("",!0),!s.value&&l(i)!==!0?(h(),w("div",As,[l(r).error==null&&!c.value?(h(),R(Wt,{key:0,onClick:y[0]||(y[0]=S=>t("export")),class:"button",left:""},{default:O(()=>[_(X,{display:"Export",direction:l(J).Left,class:"info"},{default:O(()=>[Bs]),_:1},8,["direction"])]),_:1})):M("",!0),l(r).error==null&&!c.value?(h(),w("button",{key:1,onClick:y[1]||(y[1]=S=>t("duplicate")),class:"button"},[_(X,{display:"Duplicate",direction:l(J).Left,class:"info"},{default:O(()=>[zs]),_:1},8,["direction"])])):M("",!0),l(r).error==null&&!c.value?(h(),w("button",{key:2,onClick:y[2]||(y[2]=S=>s.value=!s.value),class:"button"},[_(X,{display:"Edit Name",direction:l(J).Left,class:"info"},{default:O(()=>[Us]),_:1},8,["direction"])])):M("",!0),_(Es,{disabled:l(f),onClick:y[3]||(y[3]=S=>t("delete")),onConfirmingChanged:y[4]||(y[4]=S=>c.value=S)},{default:O(()=>[_(X,{display:"Delete",direction:l(J).Left,class:"info"},{default:O(()=>[Gs]),_:1},8,["direction"])]),_:1},8,["disabled"])])):l(i)!==!0?(h(),w("div",js,[m("button",{onClick:N,class:"button"},[_(X,{display:"Save",direction:l(J).Left,class:"info"},{default:O(()=>[Hs]),_:1},8,["direction"])]),m("button",{onClick:y[5]||(y[5]=S=>s.value=!s.value),class:"button"},[_(X,{display:"Cancel",direction:l(J).Left,class:"info"},{default:O(()=>[Ws]),_:1},8,["direction"])])])):M("",!0),l(r).error==null&&!s.value?(h(),w("div",Js,[l(v)?(h(),R(X,{key:0,display:"Synced!",direction:l(J).Right},{default:O(()=>[Ks]),_:1},8,["direction"])):M("",!0),m("button",{class:"button open",onClick:y[6]||(y[6]=S=>t("open")),disabled:l(i)},[m("h3",null,V(l(r).name),1)],8,Zs),m("span",Ys,"v"+V(l(r).modVersion),1),Xs,l(b)?(h(),w("div",Qs," Last played "+V(l(a).format(l(b))),1)):M("",!0)])):l(r).error==null&&s.value?(h(),w("div",eo,[_(An,{modelValue:d.value,"onUpdate:modelValue":y[7]||(y[7]=S=>d.value=S),class:"editname",onSubmit:N},null,8,["modelValue"])])):(h(),w("div",to,[E(" Error: Failed to load save with id "+V(l(r).id),1),no,E(V(l(r).error),1)]))],2))}});var jt=G(ro,[["__scopeId","data-v-2fbabe5d"]]);const nn=e=>(Se("data-v-a123f6ba"),e=e(),Ie(),e),io={class:"cloud-saves-modal-header"},ao=nn(()=>m("br",null,null,-1)),so=["onClick"],oo={key:0,class:"note"},lo={key:1,class:"note"},uo=["onClick"],co={key:0,class:"note"},fo={key:1,class:"note"},go=["onClick"],mo=nn(()=>m("h2",null,"Both",-1)),ho=nn(()=>m("div",{class:"save"},"Keep Both",-1)),po=[mo,ho],vo=B({__name:"CloudSaveResolver",setup(e){const t=x(!1),n=x([]),r=F(()=>ke.value.length>1?"saves":"save"),i=x(null);he(()=>ke.value.length>0,f=>{f&&(n.value=ke.value.map(({local:b,cloud:v})=>{var N,k;return((N=b.time)!=null?N:0)<((k=v.time)!=null?k:0)?"cloud":"local"}),t.value=!0)},{immediate:!0}),he(()=>{var f;return(f=i.value)==null?void 0:f.isOpen},f=>{f===!1&&(ke.value=[])});function a(f){n.value[f]="local"}function s(f){n.value[f]="cloud"}function c(f){n.value[f]="both"}function d(){var f,b;for(let v=0;v(h(),R(ze,{modelValue:t.value,"onUpdate:modelValue":b[0]||(b[0]=v=>t.value=v),width:"960px",ref_key:"modal",ref:i,"prevent-closing":!0},{header:O(()=>[m("div",io,[m("h2",null,"Cloud "+V(l(r))+" loaded!",1)])]),body:O(()=>[m("div",null," Upon loading, your cloud "+V(l(r))+" "+V(l(ke).length>1?"appear":"appears")+" to be out of sync with your local "+V(l(r))+". Which "+V(l(r))+" do you want to keep? ",1),ao,(h(!0),w(W,null,Oe(l(l(ke)),(v,N)=>{var k,y,S,P,I,$,q,ne;return h(),w("div",{key:v.id,class:"conflict-container"},[m("div",{onClick:fe=>s(N),class:ee({selected:n.value[N]==="cloud"})},[m("h2",null,[E(" Cloud "),((k=v.cloud.time)!=null?k:0)>((y=v.local.time)!=null?y:0)?(h(),w("span",oo,"(more recent)")):M("",!0),((S=v.cloud.timePlayed)!=null?S:0)>((P=v.local.timePlayed)!=null?P:0)?(h(),w("span",lo,"(more playtime)")):M("",!0)]),_(jt,{save:v.cloud,readonly:!0},null,8,["save"])],10,so),m("div",{onClick:fe=>a(N),class:ee({selected:n.value[N]==="local"})},[m("h2",null,[E(" Local "),((I=v.cloud.time)!=null?I:0)<=(($=v.local.time)!=null?$:0)?(h(),w("span",co,"(more recent)")):M("",!0),((q=v.cloud.timePlayed)!=null?q:0)<=((ne=v.local.timePlayed)!=null?ne:0)?(h(),w("span",fo,"(more playtime)")):M("",!0)]),_(jt,{save:v.local,readonly:!0},null,8,["save"])],10,uo),m("div",{onClick:fe=>c(N),class:ee({selected:n.value[N]==="both"}),style:{"flex-basis":"30%"}},po,10,go)])}),128))]),footer:O(()=>[m("div",{class:"cloud-saves-footer"},[m("button",{onClick:d,class:"button"},"Confirm")])]),_:1},8,["modelValue"]))}});var bo=G(vo,[["__scopeId","data-v-a123f6ba"]]);const yo=B({components:{Context:Ln,ErrorVue:wn},props:{index:{type:Number,required:!0},display:{type:U(Object,String,Function),required:!0},minimizedDisplay:U(Object,String,Function),minimized:{type:Object,required:!0},name:{type:U(String),required:!0},color:U(String),minimizable:U(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=de(e),a=Cs(t),s=lt(i),c=F(()=>z.allowGoBack&&n.value>0&&!we(r));function d(){T.tabs.splice(l(e.index),1/0)}function f(v){e.nodes.value=v}const b=x([]);return Xn((v,N,k)=>(console.warn(`Error caught in "${e.name}" layer`,v,N,k),b.value.push(v instanceof Error?v:new Error(JSON.stringify(v))),!1)),{component:a,minimizedComponent:s,showGoBack:c,updateNodes:f,unref:l,goBack:d,errors:b}}}),_o={key:1};function No(e,t,n,r,i,a){const s=Ke("ErrorVue"),c=Ke("Context");return e.errors.length>0?(h(),R(s,{key:0,errors:e.errors},null,8,["errors"])):(h(),w("div",Ae({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(h(),w("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...d)=>e.goBack&&e.goBack(...d))},"\u274C")):M("",!0),e.unref(e.minimized)?(h(),w("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=d=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(h(),R(se(e.minimizedComponent),{key:0})):(h(),w("div",_o,V(e.unref(e.name)),1))])):(h(),w("div",{key:2,class:ee(["layer-tab",{showGoBack:e.showGoBack}])},[_(c,{onUpdateNodes:e.updateNodes},{default:O(()=>[(h(),R(se(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(h(),w("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=d=>e.$emit("setMinimized",!0))}," \u25BC ")):M("",!0)],16))}var wo=G(yo,[["render",No],["__scopeId","data-v-a9f5b1da"]]);const Bn=e=>(Se("data-v-4b4bda40"),e=e(),Ie(),e),Co=Bn(()=>m("h2",null,"Changelog",-1)),ko=Bn(()=>m("details",{open:""},[m("summary",null,[E("v0.0 Initial Commit - "),m("time",null,"2021-09-04")]),E(" This is the first release :D "),m("ul",null,[m("li",{class:"feature"},"Did everything"),m("li",{class:"fix"},"Had some fun"),m("li",{class:"breaking"},"Removed everything"),m("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),So=B({__name:"Changelog",setup(e,{expose:t}){const n=x(!1);return t({open(){n.value=!0}}),(r,i)=>(h(),R(ze,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a)},{header:O(()=>[Co]),body:O(()=>[ko]),_:1},8,["modelValue"]))}});var Io=G(So,[["__scopeId","data-v-4b4bda40"]]);const Xe=e=>(Se("data-v-10effbe8"),e=e(),Ie(),e),Mo={class:"info-modal-header"},$o=["src","alt"],xo={class:"info-modal-title"},Po={key:0},To={key:0},Fo={key:0},Eo=Xe(()=>m("div",null," Made in Profectus, by thepaperpilot with inspiration from Acameada and Jacorb ",-1)),Oo=Xe(()=>m("br",null,null,-1)),Vo=Xe(()=>m("br",null,null,-1)),Lo=["href"],Do=Xe(()=>m("span",{class:"material-icons info-modal-discord"},"discord",-1)),Ro=Xe(()=>m("div",null,[m("a",{href:"https://discord.gg/yJ4fjnjU54",class:"info-modal-discord-link",target:"_blank"},[m("span",{class:"material-icons info-modal-discord"},"discord"),E(" Profectus & Friends ")])],-1)),qo=Xe(()=>m("div",null,[m("a",{href:"https://discord.gg/F3xveHV",class:"info-modal-discord-link",target:"_blank"},[m("span",{class:"material-icons info-modal-discord"},"discord"),E(" The Modding Tree ")])],-1)),Ao=Xe(()=>m("br",null,null,-1));var Bo=B({__name:"Info",props:{changelog:null},setup(e,{expose:t}){const n=e,{title:r,logo:i,author:a,discordName:s,discordLink:c,versionNumber:d,versionTitle:f}=z,b=de(n),v=x(!1),N=F(()=>Vt(T.timePlayed)),k=F(()=>ue(te(()=>_(W,null,[Dn.map(_t)]))));t({open(){v.value=!0}});function y(){var S;(S=l(b.changelog))==null||S.open()}return(S,P)=>(h(),R(ze,{modelValue:v.value,"onUpdate:modelValue":P[0]||(P[0]=I=>v.value=I)},{header:O(()=>[m("div",Mo,[l(i)?(h(),w("img",{key:0,class:"info-modal-logo",src:l(i),alt:l(r)},null,8,$o)):M("",!0),m("div",xo,[m("h2",null,V(l(r)),1),m("h4",null,[E(" v"+V(l(d)),1),l(f)?(h(),w("span",Po,": "+V(l(f)),1)):M("",!0)])])])]),body:O(({shown:I})=>[I?(h(),w("div",To,[l(a)?(h(),w("div",Fo,"By "+V(l(a)),1)):M("",!0),Eo,Oo,m("div",{class:"link",onClick:y},"Changelog"),Vo,m("div",null,[l(c)?(h(),w("a",{key:0,href:l(c),class:"info-modal-discord-link",target:"_blank"},[Do,E(" "+V(l(s)),1)],8,Lo)):M("",!0)]),Ro,qo,Ao,m("div",null,"Time Played: "+V(l(N)),1),(h(),R(se(l(k))))])):M("",!0)]),_:1},8,["modelValue"]))}});var zo=G(Bo,[["__scopeId","data-v-10effbe8"]]);const Uo={class:"field"},Go={key:0,class:"field-title"},zn=B({__name:"Select",props:{title:null,modelValue:null,options:null,placeholder:null,closeOnSelect:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){var s;const n=e,r=lt(Pe(n,"title"),"span"),i=x((s=n.options.find(c=>c.value===n.modelValue))!=null?s:null);he(Pe(n,"modelValue"),c=>{var d;we(i)!==c&&(i.value=(d=n.options.find(f=>f.value===c))!=null?d:null)});function a(c){t("update:modelValue",c.value)}return(c,d)=>(h(),w("div",Uo,[l(r)?(h(),w("span",Go,[(h(),R(se(l(r))))])):M("",!0),_(l(ir),{options:e.options,modelValue:i.value,"onUpdate:modelValue":[d[0]||(d[0]=f=>i.value=f),a],min:1,"label-by":"label",placeholder:e.placeholder,"close-on-select":e.closeOnSelect},null,8,["options","modelValue","placeholder","close-on-select"])]))}});const jo={class:"field"},Ho=B({__name:"Toggle",props:{title:null,modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=F(()=>{var a;return ue((a=l(n.title))!=null?a:"","span")}),i=F({get(){return!!n.modelValue},set(a){t("update:modelValue",a)}});return(a,s)=>(h(),w("label",jo,[Ht(m("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":s[0]||(s[0]=c=>ie(i)?i.value=c:null)},null,512),[[Qn,l(i)]]),(h(),R(se(l(r))))]))}});var Me=G(Ho,[["__scopeId","data-v-11046116"]]);const Wo={class:"header"},Jo=m("h2",null,"Settings",-1),Ko={class:"option-tabs"},Zo={key:0},Yo={key:1};var Xo=B({__name:"Options",setup(e,{expose:t}){const n=x(!1),r=x("behaviour");function i(be){return be==r.value}function a(be){r.value=be}t({isTab:i,setTab:a,save:ae,open(){n.value=!0}});const s=Object.keys(en).map(be=>({label:xn(be),value:be})),c=F(()=>ue(te(()=>_(W,null,[ys.map(_t)])))),{showTPS:d,theme:f,unthrottled:b,alignUnits:v}=de(j),{autosave:N,offlineProd:k}=de(T),y=F({get(){return T.devSpeed===0},set(be){T.devSpeed=be?0:null}}),S=te(()=>_("span",{class:"option-title"},[E("Unthrottled"),_("desc",null,[E("Allow the game to run as fast as possible. Not battery friendly.")])])),P=te(()=>_("span",{class:"option-title"},[E("Offline Production"),_(X,{display:"Save-specific",direction:J.Right},{default:()=>[E("*")]}),_("desc",null,[E("Simulate production that occurs while the game is closed.")])])),I=te(()=>_("span",{class:"option-title"},[E("Autosave"),_(X,{display:"Save-specific",direction:J.Right},{default:()=>[E("*")]}),_("desc",null,[E("Automatically save the game every second or when the game is closed.")])])),$=te(()=>_("span",{class:"option-title"},[E("Pause game"),_(X,{display:"Save-specific",direction:J.Right},{default:()=>[E("*")]}),_("desc",null,[E("Stop everything from moving.")])])),q=te(()=>_("span",{class:"option-title"},[E("Theme"),_("desc",null,[E("How the game looks.")])])),ne=te(()=>_("span",{class:"option-title"},[E("Show TPS"),_("desc",null,[E("Show TPS meter at the bottom-left corner of the page.")])])),fe=te(()=>_("span",{class:"option-title"},[E("Align modifier units"),_("desc",null,[E("Align numbers to the beginning of the unit in modifier view.")])]));return(be,H)=>(h(),R(ze,{modelValue:n.value,"onUpdate:modelValue":H[10]||(H[10]=re=>n.value=re)},{header:O(()=>[m("div",Wo,[Jo,m("div",Ko,[m("button",{class:ee({selected:i("behaviour")}),onClick:H[0]||(H[0]=re=>a("behaviour"))},"Behaviour",2),m("button",{class:ee({selected:i("appearance")}),onClick:H[1]||(H[1]=re=>a("appearance"))},"Appearance",2)])])]),body:O(()=>[i("behaviour")?(h(),w("div",Zo,[_(Me,{title:l(S),modelValue:l(b),"onUpdate:modelValue":H[2]||(H[2]=re=>ie(b)?b.value=re:null)},null,8,["title","modelValue"]),l(z).enablePausing?(h(),R(Me,{key:0,title:l($),modelValue:l(y),"onUpdate:modelValue":H[3]||(H[3]=re=>ie(y)?y.value=re:null)},null,8,["title","modelValue"])):M("",!0),_(Me,{title:l(P),modelValue:l(k),"onUpdate:modelValue":H[4]||(H[4]=re=>ie(k)?k.value=re:null)},null,8,["title","modelValue"]),_(Me,{title:l(I),modelValue:l(N),"onUpdate:modelValue":H[5]||(H[5]=re=>ie(N)?N.value=re:null)},null,8,["title","modelValue"]),l(N)?M("",!0):(h(),R(Wt,{key:1,class:"button save-button",onClick:H[6]||(H[6]=re=>l(ae)())},{default:O(()=>[E("Manually save")]),_:1}))])):M("",!0),i("appearance")?(h(),w("div",Yo,[_(zn,{title:l(q),options:l(s),modelValue:l(f),"onUpdate:modelValue":H[7]||(H[7]=re=>ie(f)?f.value=re:null)},null,8,["title","options","modelValue"]),(h(),R(se(l(c)))),_(Me,{title:l(ne),modelValue:l(d),"onUpdate:modelValue":H[8]||(H[8]=re=>ie(d)?d.value=re:null)},null,8,["title","modelValue"]),_(Me,{title:l(fe),modelValue:l(v),"onUpdate:modelValue":H[9]||(H[9]=re=>ie(v)?v.value=re:null)},null,8,["title","modelValue"])])):M("",!0)]),_:1},8,["modelValue"]))}});const rn=e=>(Se("data-v-b84e3a02"),e=e(),Ie(),e),Qo=rn(()=>m("h2",null,"Saves Manager",-1)),el={key:0,style:{color:"var(--danger)"}},tl={class:"modal-footer"},nl={class:"field"},rl=rn(()=>m("span",{class:"field-title"},"Create Save",-1)),il={class:"field-buttons"},al={class:"footer"},sl=rn(()=>m("div",{style:{"flex-grow":"1"}},null,-1)),ol=B({__name:"SavesManager",setup(e,{expose:t}){const n=x(!1),r=x(null);t({open(){n.value=!0}});const i=x(!1),a=x(""),s=x(null);he(a,I=>{I?Je(()=>{var $;try{if(I=($=qe(I))!=null?$:"",I===""){console.warn("Unable to determine preset encoding",I),i.value=!0;return}const q=JSON.parse(I);if(typeof q!="object"){i.value=!0;return}const ne=dt();q.id=ne,ae(q),a.value="",i.value=!1,j.saves.push(ne)}catch{i.value=!0}}):i.value=!1});let c={},d=x(Object.keys(c).reduce((I,$)=>(I.push({label:$.split("/").slice(-1)[0].slice(0,-4),value:c[$]}),I),[]));he(n,I=>{I&&ps()});const f=F(()=>j.saves.reduce((I,$)=>(I[$]=hs($),I),{})),b=F(()=>{var I;return((I=ge.value)==null?void 0:I.loggedIn)===!0&&j.saves.length{var fe;const ne=Object.keys(q).find(be=>{const H=q[be].content;try{if(JSON.parse(H).id===I)return!0}catch{return!1}});ne!=null&&((fe=ge.value)==null||fe.save(parseInt(ne),"","").catch(console.error))}),j.saves=j.saves.filter(q=>q!==I),localStorage.removeItem(I),Ct(I)}function y(I){f.value[T.id].time=T.time,ae(),Ct(T.id),xe(f.value[I]),Ct(I)}function S(I){var q;if(s.value=I,Je(()=>{s.value=null}),I=(q=qe(I))!=null?q:"",I===""){console.warn("Unable to determine preset encoding",I);return}const $=JSON.parse(I);$.id=dt(),ae($),j.saves.push($.id),y($.id)}function P(I,$){const q=f.value[I];q!=null&&(q.name=$,T.id===I?(T.name=$,ae()):(ae(q),Ct(I)))}return(I,$)=>(h(),R(ze,{modelValue:n.value,"onUpdate:modelValue":$[4]||($[4]=q=>n.value=q),ref_key:"modal",ref:r},{header:O(()=>[Qo]),body:O(({shown:q})=>[l(b)?(h(),w("div",el," Not all saves are synced! You may need to delete stale saves. ")):M("",!0),q?(h(),R(l(ar),{key:1,list:l(j).saves,handle:".handle",itemKey:ne=>ne},{item:O(({element:ne})=>[_(jt,{save:l(f)[ne],onOpen:fe=>y(ne),onExport:fe=>v(ne),onEditName:fe=>P(ne,fe),onDuplicate:fe=>N(ne),onDelete:fe=>k(ne)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):M("",!0)]),footer:O(()=>[m("div",tl,[_(An,{modelValue:a.value,"onUpdate:modelValue":$[0]||($[0]=q=>a.value=q),title:"Import Save",placeholder:"Paste your save here!",class:ee({importingFailed:i.value})},null,8,["modelValue","class"]),m("div",nl,[rl,m("div",il,[m("button",{class:"button",onClick:$[1]||($[1]=q=>y(l(nt)().id))},"New Game"),Object.keys(l(d)).length>0?(h(),R(zn,{key:0,options:l(d),modelValue:s.value,"onUpdate:modelValue":$[2]||($[2]=q=>S(q)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):M("",!0)])]),m("div",al,[sl,m("button",{class:"button modal-default-button",onClick:$[3]||($[3]=q=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Un=G(ol,[["__scopeId","data-v-b84e3a02"]]);const Ce=e=>(Se("data-v-b1a52b1c"),e=e(),Ie(),e),ll=["src","alt"],ul={key:1,class:"title"},cl=Ce(()=>m("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),dl={class:"discord"},fl={class:"discord-links"},gl={key:0},ml=["href"],hl=Ce(()=>m("li",null,[m("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"Profectus & Friends")],-1)),pl=Ce(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),vl={href:"https://forums.moddingtree.com/",target:"_blank"},bl=Ce(()=>m("span",{class:"material-icons"},"forum",-1)),yl=Ce(()=>m("span",{class:"material-icons"},"info",-1)),_l=Ce(()=>m("span",{class:"material-icons"},"settings",-1)),Nl=Ce(()=>m("span",{class:"material-icons"},"settings",-1)),wl=Ce(()=>m("span",{class:"material-icons"},"info",-1)),Cl={href:"https://forums.moddingtree.com/",target:"_blank"},kl=Ce(()=>m("span",{class:"material-icons"},"forum",-1)),Sl={class:"discord"},Il={class:"discord-links"},Ml={key:0},$l=["href"],xl=Ce(()=>m("li",null,[m("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"Profectus & Friends")],-1)),Pl=Ce(()=>m("li",null,[m("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Tl=B({__name:"Nav",setup(e){const t=x(null),n=x(null),r=x(null),i=x(null),{useHeader:a,banner:s,title:c,discordName:d,discordLink:f,versionNumber:b}=z;function v(){window.open(f,"mywindow")}const N=F(()=>{var k;return((k=ge.value)==null?void 0:k.loggedIn)===!0&&!ot.value.includes(j.active)});return(k,y)=>(h(),w(W,null,[l(a)?(h(),w("div",Ae({key:0,class:"nav"},k.$attrs),[l(s)?(h(),w("img",{key:0,src:l(s),class:"banner",alt:l(c)},null,8,ll)):(h(),w("div",ul,V(l(c)),1)),m("div",{onClick:y[0]||(y[0]=S=>{var P;return(P=i.value)==null?void 0:P.open()}),class:"version-container"},[_(X,{display:"Changelog",direction:l(J).Down,class:"version"},{default:O(()=>[m("span",null,"v"+V(l(b)),1)]),_:1},8,["direction"])]),cl,m("div",dl,[m("span",{onClick:v,class:"material-icons"},"discord"),m("ul",fl,[l(f)?(h(),w("li",gl,[m("a",{href:l(f),target:"_blank"},V(l(d)),9,ml)])):M("",!0),hl,pl])]),m("div",null,[m("a",vl,[_(X,{display:"Forums",direction:l(J).Down,yoffset:"5px"},{default:O(()=>[bl]),_:1},8,["direction"])])]),m("div",{onClick:y[1]||(y[1]=S=>{var P;return(P=t.value)==null?void 0:P.open()})},[_(X,{display:"Info",direction:l(J).Down,class:"info"},{default:O(()=>[yl]),_:1},8,["direction"])]),m("div",{onClick:y[2]||(y[2]=S=>{var P;return(P=n.value)==null?void 0:P.open()})},[_(X,{display:"Saves",direction:l(J).Down,xoffset:"-20px"},{default:O(()=>[m("span",{class:ee(["material-icons",{needsSync:l(N)}])},"library_books",2)]),_:1},8,["direction"])]),m("div",{onClick:y[3]||(y[3]=S=>{var P;return(P=r.value)==null?void 0:P.open()})},[_(X,{display:"Settings",direction:l(J).Down,xoffset:"-66px"},{default:O(()=>[_l]),_:1},8,["direction"])])],16)):(h(),w("div",Ae({key:1,class:"overlay-nav"},k.$attrs),[m("div",{onClick:y[4]||(y[4]=S=>{var P;return(P=i.value)==null?void 0:P.open()}),class:"version-container"},[_(X,{display:"Changelog",direction:l(J).Right,xoffset:"25%",class:"version"},{default:O(()=>[m("span",null,"v"+V(l(b)),1)]),_:1},8,["direction"])]),m("div",{onClick:y[5]||(y[5]=S=>{var P;return(P=n.value)==null?void 0:P.open()})},[_(X,{display:"Saves",direction:l(J).Right},{default:O(()=>[m("span",{class:ee(["material-icons",{needsSync:l(N)}])},"library_books",2)]),_:1},8,["direction"])]),m("div",{onClick:y[6]||(y[6]=S=>{var P;return(P=r.value)==null?void 0:P.open()})},[_(X,{display:"Settings",direction:l(J).Right},{default:O(()=>[Nl]),_:1},8,["direction"])]),m("div",{onClick:y[7]||(y[7]=S=>{var P;return(P=t.value)==null?void 0:P.open()})},[_(X,{display:"Info",direction:l(J).Right},{default:O(()=>[wl]),_:1},8,["direction"])]),m("div",null,[m("a",Cl,[_(X,{display:"Forums",direction:l(J).Right,xoffset:"7px"},{default:O(()=>[kl]),_:1},8,["direction"])])]),m("div",Sl,[m("span",{onClick:v,class:"material-icons"},"discord"),m("ul",Il,[l(f)?(h(),w("li",Ml,[m("a",{href:l(f),target:"_blank"},V(l(d)),9,$l)])):M("",!0),xl,Pl])])],16)),_(zo,{ref_key:"info",ref:t,changelog:i.value},null,8,["changelog"]),_(Un,{ref_key:"savesManager",ref:n},null,512),_(Xo,{ref_key:"options",ref:r},null,512),_(Io,{ref_key:"changelog",ref:i},null,512)],64))}});var Gn=G(Tl,[["__scopeId","data-v-b1a52b1c"]]);const Fl={class:"inner-tab"},El=B({__name:"Game",setup(e){const t=Pe(T,"tabs"),n=F(()=>Object.keys(le)),r=z.useHeader;function i(a){const{display:s,minimized:c,name:d,color:f,minimizable:b,nodes:v,minimizedDisplay:N}=a;return{display:s,minimized:c,name:d,color:f,minimizable:b,nodes:v,minimizedDisplay:N}}return(a,s)=>(h(),w("div",{class:ee(["tabs-container",{useHeader:l(r)}])},[(h(!0),w(W,null,Oe(l(t),(c,d)=>{var f,b;return h(),w("div",{key:d,class:ee(["tab",l((f=l(le)[c])==null?void 0:f.classes)]),style:me(l((b=l(le)[c])==null?void 0:b.style))},[d===0&&!l(r)?(h(),R(Gn,{key:0})):M("",!0),m("div",Fl,[l(n).includes(c)?(h(),R(wo,Ae({key:0},i(l(le)[c]),{index:d,onSetMinimized:v=>l(le)[c].minimized.value=v}),null,16,["index","onSetMinimized"])):(h(),R(se(c),{key:1,index:d},null,8,["index"]))])],6)}),128))],2))}});var Ol=G(El,[["__scopeId","data-v-dcd207b4"]]);const Vl=B({__name:"Node",props:{id:null},setup(e){const n=de(e),r=Mt(Jt,()=>{}),i=Mt(Kt,()=>{}),a=Ne(null),s=F(()=>a.value&&a.value.parentElement);return he([s,n.id],([c,d],[f,b])=>{f&&i(l(b)),c&&r(d,c)}),_n(()=>i(l(n.id))),(c,d)=>(h(),w("div",{class:"node",ref_key:"node",ref:a},null,512))}});var Qe=G(Vl,[["__scopeId","data-v-a48cb382"]]);const Ll=B({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(h(),w("div",{style:me({width:e.width,height:e.height})},null,4))}});function jn(e,t="points",n=0,r=void 0){const i=ie(e)?e:yt(e);if(i.displayName=t,i.precision=n,i.small=r,!ie(e)){const a=i[Ve];a.displayName=t,a.precision=n,a.small=r}return i}function Dl(e){const t=yt(e.value);return he(e,n=>{tn.value||u.gt(n,t.value)&&(t.value=n)}),t}function Rl(e){const t=yt(e.value);return he(e,(n,r)=>{tn.value||u.gt(n,r)&&(t.value=u.add(t.value,u.sub(n,r)))}),t}const ql=new u("10^^8"),Al=new u("1e100");function Bl(e,t){const n=x(0),r=x(0),i=x(0);return oe.on("update",s=>{if(r.value=0,u.lte(e.value,Al)){i.value=e.value;return}let c=e.value,d=i.value;if(i.value=c,u.gt(c,d))if(u.gte(c,ql))c=u.slog(c,1e10),d=u.slog(d,1e10),n.value=c.sub(d).div(s),r.value=-1;else for(;u.div(c,d).log(10).div(s).gte("100")&&r.value<=5&&u.gt(d,0);)c=u.log10(c),d=u.log10(d),n.value=c.sub(d).div(s),r.value++}),F(()=>r.value===0?t?Te(t.value,e.precision,e.small)+" "+e.displayName+"/s":"":Te(n.value)+" OOM"+(r.value<0?"^OOM":"^"+r.value)+"s/sec")}function Pt(e,t){const n=t!=null?t:e.value;return u.eq(e.precision,0)?mt(e.small?n:u.floor(n)):Te(n,e.precision,e.small)}const zl=["x1","y1","x2","y2"],Ul=B({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const t=e,n=de(t),r=F(()=>{const s=n.startNode.value.rect,c=n.boundingRect.value,d=c?{x:s.x+s.width/2-c.x,y:s.y+s.height/2-c.y}:{x:0,y:0};return n.link.value.offsetStart&&(d.x+=n.link.value.offsetStart.x,d.y+=n.link.value.offsetStart.y),d}),i=F(()=>{const s=n.endNode.value.rect,c=n.boundingRect.value,d=c?{x:s.x+s.width/2-c.x,y:s.y+s.height/2-c.y}:{x:0,y:0};return n.link.value.offsetEnd&&(d.x+=n.link.value.offsetEnd.x,d.y+=n.link.value.offsetEnd.y),d}),a=F(()=>ks(t.link));return(s,c)=>(h(),w("line",Ae({"stroke-width":"15px",stroke:"white"},l(a),{x1:l(r).x,y1:l(r).y,x2:l(i).x,y2:l(i).y}),null,16,zl))}});const Gl=B({__name:"Links",props:{links:null},setup(e){var d;const n=Pe(e,"links"),r=x(null),i=Mt(Zt,x({})),a=Mt(Yt,x(void 0)),s=x((d=r.value)==null?void 0:d.getBoundingClientRect());he(a,()=>{var f;return s.value=(f=r.value)==null?void 0:f.getBoundingClientRect()}),bt(()=>{var f;return s.value=(f=r.value)==null?void 0:f.getBoundingClientRect()});const c=F(()=>{var b,v;const f=i.value;return(v=(b=n.value)==null?void 0:b.filter(N=>{var k,y;return((k=f[N.startNode.id])==null?void 0:k.rect)&&((y=f[N.startNode.id])==null?void 0:y.rect)}))!=null?v:[]});return(f,b)=>(h(),w(W,null,[l(c)?(h(),w("svg",er(Ae({key:0},f.$attrs)),[(h(!0),w(W,null,Oe(l(c),(v,N)=>(h(),R(Ul,{key:N,link:v,boundingRect:s.value,startNode:l(i)[v.startNode.id],endNode:l(i)[v.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):M("",!0),m("div",{ref_key:"resizeListener",ref:r,class:"resize-listener"},null,512)],64))}});var jl=G(Gl,[["__scopeId","data-v-063f6d6b"]]),Hl=B({props:{nodes:{type:U(Array),required:!0},leftSideNodes:U(Array),rightSideNodes:U(Array),branches:U(Array)},components:{Links:jl},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:r}=de(e),i=Ne();We(()=>{const c=we(t);i.value=ue(te(()=>_(W,null,[c.map(d=>_("span",{class:"row tree-row",style:"margin: 50px auto;"},[d.map(It)]))])))});const a=Ne();We(()=>{const c=we(n);a.value=c?ue(te(()=>_("span",{class:"left-side-nodes small"},[c.map(It)]))):""});const s=Ne();return We(()=>{const c=we(r);s.value=c?ue(te(()=>_("span",{class:"side-nodes small"},[c.map(It)]))):""}),{unref:l,nodesComp:i,leftNodesComp:a,rightNodesComp:s}}});function Wl(e,t,n,r,i,a){const s=Ke("Links");return h(),w(W,null,[(h(),R(se(e.nodesComp))),e.leftNodesComp?(h(),R(se(e.leftNodesComp),{key:0})):M("",!0),e.rightNodesComp?(h(),R(se(e.rightNodesComp),{key:1})):M("",!0),e.branches?(h(),R(s,{key:2,links:e.unref(e.branches)},null,8,["links"])):M("",!0)],64)}var Jl=G(Hl,[["render",Wl],["__scopeId","data-v-39ca96d0"]]);const Kl={key:0},Zl={key:0,class:"mark star"},Yl=["src"],Xl=B({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(h(),w("div",Kl,[e.mark===!0?(h(),w("div",Zl)):(h(),w("img",{key:1,class:"mark",src:e.mark},null,8,Yl))])):M("",!0)}});var Hn=G(Xl,[["__scopeId","data-v-2207999f"]]);const Ql=B({props:{display:U(Object,String,Function),visibility:{type:U(Number,Boolean),required:!0},style:U(String,Object,Array),classes:U(Object),onClick:Function,onHold:Function,color:U(String),glowColor:U(String),canClick:{type:U(Boolean),required:!0},mark:U(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:Hn,Node:Qe},setup(e){const{onClick:t,onHold:n,display:r}=de(e),i=lt(r),{start:a,stop:s}=qn(t,n);return{start:a,stop:s,comp:i,unref:l,Visibility:at,isCoercableComponent:Dt,isVisible:Pn,isHidden:Tn}}});function eu(e,t,n,r,i,a){var d;const s=Ke("MarkNode"),c=Ke("Node");return e.isVisible(e.visibility)?(h(),w("div",{key:0,style:me({visibility:e.isHidden(e.visibility)?"hidden":void 0}),class:ee({treeNode:!0,can:e.unref(e.canClick),...e.unref(e.classes)}),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f))},[m("div",{style:me([{backgroundColor:e.unref(e.color),boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 20px ${e.unref(e.glowColor)}`},(d=e.unref(e.style))!=null?d:[]])},[(h(),R(se(e.unref(e.comp))))],4),_(s,{mark:e.unref(e.mark)},null,8,["mark"]),_(c,{id:e.id},null,8,["id"])],38)):M("",!0)}var tu=G(Ql,[["render",eu],["__scopeId","data-v-727230a6"]]);const nu=Symbol("TreeNode"),ru=Symbol("Tree");function iu(e,...t){const n=t.reduce((r,i)=>{var a;return Object.assign(r,(a=i.getPersistentData)==null?void 0:a.call(i))},{});return Ye(r=>{var s,c,d;const i=(s=e==null?void 0:e.call(r,r))!=null?s:{};i.id=Lt("treeNode-"),i.type=nu,i[De]=tu;for(const f of t)(c=f.preConstruct)==null||c.call(f,i);Object.assign(n),L(i,"visibility"),ce(i,"visibility",at.Visible),L(i,"canClick"),ce(i,"canClick",!0),L(i,"color"),L(i,"display"),L(i,"glowColor"),L(i,"classes"),L(i,"style"),L(i,"mark");for(const f of t)(d=f.postConstruct)==null||d.call(f,i);if(i.onClick){const f=i.onClick.bind(i);i.onClick=function(b){l(i.canClick)!==!1&&f(b)}}if(i.onHold){const f=i.onHold.bind(i);i.onHold=function(){l(i.canClick)!==!1&&f()}}const a=t.reduce((f,b)=>{var v;return Object.assign(f,(v=b.getGatheredProps)==null?void 0:v.call(b,i))},{});return i[Re]=function(){const{display:f,visibility:b,style:v,classes:N,onClick:k,onHold:y,color:S,glowColor:P,canClick:I,mark:$,id:q}=this;return{display:f,visibility:b,style:v,classes:N,onClick:k,onHold:y,color:S,glowColor:P,canClick:I,mark:$,id:q,...a}},i})}function au(e){return Ye(t=>{const n=e.call(t,t);return n.id=Lt("tree-"),n.type=ru,n[De]=Jl,n.isResetting=x(!1),n.resettingNode=Ne(null),n.reset=function(r){var a,s;const i=n;i.isResetting.value=!0,i.resettingNode.value=r,(a=i.resetPropagation)==null||a.call(i,i,r),(s=i.onReset)==null||s.call(i,r),i.isResetting.value=!1,i.resettingNode.value=null},n.links=F(()=>{var i;return(i=l(n.branches))!=null?i:[]}),L(n,"visibility"),ce(n,"visibility",at.Visible),L(n,"nodes"),L(n,"leftSideNodes"),L(n,"rightSideNodes"),L(n,"branches"),n[Re]=function(){const{nodes:r,leftSideNodes:i,rightSideNodes:a,branches:s}=this;return{nodes:r,leftSideNodes:i,rightSideNodes:a,branches:s}},n})}const su=function(e,t){var a;const n=l(e.branches);if(n==null)return;const r=[];let i=[t];for(;i.length!=0;){const s=[];for(const c of i)for(const d of n.filter(f=>f.startNode===c))[...r,...i].includes(d.endNode)||(s.push(d.endNode),(a=d.endNode.reset)==null||a.reset());r.push(...i),i=s}};function ou(e,t=null,n=0){const r=zt(n);return F(()=>t==null||u.gte(e.value,l(r))?Pt(e)+" "+e.displayName:`Reach ${u.eq(t.precision,0)?mt(l(r)):Te(l(r),t.precision)} ${t.displayName} to unlock (You have ${u.eq(t.precision,0)?mt(t.value):Te(t.value,t.precision)})`)}function lu(e,...t){return Ye(n=>{var i,a;const r=e.call(n,n);for(const s of t)(i=s.preConstruct)==null||i.call(s,r);r.formula=r.formula(o.variable(r.baseResource)),r.currentGain==null&&(r.currentGain=F(()=>{let s=u.floor(r.formula.evaluate(r.baseResource.value)).max(0);return l(r.buyMax)===!1&&(s=s.min(1)),s})),r.actualGain==null&&(r.actualGain=r.currentGain),r.currentAt==null&&(r.currentAt=F(()=>r.formula.invert(u.floor(l(r.currentGain))))),r.nextAt==null&&(r.nextAt=F(()=>r.formula.invert(u.floor(l(r.currentGain)).add(1)))),r.convert==null&&(r.convert=function(){var c;const s=l(r.currentGain);r.gainResource.value=u.add(r.gainResource.value,s),r.spend(s),(c=r.onConvert)==null||c.call(r,s)}),r.spend==null&&(r.spend=function(){r.baseResource.value=0}),L(r,"currentGain"),L(r,"actualGain"),L(r,"currentAt"),L(r,"nextAt"),L(r,"buyMax"),ce(r,"buyMax",!0);for(const s of t)(a=s.postConstruct)==null||a.call(s,r);return r})}function uu(e){return lu(e)}const Wn=e=>(Se("data-v-5e2d38ce"),e=e(),Ie(),e),cu=Wn(()=>m("div",{class:"key"},"Ctrl",-1)),du=Wn(()=>m("div",{class:"key"},"Shift",-1)),fu={class:"key"},gu=B({__name:"Hotkey",props:{hotkey:null},setup(e){const t=e;let n="",r=!1,i=!1,a=!1;return We(()=>{n=t.hotkey.key,r=n.startsWith("ctrl+"),r&&(n=n.slice(5)),i=n.startsWith("shift+"),i&&(n=n.slice(6)),a=n.length==1&&n.toLowerCase()!=n.toUpperCase(),a&&(n=n.toUpperCase())}),(s,c)=>(h(),w(W,null,[l(r)?(h(),w(W,{key:0},[cu,E("+")],64)):M("",!0),l(i)?(h(),w(W,{key:1},[du,E("+")],64)):M("",!0),m("div",fu,V(l(n)),1)],64))}});var mu=G(gu,[["__scopeId","data-v-5e2d38ce"]]);const vt=Et({}),an=Symbol("Hotkey"),vn=[")","!","@","#","$","%","^","&","*","("];function hu(e){return Ye(t=>{const n=e.call(t,t);return n.type=an,L(n,"enabled"),ce(n,"enabled",!0),L(n,"description"),n})}oe.on("addLayer",e=>{Fn(e,an).forEach(t=>{vt[t.key]=t})});oe.on("removeLayer",e=>{Fn(e,an).forEach(t=>{vt[t.key]=void 0})});document.onkeydown=function(e){var r,i;if(((r=e.target)==null?void 0:r.tagName)==="INPUT"||sn.value&&!T.keepGoing)return;let t=e.key;vn.includes(t)?t="shift+"+vn.indexOf(t):e.shiftKey&&(t="shift+"+t),e.ctrlKey&&(t="ctrl+"+t);const n=(i=vt[t])!=null?i:vt[t.toLowerCase()];n&&l(n.enabled)&&(e.preventDefault(),n.onPress())};_s(te(()=>{const e=Object.values(vt).filter(t=>l(t==null?void 0:t.enabled));return e.length===0?"":_("div",null,[_("br",null,null),_("h4",null,[E("Hotkeys")]),_("div",{style:"column-count: 2"},[e.map(t=>_("div",null,[_(mu,{hotkey:t},null),E(" "),t==null?void 0:t.description]))])])}));const pu=Symbol("Reset");function vu(e){return Ye(t=>{const n=e.call(t,t);return n.id=Lt("reset-"),n.type=pu,n.reset=function(){var i;const r=a=>{if(a!=null&&typeof a=="object"&&!(a instanceof u)&&!(a instanceof o)){if(Gt in a&&a[Gt]===!0)return;if(Ze in a){const s=a;s.value=s[Ze]}else!(a instanceof u)&&!ie(a)&&Object.values(a).forEach(s=>r(s))}};l(n.thingsToReset).forEach(r),oe.emit("reset",n),(i=n.onReset)==null||i.call(n)},L(n,"thingsToReset"),n})}const kt={};oe.on("removeLayer",e=>{var t;(t=kt[e.id])==null||t.call(kt),kt[e.id]=void 0});const bu=B({__name:"Sticky",setup(e){const t=x("0"),n=new ResizeObserver(i),r=Ne(null);function i(){let a=r.value;if(a==null)return;let s=0;for(;a.previousSibling;){const c=a.previousSibling;c.dataset&&"vSticky"in c.dataset&&(s+=c.offsetHeight),a=c}t.value=s+"px"}return Je(i),document.fonts.ready.then(i),bt(()=>{var s;const a=(s=r.value)==null?void 0:s.parentElement;a&&n.observe(a)}),(a,s)=>(h(),w("div",{class:"sticky",style:me({top:t.value}),ref_key:"element",ref:r,"data-v-sticky":""},[Le(a.$slots,"default",{},void 0,!0)],4))}});var yu=G(bu,[["__scopeId","data-v-cccac690"]]);const _u=B({__name:"Resource",props:{resource:null,color:null},setup(e){const t=e,n=F(()=>Pt(t.resource));return(r,i)=>(h(),w("h2",{style:me({color:e.color,"text-shadow":"0px 0px 10px "+e.color})},V(l(n)),5))}});const Nu={class:"main-display"},wu={key:0},Cu={key:1},ku=B({__name:"MainDisplay",props:{resource:null,color:null,classes:null,style:null,effectDisplay:null},setup(e){const n=de(e),r=x(null),i=lt(n.effectDisplay),a=F(()=>u.lt(n.resource.value,"1e1000"));return(s,c)=>(h(),R(yu,null,{default:O(()=>{var d,f,b,v;return[m("div",{class:ee(["main-display-container",(d=e.classes)!=null?d:{}]),style:me([{height:`${((b=(f=r.value)==null?void 0:f.$el.clientHeight)!=null?b:0)+50}px`},(v=e.style)!=null?v:{}])},[m("div",Nu,[l(a)?(h(),w("span",wu,"You have ")):M("",!0),_(_u,{resource:e.resource,color:e.color||"white"},null,8,["resource","color"]),E(" "+V(e.resource.displayName),1),l(i)?(h(),w("span",Cu,[E(", "),(h(),R(se(l(i)),{ref_key:"effectRef",ref:r},null,512))])):M("",!0)])],6)]}),_:1}))}});function Su(e,t){return L(t,"display"),L(t,"classes"),L(t,"style"),L(t,"direction"),ce(t,"direction",J.Up),L(t,"xoffset"),L(t,"yoffset"),t.pinnable&&(t.pinned=yt(!1,!1)),Je(()=>{const n=e[De];e[De]=X;const r=e[Re].bind(e);e[Re]=function(){const{display:a,classes:s,style:c,direction:d,xoffset:f,yoffset:b,pinned:v}=this;return{element:{[De]:n,[Re]:r},display:a,classes:s,style:l(c),direction:d,xoffset:f,yoffset:b,pinned:v}}.bind(t)}),t}var Iu=B({props:{display:{type:U(Object,String,Function),required:!0},visibility:{type:U(Number,Boolean),required:!0},style:U(Object,String,Array),classes:U(Object),onClick:Function,onHold:Function,canClick:{type:U(Boolean),required:!0},small:Boolean,mark:U(Boolean,String),id:{type:String,required:!0}},components:{Node:Qe,MarkNode:Hn},setup(e){const{display:t,onClick:n,onHold:r}=de(e),i=Ne("");We(()=>{var b;const c=we(t);if(c==null){i.value="";return}if(Dt(c)){i.value=ue(c);return}const d=ue((b=c.title)!=null?b:"","h3"),f=ue(c.description,"div");i.value=ue(te(()=>_("span",null,[c.title!=null?_("div",null,[_(d,null,null)]):null,_(f,null,null)])))});const{start:a,stop:s}=qn(n,r);return{start:a,stop:s,comp:i,Visibility:at,isVisible:Pn,isHidden:Tn,unref:l}}});function Mu(e,t,n,r,i,a){var d;const s=Ke("MarkNode"),c=Ke("Node");return e.isVisible(e.visibility)?(h(),w("button",{key:0,style:me([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(d=e.unref(e.style))!=null?d:[]]),onClick:t[0]||(t[0]=(...f)=>e.onClick&&e.onClick(...f)),onMousedown:t[1]||(t[1]=(...f)=>e.start&&e.start(...f)),onMouseleave:t[2]||(t[2]=(...f)=>e.stop&&e.stop(...f)),onMouseup:t[3]||(t[3]=(...f)=>e.stop&&e.stop(...f)),onTouchstartPassive:t[4]||(t[4]=(...f)=>e.start&&e.start(...f)),onTouchendPassive:t[5]||(t[5]=(...f)=>e.stop&&e.stop(...f)),onTouchcancelPassive:t[6]||(t[6]=(...f)=>e.stop&&e.stop(...f)),class:ee({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(h(),R(se(e.unref(e.comp)),{key:0})):M("",!0),_(s,{mark:e.unref(e.mark)},null,8,["mark"]),_(c,{id:e.id},null,8,["id"])],38)):M("",!0)}var $u=G(Iu,[["render",Mu],["__scopeId","data-v-211328c0"]]);const xu=Symbol("Clickable");function Pu(e,...t){const n=t.reduce((r,i)=>{var a;return Object.assign(r,(a=i.getPersistentData)==null?void 0:a.call(i))},{});return Ye(r=>{var s,c,d;const i=(s=e==null?void 0:e.call(r,r))!=null?s:{};i.id=Lt("clickable-"),i.type=xu,i[De]=$u;for(const f of t)(c=f.preConstruct)==null||c.call(f,i);if(Object.assign(i,n),L(i,"visibility"),ce(i,"visibility",at.Visible),L(i,"canClick"),ce(i,"canClick",!0),L(i,"classes"),L(i,"style"),L(i,"mark"),L(i,"display"),i.onClick){const f=i.onClick.bind(i);i.onClick=function(b){l(i.canClick)!==!1&&f(b)}}if(i.onHold){const f=i.onHold.bind(i);i.onHold=function(){l(i.canClick)!==!1&&f()}}for(const f of t)(d=f.postConstruct)==null||d.call(f,i);const a=t.reduce((f,b)=>{var v;return Object.assign(f,(v=b.getGatheredProps)==null?void 0:v.call(b,i))},{});return i[Re]=function(){const{display:f,visibility:b,style:v,classes:N,onClick:k,onHold:y,canClick:S,small:P,mark:I,id:$}=this;return{display:f,visibility:b,style:l(v),classes:N,onClick:k,onHold:y,canClick:S,small:P,mark:I,id:$,...a}},i})}function Tu(e){return Pu(t=>{const n=e.call(t,t);L(n,"showNextAt"),ce(n,"showNextAt",!0),ce(n,"minimumGain",1),n.resetDescription==null?n.resetDescription=F(()=>u.lt(n.conversion.gainResource.value,1e3)?"Reset for ":""):L(n,"resetDescription"),n.display==null&&(n.display=te(()=>_("span",null,[l(n.resetDescription),_("b",null,[Pt(n.conversion.gainResource,u.max(l(n.conversion.actualGain),l(n.minimumGain)))])," ",n.conversion.gainResource.displayName,l(n.showNextAt)!=null?_("div",null,[_("br",null,null),l(n.conversion.buyMax)?"Next:":"Req:"," ",Pt(n.conversion.baseResource,!l(n.conversion.buyMax)&&u.gte(l(n.conversion.actualGain),1)?l(n.conversion.currentAt):l(n.conversion.nextAt))," ",n.conversion.baseResource.displayName]):null]))),n.canClick==null&&(n.canClick=F(()=>u.gte(l(n.conversion.actualGain),l(n.minimumGain))));const r=n.onClick;return n.onClick=function(i){l(n.canClick)!==!1&&(n.conversion.convert(),n.tree.reset(n.treeNode),n.resetTime&&(n.resetTime.value=n.resetTime[Ze]),r==null||r(i))},n})}function Fu(e){return iu(t=>{const n=e.call(t,t);return ce(n,"display",xn(n.layerID)),L(n,"append"),{...n,onClick:l(n.append)?function(){if(T.tabs.includes(n.layerID)){const r=T.tabs.lastIndexOf(n.layerID);T.tabs.splice(r,1)}else T.tabs.push(n.layerID)}:function(){T.tabs.splice(1,1,n.layerID)}}})}const bn="p",Tt=Xt(bn,function(){const e="Prestige",t="#4BDC13",n=jn(0,"prestige points"),r=uu(()=>({formula:f=>f.div(10).sqrt(),baseResource:Ft.points,gainResource:n})),i=vu(()=>({thingsToReset:()=>[Tt]})),a=Fu(()=>({layerID:bn,color:t,reset:i})),s=Su(a,{display:ou(n),pinnable:!0}),c=Tu(()=>({conversion:r,tree:Ft.tree,treeNode:a})),d=hu(()=>({description:"Reset for prestige points",key:"p",onPress:c.onClick}));return{name:e,color:t,points:n,tooltip:s,display:te(()=>_(W,null,[_(ku,{resource:n,color:t},null),_t(c)])),treeNode:a,hotkey:d}}),Ft=Xt("main",function(){const e=jn(10),t=Dl(e),n=Rl(e),r=F(()=>new u(1));oe.on("update",s=>{e.value=u.add(e.value,u.times(r.value,s))});const i=Bl(e,r),a=au(()=>({nodes:[[Tt.treeNode]],branches:[],onReset(){e.value=un(this.resettingNode.value)===un(Tt.treeNode)?0:10,t.value=e.value,n.value=e.value},resetPropagation:su}));return{name:"Tree",links:a.links,display:te(()=>_(W,null,[T.devSpeed===0?_("div",null,[E("Game Paused"),_(Qe,{id:"paused"},null)]):null,T.devSpeed!=null&&T.devSpeed!==0&&T.devSpeed!==1?_("div",null,[E("Dev Speed: "),Te(T.devSpeed),E("x"),_(Qe,{id:"devspeed"},null)]):null,T.offlineTime!=null&&T.offlineTime!==0?_("div",null,[E("Offline Time: "),Vt(T.offlineTime),_(Qe,{id:"offline"},null)]):null,_("div",null,[u.lt(e.value,"1e1000")?_("span",null,[E("You have ")]):null,_("h2",null,[Te(e.value)]),u.lt(e.value,"1e1e6")?_("span",null,[E(" points")]):null]),u.gt(r.value,0)?_("div",null,[E("("),i.value,E(")"),_(Qe,{id:"oomps"},null)]):null,_(Ll,null,null),_t(a)])),points:e,best:t,total:n,oomps:i,tree:a}}),Eu=e=>[Ft,Tt],sn=F(()=>!1);function Ou(e,t){}var Vu=Object.freeze(Object.defineProperty({__proto__:null,main:Ft,getInitialLayers:Eu,hasWon:sn,fixOldSave:Ou},Symbol.toStringTag,{value:"Module"}));const Nt=e=>(Se("data-v-4a50ce42"),e=e(),Ie(),e),Lu={class:"game-over-modal-header"},Du=["src","alt"],Ru={class:"game-over-modal-title"},qu=Nt(()=>m("h2",null,"Congratulations!",-1)),Au={key:0},Bu=Nt(()=>m("br",null,null,-1)),zu=Nt(()=>m("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Uu=Nt(()=>m("br",null,null,-1)),Gu=["href"],ju=Nt(()=>m("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Hu=B({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:r,discordLink:i,versionNumber:a,versionTitle:s}=z,c=F(()=>Vt(T.timePlayed)),d=F(()=>sn.value&&!T.keepGoing),f=Pe(T,"autosave");function b(){T.keepGoing=!0}function v(){xe(nt())}return(N,k)=>(h(),R(ze,{"model-value":l(d)},{header:O(()=>[m("div",Lu,[l(n)?(h(),w("img",{key:0,class:"game-over-modal-logo",src:l(n),alt:l(t)},null,8,Du)):M("",!0),m("div",Ru,[qu,m("h4",null,"You've beaten "+V(l(t))+" v"+V(l(a))+": "+V(l(s)),1)])])]),body:O(({shown:y})=>[y?(h(),w("div",Au,[m("div",null,"It took you "+V(l(c))+" to beat the game.",1),Bu,zu,Uu,m("div",null,[m("a",{href:l(i),class:"game-over-modal-discord-link"},[ju,E(" "+V(l(r)),1)],8,Gu)]),_(Me,{title:"Autosave",modelValue:l(f),"onUpdate:modelValue":k[0]||(k[0]=S=>ie(f)?f.value=S:null)},null,8,["modelValue"])])):M("",!0)]),footer:O(()=>[m("div",{class:"game-over-footer"},[m("button",{onClick:b,class:"button"},"Keep Going"),m("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var Wu=G(Hu,[["__scopeId","data-v-4a50ce42"]]);const Rt=e=>(Se("data-v-6a99220e"),e=e(),Ie(),e),Ju=Rt(()=>m("div",{class:"nan-modal-header"},[m("h2",null,"NaN value detected!")],-1)),Ku={key:0},Zu=Rt(()=>m("br",null,null,-1)),Yu=["href"],Xu=Rt(()=>m("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Qu=Rt(()=>m("br",null,null,-1)),ec={class:"nan-footer"},tc=B({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=z,r=x(!0),i=x(!0),a=Pe(Z,"hasNaN"),s=x(null);he(a,N=>{N?(r.value=T.autosave,i.value=T.devSpeed===0):(T.autosave=r.value,T.devSpeed=i.value?0:null)});const c=F(()=>{var N;return(N=Z.NaNPath)==null?void 0:N.join(".")}),d=F(()=>Z.NaNPersistent!=null?Z.NaNPersistent.value:null);function f(){Z.NaNPersistent!=null&&(Z.NaNPersistent.value=new u(0),Z.hasNaN=!1)}function b(){Z.NaNPersistent&&(Z.NaNPersistent.value=new u(1),Z.hasNaN=!1)}function v(){Z.NaNPersistent&&(Z.NaNPersistent.value=new u(NaN),Z.hasNaN=!1)}return(N,k)=>(h(),w(W,null,[_(ze,Ae({modelValue:l(a),"onUpdate:modelValue":k[4]||(k[4]=y=>ie(a)?a.value=y:null)},N.$attrs),{header:O(()=>[Ju]),body:O(()=>[m("div",null,[E(' Attempted to assign "'+V(l(c))+'" to NaN',1),l(d)?(h(),w("span",Ku,V(" ")+"(previously "+V(l(Te)(l(d)))+")",1)):M("",!0),E(". Auto-saving has been "+V(r.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Zu,m("div",null,[m("a",{href:l(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[Xu,E(" "+V(l(t)||"Profectus & Friends"),1)],8,Yu)]),Qu,_(Me,{title:"Autosave",modelValue:r.value,"onUpdate:modelValue":k[0]||(k[0]=y=>r.value=y)},null,8,["modelValue"]),l(z).enablePausing?(h(),R(Me,{key:0,title:"Pause game",modelValue:i.value,"onUpdate:modelValue":k[1]||(k[1]=y=>i.value=y)},null,8,["modelValue"])):M("",!0)]),footer:O(()=>[m("div",ec,[m("button",{onClick:k[2]||(k[2]=y=>{var S;return(S=s.value)==null?void 0:S.open()}),class:"button"},"Open Saves Manager"),m("button",{onClick:f,class:"button"},"Set to 0"),m("button",{onClick:b,class:"button"},"Set to 1"),l(d)&&l(u).neq(l(d),0)&&l(u).neq(l(d),1)?(h(),w("button",{key:0,onClick:k[3]||(k[3]=y=>a.value=!1),class:"button"}," Set to previous ")):M("",!0),m("button",{onClick:v,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),_(Un,{ref_key:"savesManager",ref:s},null,512)],64))}});var nc=G(tc,[["__scopeId","data-v-6a99220e"]]);const rc={key:0,class:"tpsDisplay"},ic=B({__name:"TPS",setup(e){const t=F(()=>u.div(Z.lastTenTicks.length,Z.lastTenTicks.reduce((n,r)=>n+r,0)));return(n,r)=>l(t).isNan()?M("",!0):(h(),w("div",rc,"TPS: "+V(l(mt)(l(t))),1))}});var ac=G(ic,[["__scopeId","data-v-89b89152"]]);var sc=B({__name:"App",setup(e){const t=z.useHeader,n=F(()=>en[j.theme].variables),r=Pe(j,"showTPS"),i=Pe(Z,"errors"),a=F(()=>ue(te(()=>_(W,null,[Ns.map(_t)]))));return(s,c)=>l(i).length>0?(h(),w("div",{key:0,class:"error-container",style:me(l(n))},[_(wn,{errors:l(i)},null,8,["errors"])],4)):(h(),w(W,{key:1},[m("div",{id:"modal-root",style:me(l(n))},null,4),m("div",{class:ee(["app",{useHeader:l(t)}]),style:me(l(n))},[l(t)?(h(),R(Gn,{key:0})):M("",!0),_(Ol),l(l(r))?(h(),R(ac,{key:1})):M("",!0),_(Wu),_(nc),_(bo),(h(),R(se(l(a))))],6)],64))}});var oc=G(sc,[["__scopeId","data-v-5d695520"]]);oe.on("setupVue",e=>e.use(sr));function lc(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:s}=e;let c,d,f,b;const v=async(k=!0)=>{await f,k&&(c==null||c.addEventListener("controlling",y=>{y.isUpdate&&window.location.reload()})),await(b==null?void 0:b())};async function N(){if("serviceWorker"in navigator){const{Workbox:k,messageSW:y}=await gt(()=>import("./workbox-window.4a8794bb.js"),[]);b=async()=>{d&&d.waiting&&await y(d.waiting,{type:"SKIP_WAITING"})},c=new k("./sw.js",{scope:"./",type:"classic"}),c.addEventListener("activated",S=>{S.isUpdate||r==null||r()});{const S=()=>{n==null||n()};c.addEventListener("waiting",S),c.addEventListener("externalwaiting",S)}c.register({immediate:t}).then(S=>{d=S,a?a("./sw.js",S):i==null||i(S)}).catch(S=>{s==null||s(S)})}}return f=N(),v}function uc(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:s}=e,c=x(!1),d=x(!1);return{updateServiceWorker:lc({immediate:t,onNeedRefresh(){c.value=!0,n==null||n()},onOfflineReady(){d.value=!0,r==null||r()},onRegistered:i,onRegisteredSW:a,onRegisterError:s}),offlineReady:d,needRefresh:c}}const on=console.error;console.error=function(...e){on(...e)};window.onerror=function(e,t,n,r,i){return Z.errors.push(i instanceof Error?i:new Error(JSON.stringify(i))),on(i),!0};window.onunhandledrejection=function(e){Z.errors.push(e.reason instanceof Error?e.reason:new Error(JSON.stringify(e.reason))),on(e.reason)};document.title=z.title;window.projInfo=z;z.id===""&&console.error("Project ID is empty!","Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c -Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await ms();const{globalBus:e}=await gt(()=>Promise.resolve().then(function(){return Ii}),void 0),{startGameLoop:t}=await gt(()=>import("./gameLoop.f446598b.js"),["assets/gameLoop.f446598b.js","assets/@fontsource.f66d05e7.css","assets/vue.359c6955.js","assets/lz-string.bfbf8ec3.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/unofficial-galaxy-sdk.21372393.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-next-select.68e0c605.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.055200e5.js","assets/sortablejs.20039f18.js","assets/vue-toastification.45d39007.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=tr(oc);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Je(()=>{const r=or(),{updateServiceWorker:i}=uc({onNeedRefresh(){r.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{u as D,gt as _,Z as a,z as b,Vu as c,oe as g,tn as l,T as p,j as s}; +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 ms();const{globalBus:e}=await gt(()=>Promise.resolve().then(function(){return Ii}),void 0),{startGameLoop:t}=await gt(()=>import("./gameLoop.fd6e5459.js"),["assets/gameLoop.fd6e5459.js","assets/@fontsource.f66d05e7.css","assets/vue.359c6955.js","assets/lz-string.bfbf8ec3.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/unofficial-galaxy-sdk.21372393.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-next-select.68e0c605.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.055200e5.js","assets/sortablejs.20039f18.js","assets/vue-toastification.45d39007.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=tr(oc);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Je(()=>{const r=or(),{updateServiceWorker:i}=uc({onNeedRefresh(){r.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{u as D,gt as _,Z as a,z as b,Vu as c,oe as g,tn as l,T as p,j as s}; diff --git a/index.html b/index.html index ae5af38..cefe245 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + diff --git a/sw.js b/sw.js index bb67fed..0fff612 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const a=e=>i(e,r),u={module:{uri:r},exports:o,require:a};s[r]=Promise.all(n.map((e=>u[e]||a(e)))).then((e=>(l(...e),o)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6f8187b0.js",revision:null},{url:"assets/gameLoop.f446598b.js",revision:null},{url:"assets/index.0c166c16.js",revision:null},{url:"assets/index.e930493e.css",revision:null},{url:"assets/lz-string.bfbf8ec3.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/sortablejs.20039f18.js",revision:null},{url:"assets/unofficial-galaxy-sdk.21372393.js",revision:null},{url:"assets/vue-next-select.68e0c605.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.45d39007.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue.359c6955.js",revision:null},{url:"assets/vuedraggable.055200e5.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"d2b30ca1a5844f7aded70bbf4b38461b"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"49b9cd04ee2139bfe785f8100ba3f74f"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const a=e=>i(e,r),u={module:{uri:r},exports:o,require:a};s[r]=Promise.all(n.map((e=>u[e]||a(e)))).then((e=>(l(...e),o)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6f8187b0.js",revision:null},{url:"assets/gameLoop.fd6e5459.js",revision:null},{url:"assets/index.2cbf0746.js",revision:null},{url:"assets/index.e930493e.css",revision:null},{url:"assets/lz-string.bfbf8ec3.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/sortablejs.20039f18.js",revision:null},{url:"assets/unofficial-galaxy-sdk.21372393.js",revision:null},{url:"assets/vue-next-select.68e0c605.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.45d39007.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue.359c6955.js",revision:null},{url:"assets/vuedraggable.055200e5.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"bc34e1efa30588a3768f202ab90ed235"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"49b9cd04ee2139bfe785f8100ba3f74f"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));