Planar-Pioneers/assets/index.8dbb25be.js

19 lines
225 KiB
JavaScript
Raw Normal View History

/* empty css */import"./vue.c16a309b.js";import{_ as N,C as s,l as Fe,q as fn,t as z,b2 as vt,ab as J,aF as M,a1 as A,a2 as C,aL as Tt,G as Ne,aD as br,w as ht,b3 as It,a9 as p,O as re,ap as ta,az as gi,as as Ut,aH as ii,A as Te,$ as ne,b7 as Y,b9 as Oi,ar as Wt,bv as $n,a8 as P,bt as na,bc as zn,T as ia,u as qi,j as ra,bw as At,aM as kt,a0 as j,aO as Ke,J as de,I as Be,aI as gn,aG as mn,z as tn,bo as aa,bs as sa,aK as En,bd as ir,am as li,H as oa,bx as la,bf as ua}from"./@vue.6b211d3c.js";import{c as yr}from"./nanoevents.1080beb7.js";import{L as Kt}from"./lz-string.dccec454.js";import{Y as ca}from"./vue-next-select.ded54c4a.js";import{D as da}from"./vuedraggable.1879de79.js";import{p as pa}from"./vue-textarea-autosize.35804eaf.js";import{P as fa}from"./vue-panzoom.8ce6f9b1.js";import{s as ga,u as mi}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 ma=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 u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).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)}};ma();const va="modulepreload",rr={},ha="./",Gn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${ha}${i}`,i in rr)return;rr[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":va,r||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),r)return new Promise((l,c)=>{u.addEventListener("load",l),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},ba="./projInfo-schema.json",ya="Planar Pioneers",wa="A game about controlling and exploiting planes!",_a="planar-pioneers",Na="thepaperpilot",Ca="",ka="",Ma="0.0",Sa="Initial Commit",Ia=!1,xa=!1,$a=2,Ea=!0,Pa=null,Da="",Ta=["main"],Aa=3600,Ra=0,Fa=!0,Oa="base64";var we={$schema:ba,title:ya,description:wa,id:_a,author:Na,discordName:Ca,discordLink:ka,versionNumber:Ma,versionTitle:Sa,allowGoBack:Ia,defaultShowSmall:xa,defaultDecimalsShown:$a,useHeader:Ea,banner:Pa,logo:Da,initialTabs:Ta,maxTickLength:Aa,offlineLimit:Ra,enablePausing:Fa,exportEncoding:Oa};class qa{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 i=new Va(t,n);for(this.first===void 0?(this.first=i,this.last=i):(i.next=this.first,this.first.prev=i,this.first=i),this.map.set(t,i);this.map.size>this.maxSize;){const r=this.last;this.map.delete(r.key),this.last=r.prev,this.last.next=void 0}}}class Va{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const $i=17,Ba=9e15,La=Math.log10(9e15),ja=1/9e15,za=308,Ga=-324,ar=5,Ua=(1<<10)-1,Wa=function(){const e=[];for(let n=Ga+1;n<=za;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),sn=[2,Math.E,3,4,5,6,7,8,9,10],Ha=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.88041920
`,e),await cn(xn())}}function xn(){const e=oi(),t=Ir({id:e});return mt(t),ce.saves.push(e),t}function oi(){let e,t=0;do e=`${we.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const gs=z(!1);async function cn(e){console.info("Loading save",e),gs.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await Gn(()=>Promise.resolve().then(function(){return pl}),void 0),{fixOldSave:r,getInitialLayers:a}=await Gn(()=>Promise.resolve().then(function(){return vp}),void 0);for(const u in t){const l=t[u];l&&n(l)}a(e).forEach(u=>i(u,e)),e=Ir(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,we.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==we.versionNumber&&(r(e.modVersion,e),e.modVersion=we.versionNumber),Object.assign(Q,e),ce.active=Q.id,Qe.emit("onLoad")}setInterval(()=>{Q.autosave&&mt()},1e3);window.onbeforeunload=()=>{Q.autosave&&mt()};window.save=mt;const ms=window.hardReset=async()=>{await cn(xn())};window.deleteLowerSaves=()=>{const e=Object.values(ce.saves).indexOf(Q.id)+1;Object.values(ce.saves).slice(e).forEach(t=>localStorage.removeItem(t)),ce.saves=ce.saves.slice(0,e)};const Yn=fn({active:"",saves:[],showTPS:!0,theme:Bi.Nordic,unthrottled:!1,alignUnits:!1});vt(Yn,e=>{const t=Kt.compressToUTF16(JSON.stringify(e));localStorage.setItem(we.id,t)},{deep:!0});var ce=window.settings=Yn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Bi.Nordic,alignUnits:!1};Qe.emit("loadSettings",e),Object.assign(Yn,e),ms()};function vs(){try{let e=localStorage.getItem(we.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Kt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Yn,t)}Qe.emit("loadSettings",Yn)}catch{}}const xr=fn([]);function hs(e){xr.push(e)}const bs=fn([]),ys=fn([]),ws={class:"table"},_s=J({__name:"Column",setup(e){const t=N(()=>Nt[ce.theme].mergeAdjacent);return(n,i)=>(M(),A("div",ws,[C("div",{class:Ne(["col",{mergeAdjacent:s(t)}])},[Tt(n.$slots,"default")],2)]))}}),Ns={class:"table"},Cs=J({__name:"Row",setup(e){const t=N(()=>Nt[ce.theme].mergeAdjacent);return(n,i)=>(M(),A("div",Ns,[C("div",{class:Ne(["row",{mergeAdjacent:s(t)}])},[Tt(n.$slots,"default")],2)]))}});function $r(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ta(e)}function pe(e,t="span"){return typeof e=="function"?J({render:e}):typeof e=="string"?e.length>0?(e=e.trim(),e.charAt(0)!=="<"&&(e=`<${t}>${e}</${t}>`),J({template:e})):J({render:()=>({})}):e}function ot(e){if(xt(e))return typeof e=="function"?e():pe(e);const t=e[yt];return p(t,e[pt](),null)}function Pi(...e){let t;return p(Cs,null,$r(t=e.map(ot))?t:{default:()=>[t]})}function ks(...e){let t;return p(_s,null,$r(t=e.map(ot))?t:{default:()=>[t]})}function Ct(e){if(xt(e))return typeof e=="function"?e():typeof e=="string"?p(re,null,[e]):p(e,null,null);const t=e[yt];return p(t,e[pt](),null)}function ur(e,t){return e.reduce((n,i)=>p(re,null,[n,t,i]))}function xt(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Wn]===!0}function Er(e,t){const n=z(null),i=z(void 0);function r(l){n.value||(n.value=setInterval(u,250)),i.value=l}function a(){n.value&&(clearInterval(n.value),n.value=null)}function u(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return br(a),{start:r,stop:a,handleHolding:u}}function Pr(e,t="div"){const n=ht();return It(()=>{n.value=pe(Ee(e),t)}),n}function Dn(e,t="div"){const n=ht(null);return It(()=>{const i=Ee(e);n.value=i==""||i==null?null:pe(i,t)}),n}function Ee(e){return s(s(e))}function q(...e){return e.includes(Object)||e.push(Object),e}function cr(e){const t=z(!1),n=e[pt].bind(e);return e[pt]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var ve=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Ms=J({__name:"Context",emits:["
`).slice(3,5).map(n=>n.trim()).join(`
`))!=null?t:""}function dr(e,t){var n;if(o.isNaN(t))throw Ue.hasNaN||(Q.autosave=!1,Ue.hasNaN=!0,Ue.NaNPath=e[dn],Ue.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[dn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[en].value=t}function lt(e,t=!0){const n=Fe(e)?e:z(e);Fe(e)&&(e=e.value);const i=N({get(){return n.value},set(a){t?dr(r,a):r[en].value=a}});i[Ht]=e;const r={get value(){return n.value},set value(a){t?dr(r,a):r[en].value=a},__v_isRef:!0,[en]:n,[Ht]:e,[ci]:ol(),[di]:!1,[Dt]:i,[dn]:void 0};return ut.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
Created at:
`+r[ci]):pn[ut[ut.length-1]].add(r),r}function ll(e){return e!=null&&typeof e=="object"&&en in e}function kn(e){return!(Jt in e)&&Dt in e?e[Dt]:new Proxy(e,{get(t,n){if(n!==en)return n===Zn?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===en?!1:n==Zn?!0:Reflect.has(t,n)}})}function Rr(e){ut.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):pn[ut[ut.length-1]].delete(e),e[di]=!0}Qe.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let u=!1;return Object.keys(r).forEach(l=>{let c=r[l];if(c!=null&&typeof c=="object"){if(c[Zn]===!0)return;if(Jt in c&&(c=c[Jt]),ll(c)){if(u=!0,c[di]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
Created at:
`+c[ci]);return}pn[e.id].delete(c);const d=[e.id,...a,l];c[dn]!=null&&JSON.stringify(d)!==JSON.stringify(c[dn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[dn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[dn]=d;const h=a.reduce((b,v)=>(v in b||(b[v]={}),b[v]),t),f=h[l];h[l]=c[en],ra(h)?f!=null?h[l]=f:h[l]=c[Ht]:f!=null?h[l].value=f:h[l].value=c[Ht]}else!(c instanceof o)&&!(c instanceof g)&&!Fe(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,l])&&(At(c)&&!At(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.",Jt in r?r[Jt]:r,l):u=!0))}}),u};i(e[Jt]),pn[e.id].forEach(r=>{r[di]||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[ci])}),pn[e.id].clear()});const Li=Symbol("RegisterNode"),ji=Symbol("UnregisterNode"),zi=Symbol("Nodes"),Gi=Symbol("Bounds"),ge=qi({});window.layers=ge;const pn={},ut=[];function Ui(e,t){return et(()=>{const n={},i=n.emitter=yr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=z({}),n.id=e,ut.push(e),pn[e]=new Set,n.minimized=lt(!1,!1),Object.assign(n,t.call(n,n)),ut[ut.length-1]==null||ut[ut.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
Stack: ${ut}
Trying to pop ${n.id}`;ut.pop(),$(n,"color"),$(n,"display"),$(n,"classes"),$(n,"style"),$(n,"name"),oe(n,"name",n.id),$(n,"minWidth"),oe(n,"minWidth",600),$(n,"minimizable"),oe(n,"minimizable",!0),$(n,"minimizedDisplay");const r=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(r))!=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 Wi(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 ul(e){return ge[e]}function Hi(e){console.info("Removing layer",e.id),Qe.emit("removeLayer",e),ge[e.id]=void 0}function cl(e){Hi(e),Wi(e,Q)}function dl(e){const t=z(!1);return{openModal:()=>t.value=!0,modal:Z(()=>p(Rt,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(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 pl=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Li,UnregisterNodeInjectionKey:ji,NodesInjectionKey:zi,BoundsInjectionKey:Gi,layers:ge,persistentRefs:pn,addingLayers:ut,createLayer:Ui,addLayer:Wi,getLayer:ul,removeLayer:Hi,reloadLayer:cl,setupLayerModal:dl},Symbol.toStringTag,{value:"Module"}));const fl=J({components:{Context:Dr},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:i,minimizedDisplay:r}=Te(e),a=Pr(t),u=Dn(r),l=N(()=>we.allowGoBack&&n.value>0&&!Ee(i));function c(){Q.tabs.splice(s(e.index),1/0)}function d(h){e.nodes.value=h}return{component:a,minimizedComponent:u,showGoBack:l,updateNodes:d,unref:s,goBack:c}}}),gl={key:1};function ml(e,t,n,i,r,a){const u=kt("Context");return M(),A("div",{class:"layer-container",style:Be({"--layer-color":e.unref(e.color)})},[e.showGoBack?(M(),A("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...l)=>e.goBack&&e.goBack(...l))},"\u274C")):j("",!0),e.unref(e.minimized)?(M(),A("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=l=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),ne(Ke(e.minimizedComponent),{key:0})):(M(),A("div",gl,de(e.unref(e.name)),1))])):(M(),A("div",{key:2,class:Ne(["layer-tab",{showGoBack:e.showGoBack}])},[p(u,{onUpdateNodes:e.updateNodes},{default:Y(()=>[(M(),ne(Ke(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),A("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=l=>e.$emit("setMinimized",!0))}," \u25BC ")):j("",!0)],4)}var vl=ve(fl,[["render",ml],["__scopeId","data-v-72dd78b1"]]);const Fr=e=>(gn("data-v-4b4bda40"),e=e(),mn(),e),hl=Fr(()=>C("h2",null,"Changelog",-1)),bl=Fr(()=>C("details",{open:""},[C("summary",null,[P("v0.0 Initial Commit - "),C("time",null,"2021-09-04")]),P(" This is the first release :D "),C("ul",null,[C("li",{class:"feature"},"Did everything"),C("li",{class:"fix"},"Had some fun"),C("li",{class:"breaking"},"Removed everything"),C("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),yl=J({__name:"Changelog",setup(e,{expose:t}){const n=z(!1);return t({open(){n.value=!0}}),(i,r)=>(M(),ne(Rt,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:Y(()=>[hl]),body:Y(()=>[bl]),_:1},8,["modelValue"]))}});var wl=ve(yl,[["__scopeId","data-v-4b4bda40"]]),_l=J({props:{element:Object,display:{type:q(Object,String,Function),required:!0},style:q(Object,String,Array),classes:q(Object),di
${B}
${T}`)}}return d[S]}vt(n,S=>{S&&Object.keys(d).forEach(T=>delete d[T])});const f=N(()=>ce.saves.reduce((S,T)=>(S[T]=h(T),S),{}));function b(S){let T;switch(Q.id===S?T=Sr(Q):T=JSON.stringify(f.value[S]),we.exportEncoding){default:console.warn(`Unknown save encoding: ${we.exportEncoding}. Defaulting to lz`);case"lz":T=Kt.compressToUTF16(T);break;case"base64":T=btoa(unescape(encodeURIComponent(T)));break;case"plain":break}const B=document.createElement("textarea");B.value=T,document.body.appendChild(B),B.select(),B.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(B)}function v(S){Q.id===S&&mt();const T={...f.value[S],id:oi()};mt(T),ce.saves.push(T.id)}function y(S){ce.saves=ce.saves.filter(T=>T!==S),localStorage.removeItem(S),d[S]=void 0}function _(S){f.value[Q.id].time=Q.time,mt(),d[Q.id]=void 0,cn(f.value[S]),d[S]=void 0}function I(S){if(u.value=S,Ut(()=>{u.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Kt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const T=JSON.parse(S);T.id=oi(),mt(T),ce.saves.push(T.id),_(T.id)}function D(S,T){const B=f.value[S];B!=null&&(B.name=T,Q.id===S?(Q.name=T,mt()):(mt(B),d[S]=void 0))}return(S,T)=>(M(),ne(Rt,{modelValue:n.value,"onUpdate:modelValue":T[4]||(T[4]=B=>n.value=B),ref_key:"modal",ref:i},{header:Y(()=>[Iu]),body:Y(({shown:B})=>[B?(M(),ne(s(da),{key:0,list:s(ce).saves,handle:".handle",itemKey:le=>le},{item:Y(({element:le})=>[p(Su,{save:s(f)[le],onOpen:ae=>_(le),onExport:ae=>b(le),onEditName:ae=>D(le,ae),onDuplicate:ae=>v(le),onDelete:ae=>y(le)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):j("",!0)]),footer:Y(()=>[C("div",xu,[p(qr,{modelValue:a.value,"onUpdate:modelValue":T[0]||(T[0]=B=>a.value=B),title:"Import Save",placeholder:"Paste your save here!",class:Ne({importingFailed:r.value})},null,8,["modelValue","class"]),C("div",$u,[Eu,C("div",Pu,[C("button",{class:"button",onClick:T[1]||(T[1]=B=>_(s(xn)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),ne(Yi,{key:0,options:s(c),modelValue:u.value,"onUpdate:modelValue":T[2]||(T[2]=B=>I(B)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):j("",!0)])]),C("div",Du,[Tu,C("button",{class:"button modal-default-button",onClick:T[3]||(T[3]=B=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Vr=ve(Au,[["__scopeId","data-v-2a4275be"]]);const wt=e=>(gn("data-v-318a1c31"),e=e(),mn(),e),Ru=["src","alt"],Fu={key:1,class:"title"},Ou=wt(()=>C("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),qu={class:"discord"},Vu={class:"discord-links"},Bu={key:0},Lu=["href"],ju=wt(()=>C("li",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),zu=wt(()=>C("li",null,[C("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Gu={href:"https://forums.moddingtree.com/",target:"_blank"},Uu=wt(()=>C("span",{class:"material-icons"},"forum",-1)),Wu=wt(()=>C("span",{class:"material-icons"},"info",-1)),Hu=wt(()=>C("span",{class:"material-icons"},"library_books",-1)),Yu=wt(()=>C("span",{class:"material-icons"},"settings",-1)),Zu=wt(()=>C("span",{class:"material-icons"},"library_books",-1)),Xu=wt(()=>C("span",{class:"material-icons"},"settings",-1)),Ju=wt(()=>C("span",{class:"material-icons"},"info",-1)),Ku={href:"https://forums.moddingtree.com/",target:"_blank"},Qu=wt(()=>C("span",{class:"material-icons"},"forum",-1)),ec={class:"discord"},tc={class:"discord-links"},nc={key:0},ic=["href"],rc=wt(()=>C("li",null,[C("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),ac=wt(()=>C("li",null,[C("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),sc=J({__name:"Nav",setup(e){const t=z(null),n=z(null),i=z(null),r=z(null),{useHeader:a,banner:u,title:l,discordName:c,discordLink:d,versionNumber:h}=we;function f(){window.open(d,"mywindow")}return(b,v)=>(M(),A(re,null,[s(a)?(M(),A("div",Wt({k
${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-v)*s(l))},
${(s(r)+30)*Math.cos(((e.actions.length-1)/2-v)*s(l))}
)`,onMousedown:I=>c(I,b),onTouchstart:I=>c(I,b),onMouseup:I=>d(I,b),onTouchend:$n(I=>d(I,b),["stop"])},[C("circle",{fill:s(me)(b.fillColor,e.node),r:"20","stroke-width":((_=e.selectedAction)==null?void 0:_.id)===b.id?4:0,stroke:s(a)},null,8,vc),C("text",{fill:s(u),class:"material-icons"},de(s(me)(b.icon,e.node)),9,hc)],42,mc)}),128))])):j("",!0)]),_:1}))}});var yc=ve(bc,[["__scopeId","data-v-9efb2a56"]]);const wc=["transform"],_c={key:0},Nc=["r","fill","stroke"],Cc=["r","fill","stroke"],kc=["r","fill"],Mc=["r","stroke-dasharray","stroke-dashoffset","stroke"],Sc={key:1,transform:"rotate(45, 0, 0)"},Ic=["width","height","transform","fill","stroke"],xc=["width","height","transform","fill","stroke"],$c=["width","height","transform","fill"],Ec=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],Pc=["fill","y"],Dc=["fill"],Tc=["fill","y"],Ac={key:0},Rc=["fill","y"],Fc=["fill","y"],Oc=J({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},isSelected:{type:Boolean},selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=Te(n),a=N(()=>me(r.nodeType.value.draggable,s(r.node)));vt(a,U=>{const be=s(r.node);s(r.dragging)===be&&!U&&t("endDragging",be)});const u=N(()=>{var be;const U=s(r.node);return(be=me(r.nodeType.value.actions,U))==null?void 0:be.filter(je=>He(me(je.visibility,U)))}),l=N(()=>{var be;const U=s(r.node);if(me(r.nodeType.value.draggable,U)&&((be=s(r.dragging))==null?void 0:be.id)===U.id&&s(r.dragged)!=null){const{x:je,y:ft}=s(r.dragged);return{x:U.position.x+Math.round(je/25)*25,y:U.position.y+Math.round(ft/25)*25}}return U.position}),c=N(()=>me(r.nodeType.value.shape,s(r.node))),d=N(()=>me(r.nodeType.value.title,s(r.node))),h=N(()=>me(r.nodeType.value.subtitle,s(r.node))),f=N(()=>me(r.nodeType.value.otherSubtitle,s(r.node))),b=N(()=>{var U;return(U=r.isSelected.value?s(r.selectedAction)&&me(s(r.selectedAction).tooltip,s(r.node)):null)!=null?U:me(r.nodeType.value.label,s(r.node))}),v=N(()=>{var U,be;return me((be=(U=s(r.selectedAction))==null?void 0:U.confirmationLabel)!=null?be:{text:"Tap again to confirm"},s(r.node))}),y=N(()=>me(r.nodeType.value.size,s(r.node))),_=N(()=>{var U;return(U=me(r.nodeType.value.progress,s(r.node)))!=null?U:0}),I=N(()=>Nt[ce.theme].variables["--background"]),D=N(()=>{var U;return(U=me(r.nodeType.value.outlineColor,s(r.node)))!=null?U:Nt[ce.theme].variables["--outline"]}),S=N(()=>{var U;return(U=me(r.nodeType.value.fillColor,s(r.node)))!=null?U:Nt[ce.theme].variables["--raised-background"]}),T=N(()=>me(r.nodeType.value.progressColor,s(r.node))),B=N(()=>{var U;return(U=me(r.nodeType.value.titleColor,s(r.node)))!=null?U:Nt[ce.theme].variables["--foreground"]}),le=N(()=>me(r.nodeType.value.progressDisplay,s(r.node))),ae=N(()=>r.dragging.value!=null&&s(r.hasDragged)&&me(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),te=N(()=>me(r.nodeType.value.style,s(r.node))),K=N(()=>me(r.nodeType.value.classes,s(r.node)));function Ie(U){t("mouseDown",U,r.node.value,a.value)}function he(U){var be,je,ft;(be=r.hasDragged)!=null&&be.value||(t("endDragging",r.node.value),(ft=(je=r.nodeType.value).onClick)==null||ft.call(je,r.node.value),U.stopPropagation())}return(U,be)=>{var je,ft,Ot;return M(),A("g",{class:Ne(["boardnode",{[e.node.type]:!0,isSelected:e.isSelected,isDraggable:s(a),...s(K)}]),style:Be([{opacity:((je=e.dragging)==null?void 0:je.id)===e.node.id&&e.hasDragged?.5:1},(ft=s(te))!=null?ft:[]]),transform:`translate(${s(l).x},${s(l).y})${e.isSelected?" scale(1.2)":""}`},[p(yc,{actions:(Ot=s(u))!=null?Ot:[],"is-selected":e.isSelected,node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:be[0]||(be[0]=gt=>t("clickAction",gt))},null,8,["actions","is-selected","node","node-type","selected-action"]),C("g",{class:"node-container",onMousedown:Ie,onTouchstartPassive:Ie,onMouseup:he,onTouchendPassive:he},[s(c)===s(Le).Circle?(M(),A("g",_c,[s(ae)?(M(),A("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 fs();const{globalBus:e}=await Gn(()=>Promise.resolve().then(function(){return ds}),void 0),{startGameLoop:t}=await Gn(()=>import("./gameLoop.b6c8f87a.js"),["assets/gameLoop.b6c8f87a.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=ua(jp);e.emit("setupVue",n),n.mount("#app"),Ut(()=>{const i=mi(),{updateServiceWorker:r}=Gp({onNeedRefresh(){i.info("New content available, click here to update.",{timeout:!1,closeOnClick:!1,draggable:!1,icon:{iconClass:"material-icons",iconChildren:"refresh",iconTag:"i"},rtl:!1,onClick(){r()}})},onOfflineReady(){i.info("App ready to work offline")},onRegisterError:console.warn,onRegistered(a){a&&setInterval(()=>a.update(),60*60*1e3)}})}),t()});export{o as D,Gn as _,Ue as a,we as b,vp as c,Qe as g,gs as l,Q as p,ce as s};