mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-30 03:41:43 +00:00
19 lines
215 KiB
JavaScript
19 lines
215 KiB
JavaScript
|
/* empty css */import"./vue.c16a309b.js";import{_ as C,C as s,l as De,q as mn,t as B,b2 as pt,ab as J,aF as M,a1 as P,a2 as _,aL as Pt,G as pe,aD as _r,w as gt,b3 as _t,a9 as p,O as ne,ap as pa,az as pi,as as jt,aH as ni,A as $e,$ as ee,b7 as W,b9 as Ri,ar as zt,bv as xn,a8 as $,bt as ga,bc as $n,T as ma,u as qi,j as va,bw as Tt,aM as Ct,a0 as L,aO as We,J as ae,I as Re,aI as hn,aG as bn,z as nn,bo as ha,bs as ba,aK as En,bd as sr,am as si,H as ya,bx as wa,bf as _a}from"./@vue.6b211d3c.js";import{c as Nr}from"./nanoevents.1080beb7.js";import{L as Qt}from"./lz-string.dccec454.js";import{Y as Na}from"./vue-next-select.ded54c4a.js";import{D as Ca}from"./vuedraggable.1879de79.js";import{p as ka}from"./vue-textarea-autosize.35804eaf.js";import{P as Ma}from"./vue-panzoom.8ce6f9b1.js";import{s as Sa,u as gi}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 Ia=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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).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)}};Ia();const xa="modulepreload",or={},$a="./",zn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(i=>{if(i=`${$a}${i}`,i in or)return;or[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${a}`))return;const l=document.createElement("link");if(l.rel=r?"stylesheet":xa,r||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),r)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())},Ea="./projInfo-schema.json",Pa="Planar Pioneers",Ta="A game about controlling and exploiting planes!",Da="planar-pioneers",Aa="thepaperpilot",Fa="",Oa="",Ra="0.0",qa="Initial Commit",Va=!1,Ba=!1,La=2,ja=!0,za=null,Ua="",Ga=["main"],Wa=3600,Ha=0,Za=!0,Ya="base64";var fe={$schema:Ea,title:Pa,description:Ta,id:Da,author:Aa,discordName:Fa,discordLink:Oa,versionNumber:Ra,versionTitle:qa,allowGoBack:Va,defaultShowSmall:Ba,defaultDecimalsShown:La,useHeader:ja,banner:za,logo:Ua,initialTabs:Ga,maxTickLength:Wa,offlineLimit:Ha,enablePausing:Za,exportEncoding:Ya};class Xa{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 Ja(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 Ja{constructor(t,n){this.next=void 0,this.prev=void 0,this.key=t,this.value=n}}const Ii=17,Ka=9e15,Qa=Math.log10(9e15),es=1/9e15,ts=308,ns=-324,lr=5,is=(1<<10)-1,rs=function(){const e=[];for(let n=ns+1;n<=ts;n++)e.push(Number("1e"+n));const t=323;return function(n){return e[n+t]}}(),on=[2,Math.E,3,4,5,6,7,8,9,10],as=[[1,1.0891180521811203,1.1789767925673957,1.2701455431742086,1.3632090180450092,1.4587818160364217,1.5575237916251419,1.6601571006859253,1.767485818836978,1.88041920
|
||
|
`,e),await dn(In())}}function In(){const e=ai(),t=Er({id:e});return dt(t),re.saves.push(e),t}function ai(){let e,t=0;do e=`${fe.id}-${t++}`;while(localStorage.getItem(e)!=null);return e}const Is=B(!1);async function dn(e){console.info("Loading save",e),Is.value=!0;const{layers:t,removeLayer:n,addLayer:i}=await zn(()=>Promise.resolve().then(function(){return Js}),void 0),{fixOldSave:r,getInitialLayers:a}=await zn(()=>Promise.resolve().then(function(){return wf}),void 0);for(const l in t){const u=t[l];u&&n(u)}a(e).forEach(l=>i(l,e)),e=Er(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,fe.offlineLimit*3600)),e.time=Date.now(),e.modVersion!==fe.versionNumber&&(r(e.modVersion,e),e.modVersion=fe.versionNumber),Object.assign(Q,e),re.active=Q.id,He.emit("onLoad")}setInterval(()=>{Q.autosave&&dt()},1e3);window.onbeforeunload=()=>{Q.autosave&&dt()};window.save=dt;const xs=window.hardReset=async()=>{await dn(In())};window.deleteLowerSaves=()=>{const e=Object.values(re.saves).indexOf(Q.id)+1;Object.values(re.saves).slice(e).forEach(t=>localStorage.removeItem(t)),re.saves=re.saves.slice(0,e)};const Hn=mn({active:"",saves:[],showTPS:!0,theme:Vi.Nordic,unthrottled:!1,alignUnits:!1});pt(Hn,e=>{const t=Qt.compressToUTF16(JSON.stringify(e));localStorage.setItem(fe.id,t)},{deep:!0});var re=window.settings=Hn;window.hardResetSettings=()=>{const e={active:"",saves:[],showTPS:!0,theme:Vi.Nordic,alignUnits:!1};He.emit("loadSettings",e),Object.assign(Hn,e),xs()};function $s(){try{let e=localStorage.getItem(fe.id);if(e!=null&&e!==""){if(e[0]!=="{")if(e[0]==="e")e=decodeURIComponent(escape(atob(e)));else if(e[0]==="\u1BE1")e=Qt.decompressFromUTF16(e);else{console.warn("Unable to determine settings encoding",e);return}const t=JSON.parse(e);typeof t=="object"&&Object.assign(Hn,t)}He.emit("loadSettings",Hn)}catch{}}const Pr=mn([]);function Es(e){Pr.push(e)}const Ps=mn([]),Ts=mn([]),Ds={class:"table"},As=J({__name:"Column",setup(e){const t=C(()=>wt[re.theme].mergeAdjacent);return(n,i)=>(M(),P("div",Ds,[_("div",{class:pe(["col",{mergeAdjacent:s(t)}])},[Pt(n.$slots,"default")],2)]))}}),Fs={class:"table"},Os=J({__name:"Row",setup(e){const t=C(()=>wt[re.theme].mergeAdjacent);return(n,i)=>(M(),P("div",Fs,[_("div",{class:pe(["row",{mergeAdjacent:s(t)}])},[Pt(n.$slots,"default")],2)]))}});function Tr(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!pa(e)}function se(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 nt(e){if(St(e))return typeof e=="function"?e():se(e);const t=e[ht];return p(t,e[ot](),null)}function $i(...e){let t;return p(Os,null,Tr(t=e.map(nt))?t:{default:()=>[t]})}function Rs(...e){let t;return p(As,null,Tr(t=e.map(nt))?t:{default:()=>[t]})}function Nt(e){if(St(e))return typeof e=="function"?e():typeof e=="string"?p(ne,null,[e]):p(e,null,null);const t=e[ht];return p(t,e[ot](),null)}function fr(e,t){return e.reduce((n,i)=>p(ne,null,[n,t,i]))}function St(e){return typeof e=="string"?!0:typeof e=="object"?e==null?!1:"render"in e||"component"in e:typeof e=="function"&&e[Gn]===!0}function Dr(e,t){const n=B(null),i=B(void 0);function r(u){n.value||(n.value=setInterval(l,250)),i.value=u}function a(){n.value&&(clearInterval(n.value),n.value=null)}function l(){t&&t.value?t.value():e&&e.value&&e.value(i.value)}return _r(a),{start:r,stop:a,handleHolding:l}}function Ar(e,t="div"){const n=gt();return _t(()=>{n.value=se(Me(e),t)}),n}function Pn(e,t="div"){const n=gt(null);return _t(()=>{const i=Me(e);n.value=i==""||i==null?null:se(i,t)}),n}function Me(e){return s(s(e))}function R(...e){return e.includes(Object)||e.push(Object),e}function pr(e){const t=B(!1),n=e[ot].bind(e);return e[ot]=()=>({...n(),onPointerenter:()=>t.value=!0,onPointerleave:()=>t.value=!1}),t}var ue=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const qs=J({__name:"Context",emits:["
|
||
|
`).slice(3,5).map(n=>n.trim()).join(`
|
||
|
`))!=null?t:""}function gr(e,t){var n;if(o.isNaN(t))throw Be.hasNaN||(Q.autosave=!1,Be.hasNaN=!0,Be.NaNPath=e[fn],Be.NaNPersistent=e),console.error("Attempted to save NaN value to",(n=e[fn])==null?void 0:n.join("."),e),new Error("Attempted to set NaN value. See above for details");e[tn].value=t}function ft(e,t=!0){const n=De(e)?e:B(e);De(e)&&(e=e.value);const i=C({get(){return n.value},set(a){t?gr(r,a):r[tn].value=a}});i[rn]=e;const r={get value(){return n.value},set value(a){t?gr(r,a):r[tn].value=a},__v_isRef:!0,[tn]:n,[rn]:e,[li]:Ws(),[ui]:!1,[Et]:i,[fn]:void 0};return st.length===0?console.warn("Creating a persistent ref outside of a layer. This is not officially supported",r,`
|
||
|
Created at:
|
||
|
`+r[li]):gn[st[st.length-1]].add(r),r}function Hs(e){return e!=null&&typeof e=="object"&&tn in e}function Nn(e){return!(Kt in e)&&Et in e?e[Et]:new Proxy(e,{get(t,n){if(n!==tn)return n===Oi?!0:t[n]},set(t,n,i){return t[n]=i,!0},has(t,n){return n===tn?!1:n==Oi?!0:Reflect.has(t,n)}})}function Or(e){st.length===0?console.warn("Deleting a persistent ref outside of a layer. Ignoring...",e):gn[st[st.length-1]].delete(e),e[ui]=!0}He.on("addLayer",(e,t)=>{const n=[],i=(r,a=[])=>{let l=!1;return Object.keys(r).forEach(u=>{let c=r[u];if(c!=null&&typeof c=="object"){if(c[Oi]===!0)return;if(Kt in c&&(c=c[Kt]),Hs(c)){if(l=!0,c[ui]){console.warn("Deleted persistent ref present in returned object. Ignoring...",c,`
|
||
|
Created at:
|
||
|
`+c[li]);return}gn[e.id].delete(c);const d=[e.id,...a,u];c[fn]!=null&&JSON.stringify(d)!==JSON.stringify(c[fn])&&console.error(`Persistent ref is being saved to \`${d.join(".")}\` when it's already present at \`${c[fn].join(".")}\`. This can cause unexpected behavior when loading saves between updates.`,c),c[fn]=d;const m=a.reduce((v,w)=>(w in v||(v[w]={}),v[w]),t),f=m[u];m[u]=c[tn],va(m)?f!=null?m[u]=f:m[u]=c[rn]:f!=null?m[u].value=f:m[u].value=c[rn]}else!(c instanceof o)&&!De(c)&&!n.includes(c)&&(typeof c.type=="symbol"&&n.push(c),i(c,[...a,u])&&(Tt(c)&&!Tt(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.",Kt in r?r[Kt]:r,u):l=!0))}}),l};i(e[Kt]),gn[e.id].forEach(r=>{r[ui]||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[li])}),gn[e.id].clear()});const Bi=Symbol("RegisterNode"),Li=Symbol("UnregisterNode"),ji=Symbol("Nodes"),zi=Symbol("Bounds"),be=qi({});window.layers=be;const gn={},st=[];function Ui(e,t){return Ze(()=>{const n={},i=n.emitter=Nr();if(n.on=i.on.bind(i),n.emit=i.emit.bind(i),n.nodes=B({}),n.id=e,st.push(e),gn[e]=new Set,n.minimized=ft(!1,!1),Object.assign(n,t.call(n,n)),st[st.length-1]==null||st[st.length-1]!==e)throw`Adding layers stack in invalid state. This should not happen
|
||
|
Stack: ${st}
|
||
|
Trying to pop ${n.id}`;st.pop(),x(n,"color"),x(n,"display"),x(n,"classes"),x(n,"style"),x(n,"name"),ie(n,"name",n.id),x(n,"minWidth"),ie(n,"minWidth",600),x(n,"minimizable"),ie(n,"minimizable",!0),x(n,"minimizedDisplay");const r=n.style;return n.style=C(()=>{var l,u;let a=s(n.minWidth);return(typeof a=="number"||!Number.isNaN(parseInt(a)))&&(a=a+"px"),[(l=s(r))!=null?l:"",(u=n.minimized)!=null&&u.value?{flexGrow:"0",flexShrink:"0",width:"60px",minWidth:"",flexBasis:"",margin:"0"}:{flexGrow:"",flexShrink:"",width:"",minWidth:a,flexBasis:a,margin:""}]}),n})}function Gi(e,t){if(console.info("Adding layer",e.id),be[e.id]){console.error("Attempted to add layer with same ID as existing layer",e.id,be[e.id]);return}ie(t,"layers",{}),t.layers[e.id]==null&&(t.layers[e.id]={}),be[e.id]=e,He.emit("addLayer",e,t.layers[e.id])}function Zs(e){return be[e]}function Rr(e){console.info("Removing layer",e.id),He.emit("removeLayer",e),be[e.id]=void 0}function Ys(e){Rr(e),Gi(e,Q)}function Xs(e){const t=B(!1);return{openModal:()=>t.value=!0,modal:K(()=>p(Ut,{modelValue:t.value,"onUpdate:modelValue":n=>t.value=n},{header:()=>p("h2",null,[s(e.name)]),body:s(e.display)}))}}He.on("update",function(t){Object.values(be).forEach(n=>{n==null||n.emit("preUpdate",t)}),Object.values(be).forEach(n=>{n==null||n.emit("update",t)}),Object.values(be).forEach(n=>{n==null||n.emit("postUpdate",t)})});var Js=Object.freeze(Object.defineProperty({__proto__:null,RegisterNodeInjectionKey:Bi,UnregisterNodeInjectionKey:Li,NodesInjectionKey:ji,BoundsInjectionKey:zi,layers:be,persistentRefs:gn,addingLayers:st,createLayer:Ui,addLayer:Gi,getLayer:Zs,removeLayer:Rr,reloadLayer:Ys,setupLayerModal:Xs},Symbol.toStringTag,{value:"Module"}));const Ks=J({components:{Context:Fr},props:{index:{type:Number,required:!0},display:{type:R(Object,String,Function),required:!0},minimizedDisplay:R(Object,String,Function),minimized:{type:Object,required:!0},name:{type:R(String),required:!0},color:R(String),minimizable:R(Boolean),nodes:{type:Object,required:!0}},emits:["setMinimized"],setup(e){const{display:t,index:n,minimized:i,minimizedDisplay:r}=$e(e),a=Ar(t),l=Pn(r),u=C(()=>fe.allowGoBack&&n.value>0&&!Me(i));function c(){Q.tabs.splice(s(e.index),1/0)}function d(m){e.nodes.value=m}return{component:a,minimizedComponent:l,showGoBack:u,updateNodes:d,unref:s,goBack:c}}}),Qs={key:1};function eo(e,t,n,i,r,a){const l=Ct("Context");return M(),P("div",{class:"layer-container",style:Re({"--layer-color":e.unref(e.color)})},[e.showGoBack?(M(),P("button",{key:0,class:"goBack",onClick:t[0]||(t[0]=(...u)=>e.goBack&&e.goBack(...u))},"\u274C")):L("",!0),e.unref(e.minimized)?(M(),P("button",{key:1,class:"layer-tab minimized",onClick:t[1]||(t[1]=u=>e.$emit("setMinimized",!1))},[e.minimizedComponent?(M(),ee(We(e.minimizedComponent),{key:0})):(M(),P("div",Qs,ae(e.unref(e.name)),1))])):(M(),P("div",{key:2,class:pe(["layer-tab",{showGoBack:e.showGoBack}])},[p(l,{onUpdateNodes:e.updateNodes},{default:W(()=>[(M(),ee(We(e.component)))]),_:1},8,["onUpdateNodes"])],2)),e.unref(e.minimizable)?(M(),P("button",{key:3,class:"minimize",onClick:t[2]||(t[2]=u=>e.$emit("setMinimized",!0))}," \u25BC ")):L("",!0)],4)}var to=ue(Ks,[["render",eo],["__scopeId","data-v-72dd78b1"]]);const qr=e=>(hn("data-v-4b4bda40"),e=e(),bn(),e),no=qr(()=>_("h2",null,"Changelog",-1)),io=qr(()=>_("details",{open:""},[_("summary",null,[$("v0.0 Initial Commit - "),_("time",null,"2021-09-04")]),$(" This is the first release :D "),_("ul",null,[_("li",{class:"feature"},"Did everything"),_("li",{class:"fix"},"Had some fun"),_("li",{class:"breaking"},"Removed everything"),_("li",{class:"balancing"},"Created some bugs to fix later")])],-1)),ro=J({__name:"Changelog",setup(e,{expose:t}){const n=B(!1);return t({open(){n.value=!0}}),(i,r)=>(M(),ee(Ut,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=a=>n.value=a)},{header:W(()=>[no]),body:W(()=>[io]),_:1},8,["modelValue"]))}});var ao=ue(ro,[["__scopeId","data-v-4b4bda40"]]),so=J({props:{element:Object,display:{type:R(Object,String,Function),required:!0},style:R(Object,String,Array),classes:R(Object),di
|
||
|
${V}
|
||
|
${E}`)}}return d[S]}pt(n,S=>{S&&Object.keys(d).forEach(E=>delete d[E])});const f=C(()=>re.saves.reduce((S,E)=>(S[E]=m(E),S),{}));function v(S){let E;switch(Q.id===S?E=$r(Q):E=JSON.stringify(f.value[S]),fe.exportEncoding){default:console.warn(`Unknown save encoding: ${fe.exportEncoding}. Defaulting to lz`);case"lz":E=Qt.compressToUTF16(E);break;case"base64":E=btoa(unescape(encodeURIComponent(E)));break;case"plain":break}const V=document.createElement("textarea");V.value=E,document.body.appendChild(V),V.select(),V.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(V)}function w(S){Q.id===S&&dt();const E={...f.value[S],id:ai()};dt(E),re.saves.push(E.id)}function b(S){re.saves=re.saves.filter(E=>E!==S),localStorage.removeItem(S),d[S]=void 0}function h(S){f.value[Q.id].time=Q.time,dt(),d[Q.id]=void 0,dn(f.value[S]),d[S]=void 0}function I(S){if(l.value=S,jt(()=>{l.value=null}),S[0]!=="{")if(S[0]==="e")S=decodeURIComponent(escape(atob(S)));else if(S[0]==="\u1BE1")S=Qt.decompressFromUTF16(S);else{console.warn("Unable to determine preset encoding",S);return}const E=JSON.parse(S);E.id=ai(),dt(E),re.saves.push(E.id),h(E.id)}function F(S,E){const V=f.value[S];V!=null&&(V.name=E,Q.id===S?(Q.name=E,dt()):(dt(V),d[S]=void 0))}return(S,E)=>(M(),ee(Ut,{modelValue:n.value,"onUpdate:modelValue":E[4]||(E[4]=V=>n.value=V),ref_key:"modal",ref:i},{header:W(()=>[pl]),body:W(({shown:V})=>[V?(M(),ee(s(Ca),{key:0,list:s(re).saves,handle:".handle",itemKey:ce=>ce},{item:W(({element:ce})=>[p(fl,{save:s(f)[ce],onOpen:H=>h(ce),onExport:H=>v(ce),onEditName:H=>F(ce,H),onDuplicate:H=>w(ce),onDelete:H=>b(ce)},null,8,["save","onOpen","onExport","onEditName","onDuplicate","onDelete"])]),_:1},8,["list","itemKey"])):L("",!0)]),footer:W(()=>[_("div",gl,[p(Br,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=V=>a.value=V),title:"Import Save",placeholder:"Paste your save here!",class:pe({importingFailed:r.value})},null,8,["modelValue","class"]),_("div",ml,[vl,_("div",hl,[_("button",{class:"button",onClick:E[1]||(E[1]=V=>h(s(In)().id))},"New Game"),Object.keys(s(c)).length>0?(M(),ee(Wi,{key:0,options:s(c),modelValue:l.value,"onUpdate:modelValue":E[2]||(E[2]=V=>I(V)),closeOnSelect:"",placeholder:"Select preset",class:"presets"},null,8,["options","modelValue"])):L("",!0)])]),_("div",bl,[yl,_("button",{class:"button modal-default-button",onClick:E[3]||(E[3]=V=>n.value=!1)}," Close ")])])]),_:1},8,["modelValue"]))}});var Lr=ue(wl,[["__scopeId","data-v-2a4275be"]]);const bt=e=>(hn("data-v-318a1c31"),e=e(),bn(),e),_l=["src","alt"],Nl={key:1,class:"title"},Cl=bt(()=>_("div",{style:{"flex-grow":"1",cursor:"unset"}},null,-1)),kl={class:"discord"},Ml={class:"discord-links"},Sl={key:0},Il=["href"],xl=bt(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),$l=bt(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),El={href:"https://forums.moddingtree.com/",target:"_blank"},Pl=bt(()=>_("span",{class:"material-icons"},"forum",-1)),Tl=bt(()=>_("span",{class:"material-icons"},"info",-1)),Dl=bt(()=>_("span",{class:"material-icons"},"library_books",-1)),Al=bt(()=>_("span",{class:"material-icons"},"settings",-1)),Fl=bt(()=>_("span",{class:"material-icons"},"library_books",-1)),Ol=bt(()=>_("span",{class:"material-icons"},"settings",-1)),Rl=bt(()=>_("span",{class:"material-icons"},"info",-1)),ql={href:"https://forums.moddingtree.com/",target:"_blank"},Vl=bt(()=>_("span",{class:"material-icons"},"forum",-1)),Bl={class:"discord"},Ll={class:"discord-links"},jl={key:0},zl=["href"],Ul=bt(()=>_("li",null,[_("a",{href:"https://discord.gg/yJ4fjnjU54",target:"_blank"},"The Paper Pilot Community")],-1)),Gl=bt(()=>_("li",null,[_("a",{href:"https://discord.gg/F3xveHV",target:"_blank"},"The Modding Tree")],-1)),Wl=J({__name:"Nav",setup(e){const t=B(null),n=B(null),i=B(null),r=B(null),{useHeader:a,banner:l,title:u,discordName:c,discordLink:d,versionNumber:m}=fe;function f(){window.open(d,"mywindow")}return(v,w)=>(M(),P(ne,null,[s(a)?(M(),P("div",zt({key:0,c
|
||
|
${(-s(r)-30)*Math.sin(((e.actions.length-1)/2-w)*s(u))},
|
||
|
${(s(r)+30)*Math.cos(((e.actions.length-1)/2-w)*s(u))}
|
||
|
)`,onMousedown:I=>c(I,v),onTouchstart:I=>c(I,v),onMouseup:I=>d(I,v),onTouchend:xn(I=>d(I,v),["stop"])},[_("circle",{fill:s(de)(v.fillColor,e.node),r:"20","stroke-width":((h=e.selectedAction)==null?void 0:h.id)===v.id?4:0,stroke:s(a)},null,8,nu),_("text",{fill:s(l),class:"material-icons"},ae(s(de)(v.icon,e.node)),9,iu)],42,tu)}),128))])):L("",!0)]),_:1}))}});var au=ue(ru,[["__scopeId","data-v-9efb2a56"]]);const su=["transform"],ou={key:0},lu=["r","fill","stroke"],uu=["r","fill","stroke"],cu=["r","fill"],du=["r","stroke-dasharray","stroke-dashoffset","stroke"],fu={key:1,transform:"rotate(45, 0, 0)"},pu=["width","height","transform","fill","stroke"],gu=["width","height","transform","fill","stroke"],mu=["width","height","transform","fill"],vu=["width","height","transform","stroke-dasharray","stroke-dashoffset","stroke"],hu=["fill","y"],bu=["fill"],yu={key:0},wu=["fill","y"],_u=["fill","y"],Nu=J({__name:"BoardNode",props:{node:null,nodeType:null,dragging:null,dragged:null,hasDragged:{type:Boolean},receivingNode:{type:Boolean},selectedNode:null,selectedAction:null},emits:["mouseDown","endDragging","clickAction"],setup(e,{emit:t}){const n=e,i=Math.sqrt(2),r=$e(n),a=C(()=>s(r.selectedNode)===s(r.node)),l=C(()=>de(r.nodeType.value.draggable,s(r.node)));pt(l,Y=>{const Ce=s(r.node);s(r.dragging)===Ce&&!Y&&t("endDragging",Ce)});const u=C(()=>{var Ce;const Y=s(r.node);return(Ce=de(r.nodeType.value.actions,Y))==null?void 0:Ce.filter(Qe=>Le(de(Qe.visibility,Y)))}),c=C(()=>{var Ce;const Y=s(r.node);if(de(r.nodeType.value.draggable,Y)&&((Ce=s(r.dragging))==null?void 0:Ce.id)===Y.id&&s(r.dragged)!=null){const{x:Qe,y:kt}=s(r.dragged);return{x:Y.position.x+Math.round(Qe/25)*25,y:Y.position.y+Math.round(kt/25)*25}}return Y.position}),d=C(()=>de(r.nodeType.value.shape,s(r.node))),m=C(()=>de(r.nodeType.value.title,s(r.node))),f=C(()=>de(r.nodeType.value.subtitle,s(r.node))),v=C(()=>{var Y;return(Y=a.value?s(r.selectedAction)&&de(s(r.selectedAction).tooltip,s(r.node)):null)!=null?Y:de(r.nodeType.value.label,s(r.node))}),w=C(()=>{var Y,Ce;return de((Ce=(Y=s(r.selectedAction))==null?void 0:Y.confirmationLabel)!=null?Ce:{text:"Tap again to confirm"},s(r.node))}),b=C(()=>de(r.nodeType.value.size,s(r.node))),h=C(()=>{var Y;return(Y=de(r.nodeType.value.progress,s(r.node)))!=null?Y:0}),I=C(()=>wt[re.theme].variables["--background"]),F=C(()=>{var Y;return(Y=de(r.nodeType.value.outlineColor,s(r.node)))!=null?Y:wt[re.theme].variables["--outline"]}),S=C(()=>{var Y;return(Y=de(r.nodeType.value.fillColor,s(r.node)))!=null?Y:wt[re.theme].variables["--raised-background"]}),E=C(()=>de(r.nodeType.value.progressColor,s(r.node))),V=C(()=>{var Y;return(Y=de(r.nodeType.value.titleColor,s(r.node)))!=null?Y:wt[re.theme].variables["--foreground"]}),ce=C(()=>de(r.nodeType.value.progressDisplay,s(r.node))),H=C(()=>r.dragging.value!=null&&s(r.hasDragged)&&de(r.nodeType.value.canAccept,s(r.node),r.dragging.value)),z=C(()=>de(r.nodeType.value.style,s(r.node))),U=C(()=>de(r.nodeType.value.classes,s(r.node)));function qe(Y){t("mouseDown",Y,r.node.value,l.value)}function Ke(Y){var Ce,Qe,kt;(Ce=r.hasDragged)!=null&&Ce.value||(t("endDragging",r.node.value),(kt=(Qe=r.nodeType.value).onClick)==null||kt.call(Qe,r.node.value),Y.stopPropagation())}return(Y,Ce)=>{var Qe,kt,Ht;return M(),P("g",{class:pe(["boardnode",{[e.node.type]:!0,isSelected:s(a),isDraggable:s(l),...s(U)}]),style:Re([{opacity:((Qe=e.dragging)==null?void 0:Qe.id)===e.node.id&&e.hasDragged?.5:1},(kt=s(z))!=null?kt:[]]),transform:`translate(${s(c).x},${s(c).y})${s(a)?" scale(1.2)":""}`},[p(au,{actions:(Ht=s(u))!=null?Ht:[],"is-selected":s(a),node:e.node,"node-type":e.nodeType,"selected-action":e.selectedAction,onClickAction:Ce[0]||(Ce[0]=Ue=>t("clickAction",Ue))},null,8,["actions","is-selected","node","node-type","selected-action"]),_("g",{class:"node-container",onMousedown:qe,onTouchstartPassive:qe,onMouseup:Ke,onTouchendPassive:Ke},[s(d)===s(ze).Circle?(M(),P("g",ou,[s(H)?(M(),P("circle",{key:0,class:"receiver",r:s(b)+8,fill:s(I),stroke:e.receivingNode?"#0F0":"#0F03","stroke-width":2},null,8,lu)
|
||
|
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 Ss();const{globalBus:e}=await zn(()=>Promise.resolve().then(function(){return ks}),void 0),{startGameLoop:t}=await zn(()=>import("./gameLoop.87edf988.js"),["assets/gameLoop.87edf988.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=_a(Hf);e.emit("setupVue",n),n.mount("#app"),jt(()=>{const i=gi(),{updateServiceWorker:r}=Yf({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,zn as _,Be as a,fe as b,wf as c,He as g,Is as l,Q as p,re as s};
|