Profectus-Demo/assets/index.e149ed54.js

18 lines
149 KiB
JavaScript
Raw Normal View History

import"./vue.37fee242.js";import{a2 as N,n as pe,y as Yt,u as Mt,H as l,b3 as Ie,ae as E,o as g,a4 as x,a5 as p,r as De,K as Q,x as O,aG as Gn,A as xe,b4 as Ne,ac as d,as as cn,U as K,aC as Tt,av as Ve,aJ as Ft,F as ne,c as A,w as V,b9 as Kt,bs as Ri,au as Be,bu as _t,T as Zt,Y as Bi,ab as C,l as qi,bv as An,aN as ce,a3 as P,O as U,aP as ee,M as W,aK as qe,aI as Le,D as Ze,bn as Li,br as Hn,aM as kt,ap as jt,L as ji,ay as zi,C as En,be as Ui}from"./@vue.7184beb0.js";import{i as Gi}from"./is-plain-object.906d88e8.js";import{c as Wn}from"./nanoevents.1080beb7.js";import{L as Ye}from"./lz-string.f2f3b7cf.js";import{_ as q,C as Hi}from"./@ivanv.350aa563.js";import{Y as Wi}from"./vue-next-select.e991724e.js";import{D as Yi}from"./vuedraggable.d1ae43bb.js";import{p as Ki}from"./vue-textarea-autosize.35804eaf.js";import{s as Zi,u as fn}from"./vue-toastification.80a5fcd9.js";import{A as Ji,u as Xi,E as Vn}from"./@pixi.c5050cb0.js";import{v as Qi,n as er}from"./workbox-window.60401ce8.js";import"./earcut.17d42416.js";import"./sortablejs.bd686609.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.b1bd21f4.js";import"./querystring.776b9ab3.js";const tr=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}};tr();const nr="modulepreload",Fn={},ir="./",zt=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ir}${i}`,i in Fn)return;Fn[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":nr,r||(o.as="script",o.crossOrigin=""),o.href=i,document.head.appendChild(o),r)return new Promise((s,u)=>{o.addEventListener("load",s),o.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},rr="Profectus Demo",ar="A demo project made in Profectus",or="profectus-demo",sr="",lr="",ur="",dr="0.0",cr="Initial Commit",fr=!0,pr=!1,mr=2,gr=!0,vr=null,hr="Logo.png",br=["main","c"],yr=3600,_r=1,kr=!0,wr="base64";var J={title:rr,description:ar,id:or,author:sr,discordName:lr,discordLink:ur,versionNumber:dr,versionTitle:cr,allowGoBack:fr,defaultShowSmall:pr,defaultDecimalsShown:mr,useHeader:gr,banner:vr,logo:hr,initialTabs:br,maxTickLength:yr,offlineLimit:_r,enablePausing:kr,exportEncoding:wr};const tn=17,xr=9e15,Nr=Math.log10(9e15),Sr=1/9e15,Cr=308,$r=-324,Dn=5,Mr=function(){const e=[];for(let n=$r+1;n<=Cr;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),Qe=[2,Math.E,3,4,5,6,7,8,9,10],Tr=[[1,1.0891168053867777,1.1789745164521264,1.2701428397304229,1.3632066654400328,1.4587804913784246,1.557523817412741,1.660158301473385,1.767487542936873,1.8804205225512542,2],[1,1.1121114330934,1.23103892493161,1.35838369631113,1.49605193039935,1.64635423375119,1.81213853570186,1.99697132461829,2.20538955455724,2.44325744833852,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.56112
`,e),await nt(ut())}}function ut(){const e=qt(),t=ai({id:e});return Ae(t),Z.saves.push(e),t}function qt(){let e,t=0;do e=`${J.id}-${t++}`;while(localStorage.getItem(e));return e}async function nt(e){console.info("Loading save",e);const{layers:t,removeLayer:n,addLayer:i}=await zt(()=>Promise.resolve().then(function(){return ya}),void 0),{fixOldSave:r,getInitialLayers:a}=await zt(()=>Promise.resolve().then(function(){return Ai}),void 0);for(const o in t){const s=t[o];s&&n(s)}a(e).forEach(o=>i(o,e)),e=ai(e),e.offlineProd&&e.time&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=(Date.now()-e.time)/1e3),e.time=Date.now(),e.modVersion!==J.versionNumber&&r(e.modVersion,e),Object.assign(T,e),Z.active=T.id,ge.emit("onLoad")}setInterval(()=>{T.autosave&&Ae()},1e3);window.onbeforeunload=()=>{T.autosave&&Ae()};window.save=Ae;const Xr=window.hardReset=async()=>{await nt(ut())},xt=Mt({active:"",saves:[],showTPS:!0,theme:pn.Nordic,unthrottled:!1});Ie(xt,e=>{const t=Ye.compressToUTF16(JSON.stringify(e));localStorage.setItem(J.id,t)},{deep:!0});var Z=window.settings=xt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:pn.Nordic};ge.emit("loadSettings",e),Object.assign(xt,e),Xr()};function Qr(){try{let e=localStorage.getItem(J.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Ye.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(xt,t)}ge.emit("loadSettings",xt)}catch{}}const oi=Mt([]);function si(e){oi.push(e)}const li=Mt([]);function ea(e){li.push(e)}const ta=Mt([]),na={class:"table"},Lt=E({__name:"Column",setup(e){const t=N(()=>ze[Z.theme].mergeAdjacent);return(n,i)=>(g(),x("div",na,[p("div",{class:Q(["col",{mergeAdjacent:l(t)}])},[De(n.$slots,"default")],2)]))}}),ia={class:"table"},bt=E({__name:"Row",setup(e){const t=N(()=>ze[Z.theme].mergeAdjacent);return(n,i)=>(g(),x("div",ia,[p("div",{class:Q(["row",{mergeAdjacent:l(t)}])},[De(n.$slots,"default")],2)]))}});function ui(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!cn(e)}function D(e,t="span"){return typeof e=="function"?E({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),E({template:e})):E({render:()=>({})}):e}function oe(e){if(Te(e))return typeof e=="function"?e():D(e);const t=e[de];return d(t,e[me](),null)}function Pe(...e){let t;return d(bt,null,ui(t=e.map(oe))?t:{default:()=>[t]})}function ra(...e){let t;return d(Lt,null,ui(t=e.map(oe))?t:{default:()=>[t]})}function Re(e){if(Te(e))return typeof e=="function"?e():typeof e=="string"?d(K,null,[e]):d(e,null,null);const t=e[de];return d(t,e[me](),null)}function Te(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[wt]===!0}function mn(e,t){const n=O(null),i=O(void 0);function r(s){n.value||(n.value=setInterval(o,250)),i.value=s}function a(){n.value&&(clearInterval(n.value),n.value=null)}function o(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return Gn(a),{start:r,stop:a,handleHolding:o}}function ct(e,t="div"){const n=xe();return Ne(()=>{n.value=D(ae(e),t)}),n}function it(e,t="div"){const n=xe(null);return Ne(()=>{const i=ae(e);n.value=i==null?null:D(i,t)}),n}function aa(e){return N(()=>ae(e))}function ae(e){return l(l(e))}function k(...e){return e.includes(Object)||e.push(Object),e}const oa=E({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var h;const n=O({}),i=new ResizeObserver(s),r=O(null);Tt(()=>{const v=r.value;v!=null&&i.observe(v)});let a=!0,o=O((h=r.value)==null?void 0:h.getBoundingClientRect());function s(){r.value!=null&&a&&(a=!1,Ve(()=>{var v;o.value=(v=r.value)==null?void 0:v.getBoundingClientRect(),Object.values(n.value).filter(b=>b).forEach(b=>b.rect=b.element.getBoundingClientRect()),t("updateNodes",n.value),a=!0}))}document.fonts.ready.then(s);const u={attributes:!1,childList:!0,subtree:!1};Ft(gn,(v,b)=>{const w=new MutationObserver(()=>c(v));w.observe(b,u),n.
`).slice(3,5).map(t=>t.trim()).join(`
`))||""}function ue(e){const t=pe(e)?e:O(e);return t[Nt]=t,t[St]=pe(e)?e.value:e,t[Ht]=va(),t[ci]=!1,Ee.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",t,`
Created at:
`+t[Ht]):dt[Ee[Ee.length-1]].add(t),t}ge.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let o=!1;return Object.keys(r).forEach(s=>{const u=r[s];if(u&&typeof u=="object")if(Nt in u){if(o=!0,u[ci]){console.warn("Deleted persistent ref present in returned object. Ignoring...",u,`
Created at:
`+u[Ht]);return}dt[e.id].delete(fe in u?u[fe]:u);const c=a.reduce((v,b)=>(b in v||(v[b]={}),v[b]),t),h=c[s];c[s]=u[Nt],qi(c)?h!=null?c[s]=h:c[s]=u[St]:h!=null?c[s].value=h:c[s].value=u[St]}else!(u instanceof f)&&!pe(u)&&!n.includes(u)&&(typeof u.type=="symbol"&&n.push(u),i(u,[...a,s])&&(An(u)&&!An(r)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",fe in r?r[fe]:r,s):o=!0))}),o};i(e),dt[e.id].forEach(r=>{console.error(`Created persistent ref in ${e.id} without registering it to the layer! Make sure to include everything persistent in the returned object`,r,`
Created at:
`+r[Ht])}),dt[e.id].clear()});const gn=Symbol("RegisterNode"),vn=Symbol("UnregisterNode"),hn=Symbol("Nodes"),bn=Symbol("Bounds"),_e=Yt({});window.layers=_e;const dt={},Ee=[];function It(e,t){return le(()=>{const n={},i=n.emitter=Wn();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=O({}),n.id=e,Ee.push(e),dt[e]=new Set,n.minimized=ue(!1),Object.assign(n,t.call(n)),Ee[Ee.length-1]==null||Ee[Ee.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${Ee}
Trying to pop ${n.id}`;return Ee.pop(),y(n,"color"),y(n,"display"),y(n,"name"),z(n,"name",n.id),y(n,"minWidth"),z(n,"minWidth",600),y(n,"minimizable"),z(n,"minimizable",!0),n})}function fi(e,t){if(console.info("Adding layer",e.id),_e[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,_e[e.id]);return}z(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),_e[e.id]=e,ge.emit("addLayer",e,t.layers[e.id])}function ha(e){return _e[e]}function pi(e){console.info("Removing layer",e.id),ge.emit("removeLayer",e),_e[e.id]=void 0}function ba(e){pi(e),fi(e,T)}function mi(e){const t=O(!1);return{openModal:()=>t.value=!0,modal:L(()=>d(Je,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[l(e.name)]),body:l(e.display)}))}}ge.on("update",function(t){Object.values(_e).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(_e).forEach(n=>{n==null||n.emit("update",t)}),Object.values(_e).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ya=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:gn,UnregisterNodeInjectionKey:vn,NodesInjectionKey:hn,BoundsInjectionKey:bn,layers:_e,persistentRefs:dt,addingLayers:Ee,createLayer:It,addLayer:fi,getLayer:ha,removeLayer:pi,reloadLayer:ba,setupLayerModal:mi},Symbol.toStringTag,{value:"Module"}));const _a=E({components:{Context:di},props:{index:{type:Number,required:!0},tab:{type:Function,required:!0},display:{type:k(Object,String,Function),required:!0},minimized:{type:Object,required:!0},minWidth:{type:k(Number,String),required:!0},name:{type:k(String),required:!0},color:k(String),minimizable:k(Boolean),nodes:{type:Object,required:!0}},setup(e){const{display:t,index:n,minimized:i,minWidth:r,tab:a}=ne(e),o=ct(t),s=N(()=>J.allowGoBack&&n.value>0&&!i.value);function u(){T.tabs.splice(l(e.index),1/0)}Ve(()=>h(i.value,l(r.value))),Ie([i,aa(r)],([v,b])=>h(v,b));function c(v){e.nodes.value=v}function h(v,b){const w=typeof b=="number"||Number.isNaN(parseInt(b))?b+"px":b,S=a.value();S!=null&&(v?(S.style.flexGrow="0",S.style.flexShrink="0",S.style.width="60px",S.style.minWidth=S.style.flexBasis="",S.style.margin="0"):(S.style.flexGrow="",S.style.flexShrink="",S.style.width="",S.style.minWidth=S.style.flexBasis=w,S.style.margin=""))}return{component:o,showGoBack:s,updateNodes:c,unref:l,goBack:u}}});function ka(e,t,n,i,r,a){const o=ce("Context");return g(),x("div",{class:"layer-container",style:W({"--layer-color":e.unref(e.color)})},[e.showGoBack?(g(),x("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...s)=>e.goBack&&e.goBack(...s))},"\u2190")):P("",!0),e.minimized.value?(g(),x("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=s=>e.minimized.value=!1)},[p("div",null,U(e.unref(e.name)),1)])):(g(),x("div",{key:2,class:Q(["layer-tab",{showGoBack:e.showGoBack}])},[d(o,{onUpdateNodes:e.updateNodes},{default:V(()=>[(g(),A(ee(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(g(),x("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=s=>e.minimized.value=!0)}," \u25BC ")):P("",!0)],4)}var wa=q(_a,[["render",ka],["__scopeId","data-v-34c9d881"]]);const gi=e=>(qe("data-v-4b4bda40"),e=e(),Le(),e),xa=gi(()=>p("h2",null,"Changelog",-1)),Na=gi(()=>p("details",{open:""},[p("summary",null,[C("v0.0 Initial Commit - "),p("time",null,"2021-09-04")]),C(" This is the first release :D "),p("ul",null,[p("li",{class:"feature"},"Did everything"),p("li",{class:"fix"},"Had some fun"),p("li",{class:"breaking"},"Removed everything"),p("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Sa=E({__name:"Changelog",setup(e,{expose:t}){const n=O(!1);return t({open(){n.value=!0}}),(i,r)=>(g(),A(Je,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:V(()=>[xa]),body:V(()=>[Na]),_:1},8,["modelValue"]))}});var Ca=q(Sa,[["__scopeId","data-v-4b4bda40"]]),$a=E({props:{element:Object,display:{type:k(Object,String,Function),required:!0},style:k(Object,String,Array),classes:k(Object),direction:k(String),xoffset:k(String),yoffset:k(String),pinned:Object},setup(e){const{element:t,display:
${G}
${I}`)}}return c[M]}Ie(n,M=>{M&&Object.keys(c).forEach(I=>delete c[I])});const v=N(()=>Z.saves.reduce((M,I)=>(M[I]=h(I),M),{}));function b(M){let I;switch(T.id===M?I=ii(T[fe]):I=JSON.stringify(v.value[M]),J.exportEncoding){default:console.warn(`Unknown save encoding: ${J.exportEncoding}. Defaulting to lz`);case"lz":I=Ye.compressToUTF16(I);break;case"base64":I=btoa(unescape(encodeURIComponent(I)));break;case"plain":break}const G=document.createElement("textarea");G.value=I,document.body.appendChild(G),G.select(),G.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(G)}function w(M){T.id===M&&Ae();const I={...v.value[M],id:qt()};Ae(I),Z.saves.push(I.id)}function S(M){Z.saves=Z.saves.filter(I=>I!==M),localStorage.removeItem(M),c[M]=void 0}function $(M){v.value[T.id].time=T.time,Ae(),c[T.id]=void 0,nt(v.value[M]),c[M]=void 0}function R(M){if(o.value=M,Ve(()=>{o.value=null}),M[0]!=="{")if(M[0]==="e")M=decodeURIComponent(escape(atob(M)));else if(M[0]==="\u1BE1")M=Ye.decompressFromUTF16(M);else{console.warn("Unable to determine preset encoding",M);return}const I=JSON.parse(M);I.id=qt(),Ae(I),Z.saves.push(I.id),$(I.id)}function ke(M,I){const G=v.value[M];G&&(G.name=I,T.id===M?(T.name=I,Ae()):(Ae(G),c[M]=void 0))}return(M,I)=>(g(),A(Je,{modelValue:n.value,"onUpdate:modelValue":I[4]||(I[4]=G=>n.value=G),ref_key:"modal",ref:i},{header:V(()=>[Ao]),body:V(({shown:G})=>[G?(g(),A(l(Yi),{key:0,list:l(Z).saves,handle:".handle",itemKey:be=>be},{item:V(({element:be})=>[d(Oo,{save:l(v)[be],onOpen:te=>$(be),onExport:te=>b(be),onEditName:te=>ke(be,te),onDuplicate:te=>w(be),onDelete:te=>S(be)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):P("",!0)]),footer:V(()=>[p("div",Eo,[d(_n,{modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=G=>a.value=G),title:"Import Save",placeholder:"Paste your save here!",class:Q({importingFailed:r.value})},null,8,["modelValue","class"]),p("div",Vo,[Fo,p("div",Do,[p("button",{class:"button",onClick:I[1]||(I[1]=G=>$(l(ut)().id))},"New Game"),Object.keys(l(u)).length>0?(g(),A(yn,{key:0,options:l(u),modelValue:o.value,"onUpdate:modelValue":I[2]||(I[2]=G=>R(G)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):P("",!0)])]),p("div",Ro,[Bo,p("button",{class:"button modal-default-button",onClick:I[3]||(I[3]=G=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var hi=q(qo,[["__scopeId","data-v-3b9991aa"]]);const Se=e=>(qe("data-v-4a3f8425"),e=e(),Le(),e),Lo=["src","alt"],jo={key:1,class:"title"},zo=Se(()=>p("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),Uo={class:"discord"},Go={class:"discord-links"},Ho={key:0},Wo=["href"],Yo=Se(()=>p("li",null,[p("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),Ko=Se(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Zo={href:"https://forums.moddingtree.com/",target:"_blank"},Jo=Se(()=>p("span",{class:"material-icons"},"forum",-1)),Xo=Se(()=>p("span",{class:"material-icons"},"info",-1)),Qo=Se(()=>p("span",{class:"material-icons"},"library_books",-1)),es=Se(()=>p("span",{class:"material-icons"},"settings",-1)),ts=Se(()=>p("span",{class:"material-icons"},"library_books",-1)),ns=Se(()=>p("span",{class:"material-icons"},"settings",-1)),is=Se(()=>p("span",{class:"material-icons"},"info",-1)),rs={href:"https://forums.moddingtree.com/",target:"_blank"},as=Se(()=>p("span",{class:"material-icons"},"forum",-1)),os={class:"discord"},ss={class:"discord-links"},ls={key:0},us=["href"],ds=Se(()=>p("li",null,[p("a",{href:"https://discord.gg/WzejVAx",target:"_blank"},"The Paper Pilot Community")],-1)),cs=Se(()=>p("li",null,[p("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),fs=E({__name:"Nav",setup(e){const t=O(null),n=O(null),i=O(null),r=O(null),{useHeader:a,banner:o,title:s,discordName:u,discordLink:c,versionNumber:h}=J;function v(){window.open(c,"mywindow")}return(b,w)=>(g(),x(K,null,[l(a)?(g(),x("div",Be({key:0,class:"nav"},b.$
Reward: The dinosaur is now your friend (you can max Farm Points).`,shouldEarn:function(){return f.gte(Fe.points.value,1)},onComplete(){console.log("Bork bork bork!")}})),s=[r,a,o],u=rl(()=>({rows:2,cols:2,getStartState(h){return h},getStyle(h,v){return{backgroundColor:`#${Number(v)*1234%999999}`}},getTitle(h){let v="";return h==="101"?v="top":h==="102"?v="bottom":h==="201"?v="left":h==="202"&&(v="right"),L(()=>d(re,Be({display:JSON.stringify(this.cells[h].style)},{[v]:!0}),{default:()=>[d("h3",null,[C("Gridable #"),h])]}))},getDisplay(h,v){return String(v)},getCanClick(){return f.eq(Y.points.value,10)},onClick(h,v){this.cells[h].state=Number(v)+1}})),c=L(()=>{let h,v,b;return d(K,null,[d(bt,null,{default:()=>[d(re,{display:r.tooltip,bottom:!0},ln(h=oe(r))?h:{default:()=>[h]}),d(re,{display:a.tooltip,bottom:!0},ln(v=oe(a))?v:{default:()=>[v]}),d(re,{display:o.tooltip,bottom:!0},ln(b=oe(o))?b:{default:()=>[b]})]}),Pe(u)])});return{id:Un,color:e,name:t,points:n,achievements:s,grid:u,treeNode:i,display:c}}),Y=It("main",function(){const e=Ct(10),t=yi(e),n=ks(e),i=N(()=>{if(!Oe.generatorUpgrade.bought.value)return new f(0);let u=new f(3.19);return Oe.lollipopMultiplierUpgrade.bought.value&&(u=u.times(Oe.lollipopMultiplierEffect.value)),u});ge.on("update",u=>{e.value=f.add(e.value,f.times(i.value,u))});const r=Ns(e,i),{openModal:a,modal:o}=mi(dn),s=ki(()=>({nodes:[[Oe.treeNode],[Fe.treeNode,Oe.spook]],leftSideNodes:[dn.treeNode,Oe.h],branches:[{startNode:Fe.treeNode,endNode:Oe.treeNode,stroke:"blue","stroke-width":"25px",style:{filter:"blur(5px)"}}],onReset(){e.value=En(this.resettingNode.value)===En(Oe.treeNode)?0:10,t.value=e.value,n.value=e.value},resetPropagation:Ls}));return{name:"Tree",display:L(()=>d(K,null,[T.devSpeed===0?d("div",null,[C("Game Paused")]):null,T.devSpeed&&T.devSpeed!==1?d("div",null,[C("Dev Speed: "),se(T.devSpeed),C("x")]):null,T.offlineTime?d("div",null,[C("Offline Time: "),Jt(T.offlineTime)]):null,d("div",null,[f.lt(e.value,"1e1000")?d("span",null,[C("You have ")]):null,d("h2",null,[se(e.value)]),f.lt(e.value,"1e1e6")?d("span",null,[C(" points")]):null]),f.gt(i.value,0)?d("div",null,[C("("),r.value,C(")")]):null,d(ye,null,null),d("button",{onClick:a},[C("open achievements")]),oe(o),oe(s),d(_s,{height:"200px",style:"margin: 10px auto; display: block"},null)])),points:e,best:t,total:n,oomps:r,tree:s,showAchievements:a}}),Ou=e=>[Y,Fe,Oe,dn],Nn=N(()=>f.gt(Y.points.value,25));function Au(e,t){}var Ai=Object.freeze(Object.defineProperty({__proto__:null,main:Y,getInitialLayers:Ou,hasWon:Nn,fixOldSave:Au},Symbol.toStringTag,{value:"Module"}));const Pt=e=>(qe("data-v-4a50ce42"),e=e(),Le(),e),Eu={class:"game-over-modal-header"},Vu=["src","alt"],Fu={class:"game-over-modal-title"},Du=Pt(()=>p("h2",null,"Congratulations!",-1)),Ru={key:0},Bu=Pt(()=>p("br",null,null,-1)),qu=Pt(()=>p("div",null," Please check the Discord to discuss the game or to check for new content updates! ",-1)),Lu=Pt(()=>p("br",null,null,-1)),ju=["href"],zu=Pt(()=>p("span",{class:"material-icons game-over-modal-discord"},"discord",-1)),Uu=E({__name:"GameOverScreen",setup(e){const{title:t,logo:n,discordName:i,discordLink:r,versionNumber:a,versionTitle:o}=J,s=N(()=>Jt(T.timePlayed)),u=N(()=>Nn.value&&!T.keepGoing),c=Ze(T,"autosave");function h(){T.keepGoing=!0}function v(){nt(ut())}return(b,w)=>(g(),A(Je,{"model-value":l(u)},{header:V(()=>[p("div",Eu,[l(n)?(g(),x("img",{key:0,class:"game-over-modal-logo",src:l(n),alt:l(t)},null,8,Vu)):P("",!0),p("div",Fu,[Du,p("h4",null,"You've beaten "+U(l(t))+" v"+U(l(a))+": "+U(l(o)),1)])])]),body:V(({shown:S})=>[S?(g(),x("div",Ru,[p("div",null,"It took you "+U(l(s))+" to beat the game.",1),Bu,qu,Lu,p("div",null,[p("a",{href:l(r),class:"game-over-modal-discord-link"},[zu,C(" "+U(l(i)),1)],8,ju)]),d(we,{title:"Autosave",modelValue:l(c),"onUpdate:modelValue":w[0]||(w[0]=$=>pe(c)?c.value=$:null)},null,8,["modelValue"])])):P("",!0)]),footer:V(()=>[p("div",{class:"game-over-footer"},[p("button",{onClick:h,class:"button"},"Keep Going"),p("button",{onClick:v,class:"button danger"},"Play Again")])]),_:1},8,["model-v
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 Jr();const{globalBus:e,startGameLoop:t}=await zt(()=>Promise.resolve().then(function(){return Zr}),void 0),n=window.vue=Ui(od);e.emit("setupVue",n),n.mount("#app"),Ve(()=>{const i=fn(),{updateServiceWorker:r}=ld({onNeedRefresh(){i.info("New content available, click or reload 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()});