pages/planar/assets/index.ffd22707.js

22 lines
240 KiB
JavaScript
Raw Normal View History

/* empty css */import"./vue.c16a309b.js";import{q as an,C as s,ab as X,_ as N,az as Jn,aF as M,a1 as T,a2 as k,J as ee,O as ne,aK as xt,a0 as L,I as Be,a8 as _,aI as on,aG as ln,l as qe,u as Vr,t as G,b2 as ht,aL as Ft,G as Ne,aD as wi,w as bt,b3 as Dt,a9 as d,ap as sa,as as Wt,aH as sr,A as Te,$ as re,b7 as Y,b9 as Br,ar as Ot,bv as $n,bt as oa,bc as Gn,T as la,j as ua,bw as qt,ay as ca,aM as _t,aO as Je,z as Ht,bo as da,bs as pa,bd as ii,am as dr,H as fa,bx as ga,bf as ma}from"./@vue.6b211d3c.js";import{c as _i}from"./nanoevents.1080beb7.js";import{L as tn}from"./lz-string.dccec454.js";import{Y as va}from"./vue-next-select.ded54c4a.js";import{D as ha}from"./vuedraggable.1879de79.js";import{p as ba}from"./vue-textarea-autosize.35804eaf.js";import{P as ya}from"./vue-panzoom.8ce6f9b1.js";import{s as wa,u as hr}from"./vue-toastification.9c2dad53.js";import"./amator.1e5a40c8.js";import"./bezier-easing.a990b400.js";import"./sortablejs.a0f68e5e.js";import"./panzoom.30c56ba6.js";import"./wheel.f2ae740f.js";import"./ngraph.events.083734c6.js";const _a=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}};_a();const Na="modulepreload",ai={},Ca="./",Un=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Ca}${r}`,r in ai)return;ai[r]=!0;const i=r.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${a}`))return;const u=document.createElement("link");if(u.rel=i?"stylesheet":Na,i||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),i)return new Promise((l,c)=>{u.addEventListener("load",l),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},ka="./projInfo-schema.json",Ma="Planar Pioneers",Sa="A game about controlling and exploiting planes!",Ia="planar-pioneers",xa="thepaperpilot",$a="",Da="",Ta="0.0",Pa="Initial Commit",Aa=!1,Ra=!1,Ea=2,Fa=!0,Oa=null,qa="",Va=["main"],Ba=3600,La=0,ja=!0,za="base64";var he={$schema:ka,title:Ma,description:Sa,id:Ia,author:xa,discordName:$a,discordLink:Da,versionNumber:Ta,versionTitle:Pa,allowGoBack:Aa,defaultShowSmall:Ra,defaultDecimalsShown:Ea,useHeader:Fa,banner:Oa,logo:qa,initialTabs:Va,maxTickLength:Ba,offlineLimit:La,enablePausing:ja,exportEncoding:za};const Ga=an({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Z=window.player=Ga;function Ni(e){return JSON.stringify(e,(t,n)=>s(n))}var ve=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Ci=e=>(on("data-v-1b5356cf"),e=e(),ln(),e),Ua={class:"error"},Wa={class:"error-title"},Ha={class:"error-details",style:{"margin-top":"-10px"}},Ya={key:0},Za={class:"instructions"},Xa=["href"],Ja=Ci(()=>k("br",null,null,-1)),Ka={key:0,style:{"margin-top":"20px"}},Qa=Ci(()=>k("h3",null,"Other errors",-1)),es=[Qa],ts={class:"error-details"},ns={key:0,style:{"margin-top":"10px"}},rs={key:1,style:{"margin-top":"10px"}},is=X({__name:"Error",props:{errors:null},setup(e){const t=e,n=N(()=>t.errors[0]),r=N(()=>t.errors.map(a=>a.stack==null?[]:a.stack.split(`
`))),i=N(()=>t.errors.map(a=>a.cause==null?[]:(typeof a.cause=="string"?a.cause:JSON.stringify(a.cause)).split(`
`)));return Jn(()=>{Z.autosave=!1,Z.devSpeed=0}),(a,u)=>(M(),T("div",Ua,[k("h1",Wa,ee(s(n).name)+": "+ee(s(n).message),1),k("div",Ha,[s(n).cause?(M(),T("div",Ya,[(M(!0),T(ne,null,xt(s(i)[0],l=>(M(),T("div",{key:l},ee(l),1))),128))])):L("",!0),s(n).stack?(M(),T("div",{key:1,style:Be(s(n).cause?"margin-top: 10px":"")},[(M(!0),T(ne,null,xt(s(r)[0],l=>(M(),T("div",{key:l},ee(l),1))),128))],4)):L("",!0)]),k("div",Za,[_(" Check the console for more details, and consider sharing it with the developers on "),k("a",{href:s(he).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,Xa),_("!"),Ja,e.errors.length>1?(M(),T("div",Ka,es)):L("",!0),(M(!0),T(ne,null,xt(e.errors.slice(1),(l,c)=>(M(),T("div",{key:c,style:{"margin-top":"20px"}},[k("details",ts,[k("summary",null,ee(l.name)+": "+ee(l.message),1),l.cause?(M(),T("div",ns,[(M(!0),T(ne,null,xt(s(i)[c+1],p=>(M(),T("div",{key:p},ee(p),1))),128))])):L("",!0),l.stack?(M(),T("div",rs,[(M(!0),T(ne,null,xt(s(r)[c+1],p=>(M(),T("div",{key:p},ee(p),1))),128))])):L("",!0)])]))),128))])]))}});var ki=ve(is,[["__scopeId","data-v-1b5356cf"]]);class as{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 ss(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 ss{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Dr=17,os=9e15,ls=Math.log10(9e15),us=1/9e15,cs=308,ds=-324,si=5,ps=(1<<10)-1,fs=function(){const e=[];for(let n=ds+1;n<=cs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),pn=[2,Math.E,3,4,5,6,7,8,9,10],gs=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.8804192098842727,2],[1,1.1121114330934079,1.231038924931609,1.3583836963111375,1.4960519303993531,1.6463542337511945,1.8121385357018724,1.996971324618307,2.2053895545527546,2.4432574483385254,Math.E],[1,1.1187738849693603,1.2464963939368214,1.38527004705667,1.5376664685821402,1.7068895236551784,1.897001227148399,2.1132403089001035,2.362480153784171,2.6539010333870774,3],[1,1.1367350847096405,1.2889510672956703,1.4606478703324786,1.6570295196661111,1.8850062585672889,2.1539465047453485,2.476829779693097,2.872061932789197,3.3664204535587183,4],[1,1.1494592900767588,1.319708228183931,1.5166291280087583,1.748171114438024,2.0253263297298045,2.3636668498288547,2.7858359149579424,3.3257226212448145,4.035730287722532,5],[1,1.159225940787673,1.343712473580932,1.5611293155111927,1.8221199554561318,2.14183924486326,2.542468319282638,3.0574682501653316,3.7390572020926873,4.6719550537360774,6],[1,1.1670905356972596,1.3632807444991446,1.5979222279405536,1.8842640123816674,2.2416069644878687,2.69893426559423,3.3012632110403577,4.121250340630164,5.281493033448316,7],[1,1.1736630594087796,1.379783782386201,1.6292821855668218,1.9378971836180754,2.3289975651071977,2.8384347394720835,3.5232708454565906,4.478242031114584,5.868592169644505,8],[1,1.1793017514670474,1.394054150657457,1.65664127441059,1.985170999970283,2.4069682290577457,2.9647310119960752,3.7278665320924946,4.814462547283592,6.436522247411611,9],[1,1.1840100246247336,1.4061375836156955,1.6802272208863964,2.026757028388619,2.4770056063449646,3.080525271755482,3.9191964192627284,5.135152840833187,6.989961179534715,10]],ms=[[-1,-.9194161097107025,-.8335625019330468,-.7425599821143978,-.6466611521029437,-.5462617907227869,-.4419033816638769,-.3342645487554494,-.224140440909962,-.11241087890006762,0],[-1,-.90603157029014,-.807
`,e),await vn(xn())}}function xn(){const e=cr(),t=Ti({id:e});return mt(t),ie.saves.push(e),t}function cr(){let e,t=0;do e=`${he.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Rs=G(!1);async function vn(e){console.info("Loading save",e),Rs.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await Un(()=>Promise.resolve().then(function(){return Tl}),void 0),{fixOldSave:i,getInitialLayers:a}=await Un(()=>Promise.resolve().then(function(){return zp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>r(u,e)),e=Ti(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,he.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==he.versionNumber&&(i(e.modVersion,e),e.modVersion=he.versionNumber),Object.assign(Z,e),ie.active=Z.id,Ke.emit("onLoad")}setInterval(()=>{Z.autosave&&mt()},1e3);window.onbeforeunload=()=>{Z.autosave&&mt()};window.save=mt;const Es=window.hardReset=async()=>{await vn(xn())};window.deleteLowerSaves=()=>{const e=Object.values(ie.saves).indexOf(Z.id)+1;Object.values(ie.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ie.saves=ie.saves.slice(0,e)};const Zn=an({active:"",saves:[],showTPS:!0,theme:jr.Nordic,unthrottled:!1,alignUnits:!1});ht(Zn,e=>{const t=tn.compressToUTF16(JSON.stringify(e));localStorage.setItem(he.id,t)},{deep:!0});var ie=window.settings=Zn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:jr.Nordic,alignUnits:!1};Ke.emit("loadSettings",e),Object.assign(Zn,e),Es()};function Fs(){try{let e=localStorage.getItem(he.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=tn.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Zn,t)}Ke.emit("loadSettings",Zn)}catch{}}const Pi=an([]);function Ai(e){Pi.push(e)}const Os=an([]),qs=an([]),Vs={class:"table"},Bs=X({__name:"Column",setup(e){const t=N(()=>kt[ie.theme].mergeAdjacent);return(n,r)=>(M(),T("div",Vs,[k("div",{class:Ne(["col",{mergeAdjacent:s(t)}])},[Ft(n.$slots,"default")],2)]))}}),Ls={class:"table"},js=X({__name:"Row",setup(e){const t=N(()=>kt[ie.theme].mergeAdjacent);return(n,r)=>(M(),T("div",Ls,[k("div",{class:Ne(["row",{mergeAdjacent:s(t)}])},[Ft(n.$slots,"default")],2)]))}});function Ri(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!sa(e)}function fe(e,t="span"){return typeof e=="function"?X({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),X({template:e})):X({render:()=>({})}):e}function st(e){if(Tt(e))return typeof e=="function"?e():fe(e);const t=e[dt];return d(t,e[lt](),null)}function Pr(...e){let t;return d(js,null,Ri(t=e.map(st))?t:{default:()=>[t]})}function zs(...e){let t;return d(Bs,null,Ri(t=e.map(st))?t:{default:()=>[t]})}function wt(e){if(Tt(e))return typeof e=="function"?e():typeof e=="string"?d(ne,null,[e]):d(e,null,null);const t=e[dt];return d(t,e[lt](),null)}function ci(e,t){return e.reduce((n,r)=>d(ne,null,[n,t,r]))}function Tt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Hn]===!0}function Ei(e,t){const n=G(null),r=G(void 0);function i(l){n.value||(n.value=setInterval(u,250)),r.value=l}function a(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return wi(a),{start:i,stop:a,handleHolding:u}}function zr(e,t="div"){const n=bt();return Dt(()=>{n.value=fe(De(e),t)}),n}function Tn(e,t="div"){const n=bt(null);return Dt(()=>{const r=De(e);n.value=r==""||r==null?null:fe(r,t)}),n}function De(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function di(e){const t=G(!1),n=e[lt].bind(e);return e[lt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}const Gs=X({__name:"Context",emits:["updateNodes"],setup(e,{emit:t}){var v;const n=G({}),r=new ResizeObserver(l
`).slice(3,5).map(n=>n.trim()).join(`
`))!=null?t:""}function pi(e,t){var n;o.isNaN(t)&&(Re.hasNaN||(Z.autosave=!1,Re.hasNaN=!0,Re.NaNPath=e[hn],Re.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[hn])==null?void 0:n.join(".")}`)),e[rn].value=t}function ot(e,t=!0){const n=qe(e)?e:G(e);qe(e)&&(e=e.value);const r=N({get(){return n.value},set(a){t?pi(i,a):i[rn].value=a}});r[Yt]=e;const i={get value(){return n.value},set value(a){t?pi(i,a):i[rn].value=a},__v_isRef:!0,[rn]:n,[Yt]:e,[fr]:Sl(),[gr]:!1,[Et]:r,[hn]:void 0};return ct.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
Created at:
`+i[fr]):bn[ct[ct.length-1]].add(i),i}function Il(e){return e!=null&&typeof e=="object"&&rn in e}function kn(e){return!(en in e)&&Et in e?e[Et]:new Proxy(e,{get(t,n){if(n!==rn)return n===Xn?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===rn?!1:n==Xn?!0:Reflect.has(t,n)}})}function Vi(e){ct.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):bn[ct[ct.length-1]].delete(e),e[gr]=!0}Ke.on("addLayer",(e,t)=>{const n=[],r=(i,a=[])=>{let u=!1;return Object.keys(i).forEach(l=>{let c=i[l];if(c!=null&&typeof c=="object"){if(c[Xn]===!0)return;if(en in c&&(c=c[en]),Il(c)){if(u=!0,c[gr]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[fr]);return}bn[e.id].delete(c);const p=[e.id,...a,l];c[hn]!=null&&JSON.stringify(p)!==JSON.stringify(c[hn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[hn].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[hn]=p;const v=a.reduce((b,h)=>(h in b||(b[h]={}),b[h]),t),g=v[l];v[l]=c[rn],ua(v)?g!=null?v[l]=g:v[l]=c[Yt]:g!=null?v[l].value=g:v[l].value=c[Yt]}else!(c instanceof o)&&!(c instanceof f)&&!qe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...a,l])&&(qt(c)&&!qt(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.",en in i?i[en]:i,l):u=!0))}}),u};r(e[en]),bn[e.id].forEach(i=>{i[gr]||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[fr])}),bn[e.id].clear()});const Gr=Symbol("RegisterNode"),Ur=Symbol("UnregisterNode"),Wr=Symbol("Nodes"),Hr=Symbol("Bounds"),ge=Vr({});window.layers=ge;const bn={},ct=[];function Yr(e,t){return Qe(()=>{const n={},r=n.emitter=_i();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=G({}),n.id=e,ct.push(e),bn[e]=new Set,n.minimized=ot(!1,!1),Object.assign(n,t.call(n,n)),ct[ct.length-1]==null||ct[ct.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen
Stack: ${ct}
Trying to pop ${n.id}`);ct.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),le(n,"name",n.id),A(n,"minWidth"),le(n,"minWidth",600),A(n,"minimizable"),le(n,"minimizable",!0),A(n,"minimizedDisplay");const i=n.style;return n.style=N(()=>{var u,l;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(u=s(i))!=null?u:"",(l=n.minimized)!=null&&l.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Zr(e,t){if(console.info("Adding layer",e.id),ge[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,ge[e.id]);return}le(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ge[e.id]=e,Ke.emit("addLayer",e,t.layers[e.id])}function xl(e){return ge[e]}function Xr(e){console.info("Removing layer",e.id),Ke.emit("removeLayer",e),ge[e.id]=void 0}function $l(e){Xr(e),Zr(e,Z)}function Dl(e){const t=G(!1);return{openModal:()=>t.value=!0,modal:z(()=>d(Vt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[s(e.name)]),body:s(e.display)}))}}Ke.on("update",function(t){Object.values(ge).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("update",t)}),Object.values(ge).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Tl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Gr,UnregisterNodeInjectionKey:Ur,NodesInjectionKey:Wr,BoundsInjectionKey:Hr,layers:ge,persistentRefs:bn,addingLayers:ct,createLayer:Yr,addLayer:Zr,getLayer:xl,removeLayer:Xr,reloadLayer:$l,setupLayerModal:Dl},Symbol.toStringTag,{value:"Module"}));const Pl=X({components:{Context:Fi,ErrorVue:ki},props:{index:{type:Number,required:!0},display:{type:q(Object,String,Function),required:!0},minimizedDisplay:q(Object,String,Function),minimized:{type:Object,required:!0},name:{type:q(String),required:!0},color:q(String),minimizable:q(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:r,minimizedDisplay:i}=Te(e),a=zr(t),u=Tn(i),l=N(()=>he.allowGoBack&&n.value>0&&!De(r));function c(){Z.tabs.splice(s(e.index),1/0)}function p(g){e.nodes.value=g}const v=G([]);return ca((g,b,h)=>(console.warn(`Error caught in "${e.name}" layer`,g,b,h),v.value.push(g instanceof Error?g:new Error(JSON.stringify(g))),!1)),{component:a,minimizedComponent:u,showGoBack:l,updateNodes:p,unref:s,goBack:c,errors:v}}}),Al={key:1};function Rl(e,t,n,r,i,a){const u=_t("ErrorVue"),l=_t("Context");return e.errors.length>0?(M(),re(u,{key:0,errors:e.errors},null,8,["errors"])):(M(),T("div",Ot({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(M(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):L("",!0),e.unref(e.minimized)?(M(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),re(Je(e.minimizedComponent),{key:0})):(M(),T("div",Al,ee(e.unref(e.name)),1))])):(M(),T("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[d(l,{onUpdateNodes:e.updateNodes},{default:Y(()=>[(M(),re(Je(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):L("",!0)],16))}var El=ve(Pl,[["render",Rl],["__scopeId","data-v-a9f5b1da"]]);const Bi=e=>(on("data-v-4b4bda40"),e=e(),ln(),e),Fl=Bi(()=>k("h2",null,"Changelog",-1)),Ol=Bi(()=>k("details",{open:""},[k("summary",null,[_("v0.0 Initial Commit - "),k("time",null,"2021-09-04")]),_(" This is the first release :D "),k("ul",null,[k("li",{class:"feature"},"Did everything"),k("li",{class:"fix"},"Had some fun"),k("li",{class:"breaking"},"Removed everything"),k("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),ql=X({__name:"Changelog",setup(e,{expose:t}){const n=G(!1);return t({open(){n.value=!0}}),(r,i)=>(M(),re(Vt,{modelValue:n.value,"onUpdate
${B}
${E}`)}}return p[I]}ht(n,I=>{I&&Object.keys(p).forEach(E=>delete p[E])});const g=N(()=>ie.saves.reduce((I,E)=>(I[E]=v(E),I),{}));function b(I){let E;switch(Z.id===I?E=Ni(Z):E=JSON.stringify(g.value[I]),he.exportEncoding){default:console.warn(`Unknown save encoding: ${he.exportEncoding}. Defaulting to lz`);case"lz":E=tn.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const B=document.createElement("textarea");B.value=E,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function h(I){Z.id===I&&mt();const E={...g.value[I],id:cr()};mt(E),ie.saves.push(E.id)}function y(I){ie.saves=ie.saves.filter(E=>E!==I),localStorage.removeItem(I),p[I]=void 0}function C(I){g.value[Z.id].time=Z.time,mt(),p[Z.id]=void 0,vn(g.value[I]),p[I]=void 0}function D(I){if(u.value=I,Wt(()=>{u.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=tn.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const E=JSON.parse(I);E.id=cr(),mt(E),ie.saves.push(E.id),C(E.id)}function R(I,E){const B=g.value[I];B!=null&&(B.name=E,Z.id===I?(Z.name=E,mt()):(mt(B),p[I]=void 0))}return(I,E)=>(M(),re(Vt,{modelValue:n.value,"onUpdate:modelValue":E[4]||(E[4]=B=>n.value=B),ref_key:"modal",ref:r},{header:Y(()=>[Wu]),body:Y(({shown:B})=>[B?(M(),re(s(ha),{key:0,list:s(ie).saves,handle:".handle",itemKey:de=>de},{item:Y(({element:de})=>[d(Uu,{save:s(g)[de],onOpen:ue=>C(de),onExport:ue=>b(de),onEditName:ue=>R(de,ue),onDuplicate:ue=>h(de),onDelete:ue=>y(de)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):L("",!0)]),footer:Y(()=>[k("div",Hu,[d(ji,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=B=>a.value=B),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:i.value})},null,8,["modelValue","class"]),k("div",Yu,[Zu,k("div",Xu,[k("button",{class:"button",onClick:E[1]||(E[1]=B=>C(s(xn)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),re(Jr,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":E[2]||(E[2]=B=>D(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):L("",!0)])]),k("div",Ju,[Ku,k("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var zi=ve(Qu,[["__scopeId","data-v-2a4275be"]]);const Nt=e=>(on("data-v-318a1c31"),e=e(),ln(),e),ec=["src","alt"],tc={key:1,class:"title"},nc=Nt(()=>k("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),rc={class:"discord"},ic={class:"discord-links"},ac={key:0},sc=["href"],oc=Nt(()=>k("li",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),lc=Nt(()=>k("li",null,[k("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),uc={href:"https://forums.moddingtree.com/",target:"_blank"},cc=Nt(()=>k("span",{class:"material-icons"},"forum",-1)),dc=Nt(()=>k("span",{class:"material-icons"},"info",-1)),pc=Nt(()=>k("span",{class:"material-icons"},"library_books",-1)),fc=Nt(()=>k("span",{class:"material-icons"},"settings",-1)),gc=Nt(()=>k("span",{class:"material-icons"},"library_books",-1)),mc=Nt(()=>k("span",{class:"material-icons"},"settings",-1)),vc=Nt(()=>k("span",{class:"material-icons"},"info",-1)),hc={href:"https://forums.moddingtree.com/",target:"_blank"},bc=Nt(()=>k("span",{class:"material-icons"},"forum",-1)),yc={class:"discord"},wc={class:"discord-links"},_c={key:0},Nc=["href"],Cc=Nt(()=>k("li",null,[k("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),kc=Nt(()=>k("li",null,[k("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Mc=X({__name:"Nav",setup(e){const t=G(null),n=G(null),r=G(null),i=G(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:p,versionNumber:v}=he;function g(){window.open(p,"mywindow")}return(b,h)=>(M(),T(ne,null,[s(a)?(M(),T("div",Ot({k
${(-s(i)-30)*Math.sin(((e.actions.length-1)/2-h)*s(l))},
${(s(i)+30)*Math.cos(((e.actions.length-1)/2-h)*s(l))}
)`,onMousedown:D=>c(D,b),onTouchstart:D=>c(D,b),onMouseup:D=>p(D,b),onTouchend:$n(D=>p(D,b),["stop"])},[k("circle",{fill:s(me)(b.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===b.id?4:0,stroke:s(a)},null,8,Ec),k("text",{fill:s(u),class:"material-icons"},ee(s(me)(b.icon,e.node)),9,Fc)],42,Rc)}),128))])):L("",!0)]),_:1}))}});var qc=ve(Oc,[["__scopeId","data-v-9efb2a56"]]);const Vc=["transform"],Bc={key:0},Lc=["r","fill","stroke"],jc=["r","fill","stroke"],zc=["r","fill"],Gc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Uc={key:1,transform:"rotate(45, 0, 0)"},Wc=["width","height","transform","fill","stroke"],Hc=["width","height","transform","fill","stroke"],Yc=["width","height","transform","fill"],Zc=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Xc=["fill","y"],Jc=["fill"],Kc=["fill","y"],Qc={key:0},ed=["fill","y"],td=["fill","y"],nd=X({__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,r=Math.sqrt(2),i=Te(n),a=N(()=>me(i.nodeType.value.draggable,s(i.node)));ht(a,U=>{const ye=s(i.node);s(i.dragging)===ye&&!U&&t("endDragging",ye)});const u=N(()=>{var ye;const U=s(i.node);return(ye=me(i.nodeType.value.actions,U))==null?void 0:ye.filter(ze=>He(me(ze.visibility,U)))}),l=N(()=>{var ye;const U=s(i.node);if(me(i.nodeType.value.draggable,U)&&((ye=s(i.dragging))==null?void 0:ye.id)===U.id&&s(i.dragged)!=null){const{x:ze,y:pt}=s(i.dragged);return{x:U.position.x+Math.round(ze/25)*25,y:U.position.y+Math.round(pt/25)*25}}return U.position}),c=N(()=>me(i.nodeType.value.shape,s(i.node))),p=N(()=>me(i.nodeType.value.title,s(i.node))),v=N(()=>me(i.nodeType.value.subtitle,s(i.node))),g=N(()=>me(i.nodeType.value.otherSubtitle,s(i.node))),b=N(()=>{var U;return(U=i.isSelected.value?s(i.selectedAction)&&me(s(i.selectedAction).tooltip,s(i.node)):null)!=null?U:me(i.nodeType.value.label,s(i.node))}),h=N(()=>{var U,ye;return me((ye=(U=s(i.selectedAction))==null?void 0:U.confirmationLabel)!=null?ye:{text:"Tap again to confirm"},s(i.node))}),y=N(()=>me(i.nodeType.value.size,s(i.node))),C=N(()=>{var U;return(U=me(i.nodeType.value.progress,s(i.node)))!=null?U:0}),D=N(()=>kt[ie.theme].variables["--background"]),R=N(()=>{var U;return(U=me(i.nodeType.value.outlineColor,s(i.node)))!=null?U:kt[ie.theme].variables["--outline"]}),I=N(()=>{var U;return(U=me(i.nodeType.value.fillColor,s(i.node)))!=null?U:kt[ie.theme].variables["--raised-background"]}),E=N(()=>me(i.nodeType.value.progressColor,s(i.node))),B=N(()=>{var U;return(U=me(i.nodeType.value.titleColor,s(i.node)))!=null?U:kt[ie.theme].variables["--foreground"]}),de=N(()=>me(i.nodeType.value.progressDisplay,s(i.node))),ue=N(()=>i.dragging.value!=null&&s(i.hasDragged)&&me(i.nodeType.value.canAccept,s(i.node),i.dragging.value)),ae=N(()=>me(i.nodeType.value.style,s(i.node))),Q=N(()=>me(i.nodeType.value.classes,s(i.node)));function Ie(U){t("mouseDown",U,i.node.value,a.value)}function be(U){var ye,ze,pt;(ye=i.hasDragged)!=null&&ye.value||(t("endDragging",i.node.value),(pt=(ze=i.nodeType.value).onClick)==null||pt.call(ze,i.node.value),U.stopPropagation())}return(U,ye)=>{var ze,pt,zt;return M(),T("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(Q)}]),style:Be([{opacity:((ze=e.dragging)==null?void 0:ze.id)===e.node.id&&e.hasDragged?.5:1},(pt=s(ae))!=null?pt:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[d(qc,{actions:(zt=s(u))!=null?zt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:ye[0]||(ye[0]=ft=>t("clickAction",ft))},null,8,["actions","is-selected","node","node-type","selected-action"]),k("g",{class:"node-container",onMousedown:Ie,onTouchstartPassive:Ie,onMouseup:be,onTouchendPassive:be},[s(c)===s(je).Circle?(M(),T("g",Bc,[s(ue)?(M(),T("circle",{key:0,class:"receiver",r:s(y)+
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 As();const{globalBus:e}=await Un(()=>Promise.resolve().then(function(){return Ps}),void 0),{startGameLoop:t}=await Un(()=>import("./gameLoop.f63e9d55.js"),["assets/gameLoop.f63e9d55.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=ma(vf);n.config.errorHandler=function(r,i,a){console.error(r,a,i)},e.emit("setupVue",n),n.mount("#app"),Wt(()=>{const r=hr(),{updateServiceWorker:i}=bf({onNeedRefresh(){r.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){i()}})},onOfflineReady(){r.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Un as _,Re as a,he as b,zp as c,Ke as g,Rs as l,Z as p,ie as s};