From 9075844a260e68454a8fae77f21bd23e10c92307 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 12 May 2023 23:46:49 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20thepaper?= =?UTF-8?q?pilot/Planar-Pioneers@aa8b0a68251cb03325214cd9eac8714616381db6?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{gameLoop.c3596ec6.js => gameLoop.382c0c1f.js} | 2 +- assets/{index.24fb7a71.js => index.d763a9b8.js} | 4 ++-- index.html | 2 +- sw.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename assets/{gameLoop.c3596ec6.js => gameLoop.382c0c1f.js} (92%) rename assets/{index.24fb7a71.js => index.d763a9b8.js} (78%) diff --git a/assets/gameLoop.c3596ec6.js b/assets/gameLoop.382c0c1f.js similarity index 92% rename from assets/gameLoop.c3596ec6.js rename to assets/gameLoop.382c0c1f.js index 9c75b3f..ac4e9d5 100644 --- a/assets/gameLoop.c3596ec6.js +++ b/assets/gameLoop.382c0c1f.js @@ -1 +1 @@ -import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.24fb7a71.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.24fb7a71.js").then(function(t){return t.c}),["assets/index.24fb7a71.js","assets/index.8dafe82c.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; +import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.d763a9b8.js";import"./vue.c16a309b.js";import{b2 as c}from"./@vue.6b211d3c.js";/* empty css */import"./nanoevents.1080beb7.js";import"./lz-string.dccec454.js";import"./vue-next-select.ded54c4a.js";import"./vuedraggable.1879de79.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-panzoom.8ce6f9b1.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";import"./vue-toastification.9c2dad53.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function A(){f=(await d(()=>import("./index.d763a9b8.js").then(function(t){return t.c}),["assets/index.d763a9b8.js","assets/index.8dafe82c.css","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{A as startGameLoop}; diff --git a/assets/index.24fb7a71.js b/assets/index.d763a9b8.js similarity index 78% rename from assets/index.24fb7a71.js rename to assets/index.d763a9b8.js index f865f42..eb1ecd7 100644 --- a/assets/index.24fb7a71.js +++ b/assets/index.d763a9b8.js @@ -14,5 +14,5 @@ ${V} ${D}`)}}return d[S]}vt(n,S=>{S&&Object.keys(d).forEach(D=>delete d[D])});const f=w(()=>ue.saves.reduce((S,D)=>(S[D]=v(D),S),{}));function h(S){let D;switch(K.id===S?D=Pr(K):D=JSON.stringify(f.value[S]),me.exportEncoding){default:console.warn(`Unknown save encoding: ${me.exportEncoding}. Defaulting to lz`);case"lz":D=Kt.compressToUTF16(D);break;case"base64":D=btoa(unescape(encodeURIComponent(D)));break;case"plain":break}const V=document.createElement("textarea");V.value=D,document.body.appendChild(V),V.select(),V.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(V)}function g(S){K.id===S&&mt();const D={...f.value[S],id:fi()};mt(D),ue.saves.push(D.id)}function C(S){ue.saves=ue.saves.filter(D=>D!==S),localStorage.removeItem(S),d[S]=void 0}function _(S){f.value[K.id].time=K.time,mt(),d[K.id]=void 0,dn(f.value[S]),d[S]=void 0}function I(S){if(l.value=S,Gt(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Kt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const D=JSON.parse(S);D.id=fi(),mt(D),ue.saves.push(D.id),_(D.id)}function P(S,D){const V=f.value[S];V!=null&&(V.name=D,K.id===S?(K.name=D,mt()):(mt(V),d[S]=void 0))}return(S,D)=>(M(),te(Ht,{modelValue:n.value,"onUpdate:modelValue":D[4]||(D[4]=V=>n.value=V),ref_key:"modal",ref:i},{header:H(()=>[gl]),body:H(({shown:V})=>[V?(M(),te(s(ka),{key:0,list:s(ue).saves,handle:".handle",itemKey:oe=>oe},{item:H(({element:oe})=>[p(pl,{save:s(f)[oe],onOpen:le=>_(oe),onExport:le=>h(oe),onEditName:le=>P(oe,le),onDuplicate:le=>g(oe),onDelete:le=>C(oe)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):z("",!0)]),footer:H(()=>[N("div",ml,[p(jr,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=V=>a.value=V),title:"Import Save",placeholder:"Paste your save here!",class:be({importingFailed:r.value})},null,8,["modelValue","class"]),N("div",vl,[hl,N("div",bl,[N("button",{class:"button",onClick:D[1]||(D[1]=V=>_(s(Pn)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),te(Qi,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":D[2]||(D[2]=V=>I(V)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):z("",!0)])]),N("div",yl,[wl,N("button",{class:"button modal-default-button",onClick:D[3]||(D[3]=V=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zr=pe(_l,[["__scopeId","data-v-2a4275be"]]);const wt=e=>(hn("data-v-318a1c31"),e=e(),bn(),e),Nl=["src","alt"],Cl={key:1,class:"title"},kl=wt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Ml={class:"discord"},Sl={class:"discord-links"},Il={key:0},xl=["href"],$l=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),El=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Pl={href:"https://forums.moddingtree.com/",target:"_blank"},Tl=wt(()=>N("span",{class:"material-icons"},"forum",-1)),Dl=wt(()=>N("span",{class:"material-icons"},"info",-1)),Al=wt(()=>N("span",{class:"material-icons"},"library_books",-1)),Rl=wt(()=>N("span",{class:"material-icons"},"settings",-1)),Fl=wt(()=>N("span",{class:"material-icons"},"library_books",-1)),Ol=wt(()=>N("span",{class:"material-icons"},"settings",-1)),ql=wt(()=>N("span",{class:"material-icons"},"info",-1)),Vl={href:"https://forums.moddingtree.com/",target:"_blank"},Bl=wt(()=>N("span",{class:"material-icons"},"forum",-1)),Ll={class:"discord"},jl={class:"discord-links"},zl={key:0},Ul=["href"],Gl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Wl=wt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Hl=Y({__name:"Nav",setup(e){const t=U(null),n=U(null),i=U(null),r=U(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:d,versionNumber:v}=me;function f(){window.open(d,"mywindow")}return(h,g)=>(M(),A(re,null,[s(a)?(M(),A("div",Wt({key:0,class:"nav"},h.$attrs),[s(l)?(M(),A("img",{key:0,src:s(l),class:"banner",alt:s(u)},null,8,Nl)):(M(),A("div",Cl,ce(s(u)),1)),N("div",{onClick:g[0]||(g[0]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(Fe,{display:"Changelog",direction:s(G).Down,class:"version"},{default:H(()=>[N("span",null,"v"+ce(s(v)),1)]),_:1},8,["direction"])]),kl,N("div",Ml,[N("span",{onClick:f,class:"material-icons"},"discord"),N("ul",Sl,[s(d)?(M(),A("li",Il,[N("a",{href:s(d),target:"_blank"},ce(s(c)),9,xl)])):z("",!0),$l,El])]),N("div",null,[N("a",Pl,[p(Fe,{display:"Forums",direction:s(G).Down,yoffset:"5px"},{default:H(()=>[Tl]),_:1},8,["direction"])])]),N("div",{onClick:g[1]||(g[1]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(Fe,{display:"Info",direction:s(G).Down,class:"info"},{default:H(()=>[Dl]),_:1},8,["direction"])]),N("div",{onClick:g[2]||(g[2]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(Fe,{display:"Saves",direction:s(G).Down,xoffset:"-20px"},{default:H(()=>[Al]),_:1},8,["direction"])]),N("div",{onClick:g[3]||(g[3]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(Fe,{display:"Settings",direction:s(G).Down,xoffset:"-66px"},{default:H(()=>[Rl]),_:1},8,["direction"])])],16)):(M(),A("div",Wt({key:1,class:"overlay-nav"},h.$attrs),[N("div",{onClick:g[4]||(g[4]=C=>{var _;return(_=r.value)==null?void 0:_.open()}),class:"version-container"},[p(Fe,{display:"Changelog",direction:s(G).Right,xoffset:"25%",class:"version"},{default:H(()=>[N("span",null,"v"+ce(s(v)),1)]),_:1},8,["direction"])]),N("div",{onClick:g[5]||(g[5]=C=>{var _;return(_=n.value)==null?void 0:_.open()})},[p(Fe,{display:"Saves",direction:s(G).Right},{default:H(()=>[Fl]),_:1},8,["direction"])]),N("div",{onClick:g[6]||(g[6]=C=>{var _;return(_=i.value)==null?void 0:_.open()})},[p(Fe,{display:"Settings",direction:s(G).Right},{default:H(()=>[Ol]),_:1},8,["direction"])]),N("div",{onClick:g[7]||(g[7]=C=>{var _;return(_=t.value)==null?void 0:_.open()})},[p(Fe,{display:"Info",direction:s(G).Right},{default:H(()=>[ql]),_:1},8,["direction"])]),N("div",null,[N("a",Vl,[p(Fe,{display:"Forums",direction:s(G).Right,xoffset:"7px"},{default:H(()=>[Bl]),_:1},8,["direction"])])]),N("div",Ll,[N("span",{onClick:f,class:"material-icons"},"discord"),N("ul",jl,[s(d)?(M(),A("li",zl,[N("a",{href:s(d),target:"_blank"},ce(s(c)),9,Ul)])):z("",!0),Gl,Wl])])],16)),p(So,{ref_key:"info",ref:t,changelog:r.value},null,8,["changelog"]),p(zr,{ref_key:"savesManager",ref:n},null,512),p(qo,{ref_key:"options",ref:i},null,512),p(so,{ref_key:"changelog",ref:r},null,512)],64))}});var Ur=pe(Hl,[["__scopeId","data-v-318a1c31"]]);const Zl={class:"inner-tab"},Xl=Y({__name:"Game",setup(e){const t=en(K,"tabs"),n=w(()=>Object.keys(he)),i=me.useHeader;function r(a){const{display:l,minimized:u,name:c,color:d,minimizable:v,nodes:f,minimizedDisplay:h}=a;return{display:l,minimized:u,name:c,color:d,minimizable:v,nodes:f,minimizedDisplay:h}}return(a,l)=>(M(),A("div",{class:be(["tabs-container",{useHeader:s(i)}])},[(M(!0),A(re,null,Dn(s(t),(u,c)=>{var d,v;return M(),A("div",{key:c,class:be(["tab",s((d=s(he)[u])==null?void 0:d.classes)]),style:je(s((v=s(he)[u])==null?void 0:v.style))},[c===0&&!s(i)?(M(),te(Ur,{key:0})):z("",!0),N("div",Zl,[s(n).includes(u)?(M(),te(no,Wt({key:0},r(s(he)[u]),{index:c,onSetMinimized:f=>s(he)[u].minimized.value=f}),null,16,["index","onSetMinimized"])):(M(),te(Xe(u),{key:1,index:c},null,8,["index"]))])],6)}),128))],2))}});var Yl=pe(Xl,[["__scopeId","data-v-dcd207b4"]]);const Jl=Y({__name:"Sticky",setup(e){const t=U("0"),n=new ResizeObserver(r),i=ht(null);function r(){let a=i.value;if(a==null)return;let l=0;for(;a.previousSibling;){const u=a.previousSibling;u.dataset&&"vSticky"in u.dataset&&(l+=u.offsetHeight),a=u}t.value=l+"px"}return Gt(r),document.fonts.ready.then(r),yi(()=>{var l;const a=(l=i.value)==null?void 0:l.parentElement;a&&n.observe(a)}),(a,l)=>(M(),A("div",{class:"sticky",style:je({top:t.value}),ref_key:"element",ref:i,"data-v-sticky":""},[At(a.$slots,"default",{},void 0,!0)],4))}});var hi=pe(Jl,[["__scopeId","data-v-cccac690"]]);const Kl=["x1","y1","x2","y2"],Ql=Y({__name:"BoardLink",props:{link:null},setup(e){const n=Pe(e),i=w(()=>{const a=n.link.value.startNode.position;return n.link.value.offsetStart&&(a.x+=s(n.link.value.offsetStart).x,a.y+=s(n.link.value.offsetStart).y),a}),r=w(()=>{const a=n.link.value.endNode.position;return n.link.value.offsetEnd&&(a.x+=s(n.link.value.offsetEnd).x,a.y+=s(n.link.value.offsetEnd).y),a});return(a,l)=>(M(),A("line",Wt({class:"link"},e.link,{class:{pulsing:e.link.pulsing},x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Kl))}});var eu=pe(Ql,[["__scopeId","data-v-57c4970a"]]);const tu={key:0},nu=["transform","onMousedown","onTouchstart","onMouseup","onTouchend"],iu=["fill","stroke-width","stroke"],ru=["fill"],au=Y({__name:"BoardNodeAction",props:{node:null,nodeType:null,actions:null,isSelected:{type:Boolean},selectedAction:null},emits:["clickAction"],setup(e,{emit:t}){const i=Pe(e),r=w(()=>ge(i.nodeType.value.size,s(i.node))),a=w(()=>{var v;return(v=ge(i.nodeType.value.outlineColor,s(i.node)))!=null?v:Ct[ue.theme].variables["--outline"]}),l=w(()=>{var v;return(v=ge(i.nodeType.value.titleColor,s(i.node)))!=null?v:Ct[ue.theme].variables["--foreground"]}),u=w(()=>ge(i.nodeType.value.actionDistance,s(i.node)));function c(v,f){t("clickAction",f.id),v.preventDefault(),v.stopPropagation()}function d(v,f){var h;((h=s(i.selectedAction))==null?void 0:h.id)===f.id&&(v.preventDefault(),v.stopPropagation())}return(v,f)=>(M(),te(Hn,{name:"actions",appear:""},{default:H(()=>[e.isSelected&&e.actions?(M(),A("g",tu,[(M(!0),A(re,null,Dn(e.actions,(h,g)=>{var C,_;return M(),A("g",{key:h.id,class:be(["action",{selected:((C=e.selectedAction)==null?void 0:C.id)===h.id}]),transform:`translate( ${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-g)*s(u))}, ${(s(r)+30)*Math.cos(((e.actions.length-1)/2-g)*s(u))} - )`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:Tn(I=>d(I,h),["stop"])},[N("circle",{fill:s(ge)(h.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===h.id?4:0,stroke:s(a)},null,8,iu),N("text",{fill:s(l),class:"material-icons"},ce(s(ge)(h.icon,e.node)),9,ru)],42,nu)}),128))])):z("",!0)]),_:1}))}});var su=pe(au,[["__scopeId","data-v-9efb2a56"]]);const ou=["transform"],lu={key:0},uu=["r","fill","stroke"],cu=["r","fill","stroke"],du=["r","fill"],fu=["r","stroke-dasharray","stroke-dashoffset","stroke"],pu={key:1,transform:"rotate(45, 0, 0)"},gu=["width","height","transform","fill","stroke"],mu=["width","height","transform","fill","stroke"],vu=["width","height","transform","fill"],hu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],bu=["fill","y"],yu=["fill"],wu={key:0},_u=["fill","y"],Nu=["fill","y"],Cu=Y({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Pe(n),a=w(()=>ge(r.nodeType.value.draggable,s(r.node)));vt(a,B=>{const ae=s(r.node);s(r.dragging)===ae&&!B&&t("endDragging",ae)});const l=w(()=>{var ae;const B=s(r.node);return(ae=ge(r.nodeType.value.actions,B))==null?void 0:ae.filter(Te=>Ge(ge(Te.visibility,B)))}),u=w(()=>{var ae;const B=s(r.node);if(ge(r.nodeType.value.draggable,B)&&((ae=s(r.dragging))==null?void 0:ae.id)===B.id&&s(r.dragged)!=null){const{x:Te,y:He}=s(r.dragged);return{x:B.position.x+Math.round(Te/25)*25,y:B.position.y+Math.round(He/25)*25}}return B.position}),c=w(()=>ge(r.nodeType.value.shape,s(r.node))),d=w(()=>ge(r.nodeType.value.title,s(r.node))),v=w(()=>ge(r.nodeType.value.subtitle,s(r.node))),f=w(()=>{var B;return(B=r.isSelected.value?s(r.selectedAction)&&ge(s(r.selectedAction).tooltip,s(r.node)):null)!=null?B:ge(r.nodeType.value.label,s(r.node))}),h=w(()=>{var B,ae;return ge((ae=(B=s(r.selectedAction))==null?void 0:B.confirmationLabel)!=null?ae:{text:"Tap again to confirm"},s(r.node))}),g=w(()=>ge(r.nodeType.value.size,s(r.node))),C=w(()=>{var B;return(B=ge(r.nodeType.value.progress,s(r.node)))!=null?B:0}),_=w(()=>Ct[ue.theme].variables["--background"]),I=w(()=>{var B;return(B=ge(r.nodeType.value.outlineColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--outline"]}),P=w(()=>{var B;return(B=ge(r.nodeType.value.fillColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--raised-background"]}),S=w(()=>ge(r.nodeType.value.progressColor,s(r.node))),D=w(()=>{var B;return(B=ge(r.nodeType.value.titleColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--foreground"]}),V=w(()=>ge(r.nodeType.value.progressDisplay,s(r.node))),oe=w(()=>r.dragging.value!=null&&s(r.hasDragged)&&ge(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),le=w(()=>ge(r.nodeType.value.style,s(r.node))),Q=w(()=>ge(r.nodeType.value.classes,s(r.node)));function Z(B){t("mouseDown",B,r.node.value,a.value)}function fe(B){var ae,Te,He;(ae=r.hasDragged)!=null&&ae.value||(t("endDragging",r.node.value),(He=(Te=r.nodeType.value).onClick)==null||He.call(Te,r.node.value),B.stopPropagation())}return(B,ae)=>{var Te,He,Xt;return M(),A("g",{class:be(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(Q)}]),style:je([{opacity:((Te=e.dragging)==null?void 0:Te.id)===e.node.id&&e.hasDragged?.5:1},(He=s(le))!=null?He:[]]),transform:`translate(${s(u).x},${s(u).y})${e.isSelected?" scale(1.2)":""}`},[p(su,{actions:(Xt=s(l))!=null?Xt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ae[0]||(ae[0]=at=>t("clickAction",at))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:Z,onTouchstartPassive:Z,onMouseup:fe,onTouchendPassive:fe},[s(c)===s(We).Circle?(M(),A("g",lu,[s(oe)?(M(),A("circle",{key:0,class:"receiver",r:s(g)+8,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,uu)):z("",!0),N("circle",{class:"body",r:s(g),fill:s(P),stroke:s(I),"stroke-width":4},null,8,cu),s(V)===s(vn).Fill?(M(),A("circle",{key:1,class:"progress progressFill",r:Math.max(s(g)*s(C)-2,0),fill:s(S)},null,8,du)):(M(),A("circle",{key:2,r:s(g)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(g)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(g)+4.5)*2*Math.PI-s(C)*(s(g)+4.5)*2*Math.PI,stroke:s(S)},null,8,fu))])):s(c)===s(We).Diamond?(M(),A("g",pu,[s(oe)?(M(),A("rect",{key:0,class:"receiver",width:s(g)*s(i)+16,height:s(g)*s(i)+16,transform:`translate(${-(s(g)*s(i)+16)/2}, ${-(s(g)*s(i)+16)/2})`,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,gu)):z("",!0),N("rect",{class:"body",width:s(g)*s(i),height:s(g)*s(i),transform:`translate(${-s(g)*s(i)/2}, ${-s(g)*s(i)/2})`,fill:s(P),stroke:s(I),"stroke-width":4},null,8,mu),s(V)===s(vn).Fill?(M(),A("rect",{key:1,class:"progress progressFill",width:Math.max(s(g)*s(i)*s(C)-2,0),height:Math.max(s(g)*s(i)*s(C)-2,0),transform:`translate(${-Math.max(s(g)*s(i)*s(C)-2,0)/2}, ${-Math.max(s(g)*s(i)*s(C)-2,0)/2})`,fill:s(S)},null,8,vu)):(M(),A("rect",{key:2,class:"progress progressDiamond",width:s(g)*s(i)+9,height:s(g)*s(i)+9,transform:`translate(${-(s(g)*s(i)+9)/2}, ${-(s(g)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(g)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(g)*s(i)+9)*4-s(C)*(s(g)*s(i)+9)*4,stroke:s(S)},null,8,hu))])):z("",!0),N("text",{fill:s(D),class:"node-title",y:s(v)?10:0},ce(s(d)),9,bu),s(v)?(M(),A("text",{key:2,fill:s(D),class:"node-subtitle",y:"-15"},ce(s(v)),9,yu)):z("",!0)],32),p(Hn,{name:"fade",appear:""},{default:H(()=>{var at;return[s(f)?(M(),A("g",wu,[N("text",{fill:(at=s(f).color)!=null?at:s(D),class:be(["node-title",{pulsing:s(f).pulsing}]),y:-s(g)-20},ce(s(f).text),11,_u)])):z("",!0)]}),_:1}),p(Hn,{name:"fade",appear:""},{default:H(()=>{var at;return[e.isSelected&&e.selectedAction?(M(),A("text",{key:0,fill:(at=s(h).color)!=null?at:s(D),class:be(["node-title",{pulsing:s(h).pulsing}]),y:s(g)+75},ce(s(h).text),11,Nu)):z("",!0)]}),_:1})],14,ou)}}});var ku=pe(Cu,[["__scopeId","data-v-518d7a7f"]]);const Mu={class:"stage",width:"100%",height:"100%"},Su={class:"g1"},Iu=Y({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Pe(e),i=U({x:0,y:0}),r=U({x:0,y:0}),a=U(!1),l=U(null),u=w(()=>{const g=n.nodes.value.slice();if(n.selectedNode.value){const C=g.splice(g.indexOf(n.selectedNode.value),1)[0];g.push(C)}if(n.draggingNode.value){const C=g.splice(g.indexOf(n.draggingNode.value),1)[0];g.push(C)}return g});It(()=>{const g=n.draggingNode.value;if(g==null)return null;const C={x:g.position.x+r.value.x,y:g.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,P)=>{if(P.id===g.id)return I;const S=n.types.value[P.type];if(!ge(S.canAccept,P,g))return I;const V=Math.pow(C.x-P.position.x,2)+Math.pow(C.y-P.position.y,2);let oe=ge(S.size,P);return V>_||V>oe*oe?I:(_=V,P)},null))});function c(g){g.setTransformOrigin(null),g.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(g,C=null,_=!1){if(n.draggingNode.value==null){g.preventDefault(),g.stopPropagation();let I,P;if("touches"in g)if(g.touches.length===1)I=g.touches[0].clientX,P=g.touches[0].clientY;else return;else I=g.clientX,P=g.clientY;i.value={x:I,y:P},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(C)}C!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(g){const{x:C,y:_,scale:I}=l.value.panZoomInstance.getTransform();let P,S;if("touches"in g)if(g.touches.length===1)P=g.touches[0].clientX,S=g.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else P=g.clientX,S=g.clientY;n.mousePosition.value={x:(P-C)/I,y:(S-_)/I},r.value={x:r.value.x+(P-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:P,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(g.preventDefault(),g.stopPropagation())}function f(g,C=!1){var _,I;if(n.draggingNode.value!=null&&n.draggingNode.value===g){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const P=n.nodes.value;P.push(P.splice(P.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!C&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(g,C){n.state.value.selectedAction===C?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:C}}return(g,C)=>{const _=Mt("panZoom");return s(Ge)(e.visibility)?(M(),te(_,{key:0,style:je([{width:e.width,height:e.height},e.style]),class:be(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:v,onTouchmove:v,onMousedown:C[0]||(C[0]=I=>d(I)),onTouchstart:C[1]||(C[1]=I=>d(I)),onMouseup:C[2]||(C[2]=()=>f(s(e.draggingNode))),onTouchendPassive:C[3]||(C[3]=()=>f(s(e.draggingNode))),onMouseleave:C[4]||(C[4]=()=>f(s(e.draggingNode),!0))},{default:H(()=>[(M(),A("svg",Mu,[N("g",Su,[p(lr,{name:"link",appear:""},{default:H(()=>[(M(!0),A(re,null,Dn(s(e.links)||[],I=>(M(),A("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(eu,{link:I},null,8,["link"])]))),128))]),_:1}),p(lr,{name:"grow",duration:500,appear:""},{default:H(()=>[(M(!0),A(re,null,Dn(s(u),I=>(M(),A("g",{key:I.id,style:{"transition-duration":"0s"}},[p(ku,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:s(e.draggingNode)==null?!1:a.value,receivingNode:s(e.receivingNode)===I,isSelected:s(e.selectedNode)===I,selectedAction:s(e.selectedNode)===I?s(e.selectedAction):null,onMouseDown:d,onEndDragging:f,onClickAction:P=>h(I,P)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):z("",!0)}}});Ye.on("setupVue",e=>Sa.install(e));const Gr=Symbol("Board");var vn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(vn||{}),We=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(We||{});function xu(e){const t=dt({nodes:[],selectedNode:null,selectedAction:null},!1);return Je(n=>{const i=e.call(n,n);i.id=nn("board-"),i.type=Gr,i[yt]=Iu,i.state?(qr(t),$(i,"state")):(t[tn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=w(()=>s(l.state).nodes),i.selectedNode=w({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;Oe(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=w({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;Oe(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=U(null),i.links?$(i,"links"):i.links=w(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?ge(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=U(null),i.receivingNode=U(null),$(i,"visibility"),se(i,"visibility",Ce.Visible),$(i,"width"),se(i,"width","100%"),$(i,"height"),se(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),se(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),se(c,"draggable",!1),$(c,"shape"),se(c,"shape","Circle"),$(c,"canAccept"),se(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),se(c,"progressDisplay","Fill"),$(c,"progressColor"),se(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),se(c,"actionDistance",Math.PI/6),c.nodes=w(()=>s(l.state).nodes.filter(d=>d.type===u)),se(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),se(d,"visibility",Ce.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),se(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=G.Right){const v=l.nodes.value.slice().filter(f=>f===u||(d===G.Down||d===G.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===G.Left||d===G.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===G.Right&&f.position.xu.position.x+c||d===G.Up&&f.position.y>u.position.y+c||d===G.Down&&f.position.yf.position.x-h.position.x:d===G.Left?(f,h)=>h.position.x-f.position.x:d===G.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f0&&g>c)break}},i[pt]=function(){const{nodes:u,types:c,state:d,visibility:v,width:f,height:h,style:g,classes:C,links:_,selectedAction:I,selectedNode:P,mousePosition:S,draggingNode:D,receivingNode:V}=this;return{nodes:u,types:c,state:d,visibility:v,width:f,height:h,style:s(g),classes:C,links:_,selectedAction:I,selectedNode:P,mousePosition:S,draggingNode:D,receivingNode:V,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function ge(e,t,...n){return Xn(e)?e(t,...n):s(e)}function Qn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Un={};Ye.on("addLayer",e=>{const t=Jn(e,Gr);Un[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});Ye.on("removeLayer",e=>{var t;(t=Un[e.id])==null||t.call(Un),Un[e.id]=void 0});function $n(e,t="points",n=0,i=void 0){const r=Oe(e)?e:dt(e);if(r.displayName=t,r.precision=n,r.small=i,!Oe(e)){const a=r[Dt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function bi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?ft(e.small?n:o.floor(n)):Me(n,e.precision,e.small)}Ye.on("setupVue",e=>e.use(Ia));function $u(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const Eu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:{type:O(Object,String,Function),required:!0},style:O(String,Object,Array),classes:O(Object),glowColor:O(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Pe(e),a=Fr(n),l=w(()=>{const c=$e(i);return c==null||c===""?{}:s(r)?$u(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Pu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(M(),A("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:be(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(M(),te(Xe(e.component)))],6)):z("",!0)}var Wr=pe(Eu,[["render",Pu],["__scopeId","data-v-21427abb"]]);const Tu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},activeTab:{type:O(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:O(Object),required:!0},style:O(String,Object,Array),classes:O(Object),buttonContainerStyle:O(String,Object,Array),buttonContainerClasses:O(Object)},components:{Sticky:hi,TabButton:Wr},setup(e){const{activeTab:t}=Pe(e),n=w(()=>Ct[ue.theme].floatingTabs),i=ht("");It(()=>{const u=$e(t);if(u==null){i.value="";return}if(xt(u)){i.value=de(u);return}i.value=de(s(u.display))});const r=w(()=>{const u=$e(t);return xt(u)||!u?void 0:s(u.classes)}),a=w(()=>{const u=$e(t);return xt(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:v,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:v,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:Ce,component:i,gatherButtonProps:l,unref:s,isVisible:Ge,isHidden:yn}}});function Du(e,t,n,i,r,a){var c,d;const l=Mt("TabButton"),u=Mt("Sticky");return e.isVisible(e.visibility)?(M(),A("div",{key:0,class:be(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:be(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:je(e.unref(e.buttonContainerStyle))},{default:H(()=>[N("div",{class:be(["tab-buttons",{floating:e.floating}])},[(M(!0),A(re,null,Dn(e.unref(e.tabs),(v,f)=>(M(),te(l,Wt({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(v.tab)===e.unref(e.activeTab)},e.gatherButtonProps(v)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),te(Xe(e.unref(e.component)),{key:0})):z("",!0)],6)):z("",!0)}var Au=pe(Tu,[["render",Du],["__scopeId","data-v-58dbf83a"]]);const Ru=Symbol("TabButton"),Fu=Symbol("TabFamily");function Ou(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=dt(Object.keys(e)[0],!1);return Je(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=nn("tabFamily-"),r.type=Fu,r[yt]=Au,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=Ru,d[yt]=Wr,$(d,"visibility"),se(d,"visibility",Ce.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=w(()=>{const u=s(a.tabs);if(n.value in u&&Ge(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(d=>Ge(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[pt]=function(){const{visibility:u,activeTab:c,selected:d,tabs:v,style:f,classes:h,buttonContainerClasses:g,buttonContainerStyle:C}=this;return{visibility:u,activeTab:c,selected:d,tabs:v,style:s(f),classes:h,buttonContainerClasses:g,buttonContainerStyle:C}};const a=r;return a})}const Hr=o.ln(10);function Gn(e){return e}function qu(e,t){if(R(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Vu(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Bu(e){return m.neg(e)}function Lu(e,t,n){if(R(t))return t.invert(o.sub(e,ke(n)));if(R(n))return n.invert(o.sub(e,ke(t)));throw new Error("Could not invert due to no input being a variable")}function ju(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function zu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t,n){if(R(t))return t.invert(o.add(e,ke(n)));if(R(n))return n.invert(o.sub(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Wu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Hu(e,t,n){if(R(t))return t.invert(o.div(e,ke(n)));if(R(n))return n.invert(o.div(e,ke(t)));throw new Error("Could not invert due to no input being a variable")}function Zu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Xu(e,t,n){if(R(t))return m.div(e,n);if(R(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Yu(e,t,n){if(R(t))return t.invert(o.mul(e,ke(n)));if(R(n))return n.invert(o.div(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Ju(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Ku(e,t,n){if(R(t))return m.mul(e,n);if(R(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Qu(e,t){if(R(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function ec(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t){if(R(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function nc(e){return o.ln(e).sub(1).times(e).div(Hr)}function ic(e,t){if(R(t)){const n=Hr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function rc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:nc,invert:ic})}throw new Error("Could not integrate due to no input being a variable")}function ac(e,t,n){if(R(t))return t.invert(o.pow(ke(n),e));if(R(n))return n.invert(o.root(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function sc(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function oc(e,t,n){if(R(t)){const i=o.ln(ke(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function lc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:sc,invert:oc})}throw new Error("Could not integrate due to no input being a variable")}function uc(e,t){if(R(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function cc(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function dc(e,t){if(R(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function fc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:cc,invert:dc})}throw new Error("Could not integrate due to no input being a variable")}function pc(e,t){if(R(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function gc(e){return o.ln(e).sub(1).times(e)}function mc(e,t){if(R(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function vc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:gc,invert:mc})}throw new Error("Could not integrate due to no input being a variable")}function hc(e,t,n){if(R(t))return t.invert(o.root(e,ke(n)));if(R(n))return n.invert(o.ln(e).div(o.ln(ke(t))));throw new Error("Could not invert due to no input being a variable")}function bc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function yc(e,t){if(R(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function wc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function _c(e,t,n){if(R(t))return t.invert(o.ln(e).div(o.ln(ke(n))));if(R(n))return n.invert(o.root(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Nc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Cc(e,t,n){if(R(t))return t.invert(o.root(e,o.recip(ke(n))));if(R(n))return n.invert(o.ln(ke(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function kc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Mc(e,t){if(R(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function Sc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Ic(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function xc(e,t,n,i){if(R(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function $c(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function Ec(e,t,n,i){if(R(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,ke(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Pc(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function Tc(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function Dc(e,t,n){if(R(t))return t.invert(o.tetrate(e,o.minabs(1e308,ke(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ac(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Rc(e,t,n,i){if(R(t))return t.invert(o.layeradd(e,o.minabs(1e308,ke(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Fc(e,t){if(R(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Oc(e,t){if(R(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function qc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Vc(e,t){if(R(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Bc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Lc(e,t){if(R(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function jc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function zc(e,t){if(R(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Uc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Gc(e,t){if(R(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Wc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Hc(e,t){if(R(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function Zc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Xc(e,t){if(R(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Yc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Jc(e,t){if(R(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Kc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Qc(e,t){if(R(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function ed(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function td(e,t){if(R(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function nd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function id(e,t){if(R(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function rd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function ad(e,t){if(R(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function sd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function od(e,t){if(R(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function ld(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Rn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:Gn})}function R(e){return e instanceof Ee&&e.hasVariable()}function ke(e,t){return e instanceof Ee?e.evaluate(t):s(e)}function ud(){return m.pow(this,2).div(2)}function cd(){return this}const qe=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Dt in n?n[Dt]:n)),"variable"in e?(typeof e.variable=="object"&&Dt in e.variable&&(e.variable=e.variable[Dt]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:ud,internalIntegrateInner:cd,applySubstitution:Gn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var h,g;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((C,_)=>C+(_ instanceof qe?_.internalVariables:0),0),c=t.find(C=>C instanceof qe&&C.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,v=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(g=c==null?void 0:c.isIntegrable())!=null?g:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>ke(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:ke(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof qe&&e.inputs[n]instanceof qe?t.equals(e.inputs[n]):!(t instanceof qe)&&!(e.inputs[n]instanceof qe)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=n(m.variable(0)),r=ve(t);function a(u){return o.lt(u,s(r))?u:o.add(i.evaluate(o.sub(u,s(r))),s(r))}function l(u,c){if(R(c)&&i.isInvertible())return o.gt(u,s(r))&&(u=o.add(i.invert(o.sub(u,s(r))),s(r))),c.invert(u);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:a,invert:i.isInvertible()&&i.hasVariable()?l:void 0})}static if(e,t,n,i){const r=U(0),a=m.variable(r),l=n(a),u=i==null?void 0:i(a),c=ve(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function v(f,h){if(!R(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new m({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?v:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:qu,applySubstitution:Bu,integrate:Vu})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:Lu,integrate:ju,integrateInner:zu,applySubstitution:Gn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Uu,integrate:Gu,integrateInner:Wu,applySubstitution:Gn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:Hu,integrate:Zu,applySubstitution:Xu})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:Yu,integrate:Ju,applySubstitution:Ku})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Qu,integrate:ec})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:Gn})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:tc,integrate:rc})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:ac,integrate:lc})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:uc,integrate:fc})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:pc,integrate:vc})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:hc,integrate:bc})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:yc,integrate:wc})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:_c,integrate:Nc})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:Cc,integrate:kc})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:Mc,integrate:Sc})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Ic,invert:xc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:$c,invert:Ec})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Pc})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:Tc,invert:Dc})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:Ac,invert:Rc})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Fc})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Oc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:qc})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Gc,integrate:Bc})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:Hc,integrate:jc})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Xc,integrate:Uc})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:Vc,integrate:Wc})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Lc,integrate:Zc})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:zc,integrate:Yc})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:id,integrate:Kc})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:ad,integrate:ed})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:od,integrate:nd})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Jc,integrate:rd})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Qc,integrate:sd})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:td,integrate:ld})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Ee=qe;Ee.negate=qe.neg;Ee.negated=qe.neg;Ee.sgn=qe.sign;Ee.plus=qe.add;Ee.subtract=qe.sub;Ee.minus=qe.sub;Ee.multiply=qe.mul;Ee.times=qe.mul;Ee.divide=qe.div;Ee.divideBy=qe.div;Ee.dividedBy=qe.div;Ee.reciprocal=qe.recip;Ee.reciprocate=qe.recip;Ee.max=Rn(o.max);Ee.min=Rn(o.min);Ee.minabs=Rn(o.minabs);Ee.maxabs=Rn(o.maxabs);Ee.clampMin=Rn(o.clampMin);Ee.clampMax=Rn(o.clampMax);Ee.logarithm=qe.log;class m extends Ee{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Zr(e,t,n=!0,i,r=o.dInf){const a=ve(n),l=ve(i),u=ve(r);return w(()=>{var h,g,C,_;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),v=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,v)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((g=s(e.innermostVariable))!=null?g:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),v>0){f=o.sub(f,v).clampMin(0);let I;for(d?I=gn(e,f,!0,0):I=e.evaluate(o.add((C=s(e.innermostVariable))!=null?C:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER)&&o.add(v,1).gte(f);){const P=e.evaluate(f.add((_=s(e.innermostVariable))!=null?_:0));if(o.add(I,P).lte(t.value))f=f.add(1),I=o.add(I,P);else break}}return f})}function gn(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)))}else if(u=e.evaluate(a),a=a.add(1),l.gt(1e308))return o.sub(l,a).add(1).times(u)}for(let d=a.toNumber();d{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>m.add(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[kt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",Ut(s(l))])]))}})}function we(e){return Je(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>m.times(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[kt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[T("\xD7"),Ut(s(l))])]))}})}function dd(e){return Je(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=ve(n),c=ve(i),d=r==null?void 0:ve(r);return{apply:v=>{let f=v;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:v=>{let f=v;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:v=>a?m.add(v,1).pow(u).sub(1):m.pow(v,u),enabled:d,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[kt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[T("^"),Ut(s(u))])]))}})}function _t(e){return Je(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?w(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?J(()=>p(re,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(kt)])):void 0}})}const zi=m.variable(0).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).step(o.pow(1500,1.5).pow(1.5).add(o.pow(900,1.5).add(100)),e=>e.pow(2)).pow(1.5),rn={id:"deselect",icon:"close",tooltip:e=>({text:"portals"in e.state?"Disconnect portals":"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"portals"in e.state?e.state={...e.state,portals:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"portals"in e.state?e.state.portals.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},Ft={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${ft(y.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},y.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function _n(e,t=1/0){const n=e(m.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${ft(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(y.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(y.energy.value,r)&&(y.energy.value=o.sub(y.energy.value,r),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},y.board.selectedAction.value=null)},visibility:i=>o.add(i.state.maxConnections,y.computedBonusConnectionsModifier.value).lt(t)}}function Xr(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=y.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function fd(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=y.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Ni(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=y.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Yr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function Jr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},y.board.selectedNode.value=e}function pd(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function gd(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},y.board.selectedNode.value=e}function Ci(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function ki(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},y.board.selectedNode.value=e}function ye(e){return e===y.board.selectedNode.value||e.state.powered}function ie(e){return y.empowerer.value!=null&&ye(y.empowerer.value)&&y.empowerer.value.state.tools.includes(e)}function md(e){var a,l,u;const t=(u=(l=(a=y.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=y.resourceLevels.value[e],i=zi.evaluate(n),r=zi.evaluate(o.add(n,1));return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function un(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.gt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const vd={key:0},hd={key:0,class:"mark star"},bd=["src"],yd=Y({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),A("div",vd,[e.mark===!0?(M(),A("div",hd)):(M(),A("img",{key:1,class:"mark",src:e.mark},null,8,bd))])):z("",!0)}});var ei=pe(yd,[["__scopeId","data-v-2207999f"]]);const wd=Y({__name:"Node",props:{id:null},setup(e){const n=Pe(e),i=pi(Hi,()=>{}),r=pi(Zi,()=>{}),a=ht(null),l=w(()=>a.value&&a.value.parentElement);return vt([l,n.id],([u,c],[d,v])=>{d&&r(s(v)),u&&i(c,u)}),Cr(()=>r(s(n.id))),(u,c)=>(M(),A("div",{class:"node",ref_key:"node",ref:a},null,512))}});var ti=pe(wd,[["__scopeId","data-v-a48cb382"]]),_d=Y({props:{display:{type:O(Object,String,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),onClick:Function,onHold:Function,canClick:{type:O(Boolean),required:!0},small:Boolean,mark:O(Boolean,String),id:{type:String,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,onClick:n,onHold:i}=Pe(e),r=ht("");It(()=>{var v;const u=$e(t);if(u==null){r.value="";return}if(xt(u)){r.value=de(u);return}const c=de((v=u.title)!=null?v:"","h3"),d=de(u.description,"div");r.value=de(J(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=Rr(n,i);return{start:a,stop:l,comp:r,Visibility:Ce,isVisible:Ge,isHidden:yn,unref:s}}});function Nd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:be({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(M(),te(Xe(e.unref(e.comp)),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):z("",!0)}var Kr=pe(_d,[["render",Nd],["__scopeId","data-v-211328c0"]]);const Qr=Symbol("Clickable");function Cd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Je(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=nn("clickable-"),r.type=Qr,r[yt]=Kr;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"canClick"),se(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(v){s(r.canClick)!==!1&&d(v)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,v)=>{var f;return Object.assign(d,(f=v.getGatheredProps)==null?void 0:f.call(v,r))},{});return r[pt]=function(){const{display:d,visibility:v,style:f,classes:h,onClick:g,onHold:C,canClick:_,small:I,mark:P,id:S}=this;return{display:d,visibility:v,style:s(f),classes:h,onClick:g,onHold:C,canClick:_,small:I,mark:P,id:S,...a}},r})}function kd(e,t,n=[]){n=n.length===0?Jn(e,Qr):n;const i=typeof t=="function"?w(t):t;return e.on("update",()=>{s(i)&&n.filter(r=>s(r.canClick)).forEach(r=>{var a;return(a=r.onClick)==null?void 0:a.call(r)})})}const Md=["x1","y1","x2","y2"],Sd=Y({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Pe(e),i=w(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=w(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(M(),A("line",Wt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Md))}});const Id=Y({__name:"Links",props:{links:null},setup(e){var c;const n=en(e,"links"),i=U(null),r=pi(Xi,U({})),a=pi(Yi,U(void 0)),l=U((c=i.value)==null?void 0:c.getBoundingClientRect());vt(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),yi(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=w(()=>{var v,f;const d=r.value;return(f=(v=n.value)==null?void 0:v.filter(h=>{var g,C;return((g=d[h.startNode.id])==null?void 0:g.rect)&&((C=d[h.startNode.id])==null?void 0:C.rect)}))!=null?f:[]});return(d,v)=>(M(),A(re,null,[s(u)?(M(),A("svg",wa(Wt({key:0},d.$attrs)),[(M(!0),A(re,null,Dn(s(u),(f,h)=>(M(),te(Sd,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):z("",!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var xd=pe(Id,[["__scopeId","data-v-063f6d6b"]]);Y({props:{nodes:{type:O(Array),required:!0},leftSideNodes:O(Array),rightSideNodes:O(Array),branches:O(Array)},components:{Links:xd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Pe(e),r=ht();It(()=>{const u=$e(t);r.value=de(J(()=>p(re,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(kt)]))])))});const a=ht();It(()=>{const u=$e(n);a.value=u?de(J(()=>p("span",{class:"left-side-nodes small"},[u.map(kt)]))):""});const l=ht();return It(()=>{const u=$e(i);l.value=u?de(J(()=>p("span",{class:"side-nodes small"},[u.map(kt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});Y({props:{display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),onClick:Function,onHold:Function,color:O(String),glowColor:O(String),canClick:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ei,Node:ti},setup(e){const{onClick:t,onHold:n,display:i}=Pe(e),r=An(i),{start:a,stop:l}=Rr(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:Ce,isCoercableComponent:xt,isVisible:Ge,isHidden:yn}}});function Wn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>ve(u.base)),n.baseText=t.map(u=>ve(u.baseText)),n.visible=t.map(u=>ve(u.visible)),n.title=t.map(u=>ve(u.title)),n.subtitle=t.map(u=>ve(u.subtitle)),i=!0),t}const a=dt({},!1);return[J(()=>{const u=r();let c=!0;const d=u.map((v,f)=>{var P,S,D;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[T("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[T(" ("),s(n.subtitle[f]),T(")")]):null]),g=s(a.value[f])?null:p(re,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[kt((P=s(n.baseText[f]))!=null?P:"Base")]),p("span",{class:"modifier-amount"},[Me((S=s(n.base[f]))!=null?S:1),v.unit])]),v.modifier.description==null?null:kt(s(v.modifier.description))]),C=!c;c=!1;const _=(D=s(n.base[f]))!=null?D:1,I=v.modifier.apply(_);return p(re,null,[C?p("br",null,null):null,p("div",{style:{"--unit":ue.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[h,p("br",null,null),g,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[T("Total")]),p("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(I,_!=null?_:1):o.lt(I,_!=null?_:1))?"color: var(--danger)":""},[Ut(I),v.unit])])])])});return p(re,null,[d])}),a]}function Oi(e,t,n){const i=ve(t),r=ve(n);return w(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":_i(o.sub(l,e.value).div(a))})}function cn(e,t,n=1){const i=ve(t),r=ve(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return J(()=>{var a;if(s(i)){const l=Ut(e.evaluate()),u=Ut(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(re,null,[p("b",null,[p("i",null,[l,T(" \u2192 "),u])])])}return p(re,null,[Ut(e.evaluate())])})}const St={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Lt=Object.keys(St),Le={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Tt={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"Replicator",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},$d={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 40% stronger":"Material level is 20% stronger"},silver:{description:e=>e?"Quadruples each plane's resource gain":"Doubles each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase (diminishing)":"+1% plane's resource gain per repeatable purchase (diminishing)"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"All upgrades apply twice":"Non-multiplicative upgrades apply twice"},coalRelic:{description:e=>e?"Every treasure boosts planar speed by +20%":"Every treasure boosts planar speed by +10%"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give quadruple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Powered machines)^2 boost quarry speed":"Powered machines boost quarry speed"},goldRelic:{description:e=>e?"Each treasure gives +20% XP gain":"Each treasure gives +10% XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs 20x less energy":"Creating portals costs 10x less energy"},platinumRelic:{description:e=>e?"Quadruple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"log(energy)^0.5 boosts planar speed":"log(energy)^0.25 boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Nt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},qi=m.variable(0).add(8).times(2).pow10();const Ed=Y({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),A("div",{style:je({width:e.width,height:e.height})},null,4))}});function Ln(e){return Je(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[bi(n.resource,n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",bi(n.resource,n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),se(n,"visibility",Ce.Visible),$(n,"cost"),$(n,"requiresPay"),se(n,"requiresPay",!0),$(n,"cumulativeCost"),se(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),se(n,"maxBulkAmount",1),$(n,"directSum"),se(n,"pay",function(r){const a=n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=w(()=>{var u;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),l=(u=s(n.directSum))!=null?u:a?10:0;return o.lte(r,l)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=Zr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=w(()=>o.gte(n.resource.value,s(n.cost))),n})}function tr(e){return Je(()=>({requirementMet:w(()=>Ge(e.visibility)),visibility:Ce.None,requiresPay:!1}))}function Pd(e,t){return Je(()=>({requirementMet:ve(e),partialDisplay:t==null?void 0:J(()=>kt(t)),display:t==null?void 0:J(()=>p(re,null,[T("Req: "),kt(t)])),visibility:t==null?Ce.None:Ce.Visible,requiresPay:!1}))}function Mi(e){if(Rt(e))return e.every(Mi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function ea(e){if(Rt(e))return e.map(ea).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function Si(e,t=1){var n,i;if(Rt(e)&&(e=e.filter(r=>Ge(r.visibility)),e.length===1&&(e=e[0])),Rt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(re,null,[r.length>0?p("div",null,[T("Costs:")," ",gr(r.map(l=>l.partialDisplay(t)),p(re,null,[T(", ")]))]):null,a.length>0?p("div",null,[T("Requires:")," ",gr(a.map(l=>l.partialDisplay(t)),p(re,null,[T(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(re,null,null)}function ta(e,t=1){var n;Rt(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var Td=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:O(Object,String,Function),earned:{type:O(Boolean),required:!0},requirements:O(Object,Array),image:O(String),style:O(String,Object,Array),classes:O(Object),mark:O(Boolean,String),small:O(Boolean),id:{type:String,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,requirements:n,earned:i}=Pe(e),r=ht("");return It(()=>{const a=$e(t);if(a==null){r.value="";return}if(xt(a)){r.value=de(a);return}const l=de(a.requirement?a.requirement:J(()=>{var d;return Si((d=$e(n))!=null?d:[])}),"h3"),u=de(a.effectDisplay||"","b"),c=$e(i)?de(a.optionsDisplay||"","span"):"";r.value=de(J(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Dd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:be({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(M(),te(Xe(e.comp),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):z("",!0)}var Ad=pe(Td,[["render",Dd],["__scopeId","data-v-5673325a"]]);const Rd=wi(),Fd=Symbol("Achievement");let En=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Od(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var c,d,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=nn("achievement-"),a.type=Fd,a[yt]=Ad;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,g;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const C=s(f.display);let _;xt(C)?_=de(C):C.requirement!=null?_=de(C.requirement):_=Si((g=f.requirements)!=null?g:[]),Rd.info(p("div",null,[p("h3",null,[T("Treasure earned!")]),p("div",null,[p(_,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),se(a,"visibility",Ce.Visible);const l=a.visibility;a.visibility=_a(()=>{const f=s(a.display);switch(ue.msDisplay){default:case En.All:return s(l);case En.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?Ce.None:s(l);case En.Incomplete:return s(a.earned)?Ce.None:s(l);case En.None:return Ce.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),se(a,"showPopups",!0);for(const f of t)(v=f.postConstruct)==null||v.call(f,a);const u=t.reduce((f,h)=>{var g;return Object.assign(f,(g=h.getGatheredProps)==null?void 0:g.call(h,a))},{});if(a[pt]=function(){const{visibility:f,display:h,requirements:g,earned:C,image:_,style:I,classes:P,mark:S,small:D,id:V}=this;return{visibility:f,display:h,requirements:g,earned:C,image:_,style:s(I),classes:P,mark:S,small:D,id:V,...u}},a.requirements){const f=a,h=[tr(f),Pd(()=>!f.earned.value),...Rt(a.requirements)?a.requirements:[a.requirements]];It(()=>{ue.active===K.id&&Mi(h)&&f.complete()})}return a})}Ye.on("loadSettings",e=>{se(e,"msDisplay",En.All)});const qd=Object.values(En).map(e=>({label:tt(e),value:e}));Ps(J(()=>p(Qi,{title:J(()=>p("span",{class:"option-title"},[T("Show achievements"),p("desc",null,[T("Select which achievements to display based on criterias.")])])),options:qd,"onUpdate:modelValue":e=>ue.msDisplay=e,modelValue:ue.msDisplay},null)));const Vd=Y({props:{progress:{type:O(String,Object,Number),required:!0},width:{type:O(Number),required:!0},height:{type:O(Number),required:!0},direction:{type:O(String),required:!0},display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),borderStyle:O(Object,String,Array),textStyle:O(Object,String,Array),baseStyle:O(Object,String,Array),fillStyle:O(Object,String,Array),mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ei,Node:ti},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=Pe(e),l=w(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=w(()=>{const d={width:$e(n)+.5+"px",height:$e(i)+.5+"px"};switch(s(r)){case G.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=$e(n)+1+"px";break;case G.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=$e(n)+1+"px";break;case G.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case G.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case G.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=An(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Bd(e,t,n,i,r,a){var c,d,v,f,h,g,C;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:be({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),A("span",{key:0,class:"overlayText",style:je(e.unref(e.textStyle))},[(M(),te(Xe(e.component)))],4)):z("",!0)],4),N("div",{class:"border",style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(v=e.unref(e.style))!=null?v:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[N("div",{class:"fill",style:je([e.barStyle,(g=e.unref(e.style))!=null?g:{},(C=e.unref(e.fillStyle))!=null?C:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):z("",!0)}var Ld=pe(Vd,[["render",Bd],["__scopeId","data-v-6bd06b56"]]);const jd=Symbol("Bar");function zd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Je(i=>{var l,u;const r=e.call(i,i);r.id=nn("bar-"),r.type=jd,r[yt]=Ld;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var v;return Object.assign(c,(v=d.getGatheredProps)==null?void 0:v.call(d,r))},{});return r[pt]=function(){const{progress:c,width:d,height:v,direction:f,display:h,visibility:g,style:C,classes:_,borderStyle:I,textStyle:P,baseStyle:S,fillStyle:D,mark:V,id:oe}=this;return{progress:c,width:d,height:v,direction:f,display:h,visibility:g,style:s(C),classes:_,borderStyle:I,textStyle:P,baseStyle:S,fillStyle:D,mark:V,id:oe,...a}},r})}function Ud(e,...t){return Je(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=w(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=w(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=w(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),se(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function Gd(e){return Ud(e)}function Wd(e,t,n=1,i=o.dInf){const r=ve(n),a=ve(i);e.on("preUpdate",l=>{const u=s(r);o.neq(u,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(u,l).times(o.ceil(s(t.actualGain)))).min(s(a)).max(t.gainResource.value))})}const Hd={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),$(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=w(()=>{var t;return o.add(s((t=e.amount)!=null?t:0),s(e.bonusAmount))}))}},na=Symbol("Repeatable");function hr(e,...t){const n=dt(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var h,g,C;const a=e.call(r,r);a.id=nn("repeatable-"),a.type=na,a[yt]=Kr;for(const _ of t)(h=_.preConstruct)==null||h.call(_,a);a.amount=n,a.amount[tn]=(g=a.initialAmount)!=null?g:0,Object.assign(a,i);const l={requirementMet:w(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:Ce.None,canMaximize:!0},u=tr(a);Rt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=w(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=w(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=w(()=>o.clampMin(ea(a.requirements),1)),a.canClick=w(()=>Mi(a.requirements));const d=a.onClick;a.onClick=function(_){var S;const I=a;if(!s(I.canClick))return;const P=(S=s(a.amountToIncrease))!=null?S:1;ta(a.requirements,P),I.amount.value=o.add(I.amount.value,P),d==null||d(_)},$(a,"display");const v=a.display;a.display=J(()=>{var I,P,S;const _=s(v);if(xt(_)){const D=de(_);return p(D,null,null)}if(_!=null){const D=a,V=de((I=_.title)!=null?I:"","h3"),oe=de((P=_.description)!=null?P:""),le=de((S=_.effectDisplay)!=null?S:"");return p("span",null,[_.title==null?null:p("div",null,[p(V,null,null)]),_.description==null?null:p(oe,null,null),_.showAmount===!1?null:p("div",null,[p("br",null,null),p(re,null,[T("Amount: "),ft(D.amount.value)]),o.isFinite(s(D.limit))?p(re,null,[T(" / "),ft(s(D.limit))]):void 0]),_.effectDisplay==null?null:p("div",null,[p("br",null,null),T("Currently: "),p(le,null,null)]),D.maxed.value?null:p("div",null,[p("br",null,null),Si(D.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),se(a,"visibility",Ce.Visible),$(a,"limit"),se(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const _ of t)(C=_.postConstruct)==null||C.call(_,a);const f=t.reduce((_,I)=>{var P;return Object.assign(_,(P=I.getGatheredProps)==null?void 0:P.call(I,a))},{});return a[pt]=function(){const{display:_,visibility:I,style:P,classes:S,onClick:D,canClick:V,small:oe,mark:le,id:Q}=this;return{display:_,visibility:I,style:s(P),classes:S,onClick:D,canClick:V,small:oe,mark:le,id:Q,...f}},a})}const Zd=Symbol("Reset");function Xd(e){return Je(t=>{const n=e.call(t,t);return n.id=nn("reset-"),n.type=Zd,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object")if(tn in a){const l=a;l.value=l[tn]}else!(a instanceof o)&&!Oe(a)&&Object.values(a).forEach(l=>i(l))};s(n.thingsToReset).forEach(i),Ye.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const ci={};Ye.on("removeLayer",e=>{var t;(t=ci[e.id])==null||t.call(ci),ci[e.id]=void 0});function Vi(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),se(t,"direction",G.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=dt(!1,!1)),Gt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,qr(t.pinned)):e.pinned=t.pinned);const n=e[yt];e[yt]=Fe;const i=e[pt].bind(e);e[pt]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:v,pinned:f}=this;return{element:{[yt]:n,[pt]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:v,pinned:f}}.bind(t)}),t}var Yd=Y({props:{display:{type:O(String,Object,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),requirements:{type:Object,required:!0},canPurchase:{type:O(Boolean),required:!0},bought:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,requirements:n,bought:i}=Pe(e),r=ht("");return It(()=>{const a=$e(t);if(a==null){r.value="";return}if(xt(a)){r.value=de(a);return}const l=de(a.title||"","h3"),u=de(a.description,"div"),c=de(a.effectDisplay||"");r.value=de(J(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[T("Currently: "),p(c,null,null)]):null,i.value?null:p(re,null,[p("br",null,null),Si(n.value)])])))}),{component:r,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});const Jd=["disabled"];function Kd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:be({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(M(),te(Xe(e.unref(e.component)),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Jd)):z("",!0)}var Qd=pe(Yd,[["render",Kd],["__scopeId","data-v-9be6bac0"]]);const nr=Symbol("Upgrade");function br(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var c,d;const a=e.call(r,r);a.id=nn("upgrade-"),a.type=nr,a[yt]=Qd;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=w(()=>!n.value&&Mi(a.requirements)),a.purchase=function(){var f;const v=a;!s(v.canPurchase)||(ta(a.requirements),n.value=!0,(f=v.onPurchase)==null||f.call(v))};const l=tr(a);Rt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),se(a,"visibility",Ce.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const v of t)(d=v.postConstruct)==null||d.call(v,a);const u=t.reduce((v,f)=>{var h;return Object.assign(v,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[pt]=function(){const{display:v,visibility:f,style:h,classes:g,requirements:C,canPurchase:_,bought:I,mark:P,id:S,purchase:D}=this;return{display:v,visibility:f,style:s(h),classes:g,requirements:C,canPurchase:_,bought:I,mark:P,id:S,purchase:D,...u}},a})}function ef(e,t,n=[]){n=n.length===0?Jn(e,nr):n;const i=Xn(t)?w(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function tf(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const nf={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},yr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Bi(e){const t=yr[Math.floor(e()*yr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const _r=wi();function ia(e,t,n,i){return Ji(e,function(){const r=tf(0,n>>0,n>>32,1);for(let q=0;q<12;q++)r();const a=Bi(r),l=jn([.64,.75,.55],r),u=jn([.18,.2,.25],r),c=$n(0,Bi(r)),d=dt(0),v=Lt.indexOf(t);let f=r();const h=i.reduce((q,L)=>(q[L.type]=L.data,q),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const g=f+v+1,C=y.toolNodes.value.sandRelic!=null?ie("sandRelic")?2:1:0,_=dt(C),I=w(()=>("increaseRewards"in h?g+1:g)+_.value);let P="relic"in h?v+2:Math.ceil(r()*(v+2));"increaseLength"in h&&P++;const S=[],D=_t(()=>S),V=w(()=>D.apply(0)),oe=[],le={};function Q({feature:q,canClick:L,modifier:Se,cost:Qe,previewModifier:kn,showETA:ze,previewCost:$t}){L=ve(L),ze=ve(ze);const Vt=mr(q);oe.push({shouldShowPreview:w(()=>s(L)&&Vt.value),modifier:_t(()=>{const Et=S.slice();return Et.splice(Et.indexOf(Se),1,kn),Et}),cost:$t!=null?$t:Qe}),S.push(Se);const Bt=Oi(c,V,()=>ke(Qe)),nt=Vi(q,{display:ze==null?Bt:()=>s(ze)?Bt.value:"",direction:G.Down});return{isHovering:Vt,eta:Bt,tooltip:nt}}const Z=[],fe=U(0);let B=m.variable(fe).times(0);const ae={};let Te=!0;const He=w(()=>o.add(g,r()-.5).pow_base(2).times(10).times(B.evaluate())),Xt=[];for(let q=0;q=P-1?0:1};switch(di(L,r)){case"upgrades":const F=[];for(let Ie=0;Ie<4;Ie++){const ot=di({add:1,mult:q===0&&Ie===0?0:1},r),et=He.value,lt=xn(r);let gt="",De,Ae;const Re=fe.value;switch(ot){case"add":{const _e=o.add(et,10).pow(r()/4+.875);gt=`Gain ${Me(_e)} ${c.displayName}/s`,B=B.add(_e),De=it=>zt(()=>({addend:_e,description:lt,enabled:it==null?Be.bought:()=>it()&&Be.bought.value})),Ae=zt(()=>({addend:_e}));break}case"mult":{const _e=r()*5+1;gt=`Multiply previous ${c.displayName} gain by x${Me(_e)}.`,B=B.add(o.sub(_e,1).times(ae[Re-1])),De=it=>we(()=>({multiplier:_e,description:lt,enabled:it==null?Be.bought:()=>it()&&Be.bought.value})),Ae=we(()=>({multiplier:_e}));break}}ae[fe.value]=B.evaluate(),fe.value++;const Ve=Te,Be=br(()=>({requirements:Ln(()=>({resource:In(c),cost:et})),display:{title:lt,description:gt},visibility:Ve}));Q({feature:Be,canClick:()=>Be.canPurchase.value,modifier:De(),cost:et,showETA:()=>!Be.bought.value,previewModifier:Ae}),S.push(De(()=>ot==="add"?y.toolNodes.value.stoneRelic!=null:ie("stoneRelic"))),F.push(Be)}Z.push(F);break;case"repeatables":const j=[];for(let Ie=0;Ie<3;Ie++){const ot=di({add:1.5,mult:3},r),et=fe.value,lt=He.value,gt=xn(r);let De="",Ae,Re,Ve,Be;const _e=m.variable(w(()=>Ne.amount.value)).times(2);switch(ot){case"add":{const xe=o.add(lt,10).times(r()+.5);De=`Gain ${Me(xe)} ${c.displayName}/s`,Be=_e.add(1).times(1.5).times(lt),B=B.add(w(()=>o.sub(fe.value,et).add(1).times(5).times(xe))),Ae=w(()=>Me(o.times(xe,s(Ne.totalAmount)))+"/s"),Re=zt(()=>({addend:()=>o.times(xe,s(Ne.totalAmount)),description:gt,enabled:()=>o.gt(s(Ne.totalAmount),0)})),Ve=zt(()=>({addend:()=>o.add(s(Ne.totalAmount),Ne.amountToIncrease.value).times(xe)}));break}case"mult":{const xe=r()*.75+1.25;De=`Multiply previous ${c.displayName} gain by x${Me(xe)}.`,Be=_e.pow_base(o.times(xe,1.5)).times(lt),B=B.add(w(()=>o.sub(fe.value,et).add(1).times(5).pow_base(xe).sub(1).times(ae[et-1]))),Ae=w(()=>"x"+Me(o.pow(xe,s(Ne.totalAmount)))),Re=we(()=>({multiplier:()=>o.pow(xe,s(Ne.totalAmount)),description:gt,enabled:()=>o.gt(s(Ne.totalAmount),0)})),Ve=we(()=>({multiplier:()=>o.add(s(Ne.totalAmount),Ne.amountToIncrease.value).pow_base(xe)}));break}}ae[fe.value]=B.evaluate(),fe.value++;const it=Te,Ne=hr(()=>({requirements:Ln(()=>({resource:In(c),cost:Be,maxBulkAmount:()=>y.toolNodes.value.diamondRelic!=null?o.dInf:1})),display:()=>({title:gt,description:`${De}

Amount: ${ft(Ne.amount.value)}${o.gt(s(Ne.bonusAmount),0)?` [+${ft(s(Ne.bonusAmount))}]`:""}`,effectDisplay:s(Ae),showAmount:!1}),visibility:it,limit:100,bonusAmount:()=>o.gt(Ne.amount.value,0)?ie("dirtRelic")?2:y.toolNodes.value.dirtRelic!=null?1:0:0}),Hd);Q({feature:Ne,canClick:()=>s(Ne.canClick),modifier:Re,cost:w(()=>gn(Be,Ne.amountToIncrease.value)),previewModifier:Ve,showETA:()=>!Ne.maxed.value}),j.push(Ne)}Z.push(j);break;case"conversion":const W=$n(0,Bi(r)),ee=jn([.64,.75,.55],r),sn=He.value,li=r()/2+.25,Bn=r()/2+.25,Mn=fe.value;B=B.add(w(()=>o.sub(fe.value,Mn).add(1).pow10().times(ae[Mn-1])));const Pt=Gd(()=>({baseResource:In(c),gainResource:W,formula:Ie=>Ie.div(sn).pow(li).times(w(()=>y.toolNodes.value.ironRelic!=null?ie("ironRelic")?4:2:1)),spend(){c.value=0}}));ae[fe.value]=B.evaluate(),fe.value+=4;const ra=Te,rr=xn(r),Ti=m.variable(W).pow(Bn).add(1),aa=we(()=>({multiplier:()=>Ti.evaluate(),description:rr,enabled:()=>o.gt(W.value,0)})),sa=we(()=>({multiplier:()=>Ti.evaluate(o.add(W.value,Pt.actualGain.value))})),Sn=Cd(()=>({display:{title:rr,description:J(()=>p("span",null,[T("Reset "),c.displayName,T(" for")," ",bi(W,o.clampMin(Pt.actualGain.value,1))," ",W.displayName,p("br",null,null),p("div",null,[T("Next:")," ",bi(c,o.lt(Pt.actualGain.value,1)?Pt.currentAt.value:Pt.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(Pt.actualGain.value,1),prestigeResource:W,onClick:Pt.convert,visibility:ra})),{isHovering:oa}=Q({feature:Sn,canClick:()=>s(Sn.canClick),modifier:aa,cost:sn,previewCost:c,previewModifier:sa}),ar=w(()=>oa.value&&Sn.canClick.value);Z.push([Sn]);const la=cn(m.variable(W),ar,Pt.actualGain),ua=cn(Ti,ar,Pt.actualGain);le[q*2]=J(()=>p(re,null,[Ge(Sn.visibility)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:ee,textShadow:`0px 0px 10px ${ee}`}},[la()])," ",W.displayName,T(","),p("br",null,null),T("providing a "),ua(),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,Fi(Sn)])),Wd(this,Pt,()=>Ke.value.lengthgn(Ae,Re.value,!0,10)),Be=w(()=>gn(Ae,o.add(Re.value,1),!0,10)),_e=w(()=>o.pow(De,Re.value)),it=we(()=>({multiplier:_e,description:et,enabled:()=>Ge(xe.visibility)}));B=B.add(w(()=>o.sub(fe.value,ot).add(1).times(3).pow(De).times(ae[ot-1]))),ae[fe.value]=B.evaluate(),fe.value+=3;const Ne=jn([.18,.2,.25],r),xe=zd(()=>({direction:G.Right,width:300,height:20,progress:()=>o.sub(Ie.value,Ve.value).div(o.sub(Be.value,Ve.value)).toNumber(),visibility:st,xp:Ie,display:J(()=>p("span",null,[Me(Ie.value),T("/"),Me(Be.value)])),fillStyle:`background-color: ${Ne}`}));this.on("preUpdate",Di=>{if(Ke.value.lengthut.state.id===e)&&Ge(xe.visibility)){let ut=o.times(Ot.value,Di);y.toolNodes.value.goldRelic!=null&&(ut=o.times(ie("goldRelic")?.2:.1,Ke.value.length).add(1).times(ut)),Ie.value=o.add(ut,Ie.value)}}),S.push(it),Z.push([xe]),le[q*2]=J(()=>p(re,null,[Ge(xe.visibility)?p("div",{style:"margin: 10px"},[T("You have "),p("h3",null,[et]),T(" Lv. "),ft(Re.value),T(","),p("br",null,null),T("providing a "),Me(_e.value),T("x multiplier to previous")," ",c.displayName,T(" gain"),p("br",null,null)]):null,Fi(xe)]));break}case"dimensions":{const Ie=xn(r),st=$n(0,Ie+" energy"),ot=jn([.64,.75,.55],r),et=fe.value;B=B.add(w(()=>o.sub(fe.value,et).add(1).pow_base(32).add(1).log2().add(1).times(ae[et-1])));const lt=w(()=>o.add(st.value,1).log2().add(1)),gt=we(()=>({multiplier:lt,description:Ie,enabled:()=>o.gt(st.value,0)}));S.push(gt);const De=Te,Ae=[];for(let Re=0;Re<4;Re++){const Ve=o.add(g,r()-.5).pow_base(2).times(10).recip(),Be=He.value,_e=m.variable(w(()=>ut.amount.value)),it=_e.pow_base(o.pow10(Re+1)).times(Be),Ne=["First","Second","Third","Fourth"][Re]+" "+Ie+" Dimension",xe=$n(0,Ne),Di=_e.sub(1).pow_base(2).times(Ve).times(w(()=>o.add(ut.amount.value,xe.value))),ut=hr(()=>({display:{title:Ne,description:J(()=>p("div",null,[p("div",null,[T("Amount:")," ",Me(o.add(xe.value,ut.amount.value))," ",T("["),ft(ut.amount.value),T("]")])])),effectDisplay:J(()=>p("span",null,[fa()," ",Re===0?st.displayName:["First","Second","Third","Fourth"][Re-1]+" "+Ie+" Dimension",T("/s")])),showAmount:!1},style:{width:"400px"},effect:Di,dimensions:xe,limit:100,energy:Re===0?st:void 0,requirements:Ln(()=>({resource:In(c),cost:it,maxBulkAmount:()=>ie("diamondRelic")!=null?o.dInf:1})),visibility:De}));Ae.push(ut);const ca=mr(ut),sr=w(()=>s(ut.canClick)&&ca.value),da=new m({inputs:[_e],evaluate(or){return o.sub(or,1).pow_base(2).times(Ve).times(o.add(or,xe.value))}}),fa=cn(da,sr);oe.push({shouldShowPreview:sr,cost:it});const pa=Oi(c,V,()=>ke(it));Vi(ut,{display:pa,direction:G.Down}),ae[fe.value]=B.evaluate(),fe.value++}this.on("preUpdate",Re=>{if(Ke.value.lengthVe.state.id===e)&&Ge(De)){let Ve=o.times(Ot.value,Re);y.toolNodes.value.platinumRelic!=null&&(Ve=o.times(ie("platinumRelic")?4:2,Ve));const Be=Ae[0].effect.evaluate();st.value=o.times(Be,Ve).add(st.value);for(let _e=1;_e<4;_e++){const it=Ae[_e].effect.evaluate();Ae[_e-1].dimensions.value=o.times(it,Ve).add(Ae[_e-1].dimensions.value)}}}),Z.push(Ae),le[q*2]=J(()=>p(re,null,[Ge(De)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:ot,textShadow:`0px 0px 10px ${ot}`}},[Me(st.value)])," ",st.displayName,T(","),p("br",null,null),T("providing a "),Me(lt.value),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,qs(...Ae)]));break}case"prestige":{const Ie=xn(r),st=Te,ot=r()/2+1.25,et=He.value;B=B.pow(ot);const lt=dd(()=>({exponent:ot,description:Ie,enabled:De.bought}));ae[fe.value]=B.evaluate(),fe.value++;const gt=Xd(()=>({thingsToReset:Z.filter((Re,Ve)=>Ve%2===0),onReset(){c.value=0}})),De=br(()=>({display:{title:Ie,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${Me(ot)}`},style:{width:"200px",minHeight:"100px"},onPurchase:gt.reset,visibility:st,requirements:Ln(()=>({resource:In(c),cost:et}))})),Ae=we(()=>({multiplier:0}));Q({feature:De,canClick:()=>s(De.canPurchase),modifier:lt,cost:et,previewCost:c,previewModifier:Ae,showETA:()=>!s(De.bought)}),Z.push([De]);break}}const Qe={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(y.influenceNodes.value).length+Xt.length===Object.keys(Nt).length?0:"increaseInfluences"in h?20:2,relic:0};let kn=di(Qe,r);q===P-1&&"relic"in h&&(kn="relic");let ze="",$t,Vt,Bt,nt,Et,an;switch(kn){case"cache":nt=Li(r,i),ze=`Gain ${Me(o.div(I.value,12))}x your current ${nt} (no modifiers).`,Vt=()=>{var W,ee,sn;return y.grantResource(nt,o.times((sn=(ee=(W=y.resourceNodes.value[nt])==null?void 0:W.state)==null?void 0:ee.amount)!=null?sn:0,o.div(I.value,12)))};break;case"generation":nt=Li(r,i);const F=o.div(I.value,40).times(St[nt]);ze=`Gain ${Me(F)} ${nt}/s while plane is active.`,$t=W=>y.grantResource(nt,o.times(W,F)),Bt=w(()=>y.resourceNodes.value[nt]);break;case"resourceMulti":Et=nt=Li(r,i),an=o.div(I.value,10).pow_base(2),ze=`Gain ${Me(an)}x ${nt} while plane is active.`;break;case"energyMulti":Et="energy",an=o.div(I.value,8).add(1),ze=`Gain ${Me(an)}x energy while plane is active.`;break;case"influences":const j=Object.keys(Nt)[Math.floor(r()*Object.keys(Nt).length)];Xt.push(j),ze=`Gain a new portal influence (${Nt[j].display})`,Vt=()=>{if(j in y.influenceNodes.value){_r.warning(`Error: ignoring duplicate portal influence (${Nt[j].display})`);return}const W={id:Qn(y.board),position:{...y.board.types.portal.nodes.value.find(ee=>ee.state.id===e).position},type:"influence",state:{type:j,data:Nt[j].initialData}};y.board.placeInAvailableSpace(W),y.board.nodes.value.push(W)};break;case"relic":ze=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Tt[t]})`,Vt=()=>{if(t==="ultimatum"){ir.value=!0;return}if(`${t}Relic`in y.toolNodes.value)_r.warning(`Error: ignoring duplicate relic (${Tt[t]})`);else{const W={id:Qn(y.board),position:{...y.board.types.portal.nodes.value.find(ee=>ee.state.id===e).position},type:"passive",state:`${t}Relic`};y.board.placeInAvailableSpace(W),y.board.nodes.value.push(W)}}}const oi=Te,Vn=He.value,x=Od(()=>({requirements:Ln(()=>({resource:In(c),cost:Vn})),visibility:oi,display:{requirement:`${Me(Vn)} ${c.displayName}`,effectDisplay:ze},style:"width: 100%",classes:{final:q===P-1},update:$t,onComplete:Vt,link:Bt,effectedResource:Et,resourceMulti:an})),E=Oi(c,V,Vn);Vi(x,{display:()=>x.earned.value?"":E.value,direction:G.Down}),Z.push([x]),Te=x.earned}const at=Jn(Z,nr),Fn=Jn(Z,na);S.push(we(()=>({multiplier:()=>ie("silver")?4:2,description:()=>(ie("silver")?"Empowered ":"")+Le.silver.name,enabled:()=>y.toolNodes.value.silver!=null})),we(()=>({multiplier:()=>o.add(1,(ie("diamond")?2:1)*at.filter(q=>q.bought.value).length/10),description:()=>(ie("diamond")?"Empowered ":"")+Le.diamond.name,enabled:()=>y.toolNodes.value.diamond!=null})),we(()=>({multiplier:()=>o.div(d.value,6e3).times(ie("emerald")?2:1).add(1),description:()=>(ie("emerald")?"Empowered ":"")+Le.emerald.name,enabled:()=>y.toolNodes.value.emerald!=null})),we(()=>({multiplier:()=>o.div(Fn.reduce((q,L)=>q.add(s(L.totalAmount)),o.dZero),100).times(ie("gravelRelic")?2:1).add(1).pow(.75),description:()=>(ie("gravelRelic")?"Empowered ":"")+Tt.gravel,enabled:()=>y.toolNodes.value.gravelRelic!=null})));const Nn=_t(()=>[we(()=>({multiplier:()=>{var q,L,Se;return o.add((Se=(L=(q=y.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:L.level)!=null?Se:0,1)},description:"Booster",enabled:()=>{var q,L,Se;return(Se=(L=(q=y.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:L.portals.includes(e))!=null?Se:!1}})),we(()=>({multiplier:()=>o.times(ie("coalRelic")?.2:.1,Ke.value.length).add(1),description:()=>(ie("coalRelic")?"Empowered ":"")+Tt.coal,enabled:()=>y.toolNodes.value.coalRelic!=null})),we(()=>({multiplier:()=>o.add(y.energy.value,1).log10().add(1).pow(ie("beryliumRelic")?.5:.25),description:()=>(ie("beryliumRelic")?"Empowered ":"")+Tt.berylium,enabled:()=>y.toolNodes.value.beryliumRelic!=null}))]),Ot=w(()=>Nn.apply(1)),[xi,ii]=Wn(()=>[{title:`${tt(c.displayName)} Gain`,modifier:D,base:0,unit:"/s"},{title:`${tt(c.displayName)} Time Speed`,modifier:Nn,base:1,visible:()=>o.gt(Ot.value,1)}]),Cn=U(!1),ri=J(()=>p(Ht,{modelValue:Cn.value,"onUpdate:modelValue":q=>Cn.value=q},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>rt(xi)}));this.on("preUpdate",q=>{if(!y.activePortals.value.some(Se=>Se.state.id===e))return;const L=o.times(Ot.value,q);d.value=o.add(d.value,L),Ke.value.length{var Qe;(Qe=Se.update)==null||Qe.call(Se,L)})}),ef(this,()=>Ke.value.lengthKe.value.length{const q=oe.find(L=>L.shouldShowPreview.value);return q?o.neg(ke(q.cost)):0}),qt=w(()=>{const q=oe.find(L=>L.shouldShowPreview.value);return q&&q.modifier?o.sub(q.modifier.apply(0),V.value):0}),qn=cn(m.variable(0).add(c),()=>o.neq(On.value,0),On),ai=cn(m.variable(0).add(V),()=>o.neq(qt.value,0),qt),si=w(()=>{const q=[];return Ke.value.forEach(L=>{L.link&&q.push(L.link)}),q}),$i=w(()=>{const q={};return Ke.value.forEach(L=>{L.effectedResource!=null&&L.resourceMulti!=null&&(q[L.effectedResource]!=null?q[L.effectedResource]=o.times(q[L.effectedResource],L.resourceMulti):q[L.effectedResource]=L.resourceMulti)}),q}),Ke=w(()=>{const q=[];for(let L=1;Lo.lt(Ke.value.length,P)&&Z.some(q=>q.some(L=>"earned"in L&&s(L.earned)||"bought"in L&&s(L.bought)?!1:("canClick"in L&&s(L.canClick)||"canPurchase"in L&&s(L.canPurchase),!0)))),Pi=w(()=>{const q=Z.findIndex((Se,Qe)=>Qe>0&&Qe%2===0&&!Z[Qe-1][0].earned.value);let L;return q===-1?L=Z:L=Z.slice(0,q),L.map((Se,Qe)=>Qe in le?rt(le[Qe]):Fi(...Se))});return{tier:dt(t),seed:dt(n),influences:dt(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:Z,resourceTabCollapsed:ii,links:si,resourceMultis:$i,earnedTreasures:Ke,showNotif:Ei,timeActive:d,bonusRewardsLevel:_,display:J(()=>p(re,null,[p(hi,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,T("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Fe,{display:i.map(q=>{const L=Nt[q.type].description;return typeof L=="function"?L(q):L}).join("
"),direction:G.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,T(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>Cn.value=!0},[T("modifiers")])])]}),p(hi,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[rt(qn)])," ",c.displayName]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(V.value,0)?"+":"",rt(ai)]),T("/s)")]),o.neq(Ot.value,1)?p("span",{class:"nav-segment"},[T("Speed: "),Me(Ot.value),T("x")]):null]}),p(Ed,{height:"60px"},null),Pi.value,rt(ri)])),minimizedDisplay:J(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",Ke.value.length,T("/"),P,T(" treasures")])]))}})}function Li(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(St).reduce((u,c)=>{let d=St[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(St),r=Math.floor(e()*n);let a=0,l;for(let u=0;uu+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;ue===y.board.selectedNode.value?{text:"Mining"}:Object.keys(y.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[Ft],progress:e=>ye(e)?new o(e.state.progress).toNumber():0,progressDisplay:vn.Outline,progressColor:"var(--accent2)",classes:e=>({running:ye(e)}),draggable:!0},lf={shape:We.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===y.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(y.energy.value,100)&&(e.type="factory",y.energy.value=o.sub(y.energy.value,100))},confirmationLabel:()=>o.gte(y.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},uf={shape:We.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===y.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Le[e.state].name}`};if(((t=y.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=y.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":Le[i].name,a=e.state===i||y.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Le[e.state].name} - ${Ze(Le[e.state].cost)} energy`}),onClick(e){const t=Le[e.state];if(o.gte(y.energy.value,t.cost)&&y.toolNodes.value[e.state]==null){y.energy.value=o.sub(y.energy.value,t.cost);const n={id:Qn(y.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};y.board.placeInAvailableSpace(n),y.board.nodes.value.push(n),y.board.selectedAction.value=null,y.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(y.energy.value,Le[e.state].cost)&&y.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(y.energy.value,Le[e.state].cost)?y.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||y.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(y.energy.value),o.sqrt(Le[e.state].cost)).clampMax(1).toNumber(),progressDisplay:vn.Fill,progressColor:e=>e.state!=null&&o.gte(y.energy.value,Le[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,y.board.selectedNode.value=e},draggable:!0},cf=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],df={shape:We.Circle,size:50,title:e=>tt(e.state.type)+" ("+cf[Lt.indexOf(e.state.type)]+")",subtitle:e=>Ze(e.state.amount),progress:e=>md(e.state.type),onClick(){},progressDisplay:vn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":y.dowsing.value!=null&&ye(y.dowsing.value)&&y.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=y.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},ff={shape:We.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Tt[t.slice(0,-5)]:Le[t].name},label:e=>e===y.board.selectedNode.value?{text:$d[e.state].description(ie(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":ie(e.state)}),draggable:!0},pf={shape:We.Diamond,size:50,title:"\u{1F962}",label:e=>e===y.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Xr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(2).pow_base(100),16),Ft],classes:e=>({running:ye(e)}),canAccept:Yr,onDrop:Jr,draggable:!0},gf={shape:We.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===y.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Xr(e,t=>`Gather ${bt(o.div(y.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(2).pow_base(1e4),16),Ft],progress:e=>ye(e)?o.eq(y.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(y.quarryProgressRequired.value).toNumber():0,progressDisplay:vn.Outline,progressColor:"var(--accent2)",canAccept:Yr,onDrop:Jr,classes:e=>({running:ye(e)}),draggable:!0},mf={shape:We.Diamond,size:50,title:"\u{1F50C}",label:e=>e===y.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:fd(e,t=>t.includes("Relic")?`Double ${Tt[t.slice(0,-5)]}'s effect`:`Double ${Le[t].name}'s effect`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(3).pow_base(1e3),24),Ft],canAccept:pd,onDrop:gd,classes:e=>({running:ye(e)}),draggable:!0},vf={shape:We.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===y.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=y.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${tt(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal - ${Ze(y.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(y.energy.value,y.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(y.energy.value,y.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(y.energy.value,y.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in he;)t++;y.energy.value=o.sub(y.energy.value,y.computedPortalCost.value);const{tier:n,influences:i}=e.state;Ki(ia(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>y.influenceNodes.value[a].state)),K);const r={id:Qn(y.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};y.board.placeInAvailableSpace(r),y.board.nodes.value.push(r),y.board.selectedAction.value=null,y.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}y.board.selectedNode.value=e},draggable:!0},hf={shape:We.Diamond,size:50,title:"\u{1F300}",label:e=>e===y.board.selectedNode.value?{text:`Portal to ${he[e.state.id].name}`,color:he[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[Ft],classes:e=>({running:ye(e),showNotif:he[e.state.id].showNotif.value,"affected-node":y.booster.value!=null&&ye(y.booster.value)&&y.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>he[e.state.id].background,draggable:!0},bf={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?We.Diamond:We.Circle,size:50,title:e=>Nt[e.state.type].display,label:e=>{if(e===y.board.selectedNode.value){const n=e.state,i=Nt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=y.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${tt(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${tt(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[rn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},y.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},yf={shape:We.Diamond,size:50,title:"\u231B",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ze(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Boost ${he[t].name}'s speed`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ze(qi.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(y.energy.value,qi.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=qi.evaluate(e.state.level);o.gte(y.energy.value,t)&&(y.energy.value=o.sub(y.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},y.board.selectedAction.value=null)}},Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},wf={shape:We.Diamond,size:50,title:"\u{1F916}",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(4).pow_base(1e6)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},_f={shape:We.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Automator - Drag a portal to me!":`Automatating (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(4).pow_base(1e6)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},Nf={shape:We.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Investments - Drag a portal to me!":`Investing (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(3).pow_base(1e8)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},Nr=wi(),Cf={mine:of,brokenFactory:lf,factory:uf,resource:df,passive:ff,dowsing:pf,quarry:gf,empowerer:mf,portalGenerator:vf,portal:hf,influence:bf,booster:yf,upgrader:wf,automator:_f,investments:Nf},y=Ji("main",function(){const e=$n(0,"energy"),t=w(()=>g.types.resource.nodes.value.reduce((x,E)=>(x[E.state.type]=E,x),{})),n=w(()=>({...g.types.passive.nodes.value.reduce((x,E)=>(x[E.state]=E,x),{}),sand:g.types.dowsing.nodes.value[0],wood:g.types.quarry.nodes.value[0],coal:g.types.empowerer.nodes.value[0],iron:g.types.portalGenerator.nodes.value[0],gold:g.types.booster.nodes.value[0],platinum:g.types.upgrader.nodes.value[0],berylium:g.types.automator.nodes.value[0],ultimatum:g.types.investments.nodes.value[0]})),i=w(()=>Object.keys(Tt).filter(x=>`${x}Relic`in n.value).length),r=w(()=>({...g.types.influence.nodes.value.reduce((x,E)=>(x[E.state.type]=E,x),{})})),a=w(()=>({...g.types.portal.nodes.value.reduce((x,E)=>(x[E.state.id]=E,x),{})})),l=w(()=>Lt.reduce((x,E)=>{var j,W,ee;const F=(ee=(W=(j=t.value[E])==null?void 0:j.state)==null?void 0:W.amount)!=null?ee:0;return x[E]=o.floor(zi.invert(F)),x},{})),u=mn({}),c=mn({});Gt(()=>{Lt.forEach(x=>{vt(()=>l.value[x],(E,F)=>{const j=o.sub(E,F);o.gt(j,0)&&(o.gt(j,1)||o.lt(F,100))&&ue.active===K.id&&Nr.info(p("div",null,[p("h3",null,[o.eq(E,1)?`${tt(x)} discovered`:`${tt(x)} is now Level ${ft(E)}`,T("!")]),o.gt(j,1)?p("div",null,[T("Gained "),ft(j),T(" levels")]):null]))})})});const d=w(()=>Z.filter(x=>{var E,F;return(F=(E=x.value)==null?void 0:E.state)==null?void 0:F.powered}).length+g.types.portal.nodes.value.filter(x=>x.state.powered).length),v=w(()=>{let x=d.value;return n.value.copperRelic!=null&&(x--,ie("copperRelic")&&x--),x}),f=w(()=>{const x=v.value;return o.lt(x,0)?0:o.eq(x,0)?10:o.add(x,1).pow_base(100).div(10).times(.99)}),h=w(()=>{if(P.value==null)return 0;let E=P.value.state.resources.reduce((F,j)=>o.div(100,qt[j].computedModifier.value).add(F),o.dZero);return n.value.silverRelic!=null&&(E=o.div(E,o.add(d.value,1)),ie("silverRelic")&&(E=o.div(E,o.add(d.value,1)))),E}),g=xu(x=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:Cf,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const E=[];if(E.push(...Object.keys(u).map(F=>({startNode:C.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),_.value!=null&&_.value.state!=null&&E.push({startNode:_.value,endNode:t.value[_.value.state],stroke:"var(--foreground)",strokeWidth:4}),I.value!=null&&I.value.state.resources.forEach(F=>{E.push({startNode:I.value,endNode:t.value[F],stroke:ye(I.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),P.value!=null&&P.value.state.resources.forEach(F=>{E.push({startNode:P.value,endNode:t.value[F],stroke:"var(--foreground)",strokeWidth:4})}),E.push(...Object.keys(c).map(F=>({startNode:P.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),S.value!=null&&S.value.state.tools.forEach(F=>{E.push({startNode:S.value,endNode:n.value[F],stroke:ye(S.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D.value!=null){const F=D.value.state;F.tier!=null&&E.push({startNode:D.value,endNode:t.value[F.tier],stroke:"var(--foreground)",strokeWidth:4}),F.influences.forEach(j=>{E.push({startNode:D.value,endNode:r.value[j],stroke:"var(--foreground)",strokeWidth:4})}),x.types.portal.nodes.value.forEach(j=>{const W=he[j.state.id];return W.links.value.forEach(ee=>{ee.value!=null&&E.push({startNode:j,endNode:ee.value,stroke:ye(j)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(W.resourceMultis.value).forEach(ee=>{ee!=="energy"&&ee in t.value&&E.push({startNode:j,endNode:t.value[ee],stroke:ye(j)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),E})}return V.value!=null&&V.value.state.portals.forEach(F=>{E.push({startNode:V.value,endNode:a.value[F],stroke:ye(V.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),oe.value!=null&&oe.value.state.portals.forEach(F=>{E.push({startNode:oe.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.forEach(F=>{E.push({startNode:le.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Q.value!=null&&Q.value.state.portals.forEach(F=>{E.push({startNode:Q.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(F=>{const j=F.state;(j.type==="increaseResources"||j.type==="decreaseResources")&&j.data.forEach(W=>{E.push({startNode:F,endNode:t.value[W],stroke:"var(--foreground)",strokeWidth:4})})}),E}})),C=w(()=>g.types.mine.nodes.value[0]),_=w(()=>g.types.factory.nodes.value[0]),I=w(()=>n.value.sand),P=w(()=>n.value.wood),S=w(()=>n.value.coal),D=w(()=>n.value.iron),V=w(()=>n.value.gold),oe=w(()=>n.value.platinum),le=w(()=>n.value.berylium),Q=w(()=>n.value.ultimatum),Z=[C,I,P,S,V,oe,le,Q];function fe(x,E){let F=t.value[x];if(E=o.times(E,qn[x].computedModifier.value),F==null)F={id:Qn(g),position:{...C.value.position},type:"resource",state:{type:x,amount:E}},g.placeInAvailableSpace(F),g.nodes.value.push(F);else{const j=F.state;F.state={...j,amount:o.add(j.amount,E)}}}const B=w(()=>Object.keys(St).reduce((x,E)=>x+new o(qt[E].computedModifier.value).toNumber(),0)),ae=w(()=>{const x={};return g.types.portal.nodes.value.forEach(E=>{if(!ye(E))return;const j=he[E.state.id].resourceMultis.value;Object.keys(j).forEach(W=>{x[W]!=null?x[W]=o.times(x[W],j[W]):x[W]=j[W]})}),x}),Te=_t(()=>Lt.map(x=>zt(()=>({description:()=>tt(x),addend:()=>l.value[x],enabled:()=>o.gt(l.value[x],0)})))),He=w(()=>Te.apply(0)),Xt=_t(()=>[zt(()=>({addend:He,description:"Resource Levels"})),we(()=>({multiplier:()=>o.pow(On.value,He.value),description:()=>`${Ut(On.value,3)}x per Resource Level`})),we(()=>({multiplier:()=>ie("stone")?4:2,description:()=>(ie("stone")?"Empowered ":"")+Le.stone.name,enabled:()=>n.value.stone!=null})),we(()=>({multiplier:()=>{var x;return(x=ae.value.energy)!=null?x:1},description:"Planar Treasures",enabled:()=>{var x;return o.neq((x=ae.value.energy)!=null?x:1,1)}})),zt(()=>({addend:()=>o.pow(100,v.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(v.value,0)}))]),at=w(()=>Xt.apply(0)),Fn=_t(()=>[zt(()=>({addend:()=>ie("unobtainium")?2:1,description:()=>(ie("unobtainium")?"Empowered ":"")+Le.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),Nn=w(()=>Fn.apply(0)),Ot=_t(()=>[we(()=>({multiplier:()=>ie("dirt")?4:2,description:()=>(ie("dirt")?"Empowered ":"")+Le.dirt.name,enabled:()=>n.value.dirt!=null})),we(()=>({multiplier:()=>o.pow(i.value,ie("woodRelic")?2:1),description:()=>(ie("woodRelic")?"Empowered ":"")+Tt.wood,enabled:()=>n.value.woodRelic!=null}))]),xi=w(()=>Ot.apply(1)),ii=_t(()=>[we(()=>({multiplier:()=>ie("gravel")?4:2,description:()=>(ie("gravel")?"Empowered ":"")+Le.gravel.name,enabled:()=>n.value.gravel!=null}))]),Cn=w(()=>ii.apply(1)),ri=_t(()=>[zt(()=>({addend:()=>ie("copper")?.004:.002,description:()=>(ie("copper")?"Empowered ":"")+Le.copper.name,enabled:()=>n.value.copper!=null}))]),On=w(()=>ri.apply(1.01)),qt=Object.keys(St).reduce((x,E)=>{const F=_t(()=>[we(()=>({multiplier:2,description:"Dowsing",enabled:()=>I.value!=null&&ye(I.value)&&I.value.state.resources.includes(E)}))]),j=w(()=>F.apply(St[E])),W={title:`${tt(E)} Drop Rate`,modifier:F,base:St[E]};return x[E]={modifier:F,computedModifier:j,section:W},x},{}),qn=Object.keys(St).reduce((x,E)=>{const F=_t(()=>[we(()=>({multiplier:()=>{var ee;return(ee=ae.value[E])!=null?ee:1},description:"Planar Treasures",enabled:()=>{var ee;return o.neq((ee=ae.value[E])!=null?ee:1,1)}}))]),j=w(()=>F.apply(1)),W={title:`${tt(E)} Gain`,modifier:F};return x[E]={modifier:F,computedModifier:j,section:W},x},{}),ai=w(()=>{var E,F,j;const x=Lt.indexOf((j=(F=(E=D.value)==null?void 0:E.state)==null?void 0:F.tier)!=null?j:"dirt");return o.add(x,1).times(x).div(2).add(9).pow10()}),si=_t(()=>[...Object.keys(Nt).map(x=>we(()=>({multiplier:Nt[x].cost,description:Nt[x].display,enabled:()=>{var E,F,j;return(j=(F=(E=D.value)==null?void 0:E.state)==null?void 0:F.influences.includes(x))!=null?j:!1},smallerIsBetter:!0}))),we(()=>({multiplier:()=>ie("emeraldRelic")?.05:.1,description:()=>(ie("emeraldRelic")?"Empowered ":"")+Tt.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),$i=w(()=>si.apply(ai.value)),[Ke,Ei]=Wn(()=>[{title:"Resource Levels",modifier:Te,base:0},{title:"Energy Gain",modifier:Xt,base:0,unit:"/s"},{title:"Portal Cost",modifier:si,base:ai,unit:" energy",baseText:()=>{var x,E,F;return`${tt((F=(E=(x=D.value)==null?void 0:x.state)==null?void 0:E.tier)!=null?F:"dirt")}-tier Base Cost`},visible:()=>D.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:Fn,base:0,visible:()=>o.gt(Nn.value,0)}]),[Pi,q]=Wn(()=>[{title:"Mining Speed",modifier:Ot,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:ii,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ri,base:1.01,visible:()=>n.value.copper!=null}]),[L,Se]=Wn(()=>Object.values(qt).map(x=>x.section)),[Qe,kn]=Wn(()=>Object.values(qn).map(x=>x.section)),ze=Ou({general:()=>({display:"General",glowColor(){return ze.activeTab.value===this.tab?"white":""},tab:Ke,energyTabCollapsed:Ei}),mining:()=>({display:"Mine",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Pi,miningTabCollapsed:q}),resources:()=>({display:"Mine Rates",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>I.value!=null,tab:L,resourcesCollapsed:Se}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(qn).some(x=>o.neq(x.computedModifier.value,1)),tab:Qe,resourceGainCollapsed:kn})}),$t=U(!1),Vt=J(()=>p(Ht,{modelValue:$t.value,"onUpdate:modelValue":x=>$t.value=x},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>rt(ze)}));this.on("preUpdate",x=>{if(Object.keys(u).forEach(E=>{u[E]-=x,u[E]<=0&&delete u[E]}),Object.keys(c).forEach(E=>{c[E]-=x,c[E]<=0&&delete c[E]}),ye(C.value)){const E=o.add(C.value.state.progress,o.times(xi.value,x)),F=E.floor();C.value.state={...C.value.state,progress:o.sub(E,F)};const j=F.div(B.value).floor();j.gt(0)&&Lt.forEach(ee=>{fe(ee,o.times(new o(qt[ee].computedModifier.value).toNumber(),j).times(Cn.value)),u[ee]=.3});const W=o.sub(F,j).toNumber();for(let ee=0;ee0){let j=o.add(E,x);const W=o.div(E,h.value).floor();j=o.sub(j,o.times(W,h.value)),P.value.state={...P.value.state,progress:j},o.gt(W,0)&&F.forEach(ee=>{fe(ee,W),c[ee]=.3})}}e.value=o.add(e.value,o.times(at.value,x)),o.lt(e.value,0)&&(e.value=0,Z.forEach(E=>{var F;((F=E.value)==null?void 0:F.state).powered=!1}),Object.values(a.value).forEach(E=>{E.state.powered=!1}),C.value.state={...C.value.state,powered:!1},Nr.warning(p("div",null,[p("h3",null,[T("Ran out of energy!")]),p("div",null,[T("All machines have been turned off.")])])))});const Bt=w(()=>{var x,E;return g.selectedAction.value===g.types.brokenFactory.actions[0]?-100:g.selectedAction.value===g.types.factory.actions[1]?o.neg(Le[g.selectedNode.value.state].cost):((x=g.selectedAction.value)==null?void 0:x.id)==="moreConnections"?o.neg(g.selectedAction.value.formula.evaluate(((E=g.selectedNode.value)==null?void 0:E.state).maxConnections)):0}),nt=cn(m.variable(0).add(e),()=>o.neq(Bt.value,0),Bt),Et=w(()=>{var x;return g.selectedAction.value===Ft?((x=g.selectedNode.value)==null?void 0:x.state).powered?o.eq(d.value,1)?10:o.pow(100,d.value).div(10).times(.99):o.neg(f.value):0}),an=cn(m.variable(0).add(at),()=>o.neq(Et.value,0),Et),oi=w(()=>g.types.portal.nodes.value.filter(x=>ye(x))),Vn=w(()=>oi.value.sort((x,E)=>{var W,ee;const F=(W=he[x.state.id])!=null&&W.minimized.value?1:0,j=(ee=he[E.state.id])!=null&&ee.minimized.value?1:0;return F-j}).map(x=>x.state.id));return vt(Vn,x=>{Gt(()=>{K.tabs=["main",...x]})}),vt(Nn,(x,E)=>{o.lt(x,E)&&(un(x,I,"resources"),un(x,P,"resources"),un(x,S,"tools"),un(x,V,"portals"),un(x,oe,"portals"),un(x,le,"portals"),un(x,Q,"portals"))}),{name:"World",board:g,energy:e,modifierTabs:ze,resourceNodes:t,toolNodes:n,influenceNodes:r,grantResource:fe,activePortals:oi,nextPowerCost:f,computedBonusConnectionsModifier:Nn,quarryProgressRequired:h,dropRates:qt,dowsing:I,empowerer:S,booster:V,upgrader:oe,automator:le,investments:Q,resourceLevels:l,planarMultis:ae,computedPortalCost:$i,display:J(()=>p(re,null,[p(hi,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[rt(nt)])," ",T("energy")]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(at.value,0)?"+":"",rt(an)]),T("/s)")]),o.gt(d.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[ft(d.value)])," ",T("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>$t.value=!0},[T("modifiers")])]),K.devSpeed===0?p("span",{class:"nav-segment"},[T("Game Paused")]):K.devSpeed!=null&&K.devSpeed!==1?p("span",{class:"nav-segment"},[T("Dev Speed: "),Me(K.devSpeed),T("x")]):null]}),rt(g),rt(Vt)]))}}),kf=e=>{var i,r,a,l,u;const t=[y];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(ia(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},ir=U(!1);function Mf(e,t){}var Sf=Object.freeze(Object.defineProperty({__proto__:null,main:y,getInitialLayers:kf,hasWon:ir,fixOldSave:Mf},Symbol.toStringTag,{value:"Module"}));const ni=e=>(hn("data-v-4a50ce42"),e=e(),bn(),e),If={class:"game-over-modal-header"},xf=["src","alt"],$f={class:"game-over-modal-title"},Ef=ni(()=>N("h2",null,"Congratulations!",-1)),Pf={key:0},Tf=ni(()=>N("br",null,null,-1)),Df=ni(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Af=ni(()=>N("br",null,null,-1)),Rf=["href"],Ff=ni(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Of=Y({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=me,u=w(()=>_i(K.timePlayed)),c=w(()=>ir.value&&!K.keepGoing),d=en(K,"autosave");function v(){K.keepGoing=!0}function f(){dn(Pn())}return(h,g)=>(M(),te(Ht,{"model-value":s(c)},{header:H(()=>[N("div",If,[s(n)?(M(),A("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,xf)):z("",!0),N("div",$f,[Ef,N("h4",null,"You've beaten "+ce(s(t))+" v"+ce(s(a))+": "+ce(s(l)),1)])])]),body:H(({shown:C})=>[C?(M(),A("div",Pf,[N("div",null,"It took you "+ce(s(u))+" to beat the game.",1),Tf,Df,Af,N("div",null,[N("a",{href:s(r),class:"game-over-modal-discord-link"},[Ff,T(" "+ce(s(i)),1)],8,Rf)]),p(jt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":g[0]||(g[0]=_=>Oe(d)?d.value=_:null)},null,8,["modelValue"])])):z("",!0)]),footer:H(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:v,class:"button"},"Keep Going"),N("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var qf=pe(Of,[["__scopeId","data-v-4a50ce42"]]);const Ii=e=>(hn("data-v-2776d67d"),e=e(),bn(),e),Vf=Ii(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),Bf={key:0},Lf=Ii(()=>N("br",null,null,-1)),jf=["href"],zf=Ii(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Uf=Ii(()=>N("br",null,null,-1)),Gf={class:"nan-footer"},Wf=Y({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=me,i=U(!0),r=U(!0),a=en(Ue,"hasNaN"),l=U(null);vt(a,h=>{h?(i.value=K.autosave,r.value=K.devSpeed===0):(K.autosave=i.value,K.devSpeed=r.value?0:null)});const u=w(()=>{var h;return(h=Ue.NaNPath)==null?void 0:h.join(".")}),c=w(()=>Ue.NaNPersistent!=null?Ue.NaNPersistent.value:null);function d(){Ue.NaNPersistent!=null&&(Ue.NaNPersistent.value=new o(0),Ue.hasNaN=!1)}function v(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(1),Ue.hasNaN=!1)}function f(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(NaN),Ue.hasNaN=!1)}return(h,g)=>(M(),A(re,null,[p(Ht,Wt({modelValue:s(a),"onUpdate:modelValue":g[4]||(g[4]=C=>Oe(a)?a.value=C:null)},h.$attrs),{header:H(()=>[Vf]),body:H(()=>[N("div",null,[T(' Attempted to assign "'+ce(s(u))+'" to NaN',1),s(c)?(M(),A("span",Bf,ce(" ")+"(previously "+ce(s(Me)(s(c)))+")",1)):z("",!0),T(". Auto-saving has been "+ce(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Lf,N("div",null,[N("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[zf,T(" "+ce(s(t)||"The Paper Pilot Community"),1)],8,jf)]),Uf,p(jt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=C=>i.value=C)},null,8,["modelValue"]),s(me).enablePausing?(M(),te(jt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":g[1]||(g[1]=C=>r.value=C)},null,8,["modelValue"])):z("",!0)]),footer:H(()=>[N("div",Gf,[N("button",{onClick:g[2]||(g[2]=C=>{var _;return(_=l.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:d,class:"button"},"Set to 0"),N("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),A("button",{key:0,onClick:g[3]||(g[3]=C=>a.value=!1),class:"button"}," Set to previous ")):z("",!0),N("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(zr,{ref_key:"savesManager",ref:l},null,512)],64))}});var Hf=pe(Wf,[["__scopeId","data-v-2776d67d"]]);const Zf={key:0,class:"tpsDisplay"},Xf=Y({__name:"TPS",setup(e){const t=w(()=>o.div(Ue.lastTenTicks.length,Ue.lastTenTicks.reduce((n,i)=>n+i,0)));return(n,i)=>s(t).isNan()?z("",!0):(M(),A("div",Zf,"TPS: "+ce(s(ft)(s(t))),1))}});var Yf=pe(Xf,[["__scopeId","data-v-89b89152"]]);var Jf=Y({__name:"App",setup(e){const t=me.useHeader,n=w(()=>Ct[ue.theme].variables),i=en(ue,"showTPS"),r=w(()=>de(J(()=>p(re,null,[Ds.map(rt)]))));return(a,l)=>(M(),A(re,null,[N("div",{id:"modal-root",style:je(s(n))},null,4),N("div",{class:be(["app",{useHeader:s(t)}]),style:je(s(n))},[s(t)?(M(),te(Ur,{key:0})):z("",!0),p(Yl),s(s(i))?(M(),te(Yf,{key:1})):z("",!0),p(qf),p(Hf),(M(),te(Xe(s(r))))],6)],64))}});var Kf=pe(Jf,[["__scopeId","data-v-41d15e5e"]]);function Qf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,v;const f=async(g=!0)=>{await d,g&&(u==null||u.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function h(){if("serviceWorker"in navigator){const{Workbox:g,messageSW:C}=await Zn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await C(c.waiting,{type:"SKIP_WAITING"})},u=new g("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",_=>{_.isUpdate||i==null||i()});{const _=()=>{n==null||n()};u.addEventListener("waiting",_),u.addEventListener("externalwaiting",_)}u.register({immediate:t}).then(_=>{c=_,a?a("./sw.js",_):r==null||r(_)}).catch(_=>{l==null||l(_)})}}return d=h(),f}function ep(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=U(!1),c=U(!1);return{updateServiceWorker:Qf({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=me.title;window.projInfo=me;if(me.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c -Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Is();const{globalBus:e}=await Zn(()=>Promise.resolve().then(function(){return Ms}),void 0),{startGameLoop:t}=await Zn(()=>import("./gameLoop.c3596ec6.js"),["assets/gameLoop.c3596ec6.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=Na(Kf);e.emit("setupVue",n),n.mount("#app"),Gt(()=>{const i=wi(),{updateServiceWorker:r}=ep({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Zn as _,Ue as a,me as b,Sf as c,Ye as g,xs as l,K as p,ue as s}; + )`,onMousedown:I=>c(I,h),onTouchstart:I=>c(I,h),onMouseup:I=>d(I,h),onTouchend:Tn(I=>d(I,h),["stop"])},[N("circle",{fill:s(ge)(h.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===h.id?4:0,stroke:s(a)},null,8,iu),N("text",{fill:s(l),class:"material-icons"},ce(s(ge)(h.icon,e.node)),9,ru)],42,nu)}),128))])):z("",!0)]),_:1}))}});var su=pe(au,[["__scopeId","data-v-9efb2a56"]]);const ou=["transform"],lu={key:0},uu=["r","fill","stroke"],cu=["r","fill","stroke"],du=["r","fill"],fu=["r","stroke-dasharray","stroke-dashoffset","stroke"],pu={key:1,transform:"rotate(45, 0, 0)"},gu=["width","height","transform","fill","stroke"],mu=["width","height","transform","fill","stroke"],vu=["width","height","transform","fill"],hu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],bu=["fill","y"],yu=["fill"],wu={key:0},_u=["fill","y"],Nu=["fill","y"],Cu=Y({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Pe(n),a=w(()=>ge(r.nodeType.value.draggable,s(r.node)));vt(a,B=>{const ae=s(r.node);s(r.dragging)===ae&&!B&&t("endDragging",ae)});const l=w(()=>{var ae;const B=s(r.node);return(ae=ge(r.nodeType.value.actions,B))==null?void 0:ae.filter(Te=>Ge(ge(Te.visibility,B)))}),u=w(()=>{var ae;const B=s(r.node);if(ge(r.nodeType.value.draggable,B)&&((ae=s(r.dragging))==null?void 0:ae.id)===B.id&&s(r.dragged)!=null){const{x:Te,y:He}=s(r.dragged);return{x:B.position.x+Math.round(Te/25)*25,y:B.position.y+Math.round(He/25)*25}}return B.position}),c=w(()=>ge(r.nodeType.value.shape,s(r.node))),d=w(()=>ge(r.nodeType.value.title,s(r.node))),v=w(()=>ge(r.nodeType.value.subtitle,s(r.node))),f=w(()=>{var B;return(B=r.isSelected.value?s(r.selectedAction)&&ge(s(r.selectedAction).tooltip,s(r.node)):null)!=null?B:ge(r.nodeType.value.label,s(r.node))}),h=w(()=>{var B,ae;return ge((ae=(B=s(r.selectedAction))==null?void 0:B.confirmationLabel)!=null?ae:{text:"Tap again to confirm"},s(r.node))}),g=w(()=>ge(r.nodeType.value.size,s(r.node))),C=w(()=>{var B;return(B=ge(r.nodeType.value.progress,s(r.node)))!=null?B:0}),_=w(()=>Ct[ue.theme].variables["--background"]),I=w(()=>{var B;return(B=ge(r.nodeType.value.outlineColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--outline"]}),P=w(()=>{var B;return(B=ge(r.nodeType.value.fillColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--raised-background"]}),S=w(()=>ge(r.nodeType.value.progressColor,s(r.node))),D=w(()=>{var B;return(B=ge(r.nodeType.value.titleColor,s(r.node)))!=null?B:Ct[ue.theme].variables["--foreground"]}),V=w(()=>ge(r.nodeType.value.progressDisplay,s(r.node))),oe=w(()=>r.dragging.value!=null&&s(r.hasDragged)&&ge(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),le=w(()=>ge(r.nodeType.value.style,s(r.node))),Q=w(()=>ge(r.nodeType.value.classes,s(r.node)));function Z(B){t("mouseDown",B,r.node.value,a.value)}function fe(B){var ae,Te,He;(ae=r.hasDragged)!=null&&ae.value||(t("endDragging",r.node.value),(He=(Te=r.nodeType.value).onClick)==null||He.call(Te,r.node.value),B.stopPropagation())}return(B,ae)=>{var Te,He,Xt;return M(),A("g",{class:be(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(Q)}]),style:je([{opacity:((Te=e.dragging)==null?void 0:Te.id)===e.node.id&&e.hasDragged?.5:1},(He=s(le))!=null?He:[]]),transform:`translate(${s(u).x},${s(u).y})${e.isSelected?" scale(1.2)":""}`},[p(su,{actions:(Xt=s(l))!=null?Xt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ae[0]||(ae[0]=at=>t("clickAction",at))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:Z,onTouchstartPassive:Z,onMouseup:fe,onTouchendPassive:fe},[s(c)===s(We).Circle?(M(),A("g",lu,[s(oe)?(M(),A("circle",{key:0,class:"receiver",r:s(g)+8,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,uu)):z("",!0),N("circle",{class:"body",r:s(g),fill:s(P),stroke:s(I),"stroke-width":4},null,8,cu),s(V)===s(vn).Fill?(M(),A("circle",{key:1,class:"progress progressFill",r:Math.max(s(g)*s(C)-2,0),fill:s(S)},null,8,du)):(M(),A("circle",{key:2,r:s(g)+4.5,class:"progress progressRing",fill:"transparent","stroke-dasharray":(s(g)+4.5)*2*Math.PI,"stroke-width":5,"stroke-dashoffset":(s(g)+4.5)*2*Math.PI-s(C)*(s(g)+4.5)*2*Math.PI,stroke:s(S)},null,8,fu))])):s(c)===s(We).Diamond?(M(),A("g",pu,[s(oe)?(M(),A("rect",{key:0,class:"receiver",width:s(g)*s(i)+16,height:s(g)*s(i)+16,transform:`translate(${-(s(g)*s(i)+16)/2}, ${-(s(g)*s(i)+16)/2})`,fill:s(_),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,gu)):z("",!0),N("rect",{class:"body",width:s(g)*s(i),height:s(g)*s(i),transform:`translate(${-s(g)*s(i)/2}, ${-s(g)*s(i)/2})`,fill:s(P),stroke:s(I),"stroke-width":4},null,8,mu),s(V)===s(vn).Fill?(M(),A("rect",{key:1,class:"progress progressFill",width:Math.max(s(g)*s(i)*s(C)-2,0),height:Math.max(s(g)*s(i)*s(C)-2,0),transform:`translate(${-Math.max(s(g)*s(i)*s(C)-2,0)/2}, ${-Math.max(s(g)*s(i)*s(C)-2,0)/2})`,fill:s(S)},null,8,vu)):(M(),A("rect",{key:2,class:"progress progressDiamond",width:s(g)*s(i)+9,height:s(g)*s(i)+9,transform:`translate(${-(s(g)*s(i)+9)/2}, ${-(s(g)*s(i)+9)/2})`,fill:"transparent","stroke-dasharray":(s(g)*s(i)+9)*4,"stroke-width":5,"stroke-dashoffset":(s(g)*s(i)+9)*4-s(C)*(s(g)*s(i)+9)*4,stroke:s(S)},null,8,hu))])):z("",!0),N("text",{fill:s(D),class:"node-title",y:s(v)?10:0},ce(s(d)),9,bu),s(v)?(M(),A("text",{key:2,fill:s(D),class:"node-subtitle",y:"-15"},ce(s(v)),9,yu)):z("",!0)],32),p(Hn,{name:"fade",appear:""},{default:H(()=>{var at;return[s(f)?(M(),A("g",wu,[N("text",{fill:(at=s(f).color)!=null?at:s(D),class:be(["node-title",{pulsing:s(f).pulsing}]),y:-s(g)-20},ce(s(f).text),11,_u)])):z("",!0)]}),_:1}),p(Hn,{name:"fade",appear:""},{default:H(()=>{var at;return[e.isSelected&&e.selectedAction?(M(),A("text",{key:0,fill:(at=s(h).color)!=null?at:s(D),class:be(["node-title",{pulsing:s(h).pulsing}]),y:s(g)+75},ce(s(h).text),11,Nu)):z("",!0)]}),_:1})],14,ou)}}});var ku=pe(Cu,[["__scopeId","data-v-518d7a7f"]]);const Mu={class:"stage",width:"100%",height:"100%"},Su={class:"g1"},Iu=Y({__name:"Board",props:{nodes:null,types:null,state:null,visibility:null,width:null,height:null,style:null,classes:null,links:null,selectedAction:null,selectedNode:null,draggingNode:null,receivingNode:null,mousePosition:null,setReceivingNode:{type:Function},setDraggingNode:{type:Function}},setup(e){const n=Pe(e),i=U({x:0,y:0}),r=U({x:0,y:0}),a=U(!1),l=U(null),u=w(()=>{const g=n.nodes.value.slice();if(n.selectedNode.value){const C=g.splice(g.indexOf(n.selectedNode.value),1)[0];g.push(C)}if(n.draggingNode.value){const C=g.splice(g.indexOf(n.draggingNode.value),1)[0];g.push(C)}return g});It(()=>{const g=n.draggingNode.value;if(g==null)return null;const C={x:g.position.x+r.value.x,y:g.position.y+r.value.y};let _=Number.MAX_VALUE;n.setReceivingNode.value(n.nodes.value.reduce((I,P)=>{if(P.id===g.id)return I;const S=n.types.value[P.type];if(!ge(S.canAccept,P,g))return I;const V=Math.pow(C.x-P.position.x,2)+Math.pow(C.y-P.position.y,2);let oe=ge(S.size,P);return V>_||V>oe*oe?I:(_=V,P)},null))});function c(g){g.setTransformOrigin(null),g.moveTo(l.value.$el.clientWidth/2,l.value.$el.clientHeight/2)}function d(g,C=null,_=!1){if(n.draggingNode.value==null){g.preventDefault(),g.stopPropagation();let I,P;if("touches"in g)if(g.touches.length===1)I=g.touches[0].clientX,P=g.touches[0].clientY;else return;else I=g.clientX,P=g.clientY;i.value={x:I,y:P},r.value={x:0,y:0},a.value=!1,_&&n.setDraggingNode.value(C)}C!=null&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function v(g){const{x:C,y:_,scale:I}=l.value.panZoomInstance.getTransform();let P,S;if("touches"in g)if(g.touches.length===1)P=g.touches[0].clientX,S=g.touches[0].clientY;else{f(n.draggingNode.value),n.mousePosition.value=null;return}else P=g.clientX,S=g.clientY;n.mousePosition.value={x:(P-C)/I,y:(S-_)/I},r.value={x:r.value.x+(P-i.value.x)/I,y:r.value.y+(S-i.value.y)/I},i.value={x:P,y:S},(Math.abs(r.value.x)>10||Math.abs(r.value.y)>10)&&(a.value=!0),n.draggingNode.value!=null&&(g.preventDefault(),g.stopPropagation())}function f(g,C=!1){var _,I;if(n.draggingNode.value!=null&&n.draggingNode.value===g){n.receivingNode.value==null&&(n.draggingNode.value.position.x+=Math.round(r.value.x/25)*25,n.draggingNode.value.position.y+=Math.round(r.value.y/25)*25);const P=n.nodes.value;P.push(P.splice(P.indexOf(n.draggingNode.value),1)[0]),n.receivingNode.value&&((I=(_=n.types.value[n.receivingNode.value.type]).onDrop)==null||I.call(_,n.receivingNode.value,n.draggingNode.value)),n.setDraggingNode.value(null)}else!a.value&&!C&&(n.state.value.selectedNode=null,n.state.value.selectedAction=null)}function h(g,C){n.state.value.selectedAction===C?s(n.selectedAction).onClick(s(n.selectedNode)):n.state.value={...n.state.value,selectedAction:C}}return(g,C)=>{const _=Mt("panZoom");return s(Ge)(e.visibility)?(M(),te(_,{key:0,style:je([{width:e.width,height:e.height},e.style]),class:be(e.classes),selector:".g1",options:{initialZoom:1,minZoom:.1,maxZoom:10,zoomDoubleClickSpeed:1},ref_key:"stage",ref:l,onInit:c,onMousemove:v,onTouchmove:v,onMousedown:C[0]||(C[0]=I=>d(I)),onTouchstart:C[1]||(C[1]=I=>d(I)),onMouseup:C[2]||(C[2]=()=>f(s(e.draggingNode))),onTouchendPassive:C[3]||(C[3]=()=>f(s(e.draggingNode))),onMouseleave:C[4]||(C[4]=()=>f(s(e.draggingNode),!0))},{default:H(()=>[(M(),A("svg",Mu,[N("g",Su,[p(lr,{name:"link",appear:""},{default:H(()=>[(M(!0),A(re,null,Dn(s(e.links)||[],I=>(M(),A("g",{key:`${I.startNode.id}-${I.endNode.id}`},[p(eu,{link:I},null,8,["link"])]))),128))]),_:1}),p(lr,{name:"grow",duration:500,appear:""},{default:H(()=>[(M(!0),A(re,null,Dn(s(u),I=>(M(),A("g",{key:I.id,style:{"transition-duration":"0s"}},[p(ku,{node:I,nodeType:e.types[I.type],dragging:s(e.draggingNode),dragged:s(e.draggingNode)===I?r.value:void 0,hasDragged:s(e.draggingNode)==null?!1:a.value,receivingNode:s(e.receivingNode)===I,isSelected:s(e.selectedNode)===I,selectedAction:s(e.selectedNode)===I?s(e.selectedAction):null,onMouseDown:d,onEndDragging:f,onClickAction:P=>h(I,P)},null,8,["node","nodeType","dragging","dragged","hasDragged","receivingNode","isSelected","selectedAction","onClickAction"])]))),128))]),_:1})])]))]),_:1},8,["style","class","options"])):z("",!0)}}});Ye.on("setupVue",e=>Sa.install(e));const Gr=Symbol("Board");var vn=(e=>(e.Outline="Outline",e.Fill="Fill",e))(vn||{}),We=(e=>(e.Circle="Circle",e.Diamond="Triangle",e))(We||{});function xu(e){const t=dt({nodes:[],selectedNode:null,selectedAction:null},!1);return Je(n=>{const i=e.call(n,n);i.id=nn("board-"),i.type=Gr,i[yt]=Iu,i.state?(qr(t),$(i,"state")):(t[tn]={nodes:i.startNodes().map((u,c)=>(u.id=c,u)),selectedNode:null,selectedAction:null},i.state=t),i.nodes=w(()=>s(l.state).nodes),i.selectedNode=w({get(){return l.nodes.value.find(u=>u.id===s(l.state).selectedNode)||null},set(u){var c,d;Oe(l.state)?l.state.value={...l.state.value,selectedNode:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedNode=(d=u==null?void 0:u.id)!=null?d:null}}),i.selectedAction=w({get(){const u=l.selectedNode.value;if(u==null)return null;const c=l.types[u.type];return c.actions==null?null:c.actions.find(d=>d.id===s(l.state).selectedAction)||null},set(u){var c,d;Oe(l.state)?l.state.value={...l.state.value,selectedAction:(c=u==null?void 0:u.id)!=null?c:null}:l.state.selectedAction=(d=u==null?void 0:u.id)!=null?d:null}}),i.mousePosition=U(null),i.links?$(i,"links"):i.links=w(()=>l.selectedAction.value==null?null:l.selectedAction.value.links&&l.selectedNode.value?ge(l.selectedAction.value.links,l.selectedNode.value):null),i.draggingNode=U(null),i.receivingNode=U(null),$(i,"visibility"),se(i,"visibility",Ce.Visible),$(i,"width"),se(i,"width","100%"),$(i,"height"),se(i,"height","100%"),$(i,"classes"),$(i,"style");for(const u in i.types){const c=i.types[u];if($(c,"title"),$(c,"subtitle"),$(c,"label"),$(c,"size"),se(c,"size",50),$(c,"style"),$(c,"classes"),$(c,"draggable"),se(c,"draggable",!1),$(c,"shape"),se(c,"shape","Circle"),$(c,"canAccept"),se(c,"canAccept",!1),$(c,"progress"),$(c,"progressDisplay"),se(c,"progressDisplay","Fill"),$(c,"progressColor"),se(c,"progressColor","none"),$(c,"fillColor"),$(c,"outlineColor"),$(c,"titleColor"),$(c,"actionDistance"),se(c,"actionDistance",Math.PI/6),c.nodes=w(()=>s(l.state).nodes.filter(d=>d.type===u)),se(c,"onClick",function(d){s(l.state).selectedNode=d.id}),c.actions)for(const d of c.actions)$(d,"visibility"),se(d,"visibility",Ce.Visible),$(d,"icon"),$(d,"fillColor"),$(d,"tooltip"),$(d,"confirmationLabel"),se(d,"confirmationLabel",{text:"Tap again to confirm"}),$(d,"links")}function r(u){i.draggingNode.value=u}function a(u){i.receivingNode.value=u}i.placeInAvailableSpace=function(u,c=100,d=G.Right){const v=l.nodes.value.slice().filter(f=>f===u||(d===G.Down||d===G.Up)&&Math.abs(f.position.x-u.position.x)>c||(d===G.Left||d===G.Right)&&Math.abs(f.position.y-u.position.y)>c?!1:!(d===G.Right&&f.position.xu.position.x+c||d===G.Up&&f.position.y>u.position.y+c||d===G.Down&&f.position.yf.position.x-h.position.x:d===G.Left?(f,h)=>h.position.x-f.position.x:d===G.Up?(f,h)=>h.position.y-f.position.y:(f,h)=>f.position.y-h.position.y);for(let f=0;f0&&g>c)break}},i[pt]=function(){const{nodes:u,types:c,state:d,visibility:v,width:f,height:h,style:g,classes:C,links:_,selectedAction:I,selectedNode:P,mousePosition:S,draggingNode:D,receivingNode:V}=this;return{nodes:u,types:c,state:d,visibility:v,width:f,height:h,style:s(g),classes:C,links:_,selectedAction:I,selectedNode:P,mousePosition:S,draggingNode:D,receivingNode:V,setDraggingNode:r,setReceivingNode:a}};const l=i;return l})}function ge(e,t,...n){return Xn(e)?e(t,...n):s(e)}function Qn(e){let t=0;return e.nodes.value.forEach(n=>{n.id>=t&&(t=n.id+1)}),t}const Un={};Ye.on("addLayer",e=>{const t=Jn(e,Gr);Un[e.id]=e.on("postUpdate",n=>{t.forEach(i=>{Object.values(i.types).forEach(r=>r.nodes.value.forEach(a=>{var l;return(l=r.update)==null?void 0:l.call(r,a,n)}))})})});Ye.on("removeLayer",e=>{var t;(t=Un[e.id])==null||t.call(Un),Un[e.id]=void 0});function $n(e,t="points",n=0,i=void 0){const r=Oe(e)?e:dt(e);if(r.displayName=t,r.precision=n,r.small=i,!Oe(e)){const a=r[Dt];a.displayName=t,a.precision=n,a.small=i}return r}new o("10^^8");new o("1e100");function bi(e,t){const n=t!=null?t:e.value;return o.eq(e.precision,0)?ft(e.small?n:o.floor(n)):Me(n,e.precision,e.small)}Ye.on("setupVue",e=>e.use(Ia));function $u(e="white",t="8px"){return{transform:"scale(1.05, 1.05)",borderColor:"rgba(0, 0, 0, 0.125)",boxShadow:`-4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0 0 ${t} ${e}`,zIndex:1}}const Eu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:{type:O(Object,String,Function),required:!0},style:O(String,Object,Array),classes:O(Object),glowColor:O(String),active:Boolean,floating:Boolean},emits:["selectTab"],setup(e,{emit:t}){const{display:n,glowColor:i,floating:r}=Pe(e),a=Fr(n),l=w(()=>{const c=$e(i);return c==null||c===""?{}:s(r)?$u(c):{boxShadow:`0px 9px 5px -6px ${c}`}});function u(){t("selectTab")}return{selectTab:u,component:a,glowColorStyle:l,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Pu(e,t,n,i,r,a){var l;return e.isVisible(e.visibility)?(M(),A("button",{key:0,onClick:t[0]||(t[0]=(...u)=>e.selectTab&&e.selectTab(...u)),class:be(["tabButton",{active:e.active,...e.unref(e.classes)}]),style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},e.glowColorStyle,(l=e.unref(e.style))!=null?l:{}])},[(M(),te(Xe(e.component)))],6)):z("",!0)}var Wr=pe(Eu,[["render",Pu],["__scopeId","data-v-21427abb"]]);const Tu=Y({props:{visibility:{type:O(Number,Boolean),required:!0},activeTab:{type:O(Object),required:!0},selected:{type:Object,required:!0},tabs:{type:O(Object),required:!0},style:O(String,Object,Array),classes:O(Object),buttonContainerStyle:O(String,Object,Array),buttonContainerClasses:O(Object)},components:{Sticky:hi,TabButton:Wr},setup(e){const{activeTab:t}=Pe(e),n=w(()=>Ct[ue.theme].floatingTabs),i=ht("");It(()=>{const u=$e(t);if(u==null){i.value="";return}if(xt(u)){i.value=de(u);return}i.value=de(s(u.display))});const r=w(()=>{const u=$e(t);return xt(u)||!u?void 0:s(u.classes)}),a=w(()=>{const u=$e(t);return xt(u)||!u?void 0:s(u.style)});function l(u){const{display:c,style:d,classes:v,glowColor:f,visibility:h}=u;return{display:c,style:s(d),classes:v,glowColor:f,visibility:h}}return{floating:n,tabClasses:r,tabStyle:a,Visibility:Ce,component:i,gatherButtonProps:l,unref:s,isVisible:Ge,isHidden:yn}}});function Du(e,t,n,i,r,a){var c,d;const l=Mt("TabButton"),u=Mt("Sticky");return e.isVisible(e.visibility)?(M(),A("div",{key:0,class:be(["tab-family-container",{...e.unref(e.classes),...e.tabClasses}]),style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[],(d=e.tabStyle)!=null?d:[]])},[p(u,{class:be(["tab-buttons-container",e.unref(e.buttonContainerClasses)]),style:je(e.unref(e.buttonContainerStyle))},{default:H(()=>[N("div",{class:be(["tab-buttons",{floating:e.floating}])},[(M(!0),A(re,null,Dn(e.unref(e.tabs),(v,f)=>(M(),te(l,Wt({onSelectTab:h=>e.selected.value=f,floating:e.floating,key:f,active:e.unref(v.tab)===e.unref(e.activeTab)},e.gatherButtonProps(v)),null,16,["onSelectTab","floating","active"]))),128))],2)]),_:1},8,["class","style"]),e.unref(e.activeTab)?(M(),te(Xe(e.unref(e.component)),{key:0})):z("",!0)],6)):z("",!0)}var Au=pe(Tu,[["render",Du],["__scopeId","data-v-58dbf83a"]]);const Ru=Symbol("TabButton"),Fu=Symbol("TabFamily");function Ou(e,t){if(Object.keys(e).length===0)throw console.warn("Cannot create tab family with 0 tabs"),new Error("Cannot create tab family with 0 tabs");const n=dt(Object.keys(e)[0],!1);return Je(i=>{var l;const r=(l=t==null?void 0:t.call(i,i))!=null?l:{};r.id=nn("tabFamily-"),r.type=Fu,r[yt]=Au,r.tabs=Object.keys(e).reduce((u,c)=>{const d=e[c]();return d.type=Ru,d[yt]=Wr,$(d,"visibility"),se(d,"visibility",Ce.Visible),$(d,"tab"),$(d,"display"),$(d,"classes"),$(d,"style"),$(d,"glowColor"),u[c]=d,u},{}),r.selected=n,r.activeTab=w(()=>{const u=s(a.tabs);if(n.value in u&&Ge(u[n.value].visibility))return s(u[n.value].tab);const c=Object.values(u).find(d=>Ge(d.visibility));return c?s(c.tab):null}),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"classes"),$(r,"style"),$(r,"buttonContainerClasses"),$(r,"buttonContainerStyle"),r[pt]=function(){const{visibility:u,activeTab:c,selected:d,tabs:v,style:f,classes:h,buttonContainerClasses:g,buttonContainerStyle:C}=this;return{visibility:u,activeTab:c,selected:d,tabs:v,style:s(f),classes:h,buttonContainerClasses:g,buttonContainerStyle:C}};const a=r;return a})}const Hr=o.ln(10);function Gn(e){return e}function qu(e,t){if(R(t))return t.invert(o.neg(e));throw new Error("Could not invert due to no input being a variable")}function Vu(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return m.neg(t.getIntegralFormula(e))}throw new Error("Could not integrate due to no input being a variable")}function Bu(e){return m.neg(e)}function Lu(e,t,n){if(R(t))return t.invert(o.sub(e,ke(n)));if(R(n))return n.invert(o.sub(e,ke(t)));throw new Error("Could not invert due to no input being a variable")}function ju(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.times(n,(i=t.innermostVariable)!=null?i:0).add(a)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).add(a)}throw new Error("Could not integrate due to no input being a variable")}function zu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.add(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.add(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Uu(e,t,n){if(R(t))return t.invert(o.add(e,ke(n)));if(R(n))return n.invert(o.sub(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Gu(e,t,n){var i,r;if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=t.getIntegralFormula(e);return m.sub(a,m.times(n,(i=t.innermostVariable)!=null?i:0))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const a=n.getIntegralFormula(e);return m.times(t,(r=n.innermostVariable)!=null?r:0).sub(a)}throw new Error("Could not integrate due to no input being a variable")}function Wu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.sub(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.sub(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Hu(e,t,n){if(R(t))return t.invert(o.div(e,ke(n)));if(R(n))return n.invert(o.div(e,ke(t)));throw new Error("Could not invert due to no input being a variable")}function Zu(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.times(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.times(i,t)}throw new Error("Could not integrate due to no input being a variable")}function Xu(e,t,n){if(R(t))return m.div(e,n);if(R(n))return m.div(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Yu(e,t,n){if(R(t))return t.invert(o.mul(e,ke(n)));if(R(n))return n.invert(o.div(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Ju(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.div(i,n)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.div(t,i)}throw new Error("Could not integrate due to no input being a variable")}function Ku(e,t,n){if(R(t))return m.mul(e,n);if(R(n))return m.mul(e,t);throw new Error("Could not apply substitution due to no input being a variable")}function Qu(e,t){if(R(t))return t.invert(o.recip(e));throw new Error("Could not invert due to no input being a variable")}function ec(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.ln(n)}throw new Error("Could not integrate due to no input being a variable")}function tc(e,t){if(R(t))return t.invert(o.pow10(e));throw new Error("Could not invert due to no input being a variable")}function nc(e){return o.ln(e).sub(1).times(e).div(Hr)}function ic(e,t){if(R(t)){const n=Hr.times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function rc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:nc,invert:ic})}throw new Error("Could not integrate due to no input being a variable")}function ac(e,t,n){if(R(t))return t.invert(o.pow(ke(n),e));if(R(n))return n.invert(o.root(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function sc(e,t){return o.ln(e).sub(1).times(e).div(o.ln(t))}function oc(e,t,n){if(R(t)){const i=o.ln(ke(n)).times(e);return t.invert(i.div(i.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function lc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e),n],evaluate:sc,invert:oc})}throw new Error("Could not integrate due to no input being a variable")}function uc(e,t){if(R(t))return t.invert(o.pow(2,e));throw new Error("Could not invert due to no input being a variable")}function cc(e){return o.ln(e).sub(1).times(e).div(o.ln(2))}function dc(e,t){if(R(t)){const n=o.ln(2).times(e);return t.invert(n.div(n.div(Math.E).lambertw()))}throw new Error("Could not invert due to no input being a variable")}function fc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:cc,invert:dc})}throw new Error("Could not integrate due to no input being a variable")}function pc(e,t){if(R(t))return t.invert(o.exp(e));throw new Error("Could not invert due to no input being a variable")}function gc(e){return o.ln(e).sub(1).times(e)}function mc(e,t){if(R(t))return t.invert(o.div(e,o.div(e,Math.E).lambertw()));throw new Error("Could not invert due to no input being a variable")}function vc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");return new m({inputs:[t.getIntegralFormula(e)],evaluate:gc,invert:mc})}throw new Error("Could not integrate due to no input being a variable")}function hc(e,t,n){if(R(t))return t.invert(o.root(e,ke(n)));if(R(n))return n.invert(o.ln(e).div(o.ln(ke(t))));throw new Error("Could not invert due to no input being a variable")}function bc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e),r=m.add(n,1);return m.pow(i,r).div(r)}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e);return m.pow(t,i).div(m.ln(t))}throw new Error("Could not integrate due to no input being a variable")}function yc(e,t){if(R(t))return t.invert(o.root(e,10));throw new Error("Could not invert due to no input being a variable")}function wc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.pow10(n).div(m.ln(10))}throw new Error("Could not integrate due to no input being a variable")}function _c(e,t,n){if(R(t))return t.invert(o.ln(e).div(o.ln(ke(n))));if(R(n))return n.invert(o.root(ke(t),e));throw new Error("Could not invert due to no input being a variable")}function Nc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(n,i).div(m.ln(n))}else if(R(n)){if(!n.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=n.getIntegralFormula(e),r=m.add(t,1);return m.pow(i,r).div(r)}throw new Error("Could not integrate due to no input being a variable")}function Cc(e,t,n){if(R(t))return t.invert(o.root(e,o.recip(ke(n))));if(R(n))return n.invert(o.ln(ke(t)).div(o.ln(e)));throw new Error("Could not invert due to no input being a variable")}function kc(e,t,n){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const i=t.getIntegralFormula(e);return m.pow(i,m.recip(n).add(1)).times(n).div(m.add(n,1))}throw new Error("Could not integrate due to no input being a variable")}function Mc(e,t){if(R(t))return t.invert(o.ln(e));throw new Error("Could not invert due to no input being a variable")}function Sc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.exp(n)}throw new Error("Could not integrate due to no input being a variable")}function Ic(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.tetrate(e,i,n)}function xc(e,t,n,i){if(R(t))return t.invert(o.ssqrt(e));throw new Error("Could not invert due to no input being a variable")}function $c(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){const i=o.minabs(t,1e308).toNumber();return o.iteratedexp(e,i,new o(n))}function Ec(e,t,n,i){if(R(t))return t.invert(o.iteratedlog(e,Math.E,o.minabs(1e308,ke(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Pc(e,t=10,n=2){const i=o.minabs(n,1e308).toNumber();return o.iteratedlog(e,t,i)}function Tc(e,t=10){const n=o.minabs(t,1e308).toNumber();return o.slog(e,n)}function Dc(e,t,n){if(R(t))return t.invert(o.tetrate(e,o.minabs(1e308,ke(n)).toNumber()));throw new Error("Could not invert due to no input being a variable")}function Ac(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.layeradd(e,i,n)}function Rc(e,t,n,i){if(R(t))return t.invert(o.layeradd(e,o.minabs(1e308,ke(n)).negate().toNumber()));throw new Error("Could not invert due to no input being a variable")}function Fc(e,t){if(R(t))return t.invert(o.pow(Math.E,e).times(e));throw new Error("Could not invert due to no input being a variable")}function Oc(e,t){if(R(t))return t.invert(o.tetrate(e,2));throw new Error("Could not invert due to no input being a variable")}function qc(e,t,n){const i=o.minabs(t,1e308).toNumber();return o.pentate(e,i,n)}function Vc(e,t){if(R(t))return t.invert(o.asin(e));throw new Error("Could not invert due to no input being a variable")}function Bc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).neg()}throw new Error("Could not integrate due to no input being a variable")}function Lc(e,t){if(R(t))return t.invert(o.acos(e));throw new Error("Could not invert due to no input being a variable")}function jc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sin(n)}throw new Error("Could not integrate due to no input being a variable")}function zc(e,t){if(R(t))return t.invert(o.atan(e));throw new Error("Could not invert due to no input being a variable")}function Uc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cos(n).ln().neg()}throw new Error("Could not integrate due to no input being a variable")}function Gc(e,t){if(R(t))return t.invert(o.sin(e));throw new Error("Could not invert due to no input being a variable")}function Wc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asin(n).times(n).add(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Hc(e,t){if(R(t))return t.invert(o.cos(e));throw new Error("Could not invert due to no input being a variable")}function Zc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acos(n).times(n).sub(m.sqrt(m.sub(1,m.pow(n,2))))}throw new Error("Could not integrate due to no input being a variable")}function Xc(e,t){if(R(t))return t.invert(o.tan(e));throw new Error("Could not invert due to no input being a variable")}function Yc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atan(n).times(n).sub(m.ln(m.pow(n,2).add(1)).div(2))}throw new Error("Could not integrate due to no input being a variable")}function Jc(e,t){if(R(t))return t.invert(o.asinh(e));throw new Error("Could not invert due to no input being a variable")}function Kc(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n)}throw new Error("Could not integrate due to no input being a variable")}function Qc(e,t){if(R(t))return t.invert(o.acosh(e));throw new Error("Could not invert due to no input being a variable")}function ed(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.sinh(n)}throw new Error("Could not integrate due to no input being a variable")}function td(e,t){if(R(t))return t.invert(o.atanh(e));throw new Error("Could not invert due to no input being a variable")}function nd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.cosh(n).ln()}throw new Error("Could not integrate due to no input being a variable")}function id(e,t){if(R(t))return t.invert(o.sinh(e));throw new Error("Could not invert due to no input being a variable")}function rd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.asinh(n).times(n).sub(m.pow(n,2).add(1).sqrt())}throw new Error("Could not integrate due to no input being a variable")}function ad(e,t){if(R(t))return t.invert(o.cosh(e));throw new Error("Could not invert due to no input being a variable")}function sd(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.acosh(n).times(n).sub(m.add(n,1).sqrt().times(m.sub(n,1).sqrt()))}throw new Error("Could not integrate due to no input being a variable")}function od(e,t){if(R(t))return t.invert(o.tanh(e));throw new Error("Could not invert due to no input being a variable")}function ld(e,t){if(R(t)){if(!t.isIntegrable())throw new Error("Could not integrate due to variable not being integrable");const n=t.getIntegralFormula(e);return m.atanh(n).times(n).add(m.sub(1,m.pow(n,2)).ln().div(2))}throw new Error("Could not integrate due to no input being a variable")}function Rn(e){return(t,n)=>new m({inputs:[t,n],evaluate:e,invert:Gn})}function R(e){return e instanceof Ee&&e.hasVariable()}function ke(e,t){return e instanceof Ee?e.evaluate(t):s(e)}function ud(){return m.pow(this,2).div(2)}function cd(){return this}const qe=class{constructor(e){this.negate=this.neg,this.negated=this.neg,this.sgn=this.sign,this.plus=this.add,this.subtract=this.sub,this.minus=this.sub,this.multiply=this.mul,this.times=this.mul,this.divide=this.div,this.divideBy=this.div,this.dividedBy=this.div,this.reciprocal=this.recip,this.reciprocate=this.recip,this.logarithm=this.log;let t;"inputs"in e&&(e.inputs=e.inputs.map(n=>typeof n=="object"&&Dt in n?n[Dt]:n)),"variable"in e?(typeof e.variable=="object"&&Dt in e.variable&&(e.variable=e.variable[Dt]),t=this.setupVariable(e)):"evaluate"in e?t=this.setupFormula(e):t=this.setupConstant(e),this.inputs=t.inputs,this.internalVariables=t.internalVariables,this.innermostVariable=t.innermostVariable,this.internalEvaluate=t.internalEvaluate,this.internalInvert=t.internalInvert,this.internalIntegrate=t.internalIntegrate,this.internalIntegrateInner=t.internalIntegrateInner,this.applySubstitution=t.applySubstitution}setupVariable({variable:e}){return{inputs:[e],internalVariables:1,innermostVariable:e,internalIntegrate:ud,internalIntegrateInner:cd,applySubstitution:Gn}}setupConstant({inputs:e}){if(e.length!==1)throw new Error("Evaluate function is required if inputs is not length 1");return{inputs:e,internalVariables:0}}setupFormula(e){var h,g;const{inputs:t,evaluate:n,invert:i,integrate:r,integrateInner:a,applySubstitution:l}=e,u=t.reduce((C,_)=>C+(_ instanceof qe?_.internalVariables:0),0),c=t.find(C=>C instanceof qe&&C.hasVariable()),d=u===1?c==null?void 0:c.innermostVariable:void 0,v=(h=c==null?void 0:c.isInvertible())!=null?h:!1,f=(g=c==null?void 0:c.isIntegrable())!=null?g:!1;return{inputs:t,internalEvaluate:n,internalInvert:v?i:void 0,internalIntegrate:f?r:void 0,internalIntegrateInner:a,applySubstitution:l,innermostVariable:d,internalVariables:u}}isInvertible(){return this.hasVariable()&&(this.internalInvert!=null||this.internalEvaluate==null)}isIntegrable(){return this.hasVariable()&&this.internalIntegrate!=null}isIntegralInvertible(){return this.isIntegrable()?this.getIntegralFormula().isInvertible():!1}hasVariable(){return this.internalVariables===1}evaluate(e){var t,n,i;return(i=(n=(t=this.internalEvaluate)==null?void 0:t.call(this,...this.inputs.map(r=>ke(r,e))))!=null?n:this.hasVariable()?e:null)!=null?i:ke(this.inputs[0])}equals(e){return this.inputs.length===e.inputs.length&&this.inputs.every((t,n)=>t instanceof qe&&e.inputs[n]instanceof qe?t.equals(e.inputs[n]):!(t instanceof qe)&&!(e.inputs[n]instanceof qe)&&o.eq(s(t),s(e.inputs[n])))&&this.internalEvaluate===e.internalEvaluate&&this.internalInvert===e.internalInvert&&this.internalIntegrate===e.internalIntegrate&&this.internalVariables===e.internalVariables}static constant(e){return new m({inputs:[e]})}static variable(e){return new m({variable:e})}static step(e,t,n){const i=n(m.variable(0)),r=ve(t);function a(u){return o.lt(u,s(r))?u:o.add(i.evaluate(o.sub(u,s(r))),s(r))}function l(u,c){if(R(c)&&i.isInvertible())return o.gt(u,s(r))&&(u=o.add(i.invert(o.sub(u,s(r))),s(r))),c.invert(u);throw new Error("Could not invert due to no input being a variable")}return new m({inputs:[e],evaluate:a,invert:i.isInvertible()&&i.hasVariable()?l:void 0})}static if(e,t,n,i){const r=U(0),a=m.variable(r),l=n(a),u=i==null?void 0:i(a),c=ve(t);function d(f){return s(c)?(r.value=f,l.evaluate()):u?(r.value=f,u.evaluate()):f}function v(f,h){if(!R(h)||!l.isInvertible()||u!=null&&!u.isInvertible())throw new Error("Could not invert due to no input being a variable");return s(c)?h.invert(l.invert(f)):u?h.invert(u.invert(f)):h.invert(f)}return new m({inputs:[e],evaluate:d,invert:l.isInvertible()&&l.hasVariable()?v:void 0})}static conditional(e,t,n,i){return m.if(e,t,n,i)}static abs(e){return new m({inputs:[e],evaluate:o.abs})}static neg(e){return new m({inputs:[e],evaluate:o.neg,invert:qu,applySubstitution:Bu,integrate:Vu})}static sign(e){return new m({inputs:[e],evaluate:o.sign})}static round(e){return new m({inputs:[e],evaluate:o.round})}static floor(e){return new m({inputs:[e],evaluate:o.floor})}static ceil(e){return new m({inputs:[e],evaluate:o.ceil})}static trunc(e){return new m({inputs:[e],evaluate:o.trunc})}static add(e,t){return new m({inputs:[e,t],evaluate:o.add,invert:Lu,integrate:ju,integrateInner:zu,applySubstitution:Gn})}static sub(e,t){return new m({inputs:[e,t],evaluate:o.sub,invert:Uu,integrate:Gu,integrateInner:Wu,applySubstitution:Gn})}static mul(e,t){return new m({inputs:[e,t],evaluate:o.mul,invert:Hu,integrate:Zu,applySubstitution:Xu})}static div(e,t){return new m({inputs:[e,t],evaluate:o.div,invert:Yu,integrate:Ju,applySubstitution:Ku})}static recip(e){return new m({inputs:[e],evaluate:o.recip,invert:Qu,integrate:ec})}static clamp(e,t,n){return new m({inputs:[e,t,n],evaluate:o.clamp,invert:Gn})}static pLog10(e){return new m({inputs:[e],evaluate:o.pLog10})}static absLog10(e){return new m({inputs:[e],evaluate:o.absLog10})}static log10(e){return new m({inputs:[e],evaluate:o.log10,invert:tc,integrate:rc})}static log(e,t){return new m({inputs:[e,t],evaluate:o.log,invert:ac,integrate:lc})}static log2(e){return new m({inputs:[e],evaluate:o.log2,invert:uc,integrate:fc})}static ln(e){return new m({inputs:[e],evaluate:o.ln,invert:pc,integrate:vc})}static pow(e,t){return new m({inputs:[e,t],evaluate:o.pow,invert:hc,integrate:bc})}static pow10(e){return new m({inputs:[e],evaluate:o.pow10,invert:yc,integrate:wc})}static pow_base(e,t){return new m({inputs:[e,t],evaluate:o.pow_base,invert:_c,integrate:Nc})}static root(e,t){return new m({inputs:[e,t],evaluate:o.root,invert:Cc,integrate:kc})}static factorial(e){return new m({inputs:[e],evaluate:o.factorial})}static gamma(e){return new m({inputs:[e],evaluate:o.gamma})}static lngamma(e){return new m({inputs:[e],evaluate:o.lngamma})}static exp(e){return new m({inputs:[e],evaluate:o.exp,invert:Mc,integrate:Sc})}static sqr(e){return m.pow(e,2)}static sqrt(e){return m.root(e,2)}static cube(e){return m.pow(e,3)}static cbrt(e){return m.root(e,3)}static tetrate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:Ic,invert:xc})}static iteratedexp(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:$c,invert:Ec})}static iteratedlog(e,t=10,n=1){return new m({inputs:[e,t,n],evaluate:Pc})}static slog(e,t=10){return new m({inputs:[e,t],evaluate:Tc,invert:Dc})}static layeradd10(e,t){return new m({inputs:[e,t],evaluate:o.layeradd10})}static layeradd(e,t,n=10){return new m({inputs:[e,t,n],evaluate:Ac,invert:Rc})}static lambertw(e){return new m({inputs:[e],evaluate:o.lambertw,invert:Fc})}static ssqrt(e){return new m({inputs:[e],evaluate:o.ssqrt,invert:Oc})}static pentate(e,t=2,n=o.fromComponents_noNormalize(1,0,1)){return new m({inputs:[e,t,n],evaluate:qc})}static sin(e){return new m({inputs:[e],evaluate:o.sin,invert:Gc,integrate:Bc})}static cos(e){return new m({inputs:[e],evaluate:o.cos,invert:Hc,integrate:jc})}static tan(e){return new m({inputs:[e],evaluate:o.tan,invert:Xc,integrate:Uc})}static asin(e){return new m({inputs:[e],evaluate:o.asin,invert:Vc,integrate:Wc})}static acos(e){return new m({inputs:[e],evaluate:o.acos,invert:Lc,integrate:Zc})}static atan(e){return new m({inputs:[e],evaluate:o.atan,invert:zc,integrate:Yc})}static sinh(e){return new m({inputs:[e],evaluate:o.sinh,invert:id,integrate:Kc})}static cosh(e){return new m({inputs:[e],evaluate:o.cosh,invert:ad,integrate:ed})}static tanh(e){return new m({inputs:[e],evaluate:o.tanh,invert:od,integrate:nd})}static asinh(e){return new m({inputs:[e],evaluate:o.asinh,invert:Jc,integrate:rd})}static acosh(e){return new m({inputs:[e],evaluate:o.acosh,invert:Qc,integrate:sd})}static atanh(e){return new m({inputs:[e],evaluate:o.atanh,invert:td,integrate:ld})}step(e,t){return m.step(this,e,t)}if(e,t){return m.if(this,e,t)}conditional(e,t){return m.if(this,e,t)}abs(){return m.abs(this)}neg(){return m.neg(this)}sign(){return m.sign(this)}round(){return m.round(this)}floor(){return m.floor(this)}ceil(){return m.ceil(this)}trunc(){return m.trunc(this)}add(e){return m.add(this,e)}sub(e){return m.sub(this,e)}mul(e){return m.mul(this,e)}div(e){return m.div(this,e)}recip(){return m.recip(this)}max(e){return m.max(this,e)}min(e){return m.min(this,e)}maxabs(e){return m.maxabs(this,e)}minabs(e){return m.minabs(this,e)}clamp(e,t){return m.clamp(this,e,t)}clampMin(e){return m.clampMin(this,e)}clampMax(e){return m.clampMax(this,e)}pLog10(){return m.pLog10(this)}absLog10(){return m.absLog10(this)}log10(){return m.log10(this)}log(e){return m.log(this,e)}log2(){return m.log2(this)}ln(){return m.ln(this)}pow(e){return m.pow(this,e)}pow10(){return m.pow10(this)}pow_base(e){return m.pow_base(this,e)}root(e){return m.root(this,e)}factorial(){return m.factorial(this)}gamma(){return m.gamma(this)}lngamma(){return m.lngamma(this)}exp(){return m.exp(this)}sqr(){return m.pow(this,2)}sqrt(){return m.root(this,2)}cube(){return m.pow(this,3)}cbrt(){return m.root(this,3)}tetrate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.tetrate(this,e,t)}iteratedexp(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.iteratedexp(this,e,t)}iteratedlog(e=10,t=1){return m.iteratedlog(this,e,t)}slog(e=10){return m.slog(this,e)}layeradd10(e){return m.layeradd10(this,e)}layeradd(e,t){return m.layeradd(this,e,t)}lambertw(){return m.lambertw(this)}ssqrt(){return m.ssqrt(this)}pentate(e=2,t=o.fromComponents_noNormalize(1,0,1)){return m.pentate(this,e,t)}sin(){return m.sin(this)}cos(){return m.cos(this)}tan(){return m.tan(this)}asin(){return m.asin(this)}acos(){return m.acos(this)}atan(){return m.atan(this)}sinh(){return m.sinh(this)}cosh(){return m.cosh(this)}tanh(){return m.tanh(this)}asinh(){return m.asinh(this)}acosh(){return m.acosh(this)}atanh(){return m.atanh(this)}};let Ee=qe;Ee.negate=qe.neg;Ee.negated=qe.neg;Ee.sgn=qe.sign;Ee.plus=qe.add;Ee.subtract=qe.sub;Ee.minus=qe.sub;Ee.multiply=qe.mul;Ee.times=qe.mul;Ee.divide=qe.div;Ee.divideBy=qe.div;Ee.dividedBy=qe.div;Ee.reciprocal=qe.recip;Ee.reciprocate=qe.recip;Ee.max=Rn(o.max);Ee.min=Rn(o.min);Ee.minabs=Rn(o.minabs);Ee.maxabs=Rn(o.maxabs);Ee.clampMin=Rn(o.clampMin);Ee.clampMax=Rn(o.clampMax);Ee.logarithm=qe.log;class m extends Ee{invert(t){if(this.internalInvert&&this.hasVariable())return this.internalInvert.call(this,t,...this.inputs);if(this.inputs.length===1&&this.hasVariable())return t;throw new Error("Cannot invert non-invertible formula")}evaluateIntegral(t){if(!this.isIntegrable())throw new Error("Cannot evaluate integral of formula without integral");return this.getIntegralFormula().evaluate(t)}invertIntegral(t){if(!this.isIntegrable()||!this.getIntegralFormula().isInvertible())throw new Error("Cannot invert integral of formula without invertible integral");return this.getIntegralFormula().invert(t)}calculateConstantOfIntegration(){const t=this.getIntegralFormula().evaluate(1),n=o.add(this.evaluate(0),this.evaluate(1)).div(2);return o.sub(n,t)}getIntegralFormula(t){if(this.integralFormula!=null&&t==null)return this.integralFormula;if(t==null){if(this.applySubstitution==null){if(t=[],this.internalIntegrate==null)throw new Error("Cannot integrate formula with non-integrable operation");let n=this.internalIntegrate.call(this,t,...this.inputs);t.forEach(i=>n=i(n)),this.integralFormula=n}else if(this.internalIntegrate)this.integralFormula=this.internalIntegrate.call(this,void 0,...this.inputs);else if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())this.integralFormula=this;else throw new Error("Cannot integrate formula without variable");return this.integralFormula}else{if(this.applySubstitution==null)throw new Error("Cannot have two complex operations in an integrable formula");if(t.push(n=>this.applySubstitution.call(this,n,...this.inputs)),this.internalIntegrateInner)return this.internalIntegrateInner.call(this,t,...this.inputs);if(this.internalIntegrate)return this.internalIntegrate.call(this,t,...this.inputs);if(this.inputs.length===1&&this.internalEvaluate==null&&this.hasVariable())return this;throw new Error("Cannot integrate formula without variable")}}}function Zr(e,t,n=!0,i,r=o.dInf){const a=ve(n),l=ve(i),u=ve(r);return w(()=>{var h,g,C,_;const c=s(u);if(o.eq(c,1))return o.gte(t.value,e.evaluate())?o.dOne:o.dZero;const d=s(a),v=(h=s(l))!=null?h:d?10:0;let f=0;if(o.gt(c,v)){if(!e.isInvertible())throw new Error("Cannot calculate max affordable of non-invertible formula with more maxBulkAmount than directSum");if(d){if(!e.isIntegralInvertible())throw new Error("Cannot calculate max affordable of formula with non-invertible integral");f=o.floor(e.invertIntegral(o.add(t.value,e.evaluateIntegral()))).sub((g=s(e.innermostVariable))!=null?g:0)}else f=o.floor(e.invert(t.value))}if(f=o.clampMax(f,c),v>0){f=o.sub(f,v).clampMin(0);let I;for(d?I=gn(e,f,!0,0):I=e.evaluate(o.add((C=s(e.innermostVariable))!=null?C:0,f));o.lt(f,c)&&o.lt(f,Number.MAX_SAFE_INTEGER)&&o.add(v,1).gte(f);){const P=e.evaluate(f.add((_=s(e.innermostVariable))!=null?_:0));if(o.add(I,P).lte(t.value))f=f.add(1),I=o.add(I,P);else break}}return f})}function gn(e,t,n=!0,i){var c;if(o.eq(t,1))return e.evaluate();const r=(c=s(e.innermostVariable))!=null?c:0;let a=o.add(t,r);const l=a;i!=null||(i=n?10:0),a=a.sub(i).clampMin(r);let u=0;if(o.gt(t,i)){if(!e.isInvertible())throw new Error("Cannot calculate cost with indirect sum of non-invertible formula");if(n){if(!e.isIntegrable())throw new Error("Cannot calculate cost with cumulative cost of non-integrable formula");if(u=o.sub(e.evaluateIntegral(a),e.evaluateIntegral()),l.gt(1e308))return o.add(u,o.sub(l,a).times(e.evaluate(a)))}else if(u=e.evaluate(a),a=a.add(1),l.gt(1e308))return o.sub(l,a).add(1).times(u)}for(let d=a.toNumber();d{const{addend:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.add(d,s(l)),invert:d=>o.sub(d,s(l)),getFormula:d=>m.add(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[kt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),0):o.lt(s(l),0))?"color: var(--danger)":""},[o.gte(s(l),0)?"+":"",Ut(s(l))])]))}})}function we(e){return Je(t=>{const{multiplier:n,description:i,enabled:r,smallerIsBetter:a}=e.call(t,t),l=ve(n),u=ve(i),c=r==null?void 0:ve(r);return{apply:d=>o.times(d,s(l)),invert:d=>o.div(d,s(l)),getFormula:d=>m.times(d,l),enabled:c,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(u)!=null?p("span",{class:"modifier-description"},[kt(s(u))]):null,p("span",{class:"modifier-amount",style:(a===!0?o.gt(s(l),1):o.lt(s(l),1))?"color: var(--danger)":""},[T("\xD7"),Ut(s(l))])]))}})}function dd(e){return Je(t=>{const{exponent:n,description:i,enabled:r,supportLowNumbers:a,smallerIsBetter:l}=e.call(t,t),u=ve(n),c=ve(i),d=r==null?void 0:ve(r);return{apply:v=>{let f=v;return a&&(f=o.add(f,1)),f=o.pow(f,s(u)),a&&(f=o.sub(f,1)),f},invert:v=>{let f=v;return a&&(f=o.add(f,1)),f=o.root(f,s(u)),a&&(f=o.sub(f,1)),f},getFormula:v=>a?m.add(v,1).pow(u).sub(1):m.pow(v,u),enabled:d,description:i==null?void 0:J(()=>p("div",{class:"modifier-container"},[s(c)!=null?p("span",{class:"modifier-description"},[kt(s(c)),a?" (+1 effective)":null]):null,p("span",{class:"modifier-amount",style:(l===!0?o.gt(s(u),1):o.lt(s(u),1))?"color: var(--danger)":""},[T("^"),Ut(s(u))])]))}})}function _t(e){return Je(()=>{const t=e();return{apply:n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.apply(i),n),invert:t.every(n=>n.invert!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduceRight((i,r)=>r.invert(i),n):void 0,getFormula:t.every(n=>n.getFormula!=null)?n=>t.filter(i=>s(i.enabled)!==!1).reduce((i,r)=>r.getFormula(i),n):void 0,enabled:t.some(n=>n.enabled!=null)?w(()=>t.filter(n=>s(n.enabled)!==!1).length>0):void 0,description:t.some(n=>n.description!=null)?J(()=>p(re,null,[t.filter(n=>s(n.enabled)!==!1).map(n=>s(n.description)).filter(n=>n).map(kt)])):void 0}})}const zi=m.variable(0).step(100,e=>e.pow(1.5)).step(o.pow(900,1.5).add(100),e=>e.pow(1.5)).step(o.pow(1500,1.5).pow(1.5).add(o.pow(900,1.5).add(100)),e=>e.pow(2)).pow(1.5),rn={id:"deselect",icon:"close",tooltip:e=>({text:"portals"in e.state?"Disconnect portals":"tools"in e.state?"Disconnect tools":"Disconnect resources"}),onClick(e){var t;Array.isArray((t=e.state)==null?void 0:t.data)?e.state={...e.state,data:[]}:"portals"in e.state?e.state={...e.state,portals:[]}:"resources"in e.state?e.state={...e.state,resources:[]}:"tools"in e.state&&(e.state={...e.state,tools:[]}),y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>{var t;return Array.isArray((t=e.state)==null?void 0:t.data)?e.state.data.length>0:"portals"in e.state?e.state.portals.length>0:"resources"in e.state?e.state.resources.length>0:"tools"in e.state?e.state.tools.length>0:!1}},Ft={id:"toggle",icon:"bolt",tooltip:e=>({text:e.state.powered?"Turn Off":`Turn On - Always runs for ${ft(y.nextPowerCost.value)} energy/s`}),onClick(e){e.state={...e.state,powered:!e.state.powered},y.board.selectedAction.value=null},fillColor:e=>e.state.powered?"var(--accent1)":"var(--locked)"};function _n(e,t=1/0){const n=e(m.variable(0));return{id:"moreConnections",icon:"hub",formula:n,tooltip(i){return{text:`Increase Connections - ${ft(n.evaluate(i.state.maxConnections))} energy`}},confirmationLabel:i=>o.gte(y.energy.value,n.evaluate(i.state.maxConnections))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(i){const r=n.evaluate(i.state.maxConnections);o.gte(y.energy.value,r)&&(y.energy.value=o.sub(y.energy.value,r),i.state={...i.state,maxConnections:o.add(i.state.maxConnections,1)},y.board.selectedAction.value=null)},visibility:i=>o.add(i.state.maxConnections,y.computedBonusConnectionsModifier.value).lt(t)}}function Xr(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="resource"){const r=((i=y.board.draggingNode.value)==null?void 0:i.state).type,{maxConnections:a,resources:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function fd(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="passive"){const r=(i=y.board.draggingNode.value)==null?void 0:i.state,{maxConnections:a,tools:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Ni(e,t){var n,i;if(((n=y.board.draggingNode.value)==null?void 0:n.type)==="portal"){const r=((i=y.board.draggingNode.value)==null?void 0:i.state).id,{maxConnections:a,portals:l}=e.state;return l.includes(r)?{text:"Disconnect",color:"var(--accent2)"}:o.add(a,y.computedBonusConnectionsModifier.value).lte(l.length)?{text:"Max connections",color:"var(--danger)"}:{text:t(r),color:"var(--accent2)"}}return null}function Yr(e,t){if(t.type!=="resource")return!1;const n=t.state.type,{maxConnections:i,resources:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function Jr(e,t){if(t.type!=="resource")return;const n=t.state.type,i=e.state.resources;i.includes(n)?e.state={...e.state,resources:i.filter(r=>r!==n)}:e.state={...e.state,resources:[...i,n]},y.board.selectedNode.value=e}function pd(e,t){if(t.type!=="passive")return!1;const n=t.state,{maxConnections:i,tools:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function gd(e,t){if(t.type!=="passive")return;const n=t.state,i=e.state.tools;i.includes(n)?e.state={...e.state,tools:i.filter(r=>r!==n)}:e.state={...e.state,tools:[...i,n]},y.board.selectedNode.value=e}function Ci(e,t){if(t.type!=="portal")return!1;const n=t.state.id,{maxConnections:i,portals:r}=e.state;return r.includes(n)?!0:!o.add(i,y.computedBonusConnectionsModifier.value).lte(r.length)}function ki(e,t){if(t.type!=="portal")return;const n=t.state.id,{portals:i}=e.state;i.includes(n)?e.state={...e.state,portals:i.filter(r=>r!==n)}:e.state={...e.state,portals:[...i,n]},y.board.selectedNode.value=e}function ye(e){return e===y.board.selectedNode.value||e.state.powered}function ie(e){return y.empowerer.value!=null&&ye(y.empowerer.value)&&y.empowerer.value.state.tools.includes(e)}function md(e){var a,l,u;const t=(u=(l=(a=y.resourceNodes.value[e])==null?void 0:a.state)==null?void 0:l.amount)!=null?u:0,n=y.resourceLevels.value[e],i=zi.evaluate(n),r=zi.evaluate(o.add(n,1));return o.sub(t,i).max(0).div(o.sub(r,i)).toNumber()}function un(e,t,n){if(t.value){const i=t.value.state,r=i[n],a=i.maxConnections;o.gt(r.length,o.add(a,e))&&(t.value.state={...t.value.state,[n]:r.slice(0,o.add(a,e).toNumber())})}}const vd={key:0},hd={key:0,class:"mark star"},bd=["src"],yd=Y({__name:"MarkNode",props:{mark:{type:[Boolean,String]}},setup(e){return(t,n)=>e.mark?(M(),A("div",vd,[e.mark===!0?(M(),A("div",hd)):(M(),A("img",{key:1,class:"mark",src:e.mark},null,8,bd))])):z("",!0)}});var ei=pe(yd,[["__scopeId","data-v-2207999f"]]);const wd=Y({__name:"Node",props:{id:null},setup(e){const n=Pe(e),i=pi(Hi,()=>{}),r=pi(Zi,()=>{}),a=ht(null),l=w(()=>a.value&&a.value.parentElement);return vt([l,n.id],([u,c],[d,v])=>{d&&r(s(v)),u&&i(c,u)}),Cr(()=>r(s(n.id))),(u,c)=>(M(),A("div",{class:"node",ref_key:"node",ref:a},null,512))}});var ti=pe(wd,[["__scopeId","data-v-a48cb382"]]),_d=Y({props:{display:{type:O(Object,String,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),onClick:Function,onHold:Function,canClick:{type:O(Boolean),required:!0},small:Boolean,mark:O(Boolean,String),id:{type:String,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,onClick:n,onHold:i}=Pe(e),r=ht("");It(()=>{var v;const u=$e(t);if(u==null){r.value="";return}if(xt(u)){r.value=de(u);return}const c=de((v=u.title)!=null?v:"","h3"),d=de(u.description,"div");r.value=de(J(()=>p("span",null,[u.title!=null?p("div",null,[p(c,null,null)]):null,p(d,null,null)])))});const{start:a,stop:l}=Rr(n,i);return{start:a,stop:l,comp:r,Visibility:Ce,isVisible:Ge,isHidden:yn,unref:s}}});function Nd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:[]]),onClick:t[0]||(t[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:t[1]||(t[1]=(...d)=>e.start&&e.start(...d)),onMouseleave:t[2]||(t[2]=(...d)=>e.stop&&e.stop(...d)),onMouseup:t[3]||(t[3]=(...d)=>e.stop&&e.stop(...d)),onTouchstartPassive:t[4]||(t[4]=(...d)=>e.start&&e.start(...d)),onTouchendPassive:t[5]||(t[5]=(...d)=>e.stop&&e.stop(...d)),onTouchcancelPassive:t[6]||(t[6]=(...d)=>e.stop&&e.stop(...d)),class:be({feature:!0,clickable:!0,can:e.unref(e.canClick),locked:!e.unref(e.canClick),small:e.small,...e.unref(e.classes)})},[e.unref(e.comp)?(M(),te(Xe(e.unref(e.comp)),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],38)):z("",!0)}var Kr=pe(_d,[["render",Nd],["__scopeId","data-v-211328c0"]]);const Qr=Symbol("Clickable");function Cd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Je(i=>{var l,u,c;const r=(l=e==null?void 0:e.call(i,i))!=null?l:{};r.id=nn("clickable-"),r.type=Qr,r[yt]=Kr;for(const d of t)(u=d.preConstruct)==null||u.call(d,r);if(Object.assign(r,n),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"canClick"),se(r,"canClick",!0),$(r,"classes"),$(r,"style"),$(r,"mark"),$(r,"display"),r.onClick){const d=r.onClick.bind(r);r.onClick=function(v){s(r.canClick)!==!1&&d(v)}}if(r.onHold){const d=r.onHold.bind(r);r.onHold=function(){s(r.canClick)!==!1&&d()}}for(const d of t)(c=d.postConstruct)==null||c.call(d,r);const a=t.reduce((d,v)=>{var f;return Object.assign(d,(f=v.getGatheredProps)==null?void 0:f.call(v,r))},{});return r[pt]=function(){const{display:d,visibility:v,style:f,classes:h,onClick:g,onHold:C,canClick:_,small:I,mark:P,id:S}=this;return{display:d,visibility:v,style:s(f),classes:h,onClick:g,onHold:C,canClick:_,small:I,mark:P,id:S,...a}},r})}function kd(e,t,n=[]){n=n.length===0?Jn(e,Qr):n;const i=typeof t=="function"?w(t):t;return e.on("update",()=>{s(i)&&n.filter(r=>s(r.canClick)).forEach(r=>{var a;return(a=r.onClick)==null?void 0:a.call(r)})})}const Md=["x1","y1","x2","y2"],Sd=Y({__name:"Link",props:{link:null,startNode:null,endNode:null,boundingRect:null},setup(e){const n=Pe(e),i=w(()=>{const a=n.startNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetStart&&(u.x+=n.link.value.offsetStart.x,u.y+=n.link.value.offsetStart.y),u}),r=w(()=>{const a=n.endNode.value.rect,l=n.boundingRect.value,u=l?{x:a.x+a.width/2-l.x,y:a.y+a.height/2-l.y}:{x:0,y:0};return n.link.value.offsetEnd&&(u.x+=n.link.value.offsetEnd.x,u.y+=n.link.value.offsetEnd.y),u});return(a,l)=>(M(),A("line",Wt({"stroke-width":"15px",stroke:"white"},e.link,{x1:s(i).x,y1:s(i).y,x2:s(r).x,y2:s(r).y}),null,16,Md))}});const Id=Y({__name:"Links",props:{links:null},setup(e){var c;const n=en(e,"links"),i=U(null),r=pi(Xi,U({})),a=pi(Yi,U(void 0)),l=U((c=i.value)==null?void 0:c.getBoundingClientRect());vt(a,()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()}),yi(()=>{var d;return l.value=(d=i.value)==null?void 0:d.getBoundingClientRect()});const u=w(()=>{var v,f;const d=r.value;return(f=(v=n.value)==null?void 0:v.filter(h=>{var g,C;return((g=d[h.startNode.id])==null?void 0:g.rect)&&((C=d[h.startNode.id])==null?void 0:C.rect)}))!=null?f:[]});return(d,v)=>(M(),A(re,null,[s(u)?(M(),A("svg",wa(Wt({key:0},d.$attrs)),[(M(!0),A(re,null,Dn(s(u),(f,h)=>(M(),te(Sd,{key:h,link:f,boundingRect:l.value,startNode:s(r)[f.startNode.id],endNode:s(r)[f.endNode.id]},null,8,["link","boundingRect","startNode","endNode"]))),128))],16)):z("",!0),N("div",{ref_key:"resizeListener",ref:i,class:"resize-listener"},null,512)],64))}});var xd=pe(Id,[["__scopeId","data-v-063f6d6b"]]);Y({props:{nodes:{type:O(Array),required:!0},leftSideNodes:O(Array),rightSideNodes:O(Array),branches:O(Array)},components:{Links:xd},setup(e){const{nodes:t,leftSideNodes:n,rightSideNodes:i}=Pe(e),r=ht();It(()=>{const u=$e(t);r.value=de(J(()=>p(re,null,[u.map(c=>p("span",{class:"row tree-row",style:"margin: 50px auto;"},[c.map(kt)]))])))});const a=ht();It(()=>{const u=$e(n);a.value=u?de(J(()=>p("span",{class:"left-side-nodes small"},[u.map(kt)]))):""});const l=ht();return It(()=>{const u=$e(i);l.value=u?de(J(()=>p("span",{class:"side-nodes small"},[u.map(kt)]))):""}),{unref:s,nodesComp:r,leftNodesComp:a,rightNodesComp:l}}});Y({props:{display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),onClick:Function,onHold:Function,color:O(String),glowColor:O(String),canClick:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ei,Node:ti},setup(e){const{onClick:t,onHold:n,display:i}=Pe(e),r=An(i),{start:a,stop:l}=Rr(t,n);return{start:a,stop:l,comp:r,unref:s,Visibility:Ce,isCoercableComponent:xt,isVisible:Ge,isHidden:yn}}});function Wn(e){const t=[],n={};let i=!1;function r(){return i||(t.push(...e()),n.base=t.map(u=>ve(u.base)),n.baseText=t.map(u=>ve(u.baseText)),n.visible=t.map(u=>ve(u.visible)),n.title=t.map(u=>ve(u.title)),n.subtitle=t.map(u=>ve(u.subtitle)),i=!0),t}const a=dt({},!1);return[J(()=>{const u=r();let c=!0;const d=u.map((v,f)=>{var P,S,D;if(s(n.visible[f])===!1)return null;const h=p("h3",{onClick:()=>a.value[f]=!a.value[f],style:"cursor: pointer"},[p("span",{class:"modifier-toggle"+(s(a.value[f])?" collapsed":"")},[T("\u25BC")]),s(n.title[f]),s(n.subtitle[f])!=null?p("span",{class:"subtitle"},[T(" ("),s(n.subtitle[f]),T(")")]):null]),g=s(a.value[f])?null:p(re,null,[p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[kt((P=s(n.baseText[f]))!=null?P:"Base")]),p("span",{class:"modifier-amount"},[Me((S=s(n.base[f]))!=null?S:1),v.unit])]),v.modifier.description==null?null:kt(s(v.modifier.description))]),C=!c;c=!1;const _=(D=s(n.base[f]))!=null?D:1,I=v.modifier.apply(_);return p(re,null,[C?p("br",null,null):null,p("div",{style:{"--unit":ue.alignUnits&&v.unit!=null?"'"+v.unit+"'":""}},[h,p("br",null,null),g,p("hr",null,null),p("div",{class:"modifier-container"},[p("span",{class:"modifier-description"},[T("Total")]),p("span",{class:"modifier-amount",style:(v.smallerIsBetter===!0?o.gt(I,_!=null?_:1):o.lt(I,_!=null?_:1))?"color: var(--danger)":""},[Ut(I),v.unit])])])])});return p(re,null,[d])}),a]}function Oi(e,t,n){const i=ve(t),r=ve(n);return w(()=>{const a=s(i),l=s(r);return o.gte(e.value,l)?"Now":o.lte(a,0)?"Never":_i(o.sub(l,e.value).div(a))})}function cn(e,t,n=1){const i=ve(t),r=ve(n);if(!e.hasVariable())throw new Error("Cannot create formula preview if the formula does not have a variable");return J(()=>{var a;if(s(i)){const l=Ut(e.evaluate()),u=Ut(e.evaluate(o.add(s((a=e.innermostVariable)!=null?a:0),s(r))));return p(re,null,[p("b",null,[p("i",null,[l,T(" \u2192 "),u])])])}return p(re,null,[Ut(e.evaluate())])})}const St={dirt:120,sand:60,gravel:40,wood:30,stone:24,coal:20,copper:15,iron:12,silver:10,gold:8,emerald:6,platinum:5,diamond:4,berylium:3,unobtainium:2,ultimatum:1},Lt=Object.keys(St),Le={dirt:{cost:1e3,name:"Pickaxe",type:"passive",state:"dirt"},sand:{cost:1e4,name:"Dowsing Rod",type:"dowsing",state:{resources:[],maxConnections:1,powered:!1}},gravel:{cost:1e5,name:"Ore Processor",type:"passive",state:"gravel"},wood:{cost:1e6,name:"Quarry",type:"quarry",state:{resources:[],maxConnections:1,powered:!1,progress:0}},stone:{cost:1e7,name:"Energizer",type:"passive",state:"stone"},coal:{cost:1e8,name:"Tool Empowerer",type:"empowerer",state:{tools:[],maxConnections:1,powered:!1}},copper:{cost:1e9,name:"Book",type:"passive",state:"copper"},iron:{cost:1e10,name:"Portal Generator",type:"portalGenerator",state:{tier:void 0,influences:[]}},silver:{cost:1e12,name:"Robotics",type:"passive",state:"silver"},gold:{cost:1e15,name:"Booster",type:"booster",state:{portals:[],maxConnections:1,powered:!1,level:1}},emerald:{cost:1e19,name:"Artificial Intelligence",type:"passive",state:"emerald"},platinum:{cost:1e24,name:"Upgrader",type:"upgrader",state:{portals:[],maxConnections:1,powered:!1}},diamond:{cost:1e30,name:"Machine Learning",type:"passive",state:"diamond"},berylium:{cost:1e37,name:"Automator",type:"automator",state:{portals:[],maxConnections:1,powered:!1}},unobtainium:{cost:1e45,name:"National Grid",type:"passive",state:"unobtainium"},ultimatum:{cost:1e54,name:"Investments",type:"investments",state:{portals:[],maxConnections:1,powered:!1}}},Tt={dirt:"BOGO Coupon",sand:"Metal Detector",gravel:"Neural Networks",wood:"Mining Laser",stone:"Replicator",coal:"Planar Intelligence",copper:"Efficient Code",iron:"Trade Agreements",silver:"Machine Synergizer",gold:"XP Market",emerald:"Efficient Portals",platinum:"Time Dilation",diamond:"Paypal",berylium:"Tiered Mining",unobtainium:"Overclocked Portals",ultimatum:"Rebates"},$d={dirt:{description:e=>e?"Quadruples mining speed":"Doubles mining speed"},gravel:{description:e=>e?"Quadruples mine ore drops":"Doubles mine ore drops"},stone:{description:e=>e?"Quadruples energy gain":"Doubles energy gain"},copper:{description:e=>e?"Material level is 40% stronger":"Material level is 20% stronger"},silver:{description:e=>e?"Quadruples each plane's resource gain":"Doubles each plane's resource gain"},diamond:{description:e=>e?"+20% plane's resource gain per upgrade bought":"+10% plane's resource gain per upgrade bought"},emerald:{description:e=>e?"+2% plane's resource gain per minute active":"+1% plane's resource gain per minute active"},unobtainium:{description:e=>e?"+2 max connections per machine":"+1 max connections per machine"},dirtRelic:{description:e=>e?"2 free levels for repeatables":"1 free level for repeatables"},sandRelic:{description:e=>e?"Treasure's 2 tiers stronger":"Treasure's 1 tier stronger"},gravelRelic:{description:e=>e?"+2% plane's resource gain per repeatable purchase (diminishing)":"+1% plane's resource gain per repeatable purchase (diminishing)"},woodRelic:{description:e=>e?"(Relics)^2 boost mine speed":"Relics boost mine speed"},stoneRelic:{description:e=>e?"All upgrades apply twice":"Non-multiplicative upgrades apply twice"},coalRelic:{description:e=>e?"Every treasure boosts planar speed by +20%":"Every treasure boosts planar speed by +10%"},copperRelic:{description:e=>e?"Power 2 machines free":"Power 1 machine free"},ironRelic:{description:e=>e?"Conversions give quadruple output":"Conversions give double output"},silverRelic:{description:e=>e?"(Powered machines)^2 boost quarry speed":"Powered machines boost quarry speed"},goldRelic:{description:e=>e?"Each treasure gives +20% XP gain":"Each treasure gives +10% XP gain"},emeraldRelic:{description:e=>e?"Creating portals costs 20x less energy":"Creating portals costs 10x less energy"},platinumRelic:{description:e=>e?"Quadruple dimensions' tick rate":"Double dimensions' tick rate"},diamondRelic:{description:e=>e?"Repeatables/dimensions buy max at once":"Repeatables buy max at once"},beryliumRelic:{description:e=>e?"log(energy)^0.5 boosts planar speed":"log(energy)^0.25 boosts planar speed"},unobtainiumRelic:{description:e=>e?"Upgrades/repeatables/dimensions/prestige no longer spend on purchase":"Upgrades/repeatables no longer spend on purchase"}},Nt={increaseResources:{display:"+resource",description:e=>{const t=e.data;return t.length===0?"Increase resource odds - Drag a resource to me!":t.length===1?`Increase ${t[0]}'s odds`:`Increase ${t.length} resources' odds`},cost:2,initialData:[]},decreaseResources:{display:"-resource",description:e=>{const t=e.data;return t.length===0?"Decrease resource odds - Drag a resource to me!":t.length===1?`Decrease ${t[0]}'s odds`:`Decrease ${t.length} resources' odds`},cost:2,initialData:[]},increaseLength:{display:"+length",description:"Increase length",cost:100,initialData:void 0},increaseCaches:{display:"+caches",description:"Increase caches odds",cost:10,initialData:void 0},increaseGens:{display:"+gens",description:"Increase generators odds",cost:10,initialData:void 0},increaseInfluences:{display:"+influences",description:"Increase influences odds",cost:10,initialData:void 0},increaseEnergyMults:{display:"+energy mults",description:"Increase energy mults odds",cost:10,initialData:void 0},increaseResourceMults:{display:"+resource mults",description:"Increase resource mults odds",cost:10,initialData:void 0},increaseDiff:{display:"+diff",description:"Increase difficulty/rewards odds",cost:10,initialData:void 0},decreaseDiff:{display:"-diff",description:"Decrease difficulty/rewards odds",cost:10,initialData:void 0},increaseRewards:{display:"+rewards",description:"Increase rewards level",cost:1e4,initialData:void 0},relic:{display:"+relic",description:"Max length/difficulty, add tier-unique relic",cost:1e6,initialData:void 0}},qi=m.variable(0).add(8).times(2).pow10();const Ed=Y({__name:"Spacer",props:{width:{default:"8px"},height:{default:"17px"}},setup(e){return(t,n)=>(M(),A("div",{style:je({width:e.width,height:e.height})},null,4))}});function Ln(e){return Je(t=>{var i;const n=e.call(t,t);return n.partialDisplay=r=>p("span",{style:s(n.requirementMet)?"":"color: var(--danger)"},[bi(n.resource,n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),n.display=r=>p("div",null,[s(n.requiresPay)?"Costs: ":"Requires: ",bi(n.resource,n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost))," ",n.resource.displayName]),$(n,"visibility"),se(n,"visibility",Ce.Visible),$(n,"cost"),$(n,"requiresPay"),se(n,"requiresPay",!0),$(n,"cumulativeCost"),se(n,"cumulativeCost",!0),$(n,"maxBulkAmount"),se(n,"maxBulkAmount",1),$(n,"directSum"),se(n,"pay",function(r){const a=n.cost instanceof m?gn(n.cost,r!=null?r:1,s(n.cumulativeCost),s(n.directSum)):s(n.cost);n.resource.value=o.sub(n.resource.value,a).max(0)}),n.canMaximize=w(()=>{var u;if(!(n.cost instanceof m))return!1;const r=s(n.maxBulkAmount);if(o.lte(r,1))return!1;const a=s(n.cumulativeCost),l=(u=s(n.directSum))!=null?u:a?10:0;return o.lte(r,l)?!0:!(!n.cost.isInvertible()||a===!0&&!n.cost.isIntegrable())}),n.cost instanceof m?n.requirementMet=Zr(n.cost,n.resource,(i=n.cumulativeCost)!=null?i:!0,n.directSum,n.maxBulkAmount):n.requirementMet=w(()=>o.gte(n.resource.value,s(n.cost))),n})}function tr(e){return Je(()=>({requirementMet:w(()=>Ge(e.visibility)),visibility:Ce.None,requiresPay:!1}))}function Pd(e,t){return Je(()=>({requirementMet:ve(e),partialDisplay:t==null?void 0:J(()=>kt(t)),display:t==null?void 0:J(()=>p(re,null,[T("Req: "),kt(t)])),visibility:t==null?Ce.None:Ce.Visible,requiresPay:!1}))}function Mi(e){if(Rt(e))return e.every(Mi);const t=s(e.requirementMet);return typeof t=="boolean"?t:o.gt(t,0)}function ea(e){if(Rt(e))return e.map(ea).reduce(o.min);const t=s(e.requirementMet);return typeof t=="boolean"?t?o.dInf:0:o.gt(t,1)&&s(e.canMaximize)!==!0?1:t}function Si(e,t=1){var n,i;if(Rt(e)&&(e=e.filter(r=>Ge(r.visibility)),e.length===1&&(e=e[0])),Rt(e)){e=e.filter(l=>"partialDisplay"in l);const r=e.filter(l=>s(l.requiresPay)),a=e.filter(l=>!s(l.requiresPay));return p(re,null,[r.length>0?p("div",null,[T("Costs:")," ",gr(r.map(l=>l.partialDisplay(t)),p(re,null,[T(", ")]))]):null,a.length>0?p("div",null,[T("Requires:")," ",gr(a.map(l=>l.partialDisplay(t)),p(re,null,[T(", ")]))]):null])}return(i=(n=e.display)==null?void 0:n.call(e))!=null?i:p(re,null,null)}function ta(e,t=1){var n;Rt(e)?e.filter(i=>s(i.requiresPay)).forEach(i=>{var r;return(r=i.pay)==null?void 0:r.call(i,t)}):s(e.requiresPay)&&((n=e.pay)==null||n.call(e,t))}var Td=Y({props:{visibility:{type:O(Number,Boolean),required:!0},display:O(Object,String,Function),earned:{type:O(Boolean),required:!0},requirements:O(Object,Array),image:O(String),style:O(String,Object,Array),classes:O(Object),mark:O(Boolean,String),small:O(Boolean),id:{type:String,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,requirements:n,earned:i}=Pe(e),r=ht("");return It(()=>{const a=$e(t);if(a==null){r.value="";return}if(xt(a)){r.value=de(a);return}const l=de(a.requirement?a.requirement:J(()=>{var d;return Si((d=$e(n))!=null?d:[])}),"h3"),u=de(a.effectDisplay||"","b"),c=$e(i)?de(a.optionsDisplay||"","span"):"";r.value=de(J(()=>p("span",null,[p(l,null,null),a.effectDisplay!=null?p("div",null,[p(u,null,null)]):null,a.optionsDisplay!=null?p("div",{class:"equal-spaced"},[p(c,null,null)]):null])))}),{comp:r,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Dd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0,backgroundImage:e.earned&&e.image&&`url(${e.image})`||""},(c=e.unref(e.style))!=null?c:[]]),class:be({feature:!0,achievement:!0,locked:!e.unref(e.earned),done:e.unref(e.earned),small:e.unref(e.small),...e.unref(e.classes)})},[e.comp?(M(),te(Xe(e.comp),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):z("",!0)}var Ad=pe(Td,[["render",Dd],["__scopeId","data-v-5673325a"]]);const Rd=wi(),Fd=Symbol("Achievement");let En=function(e){return e.All="all",e.Configurable="configurable",e.Incomplete="incomplete",e.None="none",e}({});function Od(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var c,d,v;const a=(c=e==null?void 0:e.call(r,r))!=null?c:{};a.id=nn("achievement-"),a.type=Fd,a[yt]=Ad;for(const f of t)(d=f.preConstruct)==null||d.call(f,a);a.earned=n,a.complete=function(){var h,g;n.value=!0;const f=a;if((h=f.onComplete)==null||h.call(f),f.display!=null&&s(f.showPopups)===!0){const C=s(f.display);let _;xt(C)?_=de(C):C.requirement!=null?_=de(C.requirement):_=Si((g=f.requirements)!=null?g:[]),Rd.info(p("div",null,[p("h3",null,[T("Treasure earned!")]),p("div",null,[p(_,null,null)])]))}},Object.assign(a,i),$(a,"visibility"),se(a,"visibility",Ce.Visible);const l=a.visibility;a.visibility=_a(()=>{const f=s(a.display);switch(ue.msDisplay){default:case En.All:return s(l);case En.Configurable:return s(a.earned)&&!(f!=null&&typeof f=="object"&&"optionsDisplay"in f)?Ce.None:s(l);case En.Incomplete:return s(a.earned)?Ce.None:s(l);case En.None:return Ce.None}}),$(a,"display"),$(a,"mark"),$(a,"small"),$(a,"image"),$(a,"style"),$(a,"classes"),$(a,"showPopups"),se(a,"showPopups",!0);for(const f of t)(v=f.postConstruct)==null||v.call(f,a);const u=t.reduce((f,h)=>{var g;return Object.assign(f,(g=h.getGatheredProps)==null?void 0:g.call(h,a))},{});if(a[pt]=function(){const{visibility:f,display:h,requirements:g,earned:C,image:_,style:I,classes:P,mark:S,small:D,id:V}=this;return{visibility:f,display:h,requirements:g,earned:C,image:_,style:s(I),classes:P,mark:S,small:D,id:V,...u}},a.requirements){const f=a,h=[tr(f),Pd(()=>!f.earned.value),...Rt(a.requirements)?a.requirements:[a.requirements]];It(()=>{ue.active===K.id&&Mi(h)&&f.complete()})}return a})}Ye.on("loadSettings",e=>{se(e,"msDisplay",En.All)});const qd=Object.values(En).map(e=>({label:tt(e),value:e}));Ps(J(()=>p(Qi,{title:J(()=>p("span",{class:"option-title"},[T("Show achievements"),p("desc",null,[T("Select which achievements to display based on criterias.")])])),options:qd,"onUpdate:modelValue":e=>ue.msDisplay=e,modelValue:ue.msDisplay},null)));const Vd=Y({props:{progress:{type:O(String,Object,Number),required:!0},width:{type:O(Number),required:!0},height:{type:O(Number),required:!0},direction:{type:O(String),required:!0},display:O(Object,String,Function),visibility:{type:O(Number,Boolean),required:!0},style:O(Object,String,Array),classes:O(Object),borderStyle:O(Object,String,Array),textStyle:O(Object,String,Array),baseStyle:O(Object,String,Array),fillStyle:O(Object,String,Array),mark:O(Boolean,String),id:{type:String,required:!0}},components:{MarkNode:ei,Node:ti},setup(e){const{progress:t,width:n,height:i,direction:r,display:a}=Pe(e),l=w(()=>{let d=t.value instanceof o?t.value.toNumber():Number(t.value);return(1-Math.min(Math.max(d,0),1))*100}),u=w(()=>{const d={width:$e(n)+.5+"px",height:$e(i)+.5+"px"};switch(s(r)){case G.Up:d.clipPath=`inset(${l.value}% 0% 0% 0%)`,d.width=$e(n)+1+"px";break;case G.Down:d.clipPath=`inset(0% 0% ${l.value}% 0%)`,d.width=$e(n)+1+"px";break;case G.Right:d.clipPath=`inset(0% ${l.value}% 0% 0%)`;break;case G.Left:d.clipPath=`inset(0% 0% 0% ${l.value} + '%)`;break;case G.Default:d.clipPath="inset(0% 50% 0% 0%)";break}return d}),c=An(a);return{normalizedProgress:l,barStyle:u,component:c,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});function Bd(e,t,n,i,r,a){var c,d,v,f,h,g,C;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("div",{key:0,style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px",visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),class:be({bar:!0,...e.unref(e.classes)})},[N("div",{class:"overlayTextContainer border",style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(d=e.unref(e.borderStyle))!=null?d:{}])},[e.component?(M(),A("span",{key:0,class:"overlayText",style:je(e.unref(e.textStyle))},[(M(),te(Xe(e.component)))],4)):z("",!0)],4),N("div",{class:"border",style:je([{width:e.unref(e.width)+"px",height:e.unref(e.height)+"px"},(v=e.unref(e.style))!=null?v:{},(f=e.unref(e.baseStyle))!=null?f:{},(h=e.unref(e.borderStyle))!=null?h:{}])},[N("div",{class:"fill",style:je([e.barStyle,(g=e.unref(e.style))!=null?g:{},(C=e.unref(e.fillStyle))!=null?C:{}])},null,4)],4),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],6)):z("",!0)}var Ld=pe(Vd,[["render",Bd],["__scopeId","data-v-6bd06b56"]]);const jd=Symbol("Bar");function zd(e,...t){const n=t.reduce((i,r)=>{var a;return Object.assign(i,(a=r.getPersistentData)==null?void 0:a.call(r))},{});return Je(i=>{var l,u;const r=e.call(i,i);r.id=nn("bar-"),r.type=jd,r[yt]=Ld;for(const c of t)(l=c.preConstruct)==null||l.call(c,r);Object.assign(r,n),$(r,"visibility"),se(r,"visibility",Ce.Visible),$(r,"width"),$(r,"height"),$(r,"direction"),$(r,"style"),$(r,"classes"),$(r,"borderStyle"),$(r,"baseStyle"),$(r,"textStyle"),$(r,"fillStyle"),$(r,"progress"),$(r,"display"),$(r,"mark");for(const c of t)(u=c.postConstruct)==null||u.call(c,r);const a=t.reduce((c,d)=>{var v;return Object.assign(c,(v=d.getGatheredProps)==null?void 0:v.call(d,r))},{});return r[pt]=function(){const{progress:c,width:d,height:v,direction:f,display:h,visibility:g,style:C,classes:_,borderStyle:I,textStyle:P,baseStyle:S,fillStyle:D,mark:V,id:oe}=this;return{progress:c,width:d,height:v,direction:f,display:h,visibility:g,style:s(C),classes:_,borderStyle:I,textStyle:P,baseStyle:S,fillStyle:D,mark:V,id:oe,...a}},r})}function Ud(e,...t){return Je(n=>{var r,a;const i=e.call(n,n);for(const l of t)(r=l.preConstruct)==null||r.call(l,i);i.formula=i.formula(m.variable(i.baseResource)),i.currentGain==null&&(i.currentGain=w(()=>{let l=o.floor(i.formula.evaluate(i.baseResource.value)).max(0);return s(i.buyMax)===!1&&(l=l.min(1)),l})),i.actualGain==null&&(i.actualGain=i.currentGain),i.currentAt==null&&(i.currentAt=w(()=>i.formula.invert(o.floor(s(i.currentGain))))),i.nextAt==null&&(i.nextAt=w(()=>i.formula.invert(o.floor(s(i.currentGain)).add(1)))),i.convert==null&&(i.convert=function(){var u;const l=s(i.currentGain);i.gainResource.value=o.add(i.gainResource.value,l),i.spend(l),(u=i.onConvert)==null||u.call(i,l)}),i.spend==null&&(i.spend=function(){i.baseResource.value=0}),$(i,"currentGain"),$(i,"actualGain"),$(i,"currentAt"),$(i,"nextAt"),$(i,"buyMax"),se(i,"buyMax",!0);for(const l of t)(a=l.postConstruct)==null||a.call(l,i);return i})}function Gd(e){return Ud(e)}function Wd(e,t,n=1,i=o.dInf){const r=ve(n),a=ve(i);e.on("preUpdate",l=>{const u=s(r);o.neq(u,0)&&(t.gainResource.value=o.add(t.gainResource.value,o.times(u,l).times(o.ceil(s(t.actualGain)))).min(s(a)).max(t.gainResource.value))})}const Hd={postConstruct(e){e.amount===void 0&&console.error(`Decorated feature ${e.id} does not contain the required 'amount' property"`),$(e,"bonusAmount"),e.totalAmount===void 0&&(e.totalAmount=w(()=>{var t;return o.add(s((t=e.amount)!=null?t:0),s(e.bonusAmount))}))}},na=Symbol("Repeatable");function hr(e,...t){const n=dt(0),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var h,g,C;const a=e.call(r,r);a.id=nn("repeatable-"),a.type=na,a[yt]=Kr;for(const _ of t)(h=_.preConstruct)==null||h.call(_,a);a.amount=n,a.amount[tn]=(g=a.initialAmount)!=null?g:0,Object.assign(a,i);const l={requirementMet:w(()=>o.sub(s(a.limit),a.amount.value)),requiresPay:!1,visibility:Ce.None,canMaximize:!0},u=tr(a);Rt(a.requirements)?(a.requirements.unshift(u),a.requirements.push(l)):a.requirements=[u,a.requirements,l],a.maxed=w(()=>o.gte(a.amount.value,s(a.limit))),$(a,"classes");const c=a.classes;a.classes=w(()=>{const _=s(c)||{};return a.maxed.value&&(_.bought=!0),_}),a.amountToIncrease=w(()=>o.clampMin(ea(a.requirements),1)),a.canClick=w(()=>Mi(a.requirements));const d=a.onClick;a.onClick=function(_){var S;const I=a;if(!s(I.canClick))return;const P=(S=s(a.amountToIncrease))!=null?S:1;ta(a.requirements,P),I.amount.value=o.add(I.amount.value,P),d==null||d(_)},$(a,"display");const v=a.display;a.display=J(()=>{var I,P,S;const _=s(v);if(xt(_)){const D=de(_);return p(D,null,null)}if(_!=null){const D=a,V=de((I=_.title)!=null?I:"","h3"),oe=de((P=_.description)!=null?P:""),le=de((S=_.effectDisplay)!=null?S:"");return p("span",null,[_.title==null?null:p("div",null,[p(V,null,null)]),_.description==null?null:p(oe,null,null),_.showAmount===!1?null:p("div",null,[p("br",null,null),p(re,null,[T("Amount: "),ft(D.amount.value)]),o.isFinite(s(D.limit))?p(re,null,[T(" / "),ft(s(D.limit))]):void 0]),_.effectDisplay==null?null:p("div",null,[p("br",null,null),T("Currently: "),p(le,null,null)]),D.maxed.value?null:p("div",null,[p("br",null,null),Si(D.requirements,s(a.amountToIncrease))])])}return""}),$(a,"visibility"),se(a,"visibility",Ce.Visible),$(a,"limit"),se(a,"limit",o.dInf),$(a,"style"),$(a,"mark"),$(a,"small");for(const _ of t)(C=_.postConstruct)==null||C.call(_,a);const f=t.reduce((_,I)=>{var P;return Object.assign(_,(P=I.getGatheredProps)==null?void 0:P.call(I,a))},{});return a[pt]=function(){const{display:_,visibility:I,style:P,classes:S,onClick:D,canClick:V,small:oe,mark:le,id:Q}=this;return{display:_,visibility:I,style:s(P),classes:S,onClick:D,canClick:V,small:oe,mark:le,id:Q,...f}},a})}const Zd=Symbol("Reset");function Xd(e){return Je(t=>{const n=e.call(t,t);return n.id=nn("reset-"),n.type=Zd,n.reset=function(){var r;const i=a=>{if(a!=null&&typeof a=="object")if(tn in a){const l=a;l.value=l[tn]}else!(a instanceof o)&&!Oe(a)&&Object.values(a).forEach(l=>i(l))};s(n.thingsToReset).forEach(i),Ye.emit("reset",n),(r=n.onReset)==null||r.call(n)},$(n,"thingsToReset"),n})}const ci={};Ye.on("removeLayer",e=>{var t;(t=ci[e.id])==null||t.call(ci),ci[e.id]=void 0});function Vi(e,t){return $(t,"display"),$(t,"classes"),$(t,"style"),$(t,"direction"),se(t,"direction",G.Up),$(t,"xoffset"),$(t,"yoffset"),t.pinnable&&(t.pinned=dt(!1,!1)),Gt(()=>{t.pinnable&&("pinned"in e?(console.error("Cannot add pinnable tooltip to element that already has a property called 'pinned'"),t.pinnable=!1,qr(t.pinned)):e.pinned=t.pinned);const n=e[yt];e[yt]=Fe;const i=e[pt].bind(e);e[pt]=function(){const{display:a,classes:l,style:u,direction:c,xoffset:d,yoffset:v,pinned:f}=this;return{element:{[yt]:n,[pt]:i},display:a,classes:l,style:s(u),direction:c,xoffset:d,yoffset:v,pinned:f}}.bind(t)}),t}var Yd=Y({props:{display:{type:O(String,Object,Function),required:!0},visibility:{type:O(Number,Boolean),required:!0},style:O(String,Object,Array),classes:O(Object),requirements:{type:Object,required:!0},canPurchase:{type:O(Boolean),required:!0},bought:{type:O(Boolean),required:!0},mark:O(Boolean,String),id:{type:String,required:!0},purchase:{type:Function,required:!0}},components:{Node:ti,MarkNode:ei},setup(e){const{display:t,requirements:n,bought:i}=Pe(e),r=ht("");return It(()=>{const a=$e(t);if(a==null){r.value="";return}if(xt(a)){r.value=de(a);return}const l=de(a.title||"","h3"),u=de(a.description,"div"),c=de(a.effectDisplay||"");r.value=de(J(()=>p("span",null,[a.title!=null?p("div",null,[p(l,null,null)]):null,p(u,null,null),a.effectDisplay!=null?p("div",null,[T("Currently: "),p(c,null,null)]):null,i.value?null:p(re,null,[p("br",null,null),Si(n.value)])])))}),{component:r,unref:s,Visibility:Ce,isVisible:Ge,isHidden:yn}}});const Jd=["disabled"];function Kd(e,t,n,i,r,a){var c;const l=Mt("MarkNode"),u=Mt("Node");return e.isVisible(e.visibility)?(M(),A("button",{key:0,style:je([{visibility:e.isHidden(e.visibility)?"hidden":void 0},(c=e.unref(e.style))!=null?c:{}]),onClick:t[0]||(t[0]=(...d)=>e.purchase&&e.purchase(...d)),class:be({feature:!0,upgrade:!0,can:e.unref(e.canPurchase),locked:!e.unref(e.canPurchase),bought:e.unref(e.bought),...e.unref(e.classes)}),disabled:!e.unref(e.canPurchase)},[e.unref(e.component)?(M(),te(Xe(e.unref(e.component)),{key:0})):z("",!0),p(l,{mark:e.unref(e.mark)},null,8,["mark"]),p(u,{id:e.id},null,8,["id"])],14,Jd)):z("",!0)}var Qd=pe(Yd,[["render",Kd],["__scopeId","data-v-9be6bac0"]]);const nr=Symbol("Upgrade");function br(e,...t){const n=dt(!1,!1),i=t.reduce((r,a)=>{var l;return Object.assign(r,(l=a.getPersistentData)==null?void 0:l.call(a))},{});return Je(r=>{var c,d;const a=e.call(r,r);a.id=nn("upgrade-"),a.type=nr,a[yt]=Qd;for(const v of t)(c=v.preConstruct)==null||c.call(v,a);a.bought=n,Object.assign(a,i),a.canPurchase=w(()=>!n.value&&Mi(a.requirements)),a.purchase=function(){var f;const v=a;!s(v.canPurchase)||(ta(a.requirements),n.value=!0,(f=v.onPurchase)==null||f.call(v))};const l=tr(a);Rt(a.requirements)?a.requirements.unshift(l):a.requirements=[l,a.requirements],$(a,"visibility"),se(a,"visibility",Ce.Visible),$(a,"classes"),$(a,"style"),$(a,"display"),$(a,"mark");for(const v of t)(d=v.postConstruct)==null||d.call(v,a);const u=t.reduce((v,f)=>{var h;return Object.assign(v,(h=f.getGatheredProps)==null?void 0:h.call(f,a))},{});return a[pt]=function(){const{display:v,visibility:f,style:h,classes:g,requirements:C,canPurchase:_,bought:I,mark:P,id:S,purchase:D}=this;return{display:v,visibility:f,style:s(h),classes:g,requirements:C,canPurchase:_,bought:I,mark:P,id:S,purchase:D,...u}},a})}function ef(e,t,n=[]){n=n.length===0?Jn(e,nr):n;const i=Xn(t)?w(t):t;e.on("update",()=>{s(i)&&n.forEach(r=>r.purchase())})}function tf(e,t,n,i){return function(){e>>>=0,t>>>=0,n>>>=0,i>>>=0;let r=e+t|0;return e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,i=i+1|0,r=r+i|0,n=n+r|0,(r>>>0)/4294967296}}const nf={1:["b","c","d","f","g","h","i","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"],2:["a","e","o","u"],3:["br","cr","dr","fr","gr","pr","str","tr","bl","cl","fl","gl","pl","sl","sc","sk","sm","sn","sp","st","sw","ch","sh","th","wh"],4:["ae","ai","ao","au","a","ay","ea","ei","eo","eu","e","ey","ua","ue","ui","uo","u","uy","ia","ie","iu","io","iy","oa","oe","ou","oi","o","oy"],5:["turn","ter","nus","rus","tania","hiri","hines","gawa","nides","carro","rilia","stea","lia","lea","ria","nov","phus","mia","nerth","wei","ruta","tov","zuno","vis","lara","nia","liv","tera","gantu","yama","tune","ter","nus","cury","bos","pra","thea","nope","tis","clite"],6:["una","ion","iea","iri","illes","ides","agua","olla","inda","eshan","oria","ilia","erth","arth","orth","oth","illon","ichi","ov","arvis","ara","ars","yke","yria","onoe","ippe","osie","one","ore","ade","adus","urn","ypso","ora","iuq","orix","apus","ion","eon","eron","ao","omia"]},yr=[[1,2,5],[2,3,6],[3,4,5],[4,3,6],[3,4,2,5],[2,1,3,6],[3,4,2,5],[4,3,1,6],[3,4,1,4,5],[4,1,4,3,6]];function Bi(e){const t=yr[Math.floor(e()*yr.length)];let n="";for(let i=0;in-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}const _r=wi();function ia(e,t,n,i){return Ji(e,function(){const r=tf(0,n>>0,n>>32,1);for(let q=0;q<12;q++)r();const a=Bi(r),l=jn([.64,.75,.55],r),u=jn([.18,.2,.25],r),c=$n(0,Bi(r)),d=dt(0),v=Lt.indexOf(t);let f=r();const h=i.reduce((q,L)=>(q[L.type]=L.data,q),{});"increaseDiff"in h&&(f=f/2+.5),"decreaseDiff"in h&&(f=f/2),"relic"in h&&(f=1);const g=f+v+1,C=y.toolNodes.value.sandRelic!=null?ie("sandRelic")?2:1:0,_=dt(C),I=w(()=>("increaseRewards"in h?g+1:g)+_.value);let P="relic"in h?v+2:Math.ceil(r()*(v+2));"increaseLength"in h&&P++;const S=[],D=_t(()=>S),V=w(()=>D.apply(0)),oe=[],le={};function Q({feature:q,canClick:L,modifier:Se,cost:Qe,previewModifier:kn,showETA:ze,previewCost:$t}){L=ve(L),ze=ve(ze);const Vt=mr(q);oe.push({shouldShowPreview:w(()=>s(L)&&Vt.value),modifier:_t(()=>{const Et=S.slice();return Et.splice(Et.indexOf(Se),1,kn),Et}),cost:$t!=null?$t:Qe}),S.push(Se);const Bt=Oi(c,V,()=>ke(Qe)),nt=Vi(q,{display:ze==null?Bt:()=>s(ze)?Bt.value:"",direction:G.Down});return{isHovering:Vt,eta:Bt,tooltip:nt}}const Z=[],fe=U(0);let B=m.variable(fe).times(0);const ae={};let Te=!0;const He=w(()=>o.add(g,r()-.5).pow_base(2).times(10).times(B.evaluate())),Xt=[];for(let q=0;q=P-1?0:4};switch(di(L,r)){case"upgrades":const F=[];for(let Ie=0;Ie<4;Ie++){const ot=di({add:1,mult:q===0&&Ie===0?0:1},r),et=He.value,lt=xn(r);let gt="",De,Ae;const Re=fe.value;switch(ot){case"add":{const _e=o.add(et,10).pow(r()/4+.875);gt=`Gain ${Me(_e)} ${c.displayName}/s`,B=B.add(_e),De=it=>zt(()=>({addend:_e,description:lt,enabled:it==null?Be.bought:()=>it()&&Be.bought.value})),Ae=zt(()=>({addend:_e}));break}case"mult":{const _e=r()*5+1;gt=`Multiply previous ${c.displayName} gain by x${Me(_e)}.`,B=B.add(o.sub(_e,1).times(ae[Re-1])),De=it=>we(()=>({multiplier:_e,description:lt,enabled:it==null?Be.bought:()=>it()&&Be.bought.value})),Ae=we(()=>({multiplier:_e}));break}}ae[fe.value]=B.evaluate(),fe.value++;const Ve=Te,Be=br(()=>({requirements:Ln(()=>({resource:In(c),cost:et})),display:{title:lt,description:gt},visibility:Ve}));Q({feature:Be,canClick:()=>Be.canPurchase.value,modifier:De(),cost:et,showETA:()=>!Be.bought.value,previewModifier:Ae}),S.push(De(()=>ot==="add"?y.toolNodes.value.stoneRelic!=null:ie("stoneRelic"))),F.push(Be)}Z.push(F);break;case"repeatables":const j=[];for(let Ie=0;Ie<3;Ie++){const ot=di({add:1.5,mult:3},r),et=fe.value,lt=He.value,gt=xn(r);let De="",Ae,Re,Ve,Be;const _e=m.variable(w(()=>Ne.amount.value)).times(2);switch(ot){case"add":{const xe=o.add(lt,10).times(r()+.5);De=`Gain ${Me(xe)} ${c.displayName}/s`,Be=_e.add(1).times(1.5).times(lt),B=B.add(w(()=>o.sub(fe.value,et).add(1).times(5).times(xe))),Ae=w(()=>Me(o.times(xe,s(Ne.totalAmount)))+"/s"),Re=zt(()=>({addend:()=>o.times(xe,s(Ne.totalAmount)),description:gt,enabled:()=>o.gt(s(Ne.totalAmount),0)})),Ve=zt(()=>({addend:()=>o.add(s(Ne.totalAmount),Ne.amountToIncrease.value).times(xe)}));break}case"mult":{const xe=r()*.75+1.25;De=`Multiply previous ${c.displayName} gain by x${Me(xe)}.`,Be=_e.pow_base(o.times(xe,1.5)).times(lt),B=B.add(w(()=>o.sub(fe.value,et).add(1).times(5).pow_base(xe).sub(1).times(ae[et-1]))),Ae=w(()=>"x"+Me(o.pow(xe,s(Ne.totalAmount)))),Re=we(()=>({multiplier:()=>o.pow(xe,s(Ne.totalAmount)),description:gt,enabled:()=>o.gt(s(Ne.totalAmount),0)})),Ve=we(()=>({multiplier:()=>o.add(s(Ne.totalAmount),Ne.amountToIncrease.value).pow_base(xe)}));break}}ae[fe.value]=B.evaluate(),fe.value++;const it=Te,Ne=hr(()=>({requirements:Ln(()=>({resource:In(c),cost:Be,maxBulkAmount:()=>y.toolNodes.value.diamondRelic!=null?o.dInf:1})),display:()=>({title:gt,description:`${De}

Amount: ${ft(Ne.amount.value)}${o.gt(s(Ne.bonusAmount),0)?` [+${ft(s(Ne.bonusAmount))}]`:""}`,effectDisplay:s(Ae),showAmount:!1}),visibility:it,limit:100,bonusAmount:()=>o.gt(Ne.amount.value,0)?ie("dirtRelic")?2:y.toolNodes.value.dirtRelic!=null?1:0:0}),Hd);Q({feature:Ne,canClick:()=>s(Ne.canClick),modifier:Re,cost:w(()=>gn(Be,Ne.amountToIncrease.value)),previewModifier:Ve,showETA:()=>!Ne.maxed.value}),j.push(Ne)}Z.push(j);break;case"conversion":const W=$n(0,Bi(r)),ee=jn([.64,.75,.55],r),sn=He.value,li=r()/2+.25,Bn=r()/2+.25,Mn=fe.value;B=B.add(w(()=>o.sub(fe.value,Mn).add(1).pow10().times(ae[Mn-1])));const Pt=Gd(()=>({baseResource:In(c),gainResource:W,formula:Ie=>Ie.div(sn).pow(li).times(w(()=>y.toolNodes.value.ironRelic!=null?ie("ironRelic")?4:2:1)),spend(){c.value=0}}));ae[fe.value]=B.evaluate(),fe.value+=4;const ra=Te,rr=xn(r),Ti=m.variable(W).pow(Bn).add(1),aa=we(()=>({multiplier:()=>Ti.evaluate(),description:rr,enabled:()=>o.gt(W.value,0)})),sa=we(()=>({multiplier:()=>Ti.evaluate(o.add(W.value,Pt.actualGain.value))})),Sn=Cd(()=>({display:{title:rr,description:J(()=>p("span",null,[T("Reset "),c.displayName,T(" for")," ",bi(W,o.clampMin(Pt.actualGain.value,1))," ",W.displayName,p("br",null,null),p("div",null,[T("Next:")," ",bi(c,o.lt(Pt.actualGain.value,1)?Pt.currentAt.value:Pt.nextAt.value)," ",c.displayName])]))},style:{width:"200px",minHeight:"100px"},canClick:()=>o.gte(Pt.actualGain.value,1),prestigeResource:W,onClick:Pt.convert,visibility:ra})),{isHovering:oa}=Q({feature:Sn,canClick:()=>s(Sn.canClick),modifier:aa,cost:sn,previewCost:c,previewModifier:sa}),ar=w(()=>oa.value&&Sn.canClick.value);Z.push([Sn]);const la=cn(m.variable(W),ar,Pt.actualGain),ua=cn(Ti,ar,Pt.actualGain);le[q*2]=J(()=>p(re,null,[Ge(Sn.visibility)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:ee,textShadow:`0px 0px 10px ${ee}`}},[la()])," ",W.displayName,T(","),p("br",null,null),T("providing a "),ua(),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,Fi(Sn)])),Wd(this,Pt,()=>Ke.value.lengthgn(Ae,Re.value,!0,10)),Be=w(()=>gn(Ae,o.add(Re.value,1),!0,10)),_e=w(()=>o.pow(De,Re.value)),it=we(()=>({multiplier:_e,description:et,enabled:()=>Ge(xe.visibility)}));B=B.add(w(()=>o.sub(fe.value,ot).add(1).times(3).pow(De).times(ae[ot-1]))),ae[fe.value]=B.evaluate(),fe.value+=3;const Ne=jn([.18,.2,.25],r),xe=zd(()=>({direction:G.Right,width:300,height:20,progress:()=>o.sub(Ie.value,Ve.value).div(o.sub(Be.value,Ve.value)).toNumber(),visibility:st,xp:Ie,display:J(()=>p("span",null,[Me(Ie.value),T("/"),Me(Be.value)])),fillStyle:`background-color: ${Ne}`}));this.on("preUpdate",Di=>{if(Ke.value.lengthut.state.id===e)&&Ge(xe.visibility)){let ut=o.times(Ot.value,Di);y.toolNodes.value.goldRelic!=null&&(ut=o.times(ie("goldRelic")?.2:.1,Ke.value.length).add(1).times(ut)),Ie.value=o.add(ut,Ie.value)}}),S.push(it),Z.push([xe]),le[q*2]=J(()=>p(re,null,[Ge(xe.visibility)?p("div",{style:"margin: 10px"},[T("You have "),p("h3",null,[et]),T(" Lv. "),ft(Re.value),T(","),p("br",null,null),T("providing a "),Me(_e.value),T("x multiplier to previous")," ",c.displayName,T(" gain"),p("br",null,null)]):null,Fi(xe)]));break}case"dimensions":{const Ie=xn(r),st=$n(0,Ie+" energy"),ot=jn([.64,.75,.55],r),et=fe.value;B=B.add(w(()=>o.sub(fe.value,et).add(1).pow_base(32).add(1).log2().add(1).times(ae[et-1])));const lt=w(()=>o.add(st.value,1).log2().add(1)),gt=we(()=>({multiplier:lt,description:Ie,enabled:()=>o.gt(st.value,0)}));S.push(gt);const De=Te,Ae=[];for(let Re=0;Re<4;Re++){const Ve=o.add(g,r()-.5).pow_base(2).times(10).recip(),Be=He.value,_e=m.variable(w(()=>ut.amount.value)),it=_e.pow_base(o.pow10(Re+1)).times(Be),Ne=["First","Second","Third","Fourth"][Re]+" "+Ie+" Dimension",xe=$n(0,Ne),Di=_e.sub(1).pow_base(2).times(Ve).times(w(()=>o.add(ut.amount.value,xe.value))),ut=hr(()=>({display:{title:Ne,description:J(()=>p("div",null,[p("div",null,[T("Amount:")," ",Me(o.add(xe.value,ut.amount.value))," ",T("["),ft(ut.amount.value),T("]")])])),effectDisplay:J(()=>p("span",null,[fa()," ",Re===0?st.displayName:["First","Second","Third","Fourth"][Re-1]+" "+Ie+" Dimension",T("/s")])),showAmount:!1},style:{width:"400px"},effect:Di,dimensions:xe,limit:100,energy:Re===0?st:void 0,requirements:Ln(()=>({resource:In(c),cost:it,maxBulkAmount:()=>ie("diamondRelic")!=null?o.dInf:1})),visibility:De}));Ae.push(ut);const ca=mr(ut),sr=w(()=>s(ut.canClick)&&ca.value),da=new m({inputs:[_e],evaluate(or){return o.sub(or,1).pow_base(2).times(Ve).times(o.add(or,xe.value))}}),fa=cn(da,sr);oe.push({shouldShowPreview:sr,cost:it});const pa=Oi(c,V,()=>ke(it));Vi(ut,{display:pa,direction:G.Down}),ae[fe.value]=B.evaluate(),fe.value++}this.on("preUpdate",Re=>{if(Ke.value.lengthVe.state.id===e)&&Ge(De)){let Ve=o.times(Ot.value,Re);y.toolNodes.value.platinumRelic!=null&&(Ve=o.times(ie("platinumRelic")?4:2,Ve));const Be=Ae[0].effect.evaluate();st.value=o.times(Be,Ve).add(st.value);for(let _e=1;_e<4;_e++){const it=Ae[_e].effect.evaluate();Ae[_e-1].dimensions.value=o.times(it,Ve).add(Ae[_e-1].dimensions.value)}}}),Z.push(Ae),le[q*2]=J(()=>p(re,null,[Ge(De)?p("div",{style:"margin: 10px"},[T("You have")," ",p("h2",{style:{color:ot,textShadow:`0px 0px 10px ${ot}`}},[Me(st.value)])," ",st.displayName,T(","),p("br",null,null),T("providing a "),Me(lt.value),T("x multiplier to previous")," ",c.displayName,T(" gain")]):null,qs(...Ae)]));break}case"prestige":{const Ie=xn(r),st=Te,ot=r()/2+1.25,et=He.value;B=B.pow(ot);const lt=dd(()=>({exponent:ot,description:Ie,enabled:De.bought}));ae[fe.value]=B.evaluate(),fe.value++;const gt=Xd(()=>({thingsToReset:Z.filter((Re,Ve)=>Ve%2===0),onReset(){c.value=0}})),De=br(()=>({display:{title:Ie,description:`Reset all previous ${a} content to raise all previous ${c.displayName} gain to the ^${Me(ot)}`},style:{width:"200px",minHeight:"100px"},onPurchase:gt.reset,visibility:st,requirements:Ln(()=>({resource:In(c),cost:et}))})),Ae=we(()=>({multiplier:0}));Q({feature:De,canClick:()=>s(De.canPurchase),modifier:lt,cost:et,previewCost:c,previewModifier:Ae,showETA:()=>!s(De.bought)}),Z.push([De]);break}}const Qe={cache:"increaseCaches"in h?10:1,generation:"increaseGens"in h?10:1,resourceMulti:"increaseResourceMults"in h?10:1,energyMulti:"increaseEnergyMults"in h?2.5:.25,influences:Object.keys(y.influenceNodes.value).length+Xt.length===Object.keys(Nt).length?0:"increaseInfluences"in h?20:2,relic:0};let kn=di(Qe,r);q===P-1&&"relic"in h&&(kn="relic");let ze="",$t,Vt,Bt,nt,Et,an;switch(kn){case"cache":nt=Li(r,i),ze=`Gain ${Me(o.div(I.value,12))}x your current ${nt} (no modifiers).`,Vt=()=>{var W,ee,sn;return y.grantResource(nt,o.times((sn=(ee=(W=y.resourceNodes.value[nt])==null?void 0:W.state)==null?void 0:ee.amount)!=null?sn:0,o.div(I.value,12)))};break;case"generation":nt=Li(r,i);const F=o.div(I.value,40).times(St[nt]);ze=`Gain ${Me(F)} ${nt}/s while plane is active.`,$t=W=>y.grantResource(nt,o.times(W,F)),Bt=w(()=>y.resourceNodes.value[nt]);break;case"resourceMulti":Et=nt=Li(r,i),an=o.div(I.value,10).pow_base(2),ze=`Gain ${Me(an)}x ${nt} while plane is active.`;break;case"energyMulti":Et="energy",an=o.div(I.value,8).add(1),ze=`Gain ${Me(an)}x energy while plane is active.`;break;case"influences":const j=Object.keys(Nt)[Math.floor(r()*Object.keys(Nt).length)];Xt.push(j),ze=`Gain a new portal influence (${Nt[j].display})`,Vt=()=>{if(j in y.influenceNodes.value){_r.warning(`Error: ignoring duplicate portal influence (${Nt[j].display})`);return}const W={id:Qn(y.board),position:{...y.board.types.portal.nodes.value.find(ee=>ee.state.id===e).position},type:"influence",state:{type:j,data:Nt[j].initialData}};y.board.placeInAvailableSpace(W),y.board.nodes.value.push(W)};break;case"relic":ze=t==="ultimatum"?"Win the game!":`Gain the ${t}-tier planar relic (${Tt[t]})`,Vt=()=>{if(t==="ultimatum"){ir.value=!0;return}if(`${t}Relic`in y.toolNodes.value)_r.warning(`Error: ignoring duplicate relic (${Tt[t]})`);else{const W={id:Qn(y.board),position:{...y.board.types.portal.nodes.value.find(ee=>ee.state.id===e).position},type:"passive",state:`${t}Relic`};y.board.placeInAvailableSpace(W),y.board.nodes.value.push(W)}}}const oi=Te,Vn=He.value,x=Od(()=>({requirements:Ln(()=>({resource:In(c),cost:Vn})),visibility:oi,display:{requirement:`${Me(Vn)} ${c.displayName}`,effectDisplay:ze},style:"width: 100%",classes:{final:q===P-1},update:$t,onComplete:Vt,link:Bt,effectedResource:Et,resourceMulti:an})),E=Oi(c,V,Vn);Vi(x,{display:()=>x.earned.value?"":E.value,direction:G.Down}),Z.push([x]),Te=x.earned}const at=Jn(Z,nr),Fn=Jn(Z,na);S.push(we(()=>({multiplier:()=>ie("silver")?4:2,description:()=>(ie("silver")?"Empowered ":"")+Le.silver.name,enabled:()=>y.toolNodes.value.silver!=null})),we(()=>({multiplier:()=>o.add(1,(ie("diamond")?2:1)*at.filter(q=>q.bought.value).length/10),description:()=>(ie("diamond")?"Empowered ":"")+Le.diamond.name,enabled:()=>y.toolNodes.value.diamond!=null})),we(()=>({multiplier:()=>o.div(d.value,6e3).times(ie("emerald")?2:1).add(1),description:()=>(ie("emerald")?"Empowered ":"")+Le.emerald.name,enabled:()=>y.toolNodes.value.emerald!=null})),we(()=>({multiplier:()=>o.div(Fn.reduce((q,L)=>q.add(s(L.totalAmount)),o.dZero),100).times(ie("gravelRelic")?2:1).add(1).pow(.75),description:()=>(ie("gravelRelic")?"Empowered ":"")+Tt.gravel,enabled:()=>y.toolNodes.value.gravelRelic!=null})));const Nn=_t(()=>[we(()=>({multiplier:()=>{var q,L,Se;return o.add((Se=(L=(q=y.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:L.level)!=null?Se:0,1)},description:"Booster",enabled:()=>{var q,L,Se;return(Se=(L=(q=y.board.types.booster.nodes.value[0])==null?void 0:q.state)==null?void 0:L.portals.includes(e))!=null?Se:!1}})),we(()=>({multiplier:()=>o.times(ie("coalRelic")?.2:.1,Ke.value.length).add(1),description:()=>(ie("coalRelic")?"Empowered ":"")+Tt.coal,enabled:()=>y.toolNodes.value.coalRelic!=null})),we(()=>({multiplier:()=>o.add(y.energy.value,1).log10().add(1).pow(ie("beryliumRelic")?.5:.25),description:()=>(ie("beryliumRelic")?"Empowered ":"")+Tt.berylium,enabled:()=>y.toolNodes.value.beryliumRelic!=null}))]),Ot=w(()=>Nn.apply(1)),[xi,ii]=Wn(()=>[{title:`${tt(c.displayName)} Gain`,modifier:D,base:0,unit:"/s"},{title:`${tt(c.displayName)} Time Speed`,modifier:Nn,base:1,visible:()=>o.gt(Ot.value,1)}]),Cn=U(!1),ri=J(()=>p(Ht,{modelValue:Cn.value,"onUpdate:modelValue":q=>Cn.value=q},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>rt(xi)}));this.on("preUpdate",q=>{if(!y.activePortals.value.some(Se=>Se.state.id===e))return;const L=o.times(Ot.value,q);d.value=o.add(d.value,L),Ke.value.length{var Qe;(Qe=Se.update)==null||Qe.call(Se,L)})}),ef(this,()=>Ke.value.lengthKe.value.length{const q=oe.find(L=>L.shouldShowPreview.value);return q?o.neg(ke(q.cost)):0}),qt=w(()=>{const q=oe.find(L=>L.shouldShowPreview.value);return q&&q.modifier?o.sub(q.modifier.apply(0),V.value):0}),qn=cn(m.variable(0).add(c),()=>o.neq(On.value,0),On),ai=cn(m.variable(0).add(V),()=>o.neq(qt.value,0),qt),si=w(()=>{const q=[];return Ke.value.forEach(L=>{L.link&&q.push(L.link)}),q}),$i=w(()=>{const q={};return Ke.value.forEach(L=>{L.effectedResource!=null&&L.resourceMulti!=null&&(q[L.effectedResource]!=null?q[L.effectedResource]=o.times(q[L.effectedResource],L.resourceMulti):q[L.effectedResource]=L.resourceMulti)}),q}),Ke=w(()=>{const q=[];for(let L=1;Lo.lt(Ke.value.length,P)&&Z.some(q=>q.some(L=>"earned"in L&&s(L.earned)||"bought"in L&&s(L.bought)?!1:("canClick"in L&&s(L.canClick)||"canPurchase"in L&&s(L.canPurchase),!0)))),Pi=w(()=>{const q=Z.findIndex((Se,Qe)=>Qe>0&&Qe%2===0&&!Z[Qe-1][0].earned.value);let L;return q===-1?L=Z:L=Z.slice(0,q),L.map((Se,Qe)=>Qe in le?rt(le[Qe]):Fi(...Se))});return{tier:dt(t),seed:dt(n),influences:dt(i),name:a,color:l,resource:c,background:u,style:{background:u,"--background":u},features:Z,resourceTabCollapsed:ii,links:si,resourceMultis:$i,earnedTreasures:Ke,showNotif:Ei,timeActive:d,bonusRewardsLevel:_,display:J(()=>p(re,null,[p(hi,{class:"nav-container",style:"z-index: 5"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",null,[a])]),p("span",{class:"nav-segment"},[p("h3",null,[t,T("-tier")])]),i.length===0?null:p("span",{class:"nav-segment"},[p(Fe,{display:i.map(q=>{const L=Nt[q.type].description;return typeof L=="function"?L(q):L}).join("
"),direction:G.Down,style:"width: 300px"},{default:()=>[p("h3",null,[i.length,T(" influences")])]})]),p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>Cn.value=!0},[T("modifiers")])])]}),p(hi,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[rt(qn)])," ",c.displayName]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:`color: ${l}; text-shadow: 0px 0px 10px ${l};`},[o.gt(V.value,0)?"+":"",rt(ai)]),T("/s)")]),o.neq(Ot.value,1)?p("span",{class:"nav-segment"},[T("Speed: "),Me(Ot.value),T("x")]):null]}),p(Ed,{height:"60px"},null),Pi.value,rt(ri)])),minimizedDisplay:J(()=>p("div",null,[p("span",null,[a]),p("span",{style:"font-size: large; vertical-align: sub;"},[" ",Ke.value.length,T("/"),P,T(" treasures")])]))}})}function Li(e,t){t=t.filter(u=>u.type==="increaseResources"||u.type==="decreaseResources");const n=Object.keys(St).reduce((u,c)=>{let d=St[c];return t.filter(v=>v.data===c).forEach(v=>{v.type==="increaseResources"?d*=1e3:d/=1e3}),u+d},0),i=Object.keys(St),r=Math.floor(e()*n);let a=0,l;for(let u=0;uu+c),i=Object.keys(e);let r=0,a=null;const l=t()*n;for(let u=0;ue===y.board.selectedNode.value?{text:"Mining"}:Object.keys(y.resourceNodes.value).length===0?{text:"Click me!"}:null,actionDistance:Math.PI/4,actions:[Ft],progress:e=>ye(e)?new o(e.state.progress).toNumber():0,progressDisplay:vn.Outline,progressColor:"var(--accent2)",classes:e=>({running:ye(e)}),draggable:!0},lf={shape:We.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>e===y.board.selectedNode.value?{text:"Broken Forge"}:null,actionDistance:Math.PI/4,actions:[{id:"repair",icon:"build",tooltip:{text:"Repair - 100 energy"},onClick(e){o.gte(y.energy.value,100)&&(e.type="factory",y.energy.value=o.sub(y.energy.value,100))},confirmationLabel:()=>o.gte(y.energy.value,1e3)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}}],draggable:!0},uf={shape:We.Diamond,size:50,title:"\u{1F6E0}\uFE0F",label:e=>{var t,n;if(e===y.board.selectedNode.value)return{text:e.state==null?"Forge - Drag a resource to me!":`Forging ${Le[e.state].name}`};if(((t=y.board.draggingNode.value)==null?void 0:t.type)==="resource"){const i=((n=y.board.draggingNode.value)==null?void 0:n.state).type,r=e.state===i?"Disconnect":Le[i].name,a=e.state===i||y.toolNodes.value[i]==null?"var(--accent2)":"var(--danger)";return{text:r,color:a}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect resource"},onClick(e){e.state=void 0,y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>e.state!=null},{id:"craft",icon:"done",tooltip:e=>({text:`Forge ${Le[e.state].name} - ${Ze(Le[e.state].cost)} energy`}),onClick(e){const t=Le[e.state];if(o.gte(y.energy.value,t.cost)&&y.toolNodes.value[e.state]==null){y.energy.value=o.sub(y.energy.value,t.cost);const n={id:Qn(y.board),position:{...e.position},type:t.type,state:"state"in t?t.state:void 0};y.board.placeInAvailableSpace(n),y.board.nodes.value.push(n),y.board.selectedAction.value=null,y.board.selectedNode.value=null,e.state=void 0}},fillColor:e=>o.gte(y.energy.value,Le[e.state].cost)&&y.toolNodes.value[e.state]==null?"var(--accent2)":"var(--danger)",visibility:e=>e.state!=null,confirmationLabel:e=>o.gte(y.energy.value,Le[e.state].cost)?y.toolNodes.value[e.state]==null?{text:"Tap again to confirm"}:{text:"Already crafted",color:"var(--danger)"}:{text:"Cannot afford",color:"var(--danger)"}}],progress:e=>e.state==null||y.toolNodes.value[e.state]!=null?0:o.div(o.sqrt(y.energy.value),o.sqrt(Le[e.state].cost)).clampMax(1).toNumber(),progressDisplay:vn.Fill,progressColor:e=>e.state!=null&&o.gte(y.energy.value,Le[e.state].cost)?"var(--accent2)":"var(--foreground)",canAccept(e,t){return t.type==="resource"},onDrop(e,t){const n=t.state.type;e.state===n?e.state=void 0:e.state=n,y.board.selectedNode.value=e},draggable:!0},cf=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"],df={shape:We.Circle,size:50,title:e=>tt(e.state.type)+" ("+cf[Lt.indexOf(e.state.type)]+")",subtitle:e=>Ze(e.state.amount),progress:e=>md(e.state.type),onClick(){},progressDisplay:vn.Outline,progressColor:"var(--accent3)",classes:e=>{var t;return{"affected-node":y.dowsing.value!=null&&ye(y.dowsing.value)&&y.dowsing.value.state.resources.includes(e.state.type)||o.neq((t=y.planarMultis.value[e.state.type])!=null?t:1,1)}},draggable:!0},ff={shape:We.Circle,size:50,title:e=>{const t=e.state;return t.includes("Relic")?Tt[t.slice(0,-5)]:Le[t].name},label:e=>e===y.board.selectedNode.value?{text:$d[e.state].description(ie(e.state))}:null,outlineColor:"var(--bought)",classes:e=>({"affected-node":ie(e.state)}),draggable:!0},pf={shape:We.Diamond,size:50,title:"\u{1F962}",label:e=>e===y.board.selectedNode.value?{text:e.state.resources.length===0?"Dowsing - Drag a resource to me!":`Dowsing (${e.state.resources.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Xr(e,t=>`Double ${t} odds`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(2).pow_base(100),16),Ft],classes:e=>({running:ye(e)}),canAccept:Yr,onDrop:Jr,draggable:!0},gf={shape:We.Diamond,size:50,title:"\u26CF\uFE0F",label:e=>e===y.board.selectedNode.value?{text:e.state.resources.length===0?"Quarry - Drag a resource to me!":`Quarrying (${e.state.resources.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Xr(e,t=>`Gather ${bt(o.div(y.dropRates[t].computedModifier.value,100))} ${t}/s`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(2).pow_base(1e4),16),Ft],progress:e=>ye(e)?o.eq(y.quarryProgressRequired.value,0)?0:new o(e.state.progress).div(y.quarryProgressRequired.value).toNumber():0,progressDisplay:vn.Outline,progressColor:"var(--accent2)",canAccept:Yr,onDrop:Jr,classes:e=>({running:ye(e)}),draggable:!0},mf={shape:We.Diamond,size:50,title:"\u{1F50C}",label:e=>e===y.board.selectedNode.value?{text:e.state.tools.length===0?"Empowerer - Drag a tool to me!":`Empowering (${e.state.tools.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:fd(e,t=>t.includes("Relic")?`Double ${Tt[t.slice(0,-5)]}'s effect`:`Double ${Le[t].name}'s effect`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(3).pow_base(1e3),24),Ft],canAccept:pd,onDrop:gd,classes:e=>({running:ye(e)}),draggable:!0},vf={shape:We.Diamond,size:50,title:"\u26E9\uFE0F",label:e=>{if(e===y.board.selectedNode.value)return{text:e.state.tier==null?"Portal Spawner - Drag a resource to me!":`Spawning ${e.state.tier}-tier portal`};const t=y.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type;return{text:e.state.tier===n?"Disconnect":`${tt(n)}-tier Portal`,color:"var(--accent2)"}}else if((t==null?void 0:t.type)==="influence"){const n=t.state.type,{influences:i}=e.state;return i.includes(n)?{text:"Disconnect",color:"var(--accent2)"}:{text:"Add influence",color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[{id:"deselect",icon:"close",tooltip:{text:"Disconnect all"},onClick(e){e.state={...e.state,tier:void 0,influences:[]},y.board.selectedAction.value=null,y.board.selectedNode.value=null},visibility:e=>{const{tier:t,influences:n}=e.state;return t!=null||n.length>0}},{id:"makePortal",icon:"done",tooltip:e=>({text:`Spawn ${e.state.tier}-tier portal - ${Ze(y.computedPortalCost.value)} energy`}),fillColor:()=>o.gte(y.energy.value,y.computedPortalCost.value)?"var(--accent2)":"var(--danger)",confirmationLabel:()=>o.gte(y.energy.value,y.computedPortalCost.value)?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"},onClick(e){if(o.lt(y.energy.value,y.computedPortalCost.value))return;let t=0;for(;`portal-${t}`in he;)t++;y.energy.value=o.sub(y.energy.value,y.computedPortalCost.value);const{tier:n,influences:i}=e.state;Ki(ia(`portal-${t}`,n,Math.floor(Math.random()*4294967296),i.map(a=>y.influenceNodes.value[a].state)),K);const r={id:Qn(y.board),position:{...e.position},type:"portal",state:{id:`portal-${t}`,powered:!1}};y.board.placeInAvailableSpace(r),y.board.nodes.value.push(r),y.board.selectedAction.value=null,y.board.selectedNode.value=null,e.state={tier:void 0,influences:[]}},visibility:e=>e.state.tier!=null}],canAccept(e,t){return t.type==="resource"||t.type==="influence"},onDrop(e,t){if(t.type==="resource"){const n=t.state.type,i=e.state.tier;e.state={...e.state,tier:n===i?void 0:n}}else if(t.type==="influence"){const n=t.state.type,i=e.state.influences;i.includes(n)?e.state={...e.state,influences:i.filter(r=>r!==n)}:e.state={...e.state,influences:[...i,n]}}y.board.selectedNode.value=e},draggable:!0},hf={shape:We.Diamond,size:50,title:"\u{1F300}",label:e=>e===y.board.selectedNode.value?{text:`Portal to ${he[e.state.id].name}`,color:he[e.state.id].color}:null,actionDistance:Math.PI/4,actions:[Ft],classes:e=>({running:ye(e),showNotif:he[e.state.id].showNotif.value,"affected-node":y.booster.value!=null&&ye(y.booster.value)&&y.booster.value.state.portals.includes(e.state.id)}),outlineColor:e=>he[e.state.id].background,draggable:!0},bf={shape:e=>e.state.type==="increaseResources"||e.state.type==="decreaseResources"?We.Diamond:We.Circle,size:50,title:e=>Nt[e.state.type].display,label:e=>{if(e===y.board.selectedNode.value){const n=e.state,i=Nt[n.type].description;return{text:typeof i=="function"?i(n):i}}const t=y.board.draggingNode.value;if((t==null?void 0:t.type)==="resource"){const n=t.state.type,{type:i,data:r}=e.state;let a;if(Array.isArray(r)&&r.includes(n))a="Disconnect";else if(i==="increaseResources")a=`Increase ${tt(n)} odds`;else if(i==="decreaseResources")a=`Decrease ${tt(n)} odds`;else return null;return{text:a,color:"var(--accent2)"}}return null},actionDistance:Math.PI/4,actions:[rn],canAccept:(e,t)=>t.type!=="resource"?!1:Array.isArray(e.state.data),onDrop:(e,t)=>{if(t.type!=="resource")return;const n=t.state.type,i=e.state.data;i!=null&&(i.includes(n)?e.state={...e.state,data:i.filter(r=>r!==n)}:e.state={...e.state,data:[...i,n]},y.board.selectedNode.value=e)},outlineColor:"var(--danger)",draggable:!0},yf={shape:We.Diamond,size:50,title:"\u231B",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Booster - Drag a portal to me!":`Boosting by ${Ze(o.add(1,e.state.level))}x (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Boost ${he[t].name}'s speed`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(6).pow_base(1e3)),{id:"increaseBoost",icon:"arrow_upward",tooltip(e){return{text:`Increase boost - ${Ze(qi.evaluate(e.state.level))} energy`}},confirmationLabel(e){return o.gte(y.energy.value,qi.evaluate(e.state.level))?{text:"Tap again to confirm"}:{text:"Cannot afford",color:"var(--danger)"}},onClick(e){const t=qi.evaluate(e.state.level);o.gte(y.energy.value,t)&&(y.energy.value=o.sub(y.energy.value,t),e.state={...e.state,level:o.add(e.state.level,1)},y.board.selectedAction.value=null)}},Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},wf={shape:We.Diamond,size:50,title:"\u{1F916}",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Upgrader - Drag a portal to me!":`Auto-Upgrading (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s upgrades and prestiges`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(4).pow_base(1e6)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},_f={shape:We.Diamond,size:50,title:"\u{1F9BE}",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Automator - Drag a portal to me!":`Automatating (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(4).pow_base(1e6)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},Nf={shape:We.Diamond,size:50,title:"\u{1F4B1}",label:e=>e===y.board.selectedNode.value?{text:e.state.portals.length===0?"Investments - Drag a portal to me!":`Investing (${e.state.portals.length}/${o.add(e.state.maxConnections,y.computedBonusConnectionsModifier.value)})`}:Ni(e,t=>`Auto-buy ${he[t].name}'s repeatables and dimensions`),actionDistance:Math.PI/4,actions:[rn,_n(e=>e.add(3).pow_base(1e8)),Ft],canAccept:Ci,onDrop:ki,classes:e=>({running:ye(e)}),draggable:!0},Nr=wi(),Cf={mine:of,brokenFactory:lf,factory:uf,resource:df,passive:ff,dowsing:pf,quarry:gf,empowerer:mf,portalGenerator:vf,portal:hf,influence:bf,booster:yf,upgrader:wf,automator:_f,investments:Nf},y=Ji("main",function(){const e=$n(0,"energy"),t=w(()=>g.types.resource.nodes.value.reduce((x,E)=>(x[E.state.type]=E,x),{})),n=w(()=>({...g.types.passive.nodes.value.reduce((x,E)=>(x[E.state]=E,x),{}),sand:g.types.dowsing.nodes.value[0],wood:g.types.quarry.nodes.value[0],coal:g.types.empowerer.nodes.value[0],iron:g.types.portalGenerator.nodes.value[0],gold:g.types.booster.nodes.value[0],platinum:g.types.upgrader.nodes.value[0],berylium:g.types.automator.nodes.value[0],ultimatum:g.types.investments.nodes.value[0]})),i=w(()=>Object.keys(Tt).filter(x=>`${x}Relic`in n.value).length),r=w(()=>({...g.types.influence.nodes.value.reduce((x,E)=>(x[E.state.type]=E,x),{})})),a=w(()=>({...g.types.portal.nodes.value.reduce((x,E)=>(x[E.state.id]=E,x),{})})),l=w(()=>Lt.reduce((x,E)=>{var j,W,ee;const F=(ee=(W=(j=t.value[E])==null?void 0:j.state)==null?void 0:W.amount)!=null?ee:0;return x[E]=o.floor(zi.invert(F)),x},{})),u=mn({}),c=mn({});Gt(()=>{Lt.forEach(x=>{vt(()=>l.value[x],(E,F)=>{const j=o.sub(E,F);o.gt(j,0)&&(o.gt(j,1)||o.lt(F,100))&&ue.active===K.id&&Nr.info(p("div",null,[p("h3",null,[o.eq(E,1)?`${tt(x)} discovered`:`${tt(x)} is now Level ${ft(E)}`,T("!")]),o.gt(j,1)?p("div",null,[T("Gained "),ft(j),T(" levels")]):null]))})})});const d=w(()=>Z.filter(x=>{var E,F;return(F=(E=x.value)==null?void 0:E.state)==null?void 0:F.powered}).length+g.types.portal.nodes.value.filter(x=>x.state.powered).length),v=w(()=>{let x=d.value;return n.value.copperRelic!=null&&(x--,ie("copperRelic")&&x--),x}),f=w(()=>{const x=v.value;return o.lt(x,0)?0:o.eq(x,0)?10:o.add(x,1).pow_base(100).div(10).times(.99)}),h=w(()=>{if(P.value==null)return 0;let E=P.value.state.resources.reduce((F,j)=>o.div(100,qt[j].computedModifier.value).add(F),o.dZero);return n.value.silverRelic!=null&&(E=o.div(E,o.add(d.value,1)),ie("silverRelic")&&(E=o.div(E,o.add(d.value,1)))),E}),g=xu(x=>({startNodes:()=>[{position:{x:0,y:0},type:"mine",state:{progress:0,powered:!1}},{position:{x:0,y:-200},type:"brokenFactory"}],types:Cf,style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"},links(){const E=[];if(E.push(...Object.keys(u).map(F=>({startNode:C.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),_.value!=null&&_.value.state!=null&&E.push({startNode:_.value,endNode:t.value[_.value.state],stroke:"var(--foreground)",strokeWidth:4}),I.value!=null&&I.value.state.resources.forEach(F=>{E.push({startNode:I.value,endNode:t.value[F],stroke:ye(I.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),P.value!=null&&P.value.state.resources.forEach(F=>{E.push({startNode:P.value,endNode:t.value[F],stroke:"var(--foreground)",strokeWidth:4})}),E.push(...Object.keys(c).map(F=>({startNode:P.value,endNode:t.value[F],stroke:"var(--accent3)",strokeWidth:5}))),S.value!=null&&S.value.state.tools.forEach(F=>{E.push({startNode:S.value,endNode:n.value[F],stroke:ye(S.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),D.value!=null){const F=D.value.state;F.tier!=null&&E.push({startNode:D.value,endNode:t.value[F.tier],stroke:"var(--foreground)",strokeWidth:4}),F.influences.forEach(j=>{E.push({startNode:D.value,endNode:r.value[j],stroke:"var(--foreground)",strokeWidth:4})}),x.types.portal.nodes.value.forEach(j=>{const W=he[j.state.id];return W.links.value.forEach(ee=>{ee.value!=null&&E.push({startNode:j,endNode:ee.value,stroke:ye(j)?"var(--accent3)":"var(--foreground)",strokeWidth:4})}),Object.keys(W.resourceMultis.value).forEach(ee=>{ee!=="energy"&&ee in t.value&&E.push({startNode:j,endNode:t.value[ee],stroke:ye(j)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),E})}return V.value!=null&&V.value.state.portals.forEach(F=>{E.push({startNode:V.value,endNode:a.value[F],stroke:ye(V.value)?"var(--accent1)":"var(--foreground)",strokeWidth:4})}),oe.value!=null&&oe.value.state.portals.forEach(F=>{E.push({startNode:oe.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),le.value!=null&&le.value.state.portals.forEach(F=>{E.push({startNode:le.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Q.value!=null&&Q.value.state.portals.forEach(F=>{E.push({startNode:Q.value,endNode:a.value[F],stroke:"var(--foreground)",strokeWidth:4})}),Object.values(r.value).forEach(F=>{const j=F.state;(j.type==="increaseResources"||j.type==="decreaseResources")&&j.data.forEach(W=>{E.push({startNode:F,endNode:t.value[W],stroke:"var(--foreground)",strokeWidth:4})})}),E}})),C=w(()=>g.types.mine.nodes.value[0]),_=w(()=>g.types.factory.nodes.value[0]),I=w(()=>n.value.sand),P=w(()=>n.value.wood),S=w(()=>n.value.coal),D=w(()=>n.value.iron),V=w(()=>n.value.gold),oe=w(()=>n.value.platinum),le=w(()=>n.value.berylium),Q=w(()=>n.value.ultimatum),Z=[C,I,P,S,V,oe,le,Q];function fe(x,E){let F=t.value[x];if(E=o.times(E,qn[x].computedModifier.value),F==null)F={id:Qn(g),position:{...C.value.position},type:"resource",state:{type:x,amount:E}},g.placeInAvailableSpace(F),g.nodes.value.push(F);else{const j=F.state;F.state={...j,amount:o.add(j.amount,E)}}}const B=w(()=>Object.keys(St).reduce((x,E)=>x+new o(qt[E].computedModifier.value).toNumber(),0)),ae=w(()=>{const x={};return g.types.portal.nodes.value.forEach(E=>{if(!ye(E))return;const j=he[E.state.id].resourceMultis.value;Object.keys(j).forEach(W=>{x[W]!=null?x[W]=o.times(x[W],j[W]):x[W]=j[W]})}),x}),Te=_t(()=>Lt.map(x=>zt(()=>({description:()=>tt(x),addend:()=>l.value[x],enabled:()=>o.gt(l.value[x],0)})))),He=w(()=>Te.apply(0)),Xt=_t(()=>[zt(()=>({addend:He,description:"Resource Levels"})),we(()=>({multiplier:()=>o.pow(On.value,He.value),description:()=>`${Ut(On.value,3)}x per Resource Level`})),we(()=>({multiplier:()=>ie("stone")?4:2,description:()=>(ie("stone")?"Empowered ":"")+Le.stone.name,enabled:()=>n.value.stone!=null})),we(()=>({multiplier:()=>{var x;return(x=ae.value.energy)!=null?x:1},description:"Planar Treasures",enabled:()=>{var x;return o.neq((x=ae.value.energy)!=null?x:1,1)}})),zt(()=>({addend:()=>o.pow(100,v.value).div(10).neg(),description:"Powered Machines (100^n/10 energy/s)",enabled:()=>o.gt(v.value,0)}))]),at=w(()=>Xt.apply(0)),Fn=_t(()=>[zt(()=>({addend:()=>ie("unobtainium")?2:1,description:()=>(ie("unobtainium")?"Empowered ":"")+Le.unobtainium.name,enabled:()=>n.value.unobtainium!=null}))]),Nn=w(()=>Fn.apply(0)),Ot=_t(()=>[we(()=>({multiplier:()=>ie("dirt")?4:2,description:()=>(ie("dirt")?"Empowered ":"")+Le.dirt.name,enabled:()=>n.value.dirt!=null})),we(()=>({multiplier:()=>o.pow(i.value,ie("woodRelic")?2:1),description:()=>(ie("woodRelic")?"Empowered ":"")+Tt.wood,enabled:()=>n.value.woodRelic!=null}))]),xi=w(()=>Ot.apply(1)),ii=_t(()=>[we(()=>({multiplier:()=>ie("gravel")?4:2,description:()=>(ie("gravel")?"Empowered ":"")+Le.gravel.name,enabled:()=>n.value.gravel!=null}))]),Cn=w(()=>ii.apply(1)),ri=_t(()=>[zt(()=>({addend:()=>ie("copper")?.004:.002,description:()=>(ie("copper")?"Empowered ":"")+Le.copper.name,enabled:()=>n.value.copper!=null}))]),On=w(()=>ri.apply(1.01)),qt=Object.keys(St).reduce((x,E)=>{const F=_t(()=>[we(()=>({multiplier:2,description:"Dowsing",enabled:()=>I.value!=null&&ye(I.value)&&I.value.state.resources.includes(E)}))]),j=w(()=>F.apply(St[E])),W={title:`${tt(E)} Drop Rate`,modifier:F,base:St[E]};return x[E]={modifier:F,computedModifier:j,section:W},x},{}),qn=Object.keys(St).reduce((x,E)=>{const F=_t(()=>[we(()=>({multiplier:()=>{var ee;return(ee=ae.value[E])!=null?ee:1},description:"Planar Treasures",enabled:()=>{var ee;return o.neq((ee=ae.value[E])!=null?ee:1,1)}}))]),j=w(()=>F.apply(1)),W={title:`${tt(E)} Gain`,modifier:F};return x[E]={modifier:F,computedModifier:j,section:W},x},{}),ai=w(()=>{var E,F,j;const x=Lt.indexOf((j=(F=(E=D.value)==null?void 0:E.state)==null?void 0:F.tier)!=null?j:"dirt");return o.add(x,1).times(x).div(2).add(9).pow10()}),si=_t(()=>[...Object.keys(Nt).map(x=>we(()=>({multiplier:Nt[x].cost,description:Nt[x].display,enabled:()=>{var E,F,j;return(j=(F=(E=D.value)==null?void 0:E.state)==null?void 0:F.influences.includes(x))!=null?j:!1},smallerIsBetter:!0}))),we(()=>({multiplier:()=>ie("emeraldRelic")?.05:.1,description:()=>(ie("emeraldRelic")?"Empowered ":"")+Tt.emerald,enabled:()=>n.value.emeraldRelic!=null,smallerIsBetter:!0}))]),$i=w(()=>si.apply(ai.value)),[Ke,Ei]=Wn(()=>[{title:"Resource Levels",modifier:Te,base:0},{title:"Energy Gain",modifier:Xt,base:0,unit:"/s"},{title:"Portal Cost",modifier:si,base:ai,unit:" energy",baseText:()=>{var x,E,F;return`${tt((F=(E=(x=D.value)==null?void 0:x.state)==null?void 0:E.tier)!=null?F:"dirt")}-tier Base Cost`},visible:()=>D.value!=null,smallerIsBetter:!0},{title:"Bonus Connections",modifier:Fn,base:0,visible:()=>o.gt(Nn.value,0)}]),[Pi,q]=Wn(()=>[{title:"Mining Speed",modifier:Ot,base:1,unit:"/s",visible:()=>n.value.dirt!=null},{title:"Ore Dropped",modifier:ii,base:1,visible:()=>n.value.gravel!=null},{title:"Material Level Effect",modifier:ri,base:1.01,visible:()=>n.value.copper!=null}]),[L,Se]=Wn(()=>Object.values(qt).map(x=>x.section)),[Qe,kn]=Wn(()=>Object.values(qn).map(x=>x.section)),ze=Ou({general:()=>({display:"General",glowColor(){return ze.activeTab.value===this.tab?"white":""},tab:Ke,energyTabCollapsed:Ei}),mining:()=>({display:"Mine",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.keys(n.value).length>0,tab:Pi,miningTabCollapsed:q}),resources:()=>({display:"Mine Rates",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>I.value!=null,tab:L,resourcesCollapsed:Se}),resourcesGain:()=>({display:"Resource Gain",glowColor(){return ze.activeTab.value===this.tab?"white":""},visibility:()=>Object.values(qn).some(x=>o.neq(x.computedModifier.value,1)),tab:Qe,resourceGainCollapsed:kn})}),$t=U(!1),Vt=J(()=>p(Ht,{modelValue:$t.value,"onUpdate:modelValue":x=>$t.value=x},{header:()=>p("h2",null,[T("Modifiers")]),body:()=>rt(ze)}));this.on("preUpdate",x=>{if(Object.keys(u).forEach(E=>{u[E]-=x,u[E]<=0&&delete u[E]}),Object.keys(c).forEach(E=>{c[E]-=x,c[E]<=0&&delete c[E]}),ye(C.value)){const E=o.add(C.value.state.progress,o.times(xi.value,x)),F=E.floor();C.value.state={...C.value.state,progress:o.sub(E,F)};const j=F.div(B.value).floor();j.gt(0)&&Lt.forEach(ee=>{fe(ee,o.times(new o(qt[ee].computedModifier.value).toNumber(),j).times(Cn.value)),u[ee]=.3});const W=o.sub(F,j).toNumber();for(let ee=0;ee0){let j=o.add(E,x);const W=o.div(E,h.value).floor();j=o.sub(j,o.times(W,h.value)),P.value.state={...P.value.state,progress:j},o.gt(W,0)&&F.forEach(ee=>{fe(ee,W),c[ee]=.3})}}e.value=o.add(e.value,o.times(at.value,x)),o.lt(e.value,0)&&(e.value=0,Z.forEach(E=>{var F;((F=E.value)==null?void 0:F.state).powered=!1}),Object.values(a.value).forEach(E=>{E.state.powered=!1}),C.value.state={...C.value.state,powered:!1},Nr.warning(p("div",null,[p("h3",null,[T("Ran out of energy!")]),p("div",null,[T("All machines have been turned off.")])])))});const Bt=w(()=>{var x,E;return g.selectedAction.value===g.types.brokenFactory.actions[0]?-100:g.selectedAction.value===g.types.factory.actions[1]?o.neg(Le[g.selectedNode.value.state].cost):((x=g.selectedAction.value)==null?void 0:x.id)==="moreConnections"?o.neg(g.selectedAction.value.formula.evaluate(((E=g.selectedNode.value)==null?void 0:E.state).maxConnections)):0}),nt=cn(m.variable(0).add(e),()=>o.neq(Bt.value,0),Bt),Et=w(()=>{var x;return g.selectedAction.value===Ft?((x=g.selectedNode.value)==null?void 0:x.state).powered?o.eq(d.value,1)?10:o.pow(100,d.value).div(10).times(.99):o.neg(f.value):0}),an=cn(m.variable(0).add(at),()=>o.neq(Et.value,0),Et),oi=w(()=>g.types.portal.nodes.value.filter(x=>ye(x))),Vn=w(()=>oi.value.sort((x,E)=>{var W,ee;const F=(W=he[x.state.id])!=null&&W.minimized.value?1:0,j=(ee=he[E.state.id])!=null&&ee.minimized.value?1:0;return F-j}).map(x=>x.state.id));return vt(Vn,x=>{Gt(()=>{K.tabs=["main",...x]})}),vt(Nn,(x,E)=>{o.lt(x,E)&&(un(x,I,"resources"),un(x,P,"resources"),un(x,S,"tools"),un(x,V,"portals"),un(x,oe,"portals"),un(x,le,"portals"),un(x,Q,"portals"))}),{name:"World",board:g,energy:e,modifierTabs:ze,resourceNodes:t,toolNodes:n,influenceNodes:r,grantResource:fe,activePortals:oi,nextPowerCost:f,computedBonusConnectionsModifier:Nn,quarryProgressRequired:h,dropRates:qt,dowsing:I,empowerer:S,booster:V,upgrader:oe,automator:le,investments:Q,resourceLevels:l,planarMultis:ae,computedPortalCost:$i,display:J(()=>p(re,null,[p(hi,{class:"nav-container"},{default:()=>[p("span",{class:"nav-segment"},[p("h2",{style:"color: white; text-shadow: 0px 0px 10px white;"},[rt(nt)])," ",T("energy")]),p("span",{class:"nav-segment"},[T("("),p("h3",{style:"color: white; text-shadow: 0px 0px 10px white;"},[o.gt(at.value,0)?"+":"",rt(an)]),T("/s)")]),o.gt(d.value,0)?p("span",{class:"nav-segment"},[p("h3",{style:"color: var(--accent1); text-shadow: 0px 0px 10px var(--accent1);"},[ft(d.value)])," ",T("machines powered")]):null,p("span",{class:"nav-segment"},[p("button",{class:"button",style:"display: inline",onClick:()=>$t.value=!0},[T("modifiers")])]),K.devSpeed===0?p("span",{class:"nav-segment"},[T("Game Paused")]):K.devSpeed!=null&&K.devSpeed!==1?p("span",{class:"nav-segment"},[T("Dev Speed: "),Me(K.devSpeed),T("x")]):null]}),rt(g),rt(Vt)]))}}),kf=e=>{var i,r,a,l,u;const t=[y];let n=0;for(;`portal-${n}`in((i=e.layers)!=null?i:{});){const c=(r=e.layers)==null?void 0:r[`portal-${n}`];t.push(ia(`portal-${n}`,(a=c.tier)!=null?a:"dirt",(l=c.seed)!=null?l:Math.floor(Math.random()*4294967296),(u=c.influences)!=null?u:[])),n++}return t},ir=U(!1);function Mf(e,t){}var Sf=Object.freeze(Object.defineProperty({__proto__:null,main:y,getInitialLayers:kf,hasWon:ir,fixOldSave:Mf},Symbol.toStringTag,{value:"Module"}));const ni=e=>(hn("data-v-4a50ce42"),e=e(),bn(),e),If={class:"game-over-modal-header"},xf=["src","alt"],$f={class:"game-over-modal-title"},Ef=ni(()=>N("h2",null,"Congratulations!",-1)),Pf={key:0},Tf=ni(()=>N("br",null,null,-1)),Df=ni(()=>N("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Af=ni(()=>N("br",null,null,-1)),Rf=["href"],Ff=ni(()=>N("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Of=Y({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:l}=me,u=w(()=>_i(K.timePlayed)),c=w(()=>ir.value&&!K.keepGoing),d=en(K,"autosave");function v(){K.keepGoing=!0}function f(){dn(Pn())}return(h,g)=>(M(),te(Ht,{"model-value":s(c)},{header:H(()=>[N("div",If,[s(n)?(M(),A("img",{key:0,class:"game-over-modal-logo",src:s(n),alt:s(t)},null,8,xf)):z("",!0),N("div",$f,[Ef,N("h4",null,"You've beaten "+ce(s(t))+" v"+ce(s(a))+": "+ce(s(l)),1)])])]),body:H(({shown:C})=>[C?(M(),A("div",Pf,[N("div",null,"It took you "+ce(s(u))+" to beat the game.",1),Tf,Df,Af,N("div",null,[N("a",{href:s(r),class:"game-over-modal-discord-link"},[Ff,T(" "+ce(s(i)),1)],8,Rf)]),p(jt,{title:"Autosave",modelValue:s(d),"onUpdate:modelValue":g[0]||(g[0]=_=>Oe(d)?d.value=_:null)},null,8,["modelValue"])])):z("",!0)]),footer:H(()=>[N("div",{class:"game-over-footer"},[N("button",{onClick:v,class:"button"},"Keep Going"),N("button",{onClick:f,class:"button danger"},"Play Again")])]),_:1},8,["model-value"]))}});var qf=pe(Of,[["__scopeId","data-v-4a50ce42"]]);const Ii=e=>(hn("data-v-2776d67d"),e=e(),bn(),e),Vf=Ii(()=>N("div",{class:"nan-modal-header"},[N("h2",null,"NaN value detected!")],-1)),Bf={key:0},Lf=Ii(()=>N("br",null,null,-1)),jf=["href"],zf=Ii(()=>N("span",{class:"material-icons nan-modal-discord"},"discord",-1)),Uf=Ii(()=>N("br",null,null,-1)),Gf={class:"nan-footer"},Wf=Y({__name:"NaNScreen",setup(e){const{discordName:t,discordLink:n}=me,i=U(!0),r=U(!0),a=en(Ue,"hasNaN"),l=U(null);vt(a,h=>{h?(i.value=K.autosave,r.value=K.devSpeed===0):(K.autosave=i.value,K.devSpeed=r.value?0:null)});const u=w(()=>{var h;return(h=Ue.NaNPath)==null?void 0:h.join(".")}),c=w(()=>Ue.NaNPersistent!=null?Ue.NaNPersistent.value:null);function d(){Ue.NaNPersistent!=null&&(Ue.NaNPersistent.value=new o(0),Ue.hasNaN=!1)}function v(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(1),Ue.hasNaN=!1)}function f(){Ue.NaNPersistent&&(Ue.NaNPersistent.value=new o(NaN),Ue.hasNaN=!1)}return(h,g)=>(M(),A(re,null,[p(Ht,Wt({modelValue:s(a),"onUpdate:modelValue":g[4]||(g[4]=C=>Oe(a)?a.value=C:null)},h.$attrs),{header:H(()=>[Vf]),body:H(()=>[N("div",null,[T(' Attempted to assign "'+ce(s(u))+'" to NaN',1),s(c)?(M(),A("span",Bf,ce(" ")+"(previously "+ce(s(Me)(s(c)))+")",1)):z("",!0),T(". Auto-saving has been "+ce(i.value?"enabled":"disabled")+". Check the console for more details, and consider sharing it with the developers on discord. ",1)]),Lf,N("div",null,[N("a",{href:s(n)||"https://discord.gg/yJ4fjnjU54",class:"nan-modal-discord-link"},[zf,T(" "+ce(s(t)||"The Paper Pilot Community"),1)],8,jf)]),Uf,p(jt,{title:"Autosave",modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=C=>i.value=C)},null,8,["modelValue"]),s(me).enablePausing?(M(),te(jt,{key:0,title:"Pause game",modelValue:r.value,"onUpdate:modelValue":g[1]||(g[1]=C=>r.value=C)},null,8,["modelValue"])):z("",!0)]),footer:H(()=>[N("div",Gf,[N("button",{onClick:g[2]||(g[2]=C=>{var _;return(_=l.value)==null?void 0:_.open()}),class:"button"},"Open Saves Manager"),N("button",{onClick:d,class:"button"},"Set to 0"),N("button",{onClick:v,class:"button"},"Set to 1"),s(c)&&s(o).neq(s(c),0)&&s(o).neq(s(c),1)?(M(),A("button",{key:0,onClick:g[3]||(g[3]=C=>a.value=!1),class:"button"}," Set to previous ")):z("",!0),N("button",{onClick:f,class:"button danger"},"Ignore")])]),_:1},16,["modelValue"]),p(zr,{ref_key:"savesManager",ref:l},null,512)],64))}});var Hf=pe(Wf,[["__scopeId","data-v-2776d67d"]]);const Zf={key:0,class:"tpsDisplay"},Xf=Y({__name:"TPS",setup(e){const t=w(()=>o.div(Ue.lastTenTicks.length,Ue.lastTenTicks.reduce((n,i)=>n+i,0)));return(n,i)=>s(t).isNan()?z("",!0):(M(),A("div",Zf,"TPS: "+ce(s(ft)(s(t))),1))}});var Yf=pe(Xf,[["__scopeId","data-v-89b89152"]]);var Jf=Y({__name:"App",setup(e){const t=me.useHeader,n=w(()=>Ct[ue.theme].variables),i=en(ue,"showTPS"),r=w(()=>de(J(()=>p(re,null,[Ds.map(rt)]))));return(a,l)=>(M(),A(re,null,[N("div",{id:"modal-root",style:je(s(n))},null,4),N("div",{class:be(["app",{useHeader:s(t)}]),style:je(s(n))},[s(t)?(M(),te(Ur,{key:0})):z("",!0),p(Yl),s(s(i))?(M(),te(Yf,{key:1})):z("",!0),p(qf),p(Hf),(M(),te(Xe(s(r))))],6)],64))}});var Kf=pe(Jf,[["__scopeId","data-v-41d15e5e"]]);function Qf(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e;let u,c,d,v;const f=async(g=!0)=>{await d,g&&(u==null||u.addEventListener("controlling",C=>{C.isUpdate&&window.location.reload()})),await(v==null?void 0:v())};async function h(){if("serviceWorker"in navigator){const{Workbox:g,messageSW:C}=await Zn(()=>import("./workbox-window.4a8794bb.js"),[]);v=async()=>{c&&c.waiting&&await C(c.waiting,{type:"SKIP_WAITING"})},u=new g("./sw.js",{scope:"./",type:"classic"}),u.addEventListener("activated",_=>{_.isUpdate||i==null||i()});{const _=()=>{n==null||n()};u.addEventListener("waiting",_),u.addEventListener("externalwaiting",_)}u.register({immediate:t}).then(_=>{c=_,a?a("./sw.js",_):r==null||r(_)}).catch(_=>{l==null||l(_)})}}return d=h(),f}function ep(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:i,onRegistered:r,onRegisteredSW:a,onRegisterError:l}=e,u=U(!1),c=U(!1);return{updateServiceWorker:Qf({immediate:t,onNeedRefresh(){u.value=!0,n==null||n()},onOfflineReady(){c.value=!0,i==null||i()},onRegistered:r,onRegisteredSW:a,onRegisterError:l}),offlineReady:c,needRefresh:u}}document.title=me.title;window.projInfo=me;if(me.id==="")throw new Error("Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json");requestAnimationFrame(async()=>{console.log(`%cMade in Profectus%c +Learn more at www.moddingtree.com`,"font-weight: bold; font-size: 24px; color: #A3BE8C; background: #2E3440; padding: 4px 8px; border-radius: 8px;","padding: 4px;"),await Is();const{globalBus:e}=await Zn(()=>Promise.resolve().then(function(){return Ms}),void 0),{startGameLoop:t}=await Zn(()=>import("./gameLoop.382c0c1f.js"),["assets/gameLoop.382c0c1f.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/nanoevents.1080beb7.js","assets/lz-string.dccec454.js","assets/vue-next-select.ded54c4a.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.1879de79.js","assets/sortablejs.a0f68e5e.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-panzoom.8ce6f9b1.js","assets/panzoom.30c56ba6.js","assets/wheel.f2ae740f.js","assets/ngraph.events.083734c6.js","assets/vue-toastification.9c2dad53.js","assets/vue-toastification.4b5f8ac8.css"]),n=window.vue=Na(Kf);e.emit("setupVue",n),n.mount("#app"),Gt(()=>{const i=wi(),{updateServiceWorker:r}=ep({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Zn as _,Ue as a,me as b,Sf as c,Ye as g,xs as l,K as p,ue as s}; diff --git a/index.html b/index.html index ecbb18b..dea3088 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ Profectus - + diff --git a/sw.js b/sw.js index c339814..6218770 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.c3596ec6.js",revision:null},{url:"assets/index.24fb7a71.js",revision:null},{url:"assets/index.8dafe82c.css",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"c22f3990f29229326671e0c1e803a0d0"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),u={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map((e=>u[e]||o(e)))).then((e=>(l(...e),a)))}}define(["./workbox-7369c0e1"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"assets/@fontsource.f66d05e7.css",revision:null},{url:"assets/@vue.6b211d3c.js",revision:null},{url:"assets/amator.1e5a40c8.js",revision:null},{url:"assets/bezier-easing.a990b400.js",revision:null},{url:"assets/gameLoop.382c0c1f.js",revision:null},{url:"assets/index.8dafe82c.css",revision:null},{url:"assets/index.d763a9b8.js",revision:null},{url:"assets/lz-string.dccec454.js",revision:null},{url:"assets/nanoevents.1080beb7.js",revision:null},{url:"assets/ngraph.events.083734c6.js",revision:null},{url:"assets/panzoom.30c56ba6.js",revision:null},{url:"assets/sortablejs.a0f68e5e.js",revision:null},{url:"assets/vue-next-select.9e6f4164.css",revision:null},{url:"assets/vue-next-select.ded54c4a.js",revision:null},{url:"assets/vue-panzoom.8ce6f9b1.js",revision:null},{url:"assets/vue-textarea-autosize.35804eaf.js",revision:null},{url:"assets/vue-toastification.4b5f8ac8.css",revision:null},{url:"assets/vue-toastification.9c2dad53.js",revision:null},{url:"assets/vue.c16a309b.js",revision:null},{url:"assets/vuedraggable.1879de79.js",revision:null},{url:"assets/wheel.f2ae740f.js",revision:null},{url:"assets/workbox-window.4a8794bb.js",revision:null},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"favicon.svg",revision:"c8dd2748f1fedd25449164d7dda6aecb"},{url:"index.html",revision:"ee26f225342eeca1ddcf1adb42ce0c72"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"favicon.ico",revision:"eead31eb5b19fa3bdc34af83d898c0b7"},{url:"robots.txt",revision:"5e0bd1c281a62a380d7a948085bfe2d1"},{url:"apple-touch-icon.png",revision:"26e53bb981d06c8069ffd9d2a14fce0e"},{url:"pwa-192x192.png",revision:"a16785d9e890858c5b508e0ef6954aaf"},{url:"pwa-512x512.png",revision:"b84004b93fd62ef6599ff179372861a1"},{url:"manifest.webmanifest",revision:"e1e419fec40e2d042566c11fe4bce322"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));