21 lines
192 KiB
JavaScript
21 lines
192 KiB
JavaScript
|
/* empty css */import"./vue.72cfed44.js";import{u as $t,H as l,af as A,x as V,o as b,a5 as S,r as Ye,bv as Rt,K as re,aw as tt,a3 as P,aD as Mt,a6 as v,O as G,U,aN as We,a4 as F,M as ee,ac as M,ad as m,w as x,aL as ze,aJ as Ge,n as ye,y as fn,b4 as je,aH as hr,A as ke,b5 as De,at as br,aK as Xt,F as ue,c as D,ba as mn,av as Ue,bt as ci,T as Mn,Y as di,l as fi,bw as Je,aC as mi,aO as ve,aQ as ie,D as nt,bo as pi,bs as yr,aq as ln,bx as gi,L as vi,az as hi,C as ir,bf as bi}from"./@vue.6a1d7e86.js";import{L as et}from"./lz-string.dccec454.js";import{_ as K,C as yi}from"./@ivanv.c33db252.js";import{c as _r}from"./nanoevents.1080beb7.js";import{Y as _i}from"./vue-next-select.3d5e8343.js";import{D as Ci}from"./vuedraggable.a52097e2.js";import{p as wi}from"./vue-textarea-autosize.35804eaf.js";import{s as ki,u as Cr}from"./vue-toastification.42f47de1.js";import{A as wr,T as Ni,R as Si,B as Ii,u as $i,E as sr}from"./@pixi.94823b24.js";import"./earcut.b6f90e68.js";import"./sortablejs.740e9352.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.68c785f7.js";import"./querystring.d4befb87.js";const Mi=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}};Mi();const Ti="modulepreload",or={},Pi="./",At=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Pi}${r}`,r in or)return;or[r]=!0;const i=r.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${s}`))return;const o=document.createElement("link");if(o.rel=i?"stylesheet":Ti,i||(o.as="script",o.crossOrigin=""),o.href=r,document.head.appendChild(o),i)return new Promise((a,c)=>{o.addEventListener("load",a),o.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},Oi="./projInfo-schema.json",Fi="Profectus Demo",Ei="A demo project made in Profectus",qi="profectus-demo",Vi="",Di="",Ri="",Ai="0.0",Bi="Initial Commit",Li=!0,xi=!1,ji=2,Ui=!0,zi=null,Gi="Logo.png",Hi=["main","c"],Wi=3600,Ki=1,Yi=!0,Ji="base64";var te={$schema:Oi,title:Fi,description:Ei,id:qi,author:Vi,discordName:Di,discordLink:Ri,versionNumber:Ai,versionTitle:Bi,allowGoBack:Li,defaultShowSmall:xi,defaultDecimalsShown:ji,useHeader:Ui,banner:zi,logo:Gi,initialTabs:Hi,maxTickLength:Wi,offlineLimit:Ki,enablePausing:Yi,exportEncoding:Ji};const Zi=$t({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var R=window.player=Zi;function Tn(e){return JSON.stringify(e,(t,n)=>l(n))}const Xi=["onClick"],Qi=A({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=V(!1),r=V(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,tt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(s,o)=>(b(),S("button",{onClick:Rt(i,["stop"]),class:re(["feedback",{activated:n.value,left:e.left}])},[Ye(s.$slots,"default",{},void 0,!0)],10,Xi))}});var Pn=K(Qi,[["__scopeId","data-v-01a1b95c"]]);const pn=e=>(ze("data-v-ac351c02"),e=e(),Ge(),e),es={class:"error"},ts={class:"error-title"},ns={class:"error-details",style:{"margin-top":"-10px"}},rs={key:0},is={class:"instructions"},ss=["href"],os=pn(()=>v("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),as=pn(()=>v("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),ls=pn(()=>v("br",null,null,-1)),us={key:0,styl
|
||
|
`))),i=P(()=>t.errors.map(o=>o.cause==null?[]:(typeof o.cause=="string"?o.cause:JSON.stringify(o.cause)).split(`
|
||
|
`)));function s(){let o=Tn(R);switch(te.exportEncoding){default:console.warn(`Unknown save encoding: ${te.exportEncoding}. Defaulting to lz`);case"lz":o=et.compressToUTF16(o);break;case"base64":o=btoa(unescape(encodeURIComponent(o)));break;case"plain":break}console.log(o);const a=document.createElement("textarea");a.value=o,document.body.appendChild(a),a.select(),a.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(a)}return Mt(()=>{R.autosave=!1,R.devSpeed=0}),(o,a)=>(b(),S("div",es,[v("h1",ts,G(l(n).name)+": "+G(l(n).message),1),v("div",ns,[l(n).cause?(b(),S("div",rs,[(b(!0),S(U,null,We(l(i)[0],c=>(b(),S("div",{key:c},G(c),1))),128))])):F("",!0),l(n).stack?(b(),S("div",{key:1,style:ee(l(n).cause?"margin-top: 10px":"")},[(b(!0),S(U,null,We(l(r)[0],c=>(b(),S("div",{key:c},G(c),1))),128))],4)):F("",!0)]),v("div",is,[M(" Check the console for more details, and consider sharing it with the developers on "),v("a",{href:l(te).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,ss),M("! "),m(Pn,{onClick:s,class:"button",style:{display:"inline-flex"}},{default:x(()=>[os,as]),_:1}),ls,e.errors.length>1?(b(),S("div",us,ds)):F("",!0),(b(!0),S(U,null,We(e.errors.slice(1),(c,d)=>(b(),S("div",{key:d,style:{"margin-top":"20px"}},[v("details",fs,[v("summary",null,G(c.name)+": "+G(c.message),1),c.cause?(b(),S("div",ms,[(b(!0),S(U,null,We(l(i)[d+1],g=>(b(),S("div",{key:g},G(g),1))),128))])):F("",!0),c.stack?(b(),S("div",ps,[(b(!0),S(U,null,We(l(r)[d+1],g=>(b(),S("div",{key:g},G(g),1))),128))])):F("",!0)])]))),128))])]))}});var kr=K(gs,[["__scopeId","data-v-ac351c02"]]);class vs{constructor(t){this.map=new Map,this.first=void 0,this.last=void 0,this.maxSize=t}get size(){return this.map.size}get(t){const n=this.map.get(t);if(n!==void 0)return n!==this.first&&(n===this.last?(this.last=n.prev,this.last.next=void 0):(n.prev.next=n.next,n.next.prev=n.prev),n.next=this.first,this.first.prev=n,this.first=n),n.value}set(t,n){if(this.maxSize<1)return;if(this.map.has(t))throw new Error("Cannot update existing keys in the cache");const r=new hs(t,n);for(this.first===void 0?(this.first=r,this.last=r):(r.next=this.first,this.first.prev=r,this.first=r),this.map.set(t,r);this.map.size>this.maxSize;){const i=this.last;this.map.delete(i.key),this.last=i.prev,this.last.next=void 0}}}class hs{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const _n=17,bs=9e15,ys=Math.log10(9e15),_s=1/9e15,Cs=308,ws=-324,ar=5,ks=(1<<10)-1,Ns=function(){const e=[];for(let n=ws+1;n<=Cs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),mt=[2,Math.E,3,4,5,6,7,8,9,10],Ss=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.1793017514670474,1.394
|
||
|
`,e),await vt(kt())}}function kt(){const e=nn(),t=Or({id:e});return Oe(t),Q.saves.push(e),t}function nn(){let e,t=0;do e=`${te.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const En=V(!1);async function vt(e){console.info("Loading save",e),En.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await At(()=>Promise.resolve().then(function(){return ja}),void 0),{fixOldSave:i,getInitialLayers:s}=await At(()=>Promise.resolve().then(function(){return Xd}),void 0);for(const o in t){const a=t[o];a&&n(a)}s(e).forEach(o=>r(o,e)),e=Or(e),e.offlineProd&&e.time!=null&&e.time&&e.devSpeed!==0&&(e.offlineTime==null&&(e.offlineTime=0),e.offlineTime+=Math.min(e.offlineTime+(Date.now()-e.time)/1e3,te.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==te.versionNumber&&(i(e.modVersion,e),e.modVersion=te.versionNumber),Object.assign(R,e),Q.active=R.id,he.emit("onLoad")}setInterval(()=>{R.autosave&&Oe()},1e3);window.onbeforeunload=()=>{R.autosave&&Oe()};window.save=Oe;const Ws=window.hardReset=async()=>{await vt(kt())};window.deleteLowerSaves=()=>{const e=Object.values(Q.saves).indexOf(R.id)+1;Object.values(Q.saves).slice(e).forEach(t=>localStorage.removeItem(t)),Q.saves=Q.saves.slice(0,e)};const xt=$t({active:"",saves:[],showTPS:!0,theme:Fn.Nordic,unthrottled:!1,alignUnits:!1});je(xt,e=>{const t=et.compressToUTF16(JSON.stringify(e));localStorage.setItem(te.id,t)},{deep:!0});var Q=window.settings=xt;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Fn.Nordic,alignUnits:!1};he.emit("loadSettings",e),Object.assign(xt,e),Ws()};function Ks(){try{let e=localStorage.getItem(te.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=et.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(xt,t)}he.emit("loadSettings",xt)}catch{}}const Fr=$t([]);function Er(e){Fr.push(e)}const qr=$t([]);function Ys(e){qr.push(e)}const Js=$t([]),Zs={class:"table"},rn=A({__name:"Column",setup(e){const t=P(()=>rt[Q.theme].mergeAdjacent);return(n,r)=>(b(),S("div",Zs,[v("div",{class:re(["col",{mergeAdjacent:l(t)}])},[Ye(n.$slots,"default")],2)]))}}),Xs={class:"table"},sn=A({__name:"Row",setup(e){const t=P(()=>rt[Q.theme].mergeAdjacent);return(n,r)=>(b(),S("div",Xs,[v("div",{class:re(["row",{mergeAdjacent:l(t)}])},[Ye(n.$slots,"default")],2)]))}});function Vr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!br(e)}function H(e,t="span"){return typeof e=="function"?A({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),A({template:e})):A({render:()=>({})}):e}function be(e){if(Ae(e))return typeof e=="function"?e():H(e);const t=e[Ce];return m(t,e[we](),null)}function Ve(...e){let t;return m(sn,null,Vr(t=e.map(be))?t:{default:()=>[t]})}function Qs(...e){let t;return m(rn,null,Vr(t=e.map(be))?t:{default:()=>[t]})}function xe(e){if(Ae(e))return typeof e=="function"?e():typeof e=="string"?m(U,null,[e]):m(e,null,null);const t=e[Ce];return m(t,e[we](),null)}function dr(e,t){return e.reduce((n,r)=>m(U,null,[n,t,r]))}function Ae(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Lt]===!0}function qn(e,t){const n=V(null),r=V(void 0);function i(a){n.value||(n.value=setInterval(o,250)),r.value=a}function s(){n.value&&(clearInterval(n.value),n.value=null)}function o(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return hr(s),{start:i,stop:s,handleHolding:o}}function It(e,t="div"){const n=ke();return De(()=>{n.value=H(ae(e),t)}),n}function ut(e,t="div"){const n=ke(null);return De(()=>{const r=ae(e);n.value=r==""||r==null?null:H(r,t)}),n}function ae(e){return l(l(e))}function $(...e){return e.includes(Object)||e.push(Object),e}function eo(e){return Object.keys(e).reduce((t,n)=>(t[Us(n)]=e[n],t),{})}const to=A({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var g;const n=V({}),r=new ResizeObserver(a),i=V(null);Mt(()=>{const p=i.value;p!=null&&
|
||
|
`).slice(3,5).map(n=>n.trim()).join(`
|
||
|
`))!=null?t:""}function fr(e,t){var n;u.isNaN(t)&&(fe.hasNaN||(R.autosave=!1,fe.hasNaN=!0,fe.NaNPath=e[ht],fe.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[ht])==null?void 0:n.join(".")}`)),e[at].value=t}function _e(e,t=!0){const n=ye(e)?e:V(e);ye(e)&&(e=e.value);const r=P({get(){return n.value},set(s){t?fr(i,s):i[at].value=s}});r[lt]=e;const i={get value(){return n.value},set value(s){t?fr(i,s):i[at].value=s},__v_isRef:!0,[at]:n,[lt]:e,[cn]:Aa(),[Sn]:!1,[Ke]:r,[ht]:void 0};return Le.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
|
||
|
Created at:
|
||
|
`+i[cn]):Nt[Le[Le.length-1]].add(i),i}function Ba(e){return e!=null&&typeof e=="object"&&at in e}function qt(e){return!(ot in e)&&Ke in e?e[Ke]:new Proxy(e,{get(t,n){if(n!==at)return n===jt?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===at?!1:n==jt?!0:Reflect.has(t,n)}})}he.on("addLayer",(e,t)=>{const n=[],r=(i,s=[])=>{let o=!1;return Object.keys(i).forEach(a=>{let c=i[a];if(c!=null&&typeof c=="object"){if(c[jt]===!0)return;if(ot in c&&(c=c[ot]),Ba(c)){if(o=!0,c[Sn]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
||
|
Created at:
|
||
|
`+c[cn]);return}Nt[e.id].delete(c);const d=[e.id,...s,a];c[ht]!=null&&JSON.stringify(d)!==JSON.stringify(c[ht])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[ht].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[ht]=d;const g=s.reduce((y,w)=>(w in y||(y[w]={}),y[w]),t),p=g[a];g[a]=c[at],fi(g)?p!=null?g[a]=p:g[a]=c[lt]:p!=null?g[a].value=p:g[a].value=c[lt]}else!(c instanceof u)&&!(c instanceof f)&&!ye(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...s,a])&&(Je(c)&&!Je(i)?console.warn("Found array that contains persistent values when adding layer. Keep in mind changing the order of elements in the array will mess with existing player saves.",ot in i?i[ot]:i,a):o=!0))}}),o};r(e[ot]),Nt[e.id].forEach(i=>{i[Sn]||console.error(`Created persistent ref in ${e.id} without registering it to the layer!`,`Make sure to include everything persistent in the returned object.
|
||
|
|
||
|
Created at:
|
||
|
`+i[cn])}),Nt[e.id].clear()});const Vn=Symbol("RegisterNode"),Dn=Symbol("UnregisterNode"),Rn=Symbol("Nodes"),An=Symbol("Bounds"),Ie=fn({});window.layers=Ie;const Nt={},Le=[];function Gt(e,t){return ce(()=>{const n={},r=n.emitter=_r();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=V({}),n.id=e,Le.push(e),Nt[e]=new Set,n.minimized=_e(!1,!1),Object.assign(n,t.call(n,n)),Le[Le.length-1]==null||Le[Le.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen
|
||
|
Stack: ${Le}
|
||
|
Trying to pop ${n.id}`);Le.pop(),k(n,"color"),k(n,"display"),k(n,"classes"),k(n,"style"),k(n,"name"),W(n,"name",n.id),k(n,"minWidth"),W(n,"minWidth",600),k(n,"minimizable"),W(n,"minimizable",!0),k(n,"minimizedDisplay");const i=n.style;return n.style=P(()=>{var o,a;let s=l(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(o=l(i))!=null?o:"",(a=n.minimized)!=null&&a.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Ar(e,t){if(console.info("Adding layer",e.id),Ie[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,Ie[e.id]);return}W(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),Ie[e.id]=e,he.emit("addLayer",e,t.layers[e.id])}function La(e){return Ie[e]}function Br(e){console.info("Removing layer",e.id),he.emit("removeLayer",e),Ie[e.id]=void 0}function xa(e){Br(e),Ar(e,R)}function Lr(e){const t=V(!1);return{openModal:()=>t.value=!0,modal:L(()=>m(ct,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>m("h2",null,[l(e.name)]),body:l(e.display)}))}}he.on("update",function(t){Object.values(Ie).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(Ie).forEach(n=>{n==null||n.emit("update",t)}),Object.values(Ie).forEach(n=>{n==null||n.emit("postUpdate",t)})});var ja=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Vn,UnregisterNodeInjectionKey:Dn,NodesInjectionKey:Rn,BoundsInjectionKey:An,layers:Ie,persistentRefs:Nt,addingLayers:Le,createLayer:Gt,addLayer:Ar,getLayer:La,removeLayer:Br,reloadLayer:xa,setupLayerModal:Lr},Symbol.toStringTag,{value:"Module"}));const Ua=A({components:{Context:Dr,ErrorVue:kr},props:{index:{type:Number,required:!0},display:{type:$(Object,String,Function),required:!0},minimizedDisplay:$(Object,String,Function),minimized:{type:Object,required:!0},name:{type:$(String),required:!0},color:$(String),minimizable:$(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=ue(e),s=It(t),o=ut(i),a=P(()=>te.allowGoBack&&n.value>0&&!ae(r));function c(){R.tabs.splice(l(e.index),1/0)}function d(p){e.nodes.value=p}const g=V([]);return mi((p,y,w)=>(console.warn(`Error caught in "${e.name}" layer`,p,y,w),g.value.push(p instanceof Error?p:new Error(JSON.stringify(p))),!1)),{component:s,minimizedComponent:o,showGoBack:a,updateNodes:d,unref:l,goBack:c,errors:g}}}),za={key:1};function Ga(e,t,n,r,i,s){const o=ve("ErrorVue"),a=ve("Context");return e.errors.length>0?(b(),D(o,{key:0,errors:e.errors},null,8,["errors"])):(b(),S("div",Ue({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(b(),S("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):F("",!0),e.unref(e.minimized)?(b(),S("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(b(),D(ie(e.minimizedComponent),{key:0})):(b(),S("div",za,G(e.unref(e.name)),1))])):(b(),S("div",{key:2,class:re(["layer-tab",{showGoBack:e.showGoBack}])},[m(a,{onUpdateNodes:e.updateNodes},{default:x(()=>[(b(),D(ie(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(b(),S("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):F("",!0)],16))}var Ha=K(Ua,[["render",Ga],["__scopeId","data-v-a9f5b1da"]]);const xr=e=>(ze("data-v-4b4bda40"),e=e(),Ge(),e),Wa=xr(()=>v("h2",null,"Changelog",-1)),Ka=xr(()=>v("details",{open:""},[v("summary",null,[M("v0.0 Initial Commit - "),v("time",null,"2021-09-04")]),M(" This is the first release :D "),v("ul",null,[v("li",{class:"feature"},"Did everything"),v("li",{class:"fix"},"Had some fun"),v("li",{class:"breaking"},"Removed everything"),v("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Ya=A({__name:"Changelog",setup(e,{expose:t}){const n=V(!1);return t({open(){n.value=!0}}),(r,i)=>(b(),D(ct,{modelValue:n.value,"onUpdate:modelValu
|
||
|
${j}
|
||
|
${O}`)}}return d[I]}je(n,I=>{I&&Object.keys(d).forEach(O=>delete d[O])});const p=P(()=>Q.saves.reduce((I,O)=>(I[O]=g(O),I),{}));function y(I){let O;switch(R.id===I?O=Tn(R):O=JSON.stringify(p.value[I]),te.exportEncoding){default:console.warn(`Unknown save encoding: ${te.exportEncoding}. Defaulting to lz`);case"lz":O=et.compressToUTF16(O);break;case"base64":O=btoa(unescape(encodeURIComponent(O)));break;case"plain":break}const j=document.createElement("textarea");j.value=O,document.body.appendChild(j),j.select(),j.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(j)}function w(I){R.id===I&&Oe();const O={...p.value[I],id:nn()};Oe(O),Q.saves.push(O.id)}function N(I){Q.saves=Q.saves.filter(O=>O!==I),localStorage.removeItem(I),d[I]=void 0}function _(I){p.value[R.id].time=R.time,Oe(),d[R.id]=void 0,vt(p.value[I]),d[I]=void 0}function E(I){if(o.value=I,tt(()=>{o.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=et.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const O=JSON.parse(I);O.id=nn(),Oe(O),Q.saves.push(O.id),_(O.id)}function q(I,O){const j=p.value[I];j!=null&&(j.name=O,R.id===I?(R.name=O,Oe()):(Oe(j),d[I]=void 0))}return(I,O)=>(b(),D(ct,{modelValue:n.value,"onUpdate:modelValue":O[4]||(O[4]=j=>n.value=j),ref_key:"modal",ref:r},{header:x(()=>[tu]),body:x(({shown:j})=>[j?(b(),D(l(Ci),{key:0,list:l(Q).saves,handle:".handle",itemKey:le=>le},{item:x(({element:le})=>[m(eu,{save:l(p)[le],onOpen:se=>_(le),onExport:se=>y(le),onEditName:se=>q(le,se),onDuplicate:se=>w(le),onDelete:se=>N(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):F("",!0)]),footer:x(()=>[v("div",nu,[m(Ln,{modelValue:s.value,"onUpdate:modelValue":O[0]||(O[0]=j=>s.value=j),title:"Import Save",placeholder:"Paste your save here!",class:re({importingFailed:i.value})},null,8,["modelValue","class"]),v("div",ru,[iu,v("div",su,[v("button",{class:"button",onClick:O[1]||(O[1]=j=>_(l(kt)().id))},"New Game"),Object.keys(l(c)).length>0?(b(),D(Bn,{key:0,options:l(c),modelValue:o.value,"onUpdate:modelValue":O[2]||(O[2]=j=>E(j)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):F("",!0)])]),v("div",ou,[au,v("button",{class:"button modal-default-button",onClick:O[3]||(O[3]=j=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var jr=K(lu,[["__scopeId","data-v-2a4275be"]]);const Ee=e=>(ze("data-v-47c54e31"),e=e(),Ge(),e),uu=["src","alt"],cu={key:1,class:"title"},du=Ee(()=>v("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),fu={class:"discord"},mu={class:"discord-links"},pu={key:0},gu=["href"],vu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"Profectus & Friends")],-1)),hu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),bu={href:"https://forums.moddingtree.com/",target:"_blank"},yu=Ee(()=>v("span",{class:"material-icons"},"forum",-1)),_u=Ee(()=>v("span",{class:"material-icons"},"info",-1)),Cu=Ee(()=>v("span",{class:"material-icons"},"library_books",-1)),wu=Ee(()=>v("span",{class:"material-icons"},"settings",-1)),ku=Ee(()=>v("span",{class:"material-icons"},"library_books",-1)),Nu=Ee(()=>v("span",{class:"material-icons"},"settings",-1)),Su=Ee(()=>v("span",{class:"material-icons"},"info",-1)),Iu={href:"https://forums.moddingtree.com/",target:"_blank"},$u=Ee(()=>v("span",{class:"material-icons"},"forum",-1)),Mu={class:"discord"},Tu={class:"discord-links"},Pu={key:0},Ou=["href"],Fu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"Profectus & Friends")],-1)),Eu=Ee(()=>v("li",null,[v("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),qu=A({__name:"Nav",setup(e){const t=V(null),n=V(null),r=V(null),i=V(null),{useHeader:s,banner:o,title:a,discordName:c,discordLink:d,versionNumber:g}=te;function p(){window.open(d,"mywindow")}return(y,w)=>(b(),S(U,null,[l(s)?(b(),S("div",Ue({key:0,class:"nav"},y.$at
|
||
|
|
||
|
Reward: The dinosaur is now your friend (you can max Farm Points).`,direction:J.Down});const a=[i,s,o],c=gc(()=>({rows:2,cols:2,getStartState(g){return g},getStyle(g,p){return{backgroundColor:`#${Number(p)*1234%999999}`}},getTitle(g){let p="";return g==="101"?p="top":g==="102"?p="bottom":g==="201"?p="left":g==="202"&&(p="right"),L(()=>m(me,Ue({display:JSON.stringify(this.cells[g].style)},{[p]:!0}),{default:()=>[m("h3",null,[M("Gridable #"),g])]}))},getDisplay(g,p){return String(p)},getCanClick(){return u.eq(ne.points.value,10)},onClick(g,p){this.cells[g].state=Number(p)+1}})),d=L(()=>m(U,null,[Ve(...a),Ve(c)]));return{id:mr,color:e,name:t,points:n,achievements:a,grid:c,treeNode:r,display:d}});const Mc={class:"field"},Tc={key:0,class:"field-title"},Pc=["min","max"],Oc=A({__name:"Slider",props:{title:null,modelValue:null,min:null,max:null},emits:["update:modelValue"],setup(e,{emit:t}){const r=ue(e),i=P({get(){var s;return String((s=l(r.modelValue))!=null?s:0)},set(s){t("update:modelValue",Number(s))}});return(s,o)=>(b(),S("div",Mc,[e.title?(b(),S("span",Tc,G(e.title),1)):F("",!0),m(me,{display:`${l(i)}`,class:re({fullWidth:!e.title}),direction:l(J).Down},{default:x(()=>[mn(v("input",{type:"range","onUpdate:modelValue":o[0]||(o[0]=a=>ye(i)?i.value=a:null),min:e.min,max:e.max},null,8,Pc),[[yr,l(i)]])]),_:1},8,["display","class","direction"])]))}});var Fc=K(Oc,[["__scopeId","data-v-267283ff"]]);const Ec=A({__name:"Sticky",setup(e){const t=V("0"),n=new ResizeObserver(i),r=ke(null);function i(){let s=r.value;if(s==null)return;let o=0;for(;s.previousSibling;){const a=s.previousSibling;a.dataset&&"vSticky"in a.dataset&&(o+=a.offsetHeight),s=a}t.value=o+"px"}return tt(i),document.fonts.ready.then(i),Mt(()=>{var o;const s=(o=r.value)==null?void 0:o.parentElement;s&&n.observe(s)}),(s,o)=>(b(),S("div",{class:"sticky",style:ee({top:t.value}),ref_key:"element",ref:r,"data-v-sticky":""},[Ye(s.$slots,"default",{},void 0,!0)],4))}});var dn=K(Ec,[["__scopeId","data-v-cccac690"]]);const qc=A({__name:"VerticalRule",props:{height:null},setup(e){return(t,n)=>(b(),S("div",{class:"vr",style:ee({height:e.height})},null,4))}});var Vc=K(qc,[["__scopeId","data-v-5e0a978a"]]);var Dc=A({props:{display:{type:$(Object,String,Function),required:!0},visibility:{type:$(Number,Boolean),required:!0},style:$(Object,String,Array),classes:$(Object),onClick:Function,onHold:Function,canClick:{type:$(Boolean),required:!0},small:Boolean,mark:$(Boolean,String),id:{type:String,required:!0}},components:{Node:dt,MarkNode:Pt},setup(e){const{display:t,onClick:n,onHold:r}=ue(e),i=ke("");De(()=>{var g;const a=ae(t);if(a==null){i.value="";return}if(Ae(a)){i.value=H(a);return}const c=H((g=a.title)!=null?g:"","h3"),d=H(a.description,"div");i.value=H(L(()=>m("span",null,[a.title!=null?m("div",null,[m(c,null,null)]):null,m(d,null,null)])))});const{start:s,stop:o}=qn(n,r);return{start:s,stop:o,comp:i,Visibility:Z,isVisible:Se,isHidden:He,unref:l}}});function Rc(e,t,n,r,i,s){var c;const o=ve("MarkNode"),a=ve("Node");return e.isVisible(e.visibility)?(b(),S("button",{key:0,style:ee([{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:re({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)?(b(),D(ie(e.unref(e.comp)),{key:0})):F("",!0),m(o,{mark:e.unref(e.mark)},null,8,["mark"]),m(a,{id:e.id},null,8,["id"])],38)):F("",!0)}var Yr=K(Dc,[["render",Rc],["__scopeId","data-v-211328c0"]]);const Ac=Symbol("Clickable");function zt(e,...t){const n=t.reduce((r,i)=>{var s;return Object.assign(r,(s=i.getPersistentData)==null?void 0:s.call(i))},{});return ce(r=>{var o,a,c;const
|
||
|
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 Hs();const{globalBus:e}=await At(()=>Promise.resolve().then(function(){return Gs}),void 0),{startGameLoop:t}=await At(()=>import("./gameLoop.c6fcb607.js"),["assets/gameLoop.c6fcb607.js","assets/@fontsource.f66d05e7.css","assets/vue.72cfed44.js","assets/earcut.b6f90e68.js","assets/@vue.6a1d7e86.js","assets/lz-string.dccec454.js","assets/@ivanv.c33db252.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.3d5e8343.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.a52097e2.js","assets/sortablejs.740e9352.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-toastification.42f47de1.js","assets/vue-toastification.4b5f8ac8.css","assets/@pixi.94823b24.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.68c785f7.js","assets/querystring.d4befb87.js"]),n=window.vue=bi(Sf);n.config.errorHandler=function(r,i,s){console.error(r,s,i)},e.emit("setupVue",n),n.mount("#app"),tt(()=>{const r=Cr(),{updateServiceWorker:i}=$f({onNeedRefresh(){r.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(s){s&&setInterval(()=>s.update(),60*60*1e3)}})}),t()});export{u as D,At as _,fe as a,te as b,Xd as c,he as g,En as l,R as p,Q as s};
|