Planar-Pioneers/assets/index.2138cd51.js

22 lines
242 KiB
JavaScript
Raw Permalink Normal View History

/* empty css */import"./vue.c16a309b.js";import{q as ln,C as a,ab as X,t as G,aF as S,a1 as T,aL as qt,bv as Pn,G as Ne,as as Xt,_ as y,az as Qn,a2 as N,J as ee,O as ne,aK as Dt,a0 as B,I as Le,a8 as w,a9 as d,b7 as H,aI as cn,aG as dn,l as Ve,u as Lr,b2 as wt,aD as Mi,w as _t,b3 as Pt,ap as ca,aH as sr,A as Ae,$ as re,b9 as jr,ar as Vt,bt as da,bc as Wn,T as pa,j as fa,bw as Bt,ay as ga,aM as Ct,aO as Ke,z as Jt,bo as ma,bs as va,bd as ui,am as dr,H as ha,bx as ba,bf as ya}from"./@vue.6b211d3c.js";import{L as Yt}from"./lz-string.dccec454.js";import{c as Ii}from"./nanoevents.1080beb7.js";import{Y as wa}from"./vue-next-select.ded54c4a.js";import{D as _a}from"./vuedraggable.1879de79.js";import{p as Na}from"./vue-textarea-autosize.35804eaf.js";import{P as Ca}from"./vue-panzoom.8ce6f9b1.js";import{s as ka,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 Sa=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 l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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)}};Sa();const Ma="modulepreload",ci={},Ia="./",Hn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${Ia}${r}`,r in ci)return;ci[r]=!0;const i=r.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${s}`))return;const l=document.createElement("link");if(l.rel=i?"stylesheet":Ma,i||(l.as="script",l.crossOrigin=""),l.href=r,document.head.appendChild(l),i)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},xa="./projInfo-schema.json",$a="Planar Pioneers",Da="A game about controlling and exploiting planes!",Ta="planar-pioneers",Pa="thepaperpilot",Aa="",Ra="",Ea="0.0",Fa="Initial Commit",Oa=!1,qa=!1,Va=2,Ba=!0,La=null,ja="",za=["main"],Ga=3600,Ua=0,Wa=!0,Ha="base64";var ve={$schema:xa,title:$a,description:Da,id:Ta,author:Pa,discordName:Aa,discordLink:Ra,versionNumber:Ea,versionTitle:Fa,allowGoBack:Oa,defaultShowSmall:qa,defaultDecimalsShown:Va,useHeader:Ba,banner:La,logo:ja,initialTabs:za,maxTickLength:Ga,offlineLimit:Ua,enablePausing:Wa,exportEncoding:Ha};const Ya=ln({id:"",devSpeed:null,name:"",tabs:[],time:-1,autosave:!0,offlineProd:!0,offlineTime:null,timePlayed:0,keepGoing:!1,modID:"",modVersion:"",layers:{}});var Y=window.player=Ya;function zr(e){return JSON.stringify(e,(t,n)=>a(n))}var be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const Za=["onClick"],Xa=X({__name:"FeedbackButton",props:{left:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=G(!1),r=G(null);function i(){t("click"),r.value&&clearTimeout(r.value),n.value=!1,Xt(()=>{n.value=!0,r.value=setTimeout(()=>n.value=!1,500)})}return(s,l)=>(S(),T("button",{onClick:Pn(i,["stop"]),class:Ne(["feedback",{activated:n.value,left:e.left}])},[qt(s.$slots,"default",{},void 0,!0)],10,Za))}});var Gr=be(Xa,[["__scopeId","data-v-01a1b95c"]]);const br=e=>(cn("data-v-ac351c02"),e=e(),dn(),e),Ja={class:"error"},Ka={class:"error-title"},Qa={class:"error-details",style:{"margin-top":"-10px"}},es={key:0},ts={class:"instructions"},ns=["href"],rs=br(()=>N("span",{class:"material-icons",style:{"font-size":"16px"}},"content_paste",-1)),is=br(()=>N("span",{style:{"margin-left":"8px","font-size":"medium"}},"Copy Save",-1)),as=br(()=>N("br",null,null,-1)),
`))),i=y(()=>t.errors.map(l=>l.cause==null?[]:(typeof l.cause=="string"?l.cause:JSON.stringify(l.cause)).split(`
`)));function s(){let l=zr(Y);switch(ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":l=Yt.compressToUTF16(l);break;case"base64":l=btoa(unescape(encodeURIComponent(l)));break;case"plain":break}console.log(l);const u=document.createElement("textarea");u.value=l,document.body.appendChild(u),u.select(),u.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(u)}return Qn(()=>{Y.autosave=!1,Y.devSpeed=0}),(l,u)=>(S(),T("div",Ja,[N("h1",Ka,ee(a(n).name)+": "+ee(a(n).message),1),N("div",Qa,[a(n).cause?(S(),T("div",es,[(S(!0),T(ne,null,Dt(a(i)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))])):B("",!0),a(n).stack?(S(),T("div",{key:1,style:Le(a(n).cause?"margin-top: 10px":"")},[(S(!0),T(ne,null,Dt(a(r)[0],c=>(S(),T("div",{key:c},ee(c),1))),128))],4)):B("",!0)]),N("div",ts,[w(" Check the console for more details, and consider sharing it with the developers on "),N("a",{href:a(ve).discordLink||"https://discord.gg/yJ4fjnjU54",class:"discord-link"},"discord",8,ns),w("! "),d(Gr,{onClick:s,class:"button",style:{display:"inline-flex"}},{default:H(()=>[rs,is]),_:1}),as,e.errors.length>1?(S(),T("div",ss,ls)):B("",!0),(S(!0),T(ne,null,Dt(e.errors.slice(1),(c,p)=>(S(),T("div",{key:p,style:{"margin-top":"20px"}},[N("details",us,[N("summary",null,ee(c.name)+": "+ee(c.message),1),c.cause?(S(),T("div",cs,[(S(!0),T(ne,null,Dt(a(i)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0),c.stack?(S(),T("div",ds,[(S(!0),T(ne,null,Dt(a(r)[p+1],h=>(S(),T("div",{key:h},ee(h),1))),128))])):B("",!0)])]))),128))])]))}});var xi=be(ps,[["__scopeId","data-v-ac351c02"]]);class fs{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 gs(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 gs{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Pr=17,ms=9e15,vs=Math.log10(9e15),hs=1/9e15,bs=308,ys=-324,di=5,ws=(1<<10)-1,_s=function(){const e=[];for(let n=ys+1;n<=bs;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),gn=[2,Math.E,3,4,5,6,7,8,9,10],Ns=[[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.17930175
`,e),await bn(Tn())}}function Tn(){const e=cr(),t=Ei({id:e});return bt(t),ie.saves.push(e),t}function cr(){let e,t=0;do e=`${ve.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const zs=G(!1);async function bn(e){console.info("Loading save",e),zs.value=!0;const{layers:t,removeLayer:n,addLayer:r}=await Hn(()=>Promise.resolve().then(function(){return Bl}),void 0),{fixOldSave:i,getInitialLayers:s}=await Hn(()=>Promise.resolve().then(function(){return Xp}),void 0);for(const l in t){const u=t[l];u&&n(u)}s(e).forEach(l=>r(l,e)),e=Ei(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,ve.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==ve.versionNumber&&(i(e.modVersion,e),e.modVersion=ve.versionNumber),Object.assign(Y,e),ie.active=Y.id,Qe.emit("onLoad")}setInterval(()=>{Y.autosave&&bt()},1e3);window.onbeforeunload=()=>{Y.autosave&&bt()};window.save=bt;const Gs=window.hardReset=async()=>{await bn(Tn())};window.deleteLowerSaves=()=>{const e=Object.values(ie.saves).indexOf(Y.id)+1;Object.values(ie.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ie.saves=ie.saves.slice(0,e)};const Jn=ln({active:"",saves:[],showTPS:!0,theme:Wr.Nordic,unthrottled:!1,alignUnits:!1});wt(Jn,e=>{const t=Yt.compressToUTF16(JSON.stringify(e));localStorage.setItem(ve.id,t)},{deep:!0});var ie=window.settings=Jn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Wr.Nordic,alignUnits:!1};Qe.emit("loadSettings",e),Object.assign(Jn,e),Gs()};function Us(){try{let e=localStorage.getItem(ve.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Yt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Jn,t)}Qe.emit("loadSettings",Jn)}catch{}}const Fi=ln([]);function Oi(e){Fi.push(e)}const Ws=ln([]),Hs=ln([]),Ys={class:"table"},Zs=X({__name:"Column",setup(e){const t=y(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Ys,[N("div",{class:Ne(["col",{mergeAdjacent:a(t)}])},[qt(n.$slots,"default")],2)]))}}),Xs={class:"table"},Js=X({__name:"Row",setup(e){const t=y(()=>It[ie.theme].mergeAdjacent);return(n,r)=>(S(),T("div",Xs,[N("div",{class:Ne(["row",{mergeAdjacent:a(t)}])},[qt(n.$slots,"default")],2)]))}});function qi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ca(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 ot(e){if(At(e))return typeof e=="function"?e():fe(e);const t=e[gt];return d(t,e[dt](),null)}function Rr(...e){let t;return d(Js,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function Ks(...e){let t;return d(Zs,null,qi(t=e.map(ot))?t:{default:()=>[t]})}function mt(e){if(At(e))return typeof e=="function"?e():typeof e=="string"?d(ne,null,[e]):d(e,null,null);const t=e[gt];return d(t,e[dt](),null)}function mi(e,t){return e.reduce((n,r)=>d(ne,null,[n,t,r]))}function At(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Zn]===!0}function Vi(e,t){const n=G(null),r=G(void 0);function i(u){n.value||(n.value=setInterval(l,250)),r.value=u}function s(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(r.value)}return Mi(s),{start:i,stop:s,handleHolding:l}}function Hr(e,t="div"){const n=_t();return Pt(()=>{n.value=fe(Pe(e),t)}),n}function Rn(e,t="div"){const n=_t(null);return Pt(()=>{const r=Pe(e);n.value=r==""||r==null?null:fe(r,t)}),n}function Pe(e){return a(a(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function vi(e){const t=G(!1),n=e[dt].bind(e);return e[dt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}function Bi(e){return Object.keys(e).reduce((t,n)=>(t[Vs(n)]=e[n],t),{})}const Qs=X({__name:"Context",emits:["u
`).slice(3,5).map(n=>n.trim()).join(`
`))!=null?t:""}function hi(e,t){var n;o.isNaN(t)&&(Fe.hasNaN||(Y.autosave=!1,Fe.hasNaN=!0,Fe.NaNPath=e[yn],Fe.NaNPersistent=e),console.error(`Attempted to save NaN value to ${(n=e[yn])==null?void 0:n.join(".")}`)),e[on].value=t}function ct(e,t=!0){const n=Ve(e)?e:G(e);Ve(e)&&(e=e.value);const r=y({get(){return n.value},set(s){t?hi(i,s):i[on].value=s}});r[Kt]=e;const i={get value(){return n.value},set value(s){t?hi(i,s):i[on].value=s},__v_isRef:!0,[on]:n,[Kt]:e,[fr]:El(),[gr]:!1,[Ot]:r,[yn]:void 0};return ft.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",i,`
Created at:
`+i[fr]):wn[ft[ft.length-1]].add(i),i}function Fl(e){return e!=null&&typeof e=="object"&&on in e}function In(e){return!(an in e)&&Ot in e?e[Ot]:new Proxy(e,{get(t,n){if(n!==on)return n===Kn?!0:t[n]},set(t,n,r){return t[n]=r,!0},has(t,n){return n===on?!1:n==Kn?!0:Reflect.has(t,n)}})}function Gi(e){ft.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):wn[ft[ft.length-1]].delete(e),e[gr]=!0}Qe.on("addLayer",(e,t)=>{const n=[],r=(i,s=[])=>{let l=!1;return Object.keys(i).forEach(u=>{let c=i[u];if(c!=null&&typeof c=="object"){if(c[Kn]===!0)return;if(an in c&&(c=c[an]),Fl(c)){if(l=!0,c[gr]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[fr]);return}wn[e.id].delete(c);const p=[e.id,...s,u];c[yn]!=null&&JSON.stringify(p)!==JSON.stringify(c[yn])&&console.error(`Persistent ref is being saved to \`${p.join(".")}\` when it's already present at \`${c[yn].join(".")}\`.`,"This can cause unexpected behavior when loading saves between updates."),c[yn]=p;const h=s.reduce((b,m)=>(m in b||(b[m]={}),b[m]),t),g=h[u];h[u]=c[on],fa(h)?g!=null?h[u]=g:h[u]=c[Kt]:g!=null?h[u].value=g:h[u].value=c[Kt]}else!(c instanceof o)&&!(c instanceof f)&&!Ve(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),r(c,[...s,u])&&(Bt(c)&&!Bt(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.",an in i?i[an]:i,u):l=!0))}}),l};r(e[an]),wn[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])}),wn[e.id].clear()});const Yr=Symbol("RegisterNode"),Zr=Symbol("UnregisterNode"),Xr=Symbol("Nodes"),Jr=Symbol("Bounds"),ge=Lr({});window.layers=ge;const wn={},ft=[];function Kr(e,t){return et(()=>{const n={},r=n.emitter=Ii();if(n.on=r.on.bind(r),n.emit=r.emit.bind(r),n.nodes=G({}),n.id=e,ft.push(e),wn[e]=new Set,n.minimized=ct(!1,!1),Object.assign(n,t.call(n,n)),ft[ft.length-1]==null||ft[ft.length-1]!==e)throw new Error(`Adding layers stack in invalid state. This should not happen
Stack: ${ft}
Trying to pop ${n.id}`);ft.pop(),A(n,"color"),A(n,"display"),A(n,"classes"),A(n,"style"),A(n,"name"),oe(n,"name",n.id),A(n,"minWidth"),oe(n,"minWidth",600),A(n,"minimizable"),oe(n,"minimizable",!0),A(n,"minimizedDisplay");const i=n.style;return n.style=y(()=>{var l,u;let s=a(n.minWidth);return(typeof s=="number"||!Number.isNaN(parseInt(s)))&&(s=s+"px"),[(l=a(i))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:s,flexBasis:s,margin:""}]}),n})}function Qr(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}oe(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),ge[e.id]=e,Qe.emit("addLayer",e,t.layers[e.id])}function Ol(e){return ge[e]}function ei(e){console.info("Removing layer",e.id),Qe.emit("removeLayer",e),ge[e.id]=void 0}function ql(e){ei(e),Qr(e,Y)}function Vl(e){const t=G(!1);return{openModal:()=>t.value=!0,modal:j(()=>d(Lt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>d("h2",null,[a(e.name)]),body:a(e.display)}))}}Qe.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 Bl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Yr,UnregisterNodeInjectionKey:Zr,NodesInjectionKey:Xr,BoundsInjectionKey:Jr,layers:ge,persistentRefs:wn,addingLayers:ft,createLayer:Kr,addLayer:Qr,getLayer:Ol,removeLayer:ei,reloadLayer:ql,setupLayerModal:Vl},Symbol.toStringTag,{value:"Module"}));const Ll=X({components:{Context:Li,ErrorVue:xi},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}=Ae(e),s=Hr(t),l=Rn(i),u=y(()=>ve.allowGoBack&&n.value>0&&!Pe(r));function c(){Y.tabs.splice(a(e.index),1/0)}function p(g){e.nodes.value=g}const h=G([]);return ga((g,b,m)=>(console.warn(`Error caught in "${e.name}" layer`,g,b,m),h.value.push(g instanceof Error?g:new Error(JSON.stringify(g))),!1)),{component:s,minimizedComponent:l,showGoBack:u,updateNodes:p,unref:a,goBack:c,errors:h}}}),jl={key:1};function zl(e,t,n,r,i,s){const l=Ct("ErrorVue"),u=Ct("Context");return e.errors.length>0?(S(),re(l,{key:0,errors:e.errors},null,8,["errors"])):(S(),T("div",Vt({key:1,class:"layer-container",style:{"--layer-color":e.unref(e.color)}},e.$attrs),[e.showGoBack?(S(),T("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...c)=>e.goBack&&e.goBack(...c))},"\u274C")):B("",!0),e.unref(e.minimized)?(S(),T("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=c=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(S(),re(Ke(e.minimizedComponent),{key:0})):(S(),T("div",jl,ee(e.unref(e.name)),1))])):(S(),T("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[d(u,{onUpdateNodes:e.updateNodes},{default:H(()=>[(S(),re(Ke(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(S(),T("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=c=>e.$emit("setMinimized",!0))}," \u25BC ")):B("",!0)],16))}var Gl=be(Ll,[["render",zl],["__scopeId","data-v-a9f5b1da"]]);const Ui=e=>(cn("data-v-4b4bda40"),e=e(),dn(),e),Ul=Ui(()=>N("h2",null,"Changelog",-1)),Wl=Ui(()=>N("details",{open:""},[N("summary",null,[w("v0.0 Initial Commit - "),N("time",null,"2021-09-04")]),w(" This is the first release :D "),N("ul",null,[N("li",{class:"feature"},"Did everything"),N("li",{class:"fix"},"Had some fun"),N("li",{class:"breaking"},"Removed everything"),N("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),Hl=X({__name:"Changelog",setup(e,{expose:t}){const n=G(!1);return t({open(){n.value=!0}}),(r,i)=>(S(),re(Lt,{modelValue:n.value,"onUpdate
${L}
${R}`)}}return p[I]}wt(n,I=>{I&&Object.keys(p).forEach(R=>delete p[R])});const g=y(()=>ie.saves.reduce((I,R)=>(I[R]=h(R),I),{}));function b(I){let R;switch(Y.id===I?R=zr(Y):R=JSON.stringify(g.value[I]),ve.exportEncoding){default:console.warn(`Unknown save encoding: ${ve.exportEncoding}. Defaulting to lz`);case"lz":R=Yt.compressToUTF16(R);break;case"base64":R=btoa(unescape(encodeURIComponent(R)));break;case"plain":break}const L=document.createElement("textarea");L.value=R,document.body.appendChild(L),L.select(),L.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(L)}function m(I){Y.id===I&&bt();const R={...g.value[I],id:cr()};bt(R),ie.saves.push(R.id)}function k(I){ie.saves=ie.saves.filter(R=>R!==I),localStorage.removeItem(I),p[I]=void 0}function C(I){g.value[Y.id].time=Y.time,bt(),p[Y.id]=void 0,bn(g.value[I]),p[I]=void 0}function $(I){if(l.value=I,Xt(()=>{l.value=null}),I[0]!=="{")if(I[0]==="e")I=decodeURIComponent(escape(atob(I)));else if(I[0]==="\u1BE1")I=Yt.decompressFromUTF16(I);else{console.warn("Unable to determine preset encoding",I);return}const R=JSON.parse(I);R.id=cr(),bt(R),ie.saves.push(R.id),C(R.id)}function x(I,R){const L=g.value[I];L!=null&&(L.name=R,Y.id===I?(Y.name=R,bt()):(bt(L),p[I]=void 0))}return(I,R)=>(S(),re(Lt,{modelValue:n.value,"onUpdate:modelValue":R[4]||(R[4]=L=>n.value=L),ref_key:"modal",ref:r},{header:H(()=>[Qu]),body:H(({shown:L})=>[L?(S(),re(a(_a),{key:0,list:a(ie).saves,handle:".handle",itemKey:ce=>ce},{item:H(({element:ce})=>[d(Ku,{save:a(g)[ce],onOpen:le=>C(ce),onExport:le=>b(ce),onEditName:le=>x(ce,le),onDuplicate:le=>m(ce),onDelete:le=>k(ce)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):B("",!0)]),footer:H(()=>[N("div",ec,[d(Wi,{modelValue:s.value,"onUpdate:modelValue":R[0]||(R[0]=L=>s.value=L),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:i.value})},null,8,["modelValue","class"]),N("div",tc,[nc,N("div",rc,[N("button",{class:"button",onClick:R[1]||(R[1]=L=>C(a(Tn)().id))},"New Game"),Object.keys(a(c)).length>0?(S(),re(ti,{key:0,options:a(c),modelValue:l.value,"onUpdate:modelValue":R[2]||(R[2]=L=>$(L)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):B("",!0)])]),N("div",ic,[ac,N("button",{class:"button modal-default-button",onClick:R[3]||(R[3]=L=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Hi=be(sc,[["__scopeId","data-v-2a4275be"]]);const kt=e=>(cn("data-v-318a1c31"),e=e(),dn(),e),oc=["src","alt"],lc={key:1,class:"title"},uc=kt(()=>N("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),cc={class:"discord"},dc={class:"discord-links"},pc={key:0},fc=["href"],gc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),mc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),vc={href:"https://forums.moddingtree.com/",target:"_blank"},hc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),bc=kt(()=>N("span",{class:"material-icons"},"info",-1)),yc=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),wc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),_c=kt(()=>N("span",{class:"material-icons"},"library_books",-1)),Nc=kt(()=>N("span",{class:"material-icons"},"settings",-1)),Cc=kt(()=>N("span",{class:"material-icons"},"info",-1)),kc={href:"https://forums.moddingtree.com/",target:"_blank"},Sc=kt(()=>N("span",{class:"material-icons"},"forum",-1)),Mc={class:"discord"},Ic={class:"discord-links"},xc={key:0},$c=["href"],Dc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Tc=kt(()=>N("li",null,[N("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Pc=X({__name:"Nav",setup(e){const t=G(null),n=G(null),r=G(null),i=G(null),{useHeader:s,banner:l,title:u,discordName:c,discordLink:p,versionNumber:h}=ve;function g(){window.open(p,"mywindow")}return(b,m)=>(S(),T(ne,null,[a(s)?(S(),T("div",Vt({k
${(-a(i)-30)*Math.sin(((e.actions.length-1)/2-m)*a(u))},
${(a(i)+30)*Math.cos(((e.actions.length-1)/2-m)*a(u))}
)`,onMousedown:$=>c($,b),onTouchstart:$=>c($,b),onMouseup:$=>p($,b),onTouchend:Pn($=>p($,b),["stop"])},[N("circle",{fill:a(pe)(b.fillColor,e.node),r:"20","stroke-width":((C=e.selectedAction)==null?void 0:C.id)===b.id?4:0,stroke:a(s)},null,8,jc),N("text",{fill:a(l),class:"material-icons"},ee(a(pe)(b.icon,e.node)),9,zc)],42,Lc)}),128))])):B("",!0)]),_:1}))}});var Uc=be(Gc,[["__scopeId","data-v-9efb2a56"]]);const Wc=["transform"],Hc={key:0},Yc=["r","fill","stroke"],Zc=["r","fill","stroke"],Xc=["r","fill"],Jc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Kc=["fill","transform"],Qc={key:1,transform:"rotate(45, 0, 0)"},ed=["width","height","transform","fill","stroke"],td=["width","height","transform","fill","stroke"],nd=["width","height","transform","fill"],rd=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],id=["fill","y"],ad=["fill"],sd=["fill","y"],od={key:0},ld=["fill","y"],ud=["fill","y"],cd=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=Ae(n),s=y(()=>pe(i.nodeType.value.draggable,a(i.node)));wt(s,K=>{const $e=a(i.node);a(i.dragging)===$e&&!K&&t("endDragging",$e)});const l=y(()=>{var $e;const K=a(i.node);return($e=pe(i.nodeType.value.actions,K))==null?void 0:$e.filter(nt=>Ze(pe(nt.visibility,K)))}),u=y(()=>{var $e;const K=a(i.node);if(pe(i.nodeType.value.draggable,K)&&(($e=a(i.dragging))==null?void 0:$e.id)===K.id&&a(i.dragged)!=null){const{x:nt,y:ht}=a(i.dragged);return{x:K.position.x+Math.round(nt/25)*25,y:K.position.y+Math.round(ht/25)*25}}return K.position}),c=y(()=>pe(i.nodeType.value.shape,a(i.node))),p=y(()=>pe(i.nodeType.value.title,a(i.node))),h=y(()=>pe(i.nodeType.value.otherSubtitle,a(i.node))),g=y(()=>{var K;return(K=i.isSelected.value?a(i.selectedAction)&&pe(a(i.selectedAction).tooltip,a(i.node)):null)!=null?K:pe(i.nodeType.value.label,a(i.node))}),b=y(()=>{var K,$e;return pe(($e=(K=a(i.selectedAction))==null?void 0:K.confirmationLabel)!=null?$e:{text:"Tap again to confirm"},a(i.node))}),m=y(()=>pe(i.nodeType.value.size,a(i.node))),k=y(()=>{var K;return(K=pe(i.nodeType.value.progress,a(i.node)))!=null?K:0}),C=y(()=>It[ie.theme].variables["--background"]),$=y(()=>{var K;return(K=pe(i.nodeType.value.outlineColor,a(i.node)))!=null?K:It[ie.theme].variables["--outline"]}),x=y(()=>{var K;return(K=pe(i.nodeType.value.fillColor,a(i.node)))!=null?K:It[ie.theme].variables["--raised-background"]}),I=y(()=>pe(i.nodeType.value.progressColor,a(i.node))),R=y(()=>{var K;return(K=pe(i.nodeType.value.titleColor,a(i.node)))!=null?K:It[ie.theme].variables["--foreground"]}),L=y(()=>pe(i.nodeType.value.progressDisplay,a(i.node))),ce=y(()=>i.dragging.value!=null&&a(i.hasDragged)&&pe(i.nodeType.value.canAccept,a(i.node),i.dragging.value)),le=y(()=>pe(i.nodeType.value.style,a(i.node))),ae=y(()=>pe(i.nodeType.value.classes,a(i.node)));function J(K){t("mouseDown",K,i.node.value,s.value)}function Ie(K){var $e,nt,ht;($e=i.hasDragged)!=null&&$e.value||(t("endDragging",i.node.value),(ht=(nt=i.nodeType.value).onClick)==null||ht.call(nt,i.node.value),K.stopPropagation())}const he=y(()=>pe(i.nodeType.value.subtitle,a(i.node))),Ue=y(()=>pe(i.nodeType.value.showStar,a(i.node))),vt=y(()=>pe(i.nodeType.value.fillStar,a(i.node)));return(K,$e)=>{var nt,ht,pt;return S(),T("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:a(s),...a(ae)}]),style:Le([{opacity:((nt=e.dragging)==null?void 0:nt.id)===e.node.id&&e.hasDragged?.5:1},(ht=a(le))!=null?ht:[]]),transform:`translate(${a(u).x},${a(u).y})${e.isSelected?" scale(1.2)":""}`},[d(Uc,{actions:(pt=a(l))!=null?pt:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:$e[0]||($e[0]=St=>t("clickAction",St))},null,8,["actions","is-selected","node","node-type","selected-action"]),N("g",{class:"node-container",onMousedown:J,onTouchstartPassi
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 js();const{globalBus:e}=await Hn(()=>Promise.resolve().then(function(){return Ls}),void 0),{startGameLoop:t}=await Hn(()=>import("./gameLoop.42689a05.js"),["assets/gameLoop.42689a05.js","assets/@fontsource.f66d05e7.css","assets/vue.c16a309b.js","assets/amator.1e5a40c8.js","assets/bezier-easing.a990b400.js","assets/@vue.6b211d3c.js","assets/lz-string.dccec454.js","assets/nanoevents.1080beb7.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=ya(Cf);n.config.errorHandler=function(r,i,s){console.error(r,s,i)},e.emit("setupVue",n),n.mount("#app"),Xt(()=>{const r=hr(),{updateServiceWorker:i}=Sf({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{o as D,Hn as _,Fe as a,ve as b,Xp as c,Qe as g,zs as l,Y as p,ie as s};