diff --git a/dist/assets/index-BGsgtkNi.js b/dist/assets/index-D87AMfy0.js similarity index 99% rename from dist/assets/index-BGsgtkNi.js rename to dist/assets/index-D87AMfy0.js index 4e18b1d..b62191e 100644 --- a/dist/assets/index-BGsgtkNi.js +++ b/dist/assets/index-D87AMfy0.js @@ -1,2 +1,2 @@ -var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-C2X4Q0zX.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-C2X4Q0zX.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` +var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-DaC3oTyd.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-DaC3oTyd.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` ${n}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof ht){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,n,s){const i=new ht(t);i.dispose=()=>{var o;if(!(this.cache.assetsRefCount[n]<=0)){this.disposeAssetInternal(n);for(const r of i.pages)(o=r.texture)==null||o.dispose()}};for(const o of i.pages){const r=this.texturePath(e,o.name,s);this.texturePmaInfo[this.pathPrefix+r]=o.pma}return i}createTexture(t,e,n){const s=this.textureLoader(n,e),i=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(t)&&i()},s}texturePath(t,e,n){return n?n[e]:t+e}}const nt=class nt{constructor(){T(this,"assets",{});T(this,"assetsRefCount",{});T(this,"assetsLoaded",{})}static getCache(t){const e=nt.AVAILABLE_CACHES.get(t);if(e)return e;const n=new nt;return nt.AVAILABLE_CACHES.set(t,n),n}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};T(nt,"AVAILABLE_CACHES",new Map);let lt=nt;class bt{constructor(){T(this,"callbacks",{});T(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),n=e.length,s=new Uint8Array(n);for(let i=0;i{this.finish(t,i.status,i.responseText)};i.onload=o,i.onerror=o,i.send()}downloadJson(t,e,n){this.downloadText(t,s=>{e(JSON.parse(s))},n)}downloadBinary(t,e,n){if(this.start(t,e,n))return;const s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(s))}catch(r){this.finish(t,400,JSON.stringify(r))}return}const i=new XMLHttpRequest;i.open("GET",s||t,!0),i.responseType="arraybuffer";const o=()=>{this.finish(t,i.status,i.response)};i.onload=()=>{i.status===200||i.status===0?this.finish(t,200,new Uint8Array(i.response)):o()},i.onerror=o,i.send()}start(t,e,n){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,n)}}finish(t,e,n){const s=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let i=0,o=s.length;iD.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const n=this.boundingBoxes,s=this.polygons,i=this.polygonPool,o=t.slots,r=o.length;n.length=0,i.freeAll(s),s.length=0;for(let l=0;l=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,n,s){const i=this.minX,o=this.minY,r=this.maxX,l=this.maxY;if(t<=i&&n<=i||e<=o&&s<=o||t>=r&&n>=r||e>=l&&s>=l)return!1;const c=(s-e)/(n-t);let a=c*(i-t)+e;if(a>o&&ao&&ai&&hi&&ht.minX&&this.minYt.minY}containsPoint(t,e){const n=this.polygons;for(let s=0,i=n.length;s=n||a=n){const h=s[l];h+(n-c)/(a-c)*(s[o]-h)=h&&f<=A||f>=A&&f<=h)&&(f>=e&&f<=s||f>=s&&f<=e)){const x=(a*L-c*g)/C;if((x>=m&&x<=u||x>=u&&x<=m)&&(x>=n&&x<=i||x>=i&&x<=n))return!0}h=A,m=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");const e=this.boundingBoxes.indexOf(t);return e===-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class z{constructor(){T(this,"convexPolygons",[]);T(this,"convexPolygonsIndices",[]);T(this,"indicesArray",[]);T(this,"isConcaveArray",[]);T(this,"triangles",[]);T(this,"polygonPool",new at(()=>[]));T(this,"polygonIndicesPool",new at(()=>[]))}triangulate(t){const e=t;let n=t.length>>1;const s=this.indicesArray;s.length=0;for(let r=0;r3;){let r=n-1,l=0,c=1;for(;;){t:if(!i[l]){const m=s[r]<<1,y=s[l]<<1,A=s[c]<<1,u=e[m],g=e[m+1],b=e[y],L=e[y+1],C=e[A],f=e[A+1];for(let x=c+10);r=l>0?l-1:n-1,c=l+10?l-1:n-1,h=l0&&(s.push(r),i.push(o),r=this.polygonPool.obtain(),o=this.polygonIndicesPool.obtain()),r.length=0,r.push(u,g,b,L),r.push(C,f),o.length=0,o.push(m,y,A),c=z.winding(u,g,b,L,C,f),l=m}r.length>0&&(s.push(r),i.push(o));for(let a=0,h=s.length;a=0;a--)r=s[a],r.length===0?(s.splice(a,1),this.polygonPool.free(r),o=i[a],i.splice(a,1),this.polygonIndicesPool.free(o)):r.push(r[0],r[1]);return s}static isConcave(t,e,n,s){const i=s[t>0?t-1:e-1]<<1,o=s[t]<<1,r=s[t+1=0}static winding(t,e,n,s,i,o){return t*(o-s)+n*(e-o)+i*(s-e)>=0?1:-1}}class wt{constructor(){T(this,"triangulator",null);T(this,"clippingPolygon",[]);T(this,"clippingPolygons",[]);T(this,"clipOutput",[]);T(this,"clippedVertices",[]);T(this,"clippedUVs",[]);T(this,"clippedTriangles",[]);T(this,"inverseVertices",[]);T(this,"_clippedVerticesTyped",new Float32Array(1024));T(this,"_clippedUVsTyped",new Float32Array(1024));T(this,"_clippedTrianglesTyped",new Uint16Array(1024));T(this,"clippedVerticesTyped",new Float32Array(0));T(this,"clippedUVsTyped",new Float32Array(0));T(this,"clippedTrianglesTyped",new Uint16Array(0));T(this,"clippedVerticesLength",0);T(this,"clippedUVsLength",0);T(this,"clippedTrianglesLength",0);T(this,"scratch",[]);T(this,"inverse",!1);T(this,"clipAttachment",null)}clipStart(t,e,n){if(this.clipAttachment)return;const s=n.worldVerticesLength;this.clipAttachment=n,this.inverse=n.inverse;const i=D.setArraySize(this.clippingPolygon,s);n.computeWorldVertices(t,e,0,s,i,0,2);const o=this.clippingPolygon,r=this.makeClockwise(o);r||this.inverse||n.convex?(r||this.makeConvex(o),this.clippingPolygon.push(o[0],o[1]),this.clippingPolygons.push(o)):(this.triangulator===null&&(this.triangulator=new z),this.clippingPolygons.push(...this.triangulator.decompose(o,this.triangulator.triangulate(o))))}clipEnd(t){this.clipAttachment&&(t&&this.clipAttachment.endSlot!==t.data||(this.clipAttachment=null,this.clippingPolygons.length=0))}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,n,s,i,o,r,l){return s&&i&&o&&typeof r=="boolean"&&typeof l=="number"?this.clipTrianglesRender(t,e,n,s,i,o,r,l):this.clipTrianglesNoRender(t,e,n)}clipTrianglesNoRender(t,e,n){const s=this.clippedVertices;s.length=0;const i=this.clippedTriangles;i.length=0;let o=0;if(this.inverse){const h=this.clippingPolygons[0];for(let m=0;m>1,I=s.length;const R=D.setArraySize(s,I+P);D.arrayCopy(f,x,R,I,P),I=i.length;const v=D.setArraySize(i,I+3*(M-2));for(let V=1;V>1;const P=D.setArraySize(s,f+x);D.arrayCopy(a,0,P,f,x),f=i.length;const M=D.setArraySize(i,f+3*(S-2));S--;for(let I=1;I>1;let F=c.length;const N=D.setArraySize(c,F+G*l);for(let X=0;X>1;q===0&&(U=P-v,O=R-S,B=L-R,K=v-C,q=1/(U*B-O*K));const E=D.setArraySize(c,d+_*l);for(let Y=0;Y>1;let Y=this.clippedVerticesLength;const G=Y+k*o,F=this.clippedUVsLength+k*2;r.length>1;J===0&&(O=M-V,B=v-P,K=L-v,q=V-C,J=1/(O*K-B*q));const k=p+E*o;r.length=2?(a=this.clipOutput,h=this.scratch):(a=this.scratch,h=this.clipOutput);const m=r;a.length=8;const y=a;y[0]=t,y[1]=e,y[2]=n,y[3]=s,y[4]=i,y[5]=o,y[6]=t,y[7]=e,h.length=0;const A=r.length-4;for(let u=0;;u+=2){const g=m[u],b=m[u+1],L=g-m[u+2],C=b-m[u+3],f=h.length,x=a;t=x[0],e=x[1];let S=C*(g-t)-L*(b-e);for(let M=2,I=a.length-2;M<=I;M+=2){n=x[M],s=x[M+1];const R=C*(g-n)-L*(b-s);if(S>0)if(R>0)h.push(n,s);else{const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w),c=!0):h.push(n,s)}else if(R>0){const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w,n,s),c=!0):h.push(n,s)}else c=!0;t=n,e=s,S=R}if(f===h.length)return l.length=0,!0;if(h.push(h[0],h[1]),u===A)break;const P=h;h=a,h.length=0,a=P}if(l!==h){l.length=0;for(let u=0,g=h.length-2;u=2?(c=this.clipOutput,a=this.scratch):(c=this.scratch,a=this.clipOutput),c.length=8;let h=r,m=c;m[0]=t,m[1]=e,m[2]=n,m[3]=s,m[4]=i,m[5]=o,m[6]=t,m[7]=e,a.length=0;for(let y=0;;y+=2){const A=h[y],u=h[y+1],g=A-h[y+2],b=u-h[y+3],L=a.length,C=this.inverseVertices.length;this.inverseVertices.push(0),m=c,t=m[0],e=m[1];let f=b*(A-t)-g*(u-e);for(let P=2,M=c.length-2;P<=M;P+=2){n=m[P],s=m[P+1];const I=b*(A-n)-g*(u-s);if(f>0)if(I>0)a.push(n,s);else{const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;a.push(w,U),this.inverseVertices.push(w,U,n,s)}else a.push(n,s)}else if(I>0){const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;this.inverseVertices.push(w,U),a.push(w,U,n,s)}else a.push(n,s)}else this.inverseVertices.push(n,s);t=n,e=s,f=I}const x=this.inverseVertices.length-C-1;if(x>=6?this.inverseVertices[C]=x:this.inverseVertices.length=C,L===a.length||(a.push(a[0],a[1]),y===l))break;const S=a;a=c,a.length=0,c=S}}makeClockwise(t){const e=t,n=t.length;let s=!0,i=!0,o=0,r=e[n-2],l=e[n-1],c=e[0],a=e[1];for(let m=2;m=0,r=c,l=a,c=y,a=A}o+=c*e[1]-e[0]*a;const h=(c-r)*(e[1]-a)-(a-l)*(e[0]-c);if(i=i&&h<=0,s=s&&h>=0,o>=0){for(let m=0,y=n-2,A=n>>1;m=0&&(s[a]>l||s[a]===l&&s[a+1]>c);a-=2)s[a+2]=s[a],s[a+3]=s[a+1];s[a+2]=l,s[a+3]=c}n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3];let i=4;for(let r=4;r=0&&(i-=2,i!==2););n[i]=l,n[i+1]=c}n[i]=s[e-4],n[i+1]=s[e-3];const o=i;i+=2;for(let r=e-6;r>=0;r-=2,i+=2){const l=s[r],c=s[r+1];for(;(n[i-2]-n[i-4])*(c-n[i-3])-(n[i-1]-n[i-3])*(l-n[i-4])>=0&&(i-=2,i!==o););n[i]=l,n[i+1]=c}t.length=i-2}}class St{constructor(t,e,n={}){T(this,"skeleton");T(this,"adapter");T(this,"positionInheritanceFactorX",0);T(this,"positionInheritanceFactorY",0);T(this,"rotationInheritanceFactor",0);T(this,"hasLastTransform",!1);T(this,"lastX",0);T(this,"lastY",0);T(this,"lastZ",0);T(this,"lastRotation",0);T(this,"currentTransform",{x:0,y:0,z:0,rotation:0});T(this,"currentPosition",{x:0,y:0,z:0});T(this,"lastPosition",{x:0,y:0,z:0});this.skeleton=t,this.adapter=e,this.positionInheritanceFactorX=n.positionInheritanceX??0,this.positionInheritanceFactorY=n.positionInheritanceY??0,this.rotationInheritanceFactor=n.rotationInheritance??0}get positionInheritanceX(){return this.positionInheritanceFactorX}get positionInheritanceY(){return this.positionInheritanceFactorY}setPositionInheritance(t,e){const n=this.positionInheritanceFactorX===0&&this.positionInheritanceFactorY===0,s=t!==0||e!==0;this.positionInheritanceFactorX=t,this.positionInheritanceFactorY=e,n&&s&&this.resetPosition()}get rotationInheritance(){return this.rotationInheritanceFactor}set rotationInheritance(t){const e=this.rotationInheritanceFactor===0;this.rotationInheritanceFactor=t,e&&t!==0&&this.resetRotation()}resetPosition(){const t=this.currentTransform,e=!this.hasLastTransform&&this.rotationInheritanceFactor!==0;this.adapter.readTransform(t,e),this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z,e&&(this.lastRotation=t.rotation),this.hasLastTransform=!0}resetRotation(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.lastRotation=t.rotation,this.hasLastTransform||(this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z),this.hasLastTransform=!0}resetTransform(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.setLastTransform(t.x,t.y,t.z,t.rotation)}applyTransformMovement(){const t=this.positionInheritanceFactorX!==0||this.positionInheritanceFactorY!==0,e=this.rotationInheritanceFactor!==0;if(!t&&!e)return;const n=this.currentTransform;this.adapter.readTransform(n,e);const{x:s,y:i,z:o}=n,r=e?n.rotation:this.lastRotation,l=s!==this.lastX||i!==this.lastY||o!==this.lastZ;if(this.hasLastTransform){if(!l&&r===this.lastRotation)return;t&&l&&this.applyPositionMovement(s,i,o),e&&r!==this.lastRotation&&this.applyRotationMovement(r)}this.setLastTransform(s,i,o,r)}applyPositionMovement(t,e,n){const s=this.currentPosition;s.x=t,s.y=e,s.z=n,this.adapter.worldToSkeleton(s);const i=this.lastPosition;i.x=this.lastX,i.y=this.lastY,i.z=this.lastZ,this.adapter.worldToSkeleton(i),this.skeleton.physicsTranslate((s.x-i.x)*this.positionInheritanceFactorX,(s.y-i.y)*this.positionInheritanceFactorY)}applyRotationMovement(t){const e=this.rotationInheritanceFactor;e!==0&&this.skeleton.physicsRotate(0,0,this.getRotationDelta(t,this.lastRotation)*e)}setLastTransform(t,e,n,s){this.lastX=t,this.lastY=e,this.lastZ=n,this.lastRotation=s,this.hasLastTransform=!0}getRotationDelta(t,e){let n=t-e;return n=(n+180)%360-180,n<-180?n+360:n}}class Mt{constructor(){T(this,"commandPool",new xt);T(this,"worldVertices",new Float32Array(12*1024));T(this,"quadIndices",new Uint16Array([0,1,2,2,3,0]));T(this,"clipping",new wt);T(this,"renderCommands",[])}render(t,e=!1,n,s=2,i=0){var c,a;this.commandPool.reset(),this.renderCommands.length=0;const o=this.clipping;let r=0;const l=t.drawOrder.appliedPose;for(let h=0,m=l.length;h>1;const w=u.sequence,U=w.resolveIndex(A);f=w.getUVs(U),x=u.triangles,S=x.length,M=(a=w.regions[U])==null?void 0:a.texture}else if(u instanceof rt){o.clipEnd(y),o.clipStart(t,y,u);continue}else{o.clipEnd(y);continue}if(!M){o.clipEnd(y);continue}const I=t.color;let R,v;if(e){let w;if(n){w=Math.floor(n[3]*I.a*g.a*P.a*255);const U=Math.floor(w*n[0]*I.r*g.r*P.r),O=Math.floor(w*n[1]*I.g*g.g*P.g),B=Math.floor(w*n[2]*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}else{w=Math.floor(I.a*g.a*P.a*255);const U=Math.floor(w*I.r*g.r*P.r),O=Math.floor(w*I.g*g.g*P.g),B=Math.floor(w*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}if(v=4278190080,A.darkColor){const{r:U,g:O,b:B}=A.darkColor;v=4278190080|Math.floor(U*w)<<16|Math.floor(O*w)<<8|Math.floor(B*w)}}else{if(n){const w=Math.floor(n[3]*I.a*g.a*P.a*255),U=Math.floor(n[0]*I.r*g.r*P.r*255),O=Math.floor(n[1]*I.g*g.g*P.g*255),B=Math.floor(n[2]*I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}else{const w=Math.floor(I.a*g.a*P.a*255),U=Math.floor(I.r*g.r*P.r*255),O=Math.floor(I.g*g.g*P.g*255),B=Math.floor(I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}if(v=0,A.darkColor){const{r:w,g:U,b:O}=A.darkColor;v=Math.floor(w*255)<<16|Math.floor(U*255)<<8|Math.floor(O*255)}}o.isClipping()&&(o.clipTrianglesUnpacked(L,0,x,S,f,s),L=o.clippedVerticesTyped,C=o.clippedVerticesLength/s,f=o.clippedUVsTyped,x=o.clippedTrianglesTyped,S=o.clippedTrianglesLength);const V=this.commandPool.getCommand(C,S,s);if(V.blendMode=y.data.blendMode,V.texture=M,V.positions.set(L.subarray(0,C*s)),s>=3)for(let w=2,U=C*s;w=t*n&&i._indices.length>=e){s=i;break}if(s)this.pool.splice(this.pool.indexOf(s),1),s.next=void 0,s.numVertices=t,s.numIndices=e,s.positions=s._positions.subarray(0,t*n),s.uvs=s._uvs.subarray(0,t<<1),s.colors=s._colors.subarray(0,t),s.darkColors=s._darkColors.subarray(0,t),s.indices=s._indices.subarray(0,e);else{const i=new Float32Array(t*n),o=new Float32Array(t<<1),r=new Uint32Array(t),l=new Uint32Array(t),c=new Uint16Array(e);s={positions:i,uvs:o,colors:r,darkColors:l,indices:c,_positions:i,_uvs:o,_colors:r,_darkColors:l,_indices:c,numVertices:t,numIndices:e,blendMode:Tt.Normal,texture:null}}return this.inUse.push(s),s}reset(){this.pool.push(...this.inUse),this.inUse.length=0}}export{Rt as ATTACH_RETAIN,Yt as ATTACH_SETUP,Ft as AlphaTimeline,Et as Animation,_t as AnimationState,Ot as AnimationStateAdapter,It as AnimationStateData,lt as AssetCache,Ct as AssetManagerBase,Vt as AtlasAttachmentLoader,kt as Attachment,Xt as AttachmentTimeline,Bt as BinaryInput,Tt as BlendMode,Nt as Bone,Dt as BoneData,$t as BonePose,zt as BoneTimeline1,Wt as BoneTimeline2,ut as BoundingBoxAttachment,qt as CURRENT,rt as ClippingAttachment,Gt as Color,Jt as Constraint,Ht as ConstraintData,Zt as ConstraintTimeline1,Kt as CurveTimeline,Qt as CurveTimeline1,jt as DebugUtils,te as DeformTimeline,bt as Downloader,ee as DrawOrder,se as DrawOrderFolderTimeline,ne as DrawOrderTimeline,ie as Event,oe as EventData,re as EventQueue,ae as EventTimeline,le as EventType,ce as FIRST,he as FakeTexture,pe as FromProperty,de as FromRotate,ue as FromScaleX,fe as FromScaleY,ge as FromShearY,me as FromX,ye as FromY,Te as HOLD,be as IkConstraint,we as IkConstraintData,xe as IkConstraintPose,Ae as IkConstraintTimeline,Pe as Inherit,Ie as InheritTimeline,Ce as IntSet,Ve as Interpolation,Le as MODE,Se as MathUtils,dt as MeshAttachment,Me as MixFrom,mt as PathAttachment,ve as PathConstraint,Ue as PathConstraintData,Re as PathConstraintMixTimeline,Ye as PathConstraintPose,Fe as PathConstraintPositionTimeline,Ee as PathConstraintSpacingTimeline,_e as Physics,Oe as PhysicsConstraint,ke as PhysicsConstraintDampingTimeline,Xe as PhysicsConstraintData,Be as PhysicsConstraintGravityTimeline,Ne as PhysicsConstraintInertiaTimeline,De as PhysicsConstraintMassTimeline,$e as PhysicsConstraintMixTimeline,ze as PhysicsConstraintPose,We as PhysicsConstraintResetTimeline,qe as PhysicsConstraintStrengthTimeline,Ge as PhysicsConstraintTimeline,Je as PhysicsConstraintWindTimeline,yt as PointAttachment,at as Pool,He as Posed,Ze as PosedActive,Ke as PosedData,Qe as PositionMode,je as Pow,ts as PowOut,es as Property,ss as RGB2Timeline,ns as RGBA2Timeline,is as RGBATimeline,os as RGBTimeline,pt as RegionAttachment,rs as RotateMode,as as RotateTimeline,ls as SETUP,cs as ScaleTimeline,hs as ScaleXTimeline,ps as ScaleYMode,ds as ScaleYTimeline,us as Sequence,fs as SequenceMode,gs as SequenceModeValues,ms as SequenceTimeline,ys as ShearTimeline,Ts as ShearXTimeline,bs as ShearYTimeline,ws as Skeleton,xs as SkeletonBinary,Lt as SkeletonBounds,wt as SkeletonClipping,As as SkeletonData,Ps as SkeletonJson,St as SkeletonPhysicsMovement,Mt as SkeletonRendererCore,Is as Skin,Cs as SkinEntry,Vs as Slider,Ls as SliderData,Ss as SliderMixTimeline,Ms as SliderPose,vs as SliderTimeline,Us as Slot,Rs as SlotCurveTimeline,Ys as SlotData,Fs as SlotPose,Es as SpacingMode,_s as StringSet,Os as Texture,ht as TextureAtlas,ks as TextureAtlasPage,Xs as TextureAtlasRegion,Bs as TextureFilter,Ns as TextureRegion,Ds as TextureWrap,$s as TimeKeeper,zs as Timeline,Ws as ToProperty,qs as ToRotate,Gs as ToScaleX,Js as ToScaleY,Hs as ToShearY,Zs as ToX,Ks as ToY,Qs as TrackEntry,js as TransformConstraint,tn as TransformConstraintData,en as TransformConstraintPose,sn as TransformConstraintTimeline,nn as TranslateTimeline,on as TranslateXTimeline,rn as TranslateYTimeline,z as Triangulator,D as Utils,an as Vector2,ln as VertexAttachment,cn as WindowedMean,hn as isBoneTimeline,pn as isConstraintTimeline,dn as isSlotTimeline}; diff --git a/dist/assets/index-C2X4Q0zX.js b/dist/assets/index-DaC3oTyd.js similarity index 77% rename from dist/assets/index-C2X4Q0zX.js rename to dist/assets/index-DaC3oTyd.js index c5b0a28..b240c34 100644 --- a/dist/assets/index-C2X4Q0zX.js +++ b/dist/assets/index-DaC3oTyd.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B57-mKhk.js","assets/index-BGsgtkNi.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DbHSUVPi.js","assets/index-D87AMfy0.js"])))=>i.map(i=>d[i]); var RE=Object.defineProperty;var FE=(i,e,t)=>e in i?RE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var A=(i,e,t)=>FE(i,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();/** * @vue/shared v3.5.41 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -1254,4 +1254,4 @@ void main(void){ gl_FragColor.a = color.a * vColor.a; gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; } -`;class UA extends Nr{constructor(e){super(e),this.shaderGenerator=new Yw(Y4,z4),this.geometryClass=X4,this.vertexSize=7}packInterleavedGeometry(e,t,n,s,r){const{uint32View:o,float32View:a}=t,c=s/this.vertexSize,l=e.uvs,d=e.indices,u=e.vertexData,h=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=Ot.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Ot.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(l){return Promise.all(l.map(d=>Promise.resolve(d).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(l=>{if(l=q4(l),l in hx)return;hx[l]=!0;const d=l.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":W4,d||(h.as="script"),h.crossOrigin="",h.href=l,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function XA(){const[i,e]=await Promise.all([fx(()=>import("./index-BGsgtkNi.js"),[]),fx(()=>import("./index-B57-mKhk.js"),__vite__mapDeps([0,1]))]);return{core:i,pixi:e}}async function K4(i,e,t){const{core:n,pixi:s}=await XA(),r=new n.TextureAtlas(e);return ov(r,t,s.SpineTexture),{skeletonData:new n.SkeletonJson(new n.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:s.Spine}}async function J4(i,e,t){const{core:n,pixi:s}=await XA(),r=new n.TextureAtlas(e);return ov(r,t,s.SpineTexture),{skeletonData:new n.SkeletonBinary(new n.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:s.Spine}}function jr(i,e,t){const n=Number(i[e]);return Number.isFinite(n)?n:t}function hi(i,e,t,n){i[e]==null&&(i[e]=jr(i,t,n))}function av(i,e,t){if(typeof i.curve!="number")return;const n=jr(i,"time",0),r=jr(e,"time",0)-n,o=i.curve,a=jr(i,"c2",0),c=jr(i,"c3",1),l=jr(i,"c4",1);i.curve=t.flatMap(([d,u])=>[n+r*o,d+(u-d)*a,n+r*c,d+(u-d)*l]),delete i.c2,delete i.c3,delete i.c4}function Zr(i,e){if(Array.isArray(i))for(let t=0;t[jr(n,r,o),jr(s,r,o)]))}}function Z4(i){if(Array.isArray(i))for(let e=0;eNumber.parseInt(n.slice(r,r+2),16)/255);return e?s:s.slice(0,3)}function px(i,e){if(Array.isArray(i))for(let t=0;t[a,o[c]]))}}function Q4(i){for(const e of i.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of i.transform||[])hi(e,"mixRotate","rotateMix",1),hi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),hi(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),hi(e,"mixShearY","shearMix",1);for(const e of i.path||[])hi(e,"mixRotate","rotateMix",1),hi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function eU(i){for(const e of i.skins||[])for(const t of Object.values(e.attachments||{}))for(const n of Object.values(t||{}))n.parent!=null&&n.timelines==null&&n.deform!=null&&(n.timelines=n.deform)}function tU(i){for(const e of Object.values(i.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),px(e.rgba,!1),px(e.rgba2,!0)}function nU(i){for(const e of Object.values(i.bones||{})){for(const t of e.rotate||[])hi(t,"value","angle",0);Zr(e.rotate,[{key:"value",fallback:0}]),Zr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Zr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Zr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function iU(i){for(const e of Object.values(i.ik||{}))Zr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function sU(i){for(const e of Object.values(i.transform||{})){for(const t of e)hi(t,"mixRotate","rotateMix",1),hi(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),hi(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),hi(t,"mixShearY","shearMix",1);Zr(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function rU(i){for(const e of Object.values(i.path||{})){for(const n of["position","spacing"]){const s=e[n];for(const r of s||[])hi(r,"value",n,0);Zr(s,[{key:"value",fallback:0}])}const t=e.mix;for(const n of t||[])hi(n,"mixRotate","rotateMix",1),hi(n,"mixX","translateMix",1),n.mixY==null&&(n.mixY=n.mixX);Zr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function oU(i){if(!i.deform)return;const e=i.attachments||(i.attachments={});for(const[t,n]of Object.entries(i.deform)){const s=e[t]||(e[t]={});for(const[r,o]of Object.entries(n)){const a=s[r]||(s[r]={});for(const[c,l]of Object.entries(o)){const d=a[c]||(a[c]={});d.deform=l,Z4(l)}}}delete i.deform}function YA(i){Q4(i),eU(i);for(const e of Object.values(i.animations||{}))tU(e),nU(e),iU(e),sU(e),rU(e),oU(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return i}function aU(i){return i.replace(/\\/g,"/").split("/").pop()||i}async function lU(i){const e=await Promise.all(i.map(async t=>{const n=URL.createObjectURL(t);try{return[aU(t.name).toLowerCase(),await tt.fromURL(n)]}finally{URL.revokeObjectURL(n)}}));return new Map(e)}function cU(i){const e=new Map;return i.bones.map(t=>{var r;const n=((r=t.parent)==null?void 0:r.name)||null,s=n?(e.get(n)||0)+1:0;return e.set(t.name,s),{name:t.name,parent:n,depth:s}})}function dU(i){return i.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function zA(i,e,t){var o;if(!/\.(json|skel)$/i.test(i.name))throw new Error(ke("errors.spineFileType"));if(!/\.atlas$/i.test(e.name))throw new Error(ke("errors.atlasFileType"));if(!t.length)throw new Error(ke("errors.chooseTexture"));const n=await e.text(),s=await lU(t),r=[...s.values()];try{let a,c,l=null,d;if(/\.skel$/i.test(i.name)){const u=await i.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await J4(u,n,s)),d="4.3"}catch(h){try{({skeletonData:a,SpineClass:c}=G4(u,n,s)),d="4.2"}catch(f){const p=h instanceof Error?h.message:String(h),m=f instanceof Error?f.message:String(f);throw new Error(ke("errors.binaryParseFailed",{v43:p,v42:m}))}}l=gu(a.version)}else{let u;try{u=JSON.parse(await i.text())}catch{throw new Error(ke("errors.invalidSpineJson"))}if(l=gu((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(ke("errors.unsupportedSpineJsonVersion",{versions:_m()}));d=tL(l),l==="3.8"&&YA(u);const h=d==="4.3"?await K4(u,n,s):H4(u,n,s);a=h.skeletonData,c=h.SpineClass}if(!l)throw new Error(ke("errors.unsupportedSpineDataVersion",{versions:_m()}));return{skeletonData:a,textures:r,runtimeVersion:d,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:cU(a),slots:dU(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function $d(i){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(String(n.result||"")),n.onerror=()=>t(n.error),n.readAsDataURL(i)})}async function uU(i,e,t){return{skeleton:{name:i.name,dataUrl:await $d(i)},atlas:{name:e.name,dataUrl:await $d(e)},textures:await Promise.all(t.map(async n=>({name:n.name,dataUrl:await $d(n)})))}}async function Ap(i){const e=await fetch(i.dataUrl);if(!e.ok)throw new Error(ke("errors.embeddedReadFailed",{name:i.name}));return new File([await e.blob()],i.name)}async function hU(i){return{skeleton:await Ap(i.skeleton),atlas:await Ap(i.atlas),textures:await Promise.all(i.textures.map(Ap))}}const jA="SpineParticle.EditorConfig",HA=1;function GA(i){return{backgroundX:i.backgroundX,backgroundY:i.backgroundY,backgroundOpacity:i.backgroundOpacity,backgroundImageName:i.backgroundImageName,backgroundImageData:i.backgroundImageData,showGrid:i.showGrid,exportSettings:tn(i.exportSettings)}}function fU(i){return JSON.parse(JSON.stringify(i,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function WA(i){const e=tn(i);return delete e.tags,delete e.selectedTag,e}function mx(i){const e=GA(i.settings),t=i.timeline.playbackEnd>=Math.max(1,i.timeline.totalFrames-1);return fU({format:jA,version:HA,savedAt:new Date().toISOString(),editor:tn(i.editor),settings:e,timeline:{fps:i.timeline.fps,loop:i.timeline.loop,playbackStart:i.timeline.playbackStart,playbackEnd:i.timeline.playbackEnd,playbackEndAuto:t,abLoop:i.timeline.abLoop,animations:[...i.timeline.animations]},selection:{type:i.activeObjectType,id:i.activeObjectId},scene:{systems:i.systems.map(n=>({...tn(n),frames:void 0})),colliders:i.colliders.map(WA),paths:tn(i.paths),spines:tn(i.spines)}})}function pU(i,e,t,n){const s=Math.max(1,n);let r=0;for(const o of i){const a=o.config,c=Math.max(0,Number(a.lifeMin)||0),l=Math.max(0,Number(a.lifeMax)||0),d=a.lifeMode==="fixed"?c:Math.max(c,l),u=a.mode==="stream"?a.streamBehavior==="loop"?Ji(a,s).total/s:Math.max(1/s,Number(a.duration)||0):0;let h=Math.max(0,Number(a.delay)||0)+u+d;a.mode==="stream"&&a.streamBehavior==="loop"&&(h=Math.max(0,Number(a.delay)||0)+Ji(a,s).total/s),r=Math.max(r,h)}for(const o of t){const a=o.animations.find(c=>c.name===o.selectedAnimation);a&&(r=Math.max(r,Math.max(0,Number(o.timeOffset)||0)+Math.max(0,a.duration||0)))}for(const o of e)o.followPath&&o.followPathId&&(r=Math.max(r,Math.max(0,o.followDuration)||0));return nC(r,s)}function lv(i){let e;try{e=JSON.parse(i)}catch{throw new Error(ke("errors.invalidJson"))}const t=e;if(t.format!==jA)throw new Error(ke("errors.invalidConfigFormat"));if(t.version!==HA)throw new Error(ke("errors.unsupportedConfigVersion",{version:t.version??ke("export.unknown")}));if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error(ke("errors.missingScene"));return t}async function mU(i){const e=new Map,t=s=>{const r=s==="/particles/star.png"?"/images/star.png":s==="/trails/trail.png"?"/images/trail.png":s||"/images/star.png";let o=e.get(r);return o||(o=tt.fromURL(r).then(a=>Hr(a)),e.set(r,o)),o},n=await t("/images/star.png");await Promise.all(i.map(async s=>{var o;const r=fr(s.config);r.texture=n,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async c=>{c.texture=await t(c.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,s.frames=[]}))}async function gU(i){const e=new Map;try{for(const t of i){if(!t.sourceBundle)continue;const n=await hU(t.sourceBundle);e.set(t.id,await zA(n.skeleton,n.atlas,n.textures))}return e}catch(t){for(const n of e.values())for(const s of n.textures)s.destroy(!0);throw t}}function vU(i,e){const t=(e==null?void 0:e.type)||"particle",n=Number(e==null?void 0:e.id)||0;(t==="particle"?i.systems.some(r=>r.id===n):t==="collision"?i.colliders.some(r=>r.id===n):t==="path"?i.paths.some(r=>r.id===n):i.spines.some(r=>r.id===n))?i.selectSceneObject(t,n):i.systems[0]?i.selectSceneObject("particle",i.systems[0].id):i.colliders[0]?i.selectSceneObject("collision",i.colliders[0].id):i.paths[0]?i.selectSceneObject("path",i.paths[0].id):i.spines[0]?i.selectSceneObject("spine",i.spines[0].id):(i.activeObjectType="particle",i.activeObjectId=0,i.activeId=0)}async function bU(i,e){var h,f,p,m,g,v,y,b,x;const t=lv(JSON.stringify(e)),n=tn(t.scene.systems),s=t.scene.colliders.map(WA),r=tn(t.scene.paths),o=tn(t.scene.spines);for(const T of o)T.sourceBundle==null&&(T.sourceBundle=null),T.dataVersion==null&&(T.dataVersion=""),Array.isArray(T.slots)||(T.slots=[]),typeof T.selectedBone!="string"&&(T.selectedBone=""),typeof T.selectedSlot!="string"&&(T.selectedSlot="");await mU(n);const a=await gU(o),c=new Map(i.spines.map(T=>[T.id,T.assetVersion]));for(const T of i.spines)Ec(T.id);i.systems=n,i.colliders=s,i.paths=r,i.spines=o,Object.assign(i.editor,tn(t.editor||{}));const l=t.settings;if(l)for(const T of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,T)&&(i.settings[T]=l[T]);i.settings.exportSettings=ZS((h=t.settings)==null?void 0:h.exportSettings),i.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(i.settings.undoLimit)||20))),i.timeline.fps=Math.max(1,Math.round(Number((f=t.timeline)==null?void 0:f.fps)||30));const d=Math.max(1,Math.floor(Number((p=t.timeline)==null?void 0:p.playbackEnd)||Number.MAX_SAFE_INTEGER)),u=((m=t.timeline)==null?void 0:m.playbackEndAuto)??d>=pU(n,s,o,i.timeline.fps);i.timeline.abLoop=((g=t.timeline)==null?void 0:g.abLoop)===!0,i.timeline.loop=((v=t.timeline)==null?void 0:v.loop)!==!1,i.timeline.animations=Array.isArray((y=t.timeline)==null?void 0:y.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(T=>typeof T=="string"&&T.trim()).map(T=>T.trim()))]:["animation"];for(const T of i.spines){const E=a.get(T.id);if(T.assetVersion=Math.max(Number(T.assetVersion)||0,c.get(T.id)||0)+1,!E){T.status="empty",T.error=T.skeletonFileName?ke("errors.missingEmbeddedSpine"):"",T.animations=[],T.bones=[],T.slots=[],T.selectedAnimation="";continue}gh(T.id,E),T.dataVersion=E.dataVersion,T.animations=E.animations,T.bones=E.bones,T.slots=E.slots,E.animations.some(S=>S.name===T.selectedAnimation)||(T.selectedAnimation=((b=E.animations[0])==null?void 0:b.name)||""),T.status="ready",T.error=""}i.syncSceneSequences(),vU(i,t.selection),i.timeline.playbackStart=Math.max(0,Math.floor(Number((x=t.timeline)==null?void 0:x.playbackStart)||0)),i.timeline.playbackEnd=d,i.timeline.frame=0,i.timeline.recorded=!1,i.timeline.playing=!0;for(const T of i.systems)i.timeline.animations.includes(T.animation)||(T.animation=i.timeline.animations[0]);return i.recalcTotalFrames(),u&&(i.timeline.playbackEnd=i.timeline.totalFrames-1),i.timeline.frame=i.timeline.playbackStart,t}async function Ym(i,e){return bU(i,lv(e))}async function yU(i,e){if(!/\.json$/i.test(e.name))throw new Error(ke("errors.chooseJsonConfig"));return Ym(i,await e.text())}const wr=qo({undoCount:0,dirty:!1});let gc=null,Rs=null,Qr=[],wl=null,ar=null,Mu=!1,wh="";function Sh(i){return{systems:i.systems.map(t=>{const n=tn(t);return n.frames=void 0,n}),colliders:tn(i.colliders),paths:tn(i.paths),spines:tn(i.spines),animations:[...i.timeline.animations],settings:GA(i.settings)}}function Ch(i){return JSON.stringify(i,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function qA(i,e=Sh(i),t=Ch(e)){const n=new Map;for(const s of e.spines){const r=QF(s.id);r&&n.set(s.id,r)}return{data:e,signature:t,spineAssets:n}}function Pu(i){if(i){for(const e of i.spineAssets.values())JF(e);i.spineAssets.clear()}}function KA(i){for(;Qr.length>i;)Pu(Qr.shift()||null);wr.undoCount=Qr.length}function JA(){const i=gc;if(!i||!Rs||Mu)return;const e=Sh(i),t=Ch(e);t!==Rs.signature&&(Qr.push(Rs),Rs=qA(i,e,t),KA(i.settings.undoLimit))}function xU(i){Mu||(wr.dirty=i!==wh,ar&&clearTimeout(ar),ar=setTimeout(()=>{ar=null,JA()},250))}function wU(i){const e=i.activeObjectId;return i.activeObjectType==="particle"?i.systems.some(t=>t.id===e):i.activeObjectType==="collision"?i.colliders.some(t=>t.id===e):i.activeObjectType==="path"?i.paths.some(t=>t.id===e):i.spines.some(t=>t.id===e)}function SU(i){var t,n;if(!wU(i)){const s=i.systems[0],r=i.colliders[0],o=i.paths[0],a=i.spines[0];s?(i.activeObjectType="particle",i.activeObjectId=s.id):r?(i.activeObjectType="collision",i.activeObjectId=r.id):o?(i.activeObjectType="path",i.activeObjectId=o.id):(i.activeObjectType="spine",i.activeObjectId=(a==null?void 0:a.id)||0)}const e=i.activeObjectType==="particle"?i.systems.find(s=>s.id===i.activeObjectId):i.systems.find(s=>s.id===i.activeId);i.activeId=(e==null?void 0:e.id)||((t=i.systems[0])==null?void 0:t.id)||0,i.timeline.animation=(e==null?void 0:e.animation)||((n=i.systems[0])==null?void 0:n.animation)||i.timeline.animations[0]||"animation"}function CU(i,e){const t=Rs;Mu=!0;try{for(const n of i.spines)Ec(n.id);i.systems=tn(e.data.systems),i.colliders=tn(e.data.colliders),i.paths=tn(e.data.paths),i.spines=tn(e.data.spines),i.timeline.animations=[...e.data.animations],Object.assign(i.settings,tn(e.data.settings));for(const[n,s]of e.spineAssets)gh(n,s);for(const n of i.systems)n.frames=[];i.timeline.recorded=!1,i.timeline.playing=!1,SU(i),i.recalcTotalFrames(),Rs=e,wr.dirty=e.signature!==wh}finally{Mu=!1,Pu(t)}}function AU(i){if(!(gc===i&&wl)){wl==null||wl(),ar&&clearTimeout(ar),Pu(Rs);for(const e of Qr)Pu(e);Qr=[],gc=i,Rs=qA(i),wh=Rs.signature,wr.undoCount=0,wr.dirty=!1,wl=Ut(()=>Ch(Sh(i)),xU,{flush:"post"})}}function Sl(i){gc===i&&(wh=Ch(Sh(i)),wr.dirty=!1)}function TU(i,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));i.settings.undoLimit=t,KA(t)}function ZA(){const i=gc;if(!i||!Rs)return!1;ar&&(clearTimeout(ar),ar=null),JA();const e=Qr.pop();return e?(CU(i,e),wr.undoCount=Qr.length,!0):!1}function EU(i){const e=i instanceof HTMLElement?i:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function _U(i){function e(n){var r;const s=n.target instanceof Node?n.target:null;i.canvasFocused.value=!!s&&!!((r=i.canvasElement.value)!=null&&r.contains(s))}function t(n){const s=n.key.toLowerCase();if((n.ctrlKey||n.metaKey)&&!n.altKey&&s==="s"){n.preventDefault(),n.stopPropagation(),i.save();return}if((n.ctrlKey||n.metaKey)&&!n.altKey&&s==="z"){n.preventDefault(),n.stopPropagation(),i.undo();return}if(n.ctrlKey||n.metaKey||n.altKey||EU(n.target))return;if(s==="d"){n.preventDefault(),i.togglePlay();return}if(s==="s"){n.preventDefault(),i.toStart();return}if(!i.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};s in r&&(n.preventDefault(),i.setTool(r[s]))}Ti(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),nl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const MU=Array.from({length:256},(i,e)=>{let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function PU(i){let e=4294967295;for(const t of i)e=MU[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function kU(i){const e=String(i||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error(ke("errors.invalidZipPath"));return e.join("/")}function IU(i=new Date){const e=Math.max(1980,i.getFullYear());return{time:i.getHours()<<11|i.getMinutes()<<5|Math.floor(i.getSeconds()/2),date:e-1980<<9|i.getMonth()+1<<5|i.getDate()}}function Tp(i){const e=new Uint8Array(i);return{bytes:e,view:new DataView(e.buffer)}}function gx(i){const e=new Uint8Array(i.reduce((n,s)=>n+s.length,0));let t=0;for(const n of i)e.set(n,t),t+=n.length;return e}function QA(i){const e=new TextEncoder,t=[],n=[],s=IU();let r=0;for(const c of i){const l=e.encode(kU(c.name)),d=PU(c.data),u=Tp(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,s.time,!0),u.view.setUint16(12,s.date,!0),u.view.setUint32(14,d,!0),u.view.setUint32(18,c.data.length,!0),u.view.setUint32(22,c.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,c.data);const h=Tp(46);h.view.setUint32(0,33639248,!0),h.view.setUint16(4,20,!0),h.view.setUint16(6,20,!0),h.view.setUint16(8,2048,!0),h.view.setUint16(12,s.time,!0),h.view.setUint16(14,s.date,!0),h.view.setUint32(16,d,!0),h.view.setUint32(20,c.data.length,!0),h.view.setUint32(24,c.data.length,!0),h.view.setUint16(28,l.length,!0),h.view.setUint32(42,r,!0),n.push(h.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=gx(n),a=Tp(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,i.length,!0),a.view.setUint16(10,i.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([gx([...t,o,a.bytes])],{type:"application/zip"})}const RU="SpineParticle.ProjectLibrary",io="projects",FU=1,zm="spine-particle:request-save";let yd=null;function cv(){return"indexedDB"in globalThis?yd||(yd=new Promise((i,e)=>{const t=indexedDB.open(RU,FU);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(io)||n.createObjectStore(io,{keyPath:"name"})},t.onsuccess=()=>i(t.result),t.onerror=()=>e(t.error||new Error(ke("config.storageUnavailable")))}),yd):Promise.reject(new Error(ke("config.storageUnavailable")))}function LU(i){return new Promise((e,t)=>{i.onsuccess=()=>e(i.result),i.onerror=()=>t(i.error||new Error(ke("config.storageUnavailable")))})}function eT(i){return new Promise((e,t)=>{i.oncomplete=()=>e(),i.onerror=()=>t(i.error||new Error(ke("config.storageUnavailable"))),i.onabort=()=>t(i.error||new Error(ke("config.storageUnavailable")))})}function jm(i){const e=i.trim().replace(/\.json$/i,"").trim();if(!e)throw new Error(ke("config.local.nameRequired"));if(/[\\/:*?"<>|\u0000-\u001f]/.test(e))throw new Error(ke("config.local.nameInvalid"));return e}function tT(i){return`${i}.json`}async function vx(){const e=(await cv()).transaction(io,"readonly");return(await LU(e.objectStore(io).getAll())).sort((n,s)=>s.savedAt.localeCompare(n.savedAt))}async function bx(i,e){const n={name:jm(i),text:e,savedAt:new Date().toISOString(),size:new Blob([e]).size},r=(await cv()).transaction(io,"readwrite");return r.objectStore(io).put(n),await eT(r),n}async function DU(i){const t=(await cv()).transaction(io,"readwrite");t.objectStore(io).delete(i),await eT(t)}function yx(i,e){const t=new Blob([i],{type:"application/json;charset=utf-8"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)}function OU(i,e){const t=new TextEncoder,n=QA(i.map(o=>({name:tT(o.name),data:t.encode(o.text)}))),s=URL.createObjectURL(n),r=document.createElement("a");r.href=s,r.download=e,r.style.display="none",document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(s),0)}const NU={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},$U={class:"help-head"},BU={id:"help-title"},UU=["aria-label","title"],VU={class:"help-body"},XU={class:"help-section help-start"},YU={class:"help-note"},zU={class:"help-grid"},jU={class:"help-section"},HU={class:"help-list"},GU={class:"help-section"},WU={class:"shortcut-list"},qU={class:"help-note"},KU={class:"help-doc-title"},JU=["aria-expanded"],ZU={class:"mtitle"},QU={class:"caret"},e5={class:"help-module-body"},t5={class:"help-list"},n5=["aria-expanded"],i5={class:"mtitle"},s5={class:"caret"},r5={class:"help-module-body"},o5={class:"help-list"},a5=["aria-expanded"],l5={class:"mtitle"},c5={class:"caret"},d5={class:"help-module-body"},u5={class:"help-list"},h5=["aria-expanded"],f5={class:"mtitle"},p5={class:"caret"},m5={class:"help-module-body"},g5={class:"help-list"},v5=["aria-expanded"],b5={class:"mtitle"},y5={class:"caret"},x5={class:"help-module-body"},w5={class:"help-list"},S5=["aria-expanded"],C5={class:"mtitle"},A5={class:"caret"},T5={class:"help-module-body"},E5={class:"help-list"},_5=["aria-expanded"],M5={class:"mtitle"},P5={class:"caret"},k5={class:"help-module-body"},I5={class:"help-list"},R5=["aria-expanded"],F5={class:"mtitle"},L5={class:"caret"},D5={class:"help-module-body"},O5={class:"help-list"},N5=["aria-expanded"],$5={class:"mtitle"},B5={class:"caret"},U5={class:"help-module-body"},V5={class:"connector-intro"},X5={class:"help-list"},Y5={class:"help-section help-export"},z5=Zt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=e,n=Re(Array.from({length:9},()=>!1));function s(){t("close")}function r(o){o.key==="Escape"&&s()}return Ti(()=>window.addEventListener("keydown",r)),Ar(()=>window.removeEventListener("keydown",r)),(o,a)=>i.show?(Q(),te("div",{key:0,class:"help-overlay",role:"presentation",onClick:We(s,["self"])},[w("section",NU,[w("header",$U,[w("div",null,[w("h2",BU,F(o.$t("help.title")),1),w("p",null,F(o.$t("help.subtitle")),1)]),w("button",{class:"help-close","aria-label":o.$t("help.close"),title:o.$t("help.closeShort"),onClick:s},"✕",8,UU)]),w("div",VU,[w("section",XU,[w("h3",null,F(o.$t("help.quickStart")),1),w("ol",null,[w("li",null,F(o.$t("help.stepCreate")),1),w("li",null,F(o.$t("help.stepEdit")),1),w("li",null,F(o.$t("help.stepPreview")),1),w("li",null,F(o.$t("help.stepExport")),1)]),w("p",YU,F(o.$t("help.quickNote")),1)]),w("div",zU,[w("section",jU,[w("h3",null,F(o.$t("help.commonOps")),1),w("dl",HU,[w("div",null,[w("dt",null,F(o.$t("help.eye")),1),w("dd",null,F(o.$t("help.eyeDesc")),1)]),w("div",null,[a[9]||(a[9]=w("dt",null,"+Copy",-1)),w("dd",null,F(o.$t("help.copyDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("toolbar.background")),1),w("dd",null,F(o.$t("help.backgroundDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("toolbar.settings")),1),w("dd",null,F(o.$t("help.settingsDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.undoShortcut")),1),w("dd",null,F(o.$t("help.undoDesc")),1)]),w("div",null,[a[10]||(a[10]=w("dt",null,"Spine Bone",-1)),w("dd",null,F(o.$t("help.spineBoneDesc")),1)])])]),w("section",GU,[w("h3",null,F(o.$t("help.shortcuts")),1),w("div",WU,[w("div",null,[a[11]||(a[11]=w("kbd",null,"Ctrl/⌘",-1)),a[12]||(a[12]=w("span",null,"+",-1)),a[13]||(a[13]=w("kbd",null,"Z",-1)),w("em",null,F(o.$t("help.undoShortcut")),1)]),w("div",null,[a[14]||(a[14]=w("kbd",null,"Ctrl/⌘",-1)),a[15]||(a[15]=w("span",null,"+",-1)),a[16]||(a[16]=w("kbd",null,"S",-1)),w("em",null,F(o.$t("help.saveShortcut")),1)]),w("div",null,[a[17]||(a[17]=w("kbd",null,"Q",-1)),w("em",null,F(o.$t("help.panShortcut")),1)]),w("div",null,[a[18]||(a[18]=w("kbd",null,"W",-1)),w("em",null,F(o.$t("help.translateShortcut")),1)]),w("div",null,[a[19]||(a[19]=w("kbd",null,"E",-1)),w("em",null,F(o.$t("help.rotateShortcut")),1)]),w("div",null,[a[20]||(a[20]=w("kbd",null,"R",-1)),w("em",null,F(o.$t("help.scaleShortcut")),1)]),w("div",null,[a[21]||(a[21]=w("kbd",null,"D",-1)),w("em",null,F(o.$t("help.playShortcut")),1)]),w("div",null,[a[22]||(a[22]=w("kbd",null,"S",-1)),w("em",null,F(o.$t("help.startShortcut")),1)])]),w("p",qU,F(o.$t("help.shortcutNote")),1)])]),w("div",KU,F(o.$t("help.modules")),1),w("section",{class:Pe(["help-section help-module",{open:n.value[0]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[0]?"true":"false",onClick:a[0]||(a[0]=c=>n.value[0]=!n.value[0])},[a[23]||(a[23]=w("span",{class:"mnum"},"1",-1)),w("span",ZU,F(o.$t("help.configTitle")),1),w("span",QU,F(n.value[0]?"▾":"▸"),1)],8,JU),pe(w("div",e5,[w("dl",t5,[w("div",null,[w("dt",null,F(o.$t("config.save")),1),w("dd",null,F(o.$t("help.saveConfigDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("config.load")),1),w("dd",null,F(o.$t("help.loadConfigDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("config.selectPreset")),1),w("dd",null,F(o.$t("help.presetDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.configScope")),1),w("dd",null,F(o.$t("help.configScopeDesc")),1)])])],512),[[Xt,n.value[0]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[1]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[1]?"true":"false",onClick:a[1]||(a[1]=c=>n.value[1]=!n.value[1])},[a[24]||(a[24]=w("span",{class:"mnum"},"2",-1)),w("span",i5,F(o.$t("help.sceneTitle")),1),w("span",s5,F(n.value[1]?"▾":"▸"),1)],8,n5),pe(w("div",r5,[w("dl",o5,[w("div",null,[w("dt",null,F(o.$t("scene.particle")),1),w("dd",null,F(o.$t("help.particleDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("scene.collision")),1),w("dd",null,F(o.$t("help.colliderDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("scene.path")),1),w("dd",null,F(o.$t("help.pathDesc")),1)]),w("div",null,[a[25]||(a[25]=w("dt",null,"Spine",-1)),w("dd",null,F(o.$t("help.spineDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.commonOps")),1),w("dd",null,F(o.$t("help.sceneCommonDesc")),1)])])],512),[[Xt,n.value[1]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[2]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[2]?"true":"false",onClick:a[2]||(a[2]=c=>n.value[2]=!n.value[2])},[a[26]||(a[26]=w("span",{class:"mnum"},"3",-1)),w("span",l5,F(o.$t("emission.title")),1),w("span",c5,F(n.value[2]?"▾":"▸"),1)],8,a5),pe(w("div",d5,[w("dl",u5,[w("div",null,[w("dt",null,F(o.$t("emission.stream")),1),w("dd",null,F(o.$t("help.emissionDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("emission.burst")),1),w("dd",null,F(o.$t("help.burstDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("emission.delay")),1),w("dd",null,F(o.$t("help.delayDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.showShape")),1),w("dd",null,F(o.$t("help.loopNote")),1)])])],512),[[Xt,n.value[2]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[3]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[3]?"true":"false",onClick:a[3]||(a[3]=c=>n.value[3]=!n.value[3])},[a[27]||(a[27]=w("span",{class:"mnum"},"4",-1)),w("span",f5,F(o.$t("emission.shapeTitle")),1),w("span",p5,F(n.value[3]?"▾":"▸"),1)],8,h5),pe(w("div",m5,[w("dl",g5,[w("div",null,[w("dt",null,F(o.$t("emission.shape")),1),w("dd",null,F(o.$t("help.shapeDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("emission.emissionAngle")),1),w("dd",null,F(o.$t("help.angleDesc")),1)])])],512),[[Xt,n.value[3]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[4]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[4]?"true":"false",onClick:a[4]||(a[4]=c=>n.value[4]=!n.value[4])},[a[28]||(a[28]=w("span",{class:"mnum"},"5",-1)),w("span",b5,F(o.$t("attributes.title")),1),w("span",y5,F(n.value[4]?"▾":"▸"),1)],8,v5),pe(w("div",x5,[w("dl",w5,[w("div",null,[w("dt",null,F(o.$t("attributes.initialParams")),1),w("dd",null,F(o.$t("help.initialDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("attributes.lifecycleTitle")),1),w("dd",null,F(o.$t("help.overLifeDesc")),1)])])],512),[[Xt,n.value[4]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[5]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[5]?"true":"false",onClick:a[5]||(a[5]=c=>n.value[5]=!n.value[5])},[a[29]||(a[29]=w("span",{class:"mnum"},"6",-1)),w("span",C5,F(o.$t("appearance.title")),1),w("span",A5,F(n.value[5]?"▾":"▸"),1)],8,S5),pe(w("div",T5,[w("dl",E5,[w("div",null,[w("dt",null,F(o.$t("appearance.opacity")),1),w("dd",null,F(o.$t("help.alphaDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("appearance.imageResources")),1),w("dd",null,F(o.$t("help.imageDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("image.sequence")),1),w("dd",null,F(o.$t("help.sequenceDesc")),1)])])],512),[[Xt,n.value[5]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[6]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[6]?"true":"false",onClick:a[6]||(a[6]=c=>n.value[6]=!n.value[6])},[a[30]||(a[30]=w("span",{class:"mnum"},"7",-1)),w("span",M5,F(o.$t("modifiers.title")),1),w("span",P5,F(n.value[6]?"▾":"▸"),1)],8,_5),pe(w("div",k5,[w("dl",I5,[w("div",null,[w("dt",null,F(o.$t("modifiers.enableNoise")),1),w("dd",null,F(o.$t("help.noiseDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableGravity"))+" / "+F(o.$t("modifiers.enableWind")),1),w("dd",null,F(o.$t("help.gravityDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableForceField"))+" / "+F(o.$t("modifiers.enableVortex"))+" / "+F(o.$t("modifiers.enableAttraction")),1),w("dd",null,F(o.$t("help.forceDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableTrail")),1),w("dd",null,F(o.$t("help.trailDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableFollow")),1),w("dd",null,F(o.$t("help.followDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableCollision"))+" / "+F(o.$t("modifiers.damping")),1),w("dd",null,F(o.$t("help.collisionDesc")),1)])])],512),[[Xt,n.value[6]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[7]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[7]?"true":"false",onClick:a[7]||(a[7]=c=>n.value[7]=!n.value[7])},[a[31]||(a[31]=w("span",{class:"mnum"},"8",-1)),w("span",F5,F(o.$t("export.title")),1),w("span",L5,F(n.value[7]?"▾":"▸"),1)],8,R5),pe(w("div",D5,[w("dl",O5,[w("div",null,[w("dt",null,F(o.$t("export.imagesPath")),1),w("dd",null,F(o.$t("help.exportDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("export.spineVersion")),1),a[32]||(a[32]=w("dd",null,"3.8 / 4.0 / 4.1 / 4.2 / 4.3",-1))]),w("div",null,[w("dt",null,F(o.$t("export.keyframeCurve")),1),w("dd",null,F(o.$t("export.bezierHelp")),1)]),w("div",null,[w("dt",null,F(o.$t("export.fps")),1),w("dd",null,F(o.$t("export.fpsHelp")),1)]),w("div",null,[w("dt",null,F(o.$t("export.title")),1),w("dd",null,F(o.$t("help.exportButtonsDesc")),1)])])],512),[[Xt,n.value[7]]])],2),w("section",{class:Pe(["help-section help-module help-connector",{open:n.value[8]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[8]?"true":"false",onClick:a[8]||(a[8]=c=>n.value[8]=!n.value[8])},[a[33]||(a[33]=w("span",{class:"mnum"},"9",-1)),w("span",$5,F(o.$t("help.connectorTitle")),1),w("span",B5,F(n.value[8]?"▾":"▸"),1)],8,N5),pe(w("div",U5,[w("p",V5,F(o.$t("help.connectorIntro")),1),w("dl",X5,[w("div",null,[w("dt",null,F(o.$t("help.prerequisite")),1),w("dd",null,F(o.$t("help.prerequisiteDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.download")),1),a[34]||(a[34]=w("dd",null,[w("a",{class:"dl-link",href:"/downloads/connector/SpineParticleConnector-windows-x64.exe",download:""},[Ct("Windows"),w("br"),w("small",null,"SpineParticleConnector-windows-x64.exe")]),w("a",{class:"dl-link",href:"/downloads/connector/SpineParticleConnector-macos-universal.zip",download:""},[Ct("macOS (Universal)"),w("br"),w("small",null,"SpineParticleConnector-macos-universal.zip")])],-1))]),w("div",null,[w("dt",null,F(o.$t("help.webSide")),1),w("dd",null,F(o.$t("help.webSideDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.authorization")),1),w("dd",null,F(o.$t("help.authorizationDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.pathSetup")),1),w("dd",null,F(o.$t("help.pathSetupDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.downloadResult")),1),w("dd",null,F(o.$t("help.downloadResultDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.version")),1),w("dd",null,F(o.$t("help.versionDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.security")),1),w("dd",null,F(o.$t("help.securityDesc")),1)])])],512),[[Xt,n.value[8]]])],2),w("section",Y5,[w("h3",null,F(o.$t("help.differenceTitle")),1),w("p",null,F(o.$t("help.differenceDesc")),1)])])])])):xe("",!0)}}),dn=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t},j5=dn(z5,[["__scopeId","data-v-4bb9bc76"]]);function Ua(i){const e=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",i),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function Fi(i,e,t){const n=i.holder.value,s=i.app(),r=n.getBoundingClientRect(),o=Math.max(1e-4,i.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-s.screen.width/2-i.store.editor.viewX)/o,y:-(c-s.screen.height*.5-i.store.editor.viewY)/o}}function H5(i,e){const t=i.holder.value,n=i.app(),s=i.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=e.deltaY<0?1.12:1/1.12,l=s.editor.viewScale,d=Math.max(.01,l*c),u=n.screen.width/2,h=n.screen.height*.5,f=s.editor.viewX,p=s.editor.viewY,m=(o-u-f)/l,g=(a-h-p)/l;s.editor.viewX=o-u-m*d,s.editor.viewY=a-h-g*d,s.editor.viewScale=d}function G5(i,e,t){const n=i.store,s=n.editor.viewX,r=n.editor.viewY;Ua(o=>{n.editor.viewX=s+(o.clientX-e),n.editor.viewY=r+(o.clientY-t)})}function nT(i,e){const t=Math.max(.01,i.store.editor.viewScale*e);i.store.editor.viewScale=t}function W5(i){nT(i,1.2)}function q5(i){nT(i,1/1.2)}function K5(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function J5(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function Z5(i){i.store.settings.showGrid=!i.store.settings.showGrid}const Q5={class:"top-operation-stack"},e8={class:"topbar"},t8=["title"],n8=["disabled","title"],i8={class:"tool-group"},s8=["title"],r8=["title"],o8=["title"],a8=["title"],l8={class:"tool-group"},c8=["title"],d8=["title"],u8=["title"],h8=["title"],f8=["title"],p8=["title"],m8={key:0,class:"background-panel"},g8=["disabled"],v8=["title"],b8={class:"background-position-row"},y8=["aria-label"],x8=["aria-label"],w8={class:"background-opacity-row"},S8=["aria-label"],C8={class:"language-picker"},A8=["value","aria-label"],T8=["value"],E8=["title"],_8={class:"zoom-pct"},M8={class:"timeline-controls-row"},P8={key:0,class:"stage-hud"},k8={class:"hud-number hud-system-count"},I8={class:"hud-number hud-particle-count"},R8={class:"hud-tip"},F8=Zt({__name:"StageToolbar",props:{ctx:{},activeTool:{},hud:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(i,{emit:e}){const t=i,n=e,s=Zo(),{t:r,locale:o}=mi(),a=Re(!1),c=Re(null),l=Le(()=>s.settings.backgroundImageName);function d(y){n("update:activeTool",t.activeTool===y?"":y)}function u(){a.value=!a.value,a.value&&n("update:showSettings",!1)}function h(){const y=!t.showSettings;n("update:showSettings",y),y&&(a.value=!1)}function f(){n("update:showHelp",!0),a.value=!1,n("update:showSettings",!1)}function p(y){n("background-file",y)}function m(y=!0){c.value&&(c.value.value=""),n("clear-background",y)}function g(){ZA()}function v(y){const b=y.target.value;UC(b)}return(y,b)=>(Q(),te("div",Q5,[w("div",e8,[w("button",{class:"settings-btn",onClick:h,title:_(r)("toolbar.settings")},F(_(r)("toolbar.settings")),9,t8),w("button",{class:"undo-btn",disabled:_(wr).undoCount===0,onClick:g,title:_(r)("toolbar.undo")},"↶",8,n8),w("div",i8,[w("button",{class:Pe(["tool-btn",{on:i.activeTool===""}]),onClick:b[0]||(b[0]=x=>d("")),title:_(r)("toolbar.pan")},"✋",10,s8),w("button",{class:Pe(["tool-btn",{on:i.activeTool==="translate"}]),onClick:b[1]||(b[1]=x=>d("translate")),title:_(r)("toolbar.translate")},"✥",10,r8),w("button",{class:Pe(["tool-btn",{on:i.activeTool==="rotate"}]),onClick:b[2]||(b[2]=x=>d("rotate")),title:_(r)("toolbar.rotate")},"⟳",10,o8),w("button",{class:Pe(["tool-btn",{on:i.activeTool==="scale"}]),onClick:b[3]||(b[3]=x=>d("scale")),title:_(r)("toolbar.scale")},"⤢",10,a8)]),w("div",l8,[w("button",{class:"tool-btn",onClick:b[4]||(b[4]=x=>_(W5)(i.ctx)),title:_(r)("toolbar.zoomIn")},"+",8,c8),w("button",{class:"tool-btn",onClick:b[5]||(b[5]=x=>_(q5)(i.ctx)),title:_(r)("toolbar.zoomOut")},"-",8,d8),w("button",{class:"tool-btn",onClick:b[6]||(b[6]=x=>_(K5)(i.ctx)),title:_(r)("toolbar.fitView")},"⤢",8,u8),w("button",{class:Pe(["tool-btn",{on:_(s).settings.showGrid}]),onClick:b[7]||(b[7]=x=>_(Z5)(i.ctx)),title:_(r)("toolbar.toggleGrid")},"▦",10,h8),w("button",{class:"tool-btn",onClick:b[8]||(b[8]=x=>_(J5)(i.ctx)),title:_(r)("toolbar.resetView")},"⟳",8,f8)]),w("div",{class:"background-menu",onClick:b[14]||(b[14]=We(()=>{},["stop"]))},[w("button",{class:Pe(["background-btn",{on:a.value}]),title:_(r)("toolbar.backgroundSettings"),onClick:u},F(_(r)("toolbar.background")),11,p8),a.value?(Q(),te("div",m8,[w("button",{class:"background-upload",onClick:b[9]||(b[9]=x=>{var T;return(T=c.value)==null?void 0:T.click()})},F(l.value?_(r)("toolbar.changeBackground"):_(r)("toolbar.uploadBackground")),1),w("button",{class:"background-clear",disabled:!l.value,onClick:b[10]||(b[10]=x=>m())},F(_(r)("toolbar.clearBackground")),9,g8),w("input",{ref_key:"backgroundFileInput",ref:c,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:p},null,544),w("div",{class:"background-file-name",title:l.value},F(l.value||_(r)("toolbar.noBackground")),9,v8),w("div",b8,[w("label",null,[b[15]||(b[15]=w("span",null,"X",-1)),pe(w("input",{"onUpdate:modelValue":b[11]||(b[11]=x=>_(s).settings.backgroundX=x),type:"number",step:"1","aria-label":_(r)("toolbar.backgroundX")},null,8,y8),[[Je,_(s).settings.backgroundX,void 0,{number:!0}]])]),w("label",null,[b[16]||(b[16]=w("span",null,"Y",-1)),pe(w("input",{"onUpdate:modelValue":b[12]||(b[12]=x=>_(s).settings.backgroundY=x),type:"number",step:"1","aria-label":_(r)("toolbar.backgroundY")},null,8,x8),[[Je,_(s).settings.backgroundY,void 0,{number:!0}]])])]),w("label",w8,[w("span",null,F(_(r)("toolbar.opacity")),1),pe(w("input",{"onUpdate:modelValue":b[13]||(b[13]=x=>_(s).settings.backgroundOpacity=x),type:"range",min:"0",max:"1",step:"0.01","aria-label":_(r)("toolbar.backgroundOpacity")},null,8,S8),[[Je,_(s).settings.backgroundOpacity,void 0,{number:!0}]]),w("b",null,F(Math.round(_(s).settings.backgroundOpacity*100))+"%",1)])])):xe("",!0)]),w("label",C8,[w("span",null,F(_(r)("language.label")),1),w("select",{value:_(o),"aria-label":_(r)("language.label"),onChange:v},[(Q(!0),te(_e,null,Mt(_(NC),x=>(Q(),te("option",{key:x.code,value:x.code},F(x.label),9,T8))),128))],40,A8)]),w("button",{class:Pe(["help-btn",{on:i.showHelp}]),title:_(r)("toolbar.openHelp"),onClick:f},F(_(r)("toolbar.help")),11,E8),w("span",_8,F(Math.round(_(s).editor.viewScale*100))+"%",1)]),w("div",M8,[b[18]||(b[18]=w("div",{id:"timeline-controls-host",class:"timeline-controls-host"},null,-1)),i.hud?(Q(),te("div",P8,[Ct(F(_(r)("app.systems"))+": ",1),w("b",k8,F(i.hud.systems),1),Ct(" · "+F(_(r)("app.particlesBones"))+": ",1),w("b",I8,F(i.hud.particles),1),Ct(" · "+F(_(r)("app.rootBone"))+": ",1),b[17]||(b[17]=w("b",null,"root",-1)),w("span",R8,F(_(r)("app.hudTip")),1)])):xe("",!0)])]))}}),L8=dn(F8,[["__scopeId","data-v-f5300af5"]]),D8={class:"sp-head"},O8={class:"sp-section-title"},N8={class:"sp-switch-row"},$8={class:"sp-switch-control"},B8=["aria-label"],U8={class:"sp-switch-row"},V8={class:"sp-switch-control"},X8=["aria-label"],Y8={class:"sp-section-title"},z8={class:"sp-row"},j8=["aria-label"],H8={class:"sp-section-title"},G8={class:"sp-chk"},W8={class:"sp-chk"},q8={class:"sp-row"},K8=["aria-label"],J8={class:"sp-row"},Z8=["aria-label"],Q8={class:"sp-chk"},eV={class:"sp-chk"},tV={class:"sp-row"},nV={class:"sp-row"},iV={class:"sp-row"},sV={class:"sp-hex"},rV={class:"sp-chk"},oV={class:"sp-switch-row"},aV={class:"sp-switch-control"},lV=["aria-label"],cV={class:"sp-switch-row"},dV={class:"sp-switch-control"},uV=["aria-label"],hV={class:"sp-cache-note"},fV=Zt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=i,n=e,s=Zo(),{t:r}=mi(),o=Re(null);Ut(()=>t.show,async d=>{var u;d&&(await tl(),(u=o.value)==null||u.focus())});function a(d){var h;const u=d.relatedTarget;u&&((h=o.value)!=null&&h.contains(u))||requestAnimationFrame(()=>{var f;t.show&&!((f=o.value)!=null&&f.contains(document.activeElement))&&n("close")})}function c(d){TU(s,Number(d.target.value))}function l(){s.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(s.settings.bonePointDrawSize)||1)),s.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(s.settings.boneAxisDrawSize)||2))}return(d,u)=>i.show?(Q(),te("div",{key:0,ref_key:"panelRef",ref:o,class:"settings-panel",tabindex:"-1",onFocusout:a},[w("div",D8,[Ct(F(_(r)("settings.title"))+" ",1),w("button",{class:"sp-close",onClick:u[0]||(u[0]=h=>n("close"))},"✕")]),w("div",O8,F(_(r)("settings.layout")),1),w("label",N8,[w("span",null,F(_(r)("settings.parameterPanelPosition")),1),w("span",$8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[1]||(u[1]=h=>_(s).settings.parameterPanelOnRight=h),"aria-label":_(r)("settings.panelOnRight")},null,8,B8),[[vt,_(s).settings.parameterPanelOnRight]]),u[18]||(u[18]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.parameterPanelOnRight?_(r)("common.right"):_(r)("common.left")),1)])]),w("label",U8,[w("span",null,F(_(r)("settings.floatingMenu")),1),w("span",V8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[2]||(u[2]=h=>_(s).settings.floatingMenuEnabled=h),"aria-label":_(r)("settings.floatingMenu")},null,8,X8),[[vt,_(s).settings.floatingMenuEnabled]]),u[19]||(u[19]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.floatingMenuEnabled?_(r)("common.enabled"):_(r)("common.disabled")),1)])]),u[22]||(u[22]=w("div",{class:"sp-divider"},null,-1)),w("div",Y8,F(_(r)("settings.history")),1),w("label",z8,[w("span",null,F(_(r)("settings.maxUndo")),1),pe(w("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":u[3]||(u[3]=h=>_(s).settings.undoLimit=h),"aria-label":_(r)("settings.maxUndo"),onChange:c},null,40,j8),[[Je,_(s).settings.undoLimit,void 0,{number:!0}]])]),u[23]||(u[23]=w("div",{class:"sp-divider"},null,-1)),w("div",H8,F(_(r)("settings.canvasGuides")),1),w("label",G8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[4]||(u[4]=h=>_(s).settings.showEmitter=h)},null,512),[[vt,_(s).settings.showEmitter]]),Ct(F(_(r)("settings.emitter")),1)]),w("label",W8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[5]||(u[5]=h=>_(s).settings.showBones=h)},null,512),[[vt,_(s).settings.showBones]]),Ct(F(_(r)("settings.bones")),1)]),_(s).settings.showBones?(Q(),te(_e,{key:0},[w("label",q8,[w("span",null,F(_(r)("settings.bonePointSize")),1),pe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":u[6]||(u[6]=h=>_(s).settings.bonePointDrawSize=h),"aria-label":_(r)("settings.bonePointSize"),onChange:l},null,40,K8),[[Je,_(s).settings.bonePointDrawSize,void 0,{number:!0}]])]),w("label",J8,[w("span",null,F(_(r)("settings.boneAxisSize")),1),pe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":u[7]||(u[7]=h=>_(s).settings.boneAxisDrawSize=h),"aria-label":_(r)("settings.boneAxisSize"),onChange:l},null,40,Z8),[[Je,_(s).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):xe("",!0),w("label",Q8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[8]||(u[8]=h=>_(s).settings.showSkinMesh=h)},null,512),[[vt,_(s).settings.showSkinMesh]]),Ct(F(_(r)("settings.skinMesh")),1)]),u[24]||(u[24]=w("div",{class:"sp-divider"},null,-1)),w("label",eV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[9]||(u[9]=h=>_(s).settings.tickEnabled=h)},null,512),[[vt,_(s).settings.tickEnabled]]),Ct(F(_(r)("settings.enableTicks")),1)]),_(s).settings.tickEnabled?(Q(),te(_e,{key:1},[w("label",tV,[w("span",null,F(_(r)("settings.tickFontSize")),1),pe(w("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":u[10]||(u[10]=h=>_(s).settings.axisFontSize=h)},null,512),[[Je,_(s).settings.axisFontSize,void 0,{number:!0}]]),pe(w("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":u[11]||(u[11]=h=>_(s).settings.axisFontSize=h),class:"sp-num"},null,512),[[Je,_(s).settings.axisFontSize,void 0,{number:!0}]])]),w("label",nV,[w("span",null,F(_(r)("settings.tickWidth")),1),pe(w("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":u[12]||(u[12]=h=>_(s).settings.tickWidth=h)},null,512),[[Je,_(s).settings.tickWidth,void 0,{number:!0}]]),pe(w("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":u[13]||(u[13]=h=>_(s).settings.tickWidth=h),class:"sp-num"},null,512),[[Je,_(s).settings.tickWidth,void 0,{number:!0}]])]),w("label",iV,[w("span",null,F(_(r)("settings.axisColor")),1),pe(w("input",{type:"color","onUpdate:modelValue":u[14]||(u[14]=h=>_(s).settings.axisColor=h),class:"sp-colr"},null,512),[[Je,_(s).settings.axisColor]]),w("span",sV,F(_(s).settings.axisColor),1)]),w("label",rV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[15]||(u[15]=h=>_(s).settings.showAxisLabels=h)},null,512),[[vt,_(s).settings.showAxisLabels]]),Ct(F(_(r)("settings.showAxisLabels")),1)])],64)):xe("",!0),u[25]||(u[25]=w("div",{class:"sp-divider"},null,-1)),w("label",oV,[w("span",null,F(_(r)("settings.unsavedPrompt")),1),w("span",aV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[16]||(u[16]=h=>_(s).settings.unsavedChangesPrompt=h),"aria-label":_(r)("settings.unsavedPrompt")},null,8,lV),[[vt,_(s).settings.unsavedChangesPrompt]]),u[20]||(u[20]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.unsavedChangesPrompt?_(r)("common.enabled"):_(r)("common.disabled")),1)])]),w("label",cV,[w("span",null,F(_(r)("settings.showProjectSize")),1),w("span",dV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[17]||(u[17]=h=>_(s).settings.showProjectSize=h),"aria-label":_(r)("settings.showProjectSize")},null,8,uV),[[vt,_(s).settings.showProjectSize]]),u[21]||(u[21]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.showProjectSize?_(r)("common.enabled"):_(r)("common.disabled")),1)])]),w("div",hV,F(_(r)("settings.cacheNote")),1)],544)):xe("",!0)}}),pV=dn(fV,[["__scopeId","data-v-22b4df39"]]);class Ep{constructor(){A(this,"sprite",null);A(this,"texture",null);A(this,"loadVersion",0)}createSprite(e){const t=new oo(tt.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,n){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(n)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=tt.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const n=await tt.fromURL(e);if(t!==this.loadVersion||!this.sprite){n.destroy(!0);return}const s=this.texture;this.texture=n,this.sprite.texture=n,this.sprite.visible=!0,s&&s.destroy(!0)}catch(n){console.error("背景图恢复失败",n)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const n=t.target,s=(r=n.files)==null?void 0:r[0];if(s)try{e.settings.backgroundImageData=await $d(s),e.settings.backgroundImageName=s.name}catch(o){console.error("背景图加载失败",o)}finally{n.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class mV{constructor(e){A(this,"selectedNodes",new Set);A(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(n=>n.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,n){if(e.points.length<2)return e.points.length;const s=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(c.x-s.x,c.y-s.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,s.x,s.y);t.points.splice(a,0,{x:s.x,y:s.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const n=Fi(this.ctx,e.clientX,e.clientY),s=da(t,n.x,n.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-s.x,u.y-s.y)<=r)>=0)return!0;const l={x:s.x,y:s.y,inX:0,inY:0,outX:0,outY:0},d=this.pathInsertIndex(t,s.x,s.y);return t.points.splice(d,0,l),this.selectedNodes.clear(),this.selectedNodes.add(d),this.suppressNextDoubleClick=!0,Ua(u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y);l.outX=f.x-l.x,l.outY=f.y-l.y,l.inX=-l.outX,l.inY=-l.outY}),!0}let o=null;for(const c of this.selectedNodes){const l=t.points[c];l&&(Math.hypot(l.x+l.inX-s.x,l.y+l.inY-s.y)<=r&&(o={index:c,side:"in"}),Math.hypot(l.x+l.outX-s.x,l.y+l.outY-s.y)<=r&&(o={index:c,side:"out"}))}if(o){const c=t.points[o.index],l=o.side==="in"?Math.hypot(c.outX,c.outY):Math.hypot(c.inX,c.inY);return Ua(u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y),p=f.x-c.x,m=f.y-c.y;if(o.side==="in"?(c.inX=p,c.inY=m):(c.outX=p,c.outY=m),!u.altKey){const g=Math.max(1e-4,Math.hypot(p,m)),v=u.shiftKey?g:l;o.side==="in"?(c.outX=-p/g*v,c.outY=-m/g*v):(c.inX=-p/g*v,c.inY=-m/g*v)}}),!0}const a=t.points.findIndex(c=>Math.hypot(c.x-s.x,c.y-s.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const c=s,l=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return Ua(u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y);for(const p of l)t.points[p.index].x=p.x+f.x-c.x,t.points[p.index].y=p.y+f.y-c.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const c=s,l=e.altKey,d=u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y),p=Math.min(c.x,f.x),m=Math.max(c.x,f.x),g=Math.min(c.y,f.y),v=Math.max(c.y,f.y);t.points.forEach((y,b)=>{y.x>=p&&y.x<=m&&y.y>=g&&y.y<=v&&(l?this.selectedNodes.delete(b):this.selectedNodes.add(b))}),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d)};return window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d),!0}return!1}}class gV{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const n=t.colliders.find(y=>y.id===t.activeObjectId);if(!(n!=null&&n.enabled)||n.visible===!1)return!1;const s=Fi(this.ctx,e.clientX,e.clientY),r=n.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(n.scaleX??1)),l=Math.max(1e-4,Math.abs(n.scaleY??1)),d=s.x-n.x,u=s.y-n.y,h=(o*d+a*u)/c,f=(-a*d+o*u)/l;if(!(n.shape==="circle"?Math.hypot(h,f)<=n.radius:n.shape==="ellipse"?Math.hypot(h/Math.max(1,n.radiusX),f/Math.max(1,n.radiusY))<=1:Math.abs(h)<=n.width*.5&&Math.abs(f)<=n.height*.5))return!1;const m=n.x,g=n.y,v=s;return Ua(y=>{const b=Fi(this.ctx,y.clientX,y.clientY);n.x=m+b.x-v.x,n.y=g+b.y-v.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(d=>d.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const n=t==null?void 0:t.config;if(!(n!=null&&n.forceField)||!n.showForceFieldShape||n.forceRadius<=0)return!1;const s=Fi(this.ctx,e.clientX,e.clientY);if(Math.hypot(s.x-n.forceCenterX,s.y-n.forceCenterY)>n.forceRadius)return!1;const o=n.forceCenterX,a=n.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=d=>{const u=Fi(this.ctx,d.clientX,d.clientY);n.forceCenterX=o+u.x-s.x,n.forceCenterY=a+u.y-s.y},l=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const n=t==null?void 0:t.config;if(!(n!=null&&n.attraction)||!n.showAttractionShape)return!1;const s=Fi(this.ctx,e.clientX,e.clientY),r=Math.max(n.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(s.x-n.attractionCenterX,s.y-n.attractionCenterY)>r)return!1;const a=n.attractionCenterX,c=n.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const h=Fi(this.ctx,u.clientX,u.clientY);n.attractionCenterX=a+h.x-s.x,n.attractionCenterY=c+h.y-s.y},d=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,c)=>{o.centerX=a,o.centerY=c},setRotation:a=>{o.rootRotation=a},setScale:(a,c)=>{o.rootScaleX=a,o.rootScaleY=c}}}const s=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!s||s.visible===!1?null:{x:Number(s.x)||0,y:Number(s.y)||0,rotation:Number(s.rotation)||0,scaleX:Math.max(.05,Number(s.scaleX)||1),scaleY:Math.max(.05,Number(s.scaleY)||1),setPosition:(r,o)=>{s.x=r,s.y=o},setRotation:r=>{s.rotation=r},setScale:(r,o)=>{s.scaleX=r,s.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const n=this.ctx.app(),s=this.ctx.store,r=s.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+n.screen.width/2+s.editor.viewX+t.x*r,c=o.top+n.screen.height*.5+s.editor.viewY+-t.y*r,l=e.clientX,d=e.clientY,u=this.getTool(),h=t.x,f=t.y,p=t.rotation,m=t.scaleX,g=t.scaleY,v=Math.hypot(l-a,d-c)||1,y=Math.atan2(d-c,l-a);Ua(x=>{const T=(x.clientX-l)/r,E=(x.clientY-d)/r;if(u==="translate")t.setPosition(h+T,f-E);else if(u==="rotate"){const S=Math.atan2(x.clientY-c,x.clientX-a);t.setRotation(p-(S-y)*180/Math.PI)}else if(u==="scale"){const C=Math.hypot(x.clientX-a,x.clientY-c)/v;t.setScale(Math.max(.05,m*C),Math.max(.05,g*C))}})}}function xx(i,e,t,n,s){const r=1-s;return r*r*r*i+3*r*r*s*e+3*r*s*s*t+s*s*s*n}function wx(i,e,t){const n=i.rotation*Math.PI/180,s=Math.cos(n),r=Math.sin(n),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1));return{x:i.x+s*e*o-r*t*a,y:i.y+r*e*o+s*t*a}}function dv(i,e){if(!i.points.length)return null;if(i.points.length===1)return{...wx(i,i.points[0].x,i.points[0].y),angle:i.rotation};const t=i.closed?i.points.length:i.points.length-1,n=[];let s=0;for(let p=0;p0&&v===0)continue;const y=v/20,b=xx(m.x,m.x+m.outX,g.x+g.inX,g.x,y),x=xx(m.y,m.y+m.outY,g.y+g.inY,g.y,y),T=wx(i,b,x),E=n[n.length-1];E&&(s+=Math.hypot(T.x-E.x,T.y-E.y)),n.push({...T,distance:s})}}const r=Math.min(1,Math.max(0,e))*s;let o=n.findIndex(p=>p.distance>=r);o<0&&(o=n.length-1);const a=n[o],c=n[Math.max(0,o-1)],l=n[Math.min(n.length-1,o+1)],d=c.distance,u=o>0?(r-d)/Math.max(1e-4,a.distance-d):0,h=c.x+(a.x-c.x)*Math.min(1,Math.max(0,u)),f=c.y+(a.y-c.y)*Math.min(1,Math.max(0,u));return{x:h,y:f,angle:Math.atan2(l.y-c.y,l.x-c.x)*180/Math.PI}}function vV(i,e,t){if(e.renderLayerMode!=="slot")return null;const n=i.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.status==="ready");if(!n)return null;const s=n.slots||[],r=s.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=s.filter(c=>c.orderl.order-c.order)[0];if(!a)return null;o=a.name}return{spineId:n.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:n.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function ku(i,e,t,n=Math.max(1e-4,Math.abs(i.rootScaleX)),s=Math.max(1e-4,Math.abs(i.rootScaleY))){const r=-i.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-i.centerX,l=-t+i.centerY;return{x:(o*c+a*l)/n,y:(-a*c+o*l)/s}}function bV(i,e,t){const n=dv(e,t);if(!n)return null;const s=ku(i,n.x,n.y),r=n.angle*Math.PI/180,o=ku(i,n.x+Math.cos(r),n.y+Math.sin(r)),a=Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI;return{...s,angle:a}}function yV(i,e){return i.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const n=i.paths.find(d=>d.id===t.followPathId&&d.enabled);if(!(n!=null&&n.points.length))return t;const s=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/s)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?i.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,YC(o,r,a))),l=dv(n,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class xV{constructor(){A(this,"emitters",new Map);A(this,"configs",new Map);A(this,"store",null);A(this,"eventsSuspended",!1);A(this,"subEmitterState",new Map);A(this,"slotGroups",new Map)}sync(e,t,n,s,r=null){this.store=e;for(const[c,l]of this.emitters){const d=e.systems.find(u=>u.id===c);(!d||this.configs.get(c)!==d.config)&&(l.removeFromParent(),l.destroy({children:!0}),this.emitters.delete(c),this.configs.delete(c))}for(const c of e.systems){n&&!c.config.texture&&(c.config.texture=n);const l=fr(c.config);if(s)for(const u of l.trailResources)!u.texture&&(u.previewUrl==="/images/trail.png"||u.previewUrl==="/trails/trail.png")&&(u.texture=s);if(n)for(const u of l.imageResources)!u.texture&&u.textureName==="star"&&(u.texture=n);if(this.emitters.has(c.id))continue;const d=new xy(c.config);d.onParticleEvent=u=>this.handleParticleEvent(c.id,u),t.addChild(d),this.emitters.set(c.id,d),this.configs.set(c.id,c.config)}const o=ja(e.systems);for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;l.onParticleEvent||(l.onParticleEvent=u=>this.handleParticleEvent(c.id,u));const d=o.has(c.id);this.subEmitterState.get(c.id)!==d&&(d&&l.clear(),this.subEmitterState.set(c.id,d)),l.setAutoEmission(!d)}const a=new Set;for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;const d=r&&c.config.renderLayerMode==="slot"?r.getDrawOrder(c.config.renderLayerSpineId):null,u=vV(e.spines,c.config,d),h=u&&r?this.ensureSlotGroup(u,r,c.config):null;h?(a.add(h.key),l.parent!==h.compensator&&h.compensator.addChild(l)):l.parent!==t&&t.addChild(l)}for(const[c,l]of[...this.slotGroups])if(!a.has(c)){for(const d of[...l.compensator.children])d instanceof xy&&d.parent===l.compensator&&t.addChild(d);r==null||r.detachSlotObject(l.spineId,l.slotName,l.wrapper),l.wrapper.removeFromParent(),l.wrapper.removeChild(l.compensator),l.compensator.destroy(),l.wrapper.destroy(),this.slotGroups.delete(c)}}ensureSlotGroup(e,t,n){const s=`${e.spineId}:${e.targetSlotName}:${n.renderLayerSlotPosition}`;let r=this.slotGroups.get(s);if(!r){const o=new Mn,a=new Mn;o.addChild(a),r={key:s,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:n.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(s,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const n of this.slotGroups.values()){if(!n.attached||!n.wrapper.parent)continue;const s=e.spines.find(o=>o.id===n.spineId);if(!s)continue;const r=t.getSlotParentMatrix(n.spineId,n.slotName,s);r&&(r.invert(),n.compensator.transform.setFromMatrix(r))}}suspendEvents(e){this.eventsSuspended=e}handleParticleEvent(e,t){if(this.eventsSuspended)return;const n=this.store;if(!n)return;const s=n.systems.find(o=>o.id===e),r=s==null?void 0:s.config;if(!(!(r!=null&&r.eventEnabled)||!Array.isArray(r.events)||!r.events.length)&&!(t.depth>=2))for(const o of r.events){if(o.event!==t.kind||o.event==="collision"&&t.collisionCount>o.collisionLimit||o.targetSystemId<=0||o.targetSystemId===e)continue;const a=Math.min(1,Math.max(0,Number(o.probability)||0));if(a<=0)continue;const c=(Math.imul(o.id+1,2654435761)^Math.imul(t.depth+1,2246822507))>>>0;if(Dr(r.seed>>>0,t.spawnId+1,c)>=a)continue;const d=this.emitters.get(o.targetSystemId);if(!d)continue;const u=Array.isArray(o.inherit)?o.inherit:[],h=u.length?{attributes:u,colorMode:o.colorInheritMode==="replace"?"replace":"add",data:{colorHex:t.colorHex,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,life:t.maxLife}}:void 0;d.spawnEventParticle(t.worldX,t.worldY,t.depth+1,h)}}destroy(e){for(const t of this.slotGroups.values()){for(const n of[...t.compensator.children])t.compensator.removeChild(n);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,n]of this.emitters)n.removeFromParent(),n.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function wV(){const[i,e]=await Promise.all([tt.fromURL("/images/star.png"),tt.fromURL("/images/trail.png")]);return{dotTex:i,trailTex:e}}function SV(i,e,t){for(const n of i.systems){n.config.texture=e;const s=fr(n.config);if(t)for(const r of s.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of s.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const CV={class:"stage-wrap"},AV=Zt({__name:"Stage",setup(i){const e=Zo(),t=Re(null),n=Re(null),s=Re(!1),r=Re(!1),o=Re(""),a=Re(!1);e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);let c=null,l=null,d=null,u=null,h=null,f=null,p=null,m=null,g=null,v=null,y=null,b=null,x=null,T=null,E=null,S=null,C=[],M=0,k=0,P=0,I=0,N=null,$=null;const j=new Ep,B=new xV,Y={store:e,holder:t,app:()=>c},U=new mV(Y),D=new gV(Y,()=>o.value);let L=[];const R=new Map;function X(){d=new Mn,c.stage.addChild(d),E=new Mn,c.stage.addChild(E),j.createSprite(d),T=new ti,d.addChild(T),S=new N3,d.addChild(S.container),h=new ti,d.addChild(h),u=new ti,d.addChild(u),p=new ti,d.addChild(p),m=new ti,d.addChild(m),g=new ti,d.addChild(g),v=new ti,d.addChild(v),y=new ti,d.addChild(y),b=new ti,d.addChild(b),x=new ti,d.addChild(x),f=new ti,d.addChild(f)}function z(J){if(J.button===0){if(o.value&&D.selectedTransformTarget()){D.onGizmoDown(J);return}U.onPointerDown(J)||D.onColliderPointerDown(J)||D.onAttractionDown(J)||D.onForceFieldDown(J)||G5(Y,J.clientX,J.clientY)}}function K(J){U.onStageDoubleClick(J)}function Z(J){!e.settings.unsavedChangesPrompt||!wr.dirty||(J.preventDefault(),J.returnValue="")}function ae(J){H5(Y,J)}function ce(J=!0){Ep.clearStoreBackground(e,J)}async function ve(J){await Ep.handleFileChange(e,J)}_U({canvasElement:t,canvasFocused:a,undo:ZA,save:()=>window.dispatchEvent(new Event(zm)),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:J=>{o.value=J}});function we(){d&&B.sync(e,d,N,$,S)}function re(J,ie,se,G){const H=Math.max(2,Math.floor(G)||2);if(J.config.mode==="stream"&&J.config.streamBehavior==="loop"){rx(J,ie,se,H);return}ie.reset();const O=1/Math.max(1,se),V=[];for(let W=0;W=ie)continue;const O=B.emitters.get(H.id);O&&re(H,O,J,ie)}}finally{B.suspendEvents(!1)}e.systems.every(H=>{var O;return(((O=H.frames)==null?void 0:O.length)||0)>=ie})&&(e.timeline.recorded=!0)}function q(){var se,G,H,O;I=requestAnimationFrame(q);const J=performance.now()/1e3;let ie=J-M;if(M=J,ie>.1&&(ie=.1),c&&d){d.scale.set(e.editor.viewScale),d.position.set(c.screen.width/2+e.editor.viewX,c.screen.height*.5+e.editor.viewY),j.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),y3(e,c,T,E,C);const V=Math.max(1,e.timeline.fps),W=e.timeline.frame,ee=W/V;S==null||S.sync(e.spines,W,V),we(),B.updateRenderCompensation(e,S),L=yV(e,ee);for(const ft of e.systems){const Oe=B.emitters.get(ft.id);if(!Oe)continue;Oe.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const ot=ft.visible!==!1;Oe.visible=ot,Oe.renderable=ot;const Te=ft.config;Oe.scale.set(Te.rootScaleX,Te.rootScaleY);const ue=new Set(Te.collisionColliderIds);Oe.setColliders(Te.collision?L.filter(xt=>ue.has(xt.id)):[]),Oe.setEmitterFollowSpawn(0,0,0);let fe={x:Te.centerX,y:Te.centerY,rotation:Te.rootRotation};const nt=Te.emitterFollow&&Te.emitterFollowMode==="bone"?e.spines.find(xt=>xt.id===Te.emitterFollowSpineId&&xt.enabled&&xt.status==="ready"):null,mt=nt&&(S==null?void 0:S.getBoneWorldTransform(nt.id,Te.emitterFollowBoneName))||null,lt=Te.emitterFollow&&Te.emitterFollowMode==="path"?e.paths.find(xt=>xt.id===Te.emitterFollowPathId&&xt.enabled):null,ct=Math.max(.05,Te.emitterFollowDuration),Kn=Math.min(1,Math.max(0,ee/ct)),_i=Math.min(1,Math.max(0,YC(Te.emitterFollowCurve,Kn))),wn=Math.min(1,Math.max(0,Te.emitterFollowOffset)),gi=Te.emitterFollowDirection==="reverse"?(1-wn)*(1-_i):wn+(1-wn)*_i,Bn=lt?dv(lt,gi):null;if(mt){const xt=Te.emitterFollowBoneOffsetX,vi=Te.emitterFollowBoneOffsetY,Jn=mt.x+xt,Ui=mt.y+vi,Un=Te.rootRotation+Te.emitterFollowBoneRotation,Vi=Math.max(1e-4,Math.abs(Te.rootScaleX*Te.emitterFollowBoneScaleX)),Zn=Math.max(1e-4,Math.abs(Te.rootScaleY*Te.emitterFollowBoneScaleY));if(fe={x:Jn,y:Ui,rotation:Un},Te.emitterFollowSpace==="local")Oe.position.set(Jn,-Ui),Oe.rotation=-Un*Math.PI/180,Oe.scale.set(Vi,Zn),Oe.setSimulationTransform(Jn,Ui,Un,Vi,Zn);else{Oe.position.set(Te.centerX,-Te.centerY),Oe.rotation=-Te.rootRotation*Math.PI/180,Oe.scale.set(Vi,Zn),Oe.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation,Vi,Zn);const as=ku(Te,Jn,Ui,Vi,Zn),ho=-(Un-Te.rootRotation);Oe.setEmitterFollowSpawn(as.x,as.y,ho)}}else if(Bn){const xt=Bn.angle+(Te.emitterFollowDirection==="reverse"?180:0),vi=Te.emitterAngleMode==="direction"?xt:Te.rootRotation;if(fe={x:Bn.x,y:Bn.y,rotation:vi},Te.emitterFollowSpace==="local")Oe.position.set(Bn.x,-Bn.y),Oe.rotation=-vi*Math.PI/180,Oe.setSimulationTransform(Bn.x,Bn.y,vi);else{Oe.position.set(Te.centerX,-Te.centerY),Oe.rotation=-Te.rootRotation*Math.PI/180,Oe.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const Jn=ku(Te,Bn.x,Bn.y),Ui=Te.emitterAngleMode==="direction"?-(xt-Te.rootRotation):0;Oe.setEmitterFollowSpawn(Jn.x,Jn.y,Ui)}}else Oe.position.set(Te.centerX,-Te.centerY),Oe.rotation=-Te.rootRotation*Math.PI/180,Oe.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const Pn=Te.shape==="path"&&Te.spawnPathId>0&&e.paths.find(xt=>xt.id===Te.spawnPathId&&xt.enabled&&xt.points.length>0)||null;Oe.setSpawnPathSampler(Pn?xt=>bV(Te,Pn,xt):null,(Pn==null?void 0:Pn.closed)===!0),R.set(ft.id,fe)}let be=0;const ye=[],he=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,Be=(ft,Oe,ot)=>{!ft||ft.id!==he||ft.visible===!1||I3(ye,ot,Oe.position.x,Oe.position.y)},Ae=e.timeline,de=e.playbackRange,ge=Ae.fps,Ve=1/Math.max(1,ge);let qe=P,bt=0;if(Ae.playing?(k+=ie,bt=Math.floor(k/Ve),bt>0&&(k-=bt*Ve)):(k=0,Ee(ge)),Ae.playing&&bt>0)for(let ft=0;ftfe.id===e.activeId),ot=(Oe==null?void 0:Oe.config.mode)==="stream"&&Oe.config.streamBehavior==="loop"?eC(Oe.config,ge):null,ue=Ae.loop&&Ae.abLoop&&(ot==null?void 0:ot.start)===de.start&&ot.end===de.end?de.end-1:de.end;if(Ae.frame>ue)if(Ae.loop)Ae.frame=de.start;else{Ae.frame=de.end,Ae.playing=!1;break}}else{B.suspendEvents(!0);try{const Oe=ja(e.systems);for(const ot of e.systems){const Te=B.emitters.get(ot.id);if(!Te)continue;!Oe.has(ot.id)&&ot.config.mode==="stream"&&ot.config.streamBehavior==="loop"?(se=ot.frames)!=null&&se.length||rx(ot,Te,ge,Ae.totalFrames):Ae.frame===0&&Te.reset()}}finally{B.suspendEvents(!1)}for(const[Oe,ot]of B.emitters){const Te=e.systems.find(lt=>lt.id===Oe),ue=(Te==null?void 0:Te.config.mode)==="stream"&&Te.config.streamBehavior==="loop",fe=ue?(G=Te.frames)==null?void 0:G[Ae.frame]:void 0,nt=Ae.frame===0&&!ue,mt=nt?[]:fe||ot.update(Ve);if(nt?ot.apply([]):fe&&ot.apply(fe),(Te==null?void 0:Te.visible)!==!1)for(const lt of mt)lt.active&&Be(Te,ot,lt);be+=mt.length}for(const Oe of e.systems){if(!Oe.config.texture)continue;Oe.frames=Oe.frames||[];const ot=B.emitters.get(Oe.id);ot&&!(Oe.config.mode==="stream"&&Oe.config.streamBehavior==="loop")&&(Oe.frames[Ae.frame]=ot.capture())}Ae.frame++,Ae.frame>=Ae.totalFrames&&(Ae.frame=de.start,Ae.recorded=!0)}else{Ae.playing||(qe=Ae.frame);for(const ft of e.systems){const Oe=B.emitters.get(ft.id),ot=Ae.playing?P:Ae.frame,Te=(O=ft.frames)==null?void 0:O[ot],ue=ft.config.mode==="stream"&&ft.config.streamBehavior==="loop"&&!!Te;if((Ae.recorded||ue)&&Oe&&Te){Oe.apply(Te);for(const fe of Te)fe.active&&(Be(ft,Oe,fe),be++)}else if(Oe){const fe=Ae.frame===0?[]:Oe.update(0);if(Ae.frame===0&&Oe.apply([]),ft.visible!==!1)for(const nt of fe)nt.active&&Be(ft,Oe,nt);be+=Oe.activeCount}}}P=qe,S==null||S.sync(e.spines,qe,ge);for(const[,ft]of B.emitters)ft.drawTrailMeshDebug(e.settings.showSkinMesh);P3(e,L,y),k3(e,U.selectedNodes,b),E3(e,S,h),x3(e,R,u),w3(e,R,p),S3(e,m),C3(e,g),A3(e,v),_3(o,D.selectedTransformTarget.bind(D),x),R3(ye,e,f),n.value&&(n.value.systems=e.systems.length,n.value.particles=be)}}return Ti(async()=>{const J=t.value;c=new TS({width:J.clientWidth||800,height:J.clientHeight||600,backgroundAlpha:0,antialias:!0}),J.appendChild(c.view),l=new ResizeObserver(()=>{c&&c.renderer.resize(Math.max(1,J.clientWidth),Math.max(1,J.clientHeight))}),l.observe(J),X(),Ut(()=>e.settings.backgroundImageData,se=>j.syncTexture(se),{immediate:!0});const ie=await wV();N=ie.dotTex,$=ie.trailTex,SV(e,N,$),n.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,k=0,P=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const se of e.systems)se.frames=[];e.recalcTotalFrames(),M=performance.now()/1e3,q(),Ut(()=>e.systems.map(se=>JSON.stringify(se.config,(G,H)=>G==="texture"||G==="trailTexture"||G==="previewUrl"?void 0:H)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const se of e.systems)se.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),AU(e),window.addEventListener("beforeunload",Z)}),nl(()=>{window.removeEventListener("beforeunload",Z),cancelAnimationFrame(I),l==null||l.disconnect(),l=null,S==null||S.destroy(),S=null,j.destroy(),d&&c&&B.destroy(d),c&&(c.destroy(!0,{children:!0}),c=null)}),Ut(()=>[e.activeObjectType,e.activeObjectId],()=>U.resetSelection()),(J,ie)=>(Q(),te("div",CV,[w("div",{ref_key:"holder",ref:t,class:Pe(["stage-holder",{grid:_(e).settings.showGrid}]),tabindex:"0",onWheel:We(ae,["prevent"]),onPointerdown:z,onDblclick:We(K,["prevent"])},null,34),w("img",{class:Pe(["stage-watermark",{"watermark-left-panel":!_(e).settings.parameterPanelOnRight}]),src:v3,alt:"","aria-hidden":"true"},null,2),Ce(L8,{ctx:Y,"active-tool":o.value,hud:n.value,"show-settings":s.value,"show-help":r.value,"onUpdate:activeTool":ie[0]||(ie[0]=se=>o.value=se),"onUpdate:showSettings":ie[1]||(ie[1]=se=>s.value=se),"onUpdate:showHelp":ie[2]||(ie[2]=se=>r.value=se),onClearBackground:ce,onBackgroundFile:ve},null,8,["active-tool","hud","show-settings","show-help"]),Ce(pV,{show:s.value,onClose:ie[3]||(ie[3]=se=>s.value=!1)},null,8,["show"]),Ce(j5,{show:r.value,onClose:ie[4]||(ie[4]=se=>r.value=!1)},null,8,["show"])]))}}),TV=dn(AV,[["__scopeId","data-v-9119521a"]]),EV=[{x:0,y:0},{x:1,y:1}],Hm=[{x:0,y:1},{x:1,y:1}],_V=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],Gm=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],Wm=[{x:0,y:1},{x:1,y:1}],qm=[{x:0,y:1},{x:1,y:1}],hn=qo({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let xd=0;function MV(i){return new Promise(e=>window.setTimeout(e,i))}function iT(i,e){const t=++xd,n=performance.now();Object.assign(hn,{visible:!0,title:i,detail:e,progress:0,indeterminate:!1,failed:!1});const s=(o,a)=>{t===xd&&(hn.indeterminate=o==null,o!=null&&(hn.progress=Math.min(100,Math.max(0,o))),a&&(hn.detail=a))},r=async(o,a)=>{if(t!==xd)return;hn.failed=o,hn.indeterminate=!1,hn.progress=o?hn.progress:100,hn.detail=a,await MV(Math.max(180,(o?850:450)-(performance.now()-n))),t===xd&&(hn.visible=!1)};return{update:s,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o=ke("transfer.completed"))=>r(!1,o),fail:(o=ke("transfer.failed"))=>r(!0,o)}}async function PV(i,e){if(!i.body)return e(null),i.text();const t=Number(i.headers.get("content-length")),n=Number.isFinite(t)&&t>0,s=i.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(n?0:null);;){const{done:c,value:l}=await s.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(n?Math.min(1,o/t):null)}return a+=r.decode(),n&&e(1),a}const kV="3.8";function Li(i,e,t){i[e]==null&&i[t]!=null&&(i[e]=i[t]),delete i[t]}function Km(i){if(!i||typeof i!="object")return;if(Array.isArray(i)){for(const t of i)Km(t);return}const e=i;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Km(t)}function IV(i){for(const e of i.bones)Li(e,"transform","inherit");for(const e of i.transform||[])Li(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Li(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of i.path||[])Li(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of i.skins)for(const t of Object.values(e.attachments||{}))for(const n of Object.values(t||{}))n.parent!=null&&Li(n,"deform","timelines")}function RV(i){for(const e of Object.values(i.slots||{}))Li(e,"color","rgba"),Li(e,"twoColor","rgba2")}function FV(i){for(const e of Object.values(i.bones||{}))for(const t of e.rotate||[])Li(t,"angle","value")}function LV(i){for(const e of Object.values(i.transform||{}))for(const t of e)Li(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Li(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function DV(i){for(const e of Object.values(i.path||{})){for(const t of["position","spacing"])for(const n of e[t]||[])Li(n,t,"value");for(const t of e.mix||[])Li(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function OV(i){if(!i.attachments)return;const e=i.deform||(i.deform={});for(const[t,n]of Object.entries(i.attachments)){const s=e[t]||(e[t]={});for(const[r,o]of Object.entries(n)){const a=s[r]||(s[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete i.attachments}function NV(i){i.skeleton.spine=kV,IV(i);for(const e of Object.values(i.animations))RV(e),FV(e),LV(e),DV(e),OV(e);return Km(i.animations),i}function $V(i,e,t,n,s=!1){if(s){let c=0;for(let l=0;l[...s].sort((a,c)=>a-c);let o=!0;for(;o;){o=!1;const a=r();for(let c=0;cf&&(f=m,h=p)}h>=0&&(s.add(h),o=!0)}}return r().map(a=>i[a])}function Sx(i,e,t,n,s){const r=t-e+1;if(r<2)return 0;const o=s?e:t,a=s?e+1:t-1,c=s?e+2:t-2,l=Math.abs(i[a].frame-i[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(i[c].frame-i[a].frame)-l)<1e-6){const u=i[o].values[n],h=i[a].values[n],f=i[c].values[n];return s?(-3*u+4*h-f)/(2*l):(3*u-4*h+f)/(2*l)}const d=i[a].frame-i[o].frame;return d?(i[a].values[n]-i[o].values[n])/d:0}function Cx(i,e,t){const n=i[t].frame-i[e].frame,s=[];for(let r=0;rh.values[r])),l=Math.max(...i.slice(e,t+1).map(h=>h.values[r])),d=o+Sx(i,e,t,r,!0)*n/3,u=a-Sx(i,e,t,r,!1)*n/3;s.push([Math.max(c,Math.min(l,d)),Math.max(c,Math.min(l,u))])}return{values:s}}function BV(i,e,t,n,s){const r=1-s;return r*r*r*i+3*r*r*s*e+3*r*s*s*t+s*s*s*n}function UV(i,e,t,n,s,r=!1){if(r){let l=0;for(let d=0;d[...s].sort((c,l)=>c-l);let o=!0;for(;o;){o=!1;const c=r();for(let l=0;lm&&(m=v,p=g)}p>=0&&(s.add(p),o=!0)}}const a=r();return{samples:a.map(c=>i[c]),controls:a.slice(0,-1).map((c,l)=>Cx(i,c,a[l+1]))}}function VV(i){if(!i.length)return[];const e=[i[0]];for(let t=1;t180;)n-=360;for(;n-e[t-1]<-180;)n+=360;e.push(n)}return e}function gn(i){if(!Number.isFinite(i))return 0;const e=Math.round(i*1e5)/1e5;return Object.is(e,-0)?0:e}function XV(i,e,t,n){const s=Math.max(2,Math.min(16,Math.round(Number(i.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(i.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),c=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,d=Math.cos(l),u=Math.sin(l),h=[],f=[],p=[],m=[],g=[];for(let b=0;b=0;b--)g.push({col:b,row:s-1});for(let b=s-2;b>=1;b--)g.push({col:0,row:b});const v=g.length;for(let b=1;b|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function oT(i,e){let t=i,n=2;for(;e.has(t);)t=`${i}_${n++}`;return e.add(t),t}function zV(i){return i.replace(/\.[^./\\]+$/,"")}function aT(i,e){return zV([i,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function jV(i){var n,s;const e=Number(((n=i==null?void 0:i.orig)==null?void 0:n.width)??(i==null?void 0:i.width))||0,t=Number(((s=i==null?void 0:i.orig)==null?void 0:s.height)??(i==null?void 0:i.height))||0;return{width:e,height:t}}function Sd(i){return Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function Mx(i,e){return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255,Math.max(0,Math.min(1,e))]}function Xl(i,e){return gn(i/e)}function HV(i,e){const t=i.config,n=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),s=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=s+n:t.streamBehavior!=="loop"?r=s+Math.max(1/e,Number(t.duration)||0)+n:r=s+Ji(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function GV(i,e,t){const n=i.config;if(n.mode!=="stream"||n.streamBehavior!=="loop")return new Set;const s=eC(n,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(s.start*r),Math.round(s.end*r)])}function Iu(i,e){return e?i.boneName:`${i.spawnId??"legacy"}_${i.boneName}`}function WV(i,e,t,n){const s=new Set;for(const r of i)for(const o of r)s.add(Iu(o,e));return[...s].sort().map((r,o)=>({key:r,name:oT(`${n}_${o}`,t),states:i.map(a=>a.find(c=>Iu(c,e)===r)||null)}))}function Px(i,e){const t=new Set(e.states.map(n=>n==null?void 0:n.resourceId).filter(n=>typeof n=="number"));return i.config.imageResources.filter(n=>t.has(n.id))}function qV(i,e,t,n){const s=e*t/n,r=Math.min(i.states.length-1,Math.max(0,Math.floor(s))),o=Math.min(i.states.length-1,r+1),a=i.states[r],c=i.states[o];if(!a||!c||Iu(a,!0)!==Iu(c,!0)||a.spawnId!==c.spawnId)return a;const l=s-r;if(l<=1e-6)return a;const d=(h,f)=>(h??0)+((f??h??0)-(h??0))*l,u=a.trailState&&c.trailState&&a.trailState.resourceId===c.trailState.resourceId?{...a.trailState,width:d(a.trailState.width,c.trailState.width),alpha:d(a.trailState.alpha,c.trailState.alpha),bones:a.trailState.bones.map((h,f)=>{const p=c.trailState.bones[f]||h;return{...h,worldX:d(h.worldX??h.x,p.worldX??p.x),worldY:d(h.worldY??h.y,p.worldY??p.y),worldRotation:d(h.worldRotation??-h.rotation,p.worldRotation??-p.rotation)}})}:a.trailState;return{...a,worldX:d(a.worldX,c.worldX),worldY:d(a.worldY,c.worldY),worldRotation:d(a.worldRotation,c.worldRotation),worldScaleX:d(a.worldScaleX,c.worldScaleX),worldScaleY:d(a.worldScaleY,c.worldScaleY),alpha:d(a.alpha,c.alpha),trailState:u}}function kx(i,e){return!i||i==="跟随导出"?e.keyframeCurve:i==="贝塞尔"?"bezier":"linear"}function ha(i,e,t,n,s,r=new Set,o=new Set,a=s.keyframeCurve){if(!i.length)return[];const c=new Set(r);for(const u of o)c.add(u);const l=a==="bezier"&&s.spineVersion!=="3.8"?rT(i,n,c,o):{samples:sT(i,n,c,o),controls:[]},d=l.samples.map(u=>{const h={time:Xl(u.frame,e)};return t.forEach((f,p)=>{h[f]=gn(u.values[p])}),o.has(u.frame)&&(h.curve="stepped"),h});for(let u=0;u0&&s&&e.add(t-1),n&&e.add(t))}return e}function JV(i){const e=new Set;for(let t=0;t0&&s&&e.add(t-1),n&&e.add(t))}return e}function eX(i,e){var n;if(!i.shapeEnabled||!((n=i.shapeCurve)!=null&&n.length))return 1;const t=[...i.shapeCurve].sort((s,r)=>s.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let s=1;s{(o!==r||n.has(a))&&(s.push(t(o,a)),r=o)}),s}function nX(i,e,t){const n=i.imageMode==="sequence"?i.sequenceFrames[e]:void 0,s=(n==null?void 0:n.name)||i.textureName||`image_${i.id}`,r=(n==null?void 0:n.texture)||i.texture,o=jV(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:ke("errors.missingImageWarning",{file:s})});const a=o.width||1,c=o.height||1;return{path:aT(i.textureFolder,s),x:gn((.5-i.anchorX)*a),y:gn((i.anchorY-.5)*c),width:gn(a),height:gn(c)}}function Ix(i,e){const t=[];for(const s of e){const r=s.imageMode==="sequence"?Math.max(1,s.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((s,r)=>[s,n?`${i}_${r}`:i]))}function iX(i,e,t,n,s=n.keyframeCurve,r=new Set,o=new Set){if(!i.length)return[];const a=new Set;for(let h=1;h({frame:f,values:h})),l=1/255,d=s==="bezier"&&n.spineVersion!=="3.8"?rT(c,[l,l,l,.01],a,r):{samples:sT(c,[l,l,l,.01],a,r),controls:[]},u=d.samples.map(h=>{const f={time:Xl(h.frame,t),color:`${Sd(h.values[0])}${Sd(h.values[1])}${Sd(h.values[2])}${Sd(h.values[3])}`};return r.has(h.frame)&&(f.curve="stepped"),f});if(d.controls.length)for(let h=0;h({time:Xl(p,s),name:f??null}),c);d.length&&(l.attachment=d);const u=iX(n,t,s,r,o,a,c);u.length&&(l.rgba=u)}function Fx(i){var m;const e=i.settings,t=Math.max(1,Number(i.timeline.fps)||30),n=Math.max(1,Math.round(e.fps||30)),s=e.integerFrameAlignment?n:t,r=[],o=i.systems.filter(g=>g.visible!==!1),a=ja(i.systems),c={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(c.skeleton.fps=n);const l=c.skins[0].attachments,d=new Set(["root"]),u=[...new Set([...i.timeline.animations.length?i.timeline.animations:["animation"],...o.map(g=>g.animation||"animation")])],h=new Map;for(const g of o){const v=((m=g.frames)==null?void 0:m.length)||0,y=a.has(g.id)?v:Math.min(v,HV(g,t)),b=(g.frames||[]).slice(0,y);b.length||r.push({code:"empty-cache",message:ke("errors.emptyCacheWarning",{name:g.config.name})});const x=oT(YV(g.config.name,`system_${g.id}`),d);c.bones.push({name:x,parent:"root"});const T=WV(b,e.bonePool,d,x),E=Math.max(0,(y-1)/t),S=Math.max(1,Math.ceil(E*s)+1),C=GV(g,t,s),M=h.get(g.animation)||[];M.push({system:g,tracks:T,targetFrames:S,boundaryFrames:C,attachmentPrefix:x}),h.set(g.animation,M);for(const k of T){c.bones.push({name:k.name,parent:x});const P=Px(g,k),I=new Set(P.map(Y=>Y.blend)),N=[],$=[];for(const Y of I){const U=`${k.name}_${Y}`;N.push(U),c.slots.push({name:U,bone:k.name,color:"ffffff00",blend:Ax[Y]});const D=l[U]||(l[U]={}),L=P.filter(X=>X.blend===Y),R=Ix(x,L);for(const X of L){const z=X.imageMode==="sequence"?Math.max(1,X.sequenceFrames.length):1;for(let K=0;K{var K;return((K=z==null?void 0:z.trailState)==null?void 0:K.resourceId)===Y.id}))continue;const U=Math.max(2,Math.min(16,Math.round(Y.boneCount||3))),D=[];for(let z=0;zc.bones.findIndex(K=>K.name===z)),X=aT("",Y.textureName||`trail_${Y.id}`);(l[L]||(l[L]={}))[`trail_${Y.id}`]=XV(g.config,Y,R,X),Y.texture||r.push({code:"missing-image",message:ke("errors.missingTrailImageWarning",{file:Y.textureName||Y.id})})}const j=new Set([...N,...$]),B=c.slots.filter(Y=>j.has(String(Y.name)));B.length&&(c.slots=c.slots.filter(Y=>!B.includes(Y)),c.slots.push(...B.filter(Y=>$.includes(String(Y.name))),...B.filter(Y=>N.includes(String(Y.name)))))}}for(const g of u){const v=h.get(g)||[],y={bones:{},slots:{}};let b=!1;for(const{system:x,tracks:T,targetFrames:E,boundaryFrames:S,attachmentPrefix:C}of v)for(const M of T){const k=Array.from({length:E},(Z,ae)=>qV(M,ae,t,s)),P=k.map(Z=>!!(Z!=null&&Z.active)),I=[],N=[],$=[];k.forEach((Z,ae)=>{Z!=null&&Z.active&&(I.push({frame:ae,values:[Z.worldX??Z.x,Z.worldY??Z.y]}),N.push(Z.worldRotation??Z.rotation),$.push({frame:ae,values:[Z.worldScaleX??Z.scaleX,Z.worldScaleY??Z.scaleY]}))});const j=VV(N),B=I.map((Z,ae)=>({frame:Z.frame,values:[j[ae]??0]})),Y=KV(k);for(const Z of S)Y.add(Z);const U=JV(k),D={},L=ha(I,s,["x","y"],[Tx,Tx],e,Y,U),R=ha(B,s,["value"],[_x],e,Y,U),X=ha($,s,["x","y"],[wd,wd],e,Y,U);L.length&&(D.translate=L),R.length&&(D.rotate=R),X.length&&(D.scale=X),Object.keys(D).length&&(y.bones[M.name]=D,b=!0);const z=Px(x,M),K=new Set(z.map(Z=>Z.blend));for(const Z of K){const ae=z.filter(J=>J.blend===Z),ce=Ix(C,ae),ve=[],we=[];let re=16777215;for(let J=0;JO.id===ie.resourceId):void 0,G=!!ie&&P[J]&&ie.imageVisible!==!1&&(se==null?void 0:se.blend)===Z;ie&&(se==null?void 0:se.blend)===Z&&(re=ie.colorHex);const H=G?ce.get(`${se.id}_${ie.imageFrameIndex??0}`):void 0;ve.push(H??null),we.push(Mx(re,G?ie.alpha:0))}const Ee=ae.filter(J=>J.independentAlpha==="curve").map(J=>kx(J.alphaCurveMode,e)),q=Ee.length?Ee.includes("bezier")?"bezier":"linear":kx(x.config.alphaMode==="curve"?x.config.curveMode:void 0,e);Rx(y,`${M.name}_${Z}`,ve,we,s,e,q,U,S),ve.some(Boolean)&&(b=!0)}if(x.config.trail)for(const Z of x.config.trailResources){const ae=Math.max(2,Math.min(16,Math.round(Z.boneCount||3))),ce=k.map(H=>{var O;return((O=H==null?void 0:H.trailState)==null?void 0:O.resourceId)===Z.id?H.trailState:void 0}),ve=ce.find(H=>!!H);if(!ve)continue;const we=QV(ce),re=ZV(ce),Ee=Z.widthSizeMode==="random"?Math.max(1,Number(Z.widthMin)||0,Number(Z.widthMax)||0):Math.max(.001,Number(Z.width)||100);let q=ve;const J=ce.map(H=>(H&&(q=H),q));for(let H=0;H{const qe=ge==null?void 0:ge.bones[Math.min(ge.bones.length-1,H)];if(!qe)return;const bt={x:qe.worldX??qe.x,y:qe.worldY??qe.y,rotation:qe.worldRotation??-qe.rotation};O.push({frame:Ve,values:[bt.x,bt.y]}),V.push({frame:Ve,values:[bt.rotation]}),W.push({frame:Ve,values:[1,Math.max(0,ge.width/Ee)*be]})});const ye=`${M.name}_trail_${Z.id}_${H}`,he={},Be=ha(O,s,["x","y"],[Ex,Ex],e,ee,re),Ae=ha(V,s,["value"],[_x],e,ee,re),de=ha(W,s,["x","y"],[wd,wd],e,ee,re);Be.length&&(he.translate=Be),Ae.length&&(he.rotate=Ae),de.length&&(he.scale=de),Object.keys(he).length&&(y.bones[ye]=he)}const ie=ce.map(()=>`trail_${Z.id}`);let se=ve.colorHex;const G=ce.map(H=>(H&&(se=H.colorHex),Mx(se,H?H.alpha:0)));Rx(y,`${M.name}_trail_${Z.id}`,ie,G,s,e,e.keyframeCurve,re,S),b=!0}}(b||!e.excludeEmptyAnimations)&&(c.animations[g]=y)}!Object.keys(c.animations).length&&!e.excludeEmptyAnimations&&(c.animations.animation={bones:{},slots:{}});const f=e.spineVersion==="3.8"?NV(c):c,p=JSON.stringify(f,null,2);return{json:f,text:p,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(f.animations).length,boneCount:f.bones.length}}function sX(i,e){const t=new Blob([i.text],{type:"application/json;charset=utf-8"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}class rte{constructor(){A(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class rX{constructor(){A(this,"entries",{});A(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let n=0,s=e.length;n1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>`0${(t*255).toString(16)}`.slice(-2);return+`0x${e(this.r)}${e(this.g)}${e(this.b)}`}static fromString(e,t=new wi){return t.setFromString(e)}};A(wi,"WHITE",new wi(1,1,1,1)),A(wi,"RED",new wi(1,0,0,1)),A(wi,"GREEN",new wi(0,1,0,1)),A(wi,"BLUE",new wi(0,0,1,1)),A(wi,"MAGENTA",new wi(1,0,1,1));let at=wi;const rn=class rn{static clamp(e,t,n){return en?n:e}static cosDeg(e){return Math.cos(e*rn.degRad)}static sinDeg(e){return Math.sin(e*rn.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*rn.radDeg}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return rn.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,n){const s=Math.random(),r=t-e;return s<=(n-e)/r?e+Math.sqrt(s*r*(n-e)):t-Math.sqrt((1-s)*r*(t-n))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};A(rn,"epsilon",1e-5),A(rn,"epsilon2",rn.epsilon*rn.epsilon),A(rn,"PI",3.1415927),A(rn,"PI2",rn.PI*2),A(rn,"invPI2",1/rn.PI2),A(rn,"radiansToDegrees",180/rn.PI),A(rn,"radDeg",rn.radiansToDegrees),A(rn,"degreesToRadians",rn.PI/180),A(rn,"degRad",rn.degreesToRadians);let Fe=rn;const Pi=class Pi{apply(e,t,n){return t===void 0||n===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(n)}};A(Pi,"linear",new class extends Pi{applyInternal(e){return e}}),A(Pi,"smooth",new class extends Pi{applyInternal(e){return e*e*(3-2*e)}}),A(Pi,"slowFast",new class extends Pi{applyInternal(e){return e*e}}),A(Pi,"fastSlow",new class extends Pi{applyInternal(e){return(e-1)*(e-1)*-1+1}}),A(Pi,"circle",new class extends Pi{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let Va=Pi;class oX extends Va{constructor(t){super();A(this,"power",2);this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class ote extends oX{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Vr=class Vr{static arrayCopy(e,t,n,s,r){for(let o=t,a=s;o=t?e:Vr.setArraySize(e,t,n)}static newArray(e,t){const n=[];for(let s=0;s0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class cte{constructor(e=32){A(this,"values");A(this,"addedValues",0);A(this,"lastValue",0);A(this,"mean",0);A(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{d.width=parseInt(n[1]),d.height=parseInt(n[2])},s.format=()=>{},s.filter=d=>{d.minFilter=Ze.enumValue(Wa,n[1]),d.magFilter=Ze.enumValue(Wa,n[2])},s.repeat=d=>{n[1].indexOf("x")!==-1&&(d.uWrap=qa.Repeat),n[1].indexOf("y")!==-1&&(d.vWrap=qa.Repeat)},s.pma=d=>{d.pma=n[1]==="true"};var r={};r.xy=d=>{d.x=parseInt(n[1]),d.y=parseInt(n[2])},r.size=d=>{d.width=parseInt(n[1]),d.height=parseInt(n[2])},r.bounds=d=>{d.x=parseInt(n[1]),d.y=parseInt(n[2]),d.width=parseInt(n[3]),d.height=parseInt(n[4])},r.offset=d=>{d.offsetX=parseInt(n[1]),d.offsetY=parseInt(n[2])},r.orig=d=>{d.originalWidth=parseInt(n[1]),d.originalHeight=parseInt(n[2])},r.offsets=d=>{d.offsetX=parseInt(n[1]),d.offsetY=parseInt(n[2]),d.originalWidth=parseInt(n[3]),d.originalHeight=parseInt(n[4])},r.rotate=d=>{const u=n[1];u==="true"?d.degrees=90:u!=="false"&&(d.degrees=parseInt(u))},r.index=d=>{d.index=parseInt(n[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(n,o)===0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const d=new cT(a,o);for(;;){const u=t.readEntry(n,o=t.readLine());if(u===0)break;const h=r[n[0]];if(h)h(d);else{c||(c=[]),l||(l=[]),c.push(n[0]);const f=[];for(let p=0;p0&&l&&l.length>0&&(d.names=c,d.values=l,c=null,l=null),d.u=d.x/a.width,d.v=d.y/a.height,d.degrees===90?(d.u2=(d.x+d.height)/a.width,d.v2=(d.y+d.width)/a.height):(d.u2=(d.x+d.width)/a.width,d.v2=(d.y+d.height)/a.height),this.regions.push(d)}else{for(a=new dX(o.trim());t.readEntry(n,o=t.readLine())!==0;){const d=s[n[0]];d&&d(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length===0))return 0;const n=t.indexOf(":");if(n===-1)return 0;e[0]=t.substr(0,n).trim();for(let s=1,r=n+1;;s++){const o=t.indexOf(",",r);if(o===-1)return e[s]=t.substr(r).trim(),s;if(e[s]=t.substr(r,o-r).trim(),r=o+1,s===4)return 4}}}class dX{constructor(e){A(this,"name");A(this,"minFilter",Wa.Nearest);A(this,"magFilter",Wa.Nearest);A(this,"uWrap",qa.ClampToEdge);A(this,"vWrap",qa.ClampToEdge);A(this,"texture",null);A(this,"width",0);A(this,"height",0);A(this,"pma",!1);A(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class cT extends lT{constructor(t,n){super();A(this,"page");A(this,"name");A(this,"x",0);A(this,"y",0);A(this,"offsetX",0);A(this,"offsetY",0);A(this,"originalWidth",0);A(this,"originalHeight",0);A(this,"index",0);A(this,"degrees",0);A(this,"names",null);A(this,"values",null);this.page=t,this.name=n,t.regions.push(this)}}const $u=class $u{constructor(e){A(this,"name");A(this,"timelineAttachment");A(this,"timelineSlots",$u.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,n){let s=e[t];if(s.bone.isActive()){const r=(n?s.getAppliedPose():s.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*c;const l=n.appliedPose.deform;let d=this.vertices;const u=this.bones;if(!u){l.length>0&&(d=l);const m=n.bone.appliedPose,g=m.worldX,v=m.worldY,y=m.a,b=m.b,x=m.c,T=m.d;for(let E=s,S=a;S=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let n=e;const s=(this.start+t).toString();for(let r=this.digits-s.length;r>0;r--)n+="0";return n+=s,n}static nextID(){return Ea._nextID++}};A(Ea,"_nextID",0);let Ja=Ea;var Nn;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Nn||(Nn={}));const dT=[Nn.hold,Nn.once,Nn.loop,Nn.pingpong,Nn.onceReverse,Nn.loopReverse,Nn.pingpongReverse];class uv{constructor(e,t,n){A(this,"name");A(this,"timelines",[]);A(this,"timelineIds");A(this,"bones");A(this,"color",new at(1,1,1,1));A(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=n,this.timelineIds=new rX,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const n=new Set,s=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let h=0,f=u.length;ht)return r-n;return s-n}};function uX(i){return typeof i=="object"&&i!==null&&typeof i.slotIndex=="number"}class ea extends Gt{constructor(t,n,...s){super(t,...s);A(this,"curves");this.curves=Ze.newFloatArray(t+n*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const n=this.getFrameCount()+t*18;if(this.curves.length>n){const s=Ze.newFloatArray(n);Ze.arrayCopy(this.curves,0,s,0,n),this.curves=s}}setBezier(t,n,s,r,o,a,c,l,d,u,h){const f=this.curves;let p=this.getFrameCount()+t*18;s===0&&(f[n]=2+p);const m=(r-a*2+l)*.03,g=(o-c*2+d)*.03,v=((a-l)*3-r+u)*.006,y=((c-d)*3-o+h)*.006;let b=m*2+v,x=g*2+y,T=(a-r)*.3+m+v*.16666667,E=(c-o)*.3+g+y*.16666667,S=r+T,C=o+E;for(let M=p+18;pt){const d=this.frames[n],u=this.frames[n+s];return u+(t-d)/(o[r]-d)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const d=o[r-2],u=o[r-1];return u+(t-d)/(o[r]-d)*(o[r+1]-u)}n+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[n]-c)*(this.frames[n+s]-l)}}class lr extends ea{constructor(e,t,n){super(e,t,n)}getFrameEntries(){return 2}setFrame(e,t,n){e<<=1,this.frames[e]=t,this.frames[e+1]=n}getCurveValue(e){const t=this.frames;let n=t.length-2;for(let r=2;r<=n;r+=2)if(t[r]>e){n=r-2;break}const s=this.curves[n>>1];switch(s){case 0:{const r=t[n],o=t[n+1];return o+(e-r)/(t[n+2]-r)*(t[n+2+1]-o)}case 1:return t[n+1]}return this.getBezierValue(e,n,1,s-2)}getRelativeValue(e,t,n,s,r,o){if(e>2];switch(f){case 0:{const p=u[h];c=u[h+1],l=u[h+2],d=u[h+3];const m=(n-p)/(u[h+4]-p);c+=(u[h+4+1]-c)*m,l+=(u[h+4+2]-l)*m,d+=(u[h+4+3]-d)*m;break}case 1:c=u[h+1],l=u[h+2],d=u[h+3];break;default:c=this.getBezierValue(n,h,1,f-2),l=this.getBezierValue(n,h,2,f+18-2),d=this.getBezierValue(n,h,3,f+36-2)}if(s!==1)if(r===Ge.setup){const p=e.data.setupPose.color;c=p.r+(c-p.r)*s,l=p.g+(l-p.g)*s,d=p.b+(d-p.b)*s}else c=a.r+(c-a.r)*s,l=a.g+(l-a.g)*s,d=a.b+(d-a.b)*s;a.r=c<0?0:c>1?1:c,a.g=l<0?0:l>1?1:l,a.b=d<0?0:d>1?1:d}}class CT extends lr{constructor(t,n,s){super(t,n,`${rt.alpha}|${s}`);A(this,"slotIndex",0);this.slotIndex=s}apply(t,n,s,r,o,a,c,l,d){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const h=(d?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(s1?1:f}}class AT extends Ah{constructor(e,t,n){super(e,t,n,`${rt.rgb}|${n}`,`${rt.alpha}|${n}`,`${rt.rgb2}|${n}`)}getFrameEntries(){return 8}setFrame(e,t,n,s,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=n,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c,this.frames[e+7]=l}apply1(e,t,n,s,r,o){const a=t.color,c=t.darkColor;let l=0,d=0,u=0;const h=this.frames;if(n>3];switch(y){case 0:{const b=h[v];f=h[v+1],p=h[v+2],m=h[v+3],g=h[v+4],l=h[v+5],d=h[v+6],u=h[v+7];const x=(n-b)/(h[v+8]-b);f+=(h[v+8+1]-f)*x,p+=(h[v+8+2]-p)*x,m+=(h[v+8+3]-m)*x,g+=(h[v+8+4]-g)*x,l+=(h[v+8+5]-l)*x,d+=(h[v+8+6]-d)*x,u+=(h[v+8+7]-u)*x;break}case 1:f=h[v+1],p=h[v+2],m=h[v+3],g=h[v+4],l=h[v+5],d=h[v+6],u=h[v+7];break;default:f=this.getBezierValue(n,v,1,y-2),p=this.getBezierValue(n,v,2,y+18-2),m=this.getBezierValue(n,v,3,y+36-2),g=this.getBezierValue(n,v,4,y+54-2),l=this.getBezierValue(n,v,5,y+72-2),d=this.getBezierValue(n,v,6,y+90-2),u=this.getBezierValue(n,v,7,y+108-2)}if(s===1)a.set(f,p,m,g);else if(r===Ge.setup){const b=e.data.setupPose;let x=b.color;a.set(x.r+(f-x.r)*s,x.g+(p-x.g)*s,x.b+(m-x.b)*s,x.a+(g-x.a)*s),x=b.darkColor,l=x.r+(l-x.r)*s,d=x.g+(d-x.g)*s,u=x.b+(u-x.b)*s}else a.add((f-a.r)*s,(p-a.g)*s,(m-a.b)*s,(g-a.a)*s),l=c.r+(l-c.r)*s,d=c.g+(d-c.g)*s,u=c.b+(u-c.b)*s;c.r=l<0?0:l>1?1:l,c.g=d<0?0:d>1?1:d,c.b=u<0?0:u>1?1:u}}class TT extends Ah{constructor(e,t,n){super(e,t,n,`${rt.rgb}|${n}`,`${rt.rgb2}|${n}`)}getFrameEntries(){return 7}setFrame(e,t,n,s,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=n,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c}apply1(e,t,n,s,r,o){const a=t.color,c=t.darkColor;let l=0,d=0,u=0,h=0,f=0,p=0;const m=this.frames;if(n1?1:l,a.g=d<0?0:d>1?1:d,a.b=u<0?0:u>1?1:u,c.r=h<0?0:h>1?1:h,c.g=f<0?0:f>1?1:f,c.b=p<0?0:p>1?1:p}}class Yl extends Gt{constructor(t,n){super(t,`${rt.attachment}|${n}`);A(this,"slotIndex",0);A(this,"attachmentNames");this.slotIndex=n,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n,s){this.frames[t]=n,this.attachmentNames[t]=s}apply(t,n,s,r,o,a,c,l,d){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const h=d?u.appliedPose:u.pose;l||st){const l=this.frames[n];return s[r+1]*(t-l)/(s[r]-l)}const o=r+18;for(r+=2;r=t){const l=s[r-2],d=s[r-1];return d+(t-l)/(s[r]-l)*(s[r+1]-d)}const a=s[o-2],c=s[o-1];return c+(1-c)*(t-a)/(this.frames[n+this.getFrameEntries()]-a)}apply(t,n,s,r,o,a,c,l,d){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,d))return;const h=this.attachment.timelineSlots,f=this.frames;if(s=f[f.length-1])g=0,p=this.vertices[f.length-1],m=null;else{const y=Gt.search(f,s);g=this.getCurvePercent(s,y),p=this.vertices[y],m=this.vertices[y+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],d,p,m,g,v,o,a,c);for(const y of h)this.applyToSlot(u[y],d,p,m,g,v,o,a,c)}applyBeforeFirst(t,n,s,r){if(!t.bone.active)return;const o=n?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Ge.setup),r){case Ge.setup:a.length=0;break;case Ge.first:{if(s===1){a.length=0;return}const c=this.vertices[0].length;a.length=c;const l=a,d=o.attachment;if(d.bones===null){const u=d.vertices;for(let h=0;h>4,d=c.attachment.sequence.regions.length;const u=dT[o&15];if(u!==Nn.hold)switch(l+=(s-r)/a+1e-5|0,u){case Nn.once:l=Math.min(d-1,l);break;case Nn.loop:l%=d;break;case Nn.pingpong:{const h=(d<<1)-2;l=h===0?0:l%h,l>=d&&(l=h-l);break}case Nn.onceReverse:l=Math.max(d-1-l,0);break;case Nn.loopReverse:l=d-1-l%d;break;case Nn.pingpongReverse:{const h=(d<<1)-2;l=h===0?0:(l+d-1)%h,l>=d&&(l=h-l)}}c.sequenceIndex=l}};A(ki,"ENTRIES",3),A(ki,"MODE",1),A(ki,"DELAY",2);let Lu=ki;const Uu=class Uu extends Gt{constructor(t){super(t,...Uu.propertyIds);A(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n){this.frames[t]=n.time,this.events[t]=n}apply(t,n,s,r,o,a,c,l,d){if(!r)return;const u=this.frames,h=this.frames.length;if(n>s)this.apply(null,n,Number.MAX_VALUE,r,0,a,!1,!1,!1),n=-1;else if(n>=u[h-1])return;if(s0&&u[f-1]===p;)f--}for(;f=u[f];f++)r.push(this.events[f])}};A(Uu,"propertyIds",[`${rt.event}`]);let vc=Uu;const _a=class _a extends Gt{constructor(t){super(t,..._a.propertyIds);A(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n,s){this.frames[t]=n,this.drawOrders[t]=s}apply(t,n,s,r,o,a,c,l,d){const u=d?t.drawOrder.appliedPose:t.drawOrder.pose,h=t.slots;if(l||s>2];switch(y){case 0:{const x=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const T=(s-x)/(f[v+4]-x);p+=(f[v+4+1]-p)*T,m+=(f[v+4+2]-m)*T,g+=(f[v+4+3]-g)*T;break}case 1:p=f[v+1],m=f[v+2],g=f[v+3];break;default:p=this.getBezierValue(s,v,1,y-2),m=this.getBezierValue(s,v,2,y+18-2),g=this.getBezierValue(s,v,3,y+36-2)}const b=a===Ge.setup?u.data.setupPose:h;c?(h.mixRotate=b.mixRotate+p*o,h.mixX=b.mixX+m*o,h.mixY=b.mixY+g*o):(h.mixRotate=b.mixRotate+(p-b.mixRotate)*o,h.mixX=b.mixX+(m-b.mixX)*o,h.mixY=b.mixY+(g-b.mixY)*o)}}class uo extends Mc{constructor(e,t,n,s){super(e,t,n,s)}apply(e,t,n,s,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const d=n>=this.frames[0]?this.getCurveValue(n):0,u=e.physics;for(const h of u)if(h.active&&this.global(h.data)){const f=l?h.appliedPose:h.pose;this.set(f,this.getAbsoluteValue(n,r,o,a,this.get(f),this.get(h.data.setupPose),d))}}else{const d=e.constraints[this.constraintIndex];if(d.active){const u=l?d.appliedPose:d.pose;this.set(u,this.getAbsoluteValue(n,r,o,a,this.get(u),this.get(d.data.setupPose)))}}}}class RT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class FT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class LT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class DT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class OT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class NT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class $T extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Vu=class Vu extends Gt{constructor(t,n){super(t,...Vu.propertyIds);A(this,"constraintIndex");this.constraintIndex=n,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n){this.frames[t]=n}apply(t,n,s,r,o,a,c,l,d){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const h=this.frames;if(n>s)this.apply(t,n,Number.MAX_VALUE,[],o,a,!1,!1,!1),n=-1;else if(n>=h[h.length-1])return;if(!(s=h[Gt.search(h,n)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};A(Vu,"propertyIds",[rt.physicsConstraintReset.toString()]);let Du=Vu;class BT extends Mc{constructor(e,t,n){super(e,t,n,rt.sliderTime)}apply(e,t,n,s,r,o,a,c,l){const d=e.constraints[this.constraintIndex];if(d.active){const u=l?d.appliedPose:d.pose;u.time=this.getAbsoluteValue(n,r,o,a,u.time,d.data.setupPose.time)}}}class UT extends Mc{constructor(e,t,n){super(e,t,n,rt.sliderMix),this.additive=!0}apply(e,t,n,s,r,o,a,c,l){const d=e.constraints[this.constraintIndex];if(d.active){const u=l?d.appliedPose:d.pose;u.mix=this.getAbsoluteValue(n,r,o,a,u.mix,d.data.setupPose.mix)}}}const Hl=class Hl{constructor(e){A(this,"data");A(this,"tracks",[]);A(this,"timeScale",1);A(this,"unkeyedState",0);A(this,"events",[]);A(this,"listeners",[]);A(this,"queue",new mX(this));A(this,"propertyIds",new Map);A(this,"animationsChanged",!1);A(this,"trackEntryPool",new aX(()=>new pX));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let n=0,s=t.length;n0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(n,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const n=e.mixingFrom;if(!n)return!0;const s=this.updateMixingFrom(n,t);if(n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(n.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=n.mixingFrom,n.mixingFrom!=null&&(n.mixingFrom.mixingTo=e),n.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(n)}return s}return n.trackTime+=t*n.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,n=this.tracks;let s=!1;for(let a=0,c=n.length;a0)continue;s=!0;let d=l.alpha;l.mixingFrom?d*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(d=0);let u=l.animationLast,h=l.getAnimationTime(),f=h,p=t;l.reverse&&(f=l.animation.duration-f,p=null);const m=l.animation.timelines,g=m.length;if(a===0&&d===1)for(let v=0;v=l.alphaAttachmentThreshold,b=l.additive,x=b||l.shortestRotation,T=!x&&l.timelinesRotation.length!==g<<1;T&&(l.timelinesRotation.length=g<<1);for(let E=0;E0?c/a:o,d=n.animation.timelines,u=d.length,h=n.timelineMode,f=n.timelineHoldMix,p=r=n.alphaAttachmentThreshold);else{const N=!m||!(M instanceof eo)||P===Ge.current;M.apply(t,x,E,S,I,P,g,N,!1)}}return n.reverse&&r0&&this.queueEvents(n,T),this.events.length=0,n.nextAnimationLast=T,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,n,s,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+Ux)return;let a=n=0,T=v>=0;Math.abs(y)<=90&&Fe.signum(y)!==Fe.signum(g)&&(Math.abs(v-b)>180?(m+=360*Fe.signum(v),T=x):b!==0?m-=360*Fe.signum(v):T=x),T!==x&&(m+=360*Fe.signum(v)),o[a]=m}o[a+1]=g,d.rotation=f+m*s}queueEvents(e,t){const n=e.animationStart,s=e.animationEnd,r=s-n,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,d=c.length;for(;l=n&&h.time<=s&&this.queue.event(e,h)}let u=!1;if(e.loop)if(r===0)u=!0;else{const h=Math.floor(e.trackTime/r);u=h>0&&h>Math.floor(e.trackLast/r)}else u=t>=s&&e.animationLast=n&&h.time<=s&&this.queue.event(e,h)}}eventsReverse(e,t,n){const s=e.animation.duration,r=s-t,o=s-n,a=e.animation.timelines;for(let c=0,l=e.animation.timelines.length;c=o){for(let p=0;p=r)break;this.events.push(u[p])}}else{for(let m=0;m=r);m++)this.events.push(u[m]);let p=0;for(;p=o);p++);for(;p= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let n=t;for(;;){const s=n.mixingFrom;if(!s)break;this.queue.end(s),n.mixingFrom=null,n.mixingTo=null,n=s}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,n){const s=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,s&&(s.next=null,n&&this.queue.interrupt(s),t.mixingFrom=s,s.mixingTo=t,t.mixTime=0,s.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,n=!1){return typeof t=="string"?this.setAnimation1(e,t,n):this.setAnimation2(e,t,n)}setAnimation1(e,t,n=!1){const s=this.data.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,s,n)}setAnimation2(e,t,n=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));const o=this.trackEntry(e,t,n,r);return this.setTrack(e,o,s),this.queue.drain(),o}addAnimation(e,t,n=!1,s=0){return typeof t=="string"?this.addAnimation1(e,t,n,s):this.addAnimation2(e,t,n,s)}addAnimation1(e,t,n=!1,s=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,n,s)}addAnimation2(e,t,n=!1,s=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,n,r);return r?(r.next=o,o.previous=r,s<=0&&(s=Math.max(s+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),s<0&&(s=0)),o.delay=s,o}setEmptyAnimation(e,t=0){const n=this.setAnimation(e,Hl.emptyAnimation,!1);return n.mixDuration=t,n.trackEnd=t,n}addEmptyAnimation(e,t=0,n=0){const s=this.addAnimation(e,Hl.emptyAnimation,!1,n);return n<=0&&(s.delay=Math.max(s.delay+s.mixDuration-t,0)),s.mixDuration=t,s.trackEnd=t,s}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let n=0,s=this.tracks.length;n0&&(o[h]=v);break}}c&&(g=g&~Cd|r[h]&Cd),r[h]=g}}from(e,t,n){const s=this.propertyIds;let r=gX;for(let o=0,a=n.length;o= 0.");return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};A(Hl,"emptyAnimation",new uv("",[],0));let Dx=Hl;class pX{constructor(){A(this,"animation",null);A(this,"previous",null);A(this,"next",null);A(this,"mixingFrom",null);A(this,"mixingTo",null);A(this,"listener",null);A(this,"trackIndex",0);A(this,"loop",!1);A(this,"additive",!1);A(this,"reverse",!1);A(this,"shortestRotation",!1);A(this,"keepHold",!1);A(this,"eventThreshold",0);A(this,"mixAttachmentThreshold",0);A(this,"alphaAttachmentThreshold",0);A(this,"mixDrawOrderThreshold",0);A(this,"animationStart",0);A(this,"animationEnd",0);A(this,"animationLast",0);A(this,"nextAnimationLast",0);A(this,"delay",0);A(this,"trackTime",0);A(this,"trackLast",0);A(this,"nextTrackLast",0);A(this,"trackEnd",0);A(this,"timeScale",0);A(this,"alpha",0);A(this,"mixTime",0);A(this,"mixDuration",0);A(this,"totalAlpha",0);A(this,"mixInterpolation",Va.linear);A(this,"timelineMode",[]);A(this,"timelineHoldMix",[]);A(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===Va.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=Va.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class mX{constructor(e){A(this,"objects",[]);A(this,"drainDisabled",!1);A(this,"animState");this.animState=e}start(e){this.objects.push(ui.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ui.interrupt),this.objects.push(e)}end(e){this.objects.push(ui.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ui.dispose),this.objects.push(e)}complete(e){this.objects.push(ui.complete),this.objects.push(e)}event(e,t){this.objects.push(ui.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,n,s,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!n)throw new Error("name cannot be null.");this.index=t,this.parent=s}copy(t){const n=new Eh(this.index,this.name,t);return n.length=this.length,n.setupPose.set(this.setupPose),n}}var an;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(an||(an={}));class Jm{constructor(){A(this,"bone");A(this,"x",0);A(this,"y",0);A(this,"rotation",0);A(this,"scaleX",0);A(this,"scaleY",0);A(this,"shearX",0);A(this,"shearY",0);A(this,"inherit",an.Normal);A(this,"a",0);A(this,"b",0);A(this,"c",0);A(this,"d",0);A(this,"worldY",0);A(this,"worldX",0);A(this,"world",0);A(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,n=this.scaleX,s=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const h=e.scaleX,f=e.scaleY,p=(t+r)*Fe.degRad,m=(t+90+o)*Fe.degRad;this.a=Math.cos(p)*n*h,this.b=Math.cos(m)*s*h,this.c=Math.sin(p)*n*f,this.d=Math.sin(m)*s*f,this.worldX=this.x*h+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let c=a.a,l=a.b,d=a.c,u=a.d;switch(this.worldX=c*this.x+l*this.y+a.worldX,this.worldY=d*this.x+u*this.y+a.worldY,this.inherit){case an.Normal:{const h=(t+r)*Fe.degRad,f=(t+90+o)*Fe.degRad,p=Math.cos(h)*n,m=Math.cos(f)*s,g=Math.sin(h)*n,v=Math.sin(f)*s;this.a=c*p+l*g,this.b=c*m+l*v,this.c=d*p+u*g,this.d=d*m+u*v;return}case an.OnlyTranslation:{const h=e.scaleX,f=e.scaleY,p=(t+r)*Fe.degRad,m=(t+90+o)*Fe.degRad;this.a=Math.cos(p)*n*h,this.b=Math.cos(m)*s*h,this.c=Math.sin(p)*n*f,this.d=Math.sin(m)*s*f;break}case an.NoRotationOrReflection:{const h=e.scaleX,f=e.scaleY,p=1/h,m=1/f;c*=p,d*=m;let g=c*c+d*d,v=0;g>Fe.epsilon2?(g=Math.abs(c*u*m-l*p*d)/g,l=d*g,u=c*g,v=t-Fe.atan2Deg(d,c)):(c=0,d=0,v=t-90+Fe.atan2Deg(u,l));const y=(v+r)*Fe.degRad,b=(v+o+90)*Fe.degRad,x=Math.cos(y)*n,T=Math.cos(b)*s,E=Math.sin(y)*n,S=Math.sin(b)*s;this.a=(c*x-l*E)*h,this.b=(c*T-l*S)*h,this.c=(d*x+u*E)*f,this.d=(d*T+u*S)*f;break}case an.NoScale:case an.NoScaleOrReflection:{const h=e.scaleX,f=e.scaleY,p=1/h,m=1/f,g=t*Fe.degRad,v=Math.cos(g),y=Math.sin(g);let b=(c*v+l*y)*p,x=(d*v+u*y)*m;const T=1/Math.sqrt(b*b+x*x);b*=T,x*=T;let E=-x,S=b;this.inherit===an.NoScale&&c*u-l*d<0!=(h<0!=f<0)&&(E=-E,S=-S);const C=r*Fe.degRad,M=(90+o)*Fe.degRad,k=Math.cos(C)*n,P=Math.cos(M)*s,I=Math.sin(C)*n,N=Math.sin(M)*s;this.a=(b*k+E*I)*h,this.b=(b*P+E*N)*h,this.c=(x*k+S*I)*f,this.d=(x*P+S*N)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,n=e.scaleY;if(!this.bone.parent){const v=1/t,y=1/n;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*y,this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);return}const s=this.bone.parent.appliedPose;let r=s.a,o=s.b,a=s.c,c=s.d;const l=r*c-o*a,d=1/(r*c-o*a),u=c*d,h=o*d,f=a*d,p=r*d,m=this.worldX-s.worldX,g=this.worldY-s.worldY;switch(this.x=m*u-g*h,this.y=g*p-m*f,this.inherit){case an.Normal:this.set5(u*this.a-h*this.c,u*this.b-h*this.d,p*this.c-f*this.a,p*this.d-f*this.b,0);break;case an.OnlyTranslation:{const v=1/t,y=1/n;this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);break}case an.NoRotationOrReflection:{const v=1/t,y=1/n;r*=v,a*=y;const b=this.a*v,x=this.b*v,T=this.c*y,E=this.d*y,S=1/(r*r+a*a),C=1/Math.abs(l*v*y);this.set5((r*b+a*T)*S,(r*x+a*E)*S,(r*T-a*b)*C,(r*E-a*x)*C,Fe.atan2Deg(a,r));break}case an.NoScale:case an.NoScaleOrReflection:{const v=1/t,y=1/n,b=this.a*v,x=this.b*v,T=this.c*y,E=this.d*y;let S=c*this.a-o*this.c,C=r*this.c-a*this.a;l<0&&(S=-S,C=-C);let M=Fe.atan2Deg(C,S);this.rotation=M,M*=Fe.degRad;const k=Math.cos(M),P=Math.sin(M);let I=(r*k+o*P)*v,N=(a*k+c*P)*y;const $=1/Math.sqrt(I*I+N*N);I*=$,N*=$;const j=this.inherit===an.NoScale&&l<0!=(t<0!=n<0)?-1:1;this.set4(I*b+N*T,I*x+N*E,(I*T-N*b)*j,(I*E-N*x)*j)}}}set4(e,t,n,s){const r=e*e+n*n,o=t*t+s*s;r>Fe.epsilon2?(this.shearX=Fe.atan2Deg(n,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Fe.epsilon2?(this.shearY=Fe.atan2Deg(s,t),e*s-t*n<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,n,s,r){this.shearX=0;const o=e*e+n*n,a=t*t+s*s;if(o>Fe.epsilon2){const c=Fe.atan2Deg(n,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Fe.epsilon2?(this.shearY=Fe.atan2Deg(s,t),e*s-t*n<0?(this.scaleY=-this.scaleY,this.shearY+=90-c):this.shearY-=90+c,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Fe.epsilon2?Fe.atan2Deg(s,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const n=this.bone.children;for(let s=0,r=n.length;s1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,n,s,r,o,a,c,l,d,u){typeof s=="number"?Ur.apply1(t,n,s,r,o,a,c,l):Ur.apply2(t,n,s,r,o,a,c,l,d,u)}static apply1(t,n,s,r,o,a,c,l){n.modifyLocal(t);const d=n.bone.parent.appliedPose;let u=d.a,h=d.b,f=d.c,p=d.d,m=-n.shearX-n.rotation,g=0,v=0;switch(n.inherit){case an.OnlyTranslation:g=(s-n.worldX)*Fe.signum(t.scaleX),v=(r-n.worldY)*Fe.signum(t.scaleY);break;case an.NoRotationOrReflection:{const y=Math.abs(u*p-h*f)/Math.max(Fe.epsilon,u*u+f*f),b=u/t.scaleX,x=f/t.scaleY;h=-x*y*t.scaleX,p=b*y*t.scaleY,m+=Fe.atan2Deg(x,b)}default:{const y=s-d.worldX,b=r-d.worldY,x=u*p-h*f;Math.abs(x)<=Fe.epsilon?(g=0,v=0):(g=(y*p-b*h)/x-n.x,v=(b*u-y*f)/x-n.y)}}if(m+=Fe.atan2Deg(v,g),n.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),n.rotation+=m*l,o||a){switch(n.inherit){case an.NoScale:case an.NoScaleOrReflection:g=s-n.worldX,v=r-n.worldY}const y=n.bone.data.length*n.scaleX;if(y>Fe.epsilon){const b=g*g+v*v;if(o&&by*y){const x=(Math.sqrt(b)/y-1)*l+1;switch(n.scaleX*=x,c){case ri.Uniform:n.scaleY*=x;break;case ri.Volume:n.scaleY/=x<.7?.25+.642857*x:x}}}}}static apply2(t,n,s,r,o,a,c,l,d,u){if(n.inherit!==an.Normal||s.inherit!==an.Normal)return;n.modifyLocal(t),s.modifyLocal(t);let h=n.x,f=n.y,p=n.scaleX,m=n.scaleY,g=s.scaleX,v=0,y=0,b=0;p<0?(p=-p,v=180,b=-1):(v=0,b=1),m<0&&(m=-m,b=-b),g<0?(g=-g,y=180):y=0;let x=0,T=0,E=n.a,S=n.b,C=n.c,M=n.d;const k=Math.abs(p-m)<=Fe.epsilon;!k||c?(s.y=0,x=E*s.x+n.worldX,T=C*s.x+n.worldY):(x=E*s.x+S*s.y+n.worldX,T=C*s.x+M*s.y+n.worldY);const P=n.bone.parent.appliedPose;E=P.a,S=P.b,C=P.c,M=P.d;let I=E*M-S*C,N=x-P.worldX,$=T-P.worldY;I=Math.abs(I)<=Fe.epsilon?0:1/I;const j=(N*M-$*S)*I-h,B=($*E-N*C)*I-f;let Y=Math.sqrt(j*j+B*B),U=s.bone.data.length*g,D,L;if(Y0){let ce=Math.min(1,ae/(d*2))-1;ce=(ae-d*(1-ce*ce))/Z,R-=ce*R,X-=ce*X,z=R*R+X*X}}e:if(k){U*=p;let Z=(z-Y*Y-U*U)/(2*Y*U);if(Z<-1)Z=-1,L=Math.PI*a;else if(Z>1){if(Z=1,L=0,c)switch(E=(Math.sqrt(z)/(Y+U)-1)*u+1,n.scaleX*=E,l){case ri.Uniform:n.scaleY*=E;break;case ri.Volume:n.scaleY/=E<.7?.25+.642857*E:E}}else L=Math.acos(Z)*a;E=Y+U*Z,S=U*Math.sin(L),D=Math.atan2(X*E-R*S,R*E+X*S)}else{E=p*U,S=m*U;const Z=E*E,ae=S*S,ce=Math.atan2(X,R);C=ae*Y*Y+Z*z-Z*ae;const ve=-2*ae*Y,we=ae-Z;if(M=ve*ve-4*we*C,M>=0){let O=Math.sqrt(M);ve<0&&(O=-O),O=-(ve+O)*.5;let V=O/we,W=C/O;const ee=Math.abs(V)=0){$=Math.sqrt(V)*a,D=ce-Math.atan2($,ee),L=Math.atan2($/m,(ee-Y)/p);break e}}let re=Fe.PI,Ee=Y-E,q=Ee*Ee,J=0,ie=0,se=Y+E,G=se*se,H=0;C=-E*Y/(Z-ae),C>=-1&&C<=1&&(C=Math.acos(C),N=E*Math.cos(C)+Y,$=S*Math.sin(C),M=N*N+$*$,MG&&(ie=C,G=M,se=N,H=$)),z<=(q+G)*.5?(D=ce-Math.atan2(J*a,Ee),L=re*a):(D=ce-Math.atan2(H*a,se),L=ie*a)}const K=Math.atan2(s.y,s.x)*b;D=(D-K)*Fe.radDeg+v-n.rotation,D>180?D-=360:D<=-180&&(D+=360),n.rotation+=D*u,L=((L+K)*Fe.radDeg-s.shearX)*b+y-s.rotation,L>180?L-=360:L<=-180&&(L+=360),s.rotation+=L*u}}class Bd extends kc{constructor(t){super(t,new Zm);A(this,"bones",[]);A(this,"_target",null);A(this,"_scaleYMode",ri.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new Ur(this,t)}}class Qm{constructor(){A(this,"position",0);A(this,"spacing",0);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class Ud extends kc{constructor(t){super(t,new Qm);A(this,"bones",[]);A(this,"_slot",null);A(this,"positionMode",Os.Fixed);A(this,"spacingMode",En.Fixed);A(this,"rotateMode",Yo.Chain);A(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new eg(this,t)}}var Os;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Os||(Os={}));var En;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(En||(En={}));var Yo;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(Yo||(Yo={}));const Gi=class Gi extends Pc{constructor(t,n){super(t,new Qm,new Qm);A(this,"data");A(this,"bones");A(this,"slot");A(this,"spaces",[]);A(this,"positions",[]);A(this,"world",[]);A(this,"curves",[]);A(this,"lengths",[]);A(this,"segments",[]);if(!n)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const s of this.data.bones)this.bones.push(n.bones[s.index].constrainedPose);this.slot=n.slots[t.slot.index]}copy(t){var n=new Gi(this.data,t);return n.pose.set(this.pose),n}update(t,n){const s=this.slot.appliedPose.attachment;if(!(s instanceof bc))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,c=r.mixY;if(o===0&&a===0&&c===0)return;const l=this.data,d=l.rotateMode===Yo.Tangent,u=l.rotateMode===Yo.ChainScale,h=this.bones,f=h.length,p=d?f:f+1,m=Ze.setArraySize(this.spaces,p),g=u?this.lengths=Ze.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case En.Percent:if(u)for(let S=0,C=p-1;S0){S=p/S*v;for(let C=1;C0?Fe.degRad:-Fe.degRad}for(let S=0,C=3;S0){let $=M.a,j=M.b,B=M.c,Y=M.d,U=0,D=0,L=0;if(d?U=y[C-1]:m[S+1]===0?U=y[C+2]:U=Math.atan2(N,I),U-=Math.atan2(B,$),E){D=Math.cos(U),L=Math.sin(U);const R=M.bone.data.length;b+=(R*(D*$-L*B)-I)*o,x+=(R*(L*$+D*B)-N)*o}else U+=T;U>Fe.PI?U-=Fe.PI2:U<-Fe.PI&&(U+=Fe.PI2),U*=o,D=Math.cos(U),L=Math.sin(U),M.a=D*$-L*B,M.b=D*j-L*Y,M.c=L*$+D*B,M.d=L*j+D*Y}}}computeWorldPositions(t,n,s,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ze.setArraySize(this.positions,s*3+2),d=this.world;const u=n.closed;let h=n.worldVerticesLength,f=h/6,p=Gi.NONE;if(!n.constantSpeed){const L=n.lengths;f-=u?1:2;const R=L[f];this.data.positionMode===Os.Percent&&(a*=R);let X;switch(this.data.spacingMode){case En.Percent:X=R;break;case En.Proportional:X=R/s;break;default:X=1}d=Ze.setArraySize(this.world,8);for(let z=0,K=0,Z=0;zR){p!==Gi.AFTER&&(p=Gi.AFTER,n.computeWorldVertices(t,o,h-6,4,d,0,2)),this.addAfterPosition(ce-R,d,0,l,K);continue}for(;;Z++){const ve=L[Z];if(!(ce>ve)){if(Z===0)ce/=ve;else{const we=L[Z-1];ce=(ce-we)/(ve-we)}break}}Z!==p&&(p=Z,u&&Z===f?(n.computeWorldVertices(t,o,h-4,4,d,0,2),n.computeWorldVertices(t,o,0,4,d,4,2)):n.computeWorldVertices(t,o,Z*6+2,8,d,0,2)),this.addCurvePosition(ce,d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],l,K,r||z>0&&ae===0)}return l}u?(h+=2,d=Ze.setArraySize(this.world,h),n.computeWorldVertices(t,o,2,h-4,d,0,2),n.computeWorldVertices(t,o,0,2,d,h-4,2),d[h-2]=d[0],d[h-1]=d[1]):(f--,h-=4,d=Ze.setArraySize(this.world,h),n.computeWorldVertices(t,o,2,h,d,0,2));const m=Ze.setArraySize(this.curves,f);let g=0,v=d[0],y=d[1],b=0,x=0,T=0,E=0,S=0,C=0,M=0,k=0,P=0,I=0,N=0,$=0,j=0,B=0;for(let L=0,R=2;Lg){this.addAfterPosition(Z-g,d,h-4,l,R);continue}for(;;X++){const ae=m[X];if(!(Z>ae)){if(X===0)Z/=ae;else{const ce=m[X-1];Z=(Z-ce)/(ae-ce)}break}}if(X!==p){p=X;let ae=X*6;for(v=d[ae],y=d[ae+1],b=d[ae+2],x=d[ae+3],T=d[ae+4],E=d[ae+5],S=d[ae+6],C=d[ae+7],M=(v-b*2+T)*.03,k=(y-x*2+E)*.03,P=((b-T)*3-v+S)*.006,I=((x-E)*3-y+C)*.006,N=M*2+P,$=k*2+I,j=(b-v)*.3+M+P*.16666667,B=(x-y)*.3+k+I*.16666667,D=Math.sqrt(j*j+B*B),U[0]=D,ae=1;ae<8;ae++)j+=N,B+=$,N+=P,$+=I,D+=Math.sqrt(j*j+B*B),U[ae]=D;j+=N,B+=$,D+=Math.sqrt(j*j+B*B),U[8]=D,j+=N+P,B+=$+I,D+=Math.sqrt(j*j+B*B),U[9]=D,z=0}for(Z*=D;;z++){const ae=U[z];if(!(Z>ae)){if(z===0)Z/=ae;else{const ce=U[z-1];Z=z+(Z-ce)/(ae-ce)}break}}this.addCurvePosition(Z*.1,v,y,b,x,T,E,S,C,l,R,r||L>0&&K===0)}return l}addBeforePosition(t,n,s,r,o){const a=n[s],c=n[s+1],l=n[s+2]-a,d=n[s+3]-c,u=Math.atan2(d,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,n,s,r,o){const a=n[s+2],c=n[s+3],l=a-n[s],d=c-n[s+1],u=Math.atan2(d,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,n,s,r,o,a,c,l,d,u,h,f){if(t===0||Number.isNaN(t)){u[h]=n,u[h+1]=s,u[h+2]=Math.atan2(o-s,r-n);return}const p=t*t,m=p*t,g=1-t,v=g*g,y=v*g,b=g*t,x=b*3,T=g*x,E=x*t,S=n*y+r*T+a*E+l*m,C=s*y+o*T+c*E+d*m;u[h]=S,u[h+1]=C,f&&(t<.001?u[h+2]=Math.atan2(o-s,r-n):u[h+2]=Math.atan2(C-(s*v+o*b*2+c*p),S-(n*v+r*b*2+a*p)))}sort(t){const n=this.slot.data.index,s=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,n,s),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,n,s),this.sortPath(t,this.slot.pose.attachment,s);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,c=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,d=this.bone;let u=d.bone.data.length,h=this.data.step,f=0;if(n!==Po.none){switch(d.modifyWorld(t),n){case Po.reset:this.reset(t);case Po.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=d.worldX,v=d.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let y=this.remaining,b=s.inertia,x=t.data.referenceScale,T=-1,E=0,S=0,C=this.data.limit*p,M=C*Math.abs(t.scaleY);if(C*=Math.abs(t.scaleX),o||a){if(o){const k=(this.ux-g)*b;this.xOffset+=k>C?C:k<-C?-C:k,this.ux=g}if(a){const k=(this.uy-v)*b;this.yOffset+=k>M?M:k<-M?-M:k,this.uy=v}if(y>=h){const k=this.xOffset,P=this.yOffset;T=s.damping**(60*h),E=h*s.massInverse,S=s.strength;const I=x*s.wind,N=x*s.gravity,$=(I*t.windX+N*t.gravityX)*t.scaleX,j=(I*t.windY+N*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=($-this.xOffset*S)*E,this.xOffset+=this.xVelocity*h,this.xVelocity*=T),a&&(this.yVelocity-=(j+this.yOffset*S)*E,this.yOffset+=this.yVelocity*h,this.yVelocity*=T),y-=h;while(y>=h);this.xLag=this.xOffset-k,this.yLag=this.yOffset-P}f=Math.max(0,1-y/h),o&&(d.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(d.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(c||l){let k=Math.atan2(d.c,d.a),P=0,I=0,N=0,$=this.cx-d.worldX,j=this.cy-d.worldY;if($>C?$=C:$<-C&&($=-C),j>M?j=M:j<-M&&(j=-M),y=this.remaining,c){N=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/h);let B=Math.atan2(j+this.ty,$+this.tx)-k-(this.rotateOffset-f)*N;this.rotateOffset+=(B-Math.ceil(B*Fe.invPI2-.5)*Fe.PI2)*b,B=(this.rotateOffset-f)*N+k,P=Math.cos(B),I=Math.sin(B),l&&(B=u*d.getWorldScaleX(),B>0&&(this.scaleOffset+=($*P+j*I)*b/B))}else{P=Math.cos(k),I=Math.sin(k);const B=u*d.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/h);B>0&&(this.scaleOffset+=($*P+j*I)*b/B)}if(y>=h){T===-1&&(T=s.damping**(60*h),E=h*s.massInverse,S=s.strength);const B=s.wind*t.windX+s.gravity*t.gravityX,Y=(s.wind*t.windY+s.gravity*t.gravityY)*ig.yDir,U=this.rotateOffset,D=this.scaleOffset,L=u/x;for(;;)if(y-=h,l&&(this.scaleVelocity+=(B*P-Y*I-this.scaleOffset*S)*E,this.scaleOffset+=this.scaleVelocity*h,this.scaleVelocity*=T),c){if(this.rotateVelocity-=((B*I+Y*P)*L+this.rotateOffset*S)*E,this.rotateOffset+=this.rotateVelocity*h,this.rotateVelocity*=T,y0){let y=0;this.data.rotate>0&&(y=p*this.data.rotate,m=Math.sin(y),g=Math.cos(y),v=d.b,d.b=g*v-m*d.d,d.d=m*v+g*d.d),y+=p*this.data.shearX,m=Math.sin(y),g=Math.cos(y),v=d.a,d.a=g*v-m*d.c,d.c=m*v+g*d.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=d.a,d.a=g*v-m*d.c,d.c=m*v+g*d.c,v=d.b,d.b=g*v-m*d.d,d.d=m*v+g*d.d}if(l){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(d.a*=p,d.c*=p,this.data.scaleYMode){case ri.Uniform:d.b*=p,d.d*=p;break;case ri.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,d.b*=p,d.d*=p}}n!==Po.pose&&(this.tx=u*d.a,this.ty=u*d.c)}}sort(t){const n=this.bone.bone;t.sortBone(n),t._updateCache.push(this),t.sortReset(n.children),t.constrained(n)}isSourceActive(){return this.bone.bone.active}}class Vd extends kc{constructor(t){super(t,new tg);A(this,"_bone",null);A(this,"x",0);A(this,"y",0);A(this,"rotate",0);A(this,"scaleX",0);A(this,"shearX",0);A(this,"limit",0);A(this,"step",0);A(this,"inertiaGlobal",!1);A(this,"strengthGlobal",!1);A(this,"dampingGlobal",!1);A(this,"massGlobal",!1);A(this,"windGlobal",!1);A(this,"gravityGlobal",!1);A(this,"mixGlobal",!1);A(this,"_scaleYMode",ri.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new _h(this,t)}}typeof Math.fround>"u"&&(Math.fround=(i=>e=>(i[0]=e,i[0]))(new Float32Array(1)));class sg{constructor(){A(this,"time",0);A(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const Gl=class Gl extends Pc{constructor(t,n){super(t,new sg,new sg);A(this,"bone",null);if(!n)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=n.bones[t.bone.index])}copy(t){var n=new Gl(this.data,t);return n.pose.set(this.pose),n}update(t,n){const s=this.appliedPose;if(s.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),s.time=r.offset+(r.property.value(t,a.appliedPose,r.local,Gl.offsets)-r.property.offset)*r.scale,r.loop?s.time=o.duration+s.time%o.duration:s.time=Math.max(0,s.time)}const c=t.bones,l=o.bones;for(let d=0,u=o.bones.length;d=s.length&&(s.length=e+1),s[e]||(s[e]={}),s[e][t]=n}addSkin(e){for(let n=0;n= 0.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.boneData=s}}var Ou;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Ou||(Ou={}));class ag{constructor(){A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"mixScaleX",0);A(this,"mixScaleY",0);A(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class bv extends Pc{constructor(t,n){super(t,new ag,new ag);A(this,"bones");A(this,"source");if(!n)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(n.bones[r.index].constrainedPose);const s=n.bones[t.source.index];if(s==null)throw new Error("source cannot be null.");this.source=s}copy(t){var n=new bv(this.data,t);return n.pose.set(this.pose),n}update(t,n){const s=this.appliedPose;if(s.mixRotate===0&&s.mixX===0&&s.mixY===0&&s.mixScaleX===0&&s.mixScaleY===0&&s.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,c=r.additive,l=r.clamp,d=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const h=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?s[Lt.ROTATION]:-s[Lt.ROTATION]);return a<0&&(a+=360),a}}class HT extends ol{mix(e){return e.mixRotate}apply(e,t,n,s,r,o){if(r)n.rotation+=(o?s:s-n.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,d=1/c,u=n.a*l,h=n.b*l,f=n.c*d,p=n.d*d;s*=Fe.degRad,o||(s-=Math.atan2(f,u)),s>Fe.PI?s-=Fe.PI2:s<-Fe.PI&&(s+=Fe.PI2),s*=t.mixRotate;const m=Math.cos(s),g=Math.sin(s);n.a=(m*u-g*f)*a,n.b=(m*h-g*p)*a,n.c=(g*u+m*f)*c,n.d=(g*h+m*p)*c}}}class cg extends rl{value(e,t,n,s){return n?t.x+s[Lt.X]:(s[Lt.X]*t.a+s[Lt.Y]*t.b+t.worldX)/e.scaleX}}class GT extends ol{mix(e){return e.mixX}apply(e,t,n,s,r,o){r?n.x+=(o?s:s-n.x)*t.mixX:(o||(s-=n.worldX/e.scaleX),n.worldX+=s*t.mixX*e.scaleX)}}class dg extends rl{value(e,t,n,s){return n?t.y+s[Lt.Y]:(s[Lt.X]*t.c+s[Lt.Y]*t.d+t.worldY)/e.scaleY}}class WT extends ol{mix(e){return e.mixY}apply(e,t,n,s,r,o){r?n.y+=(o?s:s-n.y)*t.mixY:(o||(s-=n.worldY/e.scaleY),n.worldY+=s*t.mixY*e.scaleY)}}class ug extends rl{value(e,t,n,s){if(n)return t.scaleX+s[Lt.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+s[Lt.SCALEX]}}class qT extends ol{mix(e){return e.mixScaleX}apply(e,t,n,s,r,o){if(r)o?n.scaleX*=1+(s-1)*t.mixScaleX:n.scaleX!==0&&(n.scaleX+=(s-n.scaleX)*t.mixScaleX);else if(o){const a=1+(s-1)*t.mixScaleX;n.a*=a,n.c*=a}else{let a=n.a/e.scaleX,c=n.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(s-l)*t.mixScaleX/l,n.a*=l,n.c*=l)}}}class hg extends rl{value(e,t,n,s){if(n)return t.scaleY+s[Lt.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+s[Lt.SCALEY]}}class KT extends ol{mix(e){return e.mixScaleY}apply(e,t,n,s,r,o){if(r)o?n.scaleY*=1+(s-1)*t.mixScaleY:n.scaleY!==0&&(n.scaleY+=(s-n.scaleY)*t.mixScaleY);else if(o){const a=1+(s-1)*t.mixScaleY;n.b*=a,n.d*=a}else{let a=n.b/e.scaleX,c=n.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(s-l)*t.mixScaleY/l,n.b*=l,n.d*=l)}}}class fg extends rl{value(e,t,n,s){if(n)return t.shearY+s[Lt.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Fe.radDeg-90+s[Lt.SHEARY]}}class JT extends ol{mix(e){return e.mixShearY}apply(e,t,n,s,r,o){if(r)o||(s-=n.shearY),n.shearY+=s*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=n.b/a,d=n.d/c,u=Math.atan2(d,l);s=(s+90)*Fe.degRad,o?s-=Fe.PI/2:(s-=u-Math.atan2(n.c/c,n.a/a),s>Fe.PI?s-=Fe.PI2:s<-Fe.PI&&(s+=Fe.PI2)),s=u+s*t.mixShearY;const h=Math.sqrt(l*l+d*d);n.b=Math.cos(s)*h*a,n.d=Math.sin(s)*h*c}}}class mte{constructor(e){A(this,"scale",1);A(this,"attachmentLoader");A(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,n=new zT;n.name="";const s=new bX(e),r=s.readInt32(),o=s.readInt32();n.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),n.version=s.readString(),n.x=s.readFloat(),n.y=s.readFloat(),n.width=s.readFloat(),n.height=s.readFloat(),n.referenceScale=s.readFloat()*t;const a=s.readBoolean();a&&(n.fps=s.readFloat(),n.imagesPath=s.readString(),n.audioPath=s.readString());let c=0;c=s.readInt(!0);for(let p=0;p>5;for(let x=0,T;x>1&1,v.spacingMode=y>>2&3,v.rotateMode=y>>4&3,(y&128)!==0&&(v.offsetRotation=s.readFloat());const b=v.setupPose;b.position=s.readFloat(),v.positionMode===Os.Fixed&&(b.position*=t),b.spacing=s.readFloat(),(v.spacingMode===En.Length||v.spacingMode===En.Fixed)&&(b.spacing*=t),b.mixRotate=s.readFloat(),b.mixX=s.readFloat(),b.mixY=s.readFloat(),d.push(v);break}case XX:{const v=new Vd(m);v.bone=l[s.readInt(!0)];let y=s.readByte();if(v.skinRequired=(y&1)!==0,(y&2)!==0&&(v.x=s.readFloat()),(y&4)!==0&&(v.y=s.readFloat()),(y&8)!==0&&(v.rotate=s.readFloat()),(y&16)!==0){let x=s.readFloat();x<-2?(v.scaleYMode=ri.Volume,x=-2-x):x<0&&(v.scaleYMode=ri.Uniform,x=-1-x),v.scaleX=x}(y&32)!==0&&(v.shearX=s.readFloat()),v.limit=((y&64)!==0?s.readFloat():5e3)*t,v.step=1/s.readUnsignedByte();const b=v.setupPose;b.inertia=s.readFloat(),b.strength=s.readFloat(),b.damping=s.readFloat(),b.massInverse=(y&128)!==0?s.readFloat():1,b.wind=s.readFloat(),b.gravity=s.readFloat(),y=s.readByte(),(y&1)!==0&&(v.inertiaGlobal=!0),(y&2)!==0&&(v.strengthGlobal=!0),(y&4)!==0&&(v.dampingGlobal=!0),(y&8)!==0&&(v.massGlobal=!0),(y&16)!==0&&(v.windGlobal=!0),(y&32)!==0&&(v.gravityGlobal=!0),(y&64)!==0&&(v.mixGlobal=!0),b.mix=(y&128)!==0?s.readFloat():1,d.push(v);break}case YX:{const v=new Io(m),y=s.readByte();if(v.skinRequired=(y&1)!==0,v.loop=(y&2)!==0,v.additive=(y&4)!==0,(y&8)!==0){const b=s.readFloat();a&&(y&64)!==0?v.max=b:v.setupPose.time=b}if((y&16)!==0&&(v.setupPose.mix=(y&32)!==0?s.readFloat():1),(y&64)!==0){v.local=(y&128)!==0,v.bone=l[s.readInt(!0)];const b=s.readFloat();let x=1;switch(s.readByte()){case 0:v.property=new lg;break;case 1:{x=t,v.property=new cg;break}case 2:{x=t,v.property=new dg;break}case 3:v.property=new ug;break;case 4:v.property=new hg;break;case 5:v.property=new fg;break;default:continue}v.property.offset=b*x,v.offset=s.readFloat(),v.scale=s.readFloat()/x}d.push(v);break}}}const h=this.readSkin(s,n,!0,a);h&&(n.defaultSkin=h,n.skins.push(h));{let p=n.skins.length;for(Ze.setArraySize(n.skins,c=p+s.readInt(!0));p0){y=[];for(let S=0;S>4,e.readFloat())}r.push(k);break}}}}}const a=n.slots.length,c=e.readInt(!0);if(c>0){const f=new eo(c);for(let p=0;p0){const f=new vc(d);for(let p=0;p>>1^-(n&1)}readStringRef(){const e=this.readInt(!0);return e===0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let n=0;n>4){case 12:case 13:t+=String.fromCharCode((s&31)<<6|this.readByte()&63),n+=2;break;case 14:t+=String.fromCharCode((s&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),n+=3;break;default:t+=String.fromCharCode(s),n++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let yX=class{constructor(e,t,n,s,r,o){A(this,"source");A(this,"skinIndex");A(this,"slotIndex");A(this,"sourceIndex");A(this,"mesh");A(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=n,this.sourceIndex=s,this.source=r,this.inheritTimelines=o}};class Xx{constructor(e=null,t,n=0){A(this,"bones");A(this,"vertices");A(this,"length");this.bones=e,this.vertices=t,this.length=n}}var qs;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(qs||(qs={}));function mn(i,e,t,n){t instanceof lr?xX(i,e,t,n):wX(i,e,t,n)}function xX(i,e,t,n){let s=i.readFloat(),r=i.readFloat()*n;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,s,r),o!==c;o++){const l=i.readFloat(),d=i.readFloat()*n;switch(i.readByte()){case xs:t.setStepped(o);break;case ws:St(i,t,a++,o,0,s,l,r,d,n)}s=l,r=d}e.push(t)}function wX(i,e,t,n){let s=i.readFloat(),r=i.readFloat()*n,o=i.readFloat()*n;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,s,r,o),a!==l;a++){const d=i.readFloat(),u=i.readFloat()*n,h=i.readFloat()*n;switch(i.readByte()){case xs:t.setStepped(a);break;case ws:St(i,t,c++,a,0,s,d,r,u,n),St(i,t,c++,a,1,s,d,o,h,n)}s=d,r=u,o=h}e.push(t)}function Yx(i,e){const t=i.readInt(!0);if(t===0)return null;const n=new Array(e).fill(-1),s=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)n[a]===-1&&(n[a]=s[--o]);return n}function St(i,e,t,n,s,r,o,a,c,l){e.setBezier(t,n,s,r,a,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,o,c)}const SX=0,CX=1,AX=2,TX=3,EX=4,_X=5,MX=6,PX=7,kX=8,IX=9,RX=10,FX=0,LX=1,DX=2,OX=3,NX=4,$X=5,BX=0,UX=1,VX=2,XX=3,YX=4,zX=0,jX=1,HX=0,GX=1,WX=2,qX=0,KX=1,JX=2,ZX=4,QX=5,eY=6,tY=7,nY=8,iY=0,sY=1,xs=1,ws=2;class rY{constructor(e){A(this,"attachmentLoader");A(this,"scale",1);A(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,n=new zT,s=typeof e=="string"?JSON.parse(e):e,r=s.skeleton;if(r&&(n.hash=r.hash,n.version=r.spine,n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height,n.referenceScale=oe(r,"referenceScale",100)*t,n.fps=r.fps,n.imagesPath=r.images??null,n.audioPath=r.audio??null),s.bones)for(let o=0;o0&&l.properties.push(E)}l.offsets[Lt.ROTATION]=oe(o,"rotation",0),l.offsets[Lt.X]=oe(o,"x",0)*t,l.offsets[Lt.Y]=oe(o,"y",0)*t,l.offsets[Lt.SCALEX]=oe(o,"scaleX",0),l.offsets[Lt.SCALEY]=oe(o,"scaleY",0),l.offsets[Lt.SHEARY]=oe(o,"shearY",0);const b=l.setupPose;h&&(b.mixRotate=oe(o,"mixRotate",1)),f&&(b.mixX=oe(o,"mixX",1)),p&&(b.mixY=oe(o,"mixY",b.mixX)),m&&(b.mixScaleX=oe(o,"mixScaleX",1)),g&&(b.mixScaleY=oe(o,"mixScaleY",b.mixScaleX)),v&&(b.mixShearY=oe(o,"mixShearY",1)),n.constraints.push(l);break}case"path":{const l=new Ud(a);l.skinRequired=c;for(let f=0;f0){const h=n.findConstraint(l,Vd);if(!h)throw new Error(`Physics constraint not found: ${l}`);u=n.constraints.indexOf(h)}for(const h in d){const f=d[h];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(h==="reset"){const y=new Du(m,u);for(let b=0;p!=null;p=f[b+1],b++)y.setFrame(b,oe(p,"time",0));r.push(y);continue}switch(h){case"inertia":g=new RT(m,m,u);break;case"strength":g=new FT(m,m,u);break;case"damping":g=new LT(m,m,u);break;case"mass":g=new DT(m,m,u);break;case"wind":g=new OT(m,m,u);break;case"gravity":g=new NT(m,m,u);break;case"mix":{v=1,g=new $T(m,m,u);break}default:continue}yi(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const d=e.slider[l],u=n.findConstraint(l,Io);if(!u)throw new Error(`Slider not found: ${l}`);const h=n.constraints.indexOf(u);for(const f in d){const p=d[f];if(!p[0])continue;const g=p.length;switch(f){case"time":yi(r,p,new BT(g,g,h),1,1);break;case"mix":yi(r,p,new UT(g,g,h),1,1);break}}}if(e.attachments)for(const l in e.attachments){const d=e.attachments[l],u=n.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const h in d){const f=d[h],p=n.findSlot(h);if(!p)throw new Error(`Attachment slot not found: ${h}`);const m=p.index;for(const g in f){const v=f[g],y=u.getAttachment(m,g);if(!y)throw new Error(`Timeline attachment not found: ${g}`);for(const b in v){const x=v[b];let T=x[0];if(T){if(b==="deform"){const E=y.bones,S=y.vertices,C=E?S.length/3*2:S.length,M=new ET(x.length,x.length,m,y);let k=oe(T,"time",0);for(let P=0,I=0;;P++){let N;const $=oe(T,"vertices",null);if(!$)N=E?Ze.newFloatArray(C):S;else{N=Ze.newFloatArray(C);const U=oe(T,"offset",0);if(Ze.arrayCopy($,0,N,U,$.length),s!==1)for(let D=U,L=D+$.length;D=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function Et(i,e,t,n,s,r,o,a,c,l){if(i==="stepped")return e.setStepped(n),t;const d=s<<2,u=i[d],h=i[d+1]*l,f=i[d+2],p=i[d+3]*l;return e.setBezier(t,n,s,r,a,u,h,f,p,o,c),t+1}function oe(i,e,t){return i[e]!==void 0?i[e]:t}class aY{newRegionAttachment(e,t,n,s){return new yh(t,n)}newMeshAttachment(e,t,n,s){return new _c(t,n)}newBoundingBoxAttachment(e,t){return new AA(t)}newPathAttachment(e,t){return new mc(t)}newPointAttachment(e,t){return new kA(t)}newClippingAttachment(e,t){return new Ba(t)}}class lY{sequence(e){for(let t=0;t!Number.isInteger(d)||d<0||d>=o))throw new Error(ke("errors.trailIndexOutOfRange",{name:e}));const a=Number(i.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(ke("errors.invalidTrailHull",{name:e}));if(Array.isArray(i.edges)&&i.edges.some(d=>!Number.isInteger(d)||d<0||d>=o*2||d%2))throw new Error(ke("errors.trailHullIndexOutOfRange",{name:e}));if(s.length===n.length)return;let c=0,l=0;for(;c=t)throw new Error(ke("errors.missingBoneReference",{name:e}));if(![p,m,g].every(Number.isFinite)||g<0)throw new Error(ke("errors.invalidWeight",{name:e}));u+=g}if(Math.abs(u-1)>.001)throw new Error(ke("errors.weightSum",{name:e}));l++}if(c!==s.length||l!==o)throw new Error(ke("errors.vertexCountMismatch",{name:e}))}function uY(i,e){var r,o,a,c;const t=Array.isArray(i.bones)?i.bones:[],n=new Map(t.map(l=>[String(l.name||""),l])),s=new Set;for(const l of t){if(l.inherit!=null&&!cY.has(l.inherit))throw new Error(ke("errors.invalidInherit",{name:l.name||"",inherit:l.inherit,version:e}));if(/_trail_\d+_\d+$/.test(String(l.name||""))){const d=n.get(String(l.parent||""));if(!d||/_trail_\d+_\d+$/.test(String(d.name||"")))throw new Error(ke("errors.trailBoneParent",{name:l.name||""}))}}for(const l of Array.isArray(i.skins)?i.skins:[]){const d=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(d))for(const h of Object.keys(d[u]||{})){const f=d[u][h];(f==null?void 0:f.type)==="mesh"&&(dY(f,h,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&s.add(u))}}for(const l of Object.values(i.animations||{}))for(const d of s){const u=(c=(a=l==null?void 0:l.slots)==null?void 0:a[d])==null?void 0:c.attachment;if(Array.isArray(u)&&u.some(h=>!(h!=null&&h.name)))throw new Error(ke("errors.trailSlotEmpty",{name:d}))}}function hY(i){var e;if(String(((e=i==null?void 0:i.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error(ke("errors.spine38Version"));for(const t of i.bones||[])if(t.inherit!=null)throw new Error(ke("errors.spine38Inherit",{name:t.name||""}));for(const t of Object.values(i.animations||{})){for(const s of Object.values(t.slots||{})){if(s.rgba||s.rgba2)throw new Error(ke("errors.spine38SlotColor"));for(const r of s.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error(ke("errors.spine38AttachmentName"))}for(const s of Object.values(t.bones||{}))for(const r of s.rotate||[])if(r.value!=null||r.angle==null)throw new Error(ke("errors.spine38RotationAngle"));const n=[t];for(;n.length;){const s=n.pop();if(!(!s||typeof s!="object")){if(!Array.isArray(s)&&Array.isArray(s.curve))throw new Error(ke("errors.spine38Curve"));n.push(...Object.values(s))}}}}function jx(i,e){var o;const t=JSON.parse(i),n=gu((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!n)throw new Error(ke("errors.unsupportedExportVersion",{versions:_m()}));if(e&&n!==e)throw new Error(ke("errors.exportVersionMismatch",{expected:e,actual:n}));uY(t,n),n==="3.8"&&hY(t);const s=n==="3.8"?YA(JSON.parse(JSON.stringify(t))):t,r=n==="4.3"?new rY(new lY).readSkeletonData(s):new Eu(new aY).readSkeletonData(s);if(!r.bones.length)throw new Error(ke("errors.exportMissingBones"));return{version:n,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const ZT="http://127.0.0.1:27843";class Nu extends Error{constructor(t,n="CONNECTOR_ERROR",s){super(t);A(this,"code");A(this,"pairUrl");this.name="SpineConnectorError",this.code=n,this.pairUrl=s}}function pg(i,e){return String(i||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function fY(i,e){const t=/\.([a-z0-9]{2,5})$/i.exec(i);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function pY(i,e,t){const n=String(i||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>pg(r,"images")),s=pg(e.replace(/\.[^./\\]+$/,""),"image");return[...n,`${s}${fY(e,t)}`].join("/")}async function Mp(i,e,t){if(!i)return null;const n=await fetch(i);if(!n.ok)throw new Error(ke("errors.readExportImageFailed",{name:t}));const s=await n.blob(),r=new Uint8Array(await s.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{n++,e==null||e(n,t.length)});for(const o of i.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const c of a.sequenceFrames)t.push(s(Mp(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(s(Mp(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(s(Mp(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function mY(){try{const i=await fetch(`${ZT}/v1/health`,{cache:"no-store"});if(!i.ok)throw new Error(`HTTP ${i.status}`);return{available:!0,...await i.json()}}catch(i){return{available:!1,authorized:!1,error:i instanceof Error?i.message:String(i)}}}async function gY(i,e){const t=await QT(i.systems,(s,r)=>{e==null||e({phase:"images",progress:r?s/r:1})}),n=JSON.stringify({schemaVersion:1,projectName:i.projectName,spineVersion:i.spineVersion,skeletonJson:i.skeletonJson,images:t});return new Promise((s,r)=>{const o=new XMLHttpRequest;o.open("POST",`${ZT}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Nu(ke("errors.connectorOffline"),"CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let d={};try{d=JSON.parse(await a.text())}catch{}r(new Nu(ke("errors.connectorHttpError",{status:o.status}),d.code,d.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${pg(i.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}s({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||i.spineVersion,imageCount:t.length})},o.send(n)})}function vY(i,e){const t=URL.createObjectURL(i),n=document.createElement("a");n.href=t,n.download=/\.zip$/i.test(e)?e:`${e}.zip`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}function bY(i){const e=atob(i),t=new Uint8Array(e.length);for(let n=0;nn===".."||/^[a-z]+:/i.test(n))?"images":t.join("/")}function xY(i){return String(i||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function wY(i){const e=await QT(i.systems);if(!e.length)throw new Error(ke("errors.noExportableImages"));const t=yY(i.imagesPath);return{blob:QA(e.map(s=>({name:`${t}/${s.path}`,data:bY(s.dataBase64)}))),imageCount:e.length,folder:t}}function SY(i,e){const t=`${xY(e)}-images.zip`,n=URL.createObjectURL(i),s=document.createElement("a");return s.href=n,s.download=t,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3),t}function CY(i){const{t:e}=mi();i.settings.exportSettings=ZS(i.settings.exportSettings);const t=Le(()=>i.settings.exportSettings),n=Re(!1),s=Re(null),r=Re(""),o=Re(!1),a=Re(null),c=Re(""),l=Re(""),d=Le(()=>{const C=a.value;return C?C.available?C.spineFound?C.authorized?e("export.connectorReady"):e("export.notAuthorized"):e("export.spineNotFound"):e("export.connectorOffline"):e("export.connectorChecking")}),u=Le(()=>{var C,M,k,P,I,N;return{ready:!!((C=a.value)!=null&&C.available)&&!!((M=a.value)!=null&&M.spineFound)&&!!((k=a.value)!=null&&k.authorized),warning:!!((P=a.value)!=null&&P.available)&&(!((I=a.value)!=null&&I.spineFound)||!((N=a.value)!=null&&N.authorized))}}),h=Le(()=>{var C,M,k;return!!((C=a.value)!=null&&C.available)&&!!((M=a.value)!=null&&M.spineFound)&&!!((k=a.value)!=null&&k.authorized)}),f=Le(()=>{const C=a.value;return!(C!=null&&C.available)||!C.spineFound||C.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),p=Le(()=>{const C=a.value;return C?C.available?C.spineFound?C.authorized?"":e("export.unauthorized"):e("export.notFound"):e("export.offline"):e("export.checking")}),m=Le(()=>n.value?e("export.connectorBusy"):p.value?`${e("common.disabled")}: ${p.value}`:e("export.connectorGenerate",{version:t.value.spineVersion}));Ti(()=>{y(),g=window.setInterval(y,3e3)});let g,v=0;Ar(()=>{g!==void 0&&window.clearInterval(g)});async function y(){const C=++v,M=await mY();if(C!==v)return;a.value=M;const k=l.value;(k==="CONNECTOR_OFFLINE"?M.available:k==="SPINE_NOT_FOUND"?M.available&&M.spineFound:k==="ORIGIN_NOT_ALLOWED"?M.available&&M.spineFound&&M.authorized:!!k&&M.available&&M.spineFound&&M.authorized)&&(l.value="",c.value="",o.value&&(o.value=!1,r.value=""))}function b(){return new Promise(C=>requestAnimationFrame(()=>C()))}async function x(C){i.timeline.playing=!1,i.timeline.frame=0,i.timeline.recorded=!1;for(const P of i.systems)P.frames=void 0;i.recalcTotalFrames(),await b(),i.timeline.playing=!0;const M=i.timeline.totalFrames/Math.max(1,i.timeline.fps)*1e3,k=performance.now()+Math.max(8e3,M*2.5+3e3);for(;!i.timeline.recorded;){if(performance.now()>k)throw new Error(e("export.timeout"));C==null||C(Math.min(.98,i.timeline.frame/Math.max(1,i.timeline.totalFrames-1))),await new Promise(P=>setTimeout(P,50))}C==null||C(1)}async function T(){if(!n.value){n.value=!0,s.value="json",o.value=!1,l.value="",c.value="",r.value=e("export.recalculating");try{await x();const C=Fx({systems:i.systems,timeline:i.timeline,settings:t.value});jx(C.text,t.value.spineVersion),sX(C,t.value.fileName);const M=C.warnings.length?e("export.resourceWarning",{count:C.warnings.length}):"";r.value=e("export.exported",{version:t.value.spineVersion,systems:C.particleSystemCount,animations:C.animationCount,bones:C.boneCount,warning:M})}catch(C){o.value=!0,r.value=C instanceof Error?C.message:String(C)}finally{n.value=!1,s.value=null}}}async function E(){if(n.value)return;n.value=!0,s.value="spine",o.value=!1,l.value="",c.value="",r.value=e("export.recalculating");const C=iT(e("export.projectTransferTitle"),e("export.projectTransferDetail"));try{await C.paint(),await x(I=>C.update(I*18,e("export.recalculating"))),C.update(20,e("export.generatingJson"));const M=Fx({systems:i.systems,timeline:i.timeline,settings:t.value});jx(M.text,t.value.spineVersion),r.value=e("export.preparingProject");const k=t.value.fileName.replace(/\.json$/i,"")||"SpineParticle",P=await gY({projectName:k,spineVersion:t.value.spineVersion,skeletonJson:M.text,systems:i.systems},({phase:I,progress:N})=>{I==="images"?C.update(N==null?null:22+N*18,e("export.preparingProjectFiles")):I==="upload"?C.update(N==null?null:40+N*30,e("export.uploading")):I==="processing"?C.update(null,e("export.spineProcessing")):C.update(N==null?null:82+N*16,e("export.downloadingProject"))});C.update(99,e("export.handingToBrowser")),vY(P.blob,P.fileName),r.value=e("export.projectExported",{fileName:P.fileName,images:P.imageCount,version:P.spineEditorVersion}),await y(),await C.finish(e("export.projectTransferDownload"))}catch(M){const k=M instanceof Error?M.message:String(M);o.value=!0,l.value=M instanceof Nu?M.code:"",M instanceof Nu&&M.pairUrl&&(c.value=M.pairUrl),r.value=k,await y(),await C.fail(k)}finally{n.value=!1,s.value=null}}async function S(){if(!n.value){n.value=!0,s.value="images",o.value=!1,l.value="",c.value="",r.value=e("export.collectingImages");try{const C=await wY({systems:i.systems,imagesPath:t.value.imagesPath}),M=SY(C.blob,t.value.fileName);r.value=e("export.imagesExported",{fileName:M,folder:C.folder,images:C.imageCount})}catch(C){o.value=!0,r.value=C instanceof Error?C.message:String(C)}finally{n.value=!1,s.value=null}}}return{exportSettings:t,exportBusy:n,exportTarget:s,exportMessage:r,exportError:o,connectorHealth:a,connectorPairUrl:c,connectorExportErrorCode:l,connectorStatusText:d,connectorStatusClass:u,connectorReady:h,connectorAuthorizationUrl:f,connectorDisabledReason:p,connectorButtonTitle:m,connectorHealthTimer:g,connectorHealthRequestId:v,refreshConnectorHealth:y,nextPaint:b,prepareExportFrames:x,exportSpineJson:T,exportSpineProject:E,exportSpineImages:S}}function AY(i){if(typeof i=="string")return i.trim()||void 0;if(!i||typeof i!="object"||Array.isArray(i))return;const e=Object.entries(i).filter(t=>typeof t[1]=="string"&&!!t[1].trim());return e.length?Object.fromEntries(e):void 0}function TY(i){if(!Array.isArray(i))return[];const e=[];for(const t of i){if(typeof t=="string"&&t.trim()){e.push({file:t});continue}if(!t||typeof t!="object"||Array.isArray(t))continue;const n=typeof t.file=="string"?t.file.trim():"";n&&e.push({file:n,name:AY(t.name)})}return e}function EY(i,e){return typeof i.name=="string"?i.name:i.name&&typeof i.name=="object"?i.name[e]||i.name.en||i.name["zh-CN"]||i.file.replace(/^.*[\\/]/,"").replace(/\.json$/i,""):i.file.replace(/^.*[\\/]/,"").replace(/\.json$/i,"")}function _Y(i){const e=Re(null),t=Re(""),n=Re([]),s=Re(!1),r=Re(""),o=Re(!1),a=Re([]),c=Re(!1),l=Re(""),d=Re(""),u=Re(!1),h=Re(null),f=Re("");function p(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}`}function m(){o.value=!1,d.value="",l.value=p(),c.value=!0}function g(){u.value||(c.value=!1,d.value="")}async function v(){try{a.value=await vx(),a.value.some(N=>N.name===f.value)||(f.value="")}catch(N){a.value=[],o.value=!0,r.value=N instanceof Error?N.message:ke("config.local.storageUnavailable")}}async function y(){if(!u.value){d.value="",u.value=!0;try{const N=jm(l.value);if(a.value.some(j=>j.name===N)&&!window.confirm(ke("config.local.overwriteSave",{name:N})))return;const $=JSON.stringify(mx(i),null,2);await bx(N,$),Sl(i),f.value=N,await v(),o.value=!1,r.value=ke("config.local.saved",{name:N}),c.value=!1}catch(N){d.value=N instanceof Error?N.message:ke("config.local.storageUnavailable")}finally{u.value=!1}}}function b(N){f.value=N.name}async function x(N){if(window.confirm(ke("config.local.loadOverwrite",{name:N.name}))){o.value=!1,r.value=ke("config.loading");try{await Ym(i,N.text),Sl(i),r.value=ke("config.local.loaded",{name:N.name})}catch($){o.value=!0,r.value=$ instanceof Error?$.message:String($)}}}function T(N){const $=tT(N.name);yx(N.text,$),o.value=!1,r.value=ke("config.local.downloaded",{name:$})}function E(){const $=`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`;yx(JSON.stringify(mx(i),null,2),$),Sl(i),o.value=!1,r.value=ke("config.local.downloaded",{name:$})}async function S(N){if(window.confirm(ke("config.local.deleteConfirm",{name:N.name})))try{await DU(N.name),f.value===N.name&&(f.value=""),await v(),o.value=!1,r.value=ke("config.local.deleted",{name:N.name})}catch($){o.value=!0,r.value=$ instanceof Error?$.message:ke("config.local.storageUnavailable")}}async function C(){try{const N=await vx();if(!N.length){o.value=!0,r.value=ke("config.local.downloadEmpty");return}const j=`SpineParticle-configs-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.zip`;OU(N,j),o.value=!1,r.value=ke("config.local.downloaded",{name:j})}catch(N){o.value=!0,r.value=N instanceof Error?N.message:ke("config.local.storageUnavailable")}}async function M(N){const $=N.target,j=Array.from($.files||[]);if($.value="",!j.length||u.value||!window.confirm(ke("config.local.loadAllConfirm",{count:j.length})))return;u.value=!0;let B=0,Y=0;try{for(const U of j)try{if(!/\.json$/i.test(U.name))throw new Error(ke("errors.chooseJsonConfig"));const D=await U.text();lv(D);const L=jm(U.name);await bx(L,D),B++}catch{Y++}await v(),o.value=Y>0,r.value=Y?ke("config.local.loadAllPartial",{imported:B,failed:Y}):ke("config.local.loadAllDone",{count:B})}finally{u.value=!1}}async function k(N){var B;const $=N.target,j=(B=$.files)==null?void 0:B[0];if(j){r.value=ke("config.loading"),o.value=!1;try{await yU(i,j),Sl(i),r.value=ke("config.loaded",{name:j.name})}catch(Y){o.value=!0,r.value=Y instanceof Error?Y.message:String(Y)}finally{$.value=""}}}async function P(){try{const N=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!N.ok)throw new Error(ke("config.presetListError"));const $=await N.json();n.value=TY($)}catch{n.value=[]}}async function I(){const N=t.value;if(!N)return;s.value=!0,o.value=!1,r.value=ke("config.presetLoading");const $=iT(ke("config.presetTransferTitle"),ke("config.presetDownloading",{file:N}));try{await $.paint();const j=await fetch(`/Preset/${encodeURIComponent(N)}`,{cache:"no-store"});if(!j.ok)throw new Error(ke("config.presetReadError",{file:N}));const B=await PV(j,Y=>{$.update(Y==null?null:Y*55,ke("config.presetDownloading",{file:N}))});$.update(58,ke("config.presetParsing")),$.update(70,ke("config.presetRestoring")),await Ym(i,B),Sl(i),r.value=ke("config.presetLoaded",{name:N.replace(/\.json$/i,"")}),await $.finish(ke("config.presetComplete"))}catch(j){o.value=!0;const B=j instanceof Error?j.message:String(j);r.value=ke("config.presetNamingError",{message:B}),await $.fail(B)}finally{s.value=!1,t.value=""}}return Ti(()=>{P(),v(),window.addEventListener(zm,m)}),Ar(()=>window.removeEventListener(zm,m)),{configFileInput:e,selectedPreset:t,presetOptions:n,presetLoading:s,configMessage:r,configError:o,localProjects:a,selectedLocalProjectName:f,projectSaveOpen:c,projectNameDraft:l,projectSaveError:d,projectStorageBusy:u,saveConfig:m,closeProjectSaveDialog:g,confirmSaveConfig:y,loadLocalProject:x,downloadLocalProject:T,downloadCurrentProject:E,removeLocalProject:S,downloadAllLocalProjects:C,projectFilesInput:h,loadAllProjectFiles:M,selectLocalProject:b,onConfigFileChange:k,refreshPresets:P,loadSelectedPreset:I}}function MY(i){const e=Re(null),t=Re(null),n=Re(null),s=Re(null),r=Re(null);function o(){var R;const D=(R=i.value)==null?void 0:R.config;if(!D)return;const L=Math.max(0,...D.trailResources.map(X=>X.id))+1;D.trailResources.push({id:L,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:Wm.map(X=>({...X})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:Hm.map(X=>({...X})),shapeEnabled:!1,shapeCurve:qm.map(X=>({...X}))}),p()}function a(D){var L;r.value=D,(L=s.value)==null||L.click()}function c(D,L){var z;const R=(z=i.value)==null?void 0:z.config;if(!R)return;const X=D==="trailGridCols"?32:16;R[D]=Math.min(X,Math.max(2,Math.round(Number(L)||2)))}function l(D,L){var X;const R=(X=i.value)==null?void 0:X.config.trailResources.find(z=>z.id===D);R&&(R.boneCount=Math.min(16,Math.max(2,Math.round(Number(L)||2))))}function d(D,L){var X;const R=(X=i.value)==null?void 0:X.config.trailResources.find(z=>z.id===D);R&&(R.rotation=Math.max(-360,Math.min(360,Number(L)||0)))}async function u(D){var Z,ae;const L=D.target,R=(Z=L.files)==null?void 0:Z[0],X=(ae=i.value)==null?void 0:ae.config,z=X==null?void 0:X.trailResources.find(ce=>ce.id===r.value);if(!R||!z){L.value="";return}const K=await C(R);z.texture=Hr(await tt.fromURL(K)),z.previewUrl=K,z.textureName=R.name.replace(/\.[^.]+$/,"")||"trail",L.value="",r.value=null}async function h(D){var X;const L=(X=i.value)==null?void 0:X.config,R=L==null?void 0:L.trailResources.find(z=>z.id===D);R&&(R.texture=Hr(await tt.fromURL("/images/trail.png")),R.previewUrl="/images/trail.png",R.textureName="trail",R.weight=100,R.locked=!1,R.rotation=0,R.boneCount=3,R.trailRatio=100,R.lengthMode="fixed",R.length=100,R.lengthMin=100,R.lengthMax=100,R.widthSizeMode="fixed",R.width=100,R.widthMin=100,R.widthMax=100,R.widthMode="particle",R.lifeLengthEnabled=!1,R.lifeLengthCurve=Hm.map(z=>({...z})),R.shapeEnabled=!1,R.shapeCurve=qm.map(z=>({...z})),R.colorMode="particle",R.color="#ffffff",R.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],R.blend="normal",R.alphaMode="particle",R.alpha=1,R.alphaCurve=Wm.map(z=>({...z})),p())}function f(D){var X;const L=(X=i.value)==null?void 0:X.config.trailResources;if(!L||L.length<=1)return;const R=L.findIndex(z=>z.id===D);R>=0&&L.splice(R,1),p()}function p(){var z;const D=(z=i.value)==null?void 0:z.config.trailResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const L=D.filter(K=>K.locked),R=D.filter(K=>!K.locked);let X=L.reduce((K,Z)=>K+Math.max(0,Number(Z.weight)||0),0);X>100&&(j(L,100,!0),X=100),j(R,100-X)}function m(D,L){var ae;const R=(ae=i.value)==null?void 0:ae.config.trailResources;if(!(R!=null&&R.length))return;if(R.length===1){R[0].weight=100,R[0].locked=!1;return}const X=R.find(ce=>ce.id===D);if(!X||X.locked)return;const z=R.filter(ce=>ce.id!==D&&ce.locked).reduce((ce,ve)=>ce+Math.max(0,Number(ve.weight)||0),0),K=Math.max(0,100-z),Z=R.filter(ce=>ce.id!==D&&!ce.locked);X.weight=$(Math.min(K,Math.max(0,Number(L)||0))),Z.length?j(Z,K-X.weight,!0):X.weight=$(K)}function g(D){var X;const L=(X=i.value)==null?void 0:X.config.trailResources;if(!L||L.length===1)return;const R=L.find(z=>z.id===D);R&&(R.locked=!R.locked)}function v(D,L){const R=L.target;D.color=k(R.value,D.color),R.value=D.color}function y(D,L){v(D,L),L.target.blur()}function b(){var R;const D=(R=i.value)==null?void 0:R.config;if(!D)return;const L=Math.max(0,...D.imageResources.map(X=>X.id))+1;D.imageResources.push({id:L,texture:D.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:Gm.map(X=>({...X}))}),B()}function x(D){var L;n.value=D,(L=e.value)==null||L.click()}function T(D){var L;n.value=D,(L=t.value)==null||L.click()}async function E(D){var ae,ce;const L=D.target,R=(ae=L.files)==null?void 0:ae[0],X=(ce=i.value)==null?void 0:ce.config,z=X==null?void 0:X.imageResources.find(ve=>ve.id===n.value);if(!R||!z){L.value="";return}const K=await C(R),Z=Hr(await tt.fromURL(K));z.texture=Z,z.previewUrl=K,z.textureFolder="",z.textureName=R.name.replace(/\.[^.]+$/,"")||"particle",L.value="",n.value=null}async function S(D){var K;const L=D.target,R=Array.from(L.files||[]).sort((Z,ae)=>Z.name.localeCompare(ae.name,void 0,{numeric:!0,sensitivity:"base"})),X=(K=i.value)==null?void 0:K.config,z=X==null?void 0:X.imageResources.find(Z=>Z.id===n.value);if(!R.length||!z){L.value="";return}z.sequenceFrames=await Promise.all(R.map(async Z=>{const ae=await C(Z);return{name:Z.name,previewUrl:ae,texture:Hr(await tt.fromURL(ae))}})),z.imageMode="sequence",L.value="",n.value=null}function C(D){return new Promise((L,R)=>{const X=new FileReader;X.onload=()=>L(String(X.result||"")),X.onerror=()=>R(X.error),X.readAsDataURL(D)})}function M(D){var X;const L=(X=i.value)==null?void 0:X.config,R=L==null?void 0:L.imageResources.find(z=>z.id===D);!L||!R||(R.texture=L.texture,R.textureName="star",R.textureFolder="",R.previewUrl="/images/star.png",R.imageMode="fixed",R.sequencePlayback="loop-forward",R.sequenceFps=30,R.sequenceFrames=[],R.scale=1,R.anchorX=.5,R.anchorY=.5,R.colorMode="fixed",R.colorStart="#ffffff",R.colorEnd="#ff4d4d",R.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],R.blend="normal",R.independentAlpha="off",R.alpha=1,R.alphaCurveMode="跟随导出",R.alphaCurve=Gm.map(z=>({...z})),R.locked=!1,B())}function k(D,L){let R=D.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(R)&&(R=R.split("").map(X=>X+X).join("")),/^[0-9a-f]{6}$/i.test(R)?`#${R.toLowerCase()}`:L}function P(D,L){const R=L.target;D.colorStart=k(R.value,D.colorStart),R.value=D.colorStart}function I(D,L){P(D,L),L.target.blur()}function N(D){var X;const L=(X=i.value)==null?void 0:X.config.imageResources;if(!L||L.length<=1)return;const R=L.findIndex(z=>z.id===D);R>=0&&L.splice(R,1),B()}function $(D){return Math.round(D)}function j(D,L,R=!1){if(!D.length)return;const X=Math.max(0,$(L)),z=R?D.reduce((Z,ae)=>Z+Math.max(0,Number(ae.weight)||0),0):0;let K=0;D.forEach((Z,ae)=>{const ce=ae===D.length-1,ve=$(ce?X-K:z>0?X*Math.max(0,Number(Z.weight)||0)/z:X/D.length);Z.weight=ve,K+=ve})}function B(){var z;const D=(z=i.value)==null?void 0:z.config.imageResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const L=D.filter(K=>K.locked),R=D.filter(K=>!K.locked);let X=L.reduce((K,Z)=>K+Math.max(0,Number(Z.weight)||0),0);X>100&&(j(L,100,!0),X=100),j(R,100-X)}function Y(D,L){var ae;const R=(ae=i.value)==null?void 0:ae.config.imageResources;if(!(R!=null&&R.length))return;if(R.length===1){R[0].weight=100,R[0].locked=!1;return}const X=R.find(ce=>ce.id===D);if(!X||X.locked)return;const z=R.filter(ce=>ce.id!==D&&ce.locked).reduce((ce,ve)=>ce+Math.max(0,Number(ve.weight)||0),0),K=Math.max(0,100-z),Z=R.filter(ce=>ce.id!==D&&!ce.locked);if(X.weight=$(Math.min(K,Math.max(0,Number(L)||0))),!Z.length){X.weight=$(K);return}j(Z,K-X.weight,!0)}function U(D){var X;const L=(X=i.value)==null?void 0:X.config.imageResources;if(!L||L.length===1)return;const R=L.find(z=>z.id===D);R&&(R.locked=!R.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:n,trailTextureFileInput:s,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:c,onTrailResourceBoneCountChange:l,onTrailResourceRotationChange:d,onTrailTextureFile:u,resetTrailTexture:h,removeTrailResource:f,rebalanceTrailWeights:p,setTrailResourceWeight:m,toggleTrailResourceLock:g,setTrailColor:v,commitTrailColor:y,addImageResource:b,openTexturePicker:x,openSequencePicker:T,onTextureFile:E,onSequenceFiles:S,readFileAsDataUrl:C,resetTexture:M,normalizeHex:k,setResourceFixedColor:P,commitResourceFixedColor:I,removeImageResource:N,roundWeight:$,distributeImageWeights:j,rebalanceImageWeights:B,setResourceWeight:Y,toggleResourceLock:U}}const eE=[{key:"config",titleKey:"config.title",requiresParticle:!1},{key:"scene",titleKey:"scene.title",requiresParticle:!1},{key:"emitMode",titleKey:"emission.title",requiresParticle:!0},{key:"shape",titleKey:"emission.shapeTitle",requiresParticle:!0},{key:"attr",titleKey:"attributes.title",requiresParticle:!0},{key:"look",titleKey:"appearance.title",requiresParticle:!0},{key:"mods",titleKey:"modifiers.title",requiresParticle:!0},{key:"export",titleKey:"export.title",requiresParticle:!0}];function PY(){const i=Zo(),{t:e}=mi(),{exportSettings:t,exportBusy:n,exportTarget:s,exportMessage:r,exportError:o,connectorPairUrl:a,connectorStatusText:c,connectorStatusClass:l,connectorReady:d,connectorAuthorizationUrl:u,connectorDisabledReason:h,connectorButtonTitle:f,refreshConnectorHealth:p,exportSpineJson:m,exportSpineProject:g,exportSpineImages:v}=CY(i),{configFileInput:y,selectedPreset:b,presetOptions:x,presetLoading:T,configMessage:E,configError:S,localProjects:C,projectSaveOpen:M,projectNameDraft:k,projectSaveError:P,projectStorageBusy:I,saveConfig:N,closeProjectSaveDialog:$,confirmSaveConfig:j,loadLocalProject:B,downloadLocalProject:Y,downloadCurrentProject:U,removeLocalProject:D,downloadAllLocalProjects:L,projectFilesInput:R,loadAllProjectFiles:X,selectedLocalProjectName:z,selectLocalProject:K,onConfigFileChange:Z,refreshPresets:ae,loadSelectedPreset:ce}=_Y(i);function ve(ne){return ne==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":ne==="贝塞尔"?"bezier":"linear"}i.systems.length||i.addSystem();const we=Le(()=>{const ne=i.systems.findIndex(me=>me.id===i.activeId);return ne>=0?ne:0}),re=Le(()=>i.systems[we.value]||null),{textureFileInput:Ee,sequenceFileInput:q,trailTextureFileInput:J,addTrailResource:ie,openTrailTexturePicker:se,onTrailRigChange:G,onTrailResourceBoneCountChange:H,onTrailResourceRotationChange:O,onTrailTextureFile:V,resetTrailTexture:W,removeTrailResource:ee,setTrailResourceWeight:be,toggleTrailResourceLock:ye,setTrailColor:he,commitTrailColor:Be,addImageResource:Ae,openTexturePicker:de,openSequencePicker:ge,onTextureFile:Ve,onSequenceFiles:qe,resetTexture:bt,setResourceFixedColor:ft,commitResourceFixedColor:Oe,removeImageResource:ot,setResourceWeight:Te,toggleResourceLock:ue}=MY(re),fe=Le(()=>re.value?QS(re.value.config,i.timeline.fps):30),nt=Le(()=>{var me;const ne=(me=re.value)==null?void 0:me.config;return ne?Math.max(1,Math.ceil(Number(ne.loopDurationFrames)||1)):1}),mt=Le(()=>i.activeObjectType),lt=Re(null),ct=Le(()=>i.activeObjectType==="collision"&&i.colliders.find(ne=>ne.id===i.activeObjectId)||null),Kn=Le(()=>i.activeObjectType==="path"&&i.paths.find(ne=>ne.id===i.activeObjectId)||null),_i=Le(()=>i.activeObjectType==="spine"&&i.spines.find(ne=>ne.id===i.activeObjectId)||null),wn=Le(()=>i.activeObjectType==="particle"?i.systems.some(ne=>ne.id===i.activeObjectId):i.activeObjectType==="collision"?i.colliders.some(ne=>ne.id===i.activeObjectId):i.activeObjectType==="path"?i.paths.some(ne=>ne.id===i.activeObjectId):i.spines.some(ne=>ne.id===i.activeObjectId)),gi=Le(()=>{const ne=i.spines.find(me=>me.selectedBone&&me.bones.some(Me=>Me.name===me.selectedBone));return ne?{spine:ne,boneName:ne.selectedBone}:null}),Bn=Le(()=>{var Me;const ne=(Me=re.value)==null?void 0:Me.config;if(!ne||ne.emitterFollowMode!=="bone")return null;const me=i.spines.find(it=>it.id===ne.emitterFollowSpineId);return!me||!me.bones.some(it=>it.name===ne.emitterFollowBoneName)?null:{spine:me,boneName:ne.emitterFollowBoneName}}),Pn=Re(!1),xt=Re(""),vi=Le(()=>i.spines.filter(ne=>ne.enabled&&ne.visible!==!1&&ne.status==="ready")),Jn=Le(()=>i.spines.find(ne=>{var me;return ne.id===((me=re.value)==null?void 0:me.config.renderLayerSpineId)})||null),Ui=Le(()=>{const ne=Jn.value;return!!ne&&ne.enabled&&ne.visible!==!1&&ne.status==="ready"}),Un=Le(()=>{var ne;return[...((ne=Jn.value)==null?void 0:ne.slots)||[]].sort((me,Me)=>me.order-Me.order)}),Vi=Le(()=>{const ne=xt.value.trim().toLocaleLowerCase();return ne?Un.value.filter(me=>me.name.toLocaleLowerCase().includes(ne)||me.attachment.toLocaleLowerCase().includes(ne)):Un.value}),Zn=Le(()=>Un.value.find(ne=>{var me;return ne.name===((me=re.value)==null?void 0:me.config.renderLayerSlotName)})||null),as=Le(()=>{const ne=Zn.value;return ne&&Un.value.filter(me=>me.orderMe.order-me.order)[0]||null}),ho=Le(()=>{var it;const ne=(it=re.value)==null?void 0:it.config,me=Jn.value,Me=Zn.value;return!ne||!me||!Me?"":e(ne.renderLayerSlotPosition==="below"?"renderLayer.slotLabelBelow":"renderLayer.slotLabelAbove",{spine:me.name,slot:Me.name})}),Ic=Le(()=>{var Me;const ne=(Me=re.value)==null?void 0:Me.config,me=Zn.value;return!ne||!me?"":ne.renderLayerSlotPosition==="above"?e("renderLayer.resolvedAbove",{slot:me.name}):as.value?e("renderLayer.resolvedBetween",{previous:as.value.name,slot:me.name}):""}),Rc=Le(()=>{var Me;const ne=(Me=re.value)==null?void 0:Me.config;if(!ne||ne.renderLayerMode!=="slot")return"";if(!vi.value.length)return e("renderLayer.warningNoSpine");if(!ne.renderLayerSpineId)return e("renderLayer.warningNoSelection");const me=Jn.value;return me?!me.enabled||me.status!=="ready"?e("renderLayer.warningNotReady"):ne.renderLayerSlotName?Zn.value?ne.renderLayerSlotPosition==="below"&&!as.value?e("renderLayer.warningFirstSlot"):"":e("renderLayer.warningMissingSlot"):"":e("renderLayer.warningMissingSpine")});function al(){var me;const ne=(me=re.value)==null?void 0:me.config;ne&&(ne.renderLayerMode="slot",!ne.renderLayerSpineId&&vi.value.length&&(ne.renderLayerSpineId=vi.value[0].id),Pn.value=!ne.renderLayerSlotName)}function Fc(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.renderLayerSpineId=Math.max(0,Math.round(Number(ne.target.value)||0)),me.renderLayerSlotName="",Pn.value=!0)}function ll(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.renderLayerSlotName=ne.name,Pn.value=!1,xt.value="")}function Lc(){var me;const ne=(me=re.value)==null?void 0:me.config;ne&&(ne.renderLayerSlotName="",ne.renderLayerSlotPosition="above")}const cl=Re(!1),dl=Le(()=>{var me;const ne=new Set(((me=re.value)==null?void 0:me.config.collisionColliderIds)||[]);return i.colliders.filter(Me=>ne.has(Me.id))}),Er=Le(()=>{var me;const ne=new Set(((me=re.value)==null?void 0:me.config.collisionColliderIds)||[]);return i.colliders.filter(Me=>!ne.has(Me.id))});Ut(()=>{var ne,me;return[(ne=re.value)==null?void 0:ne.id,(me=re.value)==null?void 0:me.config.collision]},()=>{cl.value=!1}),Ut(()=>{var ne;return(ne=re.value)==null?void 0:ne.id},()=>{Pn.value=!1,xt.value=""});function na(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;!me||me.collisionColliderIds.includes(ne)||(me.collisionColliderIds.push(ne),cl.value=!1)}function Mh(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.collisionColliderIds=me.collisionColliderIds.filter(it=>it!==ne))}ma(()=>{for(const ne of i.systems)ne.visible==null&&(ne.visible=!0);for(const ne of i.colliders)ne.visible==null&&(ne.visible=!0);for(const ne of i.paths)ne.visible==null&&(ne.visible=!0);for(const ne of i.spines)ne.visible==null&&(ne.visible=!0)}),ma(()=>{if(!re.value)return;const ne=fr(re.value.config);ne.lifeMode==="curve"&&(ne.lifeMode="random"),ne.speedMode==="curve"&&(ne.speedMode="random"),ne.scaleMode==="curve"&&(ne.scaleMode="random"),ne.initialRotationMode==="curve"&&(ne.initialRotationMode="random"),ne.mode==="stream"&&!(ne.duration>0)&&(ne.duration=1),ne.streamBehavior==="loop"&&(ne.emitterFollow||ne.emitterFollowMode!=="none")&&xv(ne)}),ma(()=>{const ne=new Set(i.colliders.map(Me=>Me.id)),me=new Set(i.systems.map(Me=>Me.id));for(const Me of i.systems){const it=fr(Me.config),un=it.collisionColliderIds.filter(bi=>ne.has(bi));un.length!==it.collisionColliderIds.length&&(it.collisionColliderIds=un),it.spawnPathId>0&&!i.paths.some(bi=>bi.id===it.spawnPathId)&&(it.spawnPathId=0,(it.emissionAngleMode==="path-normal"||it.emissionAngleMode==="path-tangent")&&(it.emissionAngleMode="fixed"));const ia=tC(i.systems,Me.id);for(const bi of it.events||[])bi.targetSystemId>0&&(bi.targetSystemId===Me.id||ia.has(bi.targetSystemId)||!me.has(bi.targetSystemId))&&(bi.targetSystemId=0);if(it.emitterFollowMode!=="bone")continue;const Ph=i.spines.find(bi=>bi.id===it.emitterFollowSpineId);!!(Ph!=null&&Ph.bones.some(bi=>bi.name===it.emitterFollowBoneName))||(it.emitterFollowMode="none",it.emitterFollowSpineId=0,it.emitterFollowBoneName="")}}),ma(()=>{for(const ne of i.systems){const me=fr(ne.config);me.renderLayerMode!=="slot"||!me.renderLayerSpineId||i.spines.some(Me=>Me.id===me.renderLayerSpineId)||(me.renderLayerSpineId=0,me.renderLayerSlotName="")}}),ma(()=>{for(const ne of i.colliders)ne.followPathId==null&&(ne.followPathId=0),ne.followDuration>0||(ne.followDuration=2),ne.followPathRotation==null&&(ne.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(ne.followCurveMode)||(ne.followCurveMode="跟随导出"),(!Array.isArray(ne.followCurve)||ne.followCurve.length<2)&&(ne.followCurve=[{x:0,y:0},{x:1,y:1}])});const ls=qo({config:!0,scene:!i.settings.floatingMenuEnabled,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function yv(ne){const me=eE.find(Me=>Me.key===ne);return!!me&&(!me.requiresParticle||mt.value==="particle"&&!!re.value)}function sE(ne){yv(ne)&&(lt.value=ne)}function rE(ne){return!i.settings.floatingMenuEnabled||lt.value===ne}function oE(ne){return i.settings.floatingMenuEnabled?lt.value===ne:!ls[ne]}function aE(ne){i.settings.floatingMenuEnabled||(ls[ne]=!ls[ne])}Ut(()=>i.settings.floatingMenuEnabled,ne=>{ne&&(lt.value=null,ls.scene=!0)},{immediate:!0}),Ut(()=>[i.activeObjectType,i.activeObjectId],([ne])=>{i.settings.floatingMenuEnabled&&ne!=="particle"&&(ls.scene=!1,lt.value="scene")});function lE(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.mode=ne,ne==="stream"&&!(me.duration>0)&&(me.duration=1))}function cE(ne){var it;const me=(it=re.value)==null?void 0:it.config;if(!me)return;const Me=Math.min(1800,Math.max(1,Math.ceil(Number(ne)||1)));me.loopDurationFrames=Me}function xv(ne){const me=lc();ne.emitterFollow=!1,ne.emitterFollowMode="none",ne.emitterFollowPathId=me.emitterFollowPathId,ne.emitterFollowSpineId=me.emitterFollowSpineId,ne.emitterFollowBoneName=me.emitterFollowBoneName,ne.emitterFollowBoneOffsetX=me.emitterFollowBoneOffsetX,ne.emitterFollowBoneOffsetY=me.emitterFollowBoneOffsetY,ne.emitterFollowBoneRotation=me.emitterFollowBoneRotation,ne.emitterFollowBoneScaleX=me.emitterFollowBoneScaleX,ne.emitterFollowBoneScaleY=me.emitterFollowBoneScaleY,ne.emitterAngleMode=me.emitterAngleMode,ne.emitterFollowCurve=me.emitterFollowCurve.map(Me=>({...Me})),ne.emitterFollowDuration=me.emitterFollowDuration,ne.emitterFollowSpace=me.emitterFollowSpace,ne.emitterFollowDirection=me.emitterFollowDirection,ne.emitterFollowOffset=me.emitterFollowOffset}function dE(ne){var un;const me=(un=re.value)==null?void 0:un.config;if(!me||me.streamBehavior===ne)return;const Me=ne==="loop",it=e(Me?"errors.confirmLoopFollowEnter":"errors.confirmLoopFollowExit");window.confirm(it)&&(xv(me),me.streamBehavior=ne,Me||(me.generateLoopStartAnimation=!1,me.generateLoopEndAnimation=!1))}function uE(ne,me){var un;const Me=(un=re.value)==null?void 0:un.config;if(!Me)return;const it=me.target.checked;ne==="start"?Me.generateLoopStartAnimation=it:Me.generateLoopEndAnimation=it}function hE(ne,me){var un;const Me=(un=re.value)==null?void 0:un.config;if(!Me)return;const it=Math.min(1800,Math.max(1,Math.ceil(Number(me.target.value)||30)));ne==="start"?Me.loopStartDurationFrames=it:Me.loopEndDurationFrames=it}function fE(ne,me){var un;const Me=(un=re.value)==null?void 0:un.config;if(!Me)return;const it=me.target.checked;ne==="start"?Me.loopStartUseCustomDuration=it:Me.loopEndUseCustomDuration=it}function pE(ne,me){const Me=ne.target.value;if(me.emitterFollowMode=Me,Me!=="bone"){me.emitterFollowSpineId=0,me.emitterFollowBoneName="";return}wv(me)}function wv(ne){const me=gi.value;if(!me){ne.emitterFollowMode="none",ne.emitterFollowSpineId=0,ne.emitterFollowBoneName="";return}ne.emitterFollowMode="bone",ne.emitterFollowSpineId=me.spine.id,ne.emitterFollowBoneName=me.boneName}const mE={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","eventEnabled","events","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function gE(ne){var it;const me=(it=re.value)==null?void 0:it.config;if(ne==="export"){i.settings.exportSettings=Hg();return}if(!me)return;const Me=lc();for(const un of mE[ne])me[un]=Me[un]}function vE(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function bE(ne){var me;i.selectSystem(((me=i.systems[ne])==null?void 0:me.id)??0)}function ul(){i.settings.floatingMenuEnabled&&(ls.scene=!1,lt.value="scene")}function yE(){ul(),i.addSystem()}function xE(){ul(),i.addCollider()}function wE(){ul(),i.addPath()}function SE(){ul(),i.addSpine()}function CE(){ul(),i.duplicateSelectedObject()}function Us(ne,me,Me=0,it=0,un=0,ia=0){return{x:ne,y:me,inX:Me,inY:it,outX:un,outY:ia}}function AE(){const ne=Kn.value;if(!(!ne||!ne.preset))if(ne.preset==="circle"){const Me=60.751328;ne.points=[Us(110,0,0,-Me,0,Me),Us(0,110,Me,0,-Me,0),Us(-110,0,0,Me,0,-Me),Us(0,-110,-Me,0,Me,0)],ne.closed=!0}else if(ne.preset==="square")ne.points=[Us(-100,-100),Us(100,-100),Us(100,100),Us(-100,100)],ne.closed=!0;else{const me=ne.preset==="star"?10:6;ne.points=Array.from({length:me},(Me,it)=>{const un=ne.preset==="star"&&it%2?50:110,ia=-Math.PI*.5+it/me*Math.PI*2;return Us(Math.cos(ia)*un,Math.sin(ia)*un)}),ne.closed=!0}}function TE(){Kn.value&&(Kn.value.points=[])}function EE(){re.value&&(re.value.config.seed=Math.floor(Math.random()*999999)+1)}function _E(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;!me||ne==="direction"||(me.speedOverLifeMode=ne,ne==="curve"&&me.speedOverLifeMin===me.speedOverLifeMax&&(me.speedOverLifeMin=0,me.speedOverLifeMax=1))}function Sv(){var me;const ne=(me=re.value)==null?void 0:me.config;!ne||ne.scaleOverLifeMode!=="curve"||(ne.scaleOverLifeMin===ne.scaleOverLifeMax&&(ne.scaleOverLifeMin=0,ne.scaleOverLifeMax=1),ne.scaleYOverLifeMin===ne.scaleYOverLifeMax&&(ne.scaleYOverLifeMin=0,ne.scaleYOverLifeMax=1))}function ME(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;!me||ne==="direction"||(me.scaleOverLifeMode=ne,Sv())}const PE={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function kE(){var Me;const ne=(Me=re.value)==null?void 0:Me.config;if(!ne)return;const me=PE[ne.shape];me&&Object.assign(ne,me)}function IE(){var me;const ne=(me=re.value)==null?void 0:me.config;!ne||ne.spawnPathId>0||(ne.emissionAngleMode==="path-normal"||ne.emissionAngleMode==="path-tangent")&&(ne.emissionAngleMode="fixed")}return{store:i,exportSettings:t,exportBusy:n,exportTarget:s,exportMessage:r,exportError:o,connectorPairUrl:a,connectorStatusText:c,connectorStatusClass:l,connectorReady:d,connectorAuthorizationUrl:u,connectorDisabledReason:h,connectorButtonTitle:f,refreshConnectorHealth:p,exportSpineJson:m,exportSpineProject:g,exportSpineImages:v,configFileInput:y,selectedPreset:b,presetOptions:x,presetLoading:T,configMessage:E,configError:S,localProjects:C,selectedLocalProjectName:z,selectLocalProject:K,projectSaveOpen:M,projectNameDraft:k,projectSaveError:P,projectStorageBusy:I,projectFilesInput:R,saveConfig:N,closeProjectSaveDialog:$,confirmSaveConfig:j,loadLocalProject:B,downloadLocalProject:Y,downloadCurrentProject:U,removeLocalProject:D,downloadAllLocalProjects:L,loadAllProjectFiles:X,onConfigFileChange:Z,refreshPresets:ae,loadSelectedPreset:ce,resolvedCurveEditorMode:ve,sys:re,textureFileInput:Ee,sequenceFileInput:q,trailTextureFileInput:J,addTrailResource:ie,openTrailTexturePicker:se,onTrailRigChange:G,onTrailResourceBoneCountChange:H,onTrailResourceRotationChange:O,onTrailTextureFile:V,resetTrailTexture:W,removeTrailResource:ee,setTrailResourceWeight:be,toggleTrailResourceLock:ye,setTrailColor:he,commitTrailColor:Be,addImageResource:Ae,openTexturePicker:de,openSequencePicker:ge,onTextureFile:Ve,onSequenceFiles:qe,resetTexture:bt,setResourceFixedColor:ft,commitResourceFixedColor:Oe,removeImageResource:ot,setResourceWeight:Te,toggleResourceLock:ue,automaticLoopDuration:fe,loopDurationFrames:nt,activeObjectType:mt,activeSection:lt,canUseSection:yv,activateSection:sE,sectionVisible:rE,sectionOpen:oE,activeCollider:ct,activePath:Kn,activeSpine:_i,canCopyObject:wn,selectedSpineBone:gi,boundSpineBone:Bn,renderLayerSlotPickerOpen:Pn,renderLayerSlotSearch:xt,renderLayerReadySpines:vi,renderLayerSpineReady:Ui,renderLayerSlots:Un,renderLayerFilteredSlots:Vi,renderLayerSlotLabel:ho,renderLayerResolvedLabel:Ic,renderLayerWarning:Rc,setRenderLayerSlotMode:al,selectRenderLayerSpine:Fc,pickRenderLayerSlot:ll,clearRenderLayerSlot:Lc,collisionPickerOpen:cl,selectedCollisionBodies:dl,availableCollisionBodies:Er,addCollisionBody:na,removeCollisionBody:Mh,collapsed:ls,toggle:aE,setEmitMode:lE,setLoopDurationFrames:cE,setStreamBehavior:dE,setLoopSection:uE,setLoopSectionDuration:hE,setLoopCustomDuration:fE,onEmitterFollowModeChange:pE,bindSelectedBone:wv,resetModule:gE,normalizeExportFps:vE,select:bE,addSys:yE,addCollider:xE,addPath:wE,addSpine:SE,copySelectedObject:CE,applyPathPreset:AE,clearPathAnchors:TE,randomizeSeed:EE,setSpeedOverLifeMode:_E,prepareScaleOverLifeCurve:Sv,setScaleOverLifeMode:ME,onShapeChange:kE,onSpawnPathChange:IE,LINEAR_CURVE:EV,FLAT_CURVE:Hm,ALPHA_CURVE:_V,RESOURCE_ALPHA_CURVE:Gm,TRAIL_ALPHA_CURVE:Wm,TRAIL_SHAPE_CURVE:qm}}const tE=Symbol("particle-panel");function kY(){const i=PY();return F1(tE,i),i}function Tr(){const i=No(tE);if(!i)throw new Error("Particle panel sections require a ParticlePanel parent");return i}const IY={class:"group config-management"},RY={class:"caret"},FY={class:"group-body config-management-body"},LY={class:"config-toolbar"},DY=["title"],OY=["title"],NY=["aria-label","disabled"],$Y={value:""},BY=["value"],UY={class:"project-library"},VY={class:"project-library-title"},XY={key:0,class:"project-list",role:"listbox"},YY=["title","aria-selected","onClick","onDblclick","onKeydown"],zY={class:"project-name"},jY={key:0,class:"project-size"},HY=["onClick"],GY=["onClick"],WY={key:1,class:"project-empty"},qY={class:"project-bulk-actions"},KY=["disabled"],JY=["disabled"],ZY={class:"project-save-head"},QY=["disabled"],ez=["placeholder"],tz={key:0,class:"project-save-error"},nz={class:"project-save-actions"},iz=["disabled"],sz=["disabled"],rz=Zt({__name:"ProjectConfigSection",setup(i){const{store:e,configFileInput:t,selectedPreset:n,presetOptions:s,presetLoading:r,configMessage:o,configError:a,localProjects:c,projectSaveOpen:l,projectNameDraft:d,projectSaveError:u,projectStorageBusy:h,saveConfig:f,closeProjectSaveDialog:p,confirmSaveConfig:m,loadLocalProject:g,downloadLocalProject:v,downloadCurrentProject:y,removeLocalProject:b,downloadAllLocalProjects:x,projectFilesInput:T,loadAllProjectFiles:E,selectedLocalProjectName:S,selectLocalProject:C,onConfigFileChange:M,refreshPresets:k,loadSelectedPreset:P,collapsed:I,toggle:N,sectionOpen:$,select:j}=Tr(),{locale:B}=mi();function Y(D){const L=Math.max(1,D/1024);if(L<1024)return`${L<10?L.toFixed(1):Math.round(L)} KB`;const R=L/1024;return`${R<10?R.toFixed(1):Math.round(R)} MB`}function U(D){return EY(D,B.value)}return(D,L)=>(Q(),te(_e,null,[w("div",IY,[w("div",{class:"group-head",onClick:L[1]||(L[1]=R=>_(N)("config"))},[w("span",RY,F(_(I).config?"▸":"▾"),1),w("span",null,F(D.$t("config.title")),1),w("button",{type:"button",class:"group-download",onClick:L[0]||(L[0]=We((...R)=>_(y)&&_(y)(...R),["stop"]))},F(D.$t("config.local.downloadCurrent")),1)]),pe(w("div",FY,[w("div",LY,[w("button",{title:D.$t("config.saveTitle"),onClick:L[2]||(L[2]=(...R)=>_(f)&&_(f)(...R))},F(D.$t("config.save")),9,DY),w("button",{title:D.$t("config.loadTitle"),onClick:L[3]||(L[3]=R=>{var X;return(X=_(t))==null?void 0:X.click()})},F(D.$t("config.load")),9,OY),pe(w("select",{"onUpdate:modelValue":L[4]||(L[4]=R=>Jt(n)?n.value=R:null),"aria-label":D.$t("config.presets"),disabled:!_(s).length||_(r),onPointerdown:L[5]||(L[5]=(...R)=>_(k)&&_(k)(...R)),onFocus:L[6]||(L[6]=(...R)=>_(k)&&_(k)(...R)),onChange:L[7]||(L[7]=(...R)=>_(P)&&_(P)(...R))},[w("option",$Y,F(_(s).length?D.$t("config.selectPreset"):D.$t("config.noPresets")),1),(Q(!0),te(_e,null,Mt(_(s),R=>(Q(),te("option",{key:R.file,value:R.file},F(U(R)),9,BY))),128))],40,NY),[[_t,_(n)]]),w("input",{ref_key:"configFileInput",ref:t,hidden:"",type:"file",accept:".json,application/json",onChange:L[8]||(L[8]=(...R)=>_(M)&&_(M)(...R))},null,544)]),_(o)?(Q(),te("div",{key:0,class:Pe(["config-message",{error:_(a)}])},F(_(o)),3)):xe("",!0),w("div",UY,[w("div",VY,F(D.$t("config.local.listTitle")),1),_(c).length?(Q(),te("div",XY,[(Q(!0),te(_e,null,Mt(_(c),R=>(Q(),te("div",{key:R.name,class:Pe(["project-row",{selected:_(S)===R.name}]),title:D.$t("config.local.loadHint"),role:"option",tabindex:"0","aria-selected":_(S)===R.name,onClick:X=>_(C)(R),onDblclick:X=>_(g)(R),onKeydown:[es(We(X=>_(g)(R),["prevent"]),["enter"]),es(We(X=>_(C)(R),["prevent"]),["space"])]},[w("span",zY,F(R.name),1),_(e).settings.showProjectSize?(Q(),te("span",jY,F(Y(R.size)),1)):xe("",!0),w("div",{class:"project-actions",onDblclick:L[9]||(L[9]=We(()=>{},["stop"]))},[w("button",{type:"button",onClick:We(X=>_(b)(R),["stop"])},F(D.$t("config.local.delete")),9,HY),w("button",{type:"button",onClick:We(X=>_(v)(R),["stop"])},F(D.$t("config.local.download")),9,GY)],32)],42,YY))),128))])):(Q(),te("div",WY,F(D.$t("config.local.empty")),1))]),w("div",qY,[w("button",{type:"button",disabled:_(h),onClick:L[10]||(L[10]=(...R)=>_(x)&&_(x)(...R))},F(D.$t("config.local.downloadAll")),9,KY),w("button",{type:"button",disabled:_(h),onClick:L[11]||(L[11]=R=>{var X;return(X=_(T))==null?void 0:X.click()})},F(D.$t("config.local.loadAll")),9,JY),w("input",{ref_key:"projectFilesInput",ref:T,hidden:"",type:"file",multiple:"",accept:".json,application/json",onChange:L[12]||(L[12]=(...R)=>_(E)&&_(E)(...R))},null,544)])],512),[[Xt,_($)("config")]])]),(Q(),kt(Qu,{to:"body"},[_(l)?(Q(),te("div",{key:0,class:"project-save-backdrop",onPointerdown:L[18]||(L[18]=We((...R)=>_(p)&&_(p)(...R),["self"]))},[w("form",{class:"project-save-dialog",onSubmit:L[16]||(L[16]=We((...R)=>_(m)&&_(m)(...R),["prevent"])),onKeydown:L[17]||(L[17]=es(We((...R)=>_(p)&&_(p)(...R),["prevent"]),["esc"]))},[w("div",ZY,[w("span",null,F(D.$t("config.local.saveTitle")),1),w("button",{type:"button",disabled:_(h),onClick:L[13]||(L[13]=(...R)=>_(p)&&_(p)(...R))},"✕",8,QY)]),w("label",null,[w("span",null,F(D.$t("config.local.name")),1),pe(w("input",{"onUpdate:modelValue":L[14]||(L[14]=R=>Jt(d)?d.value=R:null),class:"inp",placeholder:D.$t("config.local.namePlaceholder"),autofocus:""},null,8,ez),[[Je,_(d)]])]),_(u)?(Q(),te("div",tz,F(_(u)),1)):xe("",!0),w("div",nz,[w("button",{type:"button",disabled:_(h),onClick:L[15]||(L[15]=(...R)=>_(p)&&_(p)(...R))},F(D.$t("common.cancel")),9,iz),w("button",{type:"submit",class:"primary",disabled:_(h)},F(D.$t("config.save")),9,sz)])],32)],32)):xe("",!0)]))],64))}}),Hx=dn(rz,[["__scopeId","data-v-2e5d6a49"]]),oz={class:"ns-label"},az=["min","max","step","value","disabled"],lz=["min","max","step","value","disabled"],cz=Zt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=e,s=Re(String(t.modelValue));Ut(()=>t.modelValue,c=>{s.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||n("update:modelValue",l)}function o(c){s.value=c.target.value;const l=parseFloat(s.value);Number.isNaN(l)||n("update:modelValue",l)}function a(){const c=parseFloat(s.value);Number.isNaN(c)&&(s.value=String(t.modelValue))}return(c,l)=>(Q(),te("div",{class:Pe(["ns",{disabled:i.disabled}])},[w("span",oz,F(i.label),1),w("input",{type:"range",class:"ns-range",min:i.min,max:i.max,step:i.step,value:i.modelValue,disabled:i.disabled,onInput:r},null,40,az),w("input",{type:"number",class:"ns-num",min:i.min,max:i.max,step:i.step,value:s.value,disabled:i.disabled,onInput:o,onBlur:a},null,40,lz)],2))}}),Ue=dn(cz,[["__scopeId","data-v-7c2fbed0"]]),dz={class:"ce"},uz={class:"ce-editor"},hz={class:"ce-grid"},fz=["x1","x2","y2"],pz=["y1","x2","y2"],mz=["x","y","width","height"],gz=["d"],vz={key:0,class:"ce-handles"},bz=["x1","y1","x2","y2"],yz=["cx","cy","onPointerdown"],xz=["x1","y1","x2","y2"],wz=["cx","cy","onPointerdown"],Sz=["cx","cy"],Cz=["cx","cy","onPointerdown","onDblclick"],Az={class:"ce-nav"},Tz={class:"ce-tip"},Ez=["title"],kr=8,_z=Zt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=e,s=Re(null),r=Re(300),o=Re(110);let a=null;function c(){if(!s.value)return;const P=s.value.getBoundingClientRect();r.value=P.width,o.value=P.height}function l(P){return kr+P*(r.value-kr*2)}function d(P){return kr+(1-P)*(o.value-kr*2)}function u(){return[...t.modelValue].sort((P,I)=>P.x-I.x)}function h(P){n("update:modelValue",[...P].sort((I,N)=>I.x-N.x))}function f(){h(t.defaultValue.map(P=>({...P})))}const p=Le(()=>u());function m(P){const I=p.value[P],N=p.value[Math.max(0,P-1)];return{x:I.x-(I.x-N.x)/3,y:I.y-(I.y-N.y)/3}}function g(P){const I=p.value[P],N=p.value[Math.min(p.value.length-1,P+1)];return{x:I.x+(N.x-I.x)/3,y:I.y+(N.y-I.y)/3}}function v(P){const I=p.value[P],N=m(P);return{x:I.x+(I.inX??N.x-I.x),y:I.y+(I.inY??N.y-I.y)}}function y(P){const I=p.value[P],N=g(P);return{x:I.x+(I.outX??N.x-I.x),y:I.y+(I.outY??N.y-I.y)}}const b=Le(()=>{if(!p.value.length)return"";let P=`M ${l(p.value[0].x)} ${d(p.value[0].y)}`;for(let I=1;IMath.abs(j.x-I)>.02);$.push({x:I,y:N}),h($)}let S={t:0,i:-1,x:0,y:0};function C(P,I){P.stopPropagation();const N=u().findIndex(Y=>Math.abs(Y.x-p.value[I].x)<1e-6&&Math.abs(Y.y-p.value[I].y)<1e-6);if(N<0)return;const $=Date.now();if($-S.t<300&&S.i===I&&Math.abs(P.clientX-S.x)<8&&Math.abs(P.clientY-S.y)<8){S={t:0,i:-1,x:0,y:0},k(I);return}S={t:$,i:I,x:P.clientX,y:P.clientY};const j=Y=>{(Math.abs(Y.clientX-P.clientX)>8||Math.abs(Y.clientY-P.clientY)>8)&&(S={t:0,i:-1,x:0,y:0});const{x:U,y:D}=x(Y.clientX,Y.clientY),L=u();L[N]={x:U,y:D},h(L)},B=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",B)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",B)}function M(P,I,N){P.stopPropagation();const $=B=>{const Y=x(B.clientX,B.clientY),U=u(),D=U[I],L=N==="in"?U[Math.max(0,I-1)].x:D.x,R=N==="in"?D.x:U[Math.min(U.length-1,I+1)].x,X=Math.min(R,Math.max(L,Y.x)),z=Math.round((X-D.x)*100)/100,K=Math.round((Y.y-D.y)*100)/100;U[I]=N==="in"?{...D,inX:z,inY:K}:{...D,outX:z,outY:K},h(U)},j=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",j)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",j)}function k(P,I){I==null||I.stopPropagation();const N=u();N.length<=2||(T=Date.now(),h(N.filter(($,j)=>j!==P)))}return Ti(()=>{c(),a=new ResizeObserver(c),s.value&&a.observe(s.value)}),nl(()=>{a==null||a.disconnect()}),(P,I)=>(Q(),te("div",dz,[w("div",uz,[(Q(),te("svg",{ref_key:"svg",ref:s,class:"ce-svg",onDblclick:E},[w("g",hz,[(Q(),te(_e,null,Mt([.25,.5,.75],N=>w("line",{key:"v"+N,x1:l(N),y1:"0",x2:l(N),y2:d(0)},null,8,fz)),64)),(Q(),te(_e,null,Mt([.25,.5,.75],N=>w("line",{key:"h"+N,x1:"0",y1:d(N),x2:l(1),y2:d(N)},null,8,pz)),64))]),w("rect",{x:l(0),y:d(1),width:l(1)-l(0),height:d(0)-d(1),class:"ce-frame",fill:"none"},null,8,mz),w("path",{d:b.value,class:"ce-line",fill:"none"},null,8,gz),i.mode==="bezier"?(Q(),te("g",vz,[(Q(!0),te(_e,null,Mt(p.value,(N,$)=>(Q(),te(_e,{key:"handles-"+$},[$>0?(Q(),te("line",{key:0,x1:l(N.x),y1:d(N.y),x2:l(v($).x),y2:d(v($).y)},null,8,bz)):xe("",!0),$>0?(Q(),te("circle",{key:1,cx:l(v($).x),cy:d(v($).y),r:"4",onPointerdown:j=>M(j,$,"in")},null,40,yz)):xe("",!0),$M(j,$,"out")},null,40,wz)):xe("",!0)],64))),128))])):xe("",!0),(Q(!0),te(_e,null,Mt(p.value,(N,$)=>(Q(),te("g",{key:$},[w("circle",{cx:l(N.x),cy:d(N.y),r:"5",class:"ce-node"},null,8,Sz),w("circle",{cx:l(N.x),cy:d(N.y),r:"9",class:"ce-hit",onPointerdown:j=>C(j,$),onDblclick:j=>k($,j)},null,40,Cz)]))),128))],544)),w("div",Az,[w("span",Tz,F(i.mode==="bezier"?P.$t("curve.bezierHint"):P.$t("curve.linearHint")),1)])]),w("button",{class:"ce-reset",type:"button",title:P.$t("curve.resetTitle"),onClick:f},F(P.$t("common.reset")),9,Ez)]))}}),Ts=dn(_z,[["__scopeId","data-v-8f475293"]]),Mz={class:"spine-editor"},Pz={class:"editor-title"},kz={class:"field wide"},Iz={class:"grid three"},Rz={class:"field"},Fz={class:"field"},Lz={class:"field"},Dz={class:"grid three"},Oz={class:"field"},Nz={class:"field"},$z={class:"field"},Bz={class:"section-title"},Uz=["disabled"],Vz={class:"folder-hint"},Xz={class:"asset-row"},Yz=["title"],zz={class:"asset-row"},jz=["title"],Hz={class:"asset-row"},Gz=["title"],Wz={class:"asset-actions"},qz=["disabled"],Kz={class:"runtime-note"},Jz={key:0},Zz={key:0,class:"error"},Qz={class:"section-box"},e6={class:"section-title"},t6={key:0,class:"empty"},n6={key:1,class:"field wide"},i6={value:""},s6=["value"],r6={class:"section-box"},o6={class:"tree-title-row"},a6={class:"section-title"},l6=["disabled","title"],c6=["disabled","title"],d6={class:"tree-tabs"},u6={key:0,class:"empty"},h6={key:1,class:"bone-search"},f6=["aria-label","placeholder"],p6=["title","aria-label"],m6={key:2,class:"empty"},g6={key:3,class:"bone-tree"},v6=["onClick","onKeydown"],b6=["title","onClick"],y6={key:1,class:"bone-leaf"},x6={class:"bone-name"},w6={key:0,class:"empty"},S6={key:1,class:"bone-search"},C6=["aria-label","placeholder"],A6=["title","aria-label"],T6={key:2,class:"empty"},E6={key:3,class:"bone-tree slot-tree"},_6=["title","onClick","onKeydown"],M6={class:"slot-order"},P6={class:"bone-name"},k6={class:"slot-attachment"},I6=Zt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(i){const e=i,{t}=mi(),n=Zo(),s=Re(null),r=Re(null),o=Re(null),a=Re(null),c=Re(new Set),l=Re(""),d=Re("bone"),u=Re(""),h=Re(null),f=Re(null),p=Re([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const m=Le(()=>{var X;return((X=h.value)==null?void 0:X.name)||e.spineObject.skeletonFileName}),g=Le(()=>{var X;return((X=f.value)==null?void 0:X.name)||e.spineObject.atlasFileName}),v=Le(()=>p.value.length?p.value.map(X=>X.name):e.spineObject.textureFileNames),y=Le(()=>v.value.length?t("spine.textureSummary",{count:v.value.length,names:v.value.join(", ")}):"PNG / JPEG / WebP..."),b=Le(()=>new Set(e.spineObject.bones.map(X=>X.parent).filter(X=>!!X))),x=Le(()=>new Map(e.spineObject.bones.map(X=>[X.name,X]))),T=Le(()=>e.spineObject.bones.filter(X=>{var Z;const z=l.value.trim().toLocaleLowerCase();if(z)return X.name.toLocaleLowerCase().includes(z);let K=X.parent;for(;K;){if(c.value.has(K))return!1;K=((Z=x.value.get(K))==null?void 0:Z.parent)||null}return!0})),E=Le(()=>b.value.size>0&&[...b.value].every(X=>c.value.has(X))),S=Le(()=>{const X=u.value.trim().toLocaleLowerCase(),z=[...e.spineObject.slots].sort((K,Z)=>K.order-Z.order);return X?z.filter(K=>K.name.toLocaleLowerCase().includes(X)||K.attachment.toLocaleLowerCase().includes(X)):z});function C(X){const z=e.spineObject.selectedBone===X;for(const K of n.spines)K.selectedBone="";z||(e.spineObject.selectedBone=X)}function M(X){const z=e.spineObject.selectedSlot===X;for(const K of n.spines)K.selectedSlot="";z||(e.spineObject.selectedSlot=X)}function k(X){c.value.has(X)?c.value.delete(X):c.value.add(X)}function P(){c.value=E.value?new Set:new Set(b.value)}function I(X){var z;return((z=X.target.files)==null?void 0:z[0])||null}function N(X){h.value=I(X)}function $(X){f.value=I(X)}function j(X){p.value=Array.from(X.target.files||[])}function B(X){return X.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function Y(X){const z=Array.from(X.target.files||[]);if(!z.length)return;const K=z.filter(re=>/\.(json|skel)$/i.test(re.name)),Z=z.filter(re=>/\.atlas$/i.test(re.name)),ae=z.filter(re=>/\.(png|jpe?g|webp|wepb)$/i.test(re.name)),ce=Z.map(re=>({atlas:re,skeleton:K.find(Ee=>B(Ee)===B(re))})).find(re=>re.skeleton),ve=(ce==null?void 0:ce.skeleton)||K[0]||null,we=(ce==null?void 0:ce.atlas)||Z[0]||null;if(h.value=ve,f.value=we,p.value=ae,!ve||!we||!ae.length){const re=[!ve&&"JSON / SKEL",!we&&"Atlas",!ae.length&&t("spine.textureImages")].filter(Boolean).join(", ");e.spineObject.status="error",e.spineObject.error=t("spine.missingFolderAssets",{missing:re});return}await L()}function U(){n.recalcTotalFrames()}function D(){U(),n.timeline.frame=0}async function L(){var K;const X=h.value,z=f.value;if(!X||!z||!p.value.length){e.spineObject.status="error",e.spineObject.error=t("spine.chooseAssets");return}e.spineObject.status="loading",e.spineObject.error="";try{const Z=await zA(X,z,p.value);gh(e.spineObject.id,Z),e.spineObject.skeletonFileName=X.name,e.spineObject.atlasFileName=z.name,e.spineObject.textureFileNames=p.value.map(ae=>ae.name),e.spineObject.dataVersion=Z.dataVersion,e.spineObject.animations=Z.animations,e.spineObject.bones=Z.bones,e.spineObject.slots=Z.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",u.value="",c.value=new Set,e.spineObject.selectedAnimation=((K=Z.animations[0])==null?void 0:K.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",U(),n.timeline.frame=0;try{e.spineObject.sourceBundle=await uU(X,z,p.value)}catch(ae){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",ae)}}catch(Z){e.spineObject.status="error",e.spineObject.error=Z instanceof Error?Z.message:String(Z)}}function R(){Ec(e.spineObject.id),h.value=null,f.value=null,p.value=[],s.value&&(s.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),a.value&&(a.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",u.value="",c.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",U()}return(X,z)=>(Q(),te("div",Mz,[w("div",Pz,F(X.$t("spine.title")),1),w("label",kz,[w("span",null,F(X.$t("spine.name")),1),pe(w("input",{"onUpdate:modelValue":z[0]||(z[0]=K=>i.spineObject.name=K)},null,512),[[Je,i.spineObject.name]])]),w("div",Iz,[w("label",Rz,[w("span",null,F(X.$t("spine.xPosition")),1),pe(w("input",{"onUpdate:modelValue":z[1]||(z[1]=K=>i.spineObject.x=K),type:"number"},null,512),[[Je,i.spineObject.x,void 0,{number:!0}]])]),w("label",Fz,[w("span",null,F(X.$t("spine.yPosition")),1),pe(w("input",{"onUpdate:modelValue":z[2]||(z[2]=K=>i.spineObject.y=K),type:"number"},null,512),[[Je,i.spineObject.y,void 0,{number:!0}]])]),w("label",Lz,[w("span",null,F(X.$t("spine.rotation")),1),pe(w("input",{"onUpdate:modelValue":z[3]||(z[3]=K=>i.spineObject.rotation=K),type:"number"},null,512),[[Je,i.spineObject.rotation,void 0,{number:!0}]])])]),w("div",Dz,[w("label",Oz,[z[20]||(z[20]=w("span",null,"Scale X",-1)),pe(w("input",{"onUpdate:modelValue":z[4]||(z[4]=K=>i.spineObject.scaleX=K),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleX,void 0,{number:!0}]])]),w("label",Nz,[z[21]||(z[21]=w("span",null,"Scale Y",-1)),pe(w("input",{"onUpdate:modelValue":z[5]||(z[5]=K=>i.spineObject.scaleY=K),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleY,void 0,{number:!0}]])]),w("label",$z,[w("span",null,F(X.$t("spine.startTime")),1),pe(w("input",{"onUpdate:modelValue":z[6]||(z[6]=K=>i.spineObject.timeOffset=K),type:"number",min:"0",step:"0.033333",onChange:U},null,544),[[Je,i.spineObject.timeOffset,void 0,{number:!0}]])])]),z[22]||(z[22]=w("div",{class:"divider"},null,-1)),w("div",Bz,F(X.$t("spine.resources")),1),w("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:N},null,544),w("input",{ref_key:"atlasInput",ref:r,hidden:"",type:"file",accept:".atlas,text/plain",onChange:$},null,544),w("input",{ref_key:"textureInput",ref:o,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:j},null,544),w("input",{ref_key:"folderInput",ref:a,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:Y},null,544),w("button",{class:"folder-select",disabled:i.spineObject.status==="loading",onClick:z[7]||(z[7]=K=>{var Z;return(Z=a.value)==null?void 0:Z.click()})},F(X.$t("spine.chooseFolder")),9,Uz),w("div",Vz,F(X.$t("spine.folderHint")),1),w("div",Xz,[w("div",{class:"asset-name",title:m.value},F(m.value||"JSON / SKEL..."),9,Yz),w("button",{onClick:z[8]||(z[8]=K=>{var Z;return(Z=s.value)==null?void 0:Z.click()})},F(X.$t("spine.choose")),1)]),w("div",zz,[w("div",{class:"asset-name",title:g.value},F(g.value||"Atlas..."),9,jz),w("button",{onClick:z[9]||(z[9]=K=>{var Z;return(Z=r.value)==null?void 0:Z.click()})},F(X.$t("spine.choose")),1)]),w("div",Hz,[w("div",{class:"asset-name",title:v.value.join(", ")},F(y.value),9,Gz),w("button",{onClick:z[10]||(z[10]=K=>{var Z;return(Z=o.value)==null?void 0:Z.click()})},F(X.$t("spine.chooseMultiple")),1)]),w("div",Wz,[w("button",{class:"load",disabled:i.spineObject.status==="loading",onClick:L},F(i.spineObject.status==="loading"?X.$t("spine.loading"):X.$t("spine.load")),9,qz),w("button",{class:"clear",onClick:R},F(X.$t("spine.clear")),1)]),w("div",Kz,[Ct(F(X.$t("spine.supportNote"))+" ",1),i.spineObject.dataVersion?(Q(),te("span",Jz," · "+F(X.$t("spine.currentResource",{version:i.spineObject.dataVersion})),1)):xe("",!0)]),i.spineObject.error?(Q(),te("div",Zz,F(i.spineObject.error),1)):xe("",!0),w("div",Qz,[w("div",e6,F(X.$t("spine.animations")),1),i.spineObject.animations.length?(Q(),te("label",n6,[w("span",null,F(X.$t("spine.timelineAnimation")),1),pe(w("select",{"onUpdate:modelValue":z[11]||(z[11]=K=>i.spineObject.selectedAnimation=K),onChange:D},[w("option",i6,F(X.$t("spine.no")),1),(Q(!0),te(_e,null,Mt(i.spineObject.animations,K=>(Q(),te("option",{key:K.name,value:K.name},F(K.name)+"("+F(K.duration.toFixed(2))+"s) ",9,s6))),128))],544),[[_t,i.spineObject.selectedAnimation]])])):(Q(),te("div",t6,F(X.$t("spine.noAnimations")),1))]),w("div",r6,[w("div",o6,[w("div",a6,F(X.$t("spine.hierarchy")),1),d.value==="bone"?(Q(),te("button",{key:0,class:Pe(["selected-bone",{active:i.spineObject.selectedBone}]),disabled:!i.spineObject.selectedBone,title:i.spineObject.selectedBone?X.$t("spine.clearBoneTitle"):X.$t("spine.noBoneTitle"),onClick:z[12]||(z[12]=K=>i.spineObject.selectedBone="")},[i.spineObject.selectedBone?(Q(),te(_e,{key:0},[Ct(F(X.$t("spine.clearBone",{name:""})),1),w("strong",null,F(i.spineObject.selectedBone),1)],64)):(Q(),te(_e,{key:1},[Ct(F(X.$t("spine.currentBone")),1),w("strong",null,F(X.$t("spine.notSelected")),1)],64))],10,l6)):(Q(),te("button",{key:1,class:Pe(["selected-bone",{active:i.spineObject.selectedSlot}]),disabled:!i.spineObject.selectedSlot,title:i.spineObject.selectedSlot?X.$t("spine.clearSlotTitle"):X.$t("spine.noSlotTitle"),onClick:z[13]||(z[13]=K=>i.spineObject.selectedSlot="")},[i.spineObject.selectedSlot?(Q(),te(_e,{key:0},[Ct(F(X.$t("spine.clearSlot",{name:""})),1),w("strong",null,F(i.spineObject.selectedSlot),1)],64)):(Q(),te(_e,{key:1},[Ct(F(X.$t("spine.currentSlot")),1),w("strong",null,F(X.$t("spine.notSelected")),1)],64))],10,c6)),d.value==="bone"&&i.spineObject.bones.length?(Q(),te("button",{key:2,class:"tree-action",onClick:P},F(E.value?X.$t("spine.expandAll"):X.$t("spine.collapseAll")),1)):xe("",!0)]),w("div",d6,[w("button",{class:Pe({on:d.value==="bone"}),onClick:z[14]||(z[14]=K=>d.value="bone")},F(X.$t("spine.bones")),3),w("button",{class:Pe({on:d.value==="slot"}),onClick:z[15]||(z[15]=K=>d.value="slot")},F(X.$t("spine.slots")),3)]),d.value==="bone"?(Q(),te(_e,{key:0},[i.spineObject.bones.length?(Q(),te("div",h6,[pe(w("input",{"onUpdate:modelValue":z[16]||(z[16]=K=>l.value=K),type:"search","aria-label":X.$t("spine.searchBones"),placeholder:X.$t("spine.searchBonesPlaceholder")},null,8,f6),[[Je,l.value,void 0,{trim:!0}]]),l.value?(Q(),te("button",{key:0,title:X.$t("spine.clearSearch"),"aria-label":X.$t("spine.clearBoneSearch"),onClick:z[17]||(z[17]=K=>l.value="")},"✕",8,p6)):xe("",!0)])):(Q(),te("div",u6,F(X.$t("spine.notLoaded")),1)),i.spineObject.bones.length&&!T.value.length?(Q(),te("div",m6,F(X.$t("spine.noMatchingBones")),1)):i.spineObject.bones.length?(Q(),te("div",g6,[(Q(!0),te(_e,null,Mt(T.value,K=>(Q(),te("div",{key:K.name,class:Pe(["bone",{selected:i.spineObject.selectedBone===K.name}]),style:zt({paddingLeft:`${6+K.depth*16}px`}),role:"button",tabindex:"0",onClick:Z=>C(K.name),onKeydown:es(We(Z=>C(K.name),["prevent"]),["enter"])},[b.value.has(K.name)?(Q(),te("button",{key:0,class:"bone-toggle",title:c.value.has(K.name)?X.$t("spine.expandChildren"):X.$t("spine.collapseChildren"),onClick:We(Z=>k(K.name),["stop"])},F(c.value.has(K.name)?"▸":"▾"),9,b6)):(Q(),te("span",y6,"•")),w("span",x6,F(K.name),1)],46,v6))),128))])):xe("",!0)],64)):(Q(),te(_e,{key:1},[i.spineObject.slots.length?(Q(),te("div",S6,[pe(w("input",{"onUpdate:modelValue":z[18]||(z[18]=K=>u.value=K),type:"search","aria-label":X.$t("spine.searchSlots"),placeholder:X.$t("spine.searchSlotsPlaceholder")},null,8,C6),[[Je,u.value,void 0,{trim:!0}]]),u.value?(Q(),te("button",{key:0,title:X.$t("spine.clearSearch"),"aria-label":X.$t("spine.clearSlotSearch"),onClick:z[19]||(z[19]=K=>u.value="")},"✕",8,A6)):xe("",!0)])):(Q(),te("div",w6,F(X.$t("spine.notLoadedSlots")),1)),i.spineObject.slots.length&&!S.value.length?(Q(),te("div",T6,F(X.$t("spine.noMatchingSlots")),1)):i.spineObject.slots.length?(Q(),te("div",E6,[(Q(!0),te(_e,null,Mt(S.value,K=>(Q(),te("div",{key:K.name,class:Pe(["bone slot-row",{selected:i.spineObject.selectedSlot===K.name}]),role:"button",tabindex:"0",title:X.$t("spine.slotTitle",{name:K.name,bone:K.bone||"-",attachment:K.attachment||X.$t("spine.empty")}),onClick:Z=>M(K.name),onKeydown:es(We(Z=>M(K.name),["prevent"]),["enter"])},[w("span",M6,F(K.order+1),1),w("span",P6,F(K.name),1),w("span",k6,F(K.attachment||X.$t("spine.empty")),1)],42,_6))),128))])):xe("",!0)],64))])]))}}),R6=dn(I6,[["__scopeId","data-v-35137928"]]),F6={class:"group"},L6={class:"caret"},D6={class:"scene-actions"},O6=["title"],N6=["title"],$6=["title"],B6=["title"],U6=["disabled","title"],V6={class:"group-body"},X6={class:"tree scene-tree"},Y6=["onClick"],z6={key:0,class:"sub-branch"},j6={key:1,class:"tdot"},H6={class:"tlabel"},G6=["title","aria-label","onClick"],W6={viewBox:"0 0 24 24","aria-hidden":"true"},q6={key:0,class:"eye-slash",d:"M4 4l16 16"},K6=["title","onClick"],J6=["onClick"],Z6={class:"tlabel"},Q6=["title","aria-label","onClick"],ej={viewBox:"0 0 24 24","aria-hidden":"true"},tj={key:0,class:"eye-slash",d:"M4 4l16 16"},nj={class:"scene-object-kind"},ij=["title","onClick"],sj=["onClick"],rj={class:"tlabel"},oj=["title","aria-label","onClick"],aj={viewBox:"0 0 24 24","aria-hidden":"true"},lj={key:0,class:"eye-slash",d:"M4 4l16 16"},cj={class:"scene-object-kind"},dj=["title","onClick"],uj=["onClick"],hj={class:"tlabel"},fj=["title","aria-label","onClick"],pj={viewBox:"0 0 24 24","aria-hidden":"true"},mj={key:0,class:"eye-slash",d:"M4 4l16 16"},gj=["title","onClick"],vj={key:0,class:"empty"},bj={class:"row"},yj={class:"seed-row scene-seed"},xj={for:"system-seed"},wj=["title"],Sj=["title"],Cj={class:"seed-hint"},Aj={class:"object-editor-title"},Tj={class:"field-block"},Ej={class:"field-grid"},_j={class:"field-block"},Mj={value:"circle"},Pj={value:"ellipse"},kj={value:"rect"},Ij={value:"polygon"},Rj={value:"custom"},Fj={class:"field-block check-field"},Lj={class:"field-grid"},Dj={class:"compact-field"},Oj={class:"compact-field"},Nj={class:"field-grid"},$j={class:"compact-field"},Bj={class:"compact-field"},Uj={key:1,class:"field-grid"},Vj={class:"compact-field"},Xj={class:"compact-field"},Yj={key:2,class:"field-grid"},zj={class:"compact-field"},jj={class:"compact-field"},Hj={class:"field-block"},Gj={value:"physics"},Wj={value:"pause"},qj={value:"destroy"},Kj={key:4,class:"field-grid"},Jj={class:"compact-field"},Zj={class:"compact-field"},Qj={class:"collider-follow-section"},eH={class:"follow-path"},tH={class:"field-block"},nH={value:0},iH=["value"],sH={class:"field-grid"},rH={class:"compact-field"},oH={class:"compact-field"},aH={value:"跟随导出"},lH={value:"线性"},cH={value:"贝塞尔"},dH={class:"follow-path"},uH={class:"collider-curve-title"},hH={class:"object-editor-title"},fH={class:"field-block"},pH={class:"field-grid"},mH={class:"compact-field"},gH={class:"compact-field"},vH={class:"field-grid"},bH={class:"compact-field"},yH={class:"compact-field"},xH={class:"setting-line"},wH={class:"setting-line"},SH={class:"path-help"},CH={class:"field-block"},AH={value:""},TH={value:"circle"},EH={value:"square"},_H={value:"polygon"},MH={value:"star"},PH={key:4,class:"panel-hint"},kH=Zt({__name:"SceneObjectsSection",setup(i){const{store:e,resolvedCurveEditorMode:t,sys:n,activeObjectType:s,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:c,collapsed:l,toggle:d,sectionOpen:u,addSys:h,addCollider:f,addPath:p,addSpine:m,copySelectedObject:g,applyPathPreset:v,clearPathAnchors:y,randomizeSeed:b,LINEAR_CURVE:x}=Tr(),T=Le(()=>{const E=new Map(e.systems.map(I=>[I.id,I])),S=new Map;for(const I of e.systems)if(I.config.eventEnabled!==!1)for(const N of I.config.events||[])N.targetSystemId<=0||N.targetSystemId===I.id||!E.has(N.targetSystemId)||S.has(N.targetSystemId)||S.set(N.targetSystemId,I.id);const C=new Map;for(const[I,N]of S){const $=C.get(N);$?$.push(I):C.set(N,[I])}const M=[],k=new Set,P=(I,N)=>{if(!k.has(I.id)){k.add(I.id),M.push({system:I,depth:N});for(const $ of C.get(I.id)||[]){const j=E.get($);j&&P(j,N+1)}}};for(const I of e.systems)S.has(I.id)||P(I,0);for(const I of e.systems)k.has(I.id)||P(I,0);return M});return(E,S)=>(Q(),te("div",F6,[w("div",{class:"group-head scene-head",onClick:S[5]||(S[5]=C=>_(d)("scene"))},[w("span",L6,F(_(l).scene?"▸":"▾"),1),w("span",null,F(E.$t("scene.title")),1),w("div",D6,[w("button",{class:"scene-add",title:E.$t("scene.addParticle"),onClick:S[0]||(S[0]=We((...C)=>_(h)&&_(h)(...C),["stop"]))},F(E.$t("scene.addParticleShort")),9,O6),w("button",{class:"scene-add",title:E.$t("scene.addCollider"),onClick:S[1]||(S[1]=We((...C)=>_(f)&&_(f)(...C),["stop"]))},F(E.$t("scene.addColliderShort")),9,N6),w("button",{class:"scene-add",title:E.$t("scene.addPath"),onClick:S[2]||(S[2]=We((...C)=>_(p)&&_(p)(...C),["stop"]))},F(E.$t("scene.addPathShort")),9,$6),w("button",{class:"scene-add",title:E.$t("scene.addSpine"),onClick:S[3]||(S[3]=We((...C)=>_(m)&&_(m)(...C),["stop"]))},"+Spine",8,B6),w("button",{class:"scene-add",disabled:!_(c),title:E.$t("scene.copyTitle"),onClick:S[4]||(S[4]=We((...C)=>_(g)&&_(g)(...C),["stop"]))},"+Copy",8,U6)])]),pe(w("div",V6,[w("div",X6,[(Q(!0),te(_e,null,Mt(T.value,C=>(Q(),te("div",{key:`particle-${C.system.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="particle"&&C.system.id===_(e).activeObjectId,"scene-object-child":C.depth>0}]),style:zt(C.depth>0?{paddingLeft:`${C.depth*18}px`}:void 0),onClick:M=>_(e).selectSystem(C.system.id)},[C.depth>0?(Q(),te("span",z6,"└")):(Q(),te("span",j6,"●")),w("span",H6,F(C.system.config.name||"ParticleSystem"),1),w("button",{class:Pe(["scene-object-eye",{off:C.system.visible===!1}]),title:C.system.visible===!1?E.$t("scene.showParticle"):E.$t("scene.hideParticle"),"aria-label":C.system.visible===!1?E.$t("scene.showParticle"):E.$t("scene.hideParticle"),onClick:We(M=>C.system.visible=C.system.visible===!1,["stop"])},[(Q(),te("svg",W6,[S[50]||(S[50]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[51]||(S[51]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.system.visible===!1?(Q(),te("path",q6)):xe("",!0)]))],10,G6),w("span",{class:Pe(["scene-object-kind",{"sub-emitter-kind":C.depth>0}])},F(C.depth>0?E.$t("scene.subEmitter"):E.$t("scene.particle")),3),w("button",{class:"scene-object-delete",title:E.$t("scene.deleteParticle"),onClick:We(M=>_(e).removeSystem(C.system.id),["stop"])},"✕",8,K6)],14,Y6))),128)),(Q(!0),te(_e,null,Mt(_(e).colliders,C=>(Q(),te("div",{key:`collision-${C.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="collision"&&C.id===_(e).activeObjectId}]),onClick:M=>_(e).selectSceneObject("collision",C.id)},[S[54]||(S[54]=w("span",{class:"tdot collision-dot"},"■",-1)),w("span",Z6,F(C.name),1),w("button",{class:Pe(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?E.$t("scene.showCollider"):E.$t("scene.hideCollider"),"aria-label":C.visible===!1?E.$t("scene.showCollider"):E.$t("scene.hideCollider"),onClick:We(M=>C.visible=C.visible===!1,["stop"])},[(Q(),te("svg",ej,[S[52]||(S[52]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[53]||(S[53]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(Q(),te("path",tj)):xe("",!0)]))],10,Q6),w("span",nj,F(E.$t("scene.collision")),1),w("button",{class:"scene-object-delete",title:E.$t("scene.deleteCollider"),onClick:We(M=>_(e).removeCollider(C.id),["stop"])},"✕",8,ij)],10,J6))),128)),(Q(!0),te(_e,null,Mt(_(e).paths,C=>(Q(),te("div",{key:`path-${C.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="path"&&C.id===_(e).activeObjectId}]),onClick:M=>_(e).selectSceneObject("path",C.id)},[S[57]||(S[57]=w("span",{class:"tdot path-dot"},"◇",-1)),w("span",rj,F(C.name),1),w("button",{class:Pe(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?E.$t("scene.showPath"):E.$t("scene.hidePath"),"aria-label":C.visible===!1?E.$t("scene.showPath"):E.$t("scene.hidePath"),onClick:We(M=>C.visible=C.visible===!1,["stop"])},[(Q(),te("svg",aj,[S[55]||(S[55]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[56]||(S[56]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(Q(),te("path",lj)):xe("",!0)]))],10,oj),w("span",cj,F(E.$t("scene.path")),1),w("button",{class:"scene-object-delete",title:E.$t("scene.deletePath"),onClick:We(M=>_(e).removePath(C.id),["stop"])},"✕",8,dj)],10,sj))),128)),(Q(!0),te(_e,null,Mt(_(e).spines,C=>(Q(),te("div",{key:`spine-${C.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="spine"&&C.id===_(e).activeObjectId}]),onClick:M=>_(e).selectSceneObject("spine",C.id)},[S[60]||(S[60]=w("span",{class:"tdot spine-dot"},"◆",-1)),w("span",hj,F(C.name),1),w("button",{class:Pe(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?E.$t("scene.showSpine"):E.$t("scene.hideSpine"),"aria-label":C.visible===!1?E.$t("scene.showSpine"):E.$t("scene.hideSpine"),onClick:We(M=>C.visible=C.visible===!1,["stop"])},[(Q(),te("svg",pj,[S[58]||(S[58]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[59]||(S[59]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(Q(),te("path",mj)):xe("",!0)]))],10,fj),S[61]||(S[61]=w("span",{class:"scene-object-kind"},"Spine",-1)),w("button",{class:"scene-object-delete",title:E.$t("scene.deleteSpine"),onClick:We(M=>_(e).removeSpine(C.id),["stop"])},"✕",8,gj)],10,uj))),128)),!_(e).systems.length&&!_(e).colliders.length&&!_(e).paths.length&&!_(e).spines.length?(Q(),te("div",vj,F(E.$t("scene.empty")),1)):xe("",!0)]),_(s)==="particle"&&_(n)?(Q(),te(_e,{key:0},[w("label",bj,[w("span",null,F(E.$t("scene.name")),1),pe(w("input",{"onUpdate:modelValue":S[6]||(S[6]=C=>_(n).config.name=C),class:"inp"},null,512),[[Je,_(n).config.name]])]),Ce(Ue,{label:E.$t("scene.positionX"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.centerX,"onUpdate:modelValue":S[7]||(S[7]=C=>_(n).config.centerX=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.positionY"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.centerY,"onUpdate:modelValue":S[8]||(S[8]=C=>_(n).config.centerY=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.offsetX"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.offsetX,"onUpdate:modelValue":S[9]||(S[9]=C=>_(n).config.offsetX=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.offsetY"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.offsetY,"onUpdate:modelValue":S[10]||(S[10]=C=>_(n).config.offsetY=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:_(n).config.rootRotation,"onUpdate:modelValue":S[11]||(S[11]=C=>_(n).config.rootRotation=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.scaleX"),min:.05,max:10,step:.05,modelValue:_(n).config.rootScaleX,"onUpdate:modelValue":S[12]||(S[12]=C=>_(n).config.rootScaleX=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.scaleY"),min:.05,max:10,step:.05,modelValue:_(n).config.rootScaleY,"onUpdate:modelValue":S[13]||(S[13]=C=>_(n).config.rootScaleY=C)},null,8,["label","modelValue"]),w("div",yj,[w("label",xj,F(E.$t("scene.seed")),1),pe(w("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[14]||(S[14]=C=>_(n).config.seed=C),title:E.$t("scene.seedTitle")},null,8,wj),[[Je,_(n).config.seed,void 0,{number:!0}]]),w("button",{class:"seed-random",title:E.$t("scene.randomizeSeed"),onClick:S[15]||(S[15]=(...C)=>_(b)&&_(b)(...C))},"⚄",8,Sj)]),w("div",Cj,F(E.$t("scene.seedHint")),1)],64)):_(r)?(Q(),te(_e,{key:1},[w("div",Aj,F(E.$t("scene.colliderTitle")),1),w("label",Tj,[w("span",null,F(E.$t("scene.colliderName")),1),pe(w("input",{"onUpdate:modelValue":S[16]||(S[16]=C=>_(r).name=C),class:"inp"},null,512),[[Je,_(r).name]])]),w("div",Ej,[w("label",_j,[w("span",null,F(E.$t("scene.type")),1),pe(w("select",{"onUpdate:modelValue":S[17]||(S[17]=C=>_(r).shape=C),class:"inp"},[w("option",Mj,F(E.$t("scene.circle")),1),w("option",Pj,F(E.$t("scene.ellipse")),1),w("option",kj,F(E.$t("scene.rect")),1),w("option",Ij,F(E.$t("scene.polygon")),1),w("option",Rj,F(E.$t("scene.custom")),1)],512),[[_t,_(r).shape]])]),w("label",Fj,[w("span",null,F(E.$t("scene.enabled")),1),pe(w("input",{"onUpdate:modelValue":S[18]||(S[18]=C=>_(r).enabled=C),type:"checkbox"},null,512),[[vt,_(r).enabled]])])]),w("div",Lj,[w("label",Dj,[w("span",null,F(E.$t("scene.xPosition")),1),pe(w("input",{"onUpdate:modelValue":S[19]||(S[19]=C=>_(r).x=C),type:"number",class:"inp"},null,512),[[Je,_(r).x,void 0,{number:!0}]])]),w("label",Oj,[w("span",null,F(E.$t("scene.yPosition")),1),pe(w("input",{"onUpdate:modelValue":S[20]||(S[20]=C=>_(r).y=C),type:"number",class:"inp"},null,512),[[Je,_(r).y,void 0,{number:!0}]])])]),Ce(Ue,{label:E.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:_(r).rotation,"onUpdate:modelValue":S[21]||(S[21]=C=>_(r).rotation=C)},null,8,["label","modelValue"]),w("div",Nj,[w("label",$j,[w("span",null,F(E.$t("scene.scaleXShort")),1),pe(w("input",{"onUpdate:modelValue":S[22]||(S[22]=C=>_(r).scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(r).scaleX,void 0,{number:!0}]])]),w("label",Bj,[w("span",null,F(E.$t("scene.scaleYShort")),1),pe(w("input",{"onUpdate:modelValue":S[23]||(S[23]=C=>_(r).scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(r).scaleY,void 0,{number:!0}]])])]),_(r).shape==="circle"?(Q(),kt(Ue,{key:0,label:E.$t("scene.radius"),min:1,max:1e3,step:1,modelValue:_(r).radius,"onUpdate:modelValue":S[24]||(S[24]=C=>_(r).radius=C)},null,8,["label","modelValue"])):_(r).shape==="ellipse"?(Q(),te("div",Uj,[w("label",Vj,[w("span",null,F(E.$t("scene.radiusX")),1),pe(w("input",{"onUpdate:modelValue":S[25]||(S[25]=C=>_(r).radiusX=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).radiusX,void 0,{number:!0}]])]),w("label",Xj,[w("span",null,F(E.$t("scene.radiusY")),1),pe(w("input",{"onUpdate:modelValue":S[26]||(S[26]=C=>_(r).radiusY=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).radiusY,void 0,{number:!0}]])])])):(Q(),te("div",Yj,[w("label",zj,[w("span",null,F(E.$t("scene.width")),1),pe(w("input",{"onUpdate:modelValue":S[27]||(S[27]=C=>_(r).width=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).width,void 0,{number:!0}]])]),w("label",jj,[w("span",null,F(E.$t("scene.height")),1),pe(w("input",{"onUpdate:modelValue":S[28]||(S[28]=C=>_(r).height=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).height,void 0,{number:!0}]])])])),_(r).shape==="polygon"||_(r).shape==="custom"?(Q(),kt(Ue,{key:3,label:E.$t("scene.sides"),min:3,max:16,step:1,modelValue:_(r).sides,"onUpdate:modelValue":S[29]||(S[29]=C=>_(r).sides=C)},null,8,["label","modelValue"])):xe("",!0),w("label",Hj,[w("span",null,F(E.$t("scene.collisionResponse")),1),pe(w("select",{"onUpdate:modelValue":S[30]||(S[30]=C=>_(r).response=C),class:"inp"},[w("option",Gj,F(E.$t("scene.physics")),1),w("option",Wj,F(E.$t("scene.pause")),1),w("option",qj,F(E.$t("scene.destroy")),1)],512),[[_t,_(r).response]])]),_(r).response==="physics"?(Q(),te("div",Kj,[w("label",Jj,[w("span",null,F(E.$t("scene.elasticity")),1),pe(w("input",{"onUpdate:modelValue":S[31]||(S[31]=C=>_(r).elasticity=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,_(r).elasticity,void 0,{number:!0}]])]),w("label",Zj,[w("span",null,F(E.$t("scene.friction")),1),pe(w("input",{"onUpdate:modelValue":S[32]||(S[32]=C=>_(r).friction=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,_(r).friction,void 0,{number:!0}]])])])):xe("",!0),w("div",Qj,[w("label",eH,[pe(w("input",{"onUpdate:modelValue":S[33]||(S[33]=C=>_(r).followPath=C),type:"checkbox"},null,512),[[vt,_(r).followPath]]),Ct(F(E.$t("scene.followPath")),1)]),_(r).followPath?(Q(),te(_e,{key:0},[w("label",tH,[w("span",null,F(E.$t("scene.targetPath")),1),pe(w("select",{"onUpdate:modelValue":S[34]||(S[34]=C=>_(r).followPathId=C),class:"inp"},[w("option",nH,F(E.$t("scene.notSelected")),1),(Q(!0),te(_e,null,Mt(_(e).paths,C=>(Q(),te("option",{key:C.id,value:C.id},F(C.name),9,iH))),128))],512),[[_t,_(r).followPathId,void 0,{number:!0}]])]),w("div",sH,[w("label",rH,[w("span",null,F(E.$t("scene.moveDuration")),1),pe(w("input",{"onUpdate:modelValue":S[35]||(S[35]=C=>_(r).followDuration=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(r).followDuration,void 0,{number:!0}]])]),w("label",oH,[w("span",null,F(E.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":S[36]||(S[36]=C=>_(r).followCurveMode=C),class:"inp"},[w("option",aH,F(E.$t("common.followExport")),1),w("option",lH,F(E.$t("common.linear")),1),w("option",cH,F(E.$t("common.bezier")),1)],512),[[_t,_(r).followCurveMode]])])]),w("label",dH,[pe(w("input",{"onUpdate:modelValue":S[37]||(S[37]=C=>_(r).followPathRotation=C),type:"checkbox"},null,512),[[vt,_(r).followPathRotation]]),Ct(F(E.$t("scene.followDirection")),1)]),w("div",uH,[Ct(F(E.$t("scene.moveProgressCurve"))+" ",1),w("small",null,F(E.$t("scene.moveProgressHelp")),1)]),Ce(Ts,{"model-value":_(r).followCurve||_(x),"default-value":_(x),mode:_(t)(_(r).followCurveMode),"onUpdate:modelValue":S[38]||(S[38]=C=>_(r).followCurve=C)},null,8,["model-value","default-value","mode"])],64)):xe("",!0)])],64)):_(o)?(Q(),te(_e,{key:2},[w("div",hH,F(E.$t("scene.pathTitle")),1),w("label",fH,[w("span",null,F(E.$t("scene.pathName")),1),pe(w("input",{"onUpdate:modelValue":S[39]||(S[39]=C=>_(o).name=C),class:"inp"},null,512),[[Je,_(o).name]])]),w("div",pH,[w("label",mH,[w("span",null,F(E.$t("scene.xPosition")),1),pe(w("input",{"onUpdate:modelValue":S[40]||(S[40]=C=>_(o).x=C),type:"number",class:"inp"},null,512),[[Je,_(o).x,void 0,{number:!0}]])]),w("label",gH,[w("span",null,F(E.$t("scene.yPosition")),1),pe(w("input",{"onUpdate:modelValue":S[41]||(S[41]=C=>_(o).y=C),type:"number",class:"inp"},null,512),[[Je,_(o).y,void 0,{number:!0}]])])]),Ce(Ue,{label:E.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:_(o).rotation,"onUpdate:modelValue":S[42]||(S[42]=C=>_(o).rotation=C)},null,8,["label","modelValue"]),w("div",vH,[w("label",bH,[w("span",null,F(E.$t("scene.scaleXShort")),1),pe(w("input",{"onUpdate:modelValue":S[43]||(S[43]=C=>_(o).scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(o).scaleX,void 0,{number:!0}]])]),w("label",yH,[w("span",null,F(E.$t("scene.scaleYShort")),1),pe(w("input",{"onUpdate:modelValue":S[44]||(S[44]=C=>_(o).scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(o).scaleY,void 0,{number:!0}]])])]),w("label",xH,[w("span",null,F(E.$t("scene.closedPath")),1),pe(w("input",{"onUpdate:modelValue":S[45]||(S[45]=C=>_(o).closed=C),type:"checkbox"},null,512),[[vt,_(o).closed]])]),w("label",wH,[w("span",null,F(E.$t("scene.pathColor")),1),pe(w("input",{"onUpdate:modelValue":S[46]||(S[46]=C=>_(o).color=C),type:"color",class:"path-color"},null,512),[[Je,_(o).color]])]),w("div",SH,[w("span",null,F(E.$t("scene.pathHelp")),1),w("ul",null,[w("li",null,F(E.$t("scene.pathHelpItems.0")),1),w("li",null,F(E.$t("scene.pathHelpItems.1")),1),w("li",null,F(E.$t("scene.pathHelpItems.2")),1),w("li",null,F(E.$t("scene.pathHelpItems.3")),1),w("li",null,F(E.$t("scene.pathHelpItems.4")),1),w("li",null,F(E.$t("scene.pathHelpItems.5")),1),w("li",null,F(E.$t("scene.pathHelpItems.6")),1),w("li",null,F(E.$t("scene.pathHelpItems.7")),1),w("li",null,F(E.$t("scene.pathHelpItems.8")),1),w("li",null,F(E.$t("scene.pathHelpItems.9")),1)])]),w("label",CH,[w("span",null,F(E.$t("scene.applyPresetShape")),1),pe(w("select",{"onUpdate:modelValue":S[47]||(S[47]=C=>_(o).preset=C),class:"inp"},[w("option",AH,F(E.$t("scene.choosePreset")),1),w("option",TH,F(E.$t("scene.circle")),1),w("option",EH,F(E.$t("scene.square")),1),w("option",_H,F(E.$t("scene.polygon")),1),w("option",MH,F(E.$t("scene.star")),1)],512),[[_t,_(o).preset]])]),w("button",{class:"path-action primary",onClick:S[48]||(S[48]=(...C)=>_(v)&&_(v)(...C))},F(E.$t("scene.applyPreset")),1),w("button",{class:"path-action",onClick:S[49]||(S[49]=(...C)=>_(y)&&_(y)(...C))},F(E.$t("scene.clearAnchors")),1)],64)):_(a)?(Q(),kt(R6,{key:3,"spine-object":_(a)},null,8,["spine-object"])):(Q(),te("div",PH,F(E.$t("scene.panelHint")),1))],512),[[Xt,_(u)("scene")]])]))}}),Gx=dn(kH,[["__scopeId","data-v-f0cc6209"]]),IH={class:"group"},RH={class:"caret"},FH=["title"],LH={class:"group-body"},DH={class:"segs"},OH={class:"segs stream-behavior-segs"},NH={key:2,class:"stream-loop-options"},$H={class:"loop-section-row"},BH={class:"switch-row"},UH=["checked"],VH={key:0,class:"loop-duration-control"},XH={class:"switch-row loop-duration-toggle"},YH=["checked"],zH={class:"loop-section-duration"},jH=["value","aria-label"],HH={key:1},GH={key:2,class:"loop-auto-duration"},WH={class:"loop-section-row"},qH={class:"switch-row"},KH=["checked"],JH={key:0,class:"loop-duration-control"},ZH={class:"switch-row loop-duration-toggle"},QH=["checked"],eG={class:"loop-section-duration"},tG=["value","aria-label"],nG={key:1},iG={key:2,class:"loop-auto-duration"},sG={key:3,class:"modifier-hint stream-loop-hint"},rG={class:"group"},oG={class:"caret"},aG=["title"],lG={class:"group-body"},cG={class:"row"},dG={value:"point"},uG={value:"circle"},hG={value:"rect"},fG={value:"cone"},pG={value:"path"},mG={class:"row"},gG={value:0},vG=["value","disabled"],bG={key:0,class:"row"},yG={value:"fixed"},xG={value:"random"},wG={class:"row"},SG={value:"fixed"},CG={value:"random"},AG={key:0,value:"radial"},TG={key:1,value:"path-normal"},EG={key:2,value:"path-tangent"},_G={key:6,class:"switch-row"},MG=Zt({__name:"EmissionSection",setup(i){const{store:e,sys:t,automaticLoopDuration:n,loopDurationFrames:s,collapsed:r,toggle:o,sectionVisible:a,sectionOpen:c,setEmitMode:l,setLoopDurationFrames:d,setStreamBehavior:u,setLoopSection:h,setLoopSectionDuration:f,setLoopCustomDuration:p,resetModule:m,select:g,onShapeChange:v,onSpawnPathChange:y}=Tr();return(b,x)=>(Q(),te(_e,null,[pe(w("div",IH,[w("div",{class:"group-head",onClick:x[1]||(x[1]=T=>_(o)("emitMode"))},[w("span",RH,F(_(r).emitMode?"▸":"▾"),1),w("span",null,F(b.$t("emission.title")),1),w("button",{class:"group-reset",title:b.$t("emission.reset"),onClick:x[0]||(x[0]=We(T=>_(m)("emitMode"),["stop"]))},F(b.$t("common.reset")),9,FH)]),pe(w("div",LH,[w("div",DH,[w("button",{class:Pe(["seg",{on:_(t).config.mode==="stream"}]),onClick:x[2]||(x[2]=T=>_(l)("stream"))},F(b.$t("emission.stream")),3),w("button",{class:Pe(["seg",{on:_(t).config.mode==="burst"}]),onClick:x[3]||(x[3]=T=>_(l)("burst"))},F(b.$t("emission.burst")),3)]),_(t).config.mode==="stream"?(Q(),te(_e,{key:0},[w("div",OH,[w("button",{class:Pe(["seg",{on:_(t).config.streamBehavior==="normal"}]),onClick:x[4]||(x[4]=T=>_(u)("normal"))},F(b.$t("emission.normalStream")),3),w("button",{class:Pe(["seg",{on:_(t).config.streamBehavior==="loop"}]),onClick:x[5]||(x[5]=T=>_(u)("loop"))},F(b.$t("emission.loopStream")),3)]),Ce(Ue,{label:b.$t("emission.rate"),min:1,max:300,step:1,modelValue:_(t).config.rate,"onUpdate:modelValue":x[6]||(x[6]=T=>_(t).config.rate=T)},null,8,["label","modelValue"]),_(t).config.streamBehavior==="normal"?(Q(),kt(Ue,{key:0,label:b.$t("emission.duration"),min:1/30,max:60,step:1/30,modelValue:_(t).config.duration,"onUpdate:modelValue":x[7]||(x[7]=T=>_(t).config.duration=T)},null,8,["label","modelValue"])):(Q(),kt(Ue,{key:1,label:b.$t("emission.loopDuration"),min:1,max:1800,step:1,"model-value":_(s),"onUpdate:modelValue":_(d)},null,8,["label","model-value","onUpdate:modelValue"])),_(t).config.streamBehavior==="loop"?(Q(),te("div",NH,[w("div",$H,[w("label",BH,[w("input",{type:"checkbox",checked:_(t).config.generateLoopStartAnimation,onChange:x[8]||(x[8]=T=>_(h)("start",T))},null,40,UH),x[36]||(x[36]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.generateStart")),1)]),_(t).config.generateLoopStartAnimation?(Q(),te("div",VH,[w("label",XH,[w("input",{type:"checkbox",checked:_(t).config.loopStartUseCustomDuration,onChange:x[9]||(x[9]=T=>_(p)("start",T))},null,40,YH),x[37]||(x[37]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.customDuration")),1)]),w("label",zH,[_(t).config.loopStartUseCustomDuration?(Q(),te("input",{key:0,value:_(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":b.$t("emission.startLoopDuration"),onChange:x[10]||(x[10]=T=>_(f)("start",T))},null,40,jH)):xe("",!0),_(t).config.loopStartUseCustomDuration?(Q(),te("span",HH,"f")):(Q(),te("span",GH,F(b.$t("emission.auto",{frames:_(n)})),1))])])):xe("",!0)]),w("div",WH,[w("label",qH,[w("input",{type:"checkbox",checked:_(t).config.generateLoopEndAnimation,onChange:x[11]||(x[11]=T=>_(h)("end",T))},null,40,KH),x[38]||(x[38]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.generateEnd")),1)]),_(t).config.generateLoopEndAnimation?(Q(),te("div",JH,[w("label",ZH,[w("input",{type:"checkbox",checked:_(t).config.loopEndUseCustomDuration,onChange:x[12]||(x[12]=T=>_(p)("end",T))},null,40,QH),x[39]||(x[39]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.customDuration")),1)]),w("label",eG,[_(t).config.loopEndUseCustomDuration?(Q(),te("input",{key:0,value:_(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":b.$t("emission.endLoopDuration"),onChange:x[13]||(x[13]=T=>_(f)("end",T))},null,40,tG)):xe("",!0),_(t).config.loopEndUseCustomDuration?(Q(),te("span",nG,"f")):(Q(),te("span",iG,F(b.$t("emission.auto",{frames:_(n)})),1))])])):xe("",!0)])])):xe("",!0),_(t).config.streamBehavior==="loop"?(Q(),te("div",sG,F(b.$t("emission.loopWarning")),1)):xe("",!0)],64)):(Q(),kt(Ue,{key:1,label:b.$t("emission.burstCount"),min:1,max:1e3,step:1,modelValue:_(t).config.burstCount,"onUpdate:modelValue":x[14]||(x[14]=T=>_(t).config.burstCount=T)},null,8,["label","modelValue"])),Ce(Ue,{label:b.$t("emission.delay"),min:0,max:5,step:.1,modelValue:_(t).config.delay,"onUpdate:modelValue":x[15]||(x[15]=T=>_(t).config.delay=T)},null,8,["label","modelValue"])],512),[[Xt,_(c)("emitMode")]])],512),[[Xt,_(a)("emitMode")]]),pe(w("div",rG,[w("div",{class:"group-head",onClick:x[17]||(x[17]=T=>_(o)("shape"))},[w("span",oG,F(_(r).shape?"▸":"▾"),1),w("span",null,F(b.$t("emission.shapeTitle")),1),w("button",{class:"group-reset",title:b.$t("emission.shapeReset"),onClick:x[16]||(x[16]=We(T=>_(m)("shape"),["stop"]))},F(b.$t("common.reset")),9,aG)]),pe(w("div",lG,[w("label",cG,[w("span",null,F(b.$t("emission.shape")),1),pe(w("select",{"onUpdate:modelValue":x[18]||(x[18]=T=>_(t).config.shape=T),class:"inp",onChange:x[19]||(x[19]=(...T)=>_(v)&&_(v)(...T))},[w("option",dG,F(b.$t("emission.point")),1),w("option",uG,F(b.$t("emission.circle")),1),w("option",hG,F(b.$t("emission.rect")),1),w("option",fG,F(b.$t("emission.cone")),1),w("option",pG,F(b.$t("emission.path")),1)],544),[[_t,_(t).config.shape]])]),_(t).config.shape==="circle"||_(t).config.shape==="cone"?(Q(),te(_e,{key:0},[Ce(Ue,{label:_(t).config.shape==="cone"?b.$t("emission.innerDiameter"):b.$t("emission.innerRadius"),min:0,max:_(t).config.outerRadius,step:1,modelValue:_(t).config.innerRadius,"onUpdate:modelValue":x[20]||(x[20]=T=>_(t).config.innerRadius=T)},null,8,["label","max","modelValue"]),Ce(Ue,{label:_(t).config.shape==="cone"?b.$t("emission.outerDiameter"):b.$t("emission.outerRadius"),min:_(t).config.innerRadius,max:300,step:1,modelValue:_(t).config.outerRadius,"onUpdate:modelValue":x[21]||(x[21]=T=>_(t).config.outerRadius=T)},null,8,["label","min","modelValue"])],64)):xe("",!0),_(t).config.shape==="cone"?(Q(),te(_e,{key:1},[Ce(Ue,{label:b.$t("emission.coneDirection"),min:-360,max:360,step:1,modelValue:_(t).config.coneDirection,"onUpdate:modelValue":x[22]||(x[22]=T=>_(t).config.coneDirection=T)},null,8,["label","modelValue"]),Ce(Ue,{label:b.$t("emission.coneAngle"),min:1,max:360,step:1,modelValue:_(t).config.coneAngle,"onUpdate:modelValue":x[23]||(x[23]=T=>_(t).config.coneAngle=T)},null,8,["label","modelValue"])],64)):_(t).config.shape==="rect"?(Q(),te(_e,{key:2},[Ce(Ue,{label:b.$t("emission.innerWidth"),min:0,max:_(t).config.outerRectW,step:1,modelValue:_(t).config.innerRectW,"onUpdate:modelValue":x[24]||(x[24]=T=>_(t).config.innerRectW=T)},null,8,["label","max","modelValue"]),Ce(Ue,{label:b.$t("emission.innerHeight"),min:0,max:_(t).config.outerRectH,step:1,modelValue:_(t).config.innerRectH,"onUpdate:modelValue":x[25]||(x[25]=T=>_(t).config.innerRectH=T)},null,8,["label","max","modelValue"]),Ce(Ue,{label:b.$t("emission.outerWidth"),min:_(t).config.innerRectW,max:400,step:1,modelValue:_(t).config.outerRectW,"onUpdate:modelValue":x[26]||(x[26]=T=>_(t).config.outerRectW=T)},null,8,["label","min","modelValue"]),Ce(Ue,{label:b.$t("emission.outerHeight"),min:_(t).config.innerRectH,max:400,step:1,modelValue:_(t).config.outerRectH,"onUpdate:modelValue":x[27]||(x[27]=T=>_(t).config.outerRectH=T)},null,8,["label","min","modelValue"])],64)):_(t).config.shape==="path"?(Q(),te(_e,{key:3},[w("label",mG,[w("span",null,F(b.$t("emission.selectPath")),1),pe(w("select",{"onUpdate:modelValue":x[28]||(x[28]=T=>_(t).config.spawnPathId=T),class:"inp",onChange:x[29]||(x[29]=(...T)=>_(y)&&_(y)(...T))},[w("option",gG,F(b.$t("emission.noPath")),1),(Q(!0),te(_e,null,Mt(_(e).paths,T=>(Q(),te("option",{key:T.id,value:T.id,disabled:!T.enabled},F(T.name),9,vG))),128))],544),[[_t,_(t).config.spawnPathId,void 0,{number:!0}]])]),_(t).config.spawnPathId>0?(Q(),te("label",bG,[w("span",null,F(b.$t("emission.birthDistribution")),1),pe(w("select",{"onUpdate:modelValue":x[30]||(x[30]=T=>_(t).config.spawnPathDistribution=T),class:"inp"},[w("option",yG,F(b.$t("emission.evenDistribution")),1),w("option",xG,F(b.$t("emission.randomDistribution")),1)],512),[[_t,_(t).config.spawnPathDistribution]])])):xe("",!0)],64)):xe("",!0),x[41]||(x[41]=w("div",{class:"divider"},null,-1)),w("label",wG,[w("span",null,F(b.$t("emission.emissionAngle")),1),pe(w("select",{"onUpdate:modelValue":x[31]||(x[31]=T=>_(t).config.emissionAngleMode=T),class:"inp"},[w("option",SG,F(b.$t("common.fixed")),1),w("option",CG,F(b.$t("common.random")),1),_(t).config.shape==="circle"||_(t).config.shape==="rect"||_(t).config.shape==="cone"?(Q(),te("option",AG,F(b.$t("emission.radial")),1)):xe("",!0),_(t).config.shape==="path"&&_(t).config.spawnPathId>0?(Q(),te("option",TG,F(b.$t("emission.pathNormal")),1)):xe("",!0),_(t).config.shape==="path"&&_(t).config.spawnPathId>0?(Q(),te("option",EG,F(b.$t("emission.pathTangent")),1)):xe("",!0)],512),[[_t,_(t).config.emissionAngleMode]])]),_(t).config.emissionAngleMode==="fixed"?(Q(),kt(Ue,{key:4,label:b.$t("emission.fixedAngle"),min:-360,max:360,step:1,modelValue:_(t).config.direction,"onUpdate:modelValue":x[32]||(x[32]=T=>_(t).config.direction=T)},null,8,["label","modelValue"])):_(t).config.emissionAngleMode==="random"?(Q(),te(_e,{key:5},[Ce(Ue,{label:b.$t("emission.baseAngle"),min:-360,max:360,step:1,modelValue:_(t).config.direction,"onUpdate:modelValue":x[33]||(x[33]=T=>_(t).config.direction=T)},null,8,["label","modelValue"]),Ce(Ue,{label:b.$t("emission.randomRange"),min:0,max:360,step:1,modelValue:_(t).config.spread,"onUpdate:modelValue":x[34]||(x[34]=T=>_(t).config.spread=T)},null,8,["label","modelValue"])],64)):xe("",!0),_(t).config.shape!=="point"?(Q(),te("label",_G,[pe(w("input",{type:"checkbox","onUpdate:modelValue":x[35]||(x[35]=T=>_(t).config.showShape=T)},null,512),[[vt,_(t).config.showShape]]),x[40]||(x[40]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.showShape")),1)])):xe("",!0)],512),[[Xt,_(c)("shape")]])],512),[[Xt,_(a)("shape")]])],64))}}),Wx=dn(MG,[["__scopeId","data-v-fc08ba9a"]]),PG={class:"pac"},kG={class:"pac-head"},IG={class:"pac-label"},RG={key:0,class:"pac-modes"},FG=["onClick"],LG={class:"pac-range"},DG={class:"pac-curve"},OG={class:"pac-axis"},NG=Zt({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:""}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(i){const e=i,{t}=mi(),n=Le(()=>{const s=[{label:t("common.fixed"),value:"fixed"},{label:t("common.random"),value:"random"}];return e.allowCurve&&s.push({label:t("common.curve"),value:"curve"}),e.allowDirection&&s.push({label:t("attributeControl.direction"),value:"direction"}),s});return(s,r)=>(Q(),te("div",PG,[w("div",kG,[w("span",IG,F(i.label),1),i.showModes?(Q(),te("div",RG,[(Q(!0),te(_e,null,Mt(n.value,o=>(Q(),te("button",{key:o.value,class:Pe(["pac-mode",{on:i.mode===o.value}]),onClick:a=>s.$emit("update:mode",o.value)},F(o.label),11,FG))),128))])):xe("",!0)]),i.mode==="fixed"||i.mode==="direction"?(Q(),kt(Ue,{key:0,label:i.mode==="direction"?s.$t("attributeControl.angleOffset"):s.$t("attributeControl.value"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":r[0]||(r[0]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"])):i.mode==="random"?(Q(),te(_e,{key:1},[Ce(Ue,{label:s.$t("attributeControl.lower"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":r[1]||(r[1]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"]),Ce(Ue,{label:s.$t("attributeControl.upper"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":r[2]||(r[2]=o=>s.$emit("update:valueMax",o))},null,8,["label","min","max","step","model-value"])],64)):(Q(),te(_e,{key:2},[w("div",LG,[Ce(Ue,{label:s.$t("attributeControl.rangeLower"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":r[3]||(r[3]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"]),Ce(Ue,{label:s.$t("attributeControl.rangeUpper"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":r[4]||(r[4]=o=>s.$emit("update:valueMax",o))},null,8,["label","min","max","step","model-value"])]),w("div",DG,[Ce(Ts,{"model-value":i.curve,"default-value":i.defaultCurve,"onUpdate:modelValue":r[5]||(r[5]=o=>s.$emit("update:curve",o))},null,8,["model-value","default-value"]),w("div",OG,[r[6]||(r[6]=w("span",null,"0",-1)),w("span",null,F(i.curveLabel||s.$t("attributeControl.curveInput")),1),r[7]||(r[7]=w("span",null,"1",-1))])])],64))]))}}),Hs=dn(NG,[["__scopeId","data-v-a3a8dde3"]]),$G={class:"group"},BG={class:"caret"},UG=["title"],VG={class:"group-body attr-body"},XG={class:"attr-section-title"},YG={class:"attr-axis-head"},zG={class:"axis-modes"},jG={class:"attr-section-title life-title"},HG={class:"life-item"},GG={class:"switch-row"},WG={class:"life-item"},qG={class:"switch-row"},KG={class:"axis-modes life-axis"},JG={class:"life-item"},ZG={class:"switch-row"},QG=Zt({__name:"ParticleAttributesSection",setup(i){const{sys:e,collapsed:t,toggle:n,sectionOpen:s,resetModule:r,setSpeedOverLifeMode:o,prepareScaleOverLifeCurve:a,setScaleOverLifeMode:c,LINEAR_CURVE:l,FLAT_CURVE:d}=Tr();return(u,h)=>(Q(),te("div",$G,[w("div",{class:"group-head",onClick:h[1]||(h[1]=f=>_(n)("attr"))},[w("span",BG,F(_(t).attr?"▸":"▾"),1),w("span",null,F(u.$t("attributes.title")),1),w("button",{class:"group-reset",title:u.$t("attributes.reset"),onClick:h[0]||(h[0]=We(f=>_(r)("attr"),["stop"]))},F(u.$t("common.reset")),9,UG)]),pe(w("div",VG,[w("div",XG,F(u.$t("attributes.initialParams")),1),Ce(Hs,{label:u.$t("attributes.initialLife"),"allow-curve":!1,mode:_(e).config.lifeMode,"onUpdate:mode":h[2]||(h[2]=f=>_(e).config.lifeMode=f),"value-min":_(e).config.lifeMin,"onUpdate:valueMin":h[3]||(h[3]=f=>_(e).config.lifeMin=f),"value-max":_(e).config.lifeMax,"onUpdate:valueMax":h[4]||(h[4]=f=>_(e).config.lifeMax=f),curve:_(e).config.lifeCurve,"onUpdate:curve":h[5]||(h[5]=f=>_(e).config.lifeCurve=f),min:.1,max:10,step:.1,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),Ce(Hs,{label:u.$t("attributes.initialSpeed"),"allow-curve":!1,mode:_(e).config.speedMode,"onUpdate:mode":h[6]||(h[6]=f=>_(e).config.speedMode=f),"value-min":_(e).config.speedMin,"onUpdate:valueMin":h[7]||(h[7]=f=>_(e).config.speedMin=f),"value-max":_(e).config.speedMax,"onUpdate:valueMax":h[8]||(h[8]=f=>_(e).config.speedMax=f),curve:_(e).config.speedCurve,"onUpdate:curve":h[9]||(h[9]=f=>_(e).config.speedCurve=f),min:0,max:1e3,step:1,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),w("div",YG,[w("span",null,F(u.$t("attributes.initialScale")),1),w("div",zG,[w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleAxisMode==="uniform"}]),onClick:h[10]||(h[10]=f=>_(e).config.scaleAxisMode="uniform")},F(u.$t("attributes.uniform")),3),w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleAxisMode==="separate"}]),onClick:h[11]||(h[11]=f=>_(e).config.scaleAxisMode="separate")},F(u.$t("attributes.separateXY")),3)])]),Ce(Hs,{label:_(e).config.scaleAxisMode==="uniform"?u.$t("attributes.initialScale"):u.$t("attributes.scaleX"),"allow-curve":!1,mode:_(e).config.scaleMode,"onUpdate:mode":h[12]||(h[12]=f=>_(e).config.scaleMode=f),"value-min":_(e).config.scaleMin,"onUpdate:valueMin":h[13]||(h[13]=f=>_(e).config.scaleMin=f),"value-max":_(e).config.scaleMax,"onUpdate:valueMax":h[14]||(h[14]=f=>_(e).config.scaleMax=f),curve:_(e).config.scaleCurve,"onUpdate:curve":h[15]||(h[15]=f=>_(e).config.scaleCurve=f),min:0,max:5,step:.05,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),_(e).config.scaleAxisMode==="separate"?(Q(),kt(Hs,{key:0,label:u.$t("attributes.scaleY"),"show-modes":!1,"allow-curve":!1,mode:_(e).config.scaleMode,"onUpdate:mode":h[16]||(h[16]=f=>_(e).config.scaleMode=f),"value-min":_(e).config.scaleYMin,"onUpdate:valueMin":h[17]||(h[17]=f=>_(e).config.scaleYMin=f),"value-max":_(e).config.scaleYMax,"onUpdate:valueMax":h[18]||(h[18]=f=>_(e).config.scaleYMax=f),curve:_(e).config.scaleYCurve,"onUpdate:curve":h[19]||(h[19]=f=>_(e).config.scaleYCurve=f),min:0,max:5,step:.05,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"])):xe("",!0),Ce(Hs,{label:u.$t("attributes.initialRotation"),"allow-direction":"","allow-curve":!1,mode:_(e).config.initialRotationMode,"onUpdate:mode":h[20]||(h[20]=f=>_(e).config.initialRotationMode=f),"value-min":_(e).config.initialRotationMin,"onUpdate:valueMin":h[21]||(h[21]=f=>_(e).config.initialRotationMin=f),"value-max":_(e).config.initialRotationMax,"onUpdate:valueMax":h[22]||(h[22]=f=>_(e).config.initialRotationMax=f),curve:_(e).config.initialRotationCurve,"onUpdate:curve":h[23]||(h[23]=f=>_(e).config.initialRotationCurve=f),min:-360,max:360,step:1,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),w("div",jG,F(u.$t("attributes.lifecycleTitle")),1),w("div",HG,[w("label",GG,[pe(w("input",{type:"checkbox","onUpdate:modelValue":h[24]||(h[24]=f=>_(e).config.speedOverLifeEnabled=f)},null,512),[[vt,_(e).config.speedOverLifeEnabled]]),h[44]||(h[44]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(u.$t("attributes.speedOverLife")),1)]),_(e).config.speedOverLifeEnabled?(Q(),kt(Hs,{key:0,label:u.$t("attributes.speedMultiplier"),mode:_(e).config.speedOverLifeMode,"onUpdate:mode":_(o),"value-min":_(e).config.speedOverLifeMin,"onUpdate:valueMin":h[25]||(h[25]=f=>_(e).config.speedOverLifeMin=f),"value-max":_(e).config.speedOverLifeMax,"onUpdate:valueMax":h[26]||(h[26]=f=>_(e).config.speedOverLifeMax=f),curve:_(e).config.speedOverLifeCurve,"onUpdate:curve":h[27]||(h[27]=f=>_(e).config.speedOverLifeCurve=f),"default-curve":_(d),min:0,max:3,step:.05,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve","curve-label"])):xe("",!0)]),w("div",WG,[w("label",qG,[pe(w("input",{type:"checkbox","onUpdate:modelValue":h[28]||(h[28]=f=>_(e).config.scaleOverLifeEnabled=f),onChange:h[29]||(h[29]=(...f)=>_(a)&&_(a)(...f))},null,544),[[vt,_(e).config.scaleOverLifeEnabled]]),h[45]||(h[45]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(u.$t("attributes.scaleOverLife")),1)]),_(e).config.scaleOverLifeEnabled?(Q(),te(_e,{key:0},[w("div",KG,[w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:h[30]||(h[30]=f=>_(e).config.scaleOverLifeAxisMode="uniform")},F(u.$t("attributes.uniform")),3),w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:h[31]||(h[31]=f=>_(e).config.scaleOverLifeAxisMode="separate")},F(u.$t("attributes.separateXY")),3)]),Ce(Hs,{label:_(e).config.scaleOverLifeAxisMode==="uniform"?u.$t("attributes.scaleMultiplier"):u.$t("attributes.multiplierX"),mode:_(e).config.scaleOverLifeMode,"onUpdate:mode":_(c),"value-min":_(e).config.scaleOverLifeMin,"onUpdate:valueMin":h[32]||(h[32]=f=>_(e).config.scaleOverLifeMin=f),"value-max":_(e).config.scaleOverLifeMax,"onUpdate:valueMax":h[33]||(h[33]=f=>_(e).config.scaleOverLifeMax=f),curve:_(e).config.scaleOverLifeCurve,"onUpdate:curve":h[34]||(h[34]=f=>_(e).config.scaleOverLifeCurve=f),"default-curve":_(d),min:0,max:3,step:.05,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve","curve-label"]),_(e).config.scaleOverLifeAxisMode==="separate"?(Q(),kt(Hs,{key:0,label:u.$t("attributes.multiplierY"),"show-modes":!1,mode:_(e).config.scaleOverLifeMode,"onUpdate:mode":h[35]||(h[35]=f=>_(e).config.scaleOverLifeMode=f),"value-min":_(e).config.scaleYOverLifeMin,"onUpdate:valueMin":h[36]||(h[36]=f=>_(e).config.scaleYOverLifeMin=f),"value-max":_(e).config.scaleYOverLifeMax,"onUpdate:valueMax":h[37]||(h[37]=f=>_(e).config.scaleYOverLifeMax=f),curve:_(e).config.scaleYOverLifeCurve,"onUpdate:curve":h[38]||(h[38]=f=>_(e).config.scaleYOverLifeCurve=f),"default-curve":_(d),min:0,max:3,step:.05,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","value-min","value-max","curve","default-curve","curve-label"])):xe("",!0)],64)):xe("",!0)]),w("div",JG,[w("label",ZG,[pe(w("input",{type:"checkbox","onUpdate:modelValue":h[39]||(h[39]=f=>_(e).config.rotationOverLifeEnabled=f)},null,512),[[vt,_(e).config.rotationOverLifeEnabled]]),h[46]||(h[46]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(u.$t("attributes.rotationOverLife")),1)]),_(e).config.rotationOverLifeEnabled?(Q(),kt(Hs,{key:0,label:u.$t("attributes.rotationSpeed"),mode:_(e).config.rotationOverLifeMode,"onUpdate:mode":h[40]||(h[40]=f=>_(e).config.rotationOverLifeMode=f),"value-min":_(e).config.rotationSpeedMin,"onUpdate:valueMin":h[41]||(h[41]=f=>_(e).config.rotationSpeedMin=f),"value-max":_(e).config.rotationSpeedMax,"onUpdate:valueMax":h[42]||(h[42]=f=>_(e).config.rotationSpeedMax=f),curve:_(e).config.rotationOverLifeCurve,"onUpdate:curve":h[43]||(h[43]=f=>_(e).config.rotationOverLifeCurve=f),"default-curve":_(l),min:-720,max:720,step:10,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","value-min","value-max","curve","default-curve","curve-label"])):xe("",!0)])],512),[[Xt,_(s)("attr")]])]))}}),qx=dn(QG,[["__scopeId","data-v-b713ad99"]]),eW={class:"gradient-editor"},tW=["title"],nW=["title","onClick","onDblclick","onPointerdown"],iW={key:0,class:"gradient-controls"},sW=["value","aria-label"],rW=["value","aria-label"],oW={class:"gradient-position"},aW=["value","aria-label"],lW=["title"],cW=["title","disabled"],dW={class:"gradient-hint"},uW=Zt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=e,s=Re(null),r=Re(0),o=Le(()=>t.modelValue[r.value]||null),a=Le(()=>[...t.modelValue].sort((C,M)=>C.position-M.position)),c=Le(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(M=>`${M.color} ${l(M.position)*100}%`).join(", ")})`:"#ffffff"});Ut(()=>t.modelValue.length,C=>{r.value>=C&&(r.value=Math.max(0,C-1))});function l(C){return Math.min(1,Math.max(0,Number(C)||0))}function d(){return t.modelValue.map(C=>({position:l(C.position),color:C.color}))}function u(C,M){const k=d();k[C]&&(k[C]={...k[C],...M},n("update:modelValue",k))}function h(C){u(r.value,{color:C.target.value})}function f(C){var P;const M=C.target,k=S(M.value,((P=o.value)==null?void 0:P.color)||"#ffffff");M.value=k,u(r.value,{color:k})}function p(C){const M=C.target;f(C),M.blur()}function m(C){const M=Number(C.target.value);Number.isFinite(M)&&u(r.value,{position:l(M/100)})}function g(C){const M=d();M.push({position:l(C),color:T(M,C)}),r.value=M.length-1,n("update:modelValue",M)}function v(C){if(!s.value)return;const M=s.value.getBoundingClientRect();g((C.clientX-M.left)/Math.max(1,M.width))}function y(){const C=a.value;let M=.5;if(C.length>1){let k=-1;for(let P=0;Pk&&(k=I,M=(C[P].position+C[P+1].position)/2)}}g(M)}function b(C){if(t.modelValue.length<=2||C<0)return;const M=d().filter((k,P)=>P!==C);r.value=Math.min(C,M.length-1),n("update:modelValue",M)}function x(C,M){if(!s.value)return;r.value=M;const k=I=>{const N=s.value.getBoundingClientRect();u(M,{position:l((I.clientX-N.left)/Math.max(1,N.width))})},P=()=>{window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)};window.addEventListener("pointermove",k),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P),C.preventDefault()}function T(C,M){const k=[...C].sort((P,I)=>P.position-I.position);if(!k.length)return"#ffffff";if(M<=k[0].position)return k[0].color;if(M>=k[k.length-1].position)return k[k.length-1].color;for(let P=0;PN.position)continue;const $=(M-I.position)/Math.max(1e-4,N.position-I.position);return E(I.color,N.color,$)}return k[k.length-1].color}function E(C,M,k){const P=j=>{const B=parseInt(j.replace("#","").padEnd(6,"0").slice(0,6),16);return[B>>16&255,B>>8&255,B&255]},I=P(C),N=P(M),$=j=>Math.round(I[j]+(N[j]-I[j])*k);return`#${[$(0),$(1),$(2)].map(j=>j.toString(16).padStart(2,"0")).join("")}`}function S(C,M){let k=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(k)&&(k=k.split("").map(P=>P+P).join("")),/^[0-9a-f]{6}$/i.test(k)?`#${k.toLowerCase()}`:M}return(C,M)=>(Q(),te("div",eW,[w("div",{ref_key:"bar",ref:s,class:"gradient-bar",style:zt({background:c.value}),title:C.$t("gradient.addTitle"),onDblclick:v},[(Q(!0),te(_e,null,Mt(i.modelValue,(k,P)=>(Q(),te("button",{key:P,type:"button",class:Pe(["gradient-stop",{selected:P===r.value}]),style:zt({left:`${l(k.position)*100}%`,"--stop-color":k.color}),title:`${Math.round(l(k.position)*100)}% · ${k.color}`,onClick:We(I=>r.value=P,["stop"]),onDblclick:We(I=>b(P),["stop"]),onPointerdown:We(I=>x(I,P),["stop"])},null,46,nW))),128))],44,tW),o.value?(Q(),te("div",iW,[w("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":C.$t("gradient.color"),onInput:h},null,40,sW),w("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":C.$t("gradient.colorValue"),spellcheck:"false",onChange:f,onKeydown:es(p,["enter"])},null,40,rW),w("label",oW,[w("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":C.$t("gradient.position"),onInput:m},null,40,aW),M[1]||(M[1]=w("span",null,"%",-1))]),w("button",{type:"button",class:"gradient-action",title:C.$t("gradient.addMiddle"),onClick:y},"+",8,lW),w("button",{type:"button",class:"gradient-action danger",title:C.$t("gradient.delete"),disabled:i.modelValue.length<=2,onClick:M[0]||(M[0]=k=>b(r.value))},"×",8,cW)])):xe("",!0),w("div",dW,F(C.$t("gradient.hint")),1)]))}}),nE=dn(uW,[["__scopeId","data-v-cb6cfaf8"]]),hW={class:"pivot-toolbar"},fW={class:"pivot-hint"},pW={class:"pivot-zoom"},mW=["disabled","title"],gW=["disabled","title"],vW=["title"],bW=["title"],yW=["src","alt"],xW={key:2,class:"pivot-empty"},wW={class:"pivot-bottom"},SW={class:"pivot-card"},CW={class:"pivot-presets"},AW=["title","aria-label","onClick"],TW={class:"pivot-card"},EW={class:"pivot-card-head"},_W={class:"pivot-coords"},MW=["value"],PW=["value"],kW={class:"pivot-card-head pivot-rotate-head"},IW={class:"pivot-rotate-state"},RW={class:"pivot-rotate-body"},FW={class:"pivot-rotate-modes"},LW={class:"pivot-rotate-preview"},DW=["src","alt"],Pp=1e3,OW=Zt({__name:"PivotEditor",props:{previewUrl:{},anchorX:{},anchorY:{},large:{type:Boolean,default:!1}},emits:["update:anchorX","update:anchorY","fullscreen"],setup(i,{emit:e}){const t=i,n=e,{t:s}=mi(),r=Le(()=>[{icon:"↖",label:s("pivot.topLeft"),x:0,y:0},{icon:"↑",label:s("pivot.top"),x:50,y:0},{icon:"↗",label:s("pivot.topRight"),x:100,y:0},{icon:"←",label:s("pivot.left"),x:0,y:50},{icon:"◯",label:s("pivot.center"),x:50,y:50},{icon:"→",label:s("pivot.right"),x:100,y:50},{icon:"↙",label:s("pivot.bottomLeft"),x:0,y:100},{icon:"↓",label:s("pivot.bottom"),x:50,y:100},{icon:"↘",label:s("pivot.bottomRight"),x:100,y:100}]),o=Re(null),a=Re(null),c=Re({w:0,h:0}),l=Re({w:1,h:1}),d=Re(100),u=Re({x:0,y:0}),h=Re(!1),f=Re("static");let p=null;const m=U=>Math.min(Pp,Math.max(-Pp,Number.isFinite(U)?U:0)),g=Le(()=>m(t.anchorX*100).toFixed(1)),v=Le(()=>m(t.anchorY*100).toFixed(1));function y(U,D){const L=l.value.w/Math.max(1,l.value.h);let R=U,X=R/L;return X>D&&(X=D,R=X*L),{w:Math.max(1,R),h:Math.max(1,X)}}const b=Le(()=>{const U=t.large?26:12,D=Math.max(1,c.value.w-U*2),L=Math.max(1,c.value.h-U*2);return y(D,L)}),x=Le(()=>({width:`${b.value.w}px`,height:`${b.value.h}px`,transform:`translate(${u.value.x}px, ${u.value.y}px) scale(${d.value/100})`})),T=Le(()=>{const U=d.value/100;return{x:c.value.w/2+u.value.x+(m(t.anchorX*100)/100-.5)*b.value.w*U,y:c.value.h/2+u.value.y+(m(t.anchorY*100)/100-.5)*b.value.h*U}}),E=Le(()=>{const U=t.large?128:72,D=y(U,U);return{width:`${D.w}px`,height:`${D.h}px`,transformOrigin:`${m(t.anchorX*100)}% ${m(t.anchorY*100)}%`}});function S(U,D){const L=Pp/100;n("update:anchorX",Math.min(L,Math.max(-L,Number.isFinite(U)?U:0))),n("update:anchorY",Math.min(L,Math.max(-L,Number.isFinite(D)?D:0)))}function C(U){const D=a.value;if(!D)return;const L=D.getBoundingClientRect();L.width<=0||L.height<=0||S((U.clientX-L.left)/L.width,(U.clientY-L.top)/L.height)}function M(U){if(!t.previewUrl)return;if(U.button===2){k(U);return}if(U.button!==0)return;U.preventDefault(),C(U);const D=R=>C(R),L=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L)}function k(U){U.preventDefault(),h.value=!0;const D=U.clientX,L=U.clientY,R=u.value.x,X=u.value.y,z=Z=>{u.value={x:R+Z.clientX-D,y:X+Z.clientY-L}},K=()=>{h.value=!1,window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K)}function P(U){const D=U.deltaY<0?1.12:.8928571428571428,L=Math.min(400,Math.max(100,Math.round(d.value*D)));if(L===d.value)return;const R=o.value;if(!R){d.value=L;return}const X=R.getBoundingClientRect(),z=U.clientX-X.left,K=U.clientY-X.top,Z=L/d.value;u.value={x:u.value.x+(z-X.width/2-u.value.x)*(1-Z),y:u.value.y+(K-X.height/2-u.value.y)*(1-Z)},d.value=L}function I(U){const D=U.target;l.value={w:D.naturalWidth||1,h:D.naturalHeight||1}}function N(U){d.value=Math.min(400,Math.max(100,d.value+U))}function $(){S(.5,.5)}function j(U){S(U.x/100,U.y/100)}function B(U){return Math.abs(m(t.anchorX*100)-U.x)<.05&&Math.abs(m(t.anchorY*100)-U.y)<.05}function Y(U,D){const L=m(Number(D.target.value));n(U==="x"?"update:anchorX":"update:anchorY",L/100)}return Ut(()=>t.previewUrl,()=>{l.value={w:1,h:1},u.value={x:0,y:0},d.value=100}),Ti(()=>{o.value&&(p=new ResizeObserver(U=>{var L;const D=(L=U[0])==null?void 0:L.contentRect;D&&(c.value={w:D.width,h:D.height})}),p.observe(o.value))}),Ar(()=>{p==null||p.disconnect(),p=null}),(U,D)=>(Q(),te("div",{class:Pe(["pivot-editor",{"pivot-large":i.large}])},[w("div",hW,[w("div",fW,[D[9]||(D[9]=w("span",{class:"pivot-hint-icon"},"⊕",-1)),w("span",null,F(U.$t("pivot.title")),1)]),w("div",pW,[w("button",{type:"button",disabled:d.value<=100,title:U.$t("pivot.zoomOut"),onClick:D[0]||(D[0]=L=>N(-25))},"−",8,mW),w("span",null,F(d.value)+"%",1),w("button",{type:"button",disabled:d.value>=400,title:U.$t("pivot.zoomIn"),onClick:D[1]||(D[1]=L=>N(25))},"+",8,gW)]),i.large?xe("",!0):(Q(),te("button",{key:0,type:"button",class:"pivot-expand",title:U.$t("pivot.expand"),onClick:D[2]||(D[2]=L=>U.$emit("fullscreen"))},"⤢",8,vW))]),w("div",{ref_key:"stageRef",ref:o,class:Pe(["pivot-stage",{panning:h.value}]),title:U.$t("pivot.interaction"),onPointerdown:M,onWheel:We(P,["prevent"]),onContextmenu:D[3]||(D[3]=We(()=>{},["prevent"]))},[i.previewUrl?(Q(),te("div",{key:0,ref_key:"boxRef",ref:a,class:"pivot-box",style:zt(x.value)},[w("img",{src:i.previewUrl,alt:U.$t("pivot.previewAlt"),draggable:"false",onLoad:I},null,40,yW)],4)):xe("",!0),i.previewUrl?(Q(),te(_e,{key:1},[w("div",{class:"pivot-cross vertical",style:zt({left:`${T.value.x}px`})},null,4),w("div",{class:"pivot-cross horizontal",style:zt({top:`${T.value.y}px`})},null,4),w("div",{class:"pivot-marker",style:zt({left:`${T.value.x}px`,top:`${T.value.y}px`})},null,4),w("div",{class:"pivot-badge",style:zt({left:`${T.value.x}px`,top:`${T.value.y}px`})},"X: "+F(g.value)+"% | Y: "+F(v.value)+"%",5)],64)):(Q(),te("div",xW,F(U.$t("pivot.noImage")),1))],42,bW),w("div",wW,[w("div",SW,[w("div",CW,[(Q(!0),te(_e,null,Mt(r.value,L=>(Q(),te("button",{key:L.label,type:"button",class:Pe(["pivot-preset",{on:B(L)}]),title:`${L.label}(${L.x}%, ${L.y}%)`,"aria-label":L.label,onClick:R=>j(L)},F(L.icon),11,AW))),128))]),w("button",{type:"button",class:"pivot-reset",onClick:$},"↺ "+F(U.$t("pivot.resetCenter")),1)]),w("div",TW,[w("div",EW,[w("span",null,[D[10]||(D[10]=w("span",{class:"pivot-card-icon"},"◎",-1)),Ct(" "+F(U.$t("pivot.coordinates")),1)])]),w("div",_W,[w("label",null,[D[11]||(D[11]=Ct("X: ",-1)),w("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:g.value,onInput:D[4]||(D[4]=L=>Y("x",L))},null,40,MW),D[12]||(D[12]=w("span",null,"%",-1))]),w("label",null,[D[13]||(D[13]=Ct("Y: ",-1)),w("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:v.value,onInput:D[5]||(D[5]=L=>Y("y",L))},null,40,PW),D[14]||(D[14]=w("span",null,"%",-1))])]),i.large?(Q(),te(_e,{key:0},[w("div",kW,[w("span",null,[D[15]||(D[15]=w("span",{class:"pivot-card-icon"},"✥",-1)),Ct(" "+F(U.$t("pivot.rotationTest")),1)]),w("span",IW,F(f.value==="static"?U.$t("pivot.static"):f.value==="spin"?U.$t("pivot.spin"):U.$t("pivot.swing")),1)]),w("div",RW,[w("div",FW,[w("button",{type:"button",class:Pe({on:f.value==="static"}),onClick:D[6]||(D[6]=L=>f.value="static")},F(U.$t("pivot.static")),3),w("button",{type:"button",class:Pe({on:f.value==="spin"}),onClick:D[7]||(D[7]=L=>f.value="spin")},"↻ "+F(U.$t("pivot.spin")),3),w("button",{type:"button",class:Pe({on:f.value==="swing"}),onClick:D[8]||(D[8]=L=>f.value="swing")},"⇄ "+F(U.$t("pivot.swing")),3)]),w("div",LW,[i.previewUrl?(Q(),te("img",{key:0,src:i.previewUrl,alt:U.$t("pivot.rotationAlt"),draggable:"false",class:Pe(f.value),style:zt(E.value)},null,14,DW)):xe("",!0)])])],64)):xe("",!0)])])],2))}}),Kx=dn(OW,[["__scopeId","data-v-a5622844"]]),NW={class:"image-card"},$W={class:"imgrow"},BW=["title"],UW=["src","alt"],VW={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},XW={class:"img-fields"},YW={key:0,class:"row"},zW={class:"row"},jW=["placeholder"],HW={class:"img-actions"},GW=["title"],WW=["title","disabled"],qW={class:"thumb-note"},KW={key:0,class:"row"},JW={value:"fixed"},ZW={value:"sequence"},QW={class:"row"},eq={value:"once-hide"},tq={value:"once-hold"},nq={value:"loop-forward"},iq={value:"loop-reverse"},sq={class:"row"},rq={class:"sequence-note"},oq={class:"resource-weight-row"},aq=["disabled","title"],lq={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},cq={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},dq={key:2,class:"pivot-toggle-row"},uq={class:"pivot-toggle-text"},hq={class:"pivot-toggle-title"},fq=["title"],pq=["title"],mq=["aria-label"],gq={class:"pivot-modal-head"},vq={class:"pivot-modal-info"},bq={class:"pivot-modal-title"},yq={class:"pivot-modal-badge"},xq={class:"pivot-modal-desc"},wq=["title"],Sq={class:"pivot-modal-hint"},Cq={class:"pivot-modal-actions"},Jx="SpineParticle.PivotPanels.v1",Aq=Zt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1},pivotKey:{}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(i,{emit:e}){const t=i,n=e,{t:s}=mi(),r=Le(()=>{var M,k;if(t.resource.imageMode==="sequence"){const P=t.resource.sequenceFrames||[];if(!P.length)return s("image.noSequence");const I=((M=P[0])==null?void 0:M.name)||s("image.firstFrame"),N=((k=P[P.length-1])==null?void 0:k.name)||I;return P.length===1?s("image.frameCountOne",{name:I}):s("image.frameCountMany",{count:P.length,first:I,last:N})}const C=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return C.includes(".")?C:`${C}.png`}),o=Le(()=>{var C,M;return t.resource.imageMode==="sequence"?((M=(C=t.resource.sequenceFrames)==null?void 0:C[0])==null?void 0:M.previewUrl)||"":t.resource.previewUrl});function a(){try{const C=JSON.parse(sessionStorage.getItem(Jx)||"{}");return C&&typeof C=="object"?C:{}}catch{return{}}}const c=a(),l=Le(()=>t.pivotKey||`particle-image:${t.resource.id}`),d=Le(()=>typeof t.resource.anchorX=="number"&&typeof t.resource.anchorY=="number"),u=Le(()=>Math.abs((t.resource.anchorX??.5)-.5)<1e-4&&Math.abs((t.resource.anchorY??.5)-.5)<1e-4),h=typeof c[l.value]=="boolean",f=Re(h?c[l.value]:!u.value);Ut(f,C=>{c[l.value]=C;try{sessionStorage.setItem(Jx,JSON.stringify(c))}catch{}}),Ut(l,C=>{f.value=typeof c[C]=="boolean"?c[C]:!u.value}),Ut(()=>u.value,C=>{C||(f.value=!0)},{immediate:!0});const p=Re(!1),m=Re(.5),g=Re(.5),v=Le(()=>{const C=((t.resource.anchorX??.5)*100).toFixed(1),M=((t.resource.anchorY??.5)*100).toFixed(1);return f.value?s("image.pivotOn",{x:C,y:M}):u.value?s("image.pivotOff"):s("image.pivotCustom",{x:C,y:M})});function y(){m.value=t.resource.anchorX??.5,g.value=t.resource.anchorY??.5,p.value=!0}function b(){f.value||(t.resource.anchorX=.5,t.resource.anchorY=.5,p.value=!1)}function x(C){C&&(t.resource.anchorX=m.value,t.resource.anchorY=g.value),p.value=!1}function T(C){C.key==="Escape"&&p.value&&x(!1)}Ti(()=>window.addEventListener("keydown",T)),Ar(()=>window.removeEventListener("keydown",T));const E=Le(()=>{var P,I;const C=t.resource.sequenceFrames||[];if(!C.length)return s("image.noSequence");const M=((P=C[0])==null?void 0:P.name)||s("image.firstImage"),k=((I=C[C.length-1])==null?void 0:I.name)||s("image.lastImage");return s("image.sequenceSelected",{count:C.length,first:M,last:k})});function S(){t.supportsSequence&&t.resource.imageMode==="sequence"?n("pickSequence",t.resource.id):n("pick",t.resource.id)}return(C,M)=>(Q(),te(_e,null,[w("div",NW,[w("div",$W,[w("button",{class:"img-thumb",title:i.supportsSequence&&i.resource.imageMode==="sequence"?C.$t("image.chooseSequence"):C.$t("image.chooseLocal"),onClick:S},[o.value?(Q(),te("img",{key:0,src:o.value,alt:i.resource.textureName},null,8,UW)):(Q(),te("svg",VW,[...M[19]||(M[19]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),w("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),w("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,BW),w("div",XW,[i.showFolder?(Q(),te("label",YW,[w("span",null,F(C.$t("image.subfolder")),1),pe(w("input",{"onUpdate:modelValue":M[0]||(M[0]=k=>i.resource.textureFolder=k),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Je,i.resource.textureFolder]])])):xe("",!0),w("label",zW,[w("span",null,F(C.$t("image.name")),1),pe(w("input",{"onUpdate:modelValue":M[1]||(M[1]=k=>i.resource.textureName=k),type:"text",class:"inp",placeholder:i.namePlaceholder},null,8,jW),[[Je,i.resource.textureName]])])]),w("div",HW,[w("button",{class:"mini-btn2",title:C.$t("image.restore",{name:i.defaultFile}),onClick:M[2]||(M[2]=k=>C.$emit("reset",i.resource.id))},"⟳",8,GW),w("button",{class:"mini-btn2",title:C.$t("image.deleteResource"),disabled:i.resourceCount===1,onClick:M[3]||(M[3]=k=>C.$emit("remove",i.resource.id))},"🗑",8,WW)])]),w("div",qW,F(r.value),1),i.supportsSequence?(Q(),te("label",KW,[w("span",null,F(C.$t("image.imageMode")),1),pe(w("select",{"onUpdate:modelValue":M[4]||(M[4]=k=>i.resource.imageMode=k),class:"inp"},[w("option",JW,F(C.$t("image.fixed")),1),w("option",ZW,F(C.$t("image.sequence")),1)],512),[[_t,i.resource.imageMode]])])):xe("",!0),i.supportsSequence&&i.resource.imageMode==="sequence"?(Q(),te(_e,{key:1},[w("label",QW,[w("span",null,F(C.$t("image.playbackMode")),1),pe(w("select",{"onUpdate:modelValue":M[5]||(M[5]=k=>i.resource.sequencePlayback=k),class:"inp"},[w("option",eq,F(C.$t("image.onceHide")),1),w("option",tq,F(C.$t("image.onceHold")),1),w("option",nq,F(C.$t("image.loopForward")),1),w("option",iq,F(C.$t("image.loopReverse")),1)],512),[[_t,i.resource.sequencePlayback]])]),w("label",sq,[w("span",null,F(C.$t("image.playbackFps")),1),pe(w("input",{"onUpdate:modelValue":M[6]||(M[6]=k=>i.resource.sequenceFps=k),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Je,i.resource.sequenceFps,void 0,{number:!0}]])]),w("button",{class:"sequence-pick",onClick:M[7]||(M[7]=k=>C.$emit("pickSequence",i.resource.id))},F(C.$t("image.chooseSequenceMulti")),1),w("div",rq,F(E.value),1)],64)):xe("",!0),w("div",oq,[Ce(Ue,{class:"resource-weight-control",label:C.$t("image.weight"),min:0,max:100,step:1,"model-value":i.resource.weight,disabled:i.resource.locked||i.resourceCount===1,"onUpdate:modelValue":M[8]||(M[8]=k=>C.$emit("updateWeight",i.resource.id,k))},null,8,["label","model-value","disabled"]),w("button",{class:Pe(["weight-lock",{on:i.resource.locked}]),disabled:i.resourceCount===1,title:i.resource.locked?C.$t("image.unlockWeight"):C.$t("image.lockWeight"),onClick:M[9]||(M[9]=k=>C.$emit("toggleLock",i.resource.id))},[i.resource.locked?(Q(),te("svg",lq,[...M[20]||(M[20]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(Q(),te("svg",cq,[...M[21]||(M[21]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,aq)]),j_(C.$slots,"default",{},void 0),d.value?(Q(),te("div",dq,[M[23]||(M[23]=w("div",{class:"pivot-toggle-icon"},"◎",-1)),w("div",uq,[w("div",hq,F(C.$t("image.pivot")),1),w("div",{class:"pivot-toggle-sub",title:v.value},F(v.value),9,fq)]),w("label",{class:"pivot-switch",title:f.value?C.$t("image.collapsePivot"):C.$t("image.expandPivot")},[pe(w("input",{"onUpdate:modelValue":M[10]||(M[10]=k=>f.value=k),type:"checkbox",onChange:b},null,544),[[vt,f.value]]),M[22]||(M[22]=w("span",{class:"pivot-switch-ui"},null,-1))],8,pq)])):xe("",!0),d.value&&f.value?(Q(),kt(Kx,{key:3,"preview-url":o.value,"anchor-x":i.resource.anchorX??.5,"anchor-y":i.resource.anchorY??.5,"onUpdate:anchorX":M[11]||(M[11]=k=>i.resource.anchorX=k),"onUpdate:anchorY":M[12]||(M[12]=k=>i.resource.anchorY=k),onFullscreen:y},null,8,["preview-url","anchor-x","anchor-y"])):xe("",!0)]),(Q(),kt(Qu,{to:"body"},[p.value?(Q(),te("div",{key:0,class:"pivot-modal-backdrop",onPointerdown:M[18]||(M[18]=We(k=>x(!1),["self"]))},[w("div",{class:"pivot-modal",role:"dialog","aria-modal":"true","aria-label":C.$t("image.pivotModal")},[w("div",gq,[M[24]||(M[24]=w("div",{class:"pivot-modal-icon"},"◎",-1)),w("div",vq,[w("div",bq,[Ct(F(C.$t("image.pivotModal"))+" ",1),w("span",yq,F(i.resource.textureName||i.defaultFile),1)]),w("div",xq,F(C.$t("image.pivotModalDesc")),1)]),w("button",{type:"button",class:"pivot-modal-close",title:C.$t("common.close"),onClick:M[13]||(M[13]=k=>x(!1))},"✕",8,wq)]),w("div",Sq,F(C.$t("image.pivotZoomHint")),1),Ce(Kx,{large:"","preview-url":o.value,"anchor-x":m.value,"anchor-y":g.value,"onUpdate:anchorX":M[14]||(M[14]=k=>m.value=k),"onUpdate:anchorY":M[15]||(M[15]=k=>g.value=k)},null,8,["preview-url","anchor-x","anchor-y"]),w("div",Cq,[w("button",{type:"button",class:"pivot-modal-cancel",onClick:M[16]||(M[16]=k=>x(!1))},F(C.$t("common.cancel")),1),w("button",{type:"button",class:"pivot-modal-confirm",onClick:M[17]||(M[17]=k=>x(!0))},F(C.$t("image.confirmPivot")),1)])],8,mq)],32)):xe("",!0)]))],64))}}),iE=dn(Aq,[["__scopeId","data-v-89f1e08d"]]),Tq={class:"group"},Eq={class:"caret"},_q=["title"],Mq={class:"group-body"},Pq={class:"look-title"},kq={class:"seg"},Iq={class:"row"},Rq={value:"跟随导出"},Fq={value:"线性"},Lq={value:"贝塞尔"},Dq={class:"curve-wrap"},Oq={class:"curve-labels"},Nq={class:"look-title"},$q={class:"seg"},Bq={class:"row"},Uq=["value"],Vq={value:0},Xq=["value"],Yq={class:"render-layer-current"},zq=["title"],jq={key:0,class:"slot-picker"},Hq=["placeholder","aria-label"],Gq={class:"slot-list"},Wq=["onClick"],qq={class:"slot-order"},Kq={class:"slot-name"},Jq={class:"slot-attachment"},Zq={key:0,class:"modifier-hint"},Qq={class:"seg"},e7={class:"switch-row render-layer-switch"},t7=["disabled"],n7={key:0,class:"modifier-hint"},i7={key:2,class:"modifier-hint render-layer-warning"},s7={class:"modifier-hint"},r7={class:"look-title image-title"},o7=["title"],a7={class:"row resource-color-row"},l7=["onUpdate:modelValue"],c7={value:"fixed"},d7={value:"random"},u7={value:"lifetime"},h7=["onUpdate:modelValue"],f7={value:"normal"},p7={value:"add"},m7={value:"multiply"},g7={value:"screen"},v7={key:0,class:"row resource-color-picker"},b7=["onUpdate:modelValue"],y7=["value","aria-label","onChange","onKeydown"],x7={key:0,class:"random-color-hint"},w7={class:"resource-alpha-head"},S7={class:"alpha-modes"},C7=["onClick"],A7=["onClick"],T7=["onClick"],E7={class:"row"},_7=["onUpdate:modelValue"],M7={value:"跟随导出"},P7={value:"线性"},k7={value:"贝塞尔"},I7={class:"resource-alpha-curve"},R7=Zt({__name:"ParticleAppearanceSection",setup(i){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:n,sequenceFileInput:s,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:c,onSequenceFiles:l,resetTexture:d,setResourceFixedColor:u,commitResourceFixedColor:h,removeImageResource:f,setResourceWeight:p,toggleResourceLock:m,collapsed:g,toggle:v,sectionOpen:y,resetModule:b,select:x,renderLayerSlotPickerOpen:T,renderLayerSlotSearch:E,renderLayerReadySpines:S,renderLayerSpineReady:C,renderLayerFilteredSlots:M,renderLayerSlotLabel:k,renderLayerResolvedLabel:P,renderLayerWarning:I,setRenderLayerSlotMode:N,selectRenderLayerSpine:$,pickRenderLayerSlot:j,clearRenderLayerSlot:B,ALPHA_CURVE:Y,RESOURCE_ALPHA_CURVE:U}=Tr();return(D,L)=>(Q(),te("div",Tq,[w("div",{class:"group-head",onClick:L[1]||(L[1]=R=>_(v)("look"))},[w("span",Eq,F(_(g).look?"▸":"▾"),1),w("span",null,F(D.$t("appearance.title")),1),w("button",{class:"group-reset",title:D.$t("appearance.reset"),onClick:L[0]||(L[0]=We(R=>_(b)("look"),["stop"]))},F(D.$t("common.reset")),9,_q)]),pe(w("div",Mq,[w("div",Pq,F(D.$t("appearance.opacity")),1),w("div",kq,[w("button",{class:Pe(["seg-btn",{active:_(t).config.alphaMode==="curve"}]),onClick:L[2]||(L[2]=R=>_(t).config.alphaMode="curve")},F(D.$t("common.curve")),3),w("button",{class:Pe(["seg-btn",{active:_(t).config.alphaMode==="fixed"}]),onClick:L[3]||(L[3]=R=>_(t).config.alphaMode="fixed")},F(D.$t("common.fixed")),3)]),_(t).config.alphaMode==="fixed"?(Q(),kt(Ue,{key:0,label:D.$t("appearance.opacity"),min:0,max:1,step:.01,modelValue:_(t).config.alpha,"onUpdate:modelValue":L[4]||(L[4]=R=>_(t).config.alpha=R)},null,8,["label","modelValue"])):(Q(),te(_e,{key:1},[w("label",Iq,[w("span",null,F(D.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":L[5]||(L[5]=R=>_(t).config.curveMode=R),class:"inp"},[w("option",Rq,F(D.$t("common.followExport")),1),w("option",Fq,F(D.$t("common.linear")),1),w("option",Lq,F(D.$t("common.bezier")),1)],512),[[_t,_(t).config.curveMode]])]),w("div",Dq,[Ce(Ts,{modelValue:_(t).config.alphaCurve,"onUpdate:modelValue":L[6]||(L[6]=R=>_(t).config.alphaCurve=R),"default-value":_(Y),mode:_(e)(_(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),w("div",Oq,[w("span",null,F(D.$t("appearance.transparent")),1),w("span",null,F(D.$t("attributes.lifeTo")),1),w("span",null,F(D.$t("appearance.opaque")),1)])])],64)),w("div",Nq,F(D.$t("appearance.renderLayer")),1),w("div",$q,[w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerMode==="top"}]),onClick:L[7]||(L[7]=R=>_(t).config.renderLayerMode="top")},F(D.$t("appearance.top")),3),w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerMode==="slot"}]),onClick:L[8]||(L[8]=(...R)=>_(N)&&_(N)(...R))},F(D.$t("appearance.spineSlot")),3)]),_(t).config.renderLayerMode==="slot"?(Q(),te(_e,{key:2},[w("label",Bq,[L[19]||(L[19]=w("span",null,"Spine",-1)),w("select",{class:"inp",value:_(t).config.renderLayerSpineId,onChange:L[9]||(L[9]=(...R)=>_($)&&_($)(...R))},[w("option",Vq,F(_(S).length?D.$t("appearance.selectSpine"):D.$t("appearance.noSpine")),1),(Q(!0),te(_e,null,Mt(_(S),R=>(Q(),te("option",{key:R.id,value:R.id},F(R.name),9,Xq))),128))],40,Uq)]),_(C)?(Q(),te(_e,{key:0},[w("div",Yq,[w("span",{class:"render-layer-text",title:_(k)},F(_(k)||D.$t("appearance.noSlot")),9,zq),w("button",{class:"mini-btn",onClick:L[10]||(L[10]=R=>T.value=!_(T))},F(_(k)?D.$t("appearance.reselect"):D.$t("appearance.selectSlot")),1),_(t).config.renderLayerSlotName?(Q(),te("button",{key:0,class:"mini-btn ghost",onClick:L[11]||(L[11]=(...R)=>_(B)&&_(B)(...R))},F(D.$t("common.clear")),1)):xe("",!0)]),_(T)?(Q(),te("div",jq,[pe(w("input",{"onUpdate:modelValue":L[12]||(L[12]=R=>Jt(E)?E.value=R:null),class:"inp",type:"search",placeholder:D.$t("appearance.searchSlots"),"aria-label":D.$t("appearance.searchSlotsAria")},null,8,Hq),[[Je,_(E),void 0,{trim:!0}]]),w("div",Gq,[(Q(!0),te(_e,null,Mt(_(M),R=>(Q(),te("button",{key:R.name,class:Pe(["slot-item",{on:_(t).config.renderLayerSlotName===R.name}]),onClick:X=>_(j)(R)},[w("span",qq,F(R.order+1),1),w("span",Kq,F(R.name),1),w("span",Jq,F(R.attachment||D.$t("appearance.emptySlot")),1)],10,Wq))),128)),_(M).length?xe("",!0):(Q(),te("div",Zq,F(D.$t("appearance.noMatchingSlots")),1))])])):xe("",!0),_(t).config.renderLayerSlotName?(Q(),te(_e,{key:1},[w("div",Qq,[w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerSlotPosition==="above"}]),onClick:L[13]||(L[13]=R=>_(t).config.renderLayerSlotPosition="above")},F(D.$t("appearance.above")),3),w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerSlotPosition==="below"}]),onClick:L[14]||(L[14]=R=>_(t).config.renderLayerSlotPosition="below")},F(D.$t("appearance.below")),3)]),w("label",e7,[pe(w("input",{"onUpdate:modelValue":L[15]||(L[15]=R=>_(t).config.renderLayerFollowAttachment=R),type:"checkbox",disabled:_(t).config.renderLayerSlotPosition==="below"},null,8,t7),[[vt,_(t).config.renderLayerFollowAttachment]]),L[20]||(L[20]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(D.$t("appearance.followAttachment")),1)]),_(P)?(Q(),te("div",n7,F(_(P)),1)):xe("",!0)],64)):xe("",!0),_(I)?(Q(),te("div",i7,F(_(I)),1)):xe("",!0),w("div",s7,F(D.$t("appearance.previewOnly")),1)],64)):xe("",!0)],64)):xe("",!0),w("div",r7,[w("span",null,F(D.$t("appearance.imageResources")),1),w("button",{class:"image-add",title:D.$t("appearance.addImage"),onClick:L[16]||(L[16]=(...R)=>_(r)&&_(r)(...R))},"+",8,o7)]),(Q(!0),te(_e,null,Mt(_(t).config.imageResources,R=>(Q(),kt(iE,{key:`${_(t).id}:${R.id}`,resource:R,"resource-count":_(t).config.imageResources.length,"pivot-key":`${_(t).id}:${R.id}`,"supports-sequence":"","default-file":"star.png",onPick:_(o),onPickSequence:_(a),onReset:_(d),onRemove:_(f),onUpdateWeight:_(p),onToggleLock:_(m)},{default:Ju(()=>[Ce(Ue,{label:D.$t("appearance.scale"),min:.1,max:3,step:.05,modelValue:R.scale,"onUpdate:modelValue":X=>R.scale=X},null,8,["label","modelValue","onUpdate:modelValue"]),L[21]||(L[21]=w("div",{class:"resource-divider"},null,-1)),w("label",a7,[w("span",null,F(D.$t("appearance.color")),1),pe(w("select",{"onUpdate:modelValue":X=>R.colorMode=X,class:"inp"},[w("option",c7,F(D.$t("appearance.fixedColor")),1),w("option",d7,F(D.$t("appearance.randomColor")),1),w("option",u7,F(D.$t("appearance.lifetime")),1)],8,l7),[[_t,R.colorMode]]),pe(w("select",{"onUpdate:modelValue":X=>R.blend=X,class:"inp blend-select"},[w("option",f7,F(D.$t("appearance.normal")),1),w("option",p7,F(D.$t("appearance.add")),1),w("option",m7,F(D.$t("appearance.multiply")),1),w("option",g7,F(D.$t("appearance.screen")),1)],8,h7),[[_t,R.blend]])]),R.colorMode==="fixed"?(Q(),te("label",v7,[w("span",null,F(D.$t("appearance.fixedColor")),1),pe(w("input",{type:"color","onUpdate:modelValue":X=>R.colorStart=X,class:"colr"},null,8,b7),[[Je,R.colorStart]]),w("input",{type:"text",class:"hex-input",value:R.colorStart,spellcheck:"false","aria-label":D.$t("appearance.fixedColorValue"),onChange:X=>_(u)(R,X),onKeydown:es(X=>_(h)(R,X),["enter"])},null,40,y7)])):(Q(),te(_e,{key:1},[Ce(nE,{modelValue:R.colorGradient,"onUpdate:modelValue":X=>R.colorGradient=X},null,8,["modelValue","onUpdate:modelValue"]),R.colorMode==="random"?(Q(),te("div",x7,F(D.$t("appearance.randomColorHint")),1)):xe("",!0)],64)),w("div",w7,[w("span",null,F(D.$t("appearance.independentAlpha")),1),w("div",S7,[w("button",{class:Pe({on:R.independentAlpha==="off"}),onClick:X=>R.independentAlpha="off"},F(D.$t("appearance.off")),11,C7),w("button",{class:Pe({on:R.independentAlpha==="fixed"}),onClick:X=>R.independentAlpha="fixed"},F(D.$t("common.fixed")),11,A7),w("button",{class:Pe({on:R.independentAlpha==="curve"}),onClick:X=>R.independentAlpha="curve"},F(D.$t("common.curve")),11,T7)])]),R.independentAlpha==="fixed"?(Q(),kt(Ue,{key:2,label:D.$t("appearance.opacity"),min:0,max:1,step:.01,modelValue:R.alpha,"onUpdate:modelValue":X=>R.alpha=X},null,8,["label","modelValue","onUpdate:modelValue"])):R.independentAlpha==="curve"?(Q(),te(_e,{key:3},[w("label",E7,[w("span",null,F(D.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":X=>R.alphaCurveMode=X,class:"inp"},[w("option",M7,F(D.$t("common.followExport")),1),w("option",P7,F(D.$t("common.linear")),1),w("option",k7,F(D.$t("common.bezier")),1)],8,_7),[[_t,R.alphaCurveMode]])]),w("div",I7,[Ce(Ts,{modelValue:R.alphaCurve,"onUpdate:modelValue":X=>R.alphaCurve=X,"default-value":_(U),mode:_(e)(R.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):xe("",!0)]),_:2},1032,["resource","resource-count","pivot-key","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),w("input",{ref_key:"textureFileInput",ref:n,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:L[17]||(L[17]=(...R)=>_(c)&&_(c)(...R))},null,544),w("input",{ref_key:"sequenceFileInput",ref:s,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:L[18]||(L[18]=(...R)=>_(l)&&_(l)(...R))},null,544)],512),[[Xt,_(y)("look")]])]))}}),Zx=dn(R7,[["__scopeId","data-v-bfe00f1f"]]),F7={class:"group"},L7={class:"caret"},D7=["title"],O7={class:"group-body"},N7={class:"modifier-item damping-item"},$7={class:"modifier-item"},B7={class:"switch-row modifier-switch"},U7={key:0,class:"modifier-params"},V7={class:"modifier-hint"},X7={class:"modifier-item"},Y7={class:"switch-row modifier-switch"},z7={key:0,class:"modifier-params gravity-params"},j7={class:"modifier-mode-row"},H7={class:"gravity-curve-title"},G7={class:"gravity-curve-axis"},W7={class:"modifier-hint"},q7={class:"modifier-item"},K7={class:"switch-row modifier-switch"},J7={key:0,class:"modifier-params gravity-params"},Z7={class:"modifier-mode-row"},Q7={class:"gravity-curve-title"},e9={class:"gravity-curve-axis"},t9={class:"modifier-hint"},n9={class:"modifier-item"},i9={class:"switch-row modifier-switch"},s9={key:0,class:"modifier-params"},r9={class:"row"},o9={value:"constant"},a9={value:"linear"},l9={value:"inverse"},c9={class:"modifier-hint"},d9={class:"switch-row"},u9={class:"modifier-item"},h9={class:"switch-row modifier-switch"},f9={key:0,class:"modifier-params"},p9={class:"row"},m9={value:"constant"},g9={value:"linear"},v9={value:"inverse"},b9={class:"modifier-hint"},y9={class:"switch-row"},x9={class:"modifier-item"},w9={class:"switch-row modifier-switch"},S9={key:0,class:"modifier-params"},C9={class:"row"},A9={value:"global"},T9={value:"particle"},E9={class:"row"},_9={value:"linear"},M9={value:"curve"},P9={class:"modifier-hint"},k9={class:"switch-row"},I9={class:"modifier-item"},R9={class:"switch-row modifier-switch"},F9={key:0,class:"modifier-params trail-params"},L9={class:"trail-section-head"},D9={class:"trail-section-title"},O9=["title"],N9={class:"row"},$9=["onUpdate:modelValue"],B9={value:"fixed"},U9={value:"random"},V9={class:"row"},X9=["onUpdate:modelValue"],Y9={value:"fixed"},z9={value:"random"},j9={class:"row"},H9=["onUpdate:modelValue"],G9={value:"particle"},W9={value:"fixed"},q9={class:"switch-row trail-sub-switch"},K9=["onUpdate:modelValue"],J9={class:"switch-row trail-sub-switch"},Z9=["onUpdate:modelValue"],Q9={class:"trail-mode-head"},eK={class:"alpha-modes"},tK=["onClick"],nK=["onClick"],iK=["onClick"],sK={class:"row"},rK=["onUpdate:modelValue"],oK={value:"normal"},aK={value:"add"},lK={value:"multiply"},cK={value:"screen"},dK={key:6,class:"row trail-fixed-color"},uK=["onUpdate:modelValue"],hK=["value","onChange","onKeydown"],fK={class:"trail-mode-head"},pK={class:"alpha-modes"},mK=["onClick"],gK=["onClick"],vK=["onClick"],bK={class:"trail-grid-row"},yK={class:"modifier-hint"},xK={class:"modifier-item"},wK={class:"switch-row modifier-switch"},SK=["disabled"],CK={key:0,class:"modifier-params emitter-follow-params"},AK={class:"field-block"},TK=["value"],EK={value:"none"},_K={value:"path"},MK={key:0,value:"bone"},PK={class:"field-block"},kK={value:0},IK=["value"],RK={class:"field-block"},FK={value:"fixed"},LK={value:"direction"},DK={class:"gravity-curve-title"},OK={class:"field-grid follow-grid"},NK={class:"compact-field"},$K={class:"compact-field"},BK={value:"local"},UK={value:"world"},VK={class:"field-block"},XK={value:"forward"},YK={value:"reverse"},zK={class:"modifier-hint"},jK={key:0,class:"bone-follow-target"},HK={key:1,class:"bone-follow-missing"},GK={class:"field-block"},WK={value:"local"},qK={value:"world"},KK={class:"field-grid follow-grid"},JK={class:"compact-field"},ZK={class:"compact-field"},QK={class:"bone-follow-transform-grid"},eJ={class:"compact-field"},tJ={class:"compact-field"},nJ={class:"compact-field"},iJ={class:"modifier-hint"},sJ={class:"modifier-item"},rJ={class:"switch-row modifier-switch"},oJ={key:0,class:"modifier-params collision-filter-params"},aJ={class:"collision-filter-title"},lJ={class:"collision-filter-tags"},cJ=["title"],dJ=["aria-label","onClick"],uJ=["disabled","title"],hJ={key:0,class:"collision-filter-empty"},fJ={key:1,class:"collision-filter-picker"},pJ=["onClick"],mJ={class:"modifier-hint"},gJ={class:"modifier-item events-item"},vJ={class:"switch-row modifier-switch"},bJ={key:0,class:"event-rules"},yJ={class:"event-selects"},xJ=["onUpdate:modelValue","title"],wJ={value:"birth"},SJ={value:"death"},CJ={value:"collision"},AJ=["onUpdate:modelValue","title"],TJ={value:0},EJ=["value"],_J=["title","onClick"],MJ={class:"event-probability"},PJ=["onUpdate:modelValue"],kJ={key:0,class:"event-probability event-collision-limit"},IJ=["value","onInput"],RJ={class:"event-probability event-inherit"},FJ=["onClick"],LJ={class:"inherit-summary"},DJ={key:1,class:"event-probability event-color-mode"},OJ=["onUpdate:modelValue"],NJ={value:"add"},$J={value:"replace"},BJ={class:"inherit-check"},UJ={class:"inherit-check"},VJ=["onClick"],XJ={class:"inherit-check"},YJ=Zt({__name:"ParticleModifiersSection",setup(i){const{store:e,sys:t,trailTextureFileInput:n,addTrailResource:s,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:c,onTrailTextureFile:l,resetTrailTexture:d,removeTrailResource:u,setTrailResourceWeight:h,toggleTrailResourceLock:f,setTrailColor:p,commitTrailColor:m,selectedSpineBone:g,boundSpineBone:v,collisionPickerOpen:y,selectedCollisionBodies:b,availableCollisionBodies:x,addCollisionBody:T,removeCollisionBody:E,collapsed:S,toggle:C,sectionOpen:M,onEmitterFollowModeChange:k,bindSelectedBone:P,resetModule:I,select:N,LINEAR_CURVE:$,FLAT_CURVE:j,TRAIL_ALPHA_CURVE:B,TRAIL_SHAPE_CURVE:Y}=Tr(),{t:U}=mi(),D=Le(()=>{var O;const G=(O=t.value)==null?void 0:O.id;if(!G)return[];const H=tC(e.systems,G);return e.systems.filter(V=>V.id!==G&&!H.has(V.id))}),L=Le(()=>[{key:"color",label:U("modifiers.inheritColor")},{key:"scale",label:U("modifiers.inheritScale")},{key:"rotation",label:U("modifiers.inheritRotation")},{key:"life",label:U("modifiers.inheritLife")}]),R=Re(null),X=Le(()=>{var O;const G=R.value,H=(O=t.value)==null?void 0:O.config.events;return!G||!Array.isArray(H)?null:H.find(V=>V.id===G.ruleId)||null});function z(G){return Array.isArray(G.inherit)||(G.inherit=[]),G.inherit}function K(G){const H=z(G);return H.length?H.length===L.value.length?U("modifiers.inheritAll"):L.value.filter(O=>H.includes(O.key)).map(O=>O.label).join("、"):U("modifiers.inheritNone")}function Z(G,H){return z(G).includes(H)}function ae(G,H){const O=z(G),V=O.indexOf(H);V>=0?O.splice(V,1):O.push(H)}function ce(G){z(G).splice(0)}function ve(G){z(G).splice(0,z(G).length,...L.value.map(H=>H.key))}function we(G,H){var he;if(((he=R.value)==null?void 0:he.ruleId)===G.id){R.value=null;return}const O=H.currentTarget;if(!O)return;const V=O.getBoundingClientRect(),W=Math.max(168,V.width),ee=212,be=Math.min(Math.max(8,V.left),Math.max(8,window.innerWidth-W-8));let ye=V.bottom+4;ye+ee>window.innerHeight-8&&(ye=Math.max(8,V.top-ee-4)),R.value={ruleId:G.id,left:be,top:ye,width:W}}function re(){R.value=null}function Ee(){re()}function q(G){G.key==="Escape"&&re()}Ti(()=>{document.addEventListener("pointerdown",re),window.addEventListener("scroll",Ee,!0),window.addEventListener("resize",Ee),window.addEventListener("keydown",q)}),Ar(()=>{document.removeEventListener("pointerdown",re),window.removeEventListener("scroll",Ee,!0),window.removeEventListener("resize",Ee),window.removeEventListener("keydown",q)});function J(){var O;const G=(O=t.value)==null?void 0:O.config;if(!G)return;Array.isArray(G.events)||(G.events=[]);const H=Math.max(0,...G.events.map(V=>V.id))+1;G.events.push({id:H,event:"birth",targetSystemId:0,probability:1,collisionLimit:1,inherit:[],colorInheritMode:"add"})}function ie(G){var H;(H=t.value)==null||H.config.events.splice(G,1)}function se(G,H){const O=H.target,V=Math.round(Number(O.value));G.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(V)?V:1)),O.value=String(G.collisionLimit)}return(G,H)=>(Q(),te(_e,null,[w("div",F7,[w("div",{class:"group-head",onClick:H[1]||(H[1]=O=>_(C)("mods"))},[w("span",L7,F(_(S).mods?"▸":"▾"),1),w("span",null,F(G.$t("modifiers.title")),1),w("button",{class:"group-reset",title:G.$t("modifiers.reset"),onClick:H[0]||(H[0]=We(O=>_(I)("mods"),["stop"]))},F(G.$t("common.reset")),9,D7)]),pe(w("div",O7,[w("div",N7,[Ce(Ue,{label:G.$t("modifiers.damping"),min:0,max:2,step:.05,modelValue:_(t).config.damping,"onUpdate:modelValue":H[2]||(H[2]=O=>_(t).config.damping=O)},null,8,["label","modelValue"])]),w("div",$7,[w("label",B7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[3]||(H[3]=O=>_(t).config.noise=O)},null,512),[[vt,_(t).config.noise]]),H[74]||(H[74]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableNoise")),1)]),_(t).config.noise?(Q(),te("div",U7,[Ce(Ue,{label:G.$t("modifiers.strength"),min:0,max:100,step:1,modelValue:_(t).config.noiseAmt,"onUpdate:modelValue":H[4]||(H[4]=O=>_(t).config.noiseAmt=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.noiseRange"),min:0,max:500,step:1,modelValue:_(t).config.noiseRange,"onUpdate:modelValue":H[5]||(H[5]=O=>_(t).config.noiseRange=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.noiseSpeed"),min:0,max:10,step:.1,modelValue:_(t).config.noiseSpeed,"onUpdate:modelValue":H[6]||(H[6]=O=>_(t).config.noiseSpeed=O)},null,8,["label","modelValue"]),w("div",V7,F(G.$t("modifiers.noiseHint")),1)])):xe("",!0)]),w("div",X7,[w("label",Y7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[7]||(H[7]=O=>_(t).config.useGravity=O)},null,512),[[vt,_(t).config.useGravity]]),H[75]||(H[75]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableGravity")),1)]),_(t).config.useGravity?(Q(),te("div",z7,[w("div",j7,[w("button",{class:Pe(["axis-mode",{on:_(t).config.gravityMode==="fixed"}]),onClick:H[8]||(H[8]=O=>_(t).config.gravityMode="fixed")},F(G.$t("common.fixed")),3),w("button",{class:Pe(["axis-mode",{on:_(t).config.gravityMode==="random"}]),onClick:H[9]||(H[9]=O=>_(t).config.gravityMode="random")},F(G.$t("common.random")),3)]),_(t).config.gravityMode==="fixed"?(Q(),kt(Ue,{key:0,label:G.$t("modifiers.gravityStrength"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.gravityMin,"onUpdate:modelValue":H[10]||(H[10]=O=>_(t).config.gravityMin=O)},null,8,["label","modelValue"])):(Q(),te(_e,{key:1},[Ce(Ue,{label:G.$t("modifiers.strengthMin"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.gravityMin,"onUpdate:modelValue":H[11]||(H[11]=O=>_(t).config.gravityMin=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.strengthMax"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.gravityMax,"onUpdate:modelValue":H[12]||(H[12]=O=>_(t).config.gravityMax=O)},null,8,["label","modelValue"])],64)),Ce(Ue,{label:G.$t("modifiers.direction"),min:-360,max:360,step:1,modelValue:_(t).config.gravityDirection,"onUpdate:modelValue":H[13]||(H[13]=O=>_(t).config.gravityDirection=O)},null,8,["label","modelValue"]),w("div",H7,[w("span",null,F(G.$t("modifiers.gravityOverLife")),1),w("span",null,F(G.$t("modifiers.axisStrength")),1)]),Ce(Ts,{modelValue:_(t).config.gravityCurve,"onUpdate:modelValue":H[14]||(H[14]=O=>_(t).config.gravityCurve=O),"default-value":_(j)},null,8,["modelValue","default-value"]),w("div",G7,[H[76]||(H[76]=w("span",null,"0",-1)),w("span",null,F(G.$t("attributes.lifeTo")),1),H[77]||(H[77]=w("span",null,"1",-1))]),w("div",W7,F(G.$t("modifiers.directionHint")),1)])):xe("",!0)]),w("div",q7,[w("label",K7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[15]||(H[15]=O=>_(t).config.wind=O)},null,512),[[vt,_(t).config.wind]]),H[78]||(H[78]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableWind")),1)]),_(t).config.wind?(Q(),te("div",J7,[w("div",Z7,[w("button",{class:Pe(["axis-mode",{on:_(t).config.windMode==="fixed"}]),onClick:H[16]||(H[16]=O=>_(t).config.windMode="fixed")},F(G.$t("common.fixed")),3),w("button",{class:Pe(["axis-mode",{on:_(t).config.windMode==="random"}]),onClick:H[17]||(H[17]=O=>_(t).config.windMode="random")},F(G.$t("common.random")),3)]),_(t).config.windMode==="fixed"?(Q(),kt(Ue,{key:0,label:G.$t("modifiers.windStrength"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.windMin,"onUpdate:modelValue":H[18]||(H[18]=O=>_(t).config.windMin=O)},null,8,["label","modelValue"])):(Q(),te(_e,{key:1},[Ce(Ue,{label:G.$t("modifiers.strengthMin"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.windMin,"onUpdate:modelValue":H[19]||(H[19]=O=>_(t).config.windMin=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.strengthMax"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.windMax,"onUpdate:modelValue":H[20]||(H[20]=O=>_(t).config.windMax=O)},null,8,["label","modelValue"])],64)),Ce(Ue,{label:G.$t("modifiers.direction"),min:-360,max:360,step:1,modelValue:_(t).config.windDirection,"onUpdate:modelValue":H[21]||(H[21]=O=>_(t).config.windDirection=O)},null,8,["label","modelValue"]),w("div",Q7,[w("span",null,F(G.$t("modifiers.windOverLife")),1),w("span",null,F(G.$t("modifiers.axisStrength")),1)]),Ce(Ts,{modelValue:_(t).config.windCurve,"onUpdate:modelValue":H[22]||(H[22]=O=>_(t).config.windCurve=O),"default-value":_(j)},null,8,["modelValue","default-value"]),w("div",e9,[H[79]||(H[79]=w("span",null,"0",-1)),w("span",null,F(G.$t("attributes.lifeTo")),1),H[80]||(H[80]=w("span",null,"1",-1))]),w("div",t9,F(G.$t("modifiers.directionHint")),1)])):xe("",!0)]),w("div",n9,[w("label",i9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[23]||(H[23]=O=>_(t).config.forceField=O)},null,512),[[vt,_(t).config.forceField]]),H[81]||(H[81]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableForceField")),1)]),_(t).config.forceField?(Q(),te("div",s9,[Ce(Ue,{label:G.$t("modifiers.centerX"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.forceCenterX,"onUpdate:modelValue":H[24]||(H[24]=O=>_(t).config.forceCenterX=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.centerY"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.forceCenterY,"onUpdate:modelValue":H[25]||(H[25]=O=>_(t).config.forceCenterY=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceStrength"),min:-300,max:300,step:1,modelValue:_(t).config.forceStrength,"onUpdate:modelValue":H[26]||(H[26]=O=>_(t).config.forceStrength=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceRadius"),min:1,max:2e3,step:1,modelValue:_(t).config.forceRadius,"onUpdate:modelValue":H[27]||(H[27]=O=>_(t).config.forceRadius=O)},null,8,["label","modelValue"]),w("label",r9,[w("span",null,F(G.$t("modifiers.falloffMode")),1),pe(w("select",{"onUpdate:modelValue":H[28]||(H[28]=O=>_(t).config.forceFalloff=O),class:"inp"},[w("option",o9,F(G.$t("modifiers.constant")),1),w("option",a9,F(G.$t("modifiers.linearFalloff")),1),w("option",l9,F(G.$t("modifiers.inverseFalloff")),1)],512),[[_t,_(t).config.forceFalloff]])]),w("div",c9,F(G.$t("modifiers.forceHint")),1),w("label",d9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[29]||(H[29]=O=>_(t).config.showForceFieldShape=O)},null,512),[[vt,_(t).config.showForceFieldShape]]),H[82]||(H[82]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.showShape")),1)])])):xe("",!0)]),w("div",u9,[w("label",h9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[30]||(H[30]=O=>_(t).config.vortex=O)},null,512),[[vt,_(t).config.vortex]]),H[83]||(H[83]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableVortex")),1)]),_(t).config.vortex?(Q(),te("div",f9,[Ce(Ue,{label:G.$t("modifiers.centerX"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.vortexCenterX,"onUpdate:modelValue":H[31]||(H[31]=O=>_(t).config.vortexCenterX=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.centerY"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.vortexCenterY,"onUpdate:modelValue":H[32]||(H[32]=O=>_(t).config.vortexCenterY=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceStrength"),min:-300,max:300,step:1,modelValue:_(t).config.vortexStrength,"onUpdate:modelValue":H[33]||(H[33]=O=>_(t).config.vortexStrength=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceRadius"),min:1,max:2e3,step:1,modelValue:_(t).config.vortexRadius,"onUpdate:modelValue":H[34]||(H[34]=O=>_(t).config.vortexRadius=O)},null,8,["label","modelValue"]),w("label",p9,[w("span",null,F(G.$t("modifiers.falloffMode")),1),pe(w("select",{"onUpdate:modelValue":H[35]||(H[35]=O=>_(t).config.vortexFalloff=O),class:"inp"},[w("option",m9,F(G.$t("modifiers.constant")),1),w("option",g9,F(G.$t("modifiers.linearFalloff")),1),w("option",v9,F(G.$t("modifiers.inverseFalloff")),1)],512),[[_t,_(t).config.vortexFalloff]])]),w("div",b9,F(G.$t("modifiers.vortexHint")),1),w("label",y9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[36]||(H[36]=O=>_(t).config.showVortexShape=O)},null,512),[[vt,_(t).config.showVortexShape]]),H[84]||(H[84]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.showShape")),1)])])):xe("",!0)]),w("div",x9,[w("label",w9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[37]||(H[37]=O=>_(t).config.attraction=O)},null,512),[[vt,_(t).config.attraction]]),H[85]||(H[85]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableAttraction")),1)]),_(t).config.attraction?(Q(),te("div",S9,[Ce(Ue,{label:G.$t("modifiers.attractionX"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.attractionCenterX,"onUpdate:modelValue":H[38]||(H[38]=O=>_(t).config.attractionCenterX=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.attractionY"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.attractionCenterY,"onUpdate:modelValue":H[39]||(H[39]=O=>_(t).config.attractionCenterY=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.attractionRadius"),min:0,max:2e3,step:1,modelValue:_(t).config.attractionRadius,"onUpdate:modelValue":H[40]||(H[40]=O=>_(t).config.attractionRadius=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.attractionDuration"),min:.05,max:30,step:.05,modelValue:_(t).config.attractionDuration,"onUpdate:modelValue":H[41]||(H[41]=O=>_(t).config.attractionDuration=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.delay"),min:0,max:30,step:.05,modelValue:_(t).config.attractionDelay,"onUpdate:modelValue":H[42]||(H[42]=O=>_(t).config.attractionDelay=O)},null,8,["label","modelValue"]),w("label",C9,[w("span",null,F(G.$t("modifiers.delayMode")),1),pe(w("select",{"onUpdate:modelValue":H[43]||(H[43]=O=>_(t).config.attractionDelayMode=O),class:"inp"},[w("option",A9,F(G.$t("modifiers.globalTime")),1),w("option",T9,F(G.$t("modifiers.particleLife")),1)],512),[[_t,_(t).config.attractionDelayMode]])]),w("label",E9,[w("span",null,F(G.$t("modifiers.attractionPath")),1),pe(w("select",{"onUpdate:modelValue":H[44]||(H[44]=O=>_(t).config.attractionPath=O),class:"inp"},[w("option",_9,F(G.$t("modifiers.straight")),1),w("option",M9,F(G.$t("common.curve")),1)],512),[[_t,_(t).config.attractionPath]])]),w("div",P9,F(G.$t("modifiers.attractionHint")),1),w("label",k9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[45]||(H[45]=O=>_(t).config.showAttractionShape=O)},null,512),[[vt,_(t).config.showAttractionShape]]),H[86]||(H[86]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.showShape")),1)])])):xe("",!0)]),w("div",I9,[w("label",R9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[46]||(H[46]=O=>_(t).config.trail=O)},null,512),[[vt,_(t).config.trail]]),H[87]||(H[87]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableTrail")),1)]),_(t).config.trail?(Q(),te("div",F9,[w("div",L9,[w("div",D9,F(G.$t("modifiers.trailImages")),1),w("button",{class:"image-add",title:G.$t("modifiers.addTrailImage"),onClick:H[47]||(H[47]=(...O)=>_(s)&&_(s)(...O))},"+",8,O9)]),(Q(!0),te(_e,null,Mt(_(t).config.trailResources,O=>(Q(),kt(iE,{key:O.id,resource:O,"resource-count":_(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:_(r),onReset:_(d),onRemove:_(u),onUpdateWeight:_(h),onToggleLock:_(f)},{default:Ju(()=>[H[90]||(H[90]=w("div",{class:"resource-divider"},null,-1)),Ce(Ue,{label:G.$t("modifiers.trailRotation"),min:-360,max:360,step:1,"model-value":O.rotation,"onUpdate:modelValue":V=>_(c)(O.id,V)},null,8,["label","model-value","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.trailBones"),min:2,max:16,step:1,"model-value":O.boneCount,"onUpdate:modelValue":V=>_(a)(O.id,V)},null,8,["label","model-value","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.trailRatio"),min:0,max:100,step:1,modelValue:O.trailRatio,"onUpdate:modelValue":V=>O.trailRatio=V},null,8,["label","modelValue","onUpdate:modelValue"]),w("label",N9,[w("span",null,F(G.$t("modifiers.trailLength")),1),pe(w("select",{"onUpdate:modelValue":V=>O.lengthMode=V,class:"inp"},[w("option",B9,F(G.$t("common.fixed")),1),w("option",U9,F(G.$t("modifiers.randomRange")),1)],8,$9),[[_t,O.lengthMode]])]),O.lengthMode==="fixed"?(Q(),kt(Ue,{key:0,label:G.$t("modifiers.lengthRatio"),min:0,max:500,step:1,modelValue:O.length,"onUpdate:modelValue":V=>O.length=V},null,8,["label","modelValue","onUpdate:modelValue"])):(Q(),te(_e,{key:1},[Ce(Ue,{label:G.$t("modifiers.lengthMin"),min:0,max:500,step:1,modelValue:O.lengthMin,"onUpdate:modelValue":V=>O.lengthMin=V},null,8,["label","modelValue","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.lengthMax"),min:0,max:500,step:1,modelValue:O.lengthMax,"onUpdate:modelValue":V=>O.lengthMax=V},null,8,["label","modelValue","onUpdate:modelValue"])],64)),w("label",V9,[w("span",null,F(G.$t("modifiers.trailWidth")),1),pe(w("select",{"onUpdate:modelValue":V=>O.widthSizeMode=V,class:"inp"},[w("option",Y9,F(G.$t("common.fixed")),1),w("option",z9,F(G.$t("modifiers.randomRange")),1)],8,X9),[[_t,O.widthSizeMode]])]),O.widthSizeMode==="fixed"?(Q(),kt(Ue,{key:2,label:G.$t("modifiers.widthRatio"),min:0,max:500,step:1,modelValue:O.width,"onUpdate:modelValue":V=>O.width=V},null,8,["label","modelValue","onUpdate:modelValue"])):(Q(),te(_e,{key:3},[Ce(Ue,{label:G.$t("modifiers.widthMin"),min:0,max:500,step:1,modelValue:O.widthMin,"onUpdate:modelValue":V=>O.widthMin=V},null,8,["label","modelValue","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.widthMax"),min:0,max:500,step:1,modelValue:O.widthMax,"onUpdate:modelValue":V=>O.widthMax=V},null,8,["label","modelValue","onUpdate:modelValue"])],64)),w("label",j9,[w("span",null,F(G.$t("modifiers.widthScale")),1),pe(w("select",{"onUpdate:modelValue":V=>O.widthMode=V,class:"inp"},[w("option",G9,F(G.$t("modifiers.followParticle")),1),w("option",W9,F(G.$t("common.fixed")),1)],8,H9),[[_t,O.widthMode]])]),w("label",q9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":V=>O.lifeLengthEnabled=V},null,8,K9),[[vt,O.lifeLengthEnabled]]),H[88]||(H[88]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.lifeLengthCurve")),1)]),O.lifeLengthEnabled?(Q(),kt(Ts,{key:4,modelValue:O.lifeLengthCurve,"onUpdate:modelValue":V=>O.lifeLengthCurve=V,"default-value":_(j)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),w("label",J9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":V=>O.shapeEnabled=V},null,8,Z9),[[vt,O.shapeEnabled]]),H[89]||(H[89]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.shapeCurve")),1)]),O.shapeEnabled?(Q(),kt(Ts,{key:5,modelValue:O.shapeCurve,"onUpdate:modelValue":V=>O.shapeCurve=V,"default-value":_(Y)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),w("div",Q9,[w("span",null,F(G.$t("modifiers.colorMode")),1),w("div",eK,[w("button",{class:Pe(["axis-mode",{on:O.colorMode==="particle"}]),onClick:V=>O.colorMode="particle"},F(G.$t("modifiers.followParticle")),11,tK),w("button",{class:Pe(["axis-mode",{on:O.colorMode==="fixed"}]),onClick:V=>O.colorMode="fixed"},F(G.$t("common.fixed")),11,nK),w("button",{class:Pe(["axis-mode",{on:O.colorMode==="curve"}]),onClick:V=>O.colorMode="curve"},F(G.$t("common.curve")),11,iK)])]),w("label",sK,[w("span",null,F(G.$t("modifiers.blendMode")),1),pe(w("select",{"onUpdate:modelValue":V=>O.blend=V,class:"inp"},[w("option",oK,F(G.$t("appearance.normal")),1),w("option",aK,F(G.$t("appearance.add")),1),w("option",lK,F(G.$t("appearance.multiply")),1),w("option",cK,F(G.$t("appearance.screen")),1)],8,rK),[[_t,O.blend]])]),O.colorMode==="fixed"?(Q(),te("label",dK,[w("span",null,F(G.$t("modifiers.fixedColor")),1),pe(w("input",{class:"colr",type:"color","onUpdate:modelValue":V=>O.color=V},null,8,uK),[[Je,O.color]]),w("input",{class:"hex-input",value:O.color,onChange:V=>_(p)(O,V),onKeydown:es(We(V=>_(m)(O,V),["prevent"]),["enter"])},null,40,hK)])):O.colorMode==="curve"?(Q(),kt(nE,{key:7,modelValue:O.colorGradient,"onUpdate:modelValue":V=>O.colorGradient=V},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),w("div",fK,[w("span",null,F(G.$t("modifiers.alphaMode")),1),w("div",pK,[w("button",{class:Pe(["axis-mode",{on:O.alphaMode==="particle"}]),onClick:V=>O.alphaMode="particle"},F(G.$t("modifiers.followParticle")),11,mK),w("button",{class:Pe(["axis-mode",{on:O.alphaMode==="fixed"}]),onClick:V=>O.alphaMode="fixed"},F(G.$t("common.fixed")),11,gK),w("button",{class:Pe(["axis-mode",{on:O.alphaMode==="curve"}]),onClick:V=>O.alphaMode="curve"},F(G.$t("common.curve")),11,vK)])]),O.alphaMode==="fixed"?(Q(),kt(Ue,{key:8,label:G.$t("modifiers.opacity"),min:0,max:1,step:.01,modelValue:O.alpha,"onUpdate:modelValue":V=>O.alpha=V},null,8,["label","modelValue","onUpdate:modelValue"])):xe("",!0),O.alphaMode==="curve"?(Q(),kt(Ts,{key:9,modelValue:O.alphaCurve,"onUpdate:modelValue":V=>O.alphaCurve=V,"default-value":_(B)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),w("input",{ref_key:"trailTextureFileInput",ref:n,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:H[48]||(H[48]=(...O)=>_(l)&&_(l)(...O))},null,544),w("div",bK,[Ce(Ue,{label:G.$t("modifiers.gridRows"),min:2,max:16,step:1,"model-value":_(t).config.trailGridRows,"onUpdate:modelValue":H[49]||(H[49]=O=>_(o)("trailGridRows",O))},null,8,["label","model-value"]),Ce(Ue,{label:G.$t("modifiers.gridCols"),min:2,max:32,step:1,"model-value":_(t).config.trailGridCols,"onUpdate:modelValue":H[50]||(H[50]=O=>_(o)("trailGridCols",O))},null,8,["label","model-value"])]),w("div",yK,F(G.$t("modifiers.trailHint")),1)])):xe("",!0)]),w("div",xK,[w("label",wK,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[51]||(H[51]=O=>_(t).config.emitterFollow=O),disabled:_(t).config.streamBehavior==="loop"},null,8,SK),[[vt,_(t).config.emitterFollow]]),H[91]||(H[91]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableFollow")),1)]),_(t).config.emitterFollow&&_(t).config.streamBehavior!=="loop"?(Q(),te("div",CK,[w("label",AK,[w("span",null,F(G.$t("modifiers.followMode")),1),w("select",{value:_(t).config.emitterFollowMode,class:"inp",onChange:H[52]||(H[52]=O=>_(k)(O,_(t).config))},[w("option",EK,F(G.$t("modifiers.noFollow")),1),w("option",_K,F(G.$t("modifiers.followPath")),1),_(g)||_(t).config.emitterFollowMode==="bone"?(Q(),te("option",MK,F(G.$t("modifiers.selectedBone")),1)):xe("",!0)],40,TK)]),_(t).config.emitterFollowMode==="path"?(Q(),te(_e,{key:0},[w("label",PK,[w("span",null,F(G.$t("modifiers.followPath")),1),pe(w("select",{"onUpdate:modelValue":H[53]||(H[53]=O=>_(t).config.emitterFollowPathId=O),class:"inp"},[w("option",kK,F(G.$t("modifiers.noFollow")),1),(Q(!0),te(_e,null,Mt(_(e).paths,O=>(Q(),te("option",{key:O.id,value:O.id},F(O.name),9,IK))),128))],512),[[_t,_(t).config.emitterFollowPathId,void 0,{number:!0}]])]),w("label",RK,[w("span",null,F(G.$t("modifiers.emitterAngleMode")),1),pe(w("select",{"onUpdate:modelValue":H[54]||(H[54]=O=>_(t).config.emitterAngleMode=O),class:"inp"},[w("option",FK,F(G.$t("modifiers.fixedAngle")),1),w("option",LK,F(G.$t("modifiers.followMoveDirection")),1)],512),[[_t,_(t).config.emitterAngleMode]])]),w("div",DK,[w("span",null,F(G.$t("modifiers.moveProgressCurve")),1)]),Ce(Ts,{modelValue:_(t).config.emitterFollowCurve,"onUpdate:modelValue":H[55]||(H[55]=O=>_(t).config.emitterFollowCurve=O),"default-value":_($)},null,8,["modelValue","default-value"]),w("div",OK,[w("label",NK,[w("span",null,F(G.$t("modifiers.moveDuration")),1),pe(w("input",{"onUpdate:modelValue":H[56]||(H[56]=O=>_(t).config.emitterFollowDuration=O),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(t).config.emitterFollowDuration,void 0,{number:!0}]])]),w("label",$K,[w("span",null,F(G.$t("modifiers.followSpace")),1),pe(w("select",{"onUpdate:modelValue":H[57]||(H[57]=O=>_(t).config.emitterFollowSpace=O),class:"inp"},[w("option",BK,F(G.$t("modifiers.localSpace")),1),w("option",UK,F(G.$t("modifiers.worldSpace")),1)],512),[[_t,_(t).config.emitterFollowSpace]])])]),w("label",VK,[w("span",null,F(G.$t("modifiers.moveDirection")),1),pe(w("select",{"onUpdate:modelValue":H[58]||(H[58]=O=>_(t).config.emitterFollowDirection=O),class:"inp"},[w("option",XK,F(G.$t("modifiers.forward")),1),w("option",YK,F(G.$t("modifiers.reverse")),1)],512),[[_t,_(t).config.emitterFollowDirection]])]),Ce(Ue,{label:G.$t("modifiers.followOffset"),min:0,max:1,step:.01,modelValue:_(t).config.emitterFollowOffset,"onUpdate:modelValue":H[59]||(H[59]=O=>_(t).config.emitterFollowOffset=O)},null,8,["label","modelValue"]),w("div",zK,F(G.$t("modifiers.followSpaceHint")),1)],64)):_(t).config.emitterFollowMode==="bone"?(Q(),te(_e,{key:1},[_(v)?(Q(),te("div",jK,[Ct(F(G.$t("modifiers.followTarget")),1),w("strong",null,F(_(v).spine.name)+" / "+F(_(v).boneName),1)])):(Q(),te("div",HK,F(G.$t("modifiers.noValidBone")),1)),_(g)&&(!_(v)||_(g).spine.id!==_(v).spine.id||_(g).boneName!==_(v).boneName)?(Q(),te("button",{key:2,class:"bone-follow-rebind",onClick:H[60]||(H[60]=O=>_(P)(_(t).config))},F(_(v)?G.$t("modifiers.rebind"):G.$t("modifiers.bind"))+F(G.$t("modifiers.selectedBoneLabel"))+F(_(g).spine.name)+" / "+F(_(g).boneName),1)):xe("",!0),_(v)?(Q(),te(_e,{key:3},[w("label",GK,[w("span",null,F(G.$t("modifiers.followSpace")),1),pe(w("select",{"onUpdate:modelValue":H[61]||(H[61]=O=>_(t).config.emitterFollowSpace=O),class:"inp"},[w("option",WK,F(G.$t("modifiers.boneLocalSpace")),1),w("option",qK,F(G.$t("modifiers.boneWorldSpace")),1)],512),[[_t,_(t).config.emitterFollowSpace]])]),w("div",KK,[w("label",JK,[w("span",null,F(G.$t("modifiers.offsetX")),1),pe(w("input",{"onUpdate:modelValue":H[62]||(H[62]=O=>_(t).config.emitterFollowBoneOffsetX=O),type:"number",step:"1",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),w("label",ZK,[w("span",null,F(G.$t("modifiers.offsetY")),1),pe(w("input",{"onUpdate:modelValue":H[63]||(H[63]=O=>_(t).config.emitterFollowBoneOffsetY=O),type:"number",step:"1",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),w("div",QK,[w("label",eJ,[w("span",null,F(G.$t("modifiers.rotationOffset")),1),pe(w("input",{"onUpdate:modelValue":H[64]||(H[64]=O=>_(t).config.emitterFollowBoneRotation=O),type:"number",step:"1",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),w("label",tJ,[w("span",null,F(G.$t("modifiers.scaleOffsetX")),1),pe(w("input",{"onUpdate:modelValue":H[65]||(H[65]=O=>_(t).config.emitterFollowBoneScaleX=O),type:"number",step:"0.05",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),w("label",nJ,[w("span",null,F(G.$t("modifiers.scaleOffsetY")),1),pe(w("input",{"onUpdate:modelValue":H[66]||(H[66]=O=>_(t).config.emitterFollowBoneScaleY=O),type:"number",step:"0.05",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),w("div",iJ,F(G.$t("modifiers.boneFollowHint")),1)],64)):xe("",!0)],64)):xe("",!0)])):xe("",!0)]),w("div",sJ,[w("label",rJ,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[67]||(H[67]=O=>_(t).config.collision=O)},null,512),[[vt,_(t).config.collision]]),H[92]||(H[92]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableCollision")),1)]),_(t).config.collision?(Q(),te("div",oJ,[w("div",aJ,F(G.$t("modifiers.collisionObjects")),1),w("div",lJ,[(Q(!0),te(_e,null,Mt(_(b),O=>(Q(),te("span",{key:O.id,class:Pe(["collision-filter-tag",{disabled:!O.enabled}]),title:O.enabled?O.name:G.$t("modifiers.colliderDisabled",{name:O.name})},[w("span",null,F(O.name),1),w("button",{type:"button","aria-label":G.$t("modifiers.clearCollider",{name:O.name}),onClick:V=>_(E)(O.id)},"×",8,dJ)],10,cJ))),128)),w("button",{type:"button",class:Pe(["collision-filter-add",{active:_(y)}]),disabled:_(x).length===0,title:_(x).length?G.$t("modifiers.addCollider"):G.$t("modifiers.noAvailableColliders"),onClick:H[68]||(H[68]=O=>y.value=!_(y))},"+",10,uJ)]),_(b).length===0?(Q(),te("div",hJ,F(G.$t("modifiers.noCollidersSelected")),1)):xe("",!0),_(y)&&_(x).length?(Q(),te("div",fJ,[(Q(!0),te(_e,null,Mt(_(x),O=>(Q(),te("button",{key:O.id,type:"button",onClick:V=>_(T)(O.id)},[w("span",null,F(O.name),1),w("small",null,F(O.enabled?G.$t("modifiers.available"):G.$t("modifiers.disabled")),1)],8,pJ))),128))])):xe("",!0),w("div",mJ,F(G.$t("modifiers.collisionHint")),1)])):xe("",!0)]),w("div",gJ,[w("label",vJ,[pe(w("input",{"onUpdate:modelValue":H[69]||(H[69]=O=>_(t).config.eventEnabled=O),type:"checkbox"},null,512),[[vt,_(t).config.eventEnabled]]),H[93]||(H[93]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableSubEmitter")),1)]),_(t).config.eventEnabled?(Q(),te("div",bJ,[(Q(!0),te(_e,null,Mt(_(t).config.events,(O,V)=>(Q(),te("div",{key:O.id,class:"event-card"},[w("div",yJ,[pe(w("select",{"onUpdate:modelValue":W=>O.event=W,class:"inp event-select",title:G.$t("modifiers.triggerTiming")},[w("option",wJ,F(G.$t("modifiers.birth")),1),w("option",SJ,F(G.$t("modifiers.death")),1),w("option",CJ,F(G.$t("modifiers.collision")),1)],8,xJ),[[_t,O.event]]),pe(w("select",{"onUpdate:modelValue":W=>O.targetSystemId=W,class:"inp event-target",title:G.$t("modifiers.chooseTarget")},[w("option",TJ,F(G.$t("modifiers.noTarget")),1),(Q(!0),te(_e,null,Mt(D.value,W=>(Q(),te("option",{key:W.id,value:W.id},F(W.config.name||`ParticleSystem${W.id}`),9,EJ))),128))],8,AJ),[[_t,O.targetSystemId,void 0,{number:!0}]]),w("button",{type:"button",class:"event-remove",title:G.$t("modifiers.deleteSubEmitter"),onClick:W=>ie(V)},"✕",8,_J)]),w("label",MJ,[w("span",null,F(G.$t("modifiers.probability")),1),pe(w("input",{"onUpdate:modelValue":W=>O.probability=W,type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,8,PJ),[[Je,O.probability,void 0,{number:!0}]])]),O.event==="collision"?(Q(),te("label",kJ,[w("span",null,F(G.$t("modifiers.collisionLimit")),1),w("input",{value:O.collisionLimit??1,type:"number",min:"1",max:"4",step:"1",class:"inp",onInput:W=>se(O,W)},null,40,IJ)])):xe("",!0),w("div",RJ,[w("span",null,F(G.$t("modifiers.inherit")),1),w("button",{type:"button",class:"inherit-trigger",onPointerdown:H[70]||(H[70]=We(()=>{},["stop"])),onClick:We(W=>we(O,W),["stop"])},[w("span",LJ,F(K(O)),1),H[94]||(H[94]=w("i",null,"⌄",-1))],40,FJ)]),Z(O,"color")?(Q(),te("label",DJ,[w("span",null,F(G.$t("modifiers.colorInheritMode")),1),pe(w("select",{"onUpdate:modelValue":W=>O.colorInheritMode=W,class:"inp"},[w("option",NJ,F(G.$t("modifiers.add")),1),w("option",$J,F(G.$t("modifiers.replace")),1)],8,OJ),[[_t,O.colorInheritMode]])])):xe("",!0)]))),128)),w("button",{type:"button",class:"event-add",onClick:J},F(G.$t("modifiers.addSubEmitter")),1)])):xe("",!0)])],512),[[Xt,_(M)("mods")]])]),(Q(),kt(Qu,{to:"body"},[R.value&&X.value?(Q(),te("div",{key:0,class:"inherit-menu",style:zt({left:`${R.value.left}px`,top:`${R.value.top}px`,width:`${R.value.width}px`}),onPointerdown:H[73]||(H[73]=We(()=>{},["stop"]))},[w("button",{type:"button",class:"inherit-option",onClick:H[71]||(H[71]=O=>ce(X.value))},[w("span",BJ,F(z(X.value).length===0?"✓":""),1),Ct(F(G.$t("modifiers.inheritNone")),1)]),w("button",{type:"button",class:"inherit-option",onClick:H[72]||(H[72]=O=>ve(X.value))},[w("span",UJ,F(z(X.value).length===4?"✓":""),1),Ct(F(G.$t("modifiers.inheritAll")),1)]),H[95]||(H[95]=w("div",{class:"inherit-divider"},null,-1)),(Q(!0),te(_e,null,Mt(L.value,O=>(Q(),te("button",{key:O.key,type:"button",class:"inherit-option",onClick:V=>ae(X.value,O.key)},[w("span",XJ,F(Z(X.value,O.key)?"✓":""),1),Ct(F(O.label),1)],8,VJ))),128))],36)):xe("",!0)]))],64))}}),Qx=dn(YJ,[["__scopeId","data-v-54af9ba1"]]),zJ={class:"spine-export-actions"},jJ=["disabled","title"],HJ=["disabled","title"],GJ=["disabled","title"],WJ={key:0},qJ=["href","title"],KJ=["title"],JJ=["href"],ZJ=Zt({__name:"ParticleExportFooter",setup(i){const{exportSettings:e,exportBusy:t,exportTarget:n,exportMessage:s,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:d,connectorDisabledReason:u,connectorButtonTitle:h,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=Tr();return(v,y)=>(Q(),te(_e,null,[w("div",zJ,[w("button",{type:"button",class:"export-spine-json",disabled:_(t),title:_(t)?v.$t("export.baking"):v.$t("export.exportJsonTitle",{version:_(e).spineVersion}),onClick:y[0]||(y[0]=(...b)=>_(p)&&_(p)(...b))},F(_(t)&&_(n)==="json"?v.$t("export.preparing"):v.$t("export.exportJson")),9,jJ),w("button",{type:"button",class:"export-spine-images",disabled:_(t),title:v.$t("export.exportImagesTitle"),onClick:y[1]||(y[1]=(...b)=>_(g)&&_(g)(...b))},F(_(t)&&_(n)==="images"?v.$t("export.organizingImages"):v.$t("export.exportImages")),9,HJ),w("button",{type:"button",class:"export-spine-project",disabled:_(t)||!_(l),title:_(h),onClick:y[2]||(y[2]=(...b)=>_(m)&&_(m)(...b))},[w("span",null,F(_(t)&&_(n)==="spine"?v.$t("export.generatingProject"):v.$t("export.exportSpine")),1),!_(t)&&_(u)?(Q(),te("small",WJ,F(_(u)),1)):xe("",!0)],8,GJ)]),w("div",{class:Pe(["connector-status",_(c)])},[y[5]||(y[5]=w("span",{class:"connector-dot"},null,-1)),Ct(F(_(a))+" ",1),_(d)?(Q(),te("a",{key:0,href:_(d),target:"_blank",rel:"noopener",title:v.$t("export.authorizeTitle")},F(v.$t("export.authorize")),9,qJ)):xe("",!0),w("button",{type:"button",title:v.$t("export.refreshConnector"),onClick:y[3]||(y[3]=(...b)=>_(f)&&_(f)(...b))},F(v.$t("export.refresh")),9,KJ)],2),_(s)?(Q(),te("div",{key:0,class:Pe(["export-message",{error:_(r)}])},[Ct(F(_(s))+" ",1),_(o)?(Q(),te("a",{key:0,href:_(o),target:"_blank",rel:"noopener",onClick:y[4]||(y[4]=b=>o.value="")},F(v.$t("export.authorize")),9,JJ)):xe("",!0)],2)):xe("",!0)],64))}}),QJ=dn(ZJ,[["__scopeId","data-v-33af5045"]]),eZ={class:"group"},tZ={class:"caret"},nZ=["title"],iZ={class:"group-body export-settings"},sZ={class:"export-field"},rZ={class:"export-field"},oZ={class:"export-field"},aZ={value:"linear"},lZ={value:"bezier"},cZ={class:"export-help"},dZ={key:0,class:"export-help"},uZ={class:"export-fps-row"},hZ={class:"export-field export-fps-field"},fZ={class:"export-checkbox"},pZ={class:"export-help"},mZ={class:"export-switches"},gZ={class:"switch-row export-switch"},vZ={class:"switch-row export-switch"},bZ={class:"switch-row export-switch export-switch-last"},yZ={class:"export-resource-actions"},xZ=Zt({__name:"ExportSettingsSection",setup(i){const{exportSettings:e,collapsed:t,toggle:n,sectionOpen:s,resetModule:r,normalizeExportFps:o,select:a}=Tr();return(c,l)=>(Q(),te("div",eZ,[w("div",{class:"group-head",onClick:l[1]||(l[1]=d=>_(n)("export"))},[w("span",tZ,F(_(t).export?"▸":"▾"),1),w("span",null,F(c.$t("export.title")),1),w("button",{class:"group-reset",title:c.$t("export.reset"),onClick:l[0]||(l[0]=We(d=>_(r)("export"),["stop"]))},F(c.$t("common.reset")),9,nZ)]),pe(w("div",iZ,[w("label",sZ,[w("span",null,F(c.$t("export.imagesPath")),1),pe(w("input",{"onUpdate:modelValue":l[2]||(l[2]=d=>_(e).imagesPath=d),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Je,_(e).imagesPath,void 0,{trim:!0}]])]),w("label",rZ,[w("span",null,F(c.$t("export.spineVersion")),1),pe(w("select",{"onUpdate:modelValue":l[3]||(l[3]=d=>_(e).spineVersion=d),class:"inp export-input"},[...l[11]||(l[11]=[xM('',5)])],512),[[_t,_(e).spineVersion]])]),w("label",oZ,[w("span",null,F(c.$t("export.keyframeCurve")),1),pe(w("select",{"onUpdate:modelValue":l[4]||(l[4]=d=>_(e).keyframeCurve=d),class:"inp export-input"},[w("option",aZ,F(c.$t("export.linear")),1),w("option",lZ,F(c.$t("export.smoothBezier")),1)],512),[[_t,_(e).keyframeCurve]])]),w("div",cZ,F(c.$t("export.bezierHelp")),1),_(e).spineVersion==="3.8"?(Q(),te("div",dZ,F(c.$t("export.spine38Help")),1)):xe("",!0),w("div",uZ,[w("label",hZ,[w("span",null,F(c.$t("export.fps")),1),pe(w("input",{"onUpdate:modelValue":l[5]||(l[5]=d=>_(e).fps=d),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:l[6]||(l[6]=(...d)=>_(o)&&_(o)(...d))},null,544),[[Je,_(e).fps,void 0,{number:!0}]])]),w("label",fZ,[pe(w("input",{"onUpdate:modelValue":l[7]||(l[7]=d=>_(e).omitFps=d),type:"checkbox"},null,512),[[vt,_(e).omitFps]]),Ct(F(c.$t("export.omitFps")),1)])]),w("div",pZ,F(c.$t("export.fpsHelp")),1),w("div",mZ,[w("label",gZ,[pe(w("input",{"onUpdate:modelValue":l[8]||(l[8]=d=>_(e).integerFrameAlignment=d),type:"checkbox"},null,512),[[vt,_(e).integerFrameAlignment]]),l[12]||(l[12]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(c.$t("export.integerFrames")),1)]),w("label",vZ,[pe(w("input",{"onUpdate:modelValue":l[9]||(l[9]=d=>_(e).bonePool=d),type:"checkbox"},null,512),[[vt,_(e).bonePool]]),l[13]||(l[13]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(c.$t("export.bonePool")),1)]),w("label",bZ,[pe(w("input",{"onUpdate:modelValue":l[10]||(l[10]=d=>_(e).excludeEmptyAnimations=d),type:"checkbox"},null,512),[[vt,_(e).excludeEmptyAnimations]]),l[14]||(l[14]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(c.$t("export.excludeEmpty")),1)])]),w("div",yZ,[Ce(QJ)])],512),[[Xt,_(s)("export")]])]))}}),e1=dn(xZ,[["__scopeId","data-v-43ee846c"]]),wZ={class:"panel"},SZ={class:"panel-header"},CZ=["title"],AZ=["data-active-section"],TZ=["data-active-section"],EZ=["data-active-section"],_Z=["data-active-section"],MZ=["data-active-section"],PZ=["data-active-section"],kZ=["data-active-section"],IZ=Zt({__name:"ParticlePanel",setup(i){const{store:e,activeObjectType:t,activeSection:n,sys:s,canUseSection:r}=Tr(),o=Re(null);function a(){n.value=null}const c=Le(()=>{const l=n.value;return!l||!r(l)||l!=="config"&&l!=="scene"&&(t.value!=="particle"||!s.value)?null:l});return Ut(c,async()=>{var l,d;await tl(),(d=(l=o.value)==null?void 0:l.querySelector('[data-active-section="true"]'))==null||d.scrollIntoView({block:"start"})}),(l,d)=>(Q(),te("div",wZ,[w("div",SZ,[w("span",null,F(l.$t("app.title")),1),_(e).settings.floatingMenuEnabled&&_(n)?(Q(),te("button",{key:0,type:"button",class:"panel-collapse",title:l.$t("common.collapse"),onClick:a},F(l.$t("common.collapse")),9,CZ)):xe("",!0)]),w("div",{ref_key:"panelScroll",ref:o,class:"panel-scroll"},[_(e).settings.floatingMenuEnabled?(Q(),te(_e,{key:0},[pe(w("div",{class:"section-detail","data-active-section":c.value==="config"?!0:void 0},[Ce(Hx)],8,AZ),[[Xt,_(n)==="config"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="scene"?!0:void 0},[Ce(Gx)],8,TZ),[[Xt,_(n)==="scene"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="emitMode"||c.value==="shape"?!0:void 0},[Ce(Wx)],8,EZ),[[Xt,c.value==="emitMode"||c.value==="shape"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="attr"?!0:void 0},[Ce(qx)],8,_Z),[[Xt,c.value==="attr"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="look"?!0:void 0},[Ce(Zx)],8,MZ),[[Xt,c.value==="look"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="mods"?!0:void 0},[Ce(Qx)],8,PZ),[[Xt,c.value==="mods"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="export"?!0:void 0},[Ce(e1)],8,kZ),[[Xt,c.value==="export"]])],64)):(Q(),te(_e,{key:1},[Ce(Hx),Ce(Gx),_(t)==="particle"&&_(s)?(Q(),te(_e,{key:0},[Ce(Wx),Ce(qx),Ce(Zx),Ce(Qx),Ce(e1)],64)):xe("",!0)],64))],512)]))}}),RZ=dn(IZ,[["__scopeId","data-v-01c761d3"]]),fa=i=>Math.max(0,Number(i)||0);function FZ(i,e){const t=Math.max(1,e),n=new Map(i.map(y=>[y.id,y])),s=new Set;for(const y of i)if(y.config.eventEnabled)for(const b of y.config.events||[])b.targetSystemId>0&&b.targetSystemId!==y.id&&n.has(b.targetSystemId)&&s.add(b.targetSystemId);const r=new Map;for(const y of i)if(y.config.eventEnabled)for(const b of y.config.events||[]){if(b.targetSystemId<=0||b.targetSystemId===y.id||!n.has(b.targetSystemId))continue;const x=r.get(b.targetSystemId);x?x.push({parent:y,rule:b}):r.set(b.targetSystemId,[{parent:y,rule:b}])}const o=y=>fa(y.delay),a=y=>fa(y.delay),c=y=>{const b=o(y);return y.mode!=="stream"?b:y.streamBehavior==="loop"?b+Ji(y,t).total/t:b+Math.max(1/t,Number(y.duration)||0)},l=y=>{const b=fa(y.lifeMin),x=fa(y.lifeMax);return y.lifeMode==="fixed"?b:Math.min(b,x)},d=y=>{const b=fa(y.lifeMin),x=fa(y.lifeMax);return y.lifeMode==="fixed"?b:Math.max(b,x)},u=new Map,h=new Map,f=new Set,p=new Set,m=y=>{const b=u.get(y.id);if(b!=null)return b;if(f.has(y.id))return o(y.config);f.add(y.id);let x=1/0;for(const{parent:T,rule:E}of r.get(y.id)||[]){const S=s.has(T.id)?m(T)+a(T.config):o(T.config),C=E.event==="death"?l(T.config):0;x=Math.min(x,S+C)}return Number.isFinite(x)||(x=o(y.config)),f.delete(y.id),u.set(y.id,x),x},g=y=>{const b=h.get(y.id);if(b!=null)return b;if(p.has(y.id))return c(y.config);p.add(y.id);let x=-1/0;for(const{parent:T,rule:E}of r.get(y.id)||[]){const S=s.has(T.id)?g(T)+a(T.config):c(T.config),C=E.event==="birth"?0:d(T.config);x=Math.max(x,S+C)}return Number.isFinite(x)||(x=c(y.config)),p.delete(y.id),h.set(y.id,x),x},v=new Map;for(const y of s){const b=n.get(y);if(!b)continue;const x=m(b),T=g(b);v.set(y,{firstTrigger:x,lastTrigger:T,end:Math.max(x,T)+d(b.config)})}return v}const LZ={class:"timeline"},DZ={class:"tl-controls"},OZ=["title"],NZ=["title"],$Z=["title"],BZ=["title"],UZ=["title"],VZ=["title","aria-label"],XZ={class:"tl-ab-loop"},YZ=["title"],zZ={class:"tl-ab-title"},jZ=["title"],HZ=["max","aria-label","onKeydown"],GZ=["title"],WZ=["min","max","aria-label","onKeydown"],qZ={class:"tl-frame"},KZ={class:"tl-legend"},JZ=["disabled","title"],ZZ={class:"tl-animation-menu-title"},QZ=["onClick"],eQ={key:0},tQ={class:"tl-animation-editor"},nQ=["aria-label"],iQ=["title"],sQ={key:0,class:"tl-animation-error"},rQ={class:"tl-animation-actions"},oQ=["disabled"],aQ={key:1,class:"tl-animation-hint"},lQ={class:"tl-anim tl-spine-preview"},cQ=["value","disabled"],dQ={value:""},uQ=["value"],hQ={class:"tl-zoom"},fQ={class:"tl-ticks"},pQ={class:"tl-ticklabel"},mQ={class:"tl-lanes"},gQ=["onPointerdown"],vQ={class:"lane-name"},bQ=["title","onPointerdown"],yQ=["title","onPointerdown"],xQ=["title","onPointerdown"],wQ={class:"lane-name"},SQ={key:0,class:"tl-empty"},CQ=Zt({__name:"Timeline",setup(i){const e=Zo(),{t}=mi(),n=Re(null),s=Re(0);let r=null;const o=Re(null),a=Re(!1),c=Re("animation"),l=Re("");ma(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const V of e.systems)(!V.animation||!e.timeline.animations.includes(V.animation))&&(V.animation=e.timeline.animations[0])});const d=Le(()=>e.systems.find(V=>V.id===e.activeId)||null);function u(){d.value&&(a.value=!a.value,c.value=d.value.animation,l.value="")}function h(V){const W=d.value;W&&(e.setSystemAnimation(W.id,V),c.value=V,l.value="")}function f(){const V=e.addAnimation();c.value=V,l.value=""}function p(){var ee;const V=((ee=d.value)==null?void 0:ee.animation)||e.timeline.animation,W=c.value.trim();if(!W){l.value=t("timeline.animationNameEmpty");return}if(W!==V&&e.timeline.animations.includes(W)){l.value=t("timeline.animationNameDuplicate");return}if(!e.renameAnimation(V,W)){l.value=t("timeline.animationRenameFailed");return}c.value=W,l.value=""}function m(){var ee,be;const V=((ee=d.value)==null?void 0:ee.animation)||e.timeline.animation;if(!e.removeAnimation(V)){l.value=t("timeline.keepOneAnimation");return}const W=((be=d.value)==null?void 0:be.animation)||e.timeline.animation;c.value=W,l.value=""}function g(V){var W;(W=o.value)!=null&&W.contains(V.target)||(a.value=!1)}Ti(()=>{document.addEventListener("pointerdown",g);const V=n.value;V&&(s.value=V.clientWidth,r=new ResizeObserver(([W])=>{s.value=Math.max(1,W.contentRect.width)}),r.observe(V))}),Ar(()=>{document.removeEventListener("pointerdown",g),r==null||r.disconnect(),r=null});const v=Le(()=>Math.max(1,e.timeline.fps||30)),y=Re(Math.max(120,e.timeline.totalFrames)),b=Re({}),x=Re({}),T=Re({}),E=Re({}),S=Re(String(e.timeline.playbackStart)),C=Re(String(e.timeline.playbackEnd));Ut(()=>e.timeline.playbackStart,V=>{S.value=String(V)}),Ut(()=>e.timeline.playbackEnd,V=>{C.value=String(V)});const M=Le(()=>e.timeline.totalFrames);Ut(M,V=>{V>y.value&&(y.value=Math.min(2e3,V))});const k=Le(()=>y.value<=30?t("timeline.zoomIn"):y.value>=300?t("timeline.zoomOut"):t("timeline.zoomFit")),P=Le(()=>e.spines.filter(V=>V.selectedAnimation&&V.animations.some(W=>W.name===V.selectedAnimation&&W.duration>0))),I=Le(()=>(e.activeObjectType==="spine"?e.spines.find(W=>W.id===e.activeObjectId&&W.animations.length):null)||e.spines.find(W=>W.animations.length)||null);function N(V){const W=I.value;W&&(W.selectedAnimation=V.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function $(){e.setPlaybackStart(Number(S.value)),S.value=String(e.timeline.playbackStart)}function j(){e.setPlaybackEnd(Number(C.value)),C.value=String(e.timeline.playbackEnd)}function B(){var W;const V=s.value||((W=n.value)==null?void 0:W.clientWidth)||600;return y.value/V}const Y=Le(()=>{const V=[],W=y.value;let ee=1;y.value<=10?ee=1:y.value<=50?ee=5:y.value<=200?ee=10:y.value<=500?ee=50:ee=100;for(let be=0;be<=W;be+=ee)V.push({f:be,px:be/B()});return V}),U=Le(()=>e.timeline.frame/B()),D=Le(()=>ja(e.systems)),L=Le(()=>FZ(e.systems,v.value));function R(V){return D.value.has(V.id)}function X(V){var ee;return(R(V)?((ee=L.value.get(V.id))==null?void 0:ee.firstTrigger)??0:0)*v.value/B()+4}function z(V){var be;const W=V.config;if(R(V)){const ye=((be=L.value.get(V.id))==null?void 0:be.firstTrigger)??0,he=b.value[V.id]??Math.max(0,Number(W.delay)||0);return(ye+he)*v.value/B()}return(b.value[V.id]??Math.max(0,Number(W.delay)||0))*v.value/B()}function K(V){const W=V.config,ee=Math.max(0,Number(W.lifeMin)||0),be=Math.max(0,Number(W.lifeMax)||0);return W.lifeMode==="fixed"?ee:Math.max(ee,be)}function Z(V){if(R(V)){const W=L.value.get(V.id),ee=(W==null?void 0:W.firstTrigger)??0,be=(W==null?void 0:W.end)??ee;return Math.max(0,be-ee)*v.value/B()}return ce(V)}function ae(V){if(R(V)||V.config.mode!=="stream")return 0;if(V.config.streamBehavior==="loop"){const ee=V.config;return(T.value[V.id]??Ji(ee,v.value).loop)/B()}return(x.value[V.id]??Math.max(1/v.value,Number(V.config.duration)||1))*v.value/B()}function ce(V){if(R(V))return Z(V);const W=V.config;return W.mode==="stream"&&W.streamBehavior==="loop"?we(V)+ae(V)+re(V):ae(V)+K(V)*v.value/B()}function ve(V){const W=V.config;return W.mode==="stream"&&W.streamBehavior==="loop"}function we(V){return ve(V)?Ji(V.config,v.value).start/B():0}function re(V){return ve(V)?Ji(V.config,v.value).end/B():0}function Ee(V){var W;return((W=V.animations.find(ee=>ee.name===V.selectedAnimation))==null?void 0:W.duration)||0}function q(V){return(E.value[V.id]??Math.max(0,Number(V.timeOffset)||0))*v.value/B()}function J(V){return Ee(V)*v.value/B()}function ie(V){const W=V.deltaY<0?.8:1.25;let ee=y.value*W;ee=Math.min(2e3,Math.max(10,ee)),y.value=Math.round(ee)}function se(V){const W=n.value;e.pause();const ee=ye=>{const he=W.getBoundingClientRect(),Be=Math.floor((ye.clientX-he.left)/he.width*y.value);e.timeline.frame=Math.max(0,Math.min(Be,M.value-1))};ee(V);const be=()=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",be)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",be)}function G(V,W){V.stopPropagation();const ee=V.clientX,be=Math.max(0,Number(W.config.delay)||0),ye=B()/v.value,he=ge=>{const Ve=(ge.clientX-ee)*ye,qe=Math.max(0,Math.min(be+Ve,600));b.value[W.id]=Math.round(qe*v.value)/v.value},Be=ge=>{window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",Ae),window.removeEventListener("pointercancel",de);const Ve=b.value[W.id];delete b.value[W.id],ge&&Ve!=null&&Ve!==be&&(W.config.delay=Ve)},Ae=()=>Be(!0),de=()=>Be(!1);window.addEventListener("pointermove",he),window.addEventListener("pointerup",Ae),window.addEventListener("pointercancel",de)}function H(V,W){var ft;V.stopPropagation();const ee=ve(W),be=Math.max(0,Number(W.config.duration)||0),ye=Ji(W.config,v.value).loop,he=B()/v.value,Be=((ft=V.currentTarget.closest(".lane-bar"))==null?void 0:ft.getBoundingClientRect().left)??V.clientX,Ae=we(W);let de=!1;const ge=Oe=>{if(de=!0,ee){const ot=Math.min(1800,Math.max(1,Math.round((Oe.clientX-Be-Ae)/B())));T.value[W.id]=ot}else{const ot=Math.max(1/v.value,Math.min((Oe.clientX-Be)*he,600));x.value[W.id]=Math.round(ot*v.value)/v.value}},Ve=Oe=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",qe),window.removeEventListener("pointercancel",bt);const ot=x.value[W.id],Te=T.value[W.id];delete x.value[W.id],delete T.value[W.id],Oe&&de&&ee&&Te!=null&&Te!==ye?W.config.loopDurationFrames=Te:Oe&&de&&!ee&&ot!=null&&ot!==be&&(W.config.duration=ot)},qe=()=>Ve(!0),bt=()=>Ve(!1);window.addEventListener("pointermove",ge),window.addEventListener("pointerup",qe),window.addEventListener("pointercancel",bt)}function O(V,W){V.stopPropagation();const ee=V.clientX,be=Math.max(0,Number(W.timeOffset)||0),ye=B()/v.value,he=ge=>{const Ve=Math.max(0,Math.min(be+(ge.clientX-ee)*ye,600));E.value[W.id]=Math.round(Ve*v.value)/v.value},Be=ge=>{window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",Ae),window.removeEventListener("pointercancel",de);const Ve=E.value[W.id];delete E.value[W.id],ge&&Ve!=null&&Ve!==be&&(W.timeOffset=Ve,e.recalcTotalFrames())},Ae=()=>Be(!0),de=()=>Be(!1);window.addEventListener("pointermove",he),window.addEventListener("pointerup",Ae),window.addEventListener("pointercancel",de)}return(V,W)=>{var ee,be,ye;return Q(),te("div",LZ,[(Q(),kt(Qu,{defer:"",to:"#timeline-controls-host"},[w("div",DZ,[w("button",{class:Pe(["tl-btn",{on:_(e).timeline.playing}]),onClick:W[0]||(W[0]=he=>_(e).togglePlay()),title:_(e).timeline.playing?V.$t("timeline.pause"):V.$t("timeline.play")},F(_(e).timeline.playing?"❚❚":"▶"),11,OZ),w("button",{class:"tl-btn",onClick:W[1]||(W[1]=he=>_(e).toStart()),title:V.$t("timeline.toStart")},"⏮",8,NZ),w("button",{class:"tl-btn",onClick:W[2]||(W[2]=he=>_(e).previousFrame()),title:V.$t("timeline.previous")},"◀",8,$Z),w("button",{class:"tl-btn",onClick:W[3]||(W[3]=he=>_(e).nextFrame()),title:V.$t("timeline.next")},"▶",8,BZ),w("button",{class:"tl-btn",onClick:W[4]||(W[4]=he=>_(e).toEnd()),title:V.$t("timeline.toEnd")},"⏭",8,UZ),w("button",{class:Pe(["tl-btn",{on:_(e).timeline.loop}]),title:V.$t("timeline.continuousLoop"),"aria-label":V.$t("timeline.continuousLoop"),onClick:W[5]||(W[5]=he=>_(e).toggleLoop())},"⟳",10,VZ),w("div",XZ,[w("button",{class:Pe(["tl-ab-toggle",{on:_(e).timeline.abLoop}]),title:V.$t("timeline.abLoop"),onClick:W[6]||(W[6]=he=>_(e).toggleABLoop())},[w("span",null,F(V.$t("timeline.abLoopShort")),1),W[12]||(W[12]=w("i",{class:"tl-switch"},[w("b")],-1))],10,YZ),_(e).timeline.abLoop?(Q(),te("div",{key:0,class:"tl-ab-popover",onPointerdown:W[9]||(W[9]=We(()=>{},["stop"]))},[w("div",zZ,F(V.$t("timeline.abRange")),1),w("label",{class:"tl-range",title:V.$t("timeline.playbackStart")},[W[13]||(W[13]=w("span",null,"A",-1)),pe(w("input",{"onUpdate:modelValue":W[7]||(W[7]=he=>S.value=he),type:"number",min:"0",max:Math.max(0,_(e).timeline.playbackEnd-1),"aria-label":V.$t("timeline.startFrame"),onChange:$,onKeydown:es(We($,["prevent"]),["enter"])},null,40,HZ),[[Je,S.value]])],8,jZ),w("label",{class:"tl-range",title:V.$t("timeline.playbackEnd")},[W[14]||(W[14]=w("span",null,"B",-1)),pe(w("input",{"onUpdate:modelValue":W[8]||(W[8]=he=>C.value=he),type:"number",min:_(e).timeline.playbackStart+1,max:Math.max(1,_(e).timeline.totalFrames-1),"aria-label":V.$t("timeline.endFrame"),onChange:j,onKeydown:es(We(j,["prevent"]),["enter"])},null,40,WZ),[[Je,C.value]])],8,GZ)],32)):xe("",!0)]),w("span",qZ,F(V.$t("timeline.frameStatus",{current:_(e).timeline.frame,total:Math.max(0,_(e).timeline.totalFrames-1)})),1),w("span",KZ,[W[15]||(W[15]=w("i",{class:"legend-emission"},null,-1)),Ct(F(V.$t("timeline.emission"))+" ",1),W[16]||(W[16]=w("i",{class:"legend-life"},null,-1)),Ct(F(V.$t("timeline.particleLife"))+" ",1),W[17]||(W[17]=w("i",{class:"legend-spine"},null,-1)),Ct(F(V.$t("timeline.spineAnimation")),1)]),w("div",{ref_key:"animationMenuRef",ref:o,class:"tl-anim tl-owner-animation"},[w("span",null,F(V.$t("timeline.ownerAnimation")),1),w("button",{class:"tl-animation-trigger",disabled:!d.value,title:V.$t("timeline.setOwnerAnimation"),onClick:We(u,["stop"])},[w("span",null,F(((ee=d.value)==null?void 0:ee.animation)||_(e).timeline.animation),1),W[18]||(W[18]=w("i",null,"⌄",-1))],8,JZ),a.value?(Q(),te("div",{key:0,class:"tl-animation-menu",onPointerdown:W[11]||(W[11]=We(()=>{},["stop"]))},[w("div",ZZ,F(V.$t("timeline.chooseOwnerAnimation")),1),(Q(!0),te(_e,null,Mt(_(e).timeline.animations,he=>{var Be,Ae;return Q(),te("button",{key:he,class:Pe(["tl-animation-option",{on:((Be=d.value)==null?void 0:Be.animation)===he}]),onClick:de=>h(he)},[w("span",null,F(he),1),((Ae=d.value)==null?void 0:Ae.animation)===he?(Q(),te("i",eQ,"✓")):xe("",!0)],10,QZ)}),128)),w("div",tQ,[pe(w("input",{"onUpdate:modelValue":W[10]||(W[10]=he=>c.value=he),class:"tl-animation-name",maxlength:"64","aria-label":V.$t("timeline.animationName"),onKeydown:es(p,["enter"])},null,40,nQ),[[Je,c.value]]),w("button",{title:V.$t("timeline.renameAnimation"),onClick:p},F(V.$t("timeline.rename")),9,iQ)]),l.value?(Q(),te("div",sQ,F(l.value),1)):xe("",!0),w("div",rQ,[w("button",{onClick:f},F(V.$t("timeline.newAnimation")),1),w("button",{disabled:_(e).timeline.animations.length<=1,onClick:m},F(V.$t("common.delete")),9,oQ)]),_(e).timeline.animations.length<=1?(Q(),te("div",aQ,F(V.$t("timeline.keepOneAnimation")),1)):xe("",!0)],32)):xe("",!0)],512),w("label",lQ,[Ct(F(V.$t("timeline.spinePreview"))+" ",1),w("select",{class:"tl-sel",value:((be=I.value)==null?void 0:be.selectedAnimation)||"",disabled:!I.value,onChange:N},[w("option",dQ,F(I.value?V.$t("timeline.none"):V.$t("timeline.noSpineAnimation")),1),(Q(!0),te(_e,null,Mt(((ye=I.value)==null?void 0:ye.animations)||[],he=>(Q(),te("option",{key:he.name,value:he.name},F(he.name)+"("+F(he.duration.toFixed(2))+"s) ",9,uQ))),128))],40,cQ)]),w("span",hQ,F(k.value),1)])])),w("div",{class:"tl-viewport",ref_key:"vpRef",ref:n,onWheel:We(ie,["prevent"]),onPointerdown:se},[w("div",fQ,[(Q(!0),te(_e,null,Mt(Y.value,he=>(Q(),te("div",{key:he.f,class:"tl-tickline",style:zt({left:he.px+"px"})},[w("span",pQ,F(he.f)+"f",1)],4))),128))]),w("div",{class:"tl-playhead",style:zt({left:U.value+"px"})},null,4),w("div",mQ,[(Q(!0),te(_e,null,Mt(_(e).systems,(he,Be)=>(Q(),te("div",{key:he.id,class:"tl-lane"},[w("span",{class:Pe(["lane-ico",{"sub-lane-ico":R(he)}]),style:zt({left:X(he)+"px"})},"●",6),w("div",{class:Pe(["lane-bar",{"sub-emitter-bar":R(he)}]),style:zt({left:z(he)+"px",width:Z(he)+"px"}),onPointerdown:We(Ae=>G(Ae,he),["stop"])},[w("span",vQ,F(he.config.name||V.$t("timeline.systemName",{index:Be+1})),1),w("span",{class:Pe(["bar-life",{"loop-life":!R(he)&&ve(he)}]),style:zt({width:ce(he)+"px"})},null,6),!R(he)&&ve(he)?(Q(),te(_e,{key:0},[we(he)?(Q(),te("span",{key:0,class:"bar-loop-transition bar-loop-start",style:zt({width:we(he)+"px"})},null,4)):xe("",!0),w("span",{class:"bar-emission bar-loop",style:zt({left:we(he)+"px",width:ae(he)+"px"})},[w("span",{class:"bar-handle",title:V.$t("timeline.dragLoopDuration"),onPointerdown:We(Ae=>H(Ae,he),["stop"])},null,40,bQ)],4),re(he)?(Q(),te("span",{key:1,class:"bar-loop-transition bar-loop-end",style:zt({left:we(he)+ae(he)+"px",width:re(he)+"px"})},null,4)):xe("",!0)],64)):!R(he)&&he.config.mode==="stream"?(Q(),te("span",{key:1,class:"bar-emission",style:zt({width:ae(he)+"px"})},[w("span",{class:"bar-handle",title:V.$t("timeline.dragEmissionDuration"),onPointerdown:We(Ae=>H(Ae,he),["stop"])},null,40,yQ)],4)):xe("",!0)],46,gQ)]))),128)),(Q(!0),te(_e,null,Mt(P.value,he=>(Q(),te("div",{key:`spine-${he.id}`,class:"tl-lane spine-lane"},[W[19]||(W[19]=w("span",{class:"lane-ico spine-ico"},"◆",-1)),w("div",{class:"spine-bar",style:zt({left:q(he)+"px",width:J(he)+"px"}),title:V.$t("timeline.dragSpineStart"),onPointerdown:We(Be=>O(Be,he),["stop"])},[w("span",wQ,F(he.name)+" · "+F(he.selectedAnimation),1)],44,xQ)]))),128)),!_(e).systems.length&&!P.value.length?(Q(),te("div",SQ,F(V.$t("timeline.noAnimationData")),1)):xe("",!0)])],544)])}}}),AQ=dn(CQ,[["__scopeId","data-v-d8a5c3cb"]]),TQ={class:"transfer-heading"},EQ={key:0},_Q={class:"transfer-detail"},MQ=Zt({__name:"TransferProgressOverlay",setup(i){const e=Re(null);return Ut(()=>hn.visible,async t=>{var n;t&&(await tl(),(n=e.value)==null||n.focus({preventScroll:!0}))},{flush:"post"}),(t,n)=>(Q(),kt(OM,{name:"transfer-fade"},{default:Ju(()=>[_(hn).visible?(Q(),te("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:n[0]||(n[0]=We(()=>{},["stop","prevent"])),onPointerup:n[1]||(n[1]=We(()=>{},["stop","prevent"])),onClick:n[2]||(n[2]=We(()=>{},["stop","prevent"])),onDblclick:n[3]||(n[3]=We(()=>{},["stop","prevent"])),onContextmenu:n[4]||(n[4]=We(()=>{},["stop","prevent"])),onWheel:n[5]||(n[5]=We(()=>{},["stop","prevent"])),onKeydown:n[6]||(n[6]=We(()=>{},["stop","prevent"]))},[w("div",{class:Pe(["transfer-dialog",{failed:_(hn).failed}])},[w("div",TQ,[w("span",null,F(_(hn).title),1),_(hn).indeterminate?xe("",!0):(Q(),te("strong",EQ,F(Math.round(_(hn).progress))+"%",1))]),w("div",{class:Pe(["transfer-track",{indeterminate:_(hn).indeterminate}])},[w("div",{class:"transfer-bar",style:zt(_(hn).indeterminate?void 0:{width:`${_(hn).progress}%`})},null,4)],2),w("div",_Q,F(_(hn).detail),1)],2)],544)):xe("",!0)]),_:1}))}}),PQ=dn(MQ,[["__scopeId","data-v-592b922e"]]),kQ=["inert","aria-hidden"],IQ={class:"right"},RQ={class:"stage-area"},FQ=["aria-label"],LQ=["disabled","aria-selected","title","onClick"],DQ={class:"floating-section-index"},OQ={class:"floating-section-label"},NQ=["title"],$Q=Zt({__name:"App",setup(i){const e=Zo();g3(e);const{activeSection:t,activateSection:n,canUseSection:s}=kY(),r=Le(()=>!e.settings.floatingMenuEnabled||t.value!==null),o=Re(360),a=Re(180);function c(d){d.preventDefault();const u=f=>{const p=e.settings.parameterPanelOnRight?window.innerWidth-f.clientX:f.clientX,m=Math.max(240,Math.min(p,window.innerWidth-200));o.value=m},h=()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",u),window.addEventListener("pointerup",h)}function l(d){d.preventDefault();const u=d.clientY,h=a.value,f=m=>{const g=Math.max(80,Math.min(h+(u-m.clientY),window.innerHeight-200));a.value=g},p=()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",p)}return(d,u)=>(Q(),te(_e,null,[w("div",{class:Pe(["layout",{"panel-right":_(e).settings.parameterPanelOnRight}]),inert:_(hn).visible?!0:void 0,"aria-hidden":_(hn).visible?"true":void 0},[pe(w("div",{class:"parameter-panel",style:zt({width:o.value+"px"})},[Ce(RZ)],4),[[Xt,r.value]]),pe(w("div",{class:"resizer-col",onPointerdown:c},null,544),[[Xt,r.value]]),w("div",IQ,[w("div",RQ,[Ce(TV),_(e).settings.floatingMenuEnabled?(Q(),te("nav",{key:0,class:Pe(["floating-section-nav",{"nav-left":!_(e).settings.parameterPanelOnRight}]),role:"tablist","aria-label":d.$t("settings.floatingMenu")},[(Q(!0),te(_e,null,Mt(_(eE),(h,f)=>(Q(),te("button",{key:h.key,type:"button",role:"tab",class:Pe(["floating-section-tab",{selected:_(t)===h.key&&_(s)(h.key)}]),disabled:!_(s)(h.key),"aria-selected":_(t)===h.key&&_(s)(h.key),title:_(s)(h.key)?d.$t(h.titleKey):d.$t("settings.floatingMenuParticleOnly"),onClick:p=>_(n)(h.key)},[w("span",DQ,F(f+1),1),w("span",OQ,F(d.$t(h.titleKey)),1)],10,LQ))),128))],10,FQ)):xe("",!0)]),w("div",{class:"resizer-row",onPointerdown:l,title:d.$t("app.resizeTimeline")},null,40,NQ),w("div",{class:"timeline-area",style:zt({height:a.value+"px"})},[Ce(AQ)],4)])],10,kQ),Ce(PQ)],64))}}),BQ=dn($Q,[["__scopeId","data-v-f71cd31c"]]);dP(BQ).use(fP()).use(pc).mount("#app");export{Ux as $,Is as A,Ou as B,Ot as C,Mn as D,$e as E,ai as F,Ns as G,at as H,Pt as I,zT as J,ti as K,Ei as L,Bi as M,so as N,Th as O,ks as P,oc as Q,Ka as R,Ki as S,lX as T,Ze as U,Lx as V,ts as W,mte as X,rY as Y,bc as Z,jg as _,tt as a,tg as a$,Bx as a0,CT as a1,uv as a2,fte as a3,Ru as a4,Yl as a5,bX as a6,zl as a7,Eh as a8,Jm as a9,cg as aA,dg as aB,Cd as aC,Ur as aD,Bd as aE,Zm as aF,_T as aG,an as aH,xT as aI,rte as aJ,Va as aK,$x as aL,Fe as aM,Ge as aN,eg as aO,Ud as aP,IT as aQ,Qm as aR,PT as aS,kT as aT,_h as aU,LT as aV,Vd as aW,NT as aX,RT as aY,DT as aZ,$T as a_,ta as aa,hv as ab,fv as ac,Ox as ad,Pc as ae,kc as af,Mc as ag,ea as ah,lr as ai,ate as aj,ET as ak,vX as al,Za as am,eo as an,gv as ao,YT as ap,mX as aq,vc as ar,ui as as,Nx as at,dte as au,rl as av,lg as aw,ug as ax,hg as ay,fg as az,Wa as b,Sr as b$,Du as b0,FT as b1,uo as b2,OT as b3,pv as b4,aX as b5,VT as b6,XT as b7,mv as b8,Os as b9,BT as bA,vv as bB,Ah as bC,jT as bD,ng as bE,En as bF,rX as bG,dX as bH,cT as bI,lT as bJ,lte as bK,Gt as bL,ol as bM,HT as bN,qT as bO,KT as bP,JT as bQ,GT as bR,WT as bS,pX as bT,bv as bU,Lt as bV,ag as bW,MT as bX,uT as bY,hT as bZ,fT as b_,oX as ba,ote as bb,rt as bc,TT as bd,AT as be,wT as bf,ST as bg,Yo as bh,Fu as bi,gX as bj,pT as bk,mT as bl,ri as bm,gT as bn,Ja as bo,Nn as bp,dT as bq,Lu as br,vT as bs,bT as bt,yT as bu,Vx as bv,rg as bw,Io as bx,UT as by,sg as bz,qa as c,cte as c0,hX as c1,fX as c2,uX as c3,Qe as d,He as e,ute as f,st as g,Fn as h,lu as i,fi as j,Kt as k,je as l,ss as m,Yt as n,$g as o,pn as p,ac as q,Nr as r,Xe as s,Yw as t,zg as u,fu as v,ig as w,Po as x,Dx as y,og as z}; +`;class UA extends Nr{constructor(e){super(e),this.shaderGenerator=new Yw(Y4,z4),this.geometryClass=X4,this.vertexSize=7}packInterleavedGeometry(e,t,n,s,r){const{uint32View:o,float32View:a}=t,c=s/this.vertexSize,l=e.uvs,d=e.indices,u=e.vertexData,h=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=Ot.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Ot.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(l){return Promise.all(l.map(d=>Promise.resolve(d).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(l=>{if(l=q4(l),l in hx)return;hx[l]=!0;const d=l.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":W4,d||(h.as="script"),h.crossOrigin="",h.href=l,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function XA(){const[i,e]=await Promise.all([fx(()=>import("./index-D87AMfy0.js"),[]),fx(()=>import("./index-DbHSUVPi.js"),__vite__mapDeps([0,1]))]);return{core:i,pixi:e}}async function K4(i,e,t){const{core:n,pixi:s}=await XA(),r=new n.TextureAtlas(e);return ov(r,t,s.SpineTexture),{skeletonData:new n.SkeletonJson(new n.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:s.Spine}}async function J4(i,e,t){const{core:n,pixi:s}=await XA(),r=new n.TextureAtlas(e);return ov(r,t,s.SpineTexture),{skeletonData:new n.SkeletonBinary(new n.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:s.Spine}}function jr(i,e,t){const n=Number(i[e]);return Number.isFinite(n)?n:t}function hi(i,e,t,n){i[e]==null&&(i[e]=jr(i,t,n))}function av(i,e,t){if(typeof i.curve!="number")return;const n=jr(i,"time",0),r=jr(e,"time",0)-n,o=i.curve,a=jr(i,"c2",0),c=jr(i,"c3",1),l=jr(i,"c4",1);i.curve=t.flatMap(([d,u])=>[n+r*o,d+(u-d)*a,n+r*c,d+(u-d)*l]),delete i.c2,delete i.c3,delete i.c4}function Zr(i,e){if(Array.isArray(i))for(let t=0;t[jr(n,r,o),jr(s,r,o)]))}}function Z4(i){if(Array.isArray(i))for(let e=0;eNumber.parseInt(n.slice(r,r+2),16)/255);return e?s:s.slice(0,3)}function px(i,e){if(Array.isArray(i))for(let t=0;t[a,o[c]]))}}function Q4(i){for(const e of i.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of i.transform||[])hi(e,"mixRotate","rotateMix",1),hi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),hi(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),hi(e,"mixShearY","shearMix",1);for(const e of i.path||[])hi(e,"mixRotate","rotateMix",1),hi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function eU(i){for(const e of i.skins||[])for(const t of Object.values(e.attachments||{}))for(const n of Object.values(t||{}))n.parent!=null&&n.timelines==null&&n.deform!=null&&(n.timelines=n.deform)}function tU(i){for(const e of Object.values(i.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),px(e.rgba,!1),px(e.rgba2,!0)}function nU(i){for(const e of Object.values(i.bones||{})){for(const t of e.rotate||[])hi(t,"value","angle",0);Zr(e.rotate,[{key:"value",fallback:0}]),Zr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Zr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Zr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function iU(i){for(const e of Object.values(i.ik||{}))Zr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function sU(i){for(const e of Object.values(i.transform||{})){for(const t of e)hi(t,"mixRotate","rotateMix",1),hi(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),hi(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),hi(t,"mixShearY","shearMix",1);Zr(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function rU(i){for(const e of Object.values(i.path||{})){for(const n of["position","spacing"]){const s=e[n];for(const r of s||[])hi(r,"value",n,0);Zr(s,[{key:"value",fallback:0}])}const t=e.mix;for(const n of t||[])hi(n,"mixRotate","rotateMix",1),hi(n,"mixX","translateMix",1),n.mixY==null&&(n.mixY=n.mixX);Zr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function oU(i){if(!i.deform)return;const e=i.attachments||(i.attachments={});for(const[t,n]of Object.entries(i.deform)){const s=e[t]||(e[t]={});for(const[r,o]of Object.entries(n)){const a=s[r]||(s[r]={});for(const[c,l]of Object.entries(o)){const d=a[c]||(a[c]={});d.deform=l,Z4(l)}}}delete i.deform}function YA(i){Q4(i),eU(i);for(const e of Object.values(i.animations||{}))tU(e),nU(e),iU(e),sU(e),rU(e),oU(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return i}function aU(i){return i.replace(/\\/g,"/").split("/").pop()||i}async function lU(i){const e=await Promise.all(i.map(async t=>{const n=URL.createObjectURL(t);try{return[aU(t.name).toLowerCase(),await tt.fromURL(n)]}finally{URL.revokeObjectURL(n)}}));return new Map(e)}function cU(i){const e=new Map;return i.bones.map(t=>{var r;const n=((r=t.parent)==null?void 0:r.name)||null,s=n?(e.get(n)||0)+1:0;return e.set(t.name,s),{name:t.name,parent:n,depth:s}})}function dU(i){return i.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function zA(i,e,t){var o;if(!/\.(json|skel)$/i.test(i.name))throw new Error(ke("errors.spineFileType"));if(!/\.atlas$/i.test(e.name))throw new Error(ke("errors.atlasFileType"));if(!t.length)throw new Error(ke("errors.chooseTexture"));const n=await e.text(),s=await lU(t),r=[...s.values()];try{let a,c,l=null,d;if(/\.skel$/i.test(i.name)){const u=await i.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await J4(u,n,s)),d="4.3"}catch(h){try{({skeletonData:a,SpineClass:c}=G4(u,n,s)),d="4.2"}catch(f){const p=h instanceof Error?h.message:String(h),m=f instanceof Error?f.message:String(f);throw new Error(ke("errors.binaryParseFailed",{v43:p,v42:m}))}}l=gu(a.version)}else{let u;try{u=JSON.parse(await i.text())}catch{throw new Error(ke("errors.invalidSpineJson"))}if(l=gu((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(ke("errors.unsupportedSpineJsonVersion",{versions:_m()}));d=tL(l),l==="3.8"&&YA(u);const h=d==="4.3"?await K4(u,n,s):H4(u,n,s);a=h.skeletonData,c=h.SpineClass}if(!l)throw new Error(ke("errors.unsupportedSpineDataVersion",{versions:_m()}));return{skeletonData:a,textures:r,runtimeVersion:d,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:cU(a),slots:dU(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function $d(i){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(String(n.result||"")),n.onerror=()=>t(n.error),n.readAsDataURL(i)})}async function uU(i,e,t){return{skeleton:{name:i.name,dataUrl:await $d(i)},atlas:{name:e.name,dataUrl:await $d(e)},textures:await Promise.all(t.map(async n=>({name:n.name,dataUrl:await $d(n)})))}}async function Ap(i){const e=await fetch(i.dataUrl);if(!e.ok)throw new Error(ke("errors.embeddedReadFailed",{name:i.name}));return new File([await e.blob()],i.name)}async function hU(i){return{skeleton:await Ap(i.skeleton),atlas:await Ap(i.atlas),textures:await Promise.all(i.textures.map(Ap))}}const jA="SpineParticle.EditorConfig",HA=1;function GA(i){return{backgroundX:i.backgroundX,backgroundY:i.backgroundY,backgroundOpacity:i.backgroundOpacity,backgroundImageName:i.backgroundImageName,backgroundImageData:i.backgroundImageData,showGrid:i.showGrid,exportSettings:tn(i.exportSettings)}}function fU(i){return JSON.parse(JSON.stringify(i,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function WA(i){const e=tn(i);return delete e.tags,delete e.selectedTag,e}function mx(i){const e=GA(i.settings),t=i.timeline.playbackEnd>=Math.max(1,i.timeline.totalFrames-1);return fU({format:jA,version:HA,savedAt:new Date().toISOString(),editor:tn(i.editor),settings:e,timeline:{fps:i.timeline.fps,loop:i.timeline.loop,playbackStart:i.timeline.playbackStart,playbackEnd:i.timeline.playbackEnd,playbackEndAuto:t,abLoop:i.timeline.abLoop,animations:[...i.timeline.animations]},selection:{type:i.activeObjectType,id:i.activeObjectId},scene:{systems:i.systems.map(n=>({...tn(n),frames:void 0})),colliders:i.colliders.map(WA),paths:tn(i.paths),spines:tn(i.spines)}})}function pU(i,e,t,n){const s=Math.max(1,n);let r=0;for(const o of i){const a=o.config,c=Math.max(0,Number(a.lifeMin)||0),l=Math.max(0,Number(a.lifeMax)||0),d=a.lifeMode==="fixed"?c:Math.max(c,l),u=a.mode==="stream"?a.streamBehavior==="loop"?Ji(a,s).total/s:Math.max(1/s,Number(a.duration)||0):0;let h=Math.max(0,Number(a.delay)||0)+u+d;a.mode==="stream"&&a.streamBehavior==="loop"&&(h=Math.max(0,Number(a.delay)||0)+Ji(a,s).total/s),r=Math.max(r,h)}for(const o of t){const a=o.animations.find(c=>c.name===o.selectedAnimation);a&&(r=Math.max(r,Math.max(0,Number(o.timeOffset)||0)+Math.max(0,a.duration||0)))}for(const o of e)o.followPath&&o.followPathId&&(r=Math.max(r,Math.max(0,o.followDuration)||0));return nC(r,s)}function lv(i){let e;try{e=JSON.parse(i)}catch{throw new Error(ke("errors.invalidJson"))}const t=e;if(t.format!==jA)throw new Error(ke("errors.invalidConfigFormat"));if(t.version!==HA)throw new Error(ke("errors.unsupportedConfigVersion",{version:t.version??ke("export.unknown")}));if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error(ke("errors.missingScene"));return t}async function mU(i){const e=new Map,t=s=>{const r=s==="/particles/star.png"?"/images/star.png":s==="/trails/trail.png"?"/images/trail.png":s||"/images/star.png";let o=e.get(r);return o||(o=tt.fromURL(r).then(a=>Hr(a)),e.set(r,o)),o},n=await t("/images/star.png");await Promise.all(i.map(async s=>{var o;const r=fr(s.config);r.texture=n,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async c=>{c.texture=await t(c.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,s.frames=[]}))}async function gU(i){const e=new Map;try{for(const t of i){if(!t.sourceBundle)continue;const n=await hU(t.sourceBundle);e.set(t.id,await zA(n.skeleton,n.atlas,n.textures))}return e}catch(t){for(const n of e.values())for(const s of n.textures)s.destroy(!0);throw t}}function vU(i,e){const t=(e==null?void 0:e.type)||"particle",n=Number(e==null?void 0:e.id)||0;(t==="particle"?i.systems.some(r=>r.id===n):t==="collision"?i.colliders.some(r=>r.id===n):t==="path"?i.paths.some(r=>r.id===n):i.spines.some(r=>r.id===n))?i.selectSceneObject(t,n):i.systems[0]?i.selectSceneObject("particle",i.systems[0].id):i.colliders[0]?i.selectSceneObject("collision",i.colliders[0].id):i.paths[0]?i.selectSceneObject("path",i.paths[0].id):i.spines[0]?i.selectSceneObject("spine",i.spines[0].id):(i.activeObjectType="particle",i.activeObjectId=0,i.activeId=0)}async function bU(i,e){var h,f,p,m,g,v,y,b,x;const t=lv(JSON.stringify(e)),n=tn(t.scene.systems),s=t.scene.colliders.map(WA),r=tn(t.scene.paths),o=tn(t.scene.spines);for(const T of o)T.sourceBundle==null&&(T.sourceBundle=null),T.dataVersion==null&&(T.dataVersion=""),Array.isArray(T.slots)||(T.slots=[]),typeof T.selectedBone!="string"&&(T.selectedBone=""),typeof T.selectedSlot!="string"&&(T.selectedSlot="");await mU(n);const a=await gU(o),c=new Map(i.spines.map(T=>[T.id,T.assetVersion]));for(const T of i.spines)Ec(T.id);i.systems=n,i.colliders=s,i.paths=r,i.spines=o,Object.assign(i.editor,tn(t.editor||{}));const l=t.settings;if(l)for(const T of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,T)&&(i.settings[T]=l[T]);i.settings.exportSettings=ZS((h=t.settings)==null?void 0:h.exportSettings),i.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(i.settings.undoLimit)||20))),i.timeline.fps=Math.max(1,Math.round(Number((f=t.timeline)==null?void 0:f.fps)||30));const d=Math.max(1,Math.floor(Number((p=t.timeline)==null?void 0:p.playbackEnd)||Number.MAX_SAFE_INTEGER)),u=((m=t.timeline)==null?void 0:m.playbackEndAuto)??d>=pU(n,s,o,i.timeline.fps);i.timeline.abLoop=((g=t.timeline)==null?void 0:g.abLoop)===!0,i.timeline.loop=((v=t.timeline)==null?void 0:v.loop)!==!1,i.timeline.animations=Array.isArray((y=t.timeline)==null?void 0:y.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(T=>typeof T=="string"&&T.trim()).map(T=>T.trim()))]:["animation"];for(const T of i.spines){const E=a.get(T.id);if(T.assetVersion=Math.max(Number(T.assetVersion)||0,c.get(T.id)||0)+1,!E){T.status="empty",T.error=T.skeletonFileName?ke("errors.missingEmbeddedSpine"):"",T.animations=[],T.bones=[],T.slots=[],T.selectedAnimation="";continue}gh(T.id,E),T.dataVersion=E.dataVersion,T.animations=E.animations,T.bones=E.bones,T.slots=E.slots,E.animations.some(S=>S.name===T.selectedAnimation)||(T.selectedAnimation=((b=E.animations[0])==null?void 0:b.name)||""),T.status="ready",T.error=""}i.syncSceneSequences(),vU(i,t.selection),i.timeline.playbackStart=Math.max(0,Math.floor(Number((x=t.timeline)==null?void 0:x.playbackStart)||0)),i.timeline.playbackEnd=d,i.timeline.frame=0,i.timeline.recorded=!1,i.timeline.playing=!0;for(const T of i.systems)i.timeline.animations.includes(T.animation)||(T.animation=i.timeline.animations[0]);return i.recalcTotalFrames(),u&&(i.timeline.playbackEnd=i.timeline.totalFrames-1),i.timeline.frame=i.timeline.playbackStart,t}async function Ym(i,e){return bU(i,lv(e))}async function yU(i,e){if(!/\.json$/i.test(e.name))throw new Error(ke("errors.chooseJsonConfig"));return Ym(i,await e.text())}const wr=qo({undoCount:0,dirty:!1});let gc=null,Rs=null,Qr=[],wl=null,ar=null,Mu=!1,wh="";function Sh(i){return{systems:i.systems.map(t=>{const n=tn(t);return n.frames=void 0,n}),colliders:tn(i.colliders),paths:tn(i.paths),spines:tn(i.spines),animations:[...i.timeline.animations],settings:GA(i.settings)}}function Ch(i){return JSON.stringify(i,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function qA(i,e=Sh(i),t=Ch(e)){const n=new Map;for(const s of e.spines){const r=QF(s.id);r&&n.set(s.id,r)}return{data:e,signature:t,spineAssets:n}}function Pu(i){if(i){for(const e of i.spineAssets.values())JF(e);i.spineAssets.clear()}}function KA(i){for(;Qr.length>i;)Pu(Qr.shift()||null);wr.undoCount=Qr.length}function JA(){const i=gc;if(!i||!Rs||Mu)return;const e=Sh(i),t=Ch(e);t!==Rs.signature&&(Qr.push(Rs),Rs=qA(i,e,t),KA(i.settings.undoLimit))}function xU(i){Mu||(wr.dirty=i!==wh,ar&&clearTimeout(ar),ar=setTimeout(()=>{ar=null,JA()},250))}function wU(i){const e=i.activeObjectId;return i.activeObjectType==="particle"?i.systems.some(t=>t.id===e):i.activeObjectType==="collision"?i.colliders.some(t=>t.id===e):i.activeObjectType==="path"?i.paths.some(t=>t.id===e):i.spines.some(t=>t.id===e)}function SU(i){var t,n;if(!wU(i)){const s=i.systems[0],r=i.colliders[0],o=i.paths[0],a=i.spines[0];s?(i.activeObjectType="particle",i.activeObjectId=s.id):r?(i.activeObjectType="collision",i.activeObjectId=r.id):o?(i.activeObjectType="path",i.activeObjectId=o.id):(i.activeObjectType="spine",i.activeObjectId=(a==null?void 0:a.id)||0)}const e=i.activeObjectType==="particle"?i.systems.find(s=>s.id===i.activeObjectId):i.systems.find(s=>s.id===i.activeId);i.activeId=(e==null?void 0:e.id)||((t=i.systems[0])==null?void 0:t.id)||0,i.timeline.animation=(e==null?void 0:e.animation)||((n=i.systems[0])==null?void 0:n.animation)||i.timeline.animations[0]||"animation"}function CU(i,e){const t=Rs;Mu=!0;try{for(const n of i.spines)Ec(n.id);i.systems=tn(e.data.systems),i.colliders=tn(e.data.colliders),i.paths=tn(e.data.paths),i.spines=tn(e.data.spines),i.timeline.animations=[...e.data.animations],Object.assign(i.settings,tn(e.data.settings));for(const[n,s]of e.spineAssets)gh(n,s);for(const n of i.systems)n.frames=[];i.timeline.recorded=!1,i.timeline.playing=!1,SU(i),i.recalcTotalFrames(),Rs=e,wr.dirty=e.signature!==wh}finally{Mu=!1,Pu(t)}}function AU(i){if(!(gc===i&&wl)){wl==null||wl(),ar&&clearTimeout(ar),Pu(Rs);for(const e of Qr)Pu(e);Qr=[],gc=i,Rs=qA(i),wh=Rs.signature,wr.undoCount=0,wr.dirty=!1,wl=Ut(()=>Ch(Sh(i)),xU,{flush:"post"})}}function Sl(i){gc===i&&(wh=Ch(Sh(i)),wr.dirty=!1)}function TU(i,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));i.settings.undoLimit=t,KA(t)}function ZA(){const i=gc;if(!i||!Rs)return!1;ar&&(clearTimeout(ar),ar=null),JA();const e=Qr.pop();return e?(CU(i,e),wr.undoCount=Qr.length,!0):!1}function EU(i){const e=i instanceof HTMLElement?i:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function _U(i){function e(n){var r;const s=n.target instanceof Node?n.target:null;i.canvasFocused.value=!!s&&!!((r=i.canvasElement.value)!=null&&r.contains(s))}function t(n){const s=n.key.toLowerCase();if((n.ctrlKey||n.metaKey)&&!n.altKey&&s==="s"){n.preventDefault(),n.stopPropagation(),i.save();return}if((n.ctrlKey||n.metaKey)&&!n.altKey&&s==="z"){n.preventDefault(),n.stopPropagation(),i.undo();return}if(n.ctrlKey||n.metaKey||n.altKey||EU(n.target))return;if(s==="d"){n.preventDefault(),i.togglePlay();return}if(s==="s"){n.preventDefault(),i.toStart();return}if(!i.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};s in r&&(n.preventDefault(),i.setTool(r[s]))}Ti(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),nl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const MU=Array.from({length:256},(i,e)=>{let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function PU(i){let e=4294967295;for(const t of i)e=MU[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function kU(i){const e=String(i||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error(ke("errors.invalidZipPath"));return e.join("/")}function IU(i=new Date){const e=Math.max(1980,i.getFullYear());return{time:i.getHours()<<11|i.getMinutes()<<5|Math.floor(i.getSeconds()/2),date:e-1980<<9|i.getMonth()+1<<5|i.getDate()}}function Tp(i){const e=new Uint8Array(i);return{bytes:e,view:new DataView(e.buffer)}}function gx(i){const e=new Uint8Array(i.reduce((n,s)=>n+s.length,0));let t=0;for(const n of i)e.set(n,t),t+=n.length;return e}function QA(i){const e=new TextEncoder,t=[],n=[],s=IU();let r=0;for(const c of i){const l=e.encode(kU(c.name)),d=PU(c.data),u=Tp(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,s.time,!0),u.view.setUint16(12,s.date,!0),u.view.setUint32(14,d,!0),u.view.setUint32(18,c.data.length,!0),u.view.setUint32(22,c.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,c.data);const h=Tp(46);h.view.setUint32(0,33639248,!0),h.view.setUint16(4,20,!0),h.view.setUint16(6,20,!0),h.view.setUint16(8,2048,!0),h.view.setUint16(12,s.time,!0),h.view.setUint16(14,s.date,!0),h.view.setUint32(16,d,!0),h.view.setUint32(20,c.data.length,!0),h.view.setUint32(24,c.data.length,!0),h.view.setUint16(28,l.length,!0),h.view.setUint32(42,r,!0),n.push(h.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=gx(n),a=Tp(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,i.length,!0),a.view.setUint16(10,i.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([gx([...t,o,a.bytes])],{type:"application/zip"})}const RU="SpineParticle.ProjectLibrary",io="projects",FU=1,zm="spine-particle:request-save";let yd=null;function cv(){return"indexedDB"in globalThis?yd||(yd=new Promise((i,e)=>{const t=indexedDB.open(RU,FU);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(io)||n.createObjectStore(io,{keyPath:"name"})},t.onsuccess=()=>i(t.result),t.onerror=()=>e(t.error||new Error(ke("config.storageUnavailable")))}),yd):Promise.reject(new Error(ke("config.storageUnavailable")))}function LU(i){return new Promise((e,t)=>{i.onsuccess=()=>e(i.result),i.onerror=()=>t(i.error||new Error(ke("config.storageUnavailable")))})}function eT(i){return new Promise((e,t)=>{i.oncomplete=()=>e(),i.onerror=()=>t(i.error||new Error(ke("config.storageUnavailable"))),i.onabort=()=>t(i.error||new Error(ke("config.storageUnavailable")))})}function jm(i){const e=i.trim().replace(/\.json$/i,"").trim();if(!e)throw new Error(ke("config.local.nameRequired"));if(/[\\/:*?"<>|\u0000-\u001f]/.test(e))throw new Error(ke("config.local.nameInvalid"));return e}function tT(i){return`${i}.json`}async function vx(){const e=(await cv()).transaction(io,"readonly");return(await LU(e.objectStore(io).getAll())).sort((n,s)=>s.savedAt.localeCompare(n.savedAt))}async function bx(i,e){const n={name:jm(i),text:e,savedAt:new Date().toISOString(),size:new Blob([e]).size},r=(await cv()).transaction(io,"readwrite");return r.objectStore(io).put(n),await eT(r),n}async function DU(i){const t=(await cv()).transaction(io,"readwrite");t.objectStore(io).delete(i),await eT(t)}function yx(i,e){const t=new Blob([i],{type:"application/json;charset=utf-8"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(n),0)}function OU(i,e){const t=new TextEncoder,n=QA(i.map(o=>({name:tT(o.name),data:t.encode(o.text)}))),s=URL.createObjectURL(n),r=document.createElement("a");r.href=s,r.download=e,r.style.display="none",document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(s),0)}const NU={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},$U={class:"help-head"},BU={id:"help-title"},UU=["aria-label","title"],VU={class:"help-body"},XU={class:"help-section help-start"},YU={class:"help-note"},zU={class:"help-grid"},jU={class:"help-section"},HU={class:"help-list"},GU={class:"help-section"},WU={class:"shortcut-list"},qU={class:"help-note"},KU={class:"help-doc-title"},JU=["aria-expanded"],ZU={class:"mtitle"},QU={class:"caret"},e5={class:"help-module-body"},t5={class:"help-list"},n5=["aria-expanded"],i5={class:"mtitle"},s5={class:"caret"},r5={class:"help-module-body"},o5={class:"help-list"},a5=["aria-expanded"],l5={class:"mtitle"},c5={class:"caret"},d5={class:"help-module-body"},u5={class:"help-list"},h5=["aria-expanded"],f5={class:"mtitle"},p5={class:"caret"},m5={class:"help-module-body"},g5={class:"help-list"},v5=["aria-expanded"],b5={class:"mtitle"},y5={class:"caret"},x5={class:"help-module-body"},w5={class:"help-list"},S5=["aria-expanded"],C5={class:"mtitle"},A5={class:"caret"},T5={class:"help-module-body"},E5={class:"help-list"},_5=["aria-expanded"],M5={class:"mtitle"},P5={class:"caret"},k5={class:"help-module-body"},I5={class:"help-list"},R5=["aria-expanded"],F5={class:"mtitle"},L5={class:"caret"},D5={class:"help-module-body"},O5={class:"help-list"},N5=["aria-expanded"],$5={class:"mtitle"},B5={class:"caret"},U5={class:"help-module-body"},V5={class:"connector-intro"},X5={class:"help-list"},Y5={class:"help-section help-export"},z5=Zt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=e,n=Re(Array.from({length:9},()=>!1));function s(){t("close")}function r(o){o.key==="Escape"&&s()}return Ti(()=>window.addEventListener("keydown",r)),Ar(()=>window.removeEventListener("keydown",r)),(o,a)=>i.show?(Q(),te("div",{key:0,class:"help-overlay",role:"presentation",onClick:We(s,["self"])},[w("section",NU,[w("header",$U,[w("div",null,[w("h2",BU,F(o.$t("help.title")),1),w("p",null,F(o.$t("help.subtitle")),1)]),w("button",{class:"help-close","aria-label":o.$t("help.close"),title:o.$t("help.closeShort"),onClick:s},"✕",8,UU)]),w("div",VU,[w("section",XU,[w("h3",null,F(o.$t("help.quickStart")),1),w("ol",null,[w("li",null,F(o.$t("help.stepCreate")),1),w("li",null,F(o.$t("help.stepEdit")),1),w("li",null,F(o.$t("help.stepPreview")),1),w("li",null,F(o.$t("help.stepExport")),1)]),w("p",YU,F(o.$t("help.quickNote")),1)]),w("div",zU,[w("section",jU,[w("h3",null,F(o.$t("help.commonOps")),1),w("dl",HU,[w("div",null,[w("dt",null,F(o.$t("help.eye")),1),w("dd",null,F(o.$t("help.eyeDesc")),1)]),w("div",null,[a[9]||(a[9]=w("dt",null,"+Copy",-1)),w("dd",null,F(o.$t("help.copyDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("toolbar.background")),1),w("dd",null,F(o.$t("help.backgroundDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("toolbar.settings")),1),w("dd",null,F(o.$t("help.settingsDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.undoShortcut")),1),w("dd",null,F(o.$t("help.undoDesc")),1)]),w("div",null,[a[10]||(a[10]=w("dt",null,"Spine Bone",-1)),w("dd",null,F(o.$t("help.spineBoneDesc")),1)])])]),w("section",GU,[w("h3",null,F(o.$t("help.shortcuts")),1),w("div",WU,[w("div",null,[a[11]||(a[11]=w("kbd",null,"Ctrl/⌘",-1)),a[12]||(a[12]=w("span",null,"+",-1)),a[13]||(a[13]=w("kbd",null,"Z",-1)),w("em",null,F(o.$t("help.undoShortcut")),1)]),w("div",null,[a[14]||(a[14]=w("kbd",null,"Ctrl/⌘",-1)),a[15]||(a[15]=w("span",null,"+",-1)),a[16]||(a[16]=w("kbd",null,"S",-1)),w("em",null,F(o.$t("help.saveShortcut")),1)]),w("div",null,[a[17]||(a[17]=w("kbd",null,"Q",-1)),w("em",null,F(o.$t("help.panShortcut")),1)]),w("div",null,[a[18]||(a[18]=w("kbd",null,"W",-1)),w("em",null,F(o.$t("help.translateShortcut")),1)]),w("div",null,[a[19]||(a[19]=w("kbd",null,"E",-1)),w("em",null,F(o.$t("help.rotateShortcut")),1)]),w("div",null,[a[20]||(a[20]=w("kbd",null,"R",-1)),w("em",null,F(o.$t("help.scaleShortcut")),1)]),w("div",null,[a[21]||(a[21]=w("kbd",null,"D",-1)),w("em",null,F(o.$t("help.playShortcut")),1)]),w("div",null,[a[22]||(a[22]=w("kbd",null,"S",-1)),w("em",null,F(o.$t("help.startShortcut")),1)])]),w("p",qU,F(o.$t("help.shortcutNote")),1)])]),w("div",KU,F(o.$t("help.modules")),1),w("section",{class:Pe(["help-section help-module",{open:n.value[0]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[0]?"true":"false",onClick:a[0]||(a[0]=c=>n.value[0]=!n.value[0])},[a[23]||(a[23]=w("span",{class:"mnum"},"1",-1)),w("span",ZU,F(o.$t("help.configTitle")),1),w("span",QU,F(n.value[0]?"▾":"▸"),1)],8,JU),pe(w("div",e5,[w("dl",t5,[w("div",null,[w("dt",null,F(o.$t("config.save")),1),w("dd",null,F(o.$t("help.saveConfigDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("config.load")),1),w("dd",null,F(o.$t("help.loadConfigDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("config.selectPreset")),1),w("dd",null,F(o.$t("help.presetDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.configScope")),1),w("dd",null,F(o.$t("help.configScopeDesc")),1)])])],512),[[Xt,n.value[0]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[1]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[1]?"true":"false",onClick:a[1]||(a[1]=c=>n.value[1]=!n.value[1])},[a[24]||(a[24]=w("span",{class:"mnum"},"2",-1)),w("span",i5,F(o.$t("help.sceneTitle")),1),w("span",s5,F(n.value[1]?"▾":"▸"),1)],8,n5),pe(w("div",r5,[w("dl",o5,[w("div",null,[w("dt",null,F(o.$t("scene.particle")),1),w("dd",null,F(o.$t("help.particleDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("scene.collision")),1),w("dd",null,F(o.$t("help.colliderDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("scene.path")),1),w("dd",null,F(o.$t("help.pathDesc")),1)]),w("div",null,[a[25]||(a[25]=w("dt",null,"Spine",-1)),w("dd",null,F(o.$t("help.spineDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.commonOps")),1),w("dd",null,F(o.$t("help.sceneCommonDesc")),1)])])],512),[[Xt,n.value[1]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[2]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[2]?"true":"false",onClick:a[2]||(a[2]=c=>n.value[2]=!n.value[2])},[a[26]||(a[26]=w("span",{class:"mnum"},"3",-1)),w("span",l5,F(o.$t("emission.title")),1),w("span",c5,F(n.value[2]?"▾":"▸"),1)],8,a5),pe(w("div",d5,[w("dl",u5,[w("div",null,[w("dt",null,F(o.$t("emission.stream")),1),w("dd",null,F(o.$t("help.emissionDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("emission.burst")),1),w("dd",null,F(o.$t("help.burstDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("emission.delay")),1),w("dd",null,F(o.$t("help.delayDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.showShape")),1),w("dd",null,F(o.$t("help.loopNote")),1)])])],512),[[Xt,n.value[2]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[3]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[3]?"true":"false",onClick:a[3]||(a[3]=c=>n.value[3]=!n.value[3])},[a[27]||(a[27]=w("span",{class:"mnum"},"4",-1)),w("span",f5,F(o.$t("emission.shapeTitle")),1),w("span",p5,F(n.value[3]?"▾":"▸"),1)],8,h5),pe(w("div",m5,[w("dl",g5,[w("div",null,[w("dt",null,F(o.$t("emission.shape")),1),w("dd",null,F(o.$t("help.shapeDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("emission.emissionAngle")),1),w("dd",null,F(o.$t("help.angleDesc")),1)])])],512),[[Xt,n.value[3]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[4]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[4]?"true":"false",onClick:a[4]||(a[4]=c=>n.value[4]=!n.value[4])},[a[28]||(a[28]=w("span",{class:"mnum"},"5",-1)),w("span",b5,F(o.$t("attributes.title")),1),w("span",y5,F(n.value[4]?"▾":"▸"),1)],8,v5),pe(w("div",x5,[w("dl",w5,[w("div",null,[w("dt",null,F(o.$t("attributes.initialParams")),1),w("dd",null,F(o.$t("help.initialDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("attributes.lifecycleTitle")),1),w("dd",null,F(o.$t("help.overLifeDesc")),1)])])],512),[[Xt,n.value[4]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[5]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[5]?"true":"false",onClick:a[5]||(a[5]=c=>n.value[5]=!n.value[5])},[a[29]||(a[29]=w("span",{class:"mnum"},"6",-1)),w("span",C5,F(o.$t("appearance.title")),1),w("span",A5,F(n.value[5]?"▾":"▸"),1)],8,S5),pe(w("div",T5,[w("dl",E5,[w("div",null,[w("dt",null,F(o.$t("appearance.opacity")),1),w("dd",null,F(o.$t("help.alphaDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("appearance.imageResources")),1),w("dd",null,F(o.$t("help.imageDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("image.sequence")),1),w("dd",null,F(o.$t("help.sequenceDesc")),1)])])],512),[[Xt,n.value[5]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[6]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[6]?"true":"false",onClick:a[6]||(a[6]=c=>n.value[6]=!n.value[6])},[a[30]||(a[30]=w("span",{class:"mnum"},"7",-1)),w("span",M5,F(o.$t("modifiers.title")),1),w("span",P5,F(n.value[6]?"▾":"▸"),1)],8,_5),pe(w("div",k5,[w("dl",I5,[w("div",null,[w("dt",null,F(o.$t("modifiers.enableNoise")),1),w("dd",null,F(o.$t("help.noiseDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableGravity"))+" / "+F(o.$t("modifiers.enableWind")),1),w("dd",null,F(o.$t("help.gravityDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableForceField"))+" / "+F(o.$t("modifiers.enableVortex"))+" / "+F(o.$t("modifiers.enableAttraction")),1),w("dd",null,F(o.$t("help.forceDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableTrail")),1),w("dd",null,F(o.$t("help.trailDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableFollow")),1),w("dd",null,F(o.$t("help.followDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("modifiers.enableCollision"))+" / "+F(o.$t("modifiers.damping")),1),w("dd",null,F(o.$t("help.collisionDesc")),1)])])],512),[[Xt,n.value[6]]])],2),w("section",{class:Pe(["help-section help-module",{open:n.value[7]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[7]?"true":"false",onClick:a[7]||(a[7]=c=>n.value[7]=!n.value[7])},[a[31]||(a[31]=w("span",{class:"mnum"},"8",-1)),w("span",F5,F(o.$t("export.title")),1),w("span",L5,F(n.value[7]?"▾":"▸"),1)],8,R5),pe(w("div",D5,[w("dl",O5,[w("div",null,[w("dt",null,F(o.$t("export.imagesPath")),1),w("dd",null,F(o.$t("help.exportDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("export.spineVersion")),1),a[32]||(a[32]=w("dd",null,"3.8 / 4.0 / 4.1 / 4.2 / 4.3",-1))]),w("div",null,[w("dt",null,F(o.$t("export.keyframeCurve")),1),w("dd",null,F(o.$t("export.bezierHelp")),1)]),w("div",null,[w("dt",null,F(o.$t("export.fps")),1),w("dd",null,F(o.$t("export.fpsHelp")),1)]),w("div",null,[w("dt",null,F(o.$t("export.title")),1),w("dd",null,F(o.$t("help.exportButtonsDesc")),1)])])],512),[[Xt,n.value[7]]])],2),w("section",{class:Pe(["help-section help-module help-connector",{open:n.value[8]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":n.value[8]?"true":"false",onClick:a[8]||(a[8]=c=>n.value[8]=!n.value[8])},[a[33]||(a[33]=w("span",{class:"mnum"},"9",-1)),w("span",$5,F(o.$t("help.connectorTitle")),1),w("span",B5,F(n.value[8]?"▾":"▸"),1)],8,N5),pe(w("div",U5,[w("p",V5,F(o.$t("help.connectorIntro")),1),w("dl",X5,[w("div",null,[w("dt",null,F(o.$t("help.prerequisite")),1),w("dd",null,F(o.$t("help.prerequisiteDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.download")),1),a[34]||(a[34]=w("dd",null,[w("a",{class:"dl-link",href:"/downloads/connector/SpineParticleConnector-windows-x64.exe",download:""},[Ct("Windows"),w("br"),w("small",null,"SpineParticleConnector-windows-x64.exe")]),w("a",{class:"dl-link",href:"/downloads/connector/SpineParticleConnector-macos-universal.zip",download:""},[Ct("macOS (Universal)"),w("br"),w("small",null,"SpineParticleConnector-macos-universal.zip")])],-1))]),w("div",null,[w("dt",null,F(o.$t("help.webSide")),1),w("dd",null,F(o.$t("help.webSideDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.authorization")),1),w("dd",null,F(o.$t("help.authorizationDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.pathSetup")),1),w("dd",null,F(o.$t("help.pathSetupDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.downloadResult")),1),w("dd",null,F(o.$t("help.downloadResultDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.version")),1),w("dd",null,F(o.$t("help.versionDesc")),1)]),w("div",null,[w("dt",null,F(o.$t("help.security")),1),w("dd",null,F(o.$t("help.securityDesc")),1)])])],512),[[Xt,n.value[8]]])],2),w("section",Y5,[w("h3",null,F(o.$t("help.differenceTitle")),1),w("p",null,F(o.$t("help.differenceDesc")),1)])])])])):xe("",!0)}}),dn=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t},j5=dn(z5,[["__scopeId","data-v-4bb9bc76"]]);function Ua(i){const e=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",i),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function Fi(i,e,t){const n=i.holder.value,s=i.app(),r=n.getBoundingClientRect(),o=Math.max(1e-4,i.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-s.screen.width/2-i.store.editor.viewX)/o,y:-(c-s.screen.height*.5-i.store.editor.viewY)/o}}function H5(i,e){const t=i.holder.value,n=i.app(),s=i.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=e.deltaY<0?1.12:1/1.12,l=s.editor.viewScale,d=Math.max(.01,l*c),u=n.screen.width/2,h=n.screen.height*.5,f=s.editor.viewX,p=s.editor.viewY,m=(o-u-f)/l,g=(a-h-p)/l;s.editor.viewX=o-u-m*d,s.editor.viewY=a-h-g*d,s.editor.viewScale=d}function G5(i,e,t){const n=i.store,s=n.editor.viewX,r=n.editor.viewY;Ua(o=>{n.editor.viewX=s+(o.clientX-e),n.editor.viewY=r+(o.clientY-t)})}function nT(i,e){const t=Math.max(.01,i.store.editor.viewScale*e);i.store.editor.viewScale=t}function W5(i){nT(i,1.2)}function q5(i){nT(i,1/1.2)}function K5(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function J5(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function Z5(i){i.store.settings.showGrid=!i.store.settings.showGrid}const Q5={class:"top-operation-stack"},e8={class:"topbar"},t8=["title"],n8=["disabled","title"],i8={class:"tool-group"},s8=["title"],r8=["title"],o8=["title"],a8=["title"],l8={class:"tool-group"},c8=["title"],d8=["title"],u8=["title"],h8=["title"],f8=["title"],p8=["title"],m8={key:0,class:"background-panel"},g8=["disabled"],v8=["title"],b8={class:"background-position-row"},y8=["aria-label"],x8=["aria-label"],w8={class:"background-opacity-row"},S8=["aria-label"],C8={class:"language-picker"},A8=["value","aria-label"],T8=["value"],E8=["title"],_8={class:"zoom-pct"},M8={class:"timeline-controls-row"},P8={key:0,class:"stage-hud"},k8={class:"hud-number hud-system-count"},I8={class:"hud-number hud-particle-count"},R8={class:"hud-tip"},F8=Zt({__name:"StageToolbar",props:{ctx:{},activeTool:{},hud:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(i,{emit:e}){const t=i,n=e,s=Zo(),{t:r,locale:o}=mi(),a=Re(!1),c=Re(null),l=Le(()=>s.settings.backgroundImageName);function d(y){n("update:activeTool",t.activeTool===y?"":y)}function u(){a.value=!a.value,a.value&&n("update:showSettings",!1)}function h(){const y=!t.showSettings;n("update:showSettings",y),y&&(a.value=!1)}function f(){n("update:showHelp",!0),a.value=!1,n("update:showSettings",!1)}function p(y){n("background-file",y)}function m(y=!0){c.value&&(c.value.value=""),n("clear-background",y)}function g(){ZA()}function v(y){const b=y.target.value;UC(b)}return(y,b)=>(Q(),te("div",Q5,[w("div",e8,[w("button",{class:"settings-btn",onClick:h,title:_(r)("toolbar.settings")},F(_(r)("toolbar.settings")),9,t8),w("button",{class:"undo-btn",disabled:_(wr).undoCount===0,onClick:g,title:_(r)("toolbar.undo")},"↶",8,n8),w("div",i8,[w("button",{class:Pe(["tool-btn",{on:i.activeTool===""}]),onClick:b[0]||(b[0]=x=>d("")),title:_(r)("toolbar.pan")},"✋",10,s8),w("button",{class:Pe(["tool-btn",{on:i.activeTool==="translate"}]),onClick:b[1]||(b[1]=x=>d("translate")),title:_(r)("toolbar.translate")},"✥",10,r8),w("button",{class:Pe(["tool-btn",{on:i.activeTool==="rotate"}]),onClick:b[2]||(b[2]=x=>d("rotate")),title:_(r)("toolbar.rotate")},"⟳",10,o8),w("button",{class:Pe(["tool-btn",{on:i.activeTool==="scale"}]),onClick:b[3]||(b[3]=x=>d("scale")),title:_(r)("toolbar.scale")},"⤢",10,a8)]),w("div",l8,[w("button",{class:"tool-btn",onClick:b[4]||(b[4]=x=>_(W5)(i.ctx)),title:_(r)("toolbar.zoomIn")},"+",8,c8),w("button",{class:"tool-btn",onClick:b[5]||(b[5]=x=>_(q5)(i.ctx)),title:_(r)("toolbar.zoomOut")},"-",8,d8),w("button",{class:"tool-btn",onClick:b[6]||(b[6]=x=>_(K5)(i.ctx)),title:_(r)("toolbar.fitView")},"⤢",8,u8),w("button",{class:Pe(["tool-btn",{on:_(s).settings.showGrid}]),onClick:b[7]||(b[7]=x=>_(Z5)(i.ctx)),title:_(r)("toolbar.toggleGrid")},"▦",10,h8),w("button",{class:"tool-btn",onClick:b[8]||(b[8]=x=>_(J5)(i.ctx)),title:_(r)("toolbar.resetView")},"⟳",8,f8)]),w("div",{class:"background-menu",onClick:b[14]||(b[14]=We(()=>{},["stop"]))},[w("button",{class:Pe(["background-btn",{on:a.value}]),title:_(r)("toolbar.backgroundSettings"),onClick:u},F(_(r)("toolbar.background")),11,p8),a.value?(Q(),te("div",m8,[w("button",{class:"background-upload",onClick:b[9]||(b[9]=x=>{var T;return(T=c.value)==null?void 0:T.click()})},F(l.value?_(r)("toolbar.changeBackground"):_(r)("toolbar.uploadBackground")),1),w("button",{class:"background-clear",disabled:!l.value,onClick:b[10]||(b[10]=x=>m())},F(_(r)("toolbar.clearBackground")),9,g8),w("input",{ref_key:"backgroundFileInput",ref:c,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:p},null,544),w("div",{class:"background-file-name",title:l.value},F(l.value||_(r)("toolbar.noBackground")),9,v8),w("div",b8,[w("label",null,[b[15]||(b[15]=w("span",null,"X",-1)),pe(w("input",{"onUpdate:modelValue":b[11]||(b[11]=x=>_(s).settings.backgroundX=x),type:"number",step:"1","aria-label":_(r)("toolbar.backgroundX")},null,8,y8),[[Je,_(s).settings.backgroundX,void 0,{number:!0}]])]),w("label",null,[b[16]||(b[16]=w("span",null,"Y",-1)),pe(w("input",{"onUpdate:modelValue":b[12]||(b[12]=x=>_(s).settings.backgroundY=x),type:"number",step:"1","aria-label":_(r)("toolbar.backgroundY")},null,8,x8),[[Je,_(s).settings.backgroundY,void 0,{number:!0}]])])]),w("label",w8,[w("span",null,F(_(r)("toolbar.opacity")),1),pe(w("input",{"onUpdate:modelValue":b[13]||(b[13]=x=>_(s).settings.backgroundOpacity=x),type:"range",min:"0",max:"1",step:"0.01","aria-label":_(r)("toolbar.backgroundOpacity")},null,8,S8),[[Je,_(s).settings.backgroundOpacity,void 0,{number:!0}]]),w("b",null,F(Math.round(_(s).settings.backgroundOpacity*100))+"%",1)])])):xe("",!0)]),w("label",C8,[w("span",null,F(_(r)("language.label")),1),w("select",{value:_(o),"aria-label":_(r)("language.label"),onChange:v},[(Q(!0),te(_e,null,Mt(_(NC),x=>(Q(),te("option",{key:x.code,value:x.code},F(x.label),9,T8))),128))],40,A8)]),w("button",{class:Pe(["help-btn",{on:i.showHelp}]),title:_(r)("toolbar.openHelp"),onClick:f},F(_(r)("toolbar.help")),11,E8),w("span",_8,F(Math.round(_(s).editor.viewScale*100))+"%",1)]),w("div",M8,[b[18]||(b[18]=w("div",{id:"timeline-controls-host",class:"timeline-controls-host"},null,-1)),i.hud?(Q(),te("div",P8,[Ct(F(_(r)("app.systems"))+": ",1),w("b",k8,F(i.hud.systems),1),Ct(" · "+F(_(r)("app.particlesBones"))+": ",1),w("b",I8,F(i.hud.particles),1),Ct(" · "+F(_(r)("app.rootBone"))+": ",1),b[17]||(b[17]=w("b",null,"root",-1)),w("span",R8,F(_(r)("app.hudTip")),1)])):xe("",!0)])]))}}),L8=dn(F8,[["__scopeId","data-v-f5300af5"]]),D8={class:"sp-head"},O8={class:"sp-section-title"},N8={class:"sp-switch-row"},$8={class:"sp-switch-control"},B8=["aria-label"],U8={class:"sp-switch-row"},V8={class:"sp-switch-control"},X8=["aria-label"],Y8={class:"sp-section-title"},z8={class:"sp-row"},j8=["aria-label"],H8={class:"sp-section-title"},G8={class:"sp-chk"},W8={class:"sp-chk"},q8={class:"sp-row"},K8=["aria-label"],J8={class:"sp-row"},Z8=["aria-label"],Q8={class:"sp-chk"},eV={class:"sp-chk"},tV={class:"sp-row"},nV={class:"sp-row"},iV={class:"sp-row"},sV={class:"sp-hex"},rV={class:"sp-chk"},oV={class:"sp-switch-row"},aV={class:"sp-switch-control"},lV=["aria-label"],cV={class:"sp-switch-row"},dV={class:"sp-switch-control"},uV=["aria-label"],hV={class:"sp-cache-note"},fV=Zt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=i,n=e,s=Zo(),{t:r}=mi(),o=Re(null);Ut(()=>t.show,async d=>{var u;d&&(await tl(),(u=o.value)==null||u.focus())});function a(d){var h;const u=d.relatedTarget;u&&((h=o.value)!=null&&h.contains(u))||requestAnimationFrame(()=>{var f;t.show&&!((f=o.value)!=null&&f.contains(document.activeElement))&&n("close")})}function c(d){TU(s,Number(d.target.value))}function l(){s.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(s.settings.bonePointDrawSize)||1)),s.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(s.settings.boneAxisDrawSize)||2))}return(d,u)=>i.show?(Q(),te("div",{key:0,ref_key:"panelRef",ref:o,class:"settings-panel",tabindex:"-1",onFocusout:a},[w("div",D8,[Ct(F(_(r)("settings.title"))+" ",1),w("button",{class:"sp-close",onClick:u[0]||(u[0]=h=>n("close"))},"✕")]),w("div",O8,F(_(r)("settings.layout")),1),w("label",N8,[w("span",null,F(_(r)("settings.parameterPanelPosition")),1),w("span",$8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[1]||(u[1]=h=>_(s).settings.parameterPanelOnRight=h),"aria-label":_(r)("settings.panelOnRight")},null,8,B8),[[vt,_(s).settings.parameterPanelOnRight]]),u[18]||(u[18]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.parameterPanelOnRight?_(r)("common.right"):_(r)("common.left")),1)])]),w("label",U8,[w("span",null,F(_(r)("settings.floatingMenu")),1),w("span",V8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[2]||(u[2]=h=>_(s).settings.floatingMenuEnabled=h),"aria-label":_(r)("settings.floatingMenu")},null,8,X8),[[vt,_(s).settings.floatingMenuEnabled]]),u[19]||(u[19]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.floatingMenuEnabled?_(r)("common.enabled"):_(r)("common.disabled")),1)])]),u[22]||(u[22]=w("div",{class:"sp-divider"},null,-1)),w("div",Y8,F(_(r)("settings.history")),1),w("label",z8,[w("span",null,F(_(r)("settings.maxUndo")),1),pe(w("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":u[3]||(u[3]=h=>_(s).settings.undoLimit=h),"aria-label":_(r)("settings.maxUndo"),onChange:c},null,40,j8),[[Je,_(s).settings.undoLimit,void 0,{number:!0}]])]),u[23]||(u[23]=w("div",{class:"sp-divider"},null,-1)),w("div",H8,F(_(r)("settings.canvasGuides")),1),w("label",G8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[4]||(u[4]=h=>_(s).settings.showEmitter=h)},null,512),[[vt,_(s).settings.showEmitter]]),Ct(F(_(r)("settings.emitter")),1)]),w("label",W8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[5]||(u[5]=h=>_(s).settings.showBones=h)},null,512),[[vt,_(s).settings.showBones]]),Ct(F(_(r)("settings.bones")),1)]),_(s).settings.showBones?(Q(),te(_e,{key:0},[w("label",q8,[w("span",null,F(_(r)("settings.bonePointSize")),1),pe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":u[6]||(u[6]=h=>_(s).settings.bonePointDrawSize=h),"aria-label":_(r)("settings.bonePointSize"),onChange:l},null,40,K8),[[Je,_(s).settings.bonePointDrawSize,void 0,{number:!0}]])]),w("label",J8,[w("span",null,F(_(r)("settings.boneAxisSize")),1),pe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":u[7]||(u[7]=h=>_(s).settings.boneAxisDrawSize=h),"aria-label":_(r)("settings.boneAxisSize"),onChange:l},null,40,Z8),[[Je,_(s).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):xe("",!0),w("label",Q8,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[8]||(u[8]=h=>_(s).settings.showSkinMesh=h)},null,512),[[vt,_(s).settings.showSkinMesh]]),Ct(F(_(r)("settings.skinMesh")),1)]),u[24]||(u[24]=w("div",{class:"sp-divider"},null,-1)),w("label",eV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[9]||(u[9]=h=>_(s).settings.tickEnabled=h)},null,512),[[vt,_(s).settings.tickEnabled]]),Ct(F(_(r)("settings.enableTicks")),1)]),_(s).settings.tickEnabled?(Q(),te(_e,{key:1},[w("label",tV,[w("span",null,F(_(r)("settings.tickFontSize")),1),pe(w("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":u[10]||(u[10]=h=>_(s).settings.axisFontSize=h)},null,512),[[Je,_(s).settings.axisFontSize,void 0,{number:!0}]]),pe(w("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":u[11]||(u[11]=h=>_(s).settings.axisFontSize=h),class:"sp-num"},null,512),[[Je,_(s).settings.axisFontSize,void 0,{number:!0}]])]),w("label",nV,[w("span",null,F(_(r)("settings.tickWidth")),1),pe(w("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":u[12]||(u[12]=h=>_(s).settings.tickWidth=h)},null,512),[[Je,_(s).settings.tickWidth,void 0,{number:!0}]]),pe(w("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":u[13]||(u[13]=h=>_(s).settings.tickWidth=h),class:"sp-num"},null,512),[[Je,_(s).settings.tickWidth,void 0,{number:!0}]])]),w("label",iV,[w("span",null,F(_(r)("settings.axisColor")),1),pe(w("input",{type:"color","onUpdate:modelValue":u[14]||(u[14]=h=>_(s).settings.axisColor=h),class:"sp-colr"},null,512),[[Je,_(s).settings.axisColor]]),w("span",sV,F(_(s).settings.axisColor),1)]),w("label",rV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[15]||(u[15]=h=>_(s).settings.showAxisLabels=h)},null,512),[[vt,_(s).settings.showAxisLabels]]),Ct(F(_(r)("settings.showAxisLabels")),1)])],64)):xe("",!0),u[25]||(u[25]=w("div",{class:"sp-divider"},null,-1)),w("label",oV,[w("span",null,F(_(r)("settings.unsavedPrompt")),1),w("span",aV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[16]||(u[16]=h=>_(s).settings.unsavedChangesPrompt=h),"aria-label":_(r)("settings.unsavedPrompt")},null,8,lV),[[vt,_(s).settings.unsavedChangesPrompt]]),u[20]||(u[20]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.unsavedChangesPrompt?_(r)("common.enabled"):_(r)("common.disabled")),1)])]),w("label",cV,[w("span",null,F(_(r)("settings.showProjectSize")),1),w("span",dV,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[17]||(u[17]=h=>_(s).settings.showProjectSize=h),"aria-label":_(r)("settings.showProjectSize")},null,8,uV),[[vt,_(s).settings.showProjectSize]]),u[21]||(u[21]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,F(_(s).settings.showProjectSize?_(r)("common.enabled"):_(r)("common.disabled")),1)])]),w("div",hV,F(_(r)("settings.cacheNote")),1)],544)):xe("",!0)}}),pV=dn(fV,[["__scopeId","data-v-22b4df39"]]);class Ep{constructor(){A(this,"sprite",null);A(this,"texture",null);A(this,"loadVersion",0)}createSprite(e){const t=new oo(tt.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,n){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(n)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=tt.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const n=await tt.fromURL(e);if(t!==this.loadVersion||!this.sprite){n.destroy(!0);return}const s=this.texture;this.texture=n,this.sprite.texture=n,this.sprite.visible=!0,s&&s.destroy(!0)}catch(n){console.error("背景图恢复失败",n)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const n=t.target,s=(r=n.files)==null?void 0:r[0];if(s)try{e.settings.backgroundImageData=await $d(s),e.settings.backgroundImageName=s.name}catch(o){console.error("背景图加载失败",o)}finally{n.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class mV{constructor(e){A(this,"selectedNodes",new Set);A(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(n=>n.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,n){if(e.points.length<2)return e.points.length;const s=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(c.x-s.x,c.y-s.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,s.x,s.y);t.points.splice(a,0,{x:s.x,y:s.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const n=Fi(this.ctx,e.clientX,e.clientY),s=da(t,n.x,n.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-s.x,u.y-s.y)<=r)>=0)return!0;const l={x:s.x,y:s.y,inX:0,inY:0,outX:0,outY:0},d=this.pathInsertIndex(t,s.x,s.y);return t.points.splice(d,0,l),this.selectedNodes.clear(),this.selectedNodes.add(d),this.suppressNextDoubleClick=!0,Ua(u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y);l.outX=f.x-l.x,l.outY=f.y-l.y,l.inX=-l.outX,l.inY=-l.outY}),!0}let o=null;for(const c of this.selectedNodes){const l=t.points[c];l&&(Math.hypot(l.x+l.inX-s.x,l.y+l.inY-s.y)<=r&&(o={index:c,side:"in"}),Math.hypot(l.x+l.outX-s.x,l.y+l.outY-s.y)<=r&&(o={index:c,side:"out"}))}if(o){const c=t.points[o.index],l=o.side==="in"?Math.hypot(c.outX,c.outY):Math.hypot(c.inX,c.inY);return Ua(u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y),p=f.x-c.x,m=f.y-c.y;if(o.side==="in"?(c.inX=p,c.inY=m):(c.outX=p,c.outY=m),!u.altKey){const g=Math.max(1e-4,Math.hypot(p,m)),v=u.shiftKey?g:l;o.side==="in"?(c.outX=-p/g*v,c.outY=-m/g*v):(c.inX=-p/g*v,c.inY=-m/g*v)}}),!0}const a=t.points.findIndex(c=>Math.hypot(c.x-s.x,c.y-s.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const c=s,l=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return Ua(u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y);for(const p of l)t.points[p.index].x=p.x+f.x-c.x,t.points[p.index].y=p.y+f.y-c.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const c=s,l=e.altKey,d=u=>{const h=Fi(this.ctx,u.clientX,u.clientY),f=da(t,h.x,h.y),p=Math.min(c.x,f.x),m=Math.max(c.x,f.x),g=Math.min(c.y,f.y),v=Math.max(c.y,f.y);t.points.forEach((y,b)=>{y.x>=p&&y.x<=m&&y.y>=g&&y.y<=v&&(l?this.selectedNodes.delete(b):this.selectedNodes.add(b))}),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d)};return window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d),!0}return!1}}class gV{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const n=t.colliders.find(y=>y.id===t.activeObjectId);if(!(n!=null&&n.enabled)||n.visible===!1)return!1;const s=Fi(this.ctx,e.clientX,e.clientY),r=n.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(n.scaleX??1)),l=Math.max(1e-4,Math.abs(n.scaleY??1)),d=s.x-n.x,u=s.y-n.y,h=(o*d+a*u)/c,f=(-a*d+o*u)/l;if(!(n.shape==="circle"?Math.hypot(h,f)<=n.radius:n.shape==="ellipse"?Math.hypot(h/Math.max(1,n.radiusX),f/Math.max(1,n.radiusY))<=1:Math.abs(h)<=n.width*.5&&Math.abs(f)<=n.height*.5))return!1;const m=n.x,g=n.y,v=s;return Ua(y=>{const b=Fi(this.ctx,y.clientX,y.clientY);n.x=m+b.x-v.x,n.y=g+b.y-v.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(d=>d.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const n=t==null?void 0:t.config;if(!(n!=null&&n.forceField)||!n.showForceFieldShape||n.forceRadius<=0)return!1;const s=Fi(this.ctx,e.clientX,e.clientY);if(Math.hypot(s.x-n.forceCenterX,s.y-n.forceCenterY)>n.forceRadius)return!1;const o=n.forceCenterX,a=n.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=d=>{const u=Fi(this.ctx,d.clientX,d.clientY);n.forceCenterX=o+u.x-s.x,n.forceCenterY=a+u.y-s.y},l=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const n=t==null?void 0:t.config;if(!(n!=null&&n.attraction)||!n.showAttractionShape)return!1;const s=Fi(this.ctx,e.clientX,e.clientY),r=Math.max(n.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(s.x-n.attractionCenterX,s.y-n.attractionCenterY)>r)return!1;const a=n.attractionCenterX,c=n.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const h=Fi(this.ctx,u.clientX,u.clientY);n.attractionCenterX=a+h.x-s.x,n.attractionCenterY=c+h.y-s.y},d=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,c)=>{o.centerX=a,o.centerY=c},setRotation:a=>{o.rootRotation=a},setScale:(a,c)=>{o.rootScaleX=a,o.rootScaleY=c}}}const s=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!s||s.visible===!1?null:{x:Number(s.x)||0,y:Number(s.y)||0,rotation:Number(s.rotation)||0,scaleX:Math.max(.05,Number(s.scaleX)||1),scaleY:Math.max(.05,Number(s.scaleY)||1),setPosition:(r,o)=>{s.x=r,s.y=o},setRotation:r=>{s.rotation=r},setScale:(r,o)=>{s.scaleX=r,s.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const n=this.ctx.app(),s=this.ctx.store,r=s.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+n.screen.width/2+s.editor.viewX+t.x*r,c=o.top+n.screen.height*.5+s.editor.viewY+-t.y*r,l=e.clientX,d=e.clientY,u=this.getTool(),h=t.x,f=t.y,p=t.rotation,m=t.scaleX,g=t.scaleY,v=Math.hypot(l-a,d-c)||1,y=Math.atan2(d-c,l-a);Ua(x=>{const T=(x.clientX-l)/r,E=(x.clientY-d)/r;if(u==="translate")t.setPosition(h+T,f-E);else if(u==="rotate"){const S=Math.atan2(x.clientY-c,x.clientX-a);t.setRotation(p-(S-y)*180/Math.PI)}else if(u==="scale"){const C=Math.hypot(x.clientX-a,x.clientY-c)/v;t.setScale(Math.max(.05,m*C),Math.max(.05,g*C))}})}}function xx(i,e,t,n,s){const r=1-s;return r*r*r*i+3*r*r*s*e+3*r*s*s*t+s*s*s*n}function wx(i,e,t){const n=i.rotation*Math.PI/180,s=Math.cos(n),r=Math.sin(n),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1));return{x:i.x+s*e*o-r*t*a,y:i.y+r*e*o+s*t*a}}function dv(i,e){if(!i.points.length)return null;if(i.points.length===1)return{...wx(i,i.points[0].x,i.points[0].y),angle:i.rotation};const t=i.closed?i.points.length:i.points.length-1,n=[];let s=0;for(let p=0;p0&&v===0)continue;const y=v/20,b=xx(m.x,m.x+m.outX,g.x+g.inX,g.x,y),x=xx(m.y,m.y+m.outY,g.y+g.inY,g.y,y),T=wx(i,b,x),E=n[n.length-1];E&&(s+=Math.hypot(T.x-E.x,T.y-E.y)),n.push({...T,distance:s})}}const r=Math.min(1,Math.max(0,e))*s;let o=n.findIndex(p=>p.distance>=r);o<0&&(o=n.length-1);const a=n[o],c=n[Math.max(0,o-1)],l=n[Math.min(n.length-1,o+1)],d=c.distance,u=o>0?(r-d)/Math.max(1e-4,a.distance-d):0,h=c.x+(a.x-c.x)*Math.min(1,Math.max(0,u)),f=c.y+(a.y-c.y)*Math.min(1,Math.max(0,u));return{x:h,y:f,angle:Math.atan2(l.y-c.y,l.x-c.x)*180/Math.PI}}function vV(i,e,t){if(e.renderLayerMode!=="slot")return null;const n=i.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.visible!==!1&&o.status==="ready");if(!n)return null;const s=n.slots||[],r=s.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=s.filter(c=>c.orderl.order-c.order)[0];if(!a)return null;o=a.name}return{spineId:n.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:n.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function ku(i,e,t,n=Math.max(1e-4,Math.abs(i.rootScaleX)),s=Math.max(1e-4,Math.abs(i.rootScaleY))){const r=-i.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-i.centerX,l=-t+i.centerY;return{x:(o*c+a*l)/n,y:(-a*c+o*l)/s}}function bV(i,e,t){const n=dv(e,t);if(!n)return null;const s=ku(i,n.x,n.y),r=n.angle*Math.PI/180,o=ku(i,n.x+Math.cos(r),n.y+Math.sin(r)),a=Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI;return{...s,angle:a}}function yV(i,e){return i.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const n=i.paths.find(d=>d.id===t.followPathId&&d.enabled);if(!(n!=null&&n.points.length))return t;const s=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/s)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?i.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,YC(o,r,a))),l=dv(n,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class xV{constructor(){A(this,"emitters",new Map);A(this,"configs",new Map);A(this,"store",null);A(this,"eventsSuspended",!1);A(this,"subEmitterState",new Map);A(this,"slotGroups",new Map)}sync(e,t,n,s,r=null){this.store=e;for(const[c,l]of this.emitters){const d=e.systems.find(u=>u.id===c);(!d||this.configs.get(c)!==d.config)&&(l.removeFromParent(),l.destroy({children:!0}),this.emitters.delete(c),this.configs.delete(c))}for(const c of e.systems){n&&!c.config.texture&&(c.config.texture=n);const l=fr(c.config);if(s)for(const u of l.trailResources)!u.texture&&(u.previewUrl==="/images/trail.png"||u.previewUrl==="/trails/trail.png")&&(u.texture=s);if(n)for(const u of l.imageResources)!u.texture&&u.textureName==="star"&&(u.texture=n);if(this.emitters.has(c.id))continue;const d=new xy(c.config);d.onParticleEvent=u=>this.handleParticleEvent(c.id,u),t.addChild(d),this.emitters.set(c.id,d),this.configs.set(c.id,c.config)}const o=ja(e.systems);for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;l.onParticleEvent||(l.onParticleEvent=u=>this.handleParticleEvent(c.id,u));const d=o.has(c.id);this.subEmitterState.get(c.id)!==d&&(d&&l.clear(),this.subEmitterState.set(c.id,d)),l.setAutoEmission(!d)}const a=new Set;for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;const d=r&&c.config.renderLayerMode==="slot"?r.getDrawOrder(c.config.renderLayerSpineId):null,u=vV(e.spines,c.config,d),h=u&&r?this.ensureSlotGroup(u,r,c.config):null;h?(a.add(h.key),l.parent!==h.compensator&&h.compensator.addChild(l)):l.parent!==t&&t.addChild(l)}for(const[c,l]of[...this.slotGroups])if(!a.has(c)){for(const d of[...l.compensator.children])d instanceof xy&&d.parent===l.compensator&&t.addChild(d);r==null||r.detachSlotObject(l.spineId,l.slotName,l.wrapper),l.wrapper.removeFromParent(),l.wrapper.removeChild(l.compensator),l.compensator.destroy(),l.wrapper.destroy(),this.slotGroups.delete(c)}}ensureSlotGroup(e,t,n){const s=`${e.spineId}:${e.targetSlotName}:${n.renderLayerSlotPosition}`;let r=this.slotGroups.get(s);if(!r){const o=new Mn,a=new Mn;o.addChild(a),r={key:s,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:n.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(s,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const n of this.slotGroups.values()){if(!n.attached||!n.wrapper.parent)continue;const s=e.spines.find(o=>o.id===n.spineId);if(!s)continue;const r=t.getSlotParentMatrix(n.spineId,n.slotName,s);r&&(r.invert(),n.compensator.transform.setFromMatrix(r))}}suspendEvents(e){this.eventsSuspended=e}handleParticleEvent(e,t){if(this.eventsSuspended)return;const n=this.store;if(!n)return;const s=n.systems.find(o=>o.id===e),r=s==null?void 0:s.config;if(!(!(r!=null&&r.eventEnabled)||!Array.isArray(r.events)||!r.events.length)&&!(t.depth>=2))for(const o of r.events){if(o.event!==t.kind||o.event==="collision"&&t.collisionCount>o.collisionLimit||o.targetSystemId<=0||o.targetSystemId===e)continue;const a=Math.min(1,Math.max(0,Number(o.probability)||0));if(a<=0)continue;const c=(Math.imul(o.id+1,2654435761)^Math.imul(t.depth+1,2246822507))>>>0;if(Dr(r.seed>>>0,t.spawnId+1,c)>=a)continue;const d=this.emitters.get(o.targetSystemId);if(!d)continue;const u=Array.isArray(o.inherit)?o.inherit:[],h=u.length?{attributes:u,colorMode:o.colorInheritMode==="replace"?"replace":"add",data:{colorHex:t.colorHex,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,life:t.maxLife}}:void 0;d.spawnEventParticle(t.worldX,t.worldY,t.depth+1,h)}}destroy(e){for(const t of this.slotGroups.values()){for(const n of[...t.compensator.children])t.compensator.removeChild(n);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,n]of this.emitters)n.removeFromParent(),n.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function wV(){const[i,e]=await Promise.all([tt.fromURL("/images/star.png"),tt.fromURL("/images/trail.png")]);return{dotTex:i,trailTex:e}}function SV(i,e,t){for(const n of i.systems){n.config.texture=e;const s=fr(n.config);if(t)for(const r of s.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of s.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const CV={class:"stage-wrap"},AV=Zt({__name:"Stage",setup(i){const e=Zo(),t=Re(null),n=Re(null),s=Re(!1),r=Re(!1),o=Re(""),a=Re(!1);e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);let c=null,l=null,d=null,u=null,h=null,f=null,p=null,m=null,g=null,v=null,y=null,b=null,x=null,T=null,E=null,S=null,C=[],M=0,k=0,P=0,I=0,N=null,$=null;const j=new Ep,B=new xV,Y={store:e,holder:t,app:()=>c},U=new mV(Y),D=new gV(Y,()=>o.value);let L=[];const R=new Map;function X(){d=new Mn,c.stage.addChild(d),E=new Mn,c.stage.addChild(E),j.createSprite(d),T=new ti,d.addChild(T),S=new N3,d.addChild(S.container),h=new ti,d.addChild(h),u=new ti,d.addChild(u),p=new ti,d.addChild(p),m=new ti,d.addChild(m),g=new ti,d.addChild(g),v=new ti,d.addChild(v),y=new ti,d.addChild(y),b=new ti,d.addChild(b),x=new ti,d.addChild(x),f=new ti,d.addChild(f)}function z(J){if(J.button===0){if(o.value&&D.selectedTransformTarget()){D.onGizmoDown(J);return}U.onPointerDown(J)||D.onColliderPointerDown(J)||D.onAttractionDown(J)||D.onForceFieldDown(J)||G5(Y,J.clientX,J.clientY)}}function K(J){U.onStageDoubleClick(J)}function Z(J){!e.settings.unsavedChangesPrompt||!wr.dirty||(J.preventDefault(),J.returnValue="")}function ae(J){H5(Y,J)}function ce(J=!0){Ep.clearStoreBackground(e,J)}async function ve(J){await Ep.handleFileChange(e,J)}_U({canvasElement:t,canvasFocused:a,undo:ZA,save:()=>window.dispatchEvent(new Event(zm)),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:J=>{o.value=J}});function we(){d&&B.sync(e,d,N,$,S)}function re(J,ie,se,G){const H=Math.max(2,Math.floor(G)||2);if(J.config.mode==="stream"&&J.config.streamBehavior==="loop"){rx(J,ie,se,H);return}ie.reset();const O=1/Math.max(1,se),V=[];for(let W=0;W=ie)continue;const O=B.emitters.get(H.id);O&&re(H,O,J,ie)}}finally{B.suspendEvents(!1)}e.systems.every(H=>{var O;return(((O=H.frames)==null?void 0:O.length)||0)>=ie})&&(e.timeline.recorded=!0)}function q(){var se,G,H,O;I=requestAnimationFrame(q);const J=performance.now()/1e3;let ie=J-M;if(M=J,ie>.1&&(ie=.1),c&&d){d.scale.set(e.editor.viewScale),d.position.set(c.screen.width/2+e.editor.viewX,c.screen.height*.5+e.editor.viewY),j.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),y3(e,c,T,E,C);const V=Math.max(1,e.timeline.fps),W=e.timeline.frame,ee=W/V;S==null||S.sync(e.spines,W,V),we(),B.updateRenderCompensation(e,S),L=yV(e,ee);for(const ft of e.systems){const Oe=B.emitters.get(ft.id);if(!Oe)continue;Oe.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const ot=ft.visible!==!1;Oe.visible=ot,Oe.renderable=ot;const Te=ft.config;Oe.scale.set(Te.rootScaleX,Te.rootScaleY);const ue=new Set(Te.collisionColliderIds);Oe.setColliders(Te.collision?L.filter(xt=>ue.has(xt.id)):[]),Oe.setEmitterFollowSpawn(0,0,0);let fe={x:Te.centerX,y:Te.centerY,rotation:Te.rootRotation};const nt=Te.emitterFollow&&Te.emitterFollowMode==="bone"?e.spines.find(xt=>xt.id===Te.emitterFollowSpineId&&xt.enabled&&xt.status==="ready"):null,mt=nt&&(S==null?void 0:S.getBoneWorldTransform(nt.id,Te.emitterFollowBoneName))||null,lt=Te.emitterFollow&&Te.emitterFollowMode==="path"?e.paths.find(xt=>xt.id===Te.emitterFollowPathId&&xt.enabled):null,ct=Math.max(.05,Te.emitterFollowDuration),Kn=Math.min(1,Math.max(0,ee/ct)),_i=Math.min(1,Math.max(0,YC(Te.emitterFollowCurve,Kn))),wn=Math.min(1,Math.max(0,Te.emitterFollowOffset)),gi=Te.emitterFollowDirection==="reverse"?(1-wn)*(1-_i):wn+(1-wn)*_i,Bn=lt?dv(lt,gi):null;if(mt){const xt=Te.emitterFollowBoneOffsetX,vi=Te.emitterFollowBoneOffsetY,Jn=mt.x+xt,Ui=mt.y+vi,Un=Te.rootRotation+Te.emitterFollowBoneRotation,Vi=Math.max(1e-4,Math.abs(Te.rootScaleX*Te.emitterFollowBoneScaleX)),Zn=Math.max(1e-4,Math.abs(Te.rootScaleY*Te.emitterFollowBoneScaleY));if(fe={x:Jn,y:Ui,rotation:Un},Te.emitterFollowSpace==="local")Oe.position.set(Jn,-Ui),Oe.rotation=-Un*Math.PI/180,Oe.scale.set(Vi,Zn),Oe.setSimulationTransform(Jn,Ui,Un,Vi,Zn);else{Oe.position.set(Te.centerX,-Te.centerY),Oe.rotation=-Te.rootRotation*Math.PI/180,Oe.scale.set(Vi,Zn),Oe.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation,Vi,Zn);const as=ku(Te,Jn,Ui,Vi,Zn),ho=-(Un-Te.rootRotation);Oe.setEmitterFollowSpawn(as.x,as.y,ho)}}else if(Bn){const xt=Bn.angle+(Te.emitterFollowDirection==="reverse"?180:0),vi=Te.emitterAngleMode==="direction"?xt:Te.rootRotation;if(fe={x:Bn.x,y:Bn.y,rotation:vi},Te.emitterFollowSpace==="local")Oe.position.set(Bn.x,-Bn.y),Oe.rotation=-vi*Math.PI/180,Oe.setSimulationTransform(Bn.x,Bn.y,vi);else{Oe.position.set(Te.centerX,-Te.centerY),Oe.rotation=-Te.rootRotation*Math.PI/180,Oe.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const Jn=ku(Te,Bn.x,Bn.y),Ui=Te.emitterAngleMode==="direction"?-(xt-Te.rootRotation):0;Oe.setEmitterFollowSpawn(Jn.x,Jn.y,Ui)}}else Oe.position.set(Te.centerX,-Te.centerY),Oe.rotation=-Te.rootRotation*Math.PI/180,Oe.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const Pn=Te.shape==="path"&&Te.spawnPathId>0&&e.paths.find(xt=>xt.id===Te.spawnPathId&&xt.enabled&&xt.points.length>0)||null;Oe.setSpawnPathSampler(Pn?xt=>bV(Te,Pn,xt):null,(Pn==null?void 0:Pn.closed)===!0),R.set(ft.id,fe)}let be=0;const ye=[],he=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,Be=(ft,Oe,ot)=>{!ft||ft.id!==he||ft.visible===!1||I3(ye,ot,Oe.position.x,Oe.position.y)},Ae=e.timeline,de=e.playbackRange,ge=Ae.fps,Ve=1/Math.max(1,ge);let qe=P,bt=0;if(Ae.playing?(k+=ie,bt=Math.floor(k/Ve),bt>0&&(k-=bt*Ve)):(k=0,Ee(ge)),Ae.playing&&bt>0)for(let ft=0;ftfe.id===e.activeId),ot=(Oe==null?void 0:Oe.config.mode)==="stream"&&Oe.config.streamBehavior==="loop"?eC(Oe.config,ge):null,ue=Ae.loop&&Ae.abLoop&&(ot==null?void 0:ot.start)===de.start&&ot.end===de.end?de.end-1:de.end;if(Ae.frame>ue)if(Ae.loop)Ae.frame=de.start;else{Ae.frame=de.end,Ae.playing=!1;break}}else{B.suspendEvents(!0);try{const Oe=ja(e.systems);for(const ot of e.systems){const Te=B.emitters.get(ot.id);if(!Te)continue;!Oe.has(ot.id)&&ot.config.mode==="stream"&&ot.config.streamBehavior==="loop"?(se=ot.frames)!=null&&se.length||rx(ot,Te,ge,Ae.totalFrames):Ae.frame===0&&Te.reset()}}finally{B.suspendEvents(!1)}for(const[Oe,ot]of B.emitters){const Te=e.systems.find(lt=>lt.id===Oe),ue=(Te==null?void 0:Te.config.mode)==="stream"&&Te.config.streamBehavior==="loop",fe=ue?(G=Te.frames)==null?void 0:G[Ae.frame]:void 0,nt=Ae.frame===0&&!ue,mt=nt?[]:fe||ot.update(Ve);if(nt?ot.apply([]):fe&&ot.apply(fe),(Te==null?void 0:Te.visible)!==!1)for(const lt of mt)lt.active&&Be(Te,ot,lt);be+=mt.length}for(const Oe of e.systems){if(!Oe.config.texture)continue;Oe.frames=Oe.frames||[];const ot=B.emitters.get(Oe.id);ot&&!(Oe.config.mode==="stream"&&Oe.config.streamBehavior==="loop")&&(Oe.frames[Ae.frame]=ot.capture())}Ae.frame++,Ae.frame>=Ae.totalFrames&&(Ae.frame=de.start,Ae.recorded=!0)}else{Ae.playing||(qe=Ae.frame);for(const ft of e.systems){const Oe=B.emitters.get(ft.id),ot=Ae.playing?P:Ae.frame,Te=(O=ft.frames)==null?void 0:O[ot],ue=ft.config.mode==="stream"&&ft.config.streamBehavior==="loop"&&!!Te;if((Ae.recorded||ue)&&Oe&&Te){Oe.apply(Te);for(const fe of Te)fe.active&&(Be(ft,Oe,fe),be++)}else if(Oe){const fe=Ae.frame===0?[]:Oe.update(0);if(Ae.frame===0&&Oe.apply([]),ft.visible!==!1)for(const nt of fe)nt.active&&Be(ft,Oe,nt);be+=Oe.activeCount}}}P=qe,S==null||S.sync(e.spines,qe,ge);for(const[,ft]of B.emitters)ft.drawTrailMeshDebug(e.settings.showSkinMesh);P3(e,L,y),k3(e,U.selectedNodes,b),E3(e,S,h),x3(e,R,u),w3(e,R,p),S3(e,m),C3(e,g),A3(e,v),_3(o,D.selectedTransformTarget.bind(D),x),R3(ye,e,f),n.value&&(n.value.systems=e.systems.length,n.value.particles=be)}}return Ti(async()=>{const J=t.value;c=new TS({width:J.clientWidth||800,height:J.clientHeight||600,backgroundAlpha:0,antialias:!0}),J.appendChild(c.view),l=new ResizeObserver(()=>{c&&c.renderer.resize(Math.max(1,J.clientWidth),Math.max(1,J.clientHeight))}),l.observe(J),X(),Ut(()=>e.settings.backgroundImageData,se=>j.syncTexture(se),{immediate:!0});const ie=await wV();N=ie.dotTex,$=ie.trailTex,SV(e,N,$),n.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,k=0,P=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const se of e.systems)se.frames=[];e.recalcTotalFrames(),M=performance.now()/1e3,q(),Ut(()=>e.systems.map(se=>JSON.stringify(se.config,(G,H)=>G==="texture"||G==="trailTexture"||G==="previewUrl"?void 0:H)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const se of e.systems)se.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),AU(e),window.addEventListener("beforeunload",Z)}),nl(()=>{window.removeEventListener("beforeunload",Z),cancelAnimationFrame(I),l==null||l.disconnect(),l=null,S==null||S.destroy(),S=null,j.destroy(),d&&c&&B.destroy(d),c&&(c.destroy(!0,{children:!0}),c=null)}),Ut(()=>[e.activeObjectType,e.activeObjectId],()=>U.resetSelection()),(J,ie)=>(Q(),te("div",CV,[w("div",{ref_key:"holder",ref:t,class:Pe(["stage-holder",{grid:_(e).settings.showGrid}]),tabindex:"0",onWheel:We(ae,["prevent"]),onPointerdown:z,onDblclick:We(K,["prevent"])},null,34),w("img",{class:Pe(["stage-watermark",{"watermark-left-panel":!_(e).settings.parameterPanelOnRight}]),src:v3,alt:"","aria-hidden":"true"},null,2),Ce(L8,{ctx:Y,"active-tool":o.value,hud:n.value,"show-settings":s.value,"show-help":r.value,"onUpdate:activeTool":ie[0]||(ie[0]=se=>o.value=se),"onUpdate:showSettings":ie[1]||(ie[1]=se=>s.value=se),"onUpdate:showHelp":ie[2]||(ie[2]=se=>r.value=se),onClearBackground:ce,onBackgroundFile:ve},null,8,["active-tool","hud","show-settings","show-help"]),Ce(pV,{show:s.value,onClose:ie[3]||(ie[3]=se=>s.value=!1)},null,8,["show"]),Ce(j5,{show:r.value,onClose:ie[4]||(ie[4]=se=>r.value=!1)},null,8,["show"])]))}}),TV=dn(AV,[["__scopeId","data-v-9119521a"]]),EV=[{x:0,y:0},{x:1,y:1}],Hm=[{x:0,y:1},{x:1,y:1}],_V=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],Gm=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],Wm=[{x:0,y:1},{x:1,y:1}],qm=[{x:0,y:1},{x:1,y:1}],hn=qo({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let xd=0;function MV(i){return new Promise(e=>window.setTimeout(e,i))}function iT(i,e){const t=++xd,n=performance.now();Object.assign(hn,{visible:!0,title:i,detail:e,progress:0,indeterminate:!1,failed:!1});const s=(o,a)=>{t===xd&&(hn.indeterminate=o==null,o!=null&&(hn.progress=Math.min(100,Math.max(0,o))),a&&(hn.detail=a))},r=async(o,a)=>{if(t!==xd)return;hn.failed=o,hn.indeterminate=!1,hn.progress=o?hn.progress:100,hn.detail=a,await MV(Math.max(180,(o?850:450)-(performance.now()-n))),t===xd&&(hn.visible=!1)};return{update:s,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o=ke("transfer.completed"))=>r(!1,o),fail:(o=ke("transfer.failed"))=>r(!0,o)}}async function PV(i,e){if(!i.body)return e(null),i.text();const t=Number(i.headers.get("content-length")),n=Number.isFinite(t)&&t>0,s=i.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(n?0:null);;){const{done:c,value:l}=await s.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(n?Math.min(1,o/t):null)}return a+=r.decode(),n&&e(1),a}const kV="3.8";function Li(i,e,t){i[e]==null&&i[t]!=null&&(i[e]=i[t]),delete i[t]}function Km(i){if(!i||typeof i!="object")return;if(Array.isArray(i)){for(const t of i)Km(t);return}const e=i;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Km(t)}function IV(i){for(const e of i.bones)Li(e,"transform","inherit");for(const e of i.transform||[])Li(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Li(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of i.path||[])Li(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of i.skins)for(const t of Object.values(e.attachments||{}))for(const n of Object.values(t||{}))n.parent!=null&&Li(n,"deform","timelines")}function RV(i){for(const e of Object.values(i.slots||{}))Li(e,"color","rgba"),Li(e,"twoColor","rgba2")}function FV(i){for(const e of Object.values(i.bones||{}))for(const t of e.rotate||[])Li(t,"angle","value")}function LV(i){for(const e of Object.values(i.transform||{}))for(const t of e)Li(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Li(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function DV(i){for(const e of Object.values(i.path||{})){for(const t of["position","spacing"])for(const n of e[t]||[])Li(n,t,"value");for(const t of e.mix||[])Li(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function OV(i){if(!i.attachments)return;const e=i.deform||(i.deform={});for(const[t,n]of Object.entries(i.attachments)){const s=e[t]||(e[t]={});for(const[r,o]of Object.entries(n)){const a=s[r]||(s[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete i.attachments}function NV(i){i.skeleton.spine=kV,IV(i);for(const e of Object.values(i.animations))RV(e),FV(e),LV(e),DV(e),OV(e);return Km(i.animations),i}function $V(i,e,t,n,s=!1){if(s){let c=0;for(let l=0;l[...s].sort((a,c)=>a-c);let o=!0;for(;o;){o=!1;const a=r();for(let c=0;cf&&(f=m,h=p)}h>=0&&(s.add(h),o=!0)}}return r().map(a=>i[a])}function Sx(i,e,t,n,s){const r=t-e+1;if(r<2)return 0;const o=s?e:t,a=s?e+1:t-1,c=s?e+2:t-2,l=Math.abs(i[a].frame-i[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(i[c].frame-i[a].frame)-l)<1e-6){const u=i[o].values[n],h=i[a].values[n],f=i[c].values[n];return s?(-3*u+4*h-f)/(2*l):(3*u-4*h+f)/(2*l)}const d=i[a].frame-i[o].frame;return d?(i[a].values[n]-i[o].values[n])/d:0}function Cx(i,e,t){const n=i[t].frame-i[e].frame,s=[];for(let r=0;rh.values[r])),l=Math.max(...i.slice(e,t+1).map(h=>h.values[r])),d=o+Sx(i,e,t,r,!0)*n/3,u=a-Sx(i,e,t,r,!1)*n/3;s.push([Math.max(c,Math.min(l,d)),Math.max(c,Math.min(l,u))])}return{values:s}}function BV(i,e,t,n,s){const r=1-s;return r*r*r*i+3*r*r*s*e+3*r*s*s*t+s*s*s*n}function UV(i,e,t,n,s,r=!1){if(r){let l=0;for(let d=0;d[...s].sort((c,l)=>c-l);let o=!0;for(;o;){o=!1;const c=r();for(let l=0;lm&&(m=v,p=g)}p>=0&&(s.add(p),o=!0)}}const a=r();return{samples:a.map(c=>i[c]),controls:a.slice(0,-1).map((c,l)=>Cx(i,c,a[l+1]))}}function VV(i){if(!i.length)return[];const e=[i[0]];for(let t=1;t180;)n-=360;for(;n-e[t-1]<-180;)n+=360;e.push(n)}return e}function gn(i){if(!Number.isFinite(i))return 0;const e=Math.round(i*1e5)/1e5;return Object.is(e,-0)?0:e}function XV(i,e,t,n){const s=Math.max(2,Math.min(16,Math.round(Number(i.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(i.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),c=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,d=Math.cos(l),u=Math.sin(l),h=[],f=[],p=[],m=[],g=[];for(let b=0;b=0;b--)g.push({col:b,row:s-1});for(let b=s-2;b>=1;b--)g.push({col:0,row:b});const v=g.length;for(let b=1;b|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function oT(i,e){let t=i,n=2;for(;e.has(t);)t=`${i}_${n++}`;return e.add(t),t}function zV(i){return i.replace(/\.[^./\\]+$/,"")}function aT(i,e){return zV([i,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function jV(i){var n,s;const e=Number(((n=i==null?void 0:i.orig)==null?void 0:n.width)??(i==null?void 0:i.width))||0,t=Number(((s=i==null?void 0:i.orig)==null?void 0:s.height)??(i==null?void 0:i.height))||0;return{width:e,height:t}}function Sd(i){return Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function Mx(i,e){return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255,Math.max(0,Math.min(1,e))]}function Xl(i,e){return gn(i/e)}function HV(i,e){const t=i.config,n=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),s=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=s+n:t.streamBehavior!=="loop"?r=s+Math.max(1/e,Number(t.duration)||0)+n:r=s+Ji(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function GV(i,e,t){const n=i.config;if(n.mode!=="stream"||n.streamBehavior!=="loop")return new Set;const s=eC(n,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(s.start*r),Math.round(s.end*r)])}function Iu(i,e){return e?i.boneName:`${i.spawnId??"legacy"}_${i.boneName}`}function WV(i,e,t,n){const s=new Set;for(const r of i)for(const o of r)s.add(Iu(o,e));return[...s].sort().map((r,o)=>({key:r,name:oT(`${n}_${o}`,t),states:i.map(a=>a.find(c=>Iu(c,e)===r)||null)}))}function Px(i,e){const t=new Set(e.states.map(n=>n==null?void 0:n.resourceId).filter(n=>typeof n=="number"));return i.config.imageResources.filter(n=>t.has(n.id))}function qV(i,e,t,n){const s=e*t/n,r=Math.min(i.states.length-1,Math.max(0,Math.floor(s))),o=Math.min(i.states.length-1,r+1),a=i.states[r],c=i.states[o];if(!a||!c||Iu(a,!0)!==Iu(c,!0)||a.spawnId!==c.spawnId)return a;const l=s-r;if(l<=1e-6)return a;const d=(h,f)=>(h??0)+((f??h??0)-(h??0))*l,u=a.trailState&&c.trailState&&a.trailState.resourceId===c.trailState.resourceId?{...a.trailState,width:d(a.trailState.width,c.trailState.width),alpha:d(a.trailState.alpha,c.trailState.alpha),bones:a.trailState.bones.map((h,f)=>{const p=c.trailState.bones[f]||h;return{...h,worldX:d(h.worldX??h.x,p.worldX??p.x),worldY:d(h.worldY??h.y,p.worldY??p.y),worldRotation:d(h.worldRotation??-h.rotation,p.worldRotation??-p.rotation)}})}:a.trailState;return{...a,worldX:d(a.worldX,c.worldX),worldY:d(a.worldY,c.worldY),worldRotation:d(a.worldRotation,c.worldRotation),worldScaleX:d(a.worldScaleX,c.worldScaleX),worldScaleY:d(a.worldScaleY,c.worldScaleY),alpha:d(a.alpha,c.alpha),trailState:u}}function kx(i,e){return!i||i==="跟随导出"?e.keyframeCurve:i==="贝塞尔"?"bezier":"linear"}function ha(i,e,t,n,s,r=new Set,o=new Set,a=s.keyframeCurve){if(!i.length)return[];const c=new Set(r);for(const u of o)c.add(u);const l=a==="bezier"&&s.spineVersion!=="3.8"?rT(i,n,c,o):{samples:sT(i,n,c,o),controls:[]},d=l.samples.map(u=>{const h={time:Xl(u.frame,e)};return t.forEach((f,p)=>{h[f]=gn(u.values[p])}),o.has(u.frame)&&(h.curve="stepped"),h});for(let u=0;u0&&s&&e.add(t-1),n&&e.add(t))}return e}function JV(i){const e=new Set;for(let t=0;t0&&s&&e.add(t-1),n&&e.add(t))}return e}function eX(i,e){var n;if(!i.shapeEnabled||!((n=i.shapeCurve)!=null&&n.length))return 1;const t=[...i.shapeCurve].sort((s,r)=>s.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let s=1;s{(o!==r||n.has(a))&&(s.push(t(o,a)),r=o)}),s}function nX(i,e,t){const n=i.imageMode==="sequence"?i.sequenceFrames[e]:void 0,s=(n==null?void 0:n.name)||i.textureName||`image_${i.id}`,r=(n==null?void 0:n.texture)||i.texture,o=jV(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:ke("errors.missingImageWarning",{file:s})});const a=o.width||1,c=o.height||1;return{path:aT(i.textureFolder,s),x:gn((.5-i.anchorX)*a),y:gn((i.anchorY-.5)*c),width:gn(a),height:gn(c)}}function Ix(i,e){const t=[];for(const s of e){const r=s.imageMode==="sequence"?Math.max(1,s.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((s,r)=>[s,n?`${i}_${r}`:i]))}function iX(i,e,t,n,s=n.keyframeCurve,r=new Set,o=new Set){if(!i.length)return[];const a=new Set;for(let h=1;h({frame:f,values:h})),l=1/255,d=s==="bezier"&&n.spineVersion!=="3.8"?rT(c,[l,l,l,.01],a,r):{samples:sT(c,[l,l,l,.01],a,r),controls:[]},u=d.samples.map(h=>{const f={time:Xl(h.frame,t),color:`${Sd(h.values[0])}${Sd(h.values[1])}${Sd(h.values[2])}${Sd(h.values[3])}`};return r.has(h.frame)&&(f.curve="stepped"),f});if(d.controls.length)for(let h=0;h({time:Xl(p,s),name:f??null}),c);d.length&&(l.attachment=d);const u=iX(n,t,s,r,o,a,c);u.length&&(l.rgba=u)}function Fx(i){var m;const e=i.settings,t=Math.max(1,Number(i.timeline.fps)||30),n=Math.max(1,Math.round(e.fps||30)),s=e.integerFrameAlignment?n:t,r=[],o=i.systems.filter(g=>g.visible!==!1),a=ja(i.systems),c={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(c.skeleton.fps=n);const l=c.skins[0].attachments,d=new Set(["root"]),u=[...new Set([...i.timeline.animations.length?i.timeline.animations:["animation"],...o.map(g=>g.animation||"animation")])],h=new Map;for(const g of o){const v=((m=g.frames)==null?void 0:m.length)||0,y=a.has(g.id)?v:Math.min(v,HV(g,t)),b=(g.frames||[]).slice(0,y);b.length||r.push({code:"empty-cache",message:ke("errors.emptyCacheWarning",{name:g.config.name})});const x=oT(YV(g.config.name,`system_${g.id}`),d);c.bones.push({name:x,parent:"root"});const T=WV(b,e.bonePool,d,x),E=Math.max(0,(y-1)/t),S=Math.max(1,Math.ceil(E*s)+1),C=GV(g,t,s),M=h.get(g.animation)||[];M.push({system:g,tracks:T,targetFrames:S,boundaryFrames:C,attachmentPrefix:x}),h.set(g.animation,M);for(const k of T){c.bones.push({name:k.name,parent:x});const P=Px(g,k),I=new Set(P.map(Y=>Y.blend)),N=[],$=[];for(const Y of I){const U=`${k.name}_${Y}`;N.push(U),c.slots.push({name:U,bone:k.name,color:"ffffff00",blend:Ax[Y]});const D=l[U]||(l[U]={}),L=P.filter(X=>X.blend===Y),R=Ix(x,L);for(const X of L){const z=X.imageMode==="sequence"?Math.max(1,X.sequenceFrames.length):1;for(let K=0;K{var K;return((K=z==null?void 0:z.trailState)==null?void 0:K.resourceId)===Y.id}))continue;const U=Math.max(2,Math.min(16,Math.round(Y.boneCount||3))),D=[];for(let z=0;zc.bones.findIndex(K=>K.name===z)),X=aT("",Y.textureName||`trail_${Y.id}`);(l[L]||(l[L]={}))[`trail_${Y.id}`]=XV(g.config,Y,R,X),Y.texture||r.push({code:"missing-image",message:ke("errors.missingTrailImageWarning",{file:Y.textureName||Y.id})})}const j=new Set([...N,...$]),B=c.slots.filter(Y=>j.has(String(Y.name)));B.length&&(c.slots=c.slots.filter(Y=>!B.includes(Y)),c.slots.push(...B.filter(Y=>$.includes(String(Y.name))),...B.filter(Y=>N.includes(String(Y.name)))))}}for(const g of u){const v=h.get(g)||[],y={bones:{},slots:{}};let b=!1;for(const{system:x,tracks:T,targetFrames:E,boundaryFrames:S,attachmentPrefix:C}of v)for(const M of T){const k=Array.from({length:E},(Z,ae)=>qV(M,ae,t,s)),P=k.map(Z=>!!(Z!=null&&Z.active)),I=[],N=[],$=[];k.forEach((Z,ae)=>{Z!=null&&Z.active&&(I.push({frame:ae,values:[Z.worldX??Z.x,Z.worldY??Z.y]}),N.push(Z.worldRotation??Z.rotation),$.push({frame:ae,values:[Z.worldScaleX??Z.scaleX,Z.worldScaleY??Z.scaleY]}))});const j=VV(N),B=I.map((Z,ae)=>({frame:Z.frame,values:[j[ae]??0]})),Y=KV(k);for(const Z of S)Y.add(Z);const U=JV(k),D={},L=ha(I,s,["x","y"],[Tx,Tx],e,Y,U),R=ha(B,s,["value"],[_x],e,Y,U),X=ha($,s,["x","y"],[wd,wd],e,Y,U);L.length&&(D.translate=L),R.length&&(D.rotate=R),X.length&&(D.scale=X),Object.keys(D).length&&(y.bones[M.name]=D,b=!0);const z=Px(x,M),K=new Set(z.map(Z=>Z.blend));for(const Z of K){const ae=z.filter(J=>J.blend===Z),ce=Ix(C,ae),ve=[],we=[];let re=16777215;for(let J=0;JO.id===ie.resourceId):void 0,G=!!ie&&P[J]&&ie.imageVisible!==!1&&(se==null?void 0:se.blend)===Z;ie&&(se==null?void 0:se.blend)===Z&&(re=ie.colorHex);const H=G?ce.get(`${se.id}_${ie.imageFrameIndex??0}`):void 0;ve.push(H??null),we.push(Mx(re,G?ie.alpha:0))}const Ee=ae.filter(J=>J.independentAlpha==="curve").map(J=>kx(J.alphaCurveMode,e)),q=Ee.length?Ee.includes("bezier")?"bezier":"linear":kx(x.config.alphaMode==="curve"?x.config.curveMode:void 0,e);Rx(y,`${M.name}_${Z}`,ve,we,s,e,q,U,S),ve.some(Boolean)&&(b=!0)}if(x.config.trail)for(const Z of x.config.trailResources){const ae=Math.max(2,Math.min(16,Math.round(Z.boneCount||3))),ce=k.map(H=>{var O;return((O=H==null?void 0:H.trailState)==null?void 0:O.resourceId)===Z.id?H.trailState:void 0}),ve=ce.find(H=>!!H);if(!ve)continue;const we=QV(ce),re=ZV(ce),Ee=Z.widthSizeMode==="random"?Math.max(1,Number(Z.widthMin)||0,Number(Z.widthMax)||0):Math.max(.001,Number(Z.width)||100);let q=ve;const J=ce.map(H=>(H&&(q=H),q));for(let H=0;H{const qe=ge==null?void 0:ge.bones[Math.min(ge.bones.length-1,H)];if(!qe)return;const bt={x:qe.worldX??qe.x,y:qe.worldY??qe.y,rotation:qe.worldRotation??-qe.rotation};O.push({frame:Ve,values:[bt.x,bt.y]}),V.push({frame:Ve,values:[bt.rotation]}),W.push({frame:Ve,values:[1,Math.max(0,ge.width/Ee)*be]})});const ye=`${M.name}_trail_${Z.id}_${H}`,he={},Be=ha(O,s,["x","y"],[Ex,Ex],e,ee,re),Ae=ha(V,s,["value"],[_x],e,ee,re),de=ha(W,s,["x","y"],[wd,wd],e,ee,re);Be.length&&(he.translate=Be),Ae.length&&(he.rotate=Ae),de.length&&(he.scale=de),Object.keys(he).length&&(y.bones[ye]=he)}const ie=ce.map(()=>`trail_${Z.id}`);let se=ve.colorHex;const G=ce.map(H=>(H&&(se=H.colorHex),Mx(se,H?H.alpha:0)));Rx(y,`${M.name}_trail_${Z.id}`,ie,G,s,e,e.keyframeCurve,re,S),b=!0}}(b||!e.excludeEmptyAnimations)&&(c.animations[g]=y)}!Object.keys(c.animations).length&&!e.excludeEmptyAnimations&&(c.animations.animation={bones:{},slots:{}});const f=e.spineVersion==="3.8"?NV(c):c,p=JSON.stringify(f,null,2);return{json:f,text:p,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(f.animations).length,boneCount:f.bones.length}}function sX(i,e){const t=new Blob([i.text],{type:"application/json;charset=utf-8"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}class rte{constructor(){A(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class rX{constructor(){A(this,"entries",{});A(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let n=0,s=e.length;n1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>`0${(t*255).toString(16)}`.slice(-2);return+`0x${e(this.r)}${e(this.g)}${e(this.b)}`}static fromString(e,t=new wi){return t.setFromString(e)}};A(wi,"WHITE",new wi(1,1,1,1)),A(wi,"RED",new wi(1,0,0,1)),A(wi,"GREEN",new wi(0,1,0,1)),A(wi,"BLUE",new wi(0,0,1,1)),A(wi,"MAGENTA",new wi(1,0,1,1));let at=wi;const rn=class rn{static clamp(e,t,n){return en?n:e}static cosDeg(e){return Math.cos(e*rn.degRad)}static sinDeg(e){return Math.sin(e*rn.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*rn.radDeg}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return rn.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,n){const s=Math.random(),r=t-e;return s<=(n-e)/r?e+Math.sqrt(s*r*(n-e)):t-Math.sqrt((1-s)*r*(t-n))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};A(rn,"epsilon",1e-5),A(rn,"epsilon2",rn.epsilon*rn.epsilon),A(rn,"PI",3.1415927),A(rn,"PI2",rn.PI*2),A(rn,"invPI2",1/rn.PI2),A(rn,"radiansToDegrees",180/rn.PI),A(rn,"radDeg",rn.radiansToDegrees),A(rn,"degreesToRadians",rn.PI/180),A(rn,"degRad",rn.degreesToRadians);let Fe=rn;const Pi=class Pi{apply(e,t,n){return t===void 0||n===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(n)}};A(Pi,"linear",new class extends Pi{applyInternal(e){return e}}),A(Pi,"smooth",new class extends Pi{applyInternal(e){return e*e*(3-2*e)}}),A(Pi,"slowFast",new class extends Pi{applyInternal(e){return e*e}}),A(Pi,"fastSlow",new class extends Pi{applyInternal(e){return(e-1)*(e-1)*-1+1}}),A(Pi,"circle",new class extends Pi{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let Va=Pi;class oX extends Va{constructor(t){super();A(this,"power",2);this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class ote extends oX{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Vr=class Vr{static arrayCopy(e,t,n,s,r){for(let o=t,a=s;o=t?e:Vr.setArraySize(e,t,n)}static newArray(e,t){const n=[];for(let s=0;s0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class cte{constructor(e=32){A(this,"values");A(this,"addedValues",0);A(this,"lastValue",0);A(this,"mean",0);A(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{d.width=parseInt(n[1]),d.height=parseInt(n[2])},s.format=()=>{},s.filter=d=>{d.minFilter=Ze.enumValue(Wa,n[1]),d.magFilter=Ze.enumValue(Wa,n[2])},s.repeat=d=>{n[1].indexOf("x")!==-1&&(d.uWrap=qa.Repeat),n[1].indexOf("y")!==-1&&(d.vWrap=qa.Repeat)},s.pma=d=>{d.pma=n[1]==="true"};var r={};r.xy=d=>{d.x=parseInt(n[1]),d.y=parseInt(n[2])},r.size=d=>{d.width=parseInt(n[1]),d.height=parseInt(n[2])},r.bounds=d=>{d.x=parseInt(n[1]),d.y=parseInt(n[2]),d.width=parseInt(n[3]),d.height=parseInt(n[4])},r.offset=d=>{d.offsetX=parseInt(n[1]),d.offsetY=parseInt(n[2])},r.orig=d=>{d.originalWidth=parseInt(n[1]),d.originalHeight=parseInt(n[2])},r.offsets=d=>{d.offsetX=parseInt(n[1]),d.offsetY=parseInt(n[2]),d.originalWidth=parseInt(n[3]),d.originalHeight=parseInt(n[4])},r.rotate=d=>{const u=n[1];u==="true"?d.degrees=90:u!=="false"&&(d.degrees=parseInt(u))},r.index=d=>{d.index=parseInt(n[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(n,o)===0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const d=new cT(a,o);for(;;){const u=t.readEntry(n,o=t.readLine());if(u===0)break;const h=r[n[0]];if(h)h(d);else{c||(c=[]),l||(l=[]),c.push(n[0]);const f=[];for(let p=0;p0&&l&&l.length>0&&(d.names=c,d.values=l,c=null,l=null),d.u=d.x/a.width,d.v=d.y/a.height,d.degrees===90?(d.u2=(d.x+d.height)/a.width,d.v2=(d.y+d.width)/a.height):(d.u2=(d.x+d.width)/a.width,d.v2=(d.y+d.height)/a.height),this.regions.push(d)}else{for(a=new dX(o.trim());t.readEntry(n,o=t.readLine())!==0;){const d=s[n[0]];d&&d(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length===0))return 0;const n=t.indexOf(":");if(n===-1)return 0;e[0]=t.substr(0,n).trim();for(let s=1,r=n+1;;s++){const o=t.indexOf(",",r);if(o===-1)return e[s]=t.substr(r).trim(),s;if(e[s]=t.substr(r,o-r).trim(),r=o+1,s===4)return 4}}}class dX{constructor(e){A(this,"name");A(this,"minFilter",Wa.Nearest);A(this,"magFilter",Wa.Nearest);A(this,"uWrap",qa.ClampToEdge);A(this,"vWrap",qa.ClampToEdge);A(this,"texture",null);A(this,"width",0);A(this,"height",0);A(this,"pma",!1);A(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class cT extends lT{constructor(t,n){super();A(this,"page");A(this,"name");A(this,"x",0);A(this,"y",0);A(this,"offsetX",0);A(this,"offsetY",0);A(this,"originalWidth",0);A(this,"originalHeight",0);A(this,"index",0);A(this,"degrees",0);A(this,"names",null);A(this,"values",null);this.page=t,this.name=n,t.regions.push(this)}}const $u=class $u{constructor(e){A(this,"name");A(this,"timelineAttachment");A(this,"timelineSlots",$u.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,n){let s=e[t];if(s.bone.isActive()){const r=(n?s.getAppliedPose():s.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*c;const l=n.appliedPose.deform;let d=this.vertices;const u=this.bones;if(!u){l.length>0&&(d=l);const m=n.bone.appliedPose,g=m.worldX,v=m.worldY,y=m.a,b=m.b,x=m.c,T=m.d;for(let E=s,S=a;S=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let n=e;const s=(this.start+t).toString();for(let r=this.digits-s.length;r>0;r--)n+="0";return n+=s,n}static nextID(){return Ea._nextID++}};A(Ea,"_nextID",0);let Ja=Ea;var Nn;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Nn||(Nn={}));const dT=[Nn.hold,Nn.once,Nn.loop,Nn.pingpong,Nn.onceReverse,Nn.loopReverse,Nn.pingpongReverse];class uv{constructor(e,t,n){A(this,"name");A(this,"timelines",[]);A(this,"timelineIds");A(this,"bones");A(this,"color",new at(1,1,1,1));A(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=n,this.timelineIds=new rX,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const n=new Set,s=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let h=0,f=u.length;ht)return r-n;return s-n}};function uX(i){return typeof i=="object"&&i!==null&&typeof i.slotIndex=="number"}class ea extends Gt{constructor(t,n,...s){super(t,...s);A(this,"curves");this.curves=Ze.newFloatArray(t+n*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const n=this.getFrameCount()+t*18;if(this.curves.length>n){const s=Ze.newFloatArray(n);Ze.arrayCopy(this.curves,0,s,0,n),this.curves=s}}setBezier(t,n,s,r,o,a,c,l,d,u,h){const f=this.curves;let p=this.getFrameCount()+t*18;s===0&&(f[n]=2+p);const m=(r-a*2+l)*.03,g=(o-c*2+d)*.03,v=((a-l)*3-r+u)*.006,y=((c-d)*3-o+h)*.006;let b=m*2+v,x=g*2+y,T=(a-r)*.3+m+v*.16666667,E=(c-o)*.3+g+y*.16666667,S=r+T,C=o+E;for(let M=p+18;pt){const d=this.frames[n],u=this.frames[n+s];return u+(t-d)/(o[r]-d)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const d=o[r-2],u=o[r-1];return u+(t-d)/(o[r]-d)*(o[r+1]-u)}n+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[n]-c)*(this.frames[n+s]-l)}}class lr extends ea{constructor(e,t,n){super(e,t,n)}getFrameEntries(){return 2}setFrame(e,t,n){e<<=1,this.frames[e]=t,this.frames[e+1]=n}getCurveValue(e){const t=this.frames;let n=t.length-2;for(let r=2;r<=n;r+=2)if(t[r]>e){n=r-2;break}const s=this.curves[n>>1];switch(s){case 0:{const r=t[n],o=t[n+1];return o+(e-r)/(t[n+2]-r)*(t[n+2+1]-o)}case 1:return t[n+1]}return this.getBezierValue(e,n,1,s-2)}getRelativeValue(e,t,n,s,r,o){if(e>2];switch(f){case 0:{const p=u[h];c=u[h+1],l=u[h+2],d=u[h+3];const m=(n-p)/(u[h+4]-p);c+=(u[h+4+1]-c)*m,l+=(u[h+4+2]-l)*m,d+=(u[h+4+3]-d)*m;break}case 1:c=u[h+1],l=u[h+2],d=u[h+3];break;default:c=this.getBezierValue(n,h,1,f-2),l=this.getBezierValue(n,h,2,f+18-2),d=this.getBezierValue(n,h,3,f+36-2)}if(s!==1)if(r===Ge.setup){const p=e.data.setupPose.color;c=p.r+(c-p.r)*s,l=p.g+(l-p.g)*s,d=p.b+(d-p.b)*s}else c=a.r+(c-a.r)*s,l=a.g+(l-a.g)*s,d=a.b+(d-a.b)*s;a.r=c<0?0:c>1?1:c,a.g=l<0?0:l>1?1:l,a.b=d<0?0:d>1?1:d}}class CT extends lr{constructor(t,n,s){super(t,n,`${rt.alpha}|${s}`);A(this,"slotIndex",0);this.slotIndex=s}apply(t,n,s,r,o,a,c,l,d){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const h=(d?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(s1?1:f}}class AT extends Ah{constructor(e,t,n){super(e,t,n,`${rt.rgb}|${n}`,`${rt.alpha}|${n}`,`${rt.rgb2}|${n}`)}getFrameEntries(){return 8}setFrame(e,t,n,s,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=n,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c,this.frames[e+7]=l}apply1(e,t,n,s,r,o){const a=t.color,c=t.darkColor;let l=0,d=0,u=0;const h=this.frames;if(n>3];switch(y){case 0:{const b=h[v];f=h[v+1],p=h[v+2],m=h[v+3],g=h[v+4],l=h[v+5],d=h[v+6],u=h[v+7];const x=(n-b)/(h[v+8]-b);f+=(h[v+8+1]-f)*x,p+=(h[v+8+2]-p)*x,m+=(h[v+8+3]-m)*x,g+=(h[v+8+4]-g)*x,l+=(h[v+8+5]-l)*x,d+=(h[v+8+6]-d)*x,u+=(h[v+8+7]-u)*x;break}case 1:f=h[v+1],p=h[v+2],m=h[v+3],g=h[v+4],l=h[v+5],d=h[v+6],u=h[v+7];break;default:f=this.getBezierValue(n,v,1,y-2),p=this.getBezierValue(n,v,2,y+18-2),m=this.getBezierValue(n,v,3,y+36-2),g=this.getBezierValue(n,v,4,y+54-2),l=this.getBezierValue(n,v,5,y+72-2),d=this.getBezierValue(n,v,6,y+90-2),u=this.getBezierValue(n,v,7,y+108-2)}if(s===1)a.set(f,p,m,g);else if(r===Ge.setup){const b=e.data.setupPose;let x=b.color;a.set(x.r+(f-x.r)*s,x.g+(p-x.g)*s,x.b+(m-x.b)*s,x.a+(g-x.a)*s),x=b.darkColor,l=x.r+(l-x.r)*s,d=x.g+(d-x.g)*s,u=x.b+(u-x.b)*s}else a.add((f-a.r)*s,(p-a.g)*s,(m-a.b)*s,(g-a.a)*s),l=c.r+(l-c.r)*s,d=c.g+(d-c.g)*s,u=c.b+(u-c.b)*s;c.r=l<0?0:l>1?1:l,c.g=d<0?0:d>1?1:d,c.b=u<0?0:u>1?1:u}}class TT extends Ah{constructor(e,t,n){super(e,t,n,`${rt.rgb}|${n}`,`${rt.rgb2}|${n}`)}getFrameEntries(){return 7}setFrame(e,t,n,s,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=n,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c}apply1(e,t,n,s,r,o){const a=t.color,c=t.darkColor;let l=0,d=0,u=0,h=0,f=0,p=0;const m=this.frames;if(n1?1:l,a.g=d<0?0:d>1?1:d,a.b=u<0?0:u>1?1:u,c.r=h<0?0:h>1?1:h,c.g=f<0?0:f>1?1:f,c.b=p<0?0:p>1?1:p}}class Yl extends Gt{constructor(t,n){super(t,`${rt.attachment}|${n}`);A(this,"slotIndex",0);A(this,"attachmentNames");this.slotIndex=n,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n,s){this.frames[t]=n,this.attachmentNames[t]=s}apply(t,n,s,r,o,a,c,l,d){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const h=d?u.appliedPose:u.pose;l||st){const l=this.frames[n];return s[r+1]*(t-l)/(s[r]-l)}const o=r+18;for(r+=2;r=t){const l=s[r-2],d=s[r-1];return d+(t-l)/(s[r]-l)*(s[r+1]-d)}const a=s[o-2],c=s[o-1];return c+(1-c)*(t-a)/(this.frames[n+this.getFrameEntries()]-a)}apply(t,n,s,r,o,a,c,l,d){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,d))return;const h=this.attachment.timelineSlots,f=this.frames;if(s=f[f.length-1])g=0,p=this.vertices[f.length-1],m=null;else{const y=Gt.search(f,s);g=this.getCurvePercent(s,y),p=this.vertices[y],m=this.vertices[y+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],d,p,m,g,v,o,a,c);for(const y of h)this.applyToSlot(u[y],d,p,m,g,v,o,a,c)}applyBeforeFirst(t,n,s,r){if(!t.bone.active)return;const o=n?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Ge.setup),r){case Ge.setup:a.length=0;break;case Ge.first:{if(s===1){a.length=0;return}const c=this.vertices[0].length;a.length=c;const l=a,d=o.attachment;if(d.bones===null){const u=d.vertices;for(let h=0;h>4,d=c.attachment.sequence.regions.length;const u=dT[o&15];if(u!==Nn.hold)switch(l+=(s-r)/a+1e-5|0,u){case Nn.once:l=Math.min(d-1,l);break;case Nn.loop:l%=d;break;case Nn.pingpong:{const h=(d<<1)-2;l=h===0?0:l%h,l>=d&&(l=h-l);break}case Nn.onceReverse:l=Math.max(d-1-l,0);break;case Nn.loopReverse:l=d-1-l%d;break;case Nn.pingpongReverse:{const h=(d<<1)-2;l=h===0?0:(l+d-1)%h,l>=d&&(l=h-l)}}c.sequenceIndex=l}};A(ki,"ENTRIES",3),A(ki,"MODE",1),A(ki,"DELAY",2);let Lu=ki;const Uu=class Uu extends Gt{constructor(t){super(t,...Uu.propertyIds);A(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n){this.frames[t]=n.time,this.events[t]=n}apply(t,n,s,r,o,a,c,l,d){if(!r)return;const u=this.frames,h=this.frames.length;if(n>s)this.apply(null,n,Number.MAX_VALUE,r,0,a,!1,!1,!1),n=-1;else if(n>=u[h-1])return;if(s0&&u[f-1]===p;)f--}for(;f=u[f];f++)r.push(this.events[f])}};A(Uu,"propertyIds",[`${rt.event}`]);let vc=Uu;const _a=class _a extends Gt{constructor(t){super(t,..._a.propertyIds);A(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n,s){this.frames[t]=n,this.drawOrders[t]=s}apply(t,n,s,r,o,a,c,l,d){const u=d?t.drawOrder.appliedPose:t.drawOrder.pose,h=t.slots;if(l||s>2];switch(y){case 0:{const x=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const T=(s-x)/(f[v+4]-x);p+=(f[v+4+1]-p)*T,m+=(f[v+4+2]-m)*T,g+=(f[v+4+3]-g)*T;break}case 1:p=f[v+1],m=f[v+2],g=f[v+3];break;default:p=this.getBezierValue(s,v,1,y-2),m=this.getBezierValue(s,v,2,y+18-2),g=this.getBezierValue(s,v,3,y+36-2)}const b=a===Ge.setup?u.data.setupPose:h;c?(h.mixRotate=b.mixRotate+p*o,h.mixX=b.mixX+m*o,h.mixY=b.mixY+g*o):(h.mixRotate=b.mixRotate+(p-b.mixRotate)*o,h.mixX=b.mixX+(m-b.mixX)*o,h.mixY=b.mixY+(g-b.mixY)*o)}}class uo extends Mc{constructor(e,t,n,s){super(e,t,n,s)}apply(e,t,n,s,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const d=n>=this.frames[0]?this.getCurveValue(n):0,u=e.physics;for(const h of u)if(h.active&&this.global(h.data)){const f=l?h.appliedPose:h.pose;this.set(f,this.getAbsoluteValue(n,r,o,a,this.get(f),this.get(h.data.setupPose),d))}}else{const d=e.constraints[this.constraintIndex];if(d.active){const u=l?d.appliedPose:d.pose;this.set(u,this.getAbsoluteValue(n,r,o,a,this.get(u),this.get(d.data.setupPose)))}}}}class RT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class FT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class LT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class DT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class OT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class NT extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class $T extends uo{constructor(e,t,n){super(e,t,n,rt.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Vu=class Vu extends Gt{constructor(t,n){super(t,...Vu.propertyIds);A(this,"constraintIndex");this.constraintIndex=n,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,n){this.frames[t]=n}apply(t,n,s,r,o,a,c,l,d){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const h=this.frames;if(n>s)this.apply(t,n,Number.MAX_VALUE,[],o,a,!1,!1,!1),n=-1;else if(n>=h[h.length-1])return;if(!(s=h[Gt.search(h,n)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};A(Vu,"propertyIds",[rt.physicsConstraintReset.toString()]);let Du=Vu;class BT extends Mc{constructor(e,t,n){super(e,t,n,rt.sliderTime)}apply(e,t,n,s,r,o,a,c,l){const d=e.constraints[this.constraintIndex];if(d.active){const u=l?d.appliedPose:d.pose;u.time=this.getAbsoluteValue(n,r,o,a,u.time,d.data.setupPose.time)}}}class UT extends Mc{constructor(e,t,n){super(e,t,n,rt.sliderMix),this.additive=!0}apply(e,t,n,s,r,o,a,c,l){const d=e.constraints[this.constraintIndex];if(d.active){const u=l?d.appliedPose:d.pose;u.mix=this.getAbsoluteValue(n,r,o,a,u.mix,d.data.setupPose.mix)}}}const Hl=class Hl{constructor(e){A(this,"data");A(this,"tracks",[]);A(this,"timeScale",1);A(this,"unkeyedState",0);A(this,"events",[]);A(this,"listeners",[]);A(this,"queue",new mX(this));A(this,"propertyIds",new Map);A(this,"animationsChanged",!1);A(this,"trackEntryPool",new aX(()=>new pX));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let n=0,s=t.length;n0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(n,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const n=e.mixingFrom;if(!n)return!0;const s=this.updateMixingFrom(n,t);if(n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(n.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=n.mixingFrom,n.mixingFrom!=null&&(n.mixingFrom.mixingTo=e),n.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(n)}return s}return n.trackTime+=t*n.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,n=this.tracks;let s=!1;for(let a=0,c=n.length;a0)continue;s=!0;let d=l.alpha;l.mixingFrom?d*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(d=0);let u=l.animationLast,h=l.getAnimationTime(),f=h,p=t;l.reverse&&(f=l.animation.duration-f,p=null);const m=l.animation.timelines,g=m.length;if(a===0&&d===1)for(let v=0;v=l.alphaAttachmentThreshold,b=l.additive,x=b||l.shortestRotation,T=!x&&l.timelinesRotation.length!==g<<1;T&&(l.timelinesRotation.length=g<<1);for(let E=0;E0?c/a:o,d=n.animation.timelines,u=d.length,h=n.timelineMode,f=n.timelineHoldMix,p=r=n.alphaAttachmentThreshold);else{const N=!m||!(M instanceof eo)||P===Ge.current;M.apply(t,x,E,S,I,P,g,N,!1)}}return n.reverse&&r0&&this.queueEvents(n,T),this.events.length=0,n.nextAnimationLast=T,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,n,s,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+Ux)return;let a=n=0,T=v>=0;Math.abs(y)<=90&&Fe.signum(y)!==Fe.signum(g)&&(Math.abs(v-b)>180?(m+=360*Fe.signum(v),T=x):b!==0?m-=360*Fe.signum(v):T=x),T!==x&&(m+=360*Fe.signum(v)),o[a]=m}o[a+1]=g,d.rotation=f+m*s}queueEvents(e,t){const n=e.animationStart,s=e.animationEnd,r=s-n,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,d=c.length;for(;l=n&&h.time<=s&&this.queue.event(e,h)}let u=!1;if(e.loop)if(r===0)u=!0;else{const h=Math.floor(e.trackTime/r);u=h>0&&h>Math.floor(e.trackLast/r)}else u=t>=s&&e.animationLast=n&&h.time<=s&&this.queue.event(e,h)}}eventsReverse(e,t,n){const s=e.animation.duration,r=s-t,o=s-n,a=e.animation.timelines;for(let c=0,l=e.animation.timelines.length;c=o){for(let p=0;p=r)break;this.events.push(u[p])}}else{for(let m=0;m=r);m++)this.events.push(u[m]);let p=0;for(;p=o);p++);for(;p= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let n=t;for(;;){const s=n.mixingFrom;if(!s)break;this.queue.end(s),n.mixingFrom=null,n.mixingTo=null,n=s}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,n){const s=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,s&&(s.next=null,n&&this.queue.interrupt(s),t.mixingFrom=s,s.mixingTo=t,t.mixTime=0,s.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,n=!1){return typeof t=="string"?this.setAnimation1(e,t,n):this.setAnimation2(e,t,n)}setAnimation1(e,t,n=!1){const s=this.data.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,s,n)}setAnimation2(e,t,n=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));const o=this.trackEntry(e,t,n,r);return this.setTrack(e,o,s),this.queue.drain(),o}addAnimation(e,t,n=!1,s=0){return typeof t=="string"?this.addAnimation1(e,t,n,s):this.addAnimation2(e,t,n,s)}addAnimation1(e,t,n=!1,s=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,n,s)}addAnimation2(e,t,n=!1,s=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,n,r);return r?(r.next=o,o.previous=r,s<=0&&(s=Math.max(s+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),s<0&&(s=0)),o.delay=s,o}setEmptyAnimation(e,t=0){const n=this.setAnimation(e,Hl.emptyAnimation,!1);return n.mixDuration=t,n.trackEnd=t,n}addEmptyAnimation(e,t=0,n=0){const s=this.addAnimation(e,Hl.emptyAnimation,!1,n);return n<=0&&(s.delay=Math.max(s.delay+s.mixDuration-t,0)),s.mixDuration=t,s.trackEnd=t,s}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let n=0,s=this.tracks.length;n0&&(o[h]=v);break}}c&&(g=g&~Cd|r[h]&Cd),r[h]=g}}from(e,t,n){const s=this.propertyIds;let r=gX;for(let o=0,a=n.length;o= 0.");return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};A(Hl,"emptyAnimation",new uv("",[],0));let Dx=Hl;class pX{constructor(){A(this,"animation",null);A(this,"previous",null);A(this,"next",null);A(this,"mixingFrom",null);A(this,"mixingTo",null);A(this,"listener",null);A(this,"trackIndex",0);A(this,"loop",!1);A(this,"additive",!1);A(this,"reverse",!1);A(this,"shortestRotation",!1);A(this,"keepHold",!1);A(this,"eventThreshold",0);A(this,"mixAttachmentThreshold",0);A(this,"alphaAttachmentThreshold",0);A(this,"mixDrawOrderThreshold",0);A(this,"animationStart",0);A(this,"animationEnd",0);A(this,"animationLast",0);A(this,"nextAnimationLast",0);A(this,"delay",0);A(this,"trackTime",0);A(this,"trackLast",0);A(this,"nextTrackLast",0);A(this,"trackEnd",0);A(this,"timeScale",0);A(this,"alpha",0);A(this,"mixTime",0);A(this,"mixDuration",0);A(this,"totalAlpha",0);A(this,"mixInterpolation",Va.linear);A(this,"timelineMode",[]);A(this,"timelineHoldMix",[]);A(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===Va.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=Va.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class mX{constructor(e){A(this,"objects",[]);A(this,"drainDisabled",!1);A(this,"animState");this.animState=e}start(e){this.objects.push(ui.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(ui.interrupt),this.objects.push(e)}end(e){this.objects.push(ui.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(ui.dispose),this.objects.push(e)}complete(e){this.objects.push(ui.complete),this.objects.push(e)}event(e,t){this.objects.push(ui.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,n,s,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!n)throw new Error("name cannot be null.");this.index=t,this.parent=s}copy(t){const n=new Eh(this.index,this.name,t);return n.length=this.length,n.setupPose.set(this.setupPose),n}}var an;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(an||(an={}));class Jm{constructor(){A(this,"bone");A(this,"x",0);A(this,"y",0);A(this,"rotation",0);A(this,"scaleX",0);A(this,"scaleY",0);A(this,"shearX",0);A(this,"shearY",0);A(this,"inherit",an.Normal);A(this,"a",0);A(this,"b",0);A(this,"c",0);A(this,"d",0);A(this,"worldY",0);A(this,"worldX",0);A(this,"world",0);A(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,n=this.scaleX,s=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const h=e.scaleX,f=e.scaleY,p=(t+r)*Fe.degRad,m=(t+90+o)*Fe.degRad;this.a=Math.cos(p)*n*h,this.b=Math.cos(m)*s*h,this.c=Math.sin(p)*n*f,this.d=Math.sin(m)*s*f,this.worldX=this.x*h+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let c=a.a,l=a.b,d=a.c,u=a.d;switch(this.worldX=c*this.x+l*this.y+a.worldX,this.worldY=d*this.x+u*this.y+a.worldY,this.inherit){case an.Normal:{const h=(t+r)*Fe.degRad,f=(t+90+o)*Fe.degRad,p=Math.cos(h)*n,m=Math.cos(f)*s,g=Math.sin(h)*n,v=Math.sin(f)*s;this.a=c*p+l*g,this.b=c*m+l*v,this.c=d*p+u*g,this.d=d*m+u*v;return}case an.OnlyTranslation:{const h=e.scaleX,f=e.scaleY,p=(t+r)*Fe.degRad,m=(t+90+o)*Fe.degRad;this.a=Math.cos(p)*n*h,this.b=Math.cos(m)*s*h,this.c=Math.sin(p)*n*f,this.d=Math.sin(m)*s*f;break}case an.NoRotationOrReflection:{const h=e.scaleX,f=e.scaleY,p=1/h,m=1/f;c*=p,d*=m;let g=c*c+d*d,v=0;g>Fe.epsilon2?(g=Math.abs(c*u*m-l*p*d)/g,l=d*g,u=c*g,v=t-Fe.atan2Deg(d,c)):(c=0,d=0,v=t-90+Fe.atan2Deg(u,l));const y=(v+r)*Fe.degRad,b=(v+o+90)*Fe.degRad,x=Math.cos(y)*n,T=Math.cos(b)*s,E=Math.sin(y)*n,S=Math.sin(b)*s;this.a=(c*x-l*E)*h,this.b=(c*T-l*S)*h,this.c=(d*x+u*E)*f,this.d=(d*T+u*S)*f;break}case an.NoScale:case an.NoScaleOrReflection:{const h=e.scaleX,f=e.scaleY,p=1/h,m=1/f,g=t*Fe.degRad,v=Math.cos(g),y=Math.sin(g);let b=(c*v+l*y)*p,x=(d*v+u*y)*m;const T=1/Math.sqrt(b*b+x*x);b*=T,x*=T;let E=-x,S=b;this.inherit===an.NoScale&&c*u-l*d<0!=(h<0!=f<0)&&(E=-E,S=-S);const C=r*Fe.degRad,M=(90+o)*Fe.degRad,k=Math.cos(C)*n,P=Math.cos(M)*s,I=Math.sin(C)*n,N=Math.sin(M)*s;this.a=(b*k+E*I)*h,this.b=(b*P+E*N)*h,this.c=(x*k+S*I)*f,this.d=(x*P+S*N)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,n=e.scaleY;if(!this.bone.parent){const v=1/t,y=1/n;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*y,this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);return}const s=this.bone.parent.appliedPose;let r=s.a,o=s.b,a=s.c,c=s.d;const l=r*c-o*a,d=1/(r*c-o*a),u=c*d,h=o*d,f=a*d,p=r*d,m=this.worldX-s.worldX,g=this.worldY-s.worldY;switch(this.x=m*u-g*h,this.y=g*p-m*f,this.inherit){case an.Normal:this.set5(u*this.a-h*this.c,u*this.b-h*this.d,p*this.c-f*this.a,p*this.d-f*this.b,0);break;case an.OnlyTranslation:{const v=1/t,y=1/n;this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);break}case an.NoRotationOrReflection:{const v=1/t,y=1/n;r*=v,a*=y;const b=this.a*v,x=this.b*v,T=this.c*y,E=this.d*y,S=1/(r*r+a*a),C=1/Math.abs(l*v*y);this.set5((r*b+a*T)*S,(r*x+a*E)*S,(r*T-a*b)*C,(r*E-a*x)*C,Fe.atan2Deg(a,r));break}case an.NoScale:case an.NoScaleOrReflection:{const v=1/t,y=1/n,b=this.a*v,x=this.b*v,T=this.c*y,E=this.d*y;let S=c*this.a-o*this.c,C=r*this.c-a*this.a;l<0&&(S=-S,C=-C);let M=Fe.atan2Deg(C,S);this.rotation=M,M*=Fe.degRad;const k=Math.cos(M),P=Math.sin(M);let I=(r*k+o*P)*v,N=(a*k+c*P)*y;const $=1/Math.sqrt(I*I+N*N);I*=$,N*=$;const j=this.inherit===an.NoScale&&l<0!=(t<0!=n<0)?-1:1;this.set4(I*b+N*T,I*x+N*E,(I*T-N*b)*j,(I*E-N*x)*j)}}}set4(e,t,n,s){const r=e*e+n*n,o=t*t+s*s;r>Fe.epsilon2?(this.shearX=Fe.atan2Deg(n,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Fe.epsilon2?(this.shearY=Fe.atan2Deg(s,t),e*s-t*n<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,n,s,r){this.shearX=0;const o=e*e+n*n,a=t*t+s*s;if(o>Fe.epsilon2){const c=Fe.atan2Deg(n,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Fe.epsilon2?(this.shearY=Fe.atan2Deg(s,t),e*s-t*n<0?(this.scaleY=-this.scaleY,this.shearY+=90-c):this.shearY-=90+c,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Fe.epsilon2?Fe.atan2Deg(s,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const n=this.bone.children;for(let s=0,r=n.length;s1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,n,s,r,o,a,c,l,d,u){typeof s=="number"?Ur.apply1(t,n,s,r,o,a,c,l):Ur.apply2(t,n,s,r,o,a,c,l,d,u)}static apply1(t,n,s,r,o,a,c,l){n.modifyLocal(t);const d=n.bone.parent.appliedPose;let u=d.a,h=d.b,f=d.c,p=d.d,m=-n.shearX-n.rotation,g=0,v=0;switch(n.inherit){case an.OnlyTranslation:g=(s-n.worldX)*Fe.signum(t.scaleX),v=(r-n.worldY)*Fe.signum(t.scaleY);break;case an.NoRotationOrReflection:{const y=Math.abs(u*p-h*f)/Math.max(Fe.epsilon,u*u+f*f),b=u/t.scaleX,x=f/t.scaleY;h=-x*y*t.scaleX,p=b*y*t.scaleY,m+=Fe.atan2Deg(x,b)}default:{const y=s-d.worldX,b=r-d.worldY,x=u*p-h*f;Math.abs(x)<=Fe.epsilon?(g=0,v=0):(g=(y*p-b*h)/x-n.x,v=(b*u-y*f)/x-n.y)}}if(m+=Fe.atan2Deg(v,g),n.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),n.rotation+=m*l,o||a){switch(n.inherit){case an.NoScale:case an.NoScaleOrReflection:g=s-n.worldX,v=r-n.worldY}const y=n.bone.data.length*n.scaleX;if(y>Fe.epsilon){const b=g*g+v*v;if(o&&by*y){const x=(Math.sqrt(b)/y-1)*l+1;switch(n.scaleX*=x,c){case ri.Uniform:n.scaleY*=x;break;case ri.Volume:n.scaleY/=x<.7?.25+.642857*x:x}}}}}static apply2(t,n,s,r,o,a,c,l,d,u){if(n.inherit!==an.Normal||s.inherit!==an.Normal)return;n.modifyLocal(t),s.modifyLocal(t);let h=n.x,f=n.y,p=n.scaleX,m=n.scaleY,g=s.scaleX,v=0,y=0,b=0;p<0?(p=-p,v=180,b=-1):(v=0,b=1),m<0&&(m=-m,b=-b),g<0?(g=-g,y=180):y=0;let x=0,T=0,E=n.a,S=n.b,C=n.c,M=n.d;const k=Math.abs(p-m)<=Fe.epsilon;!k||c?(s.y=0,x=E*s.x+n.worldX,T=C*s.x+n.worldY):(x=E*s.x+S*s.y+n.worldX,T=C*s.x+M*s.y+n.worldY);const P=n.bone.parent.appliedPose;E=P.a,S=P.b,C=P.c,M=P.d;let I=E*M-S*C,N=x-P.worldX,$=T-P.worldY;I=Math.abs(I)<=Fe.epsilon?0:1/I;const j=(N*M-$*S)*I-h,B=($*E-N*C)*I-f;let Y=Math.sqrt(j*j+B*B),U=s.bone.data.length*g,D,L;if(Y0){let ce=Math.min(1,ae/(d*2))-1;ce=(ae-d*(1-ce*ce))/Z,R-=ce*R,X-=ce*X,z=R*R+X*X}}e:if(k){U*=p;let Z=(z-Y*Y-U*U)/(2*Y*U);if(Z<-1)Z=-1,L=Math.PI*a;else if(Z>1){if(Z=1,L=0,c)switch(E=(Math.sqrt(z)/(Y+U)-1)*u+1,n.scaleX*=E,l){case ri.Uniform:n.scaleY*=E;break;case ri.Volume:n.scaleY/=E<.7?.25+.642857*E:E}}else L=Math.acos(Z)*a;E=Y+U*Z,S=U*Math.sin(L),D=Math.atan2(X*E-R*S,R*E+X*S)}else{E=p*U,S=m*U;const Z=E*E,ae=S*S,ce=Math.atan2(X,R);C=ae*Y*Y+Z*z-Z*ae;const ve=-2*ae*Y,we=ae-Z;if(M=ve*ve-4*we*C,M>=0){let O=Math.sqrt(M);ve<0&&(O=-O),O=-(ve+O)*.5;let V=O/we,W=C/O;const ee=Math.abs(V)=0){$=Math.sqrt(V)*a,D=ce-Math.atan2($,ee),L=Math.atan2($/m,(ee-Y)/p);break e}}let re=Fe.PI,Ee=Y-E,q=Ee*Ee,J=0,ie=0,se=Y+E,G=se*se,H=0;C=-E*Y/(Z-ae),C>=-1&&C<=1&&(C=Math.acos(C),N=E*Math.cos(C)+Y,$=S*Math.sin(C),M=N*N+$*$,MG&&(ie=C,G=M,se=N,H=$)),z<=(q+G)*.5?(D=ce-Math.atan2(J*a,Ee),L=re*a):(D=ce-Math.atan2(H*a,se),L=ie*a)}const K=Math.atan2(s.y,s.x)*b;D=(D-K)*Fe.radDeg+v-n.rotation,D>180?D-=360:D<=-180&&(D+=360),n.rotation+=D*u,L=((L+K)*Fe.radDeg-s.shearX)*b+y-s.rotation,L>180?L-=360:L<=-180&&(L+=360),s.rotation+=L*u}}class Bd extends kc{constructor(t){super(t,new Zm);A(this,"bones",[]);A(this,"_target",null);A(this,"_scaleYMode",ri.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new Ur(this,t)}}class Qm{constructor(){A(this,"position",0);A(this,"spacing",0);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class Ud extends kc{constructor(t){super(t,new Qm);A(this,"bones",[]);A(this,"_slot",null);A(this,"positionMode",Os.Fixed);A(this,"spacingMode",En.Fixed);A(this,"rotateMode",Yo.Chain);A(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new eg(this,t)}}var Os;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Os||(Os={}));var En;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(En||(En={}));var Yo;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(Yo||(Yo={}));const Gi=class Gi extends Pc{constructor(t,n){super(t,new Qm,new Qm);A(this,"data");A(this,"bones");A(this,"slot");A(this,"spaces",[]);A(this,"positions",[]);A(this,"world",[]);A(this,"curves",[]);A(this,"lengths",[]);A(this,"segments",[]);if(!n)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const s of this.data.bones)this.bones.push(n.bones[s.index].constrainedPose);this.slot=n.slots[t.slot.index]}copy(t){var n=new Gi(this.data,t);return n.pose.set(this.pose),n}update(t,n){const s=this.slot.appliedPose.attachment;if(!(s instanceof bc))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,c=r.mixY;if(o===0&&a===0&&c===0)return;const l=this.data,d=l.rotateMode===Yo.Tangent,u=l.rotateMode===Yo.ChainScale,h=this.bones,f=h.length,p=d?f:f+1,m=Ze.setArraySize(this.spaces,p),g=u?this.lengths=Ze.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case En.Percent:if(u)for(let S=0,C=p-1;S0){S=p/S*v;for(let C=1;C0?Fe.degRad:-Fe.degRad}for(let S=0,C=3;S0){let $=M.a,j=M.b,B=M.c,Y=M.d,U=0,D=0,L=0;if(d?U=y[C-1]:m[S+1]===0?U=y[C+2]:U=Math.atan2(N,I),U-=Math.atan2(B,$),E){D=Math.cos(U),L=Math.sin(U);const R=M.bone.data.length;b+=(R*(D*$-L*B)-I)*o,x+=(R*(L*$+D*B)-N)*o}else U+=T;U>Fe.PI?U-=Fe.PI2:U<-Fe.PI&&(U+=Fe.PI2),U*=o,D=Math.cos(U),L=Math.sin(U),M.a=D*$-L*B,M.b=D*j-L*Y,M.c=L*$+D*B,M.d=L*j+D*Y}}}computeWorldPositions(t,n,s,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ze.setArraySize(this.positions,s*3+2),d=this.world;const u=n.closed;let h=n.worldVerticesLength,f=h/6,p=Gi.NONE;if(!n.constantSpeed){const L=n.lengths;f-=u?1:2;const R=L[f];this.data.positionMode===Os.Percent&&(a*=R);let X;switch(this.data.spacingMode){case En.Percent:X=R;break;case En.Proportional:X=R/s;break;default:X=1}d=Ze.setArraySize(this.world,8);for(let z=0,K=0,Z=0;zR){p!==Gi.AFTER&&(p=Gi.AFTER,n.computeWorldVertices(t,o,h-6,4,d,0,2)),this.addAfterPosition(ce-R,d,0,l,K);continue}for(;;Z++){const ve=L[Z];if(!(ce>ve)){if(Z===0)ce/=ve;else{const we=L[Z-1];ce=(ce-we)/(ve-we)}break}}Z!==p&&(p=Z,u&&Z===f?(n.computeWorldVertices(t,o,h-4,4,d,0,2),n.computeWorldVertices(t,o,0,4,d,4,2)):n.computeWorldVertices(t,o,Z*6+2,8,d,0,2)),this.addCurvePosition(ce,d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],l,K,r||z>0&&ae===0)}return l}u?(h+=2,d=Ze.setArraySize(this.world,h),n.computeWorldVertices(t,o,2,h-4,d,0,2),n.computeWorldVertices(t,o,0,2,d,h-4,2),d[h-2]=d[0],d[h-1]=d[1]):(f--,h-=4,d=Ze.setArraySize(this.world,h),n.computeWorldVertices(t,o,2,h,d,0,2));const m=Ze.setArraySize(this.curves,f);let g=0,v=d[0],y=d[1],b=0,x=0,T=0,E=0,S=0,C=0,M=0,k=0,P=0,I=0,N=0,$=0,j=0,B=0;for(let L=0,R=2;Lg){this.addAfterPosition(Z-g,d,h-4,l,R);continue}for(;;X++){const ae=m[X];if(!(Z>ae)){if(X===0)Z/=ae;else{const ce=m[X-1];Z=(Z-ce)/(ae-ce)}break}}if(X!==p){p=X;let ae=X*6;for(v=d[ae],y=d[ae+1],b=d[ae+2],x=d[ae+3],T=d[ae+4],E=d[ae+5],S=d[ae+6],C=d[ae+7],M=(v-b*2+T)*.03,k=(y-x*2+E)*.03,P=((b-T)*3-v+S)*.006,I=((x-E)*3-y+C)*.006,N=M*2+P,$=k*2+I,j=(b-v)*.3+M+P*.16666667,B=(x-y)*.3+k+I*.16666667,D=Math.sqrt(j*j+B*B),U[0]=D,ae=1;ae<8;ae++)j+=N,B+=$,N+=P,$+=I,D+=Math.sqrt(j*j+B*B),U[ae]=D;j+=N,B+=$,D+=Math.sqrt(j*j+B*B),U[8]=D,j+=N+P,B+=$+I,D+=Math.sqrt(j*j+B*B),U[9]=D,z=0}for(Z*=D;;z++){const ae=U[z];if(!(Z>ae)){if(z===0)Z/=ae;else{const ce=U[z-1];Z=z+(Z-ce)/(ae-ce)}break}}this.addCurvePosition(Z*.1,v,y,b,x,T,E,S,C,l,R,r||L>0&&K===0)}return l}addBeforePosition(t,n,s,r,o){const a=n[s],c=n[s+1],l=n[s+2]-a,d=n[s+3]-c,u=Math.atan2(d,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,n,s,r,o){const a=n[s+2],c=n[s+3],l=a-n[s],d=c-n[s+1],u=Math.atan2(d,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,n,s,r,o,a,c,l,d,u,h,f){if(t===0||Number.isNaN(t)){u[h]=n,u[h+1]=s,u[h+2]=Math.atan2(o-s,r-n);return}const p=t*t,m=p*t,g=1-t,v=g*g,y=v*g,b=g*t,x=b*3,T=g*x,E=x*t,S=n*y+r*T+a*E+l*m,C=s*y+o*T+c*E+d*m;u[h]=S,u[h+1]=C,f&&(t<.001?u[h+2]=Math.atan2(o-s,r-n):u[h+2]=Math.atan2(C-(s*v+o*b*2+c*p),S-(n*v+r*b*2+a*p)))}sort(t){const n=this.slot.data.index,s=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,n,s),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,n,s),this.sortPath(t,this.slot.pose.attachment,s);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,c=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,d=this.bone;let u=d.bone.data.length,h=this.data.step,f=0;if(n!==Po.none){switch(d.modifyWorld(t),n){case Po.reset:this.reset(t);case Po.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=d.worldX,v=d.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let y=this.remaining,b=s.inertia,x=t.data.referenceScale,T=-1,E=0,S=0,C=this.data.limit*p,M=C*Math.abs(t.scaleY);if(C*=Math.abs(t.scaleX),o||a){if(o){const k=(this.ux-g)*b;this.xOffset+=k>C?C:k<-C?-C:k,this.ux=g}if(a){const k=(this.uy-v)*b;this.yOffset+=k>M?M:k<-M?-M:k,this.uy=v}if(y>=h){const k=this.xOffset,P=this.yOffset;T=s.damping**(60*h),E=h*s.massInverse,S=s.strength;const I=x*s.wind,N=x*s.gravity,$=(I*t.windX+N*t.gravityX)*t.scaleX,j=(I*t.windY+N*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=($-this.xOffset*S)*E,this.xOffset+=this.xVelocity*h,this.xVelocity*=T),a&&(this.yVelocity-=(j+this.yOffset*S)*E,this.yOffset+=this.yVelocity*h,this.yVelocity*=T),y-=h;while(y>=h);this.xLag=this.xOffset-k,this.yLag=this.yOffset-P}f=Math.max(0,1-y/h),o&&(d.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(d.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(c||l){let k=Math.atan2(d.c,d.a),P=0,I=0,N=0,$=this.cx-d.worldX,j=this.cy-d.worldY;if($>C?$=C:$<-C&&($=-C),j>M?j=M:j<-M&&(j=-M),y=this.remaining,c){N=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/h);let B=Math.atan2(j+this.ty,$+this.tx)-k-(this.rotateOffset-f)*N;this.rotateOffset+=(B-Math.ceil(B*Fe.invPI2-.5)*Fe.PI2)*b,B=(this.rotateOffset-f)*N+k,P=Math.cos(B),I=Math.sin(B),l&&(B=u*d.getWorldScaleX(),B>0&&(this.scaleOffset+=($*P+j*I)*b/B))}else{P=Math.cos(k),I=Math.sin(k);const B=u*d.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/h);B>0&&(this.scaleOffset+=($*P+j*I)*b/B)}if(y>=h){T===-1&&(T=s.damping**(60*h),E=h*s.massInverse,S=s.strength);const B=s.wind*t.windX+s.gravity*t.gravityX,Y=(s.wind*t.windY+s.gravity*t.gravityY)*ig.yDir,U=this.rotateOffset,D=this.scaleOffset,L=u/x;for(;;)if(y-=h,l&&(this.scaleVelocity+=(B*P-Y*I-this.scaleOffset*S)*E,this.scaleOffset+=this.scaleVelocity*h,this.scaleVelocity*=T),c){if(this.rotateVelocity-=((B*I+Y*P)*L+this.rotateOffset*S)*E,this.rotateOffset+=this.rotateVelocity*h,this.rotateVelocity*=T,y0){let y=0;this.data.rotate>0&&(y=p*this.data.rotate,m=Math.sin(y),g=Math.cos(y),v=d.b,d.b=g*v-m*d.d,d.d=m*v+g*d.d),y+=p*this.data.shearX,m=Math.sin(y),g=Math.cos(y),v=d.a,d.a=g*v-m*d.c,d.c=m*v+g*d.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=d.a,d.a=g*v-m*d.c,d.c=m*v+g*d.c,v=d.b,d.b=g*v-m*d.d,d.d=m*v+g*d.d}if(l){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(d.a*=p,d.c*=p,this.data.scaleYMode){case ri.Uniform:d.b*=p,d.d*=p;break;case ri.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,d.b*=p,d.d*=p}}n!==Po.pose&&(this.tx=u*d.a,this.ty=u*d.c)}}sort(t){const n=this.bone.bone;t.sortBone(n),t._updateCache.push(this),t.sortReset(n.children),t.constrained(n)}isSourceActive(){return this.bone.bone.active}}class Vd extends kc{constructor(t){super(t,new tg);A(this,"_bone",null);A(this,"x",0);A(this,"y",0);A(this,"rotate",0);A(this,"scaleX",0);A(this,"shearX",0);A(this,"limit",0);A(this,"step",0);A(this,"inertiaGlobal",!1);A(this,"strengthGlobal",!1);A(this,"dampingGlobal",!1);A(this,"massGlobal",!1);A(this,"windGlobal",!1);A(this,"gravityGlobal",!1);A(this,"mixGlobal",!1);A(this,"_scaleYMode",ri.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new _h(this,t)}}typeof Math.fround>"u"&&(Math.fround=(i=>e=>(i[0]=e,i[0]))(new Float32Array(1)));class sg{constructor(){A(this,"time",0);A(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const Gl=class Gl extends Pc{constructor(t,n){super(t,new sg,new sg);A(this,"bone",null);if(!n)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=n.bones[t.bone.index])}copy(t){var n=new Gl(this.data,t);return n.pose.set(this.pose),n}update(t,n){const s=this.appliedPose;if(s.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),s.time=r.offset+(r.property.value(t,a.appliedPose,r.local,Gl.offsets)-r.property.offset)*r.scale,r.loop?s.time=o.duration+s.time%o.duration:s.time=Math.max(0,s.time)}const c=t.bones,l=o.bones;for(let d=0,u=o.bones.length;d=s.length&&(s.length=e+1),s[e]||(s[e]={}),s[e][t]=n}addSkin(e){for(let n=0;n= 0.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.boneData=s}}var Ou;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Ou||(Ou={}));class ag{constructor(){A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"mixScaleX",0);A(this,"mixScaleY",0);A(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class bv extends Pc{constructor(t,n){super(t,new ag,new ag);A(this,"bones");A(this,"source");if(!n)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(n.bones[r.index].constrainedPose);const s=n.bones[t.source.index];if(s==null)throw new Error("source cannot be null.");this.source=s}copy(t){var n=new bv(this.data,t);return n.pose.set(this.pose),n}update(t,n){const s=this.appliedPose;if(s.mixRotate===0&&s.mixX===0&&s.mixY===0&&s.mixScaleX===0&&s.mixScaleY===0&&s.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,c=r.additive,l=r.clamp,d=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const h=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?s[Lt.ROTATION]:-s[Lt.ROTATION]);return a<0&&(a+=360),a}}class HT extends ol{mix(e){return e.mixRotate}apply(e,t,n,s,r,o){if(r)n.rotation+=(o?s:s-n.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,d=1/c,u=n.a*l,h=n.b*l,f=n.c*d,p=n.d*d;s*=Fe.degRad,o||(s-=Math.atan2(f,u)),s>Fe.PI?s-=Fe.PI2:s<-Fe.PI&&(s+=Fe.PI2),s*=t.mixRotate;const m=Math.cos(s),g=Math.sin(s);n.a=(m*u-g*f)*a,n.b=(m*h-g*p)*a,n.c=(g*u+m*f)*c,n.d=(g*h+m*p)*c}}}class cg extends rl{value(e,t,n,s){return n?t.x+s[Lt.X]:(s[Lt.X]*t.a+s[Lt.Y]*t.b+t.worldX)/e.scaleX}}class GT extends ol{mix(e){return e.mixX}apply(e,t,n,s,r,o){r?n.x+=(o?s:s-n.x)*t.mixX:(o||(s-=n.worldX/e.scaleX),n.worldX+=s*t.mixX*e.scaleX)}}class dg extends rl{value(e,t,n,s){return n?t.y+s[Lt.Y]:(s[Lt.X]*t.c+s[Lt.Y]*t.d+t.worldY)/e.scaleY}}class WT extends ol{mix(e){return e.mixY}apply(e,t,n,s,r,o){r?n.y+=(o?s:s-n.y)*t.mixY:(o||(s-=n.worldY/e.scaleY),n.worldY+=s*t.mixY*e.scaleY)}}class ug extends rl{value(e,t,n,s){if(n)return t.scaleX+s[Lt.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+s[Lt.SCALEX]}}class qT extends ol{mix(e){return e.mixScaleX}apply(e,t,n,s,r,o){if(r)o?n.scaleX*=1+(s-1)*t.mixScaleX:n.scaleX!==0&&(n.scaleX+=(s-n.scaleX)*t.mixScaleX);else if(o){const a=1+(s-1)*t.mixScaleX;n.a*=a,n.c*=a}else{let a=n.a/e.scaleX,c=n.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(s-l)*t.mixScaleX/l,n.a*=l,n.c*=l)}}}class hg extends rl{value(e,t,n,s){if(n)return t.scaleY+s[Lt.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+s[Lt.SCALEY]}}class KT extends ol{mix(e){return e.mixScaleY}apply(e,t,n,s,r,o){if(r)o?n.scaleY*=1+(s-1)*t.mixScaleY:n.scaleY!==0&&(n.scaleY+=(s-n.scaleY)*t.mixScaleY);else if(o){const a=1+(s-1)*t.mixScaleY;n.b*=a,n.d*=a}else{let a=n.b/e.scaleX,c=n.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(s-l)*t.mixScaleY/l,n.b*=l,n.d*=l)}}}class fg extends rl{value(e,t,n,s){if(n)return t.shearY+s[Lt.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Fe.radDeg-90+s[Lt.SHEARY]}}class JT extends ol{mix(e){return e.mixShearY}apply(e,t,n,s,r,o){if(r)o||(s-=n.shearY),n.shearY+=s*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=n.b/a,d=n.d/c,u=Math.atan2(d,l);s=(s+90)*Fe.degRad,o?s-=Fe.PI/2:(s-=u-Math.atan2(n.c/c,n.a/a),s>Fe.PI?s-=Fe.PI2:s<-Fe.PI&&(s+=Fe.PI2)),s=u+s*t.mixShearY;const h=Math.sqrt(l*l+d*d);n.b=Math.cos(s)*h*a,n.d=Math.sin(s)*h*c}}}class mte{constructor(e){A(this,"scale",1);A(this,"attachmentLoader");A(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,n=new zT;n.name="";const s=new bX(e),r=s.readInt32(),o=s.readInt32();n.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),n.version=s.readString(),n.x=s.readFloat(),n.y=s.readFloat(),n.width=s.readFloat(),n.height=s.readFloat(),n.referenceScale=s.readFloat()*t;const a=s.readBoolean();a&&(n.fps=s.readFloat(),n.imagesPath=s.readString(),n.audioPath=s.readString());let c=0;c=s.readInt(!0);for(let p=0;p>5;for(let x=0,T;x>1&1,v.spacingMode=y>>2&3,v.rotateMode=y>>4&3,(y&128)!==0&&(v.offsetRotation=s.readFloat());const b=v.setupPose;b.position=s.readFloat(),v.positionMode===Os.Fixed&&(b.position*=t),b.spacing=s.readFloat(),(v.spacingMode===En.Length||v.spacingMode===En.Fixed)&&(b.spacing*=t),b.mixRotate=s.readFloat(),b.mixX=s.readFloat(),b.mixY=s.readFloat(),d.push(v);break}case XX:{const v=new Vd(m);v.bone=l[s.readInt(!0)];let y=s.readByte();if(v.skinRequired=(y&1)!==0,(y&2)!==0&&(v.x=s.readFloat()),(y&4)!==0&&(v.y=s.readFloat()),(y&8)!==0&&(v.rotate=s.readFloat()),(y&16)!==0){let x=s.readFloat();x<-2?(v.scaleYMode=ri.Volume,x=-2-x):x<0&&(v.scaleYMode=ri.Uniform,x=-1-x),v.scaleX=x}(y&32)!==0&&(v.shearX=s.readFloat()),v.limit=((y&64)!==0?s.readFloat():5e3)*t,v.step=1/s.readUnsignedByte();const b=v.setupPose;b.inertia=s.readFloat(),b.strength=s.readFloat(),b.damping=s.readFloat(),b.massInverse=(y&128)!==0?s.readFloat():1,b.wind=s.readFloat(),b.gravity=s.readFloat(),y=s.readByte(),(y&1)!==0&&(v.inertiaGlobal=!0),(y&2)!==0&&(v.strengthGlobal=!0),(y&4)!==0&&(v.dampingGlobal=!0),(y&8)!==0&&(v.massGlobal=!0),(y&16)!==0&&(v.windGlobal=!0),(y&32)!==0&&(v.gravityGlobal=!0),(y&64)!==0&&(v.mixGlobal=!0),b.mix=(y&128)!==0?s.readFloat():1,d.push(v);break}case YX:{const v=new Io(m),y=s.readByte();if(v.skinRequired=(y&1)!==0,v.loop=(y&2)!==0,v.additive=(y&4)!==0,(y&8)!==0){const b=s.readFloat();a&&(y&64)!==0?v.max=b:v.setupPose.time=b}if((y&16)!==0&&(v.setupPose.mix=(y&32)!==0?s.readFloat():1),(y&64)!==0){v.local=(y&128)!==0,v.bone=l[s.readInt(!0)];const b=s.readFloat();let x=1;switch(s.readByte()){case 0:v.property=new lg;break;case 1:{x=t,v.property=new cg;break}case 2:{x=t,v.property=new dg;break}case 3:v.property=new ug;break;case 4:v.property=new hg;break;case 5:v.property=new fg;break;default:continue}v.property.offset=b*x,v.offset=s.readFloat(),v.scale=s.readFloat()/x}d.push(v);break}}}const h=this.readSkin(s,n,!0,a);h&&(n.defaultSkin=h,n.skins.push(h));{let p=n.skins.length;for(Ze.setArraySize(n.skins,c=p+s.readInt(!0));p0){y=[];for(let S=0;S>4,e.readFloat())}r.push(k);break}}}}}const a=n.slots.length,c=e.readInt(!0);if(c>0){const f=new eo(c);for(let p=0;p0){const f=new vc(d);for(let p=0;p>>1^-(n&1)}readStringRef(){const e=this.readInt(!0);return e===0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let n=0;n>4){case 12:case 13:t+=String.fromCharCode((s&31)<<6|this.readByte()&63),n+=2;break;case 14:t+=String.fromCharCode((s&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),n+=3;break;default:t+=String.fromCharCode(s),n++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let yX=class{constructor(e,t,n,s,r,o){A(this,"source");A(this,"skinIndex");A(this,"slotIndex");A(this,"sourceIndex");A(this,"mesh");A(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=n,this.sourceIndex=s,this.source=r,this.inheritTimelines=o}};class Xx{constructor(e=null,t,n=0){A(this,"bones");A(this,"vertices");A(this,"length");this.bones=e,this.vertices=t,this.length=n}}var qs;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(qs||(qs={}));function mn(i,e,t,n){t instanceof lr?xX(i,e,t,n):wX(i,e,t,n)}function xX(i,e,t,n){let s=i.readFloat(),r=i.readFloat()*n;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,s,r),o!==c;o++){const l=i.readFloat(),d=i.readFloat()*n;switch(i.readByte()){case xs:t.setStepped(o);break;case ws:St(i,t,a++,o,0,s,l,r,d,n)}s=l,r=d}e.push(t)}function wX(i,e,t,n){let s=i.readFloat(),r=i.readFloat()*n,o=i.readFloat()*n;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,s,r,o),a!==l;a++){const d=i.readFloat(),u=i.readFloat()*n,h=i.readFloat()*n;switch(i.readByte()){case xs:t.setStepped(a);break;case ws:St(i,t,c++,a,0,s,d,r,u,n),St(i,t,c++,a,1,s,d,o,h,n)}s=d,r=u,o=h}e.push(t)}function Yx(i,e){const t=i.readInt(!0);if(t===0)return null;const n=new Array(e).fill(-1),s=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)n[a]===-1&&(n[a]=s[--o]);return n}function St(i,e,t,n,s,r,o,a,c,l){e.setBezier(t,n,s,r,a,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,o,c)}const SX=0,CX=1,AX=2,TX=3,EX=4,_X=5,MX=6,PX=7,kX=8,IX=9,RX=10,FX=0,LX=1,DX=2,OX=3,NX=4,$X=5,BX=0,UX=1,VX=2,XX=3,YX=4,zX=0,jX=1,HX=0,GX=1,WX=2,qX=0,KX=1,JX=2,ZX=4,QX=5,eY=6,tY=7,nY=8,iY=0,sY=1,xs=1,ws=2;class rY{constructor(e){A(this,"attachmentLoader");A(this,"scale",1);A(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,n=new zT,s=typeof e=="string"?JSON.parse(e):e,r=s.skeleton;if(r&&(n.hash=r.hash,n.version=r.spine,n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height,n.referenceScale=oe(r,"referenceScale",100)*t,n.fps=r.fps,n.imagesPath=r.images??null,n.audioPath=r.audio??null),s.bones)for(let o=0;o0&&l.properties.push(E)}l.offsets[Lt.ROTATION]=oe(o,"rotation",0),l.offsets[Lt.X]=oe(o,"x",0)*t,l.offsets[Lt.Y]=oe(o,"y",0)*t,l.offsets[Lt.SCALEX]=oe(o,"scaleX",0),l.offsets[Lt.SCALEY]=oe(o,"scaleY",0),l.offsets[Lt.SHEARY]=oe(o,"shearY",0);const b=l.setupPose;h&&(b.mixRotate=oe(o,"mixRotate",1)),f&&(b.mixX=oe(o,"mixX",1)),p&&(b.mixY=oe(o,"mixY",b.mixX)),m&&(b.mixScaleX=oe(o,"mixScaleX",1)),g&&(b.mixScaleY=oe(o,"mixScaleY",b.mixScaleX)),v&&(b.mixShearY=oe(o,"mixShearY",1)),n.constraints.push(l);break}case"path":{const l=new Ud(a);l.skinRequired=c;for(let f=0;f0){const h=n.findConstraint(l,Vd);if(!h)throw new Error(`Physics constraint not found: ${l}`);u=n.constraints.indexOf(h)}for(const h in d){const f=d[h];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(h==="reset"){const y=new Du(m,u);for(let b=0;p!=null;p=f[b+1],b++)y.setFrame(b,oe(p,"time",0));r.push(y);continue}switch(h){case"inertia":g=new RT(m,m,u);break;case"strength":g=new FT(m,m,u);break;case"damping":g=new LT(m,m,u);break;case"mass":g=new DT(m,m,u);break;case"wind":g=new OT(m,m,u);break;case"gravity":g=new NT(m,m,u);break;case"mix":{v=1,g=new $T(m,m,u);break}default:continue}yi(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const d=e.slider[l],u=n.findConstraint(l,Io);if(!u)throw new Error(`Slider not found: ${l}`);const h=n.constraints.indexOf(u);for(const f in d){const p=d[f];if(!p[0])continue;const g=p.length;switch(f){case"time":yi(r,p,new BT(g,g,h),1,1);break;case"mix":yi(r,p,new UT(g,g,h),1,1);break}}}if(e.attachments)for(const l in e.attachments){const d=e.attachments[l],u=n.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const h in d){const f=d[h],p=n.findSlot(h);if(!p)throw new Error(`Attachment slot not found: ${h}`);const m=p.index;for(const g in f){const v=f[g],y=u.getAttachment(m,g);if(!y)throw new Error(`Timeline attachment not found: ${g}`);for(const b in v){const x=v[b];let T=x[0];if(T){if(b==="deform"){const E=y.bones,S=y.vertices,C=E?S.length/3*2:S.length,M=new ET(x.length,x.length,m,y);let k=oe(T,"time",0);for(let P=0,I=0;;P++){let N;const $=oe(T,"vertices",null);if(!$)N=E?Ze.newFloatArray(C):S;else{N=Ze.newFloatArray(C);const U=oe(T,"offset",0);if(Ze.arrayCopy($,0,N,U,$.length),s!==1)for(let D=U,L=D+$.length;D=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function Et(i,e,t,n,s,r,o,a,c,l){if(i==="stepped")return e.setStepped(n),t;const d=s<<2,u=i[d],h=i[d+1]*l,f=i[d+2],p=i[d+3]*l;return e.setBezier(t,n,s,r,a,u,h,f,p,o,c),t+1}function oe(i,e,t){return i[e]!==void 0?i[e]:t}class aY{newRegionAttachment(e,t,n,s){return new yh(t,n)}newMeshAttachment(e,t,n,s){return new _c(t,n)}newBoundingBoxAttachment(e,t){return new AA(t)}newPathAttachment(e,t){return new mc(t)}newPointAttachment(e,t){return new kA(t)}newClippingAttachment(e,t){return new Ba(t)}}class lY{sequence(e){for(let t=0;t!Number.isInteger(d)||d<0||d>=o))throw new Error(ke("errors.trailIndexOutOfRange",{name:e}));const a=Number(i.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(ke("errors.invalidTrailHull",{name:e}));if(Array.isArray(i.edges)&&i.edges.some(d=>!Number.isInteger(d)||d<0||d>=o*2||d%2))throw new Error(ke("errors.trailHullIndexOutOfRange",{name:e}));if(s.length===n.length)return;let c=0,l=0;for(;c=t)throw new Error(ke("errors.missingBoneReference",{name:e}));if(![p,m,g].every(Number.isFinite)||g<0)throw new Error(ke("errors.invalidWeight",{name:e}));u+=g}if(Math.abs(u-1)>.001)throw new Error(ke("errors.weightSum",{name:e}));l++}if(c!==s.length||l!==o)throw new Error(ke("errors.vertexCountMismatch",{name:e}))}function uY(i,e){var r,o,a,c;const t=Array.isArray(i.bones)?i.bones:[],n=new Map(t.map(l=>[String(l.name||""),l])),s=new Set;for(const l of t){if(l.inherit!=null&&!cY.has(l.inherit))throw new Error(ke("errors.invalidInherit",{name:l.name||"",inherit:l.inherit,version:e}));if(/_trail_\d+_\d+$/.test(String(l.name||""))){const d=n.get(String(l.parent||""));if(!d||/_trail_\d+_\d+$/.test(String(d.name||"")))throw new Error(ke("errors.trailBoneParent",{name:l.name||""}))}}for(const l of Array.isArray(i.skins)?i.skins:[]){const d=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(d))for(const h of Object.keys(d[u]||{})){const f=d[u][h];(f==null?void 0:f.type)==="mesh"&&(dY(f,h,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&s.add(u))}}for(const l of Object.values(i.animations||{}))for(const d of s){const u=(c=(a=l==null?void 0:l.slots)==null?void 0:a[d])==null?void 0:c.attachment;if(Array.isArray(u)&&u.some(h=>!(h!=null&&h.name)))throw new Error(ke("errors.trailSlotEmpty",{name:d}))}}function hY(i){var e;if(String(((e=i==null?void 0:i.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error(ke("errors.spine38Version"));for(const t of i.bones||[])if(t.inherit!=null)throw new Error(ke("errors.spine38Inherit",{name:t.name||""}));for(const t of Object.values(i.animations||{})){for(const s of Object.values(t.slots||{})){if(s.rgba||s.rgba2)throw new Error(ke("errors.spine38SlotColor"));for(const r of s.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error(ke("errors.spine38AttachmentName"))}for(const s of Object.values(t.bones||{}))for(const r of s.rotate||[])if(r.value!=null||r.angle==null)throw new Error(ke("errors.spine38RotationAngle"));const n=[t];for(;n.length;){const s=n.pop();if(!(!s||typeof s!="object")){if(!Array.isArray(s)&&Array.isArray(s.curve))throw new Error(ke("errors.spine38Curve"));n.push(...Object.values(s))}}}}function jx(i,e){var o;const t=JSON.parse(i),n=gu((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!n)throw new Error(ke("errors.unsupportedExportVersion",{versions:_m()}));if(e&&n!==e)throw new Error(ke("errors.exportVersionMismatch",{expected:e,actual:n}));uY(t,n),n==="3.8"&&hY(t);const s=n==="3.8"?YA(JSON.parse(JSON.stringify(t))):t,r=n==="4.3"?new rY(new lY).readSkeletonData(s):new Eu(new aY).readSkeletonData(s);if(!r.bones.length)throw new Error(ke("errors.exportMissingBones"));return{version:n,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const ZT="http://127.0.0.1:27843";class Nu extends Error{constructor(t,n="CONNECTOR_ERROR",s){super(t);A(this,"code");A(this,"pairUrl");this.name="SpineConnectorError",this.code=n,this.pairUrl=s}}function pg(i,e){return String(i||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function fY(i,e){const t=/\.([a-z0-9]{2,5})$/i.exec(i);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function pY(i,e,t){const n=String(i||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>pg(r,"images")),s=pg(e.replace(/\.[^./\\]+$/,""),"image");return[...n,`${s}${fY(e,t)}`].join("/")}async function Mp(i,e,t){if(!i)return null;const n=await fetch(i);if(!n.ok)throw new Error(ke("errors.readExportImageFailed",{name:t}));const s=await n.blob(),r=new Uint8Array(await s.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{n++,e==null||e(n,t.length)});for(const o of i.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const c of a.sequenceFrames)t.push(s(Mp(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(s(Mp(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(s(Mp(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function mY(){try{const i=await fetch(`${ZT}/v1/health`,{cache:"no-store"});if(!i.ok)throw new Error(`HTTP ${i.status}`);return{available:!0,...await i.json()}}catch(i){return{available:!1,authorized:!1,error:i instanceof Error?i.message:String(i)}}}async function gY(i,e){const t=await QT(i.systems,(s,r)=>{e==null||e({phase:"images",progress:r?s/r:1})}),n=JSON.stringify({schemaVersion:1,projectName:i.projectName,spineVersion:i.spineVersion,skeletonJson:i.skeletonJson,images:t});return new Promise((s,r)=>{const o=new XMLHttpRequest;o.open("POST",`${ZT}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Nu(ke("errors.connectorOffline"),"CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let d={};try{d=JSON.parse(await a.text())}catch{}r(new Nu(ke("errors.connectorHttpError",{status:o.status}),d.code,d.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${pg(i.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}s({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||i.spineVersion,imageCount:t.length})},o.send(n)})}function vY(i,e){const t=URL.createObjectURL(i),n=document.createElement("a");n.href=t,n.download=/\.zip$/i.test(e)?e:`${e}.zip`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}function bY(i){const e=atob(i),t=new Uint8Array(e.length);for(let n=0;nn===".."||/^[a-z]+:/i.test(n))?"images":t.join("/")}function xY(i){return String(i||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function wY(i){const e=await QT(i.systems);if(!e.length)throw new Error(ke("errors.noExportableImages"));const t=yY(i.imagesPath);return{blob:QA(e.map(s=>({name:`${t}/${s.path}`,data:bY(s.dataBase64)}))),imageCount:e.length,folder:t}}function SY(i,e){const t=`${xY(e)}-images.zip`,n=URL.createObjectURL(i),s=document.createElement("a");return s.href=n,s.download=t,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3),t}function CY(i){const{t:e}=mi();i.settings.exportSettings=ZS(i.settings.exportSettings);const t=Le(()=>i.settings.exportSettings),n=Re(!1),s=Re(null),r=Re(""),o=Re(!1),a=Re(null),c=Re(""),l=Re(""),d=Le(()=>{const C=a.value;return C?C.available?C.spineFound?C.authorized?e("export.connectorReady"):e("export.notAuthorized"):e("export.spineNotFound"):e("export.connectorOffline"):e("export.connectorChecking")}),u=Le(()=>{var C,M,k,P,I,N;return{ready:!!((C=a.value)!=null&&C.available)&&!!((M=a.value)!=null&&M.spineFound)&&!!((k=a.value)!=null&&k.authorized),warning:!!((P=a.value)!=null&&P.available)&&(!((I=a.value)!=null&&I.spineFound)||!((N=a.value)!=null&&N.authorized))}}),h=Le(()=>{var C,M,k;return!!((C=a.value)!=null&&C.available)&&!!((M=a.value)!=null&&M.spineFound)&&!!((k=a.value)!=null&&k.authorized)}),f=Le(()=>{const C=a.value;return!(C!=null&&C.available)||!C.spineFound||C.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),p=Le(()=>{const C=a.value;return C?C.available?C.spineFound?C.authorized?"":e("export.unauthorized"):e("export.notFound"):e("export.offline"):e("export.checking")}),m=Le(()=>n.value?e("export.connectorBusy"):p.value?`${e("common.disabled")}: ${p.value}`:e("export.connectorGenerate",{version:t.value.spineVersion}));Ti(()=>{y(),g=window.setInterval(y,3e3)});let g,v=0;Ar(()=>{g!==void 0&&window.clearInterval(g)});async function y(){const C=++v,M=await mY();if(C!==v)return;a.value=M;const k=l.value;(k==="CONNECTOR_OFFLINE"?M.available:k==="SPINE_NOT_FOUND"?M.available&&M.spineFound:k==="ORIGIN_NOT_ALLOWED"?M.available&&M.spineFound&&M.authorized:!!k&&M.available&&M.spineFound&&M.authorized)&&(l.value="",c.value="",o.value&&(o.value=!1,r.value=""))}function b(){return new Promise(C=>requestAnimationFrame(()=>C()))}async function x(C){i.timeline.playing=!1,i.timeline.frame=0,i.timeline.recorded=!1;for(const P of i.systems)P.frames=void 0;i.recalcTotalFrames(),await b(),i.timeline.playing=!0;const M=i.timeline.totalFrames/Math.max(1,i.timeline.fps)*1e3,k=performance.now()+Math.max(8e3,M*2.5+3e3);for(;!i.timeline.recorded;){if(performance.now()>k)throw new Error(e("export.timeout"));C==null||C(Math.min(.98,i.timeline.frame/Math.max(1,i.timeline.totalFrames-1))),await new Promise(P=>setTimeout(P,50))}C==null||C(1)}async function T(){if(!n.value){n.value=!0,s.value="json",o.value=!1,l.value="",c.value="",r.value=e("export.recalculating");try{await x();const C=Fx({systems:i.systems,timeline:i.timeline,settings:t.value});jx(C.text,t.value.spineVersion),sX(C,t.value.fileName);const M=C.warnings.length?e("export.resourceWarning",{count:C.warnings.length}):"";r.value=e("export.exported",{version:t.value.spineVersion,systems:C.particleSystemCount,animations:C.animationCount,bones:C.boneCount,warning:M})}catch(C){o.value=!0,r.value=C instanceof Error?C.message:String(C)}finally{n.value=!1,s.value=null}}}async function E(){if(n.value)return;n.value=!0,s.value="spine",o.value=!1,l.value="",c.value="",r.value=e("export.recalculating");const C=iT(e("export.projectTransferTitle"),e("export.projectTransferDetail"));try{await C.paint(),await x(I=>C.update(I*18,e("export.recalculating"))),C.update(20,e("export.generatingJson"));const M=Fx({systems:i.systems,timeline:i.timeline,settings:t.value});jx(M.text,t.value.spineVersion),r.value=e("export.preparingProject");const k=t.value.fileName.replace(/\.json$/i,"")||"SpineParticle",P=await gY({projectName:k,spineVersion:t.value.spineVersion,skeletonJson:M.text,systems:i.systems},({phase:I,progress:N})=>{I==="images"?C.update(N==null?null:22+N*18,e("export.preparingProjectFiles")):I==="upload"?C.update(N==null?null:40+N*30,e("export.uploading")):I==="processing"?C.update(null,e("export.spineProcessing")):C.update(N==null?null:82+N*16,e("export.downloadingProject"))});C.update(99,e("export.handingToBrowser")),vY(P.blob,P.fileName),r.value=e("export.projectExported",{fileName:P.fileName,images:P.imageCount,version:P.spineEditorVersion}),await y(),await C.finish(e("export.projectTransferDownload"))}catch(M){const k=M instanceof Error?M.message:String(M);o.value=!0,l.value=M instanceof Nu?M.code:"",M instanceof Nu&&M.pairUrl&&(c.value=M.pairUrl),r.value=k,await y(),await C.fail(k)}finally{n.value=!1,s.value=null}}async function S(){if(!n.value){n.value=!0,s.value="images",o.value=!1,l.value="",c.value="",r.value=e("export.collectingImages");try{const C=await wY({systems:i.systems,imagesPath:t.value.imagesPath}),M=SY(C.blob,t.value.fileName);r.value=e("export.imagesExported",{fileName:M,folder:C.folder,images:C.imageCount})}catch(C){o.value=!0,r.value=C instanceof Error?C.message:String(C)}finally{n.value=!1,s.value=null}}}return{exportSettings:t,exportBusy:n,exportTarget:s,exportMessage:r,exportError:o,connectorHealth:a,connectorPairUrl:c,connectorExportErrorCode:l,connectorStatusText:d,connectorStatusClass:u,connectorReady:h,connectorAuthorizationUrl:f,connectorDisabledReason:p,connectorButtonTitle:m,connectorHealthTimer:g,connectorHealthRequestId:v,refreshConnectorHealth:y,nextPaint:b,prepareExportFrames:x,exportSpineJson:T,exportSpineProject:E,exportSpineImages:S}}function AY(i){if(typeof i=="string")return i.trim()||void 0;if(!i||typeof i!="object"||Array.isArray(i))return;const e=Object.entries(i).filter(t=>typeof t[1]=="string"&&!!t[1].trim());return e.length?Object.fromEntries(e):void 0}function TY(i){if(!Array.isArray(i))return[];const e=[];for(const t of i){if(typeof t=="string"&&t.trim()){e.push({file:t});continue}if(!t||typeof t!="object"||Array.isArray(t))continue;const n=typeof t.file=="string"?t.file.trim():"";n&&e.push({file:n,name:AY(t.name)})}return e}function EY(i,e){return typeof i.name=="string"?i.name:i.name&&typeof i.name=="object"?i.name[e]||i.name.en||i.name["zh-CN"]||i.file.replace(/^.*[\\/]/,"").replace(/\.json$/i,""):i.file.replace(/^.*[\\/]/,"").replace(/\.json$/i,"")}function _Y(i){const e=Re(null),t=Re(""),n=Re([]),s=Re(!1),r=Re(""),o=Re(!1),a=Re([]),c=Re(!1),l=Re(""),d=Re(""),u=Re(!1),h=Re(null),f=Re("");function p(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}`}function m(){o.value=!1,d.value="",l.value=p(),c.value=!0}function g(){u.value||(c.value=!1,d.value="")}async function v(){try{a.value=await vx(),a.value.some(N=>N.name===f.value)||(f.value="")}catch(N){a.value=[],o.value=!0,r.value=N instanceof Error?N.message:ke("config.local.storageUnavailable")}}async function y(){if(!u.value){d.value="",u.value=!0;try{const N=jm(l.value);if(a.value.some(j=>j.name===N)&&!window.confirm(ke("config.local.overwriteSave",{name:N})))return;const $=JSON.stringify(mx(i),null,2);await bx(N,$),Sl(i),f.value=N,await v(),o.value=!1,r.value=ke("config.local.saved",{name:N}),c.value=!1}catch(N){d.value=N instanceof Error?N.message:ke("config.local.storageUnavailable")}finally{u.value=!1}}}function b(N){f.value=N.name}async function x(N){if(window.confirm(ke("config.local.loadOverwrite",{name:N.name}))){o.value=!1,r.value=ke("config.loading");try{await Ym(i,N.text),Sl(i),r.value=ke("config.local.loaded",{name:N.name})}catch($){o.value=!0,r.value=$ instanceof Error?$.message:String($)}}}function T(N){const $=tT(N.name);yx(N.text,$),o.value=!1,r.value=ke("config.local.downloaded",{name:$})}function E(){const $=`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`;yx(JSON.stringify(mx(i),null,2),$),Sl(i),o.value=!1,r.value=ke("config.local.downloaded",{name:$})}async function S(N){if(window.confirm(ke("config.local.deleteConfirm",{name:N.name})))try{await DU(N.name),f.value===N.name&&(f.value=""),await v(),o.value=!1,r.value=ke("config.local.deleted",{name:N.name})}catch($){o.value=!0,r.value=$ instanceof Error?$.message:ke("config.local.storageUnavailable")}}async function C(){try{const N=await vx();if(!N.length){o.value=!0,r.value=ke("config.local.downloadEmpty");return}const j=`SpineParticle-configs-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.zip`;OU(N,j),o.value=!1,r.value=ke("config.local.downloaded",{name:j})}catch(N){o.value=!0,r.value=N instanceof Error?N.message:ke("config.local.storageUnavailable")}}async function M(N){const $=N.target,j=Array.from($.files||[]);if($.value="",!j.length||u.value||!window.confirm(ke("config.local.loadAllConfirm",{count:j.length})))return;u.value=!0;let B=0,Y=0;try{for(const U of j)try{if(!/\.json$/i.test(U.name))throw new Error(ke("errors.chooseJsonConfig"));const D=await U.text();lv(D);const L=jm(U.name);await bx(L,D),B++}catch{Y++}await v(),o.value=Y>0,r.value=Y?ke("config.local.loadAllPartial",{imported:B,failed:Y}):ke("config.local.loadAllDone",{count:B})}finally{u.value=!1}}async function k(N){var B;const $=N.target,j=(B=$.files)==null?void 0:B[0];if(j){r.value=ke("config.loading"),o.value=!1;try{await yU(i,j),Sl(i),r.value=ke("config.loaded",{name:j.name})}catch(Y){o.value=!0,r.value=Y instanceof Error?Y.message:String(Y)}finally{$.value=""}}}async function P(){try{const N=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!N.ok)throw new Error(ke("config.presetListError"));const $=await N.json();n.value=TY($)}catch{n.value=[]}}async function I(){const N=t.value;if(!N)return;s.value=!0,o.value=!1,r.value=ke("config.presetLoading");const $=iT(ke("config.presetTransferTitle"),ke("config.presetDownloading",{file:N}));try{await $.paint();const j=await fetch(`/Preset/${encodeURIComponent(N)}`,{cache:"no-store"});if(!j.ok)throw new Error(ke("config.presetReadError",{file:N}));const B=await PV(j,Y=>{$.update(Y==null?null:Y*55,ke("config.presetDownloading",{file:N}))});$.update(58,ke("config.presetParsing")),$.update(70,ke("config.presetRestoring")),await Ym(i,B),Sl(i),r.value=ke("config.presetLoaded",{name:N.replace(/\.json$/i,"")}),await $.finish(ke("config.presetComplete"))}catch(j){o.value=!0;const B=j instanceof Error?j.message:String(j);r.value=ke("config.presetNamingError",{message:B}),await $.fail(B)}finally{s.value=!1,t.value=""}}return Ti(()=>{P(),v(),window.addEventListener(zm,m)}),Ar(()=>window.removeEventListener(zm,m)),{configFileInput:e,selectedPreset:t,presetOptions:n,presetLoading:s,configMessage:r,configError:o,localProjects:a,selectedLocalProjectName:f,projectSaveOpen:c,projectNameDraft:l,projectSaveError:d,projectStorageBusy:u,saveConfig:m,closeProjectSaveDialog:g,confirmSaveConfig:y,loadLocalProject:x,downloadLocalProject:T,downloadCurrentProject:E,removeLocalProject:S,downloadAllLocalProjects:C,projectFilesInput:h,loadAllProjectFiles:M,selectLocalProject:b,onConfigFileChange:k,refreshPresets:P,loadSelectedPreset:I}}function MY(i){const e=Re(null),t=Re(null),n=Re(null),s=Re(null),r=Re(null);function o(){var R;const D=(R=i.value)==null?void 0:R.config;if(!D)return;const L=Math.max(0,...D.trailResources.map(X=>X.id))+1;D.trailResources.push({id:L,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:Wm.map(X=>({...X})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:Hm.map(X=>({...X})),shapeEnabled:!1,shapeCurve:qm.map(X=>({...X}))}),p()}function a(D){var L;r.value=D,(L=s.value)==null||L.click()}function c(D,L){var z;const R=(z=i.value)==null?void 0:z.config;if(!R)return;const X=D==="trailGridCols"?32:16;R[D]=Math.min(X,Math.max(2,Math.round(Number(L)||2)))}function l(D,L){var X;const R=(X=i.value)==null?void 0:X.config.trailResources.find(z=>z.id===D);R&&(R.boneCount=Math.min(16,Math.max(2,Math.round(Number(L)||2))))}function d(D,L){var X;const R=(X=i.value)==null?void 0:X.config.trailResources.find(z=>z.id===D);R&&(R.rotation=Math.max(-360,Math.min(360,Number(L)||0)))}async function u(D){var Z,ae;const L=D.target,R=(Z=L.files)==null?void 0:Z[0],X=(ae=i.value)==null?void 0:ae.config,z=X==null?void 0:X.trailResources.find(ce=>ce.id===r.value);if(!R||!z){L.value="";return}const K=await C(R);z.texture=Hr(await tt.fromURL(K)),z.previewUrl=K,z.textureName=R.name.replace(/\.[^.]+$/,"")||"trail",L.value="",r.value=null}async function h(D){var X;const L=(X=i.value)==null?void 0:X.config,R=L==null?void 0:L.trailResources.find(z=>z.id===D);R&&(R.texture=Hr(await tt.fromURL("/images/trail.png")),R.previewUrl="/images/trail.png",R.textureName="trail",R.weight=100,R.locked=!1,R.rotation=0,R.boneCount=3,R.trailRatio=100,R.lengthMode="fixed",R.length=100,R.lengthMin=100,R.lengthMax=100,R.widthSizeMode="fixed",R.width=100,R.widthMin=100,R.widthMax=100,R.widthMode="particle",R.lifeLengthEnabled=!1,R.lifeLengthCurve=Hm.map(z=>({...z})),R.shapeEnabled=!1,R.shapeCurve=qm.map(z=>({...z})),R.colorMode="particle",R.color="#ffffff",R.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],R.blend="normal",R.alphaMode="particle",R.alpha=1,R.alphaCurve=Wm.map(z=>({...z})),p())}function f(D){var X;const L=(X=i.value)==null?void 0:X.config.trailResources;if(!L||L.length<=1)return;const R=L.findIndex(z=>z.id===D);R>=0&&L.splice(R,1),p()}function p(){var z;const D=(z=i.value)==null?void 0:z.config.trailResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const L=D.filter(K=>K.locked),R=D.filter(K=>!K.locked);let X=L.reduce((K,Z)=>K+Math.max(0,Number(Z.weight)||0),0);X>100&&(j(L,100,!0),X=100),j(R,100-X)}function m(D,L){var ae;const R=(ae=i.value)==null?void 0:ae.config.trailResources;if(!(R!=null&&R.length))return;if(R.length===1){R[0].weight=100,R[0].locked=!1;return}const X=R.find(ce=>ce.id===D);if(!X||X.locked)return;const z=R.filter(ce=>ce.id!==D&&ce.locked).reduce((ce,ve)=>ce+Math.max(0,Number(ve.weight)||0),0),K=Math.max(0,100-z),Z=R.filter(ce=>ce.id!==D&&!ce.locked);X.weight=$(Math.min(K,Math.max(0,Number(L)||0))),Z.length?j(Z,K-X.weight,!0):X.weight=$(K)}function g(D){var X;const L=(X=i.value)==null?void 0:X.config.trailResources;if(!L||L.length===1)return;const R=L.find(z=>z.id===D);R&&(R.locked=!R.locked)}function v(D,L){const R=L.target;D.color=k(R.value,D.color),R.value=D.color}function y(D,L){v(D,L),L.target.blur()}function b(){var R;const D=(R=i.value)==null?void 0:R.config;if(!D)return;const L=Math.max(0,...D.imageResources.map(X=>X.id))+1;D.imageResources.push({id:L,texture:D.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:Gm.map(X=>({...X}))}),B()}function x(D){var L;n.value=D,(L=e.value)==null||L.click()}function T(D){var L;n.value=D,(L=t.value)==null||L.click()}async function E(D){var ae,ce;const L=D.target,R=(ae=L.files)==null?void 0:ae[0],X=(ce=i.value)==null?void 0:ce.config,z=X==null?void 0:X.imageResources.find(ve=>ve.id===n.value);if(!R||!z){L.value="";return}const K=await C(R),Z=Hr(await tt.fromURL(K));z.texture=Z,z.previewUrl=K,z.textureFolder="",z.textureName=R.name.replace(/\.[^.]+$/,"")||"particle",L.value="",n.value=null}async function S(D){var K;const L=D.target,R=Array.from(L.files||[]).sort((Z,ae)=>Z.name.localeCompare(ae.name,void 0,{numeric:!0,sensitivity:"base"})),X=(K=i.value)==null?void 0:K.config,z=X==null?void 0:X.imageResources.find(Z=>Z.id===n.value);if(!R.length||!z){L.value="";return}z.sequenceFrames=await Promise.all(R.map(async Z=>{const ae=await C(Z);return{name:Z.name,previewUrl:ae,texture:Hr(await tt.fromURL(ae))}})),z.imageMode="sequence",L.value="",n.value=null}function C(D){return new Promise((L,R)=>{const X=new FileReader;X.onload=()=>L(String(X.result||"")),X.onerror=()=>R(X.error),X.readAsDataURL(D)})}function M(D){var X;const L=(X=i.value)==null?void 0:X.config,R=L==null?void 0:L.imageResources.find(z=>z.id===D);!L||!R||(R.texture=L.texture,R.textureName="star",R.textureFolder="",R.previewUrl="/images/star.png",R.imageMode="fixed",R.sequencePlayback="loop-forward",R.sequenceFps=30,R.sequenceFrames=[],R.scale=1,R.anchorX=.5,R.anchorY=.5,R.colorMode="fixed",R.colorStart="#ffffff",R.colorEnd="#ff4d4d",R.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],R.blend="normal",R.independentAlpha="off",R.alpha=1,R.alphaCurveMode="跟随导出",R.alphaCurve=Gm.map(z=>({...z})),R.locked=!1,B())}function k(D,L){let R=D.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(R)&&(R=R.split("").map(X=>X+X).join("")),/^[0-9a-f]{6}$/i.test(R)?`#${R.toLowerCase()}`:L}function P(D,L){const R=L.target;D.colorStart=k(R.value,D.colorStart),R.value=D.colorStart}function I(D,L){P(D,L),L.target.blur()}function N(D){var X;const L=(X=i.value)==null?void 0:X.config.imageResources;if(!L||L.length<=1)return;const R=L.findIndex(z=>z.id===D);R>=0&&L.splice(R,1),B()}function $(D){return Math.round(D)}function j(D,L,R=!1){if(!D.length)return;const X=Math.max(0,$(L)),z=R?D.reduce((Z,ae)=>Z+Math.max(0,Number(ae.weight)||0),0):0;let K=0;D.forEach((Z,ae)=>{const ce=ae===D.length-1,ve=$(ce?X-K:z>0?X*Math.max(0,Number(Z.weight)||0)/z:X/D.length);Z.weight=ve,K+=ve})}function B(){var z;const D=(z=i.value)==null?void 0:z.config.imageResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const L=D.filter(K=>K.locked),R=D.filter(K=>!K.locked);let X=L.reduce((K,Z)=>K+Math.max(0,Number(Z.weight)||0),0);X>100&&(j(L,100,!0),X=100),j(R,100-X)}function Y(D,L){var ae;const R=(ae=i.value)==null?void 0:ae.config.imageResources;if(!(R!=null&&R.length))return;if(R.length===1){R[0].weight=100,R[0].locked=!1;return}const X=R.find(ce=>ce.id===D);if(!X||X.locked)return;const z=R.filter(ce=>ce.id!==D&&ce.locked).reduce((ce,ve)=>ce+Math.max(0,Number(ve.weight)||0),0),K=Math.max(0,100-z),Z=R.filter(ce=>ce.id!==D&&!ce.locked);if(X.weight=$(Math.min(K,Math.max(0,Number(L)||0))),!Z.length){X.weight=$(K);return}j(Z,K-X.weight,!0)}function U(D){var X;const L=(X=i.value)==null?void 0:X.config.imageResources;if(!L||L.length===1)return;const R=L.find(z=>z.id===D);R&&(R.locked=!R.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:n,trailTextureFileInput:s,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:c,onTrailResourceBoneCountChange:l,onTrailResourceRotationChange:d,onTrailTextureFile:u,resetTrailTexture:h,removeTrailResource:f,rebalanceTrailWeights:p,setTrailResourceWeight:m,toggleTrailResourceLock:g,setTrailColor:v,commitTrailColor:y,addImageResource:b,openTexturePicker:x,openSequencePicker:T,onTextureFile:E,onSequenceFiles:S,readFileAsDataUrl:C,resetTexture:M,normalizeHex:k,setResourceFixedColor:P,commitResourceFixedColor:I,removeImageResource:N,roundWeight:$,distributeImageWeights:j,rebalanceImageWeights:B,setResourceWeight:Y,toggleResourceLock:U}}const eE=[{key:"config",titleKey:"config.title",requiresParticle:!1},{key:"scene",titleKey:"scene.title",requiresParticle:!1},{key:"emitMode",titleKey:"emission.title",requiresParticle:!0},{key:"shape",titleKey:"emission.shapeTitle",requiresParticle:!0},{key:"attr",titleKey:"attributes.title",requiresParticle:!0},{key:"look",titleKey:"appearance.title",requiresParticle:!0},{key:"mods",titleKey:"modifiers.title",requiresParticle:!0},{key:"export",titleKey:"export.title",requiresParticle:!0}];function PY(){const i=Zo(),{t:e}=mi(),{exportSettings:t,exportBusy:n,exportTarget:s,exportMessage:r,exportError:o,connectorPairUrl:a,connectorStatusText:c,connectorStatusClass:l,connectorReady:d,connectorAuthorizationUrl:u,connectorDisabledReason:h,connectorButtonTitle:f,refreshConnectorHealth:p,exportSpineJson:m,exportSpineProject:g,exportSpineImages:v}=CY(i),{configFileInput:y,selectedPreset:b,presetOptions:x,presetLoading:T,configMessage:E,configError:S,localProjects:C,projectSaveOpen:M,projectNameDraft:k,projectSaveError:P,projectStorageBusy:I,saveConfig:N,closeProjectSaveDialog:$,confirmSaveConfig:j,loadLocalProject:B,downloadLocalProject:Y,downloadCurrentProject:U,removeLocalProject:D,downloadAllLocalProjects:L,projectFilesInput:R,loadAllProjectFiles:X,selectedLocalProjectName:z,selectLocalProject:K,onConfigFileChange:Z,refreshPresets:ae,loadSelectedPreset:ce}=_Y(i);function ve(ne){return ne==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":ne==="贝塞尔"?"bezier":"linear"}i.systems.length||i.addSystem();const we=Le(()=>{const ne=i.systems.findIndex(me=>me.id===i.activeId);return ne>=0?ne:0}),re=Le(()=>i.systems[we.value]||null),{textureFileInput:Ee,sequenceFileInput:q,trailTextureFileInput:J,addTrailResource:ie,openTrailTexturePicker:se,onTrailRigChange:G,onTrailResourceBoneCountChange:H,onTrailResourceRotationChange:O,onTrailTextureFile:V,resetTrailTexture:W,removeTrailResource:ee,setTrailResourceWeight:be,toggleTrailResourceLock:ye,setTrailColor:he,commitTrailColor:Be,addImageResource:Ae,openTexturePicker:de,openSequencePicker:ge,onTextureFile:Ve,onSequenceFiles:qe,resetTexture:bt,setResourceFixedColor:ft,commitResourceFixedColor:Oe,removeImageResource:ot,setResourceWeight:Te,toggleResourceLock:ue}=MY(re),fe=Le(()=>re.value?QS(re.value.config,i.timeline.fps):30),nt=Le(()=>{var me;const ne=(me=re.value)==null?void 0:me.config;return ne?Math.max(1,Math.ceil(Number(ne.loopDurationFrames)||1)):1}),mt=Le(()=>i.activeObjectType),lt=Re(null),ct=Le(()=>i.activeObjectType==="collision"&&i.colliders.find(ne=>ne.id===i.activeObjectId)||null),Kn=Le(()=>i.activeObjectType==="path"&&i.paths.find(ne=>ne.id===i.activeObjectId)||null),_i=Le(()=>i.activeObjectType==="spine"&&i.spines.find(ne=>ne.id===i.activeObjectId)||null),wn=Le(()=>i.activeObjectType==="particle"?i.systems.some(ne=>ne.id===i.activeObjectId):i.activeObjectType==="collision"?i.colliders.some(ne=>ne.id===i.activeObjectId):i.activeObjectType==="path"?i.paths.some(ne=>ne.id===i.activeObjectId):i.spines.some(ne=>ne.id===i.activeObjectId)),gi=Le(()=>{const ne=i.spines.find(me=>me.selectedBone&&me.bones.some(Me=>Me.name===me.selectedBone));return ne?{spine:ne,boneName:ne.selectedBone}:null}),Bn=Le(()=>{var Me;const ne=(Me=re.value)==null?void 0:Me.config;if(!ne||ne.emitterFollowMode!=="bone")return null;const me=i.spines.find(it=>it.id===ne.emitterFollowSpineId);return!me||!me.bones.some(it=>it.name===ne.emitterFollowBoneName)?null:{spine:me,boneName:ne.emitterFollowBoneName}}),Pn=Re(!1),xt=Re(""),vi=Le(()=>i.spines.filter(ne=>ne.enabled&&ne.visible!==!1&&ne.status==="ready")),Jn=Le(()=>i.spines.find(ne=>{var me;return ne.id===((me=re.value)==null?void 0:me.config.renderLayerSpineId)})||null),Ui=Le(()=>{const ne=Jn.value;return!!ne&&ne.enabled&&ne.visible!==!1&&ne.status==="ready"}),Un=Le(()=>{var ne;return[...((ne=Jn.value)==null?void 0:ne.slots)||[]].sort((me,Me)=>me.order-Me.order)}),Vi=Le(()=>{const ne=xt.value.trim().toLocaleLowerCase();return ne?Un.value.filter(me=>me.name.toLocaleLowerCase().includes(ne)||me.attachment.toLocaleLowerCase().includes(ne)):Un.value}),Zn=Le(()=>Un.value.find(ne=>{var me;return ne.name===((me=re.value)==null?void 0:me.config.renderLayerSlotName)})||null),as=Le(()=>{const ne=Zn.value;return ne&&Un.value.filter(me=>me.orderMe.order-me.order)[0]||null}),ho=Le(()=>{var it;const ne=(it=re.value)==null?void 0:it.config,me=Jn.value,Me=Zn.value;return!ne||!me||!Me?"":e(ne.renderLayerSlotPosition==="below"?"renderLayer.slotLabelBelow":"renderLayer.slotLabelAbove",{spine:me.name,slot:Me.name})}),Ic=Le(()=>{var Me;const ne=(Me=re.value)==null?void 0:Me.config,me=Zn.value;return!ne||!me?"":ne.renderLayerSlotPosition==="above"?e("renderLayer.resolvedAbove",{slot:me.name}):as.value?e("renderLayer.resolvedBetween",{previous:as.value.name,slot:me.name}):""}),Rc=Le(()=>{var Me;const ne=(Me=re.value)==null?void 0:Me.config;if(!ne||ne.renderLayerMode!=="slot")return"";if(!vi.value.length)return e("renderLayer.warningNoSpine");if(!ne.renderLayerSpineId)return e("renderLayer.warningNoSelection");const me=Jn.value;return me?!me.enabled||me.status!=="ready"?e("renderLayer.warningNotReady"):ne.renderLayerSlotName?Zn.value?ne.renderLayerSlotPosition==="below"&&!as.value?e("renderLayer.warningFirstSlot"):"":e("renderLayer.warningMissingSlot"):"":e("renderLayer.warningMissingSpine")});function al(){var me;const ne=(me=re.value)==null?void 0:me.config;ne&&(ne.renderLayerMode="slot",!ne.renderLayerSpineId&&vi.value.length&&(ne.renderLayerSpineId=vi.value[0].id),Pn.value=!ne.renderLayerSlotName)}function Fc(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.renderLayerSpineId=Math.max(0,Math.round(Number(ne.target.value)||0)),me.renderLayerSlotName="",Pn.value=!0)}function ll(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.renderLayerSlotName=ne.name,Pn.value=!1,xt.value="")}function Lc(){var me;const ne=(me=re.value)==null?void 0:me.config;ne&&(ne.renderLayerSlotName="",ne.renderLayerSlotPosition="above")}const cl=Re(!1),dl=Le(()=>{var me;const ne=new Set(((me=re.value)==null?void 0:me.config.collisionColliderIds)||[]);return i.colliders.filter(Me=>ne.has(Me.id))}),Er=Le(()=>{var me;const ne=new Set(((me=re.value)==null?void 0:me.config.collisionColliderIds)||[]);return i.colliders.filter(Me=>!ne.has(Me.id))});Ut(()=>{var ne,me;return[(ne=re.value)==null?void 0:ne.id,(me=re.value)==null?void 0:me.config.collision]},()=>{cl.value=!1}),Ut(()=>{var ne;return(ne=re.value)==null?void 0:ne.id},()=>{Pn.value=!1,xt.value=""});function na(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;!me||me.collisionColliderIds.includes(ne)||(me.collisionColliderIds.push(ne),cl.value=!1)}function Mh(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.collisionColliderIds=me.collisionColliderIds.filter(it=>it!==ne))}ma(()=>{for(const ne of i.systems)ne.visible==null&&(ne.visible=!0);for(const ne of i.colliders)ne.visible==null&&(ne.visible=!0);for(const ne of i.paths)ne.visible==null&&(ne.visible=!0);for(const ne of i.spines)ne.visible==null&&(ne.visible=!0)}),ma(()=>{if(!re.value)return;const ne=fr(re.value.config);ne.lifeMode==="curve"&&(ne.lifeMode="random"),ne.speedMode==="curve"&&(ne.speedMode="random"),ne.scaleMode==="curve"&&(ne.scaleMode="random"),ne.initialRotationMode==="curve"&&(ne.initialRotationMode="random"),ne.mode==="stream"&&!(ne.duration>0)&&(ne.duration=1),ne.streamBehavior==="loop"&&(ne.emitterFollow||ne.emitterFollowMode!=="none")&&xv(ne)}),ma(()=>{const ne=new Set(i.colliders.map(Me=>Me.id)),me=new Set(i.systems.map(Me=>Me.id));for(const Me of i.systems){const it=fr(Me.config),un=it.collisionColliderIds.filter(bi=>ne.has(bi));un.length!==it.collisionColliderIds.length&&(it.collisionColliderIds=un),it.spawnPathId>0&&!i.paths.some(bi=>bi.id===it.spawnPathId)&&(it.spawnPathId=0,(it.emissionAngleMode==="path-normal"||it.emissionAngleMode==="path-tangent")&&(it.emissionAngleMode="fixed"));const ia=tC(i.systems,Me.id);for(const bi of it.events||[])bi.targetSystemId>0&&(bi.targetSystemId===Me.id||ia.has(bi.targetSystemId)||!me.has(bi.targetSystemId))&&(bi.targetSystemId=0);if(it.emitterFollowMode!=="bone")continue;const Ph=i.spines.find(bi=>bi.id===it.emitterFollowSpineId);!!(Ph!=null&&Ph.bones.some(bi=>bi.name===it.emitterFollowBoneName))||(it.emitterFollowMode="none",it.emitterFollowSpineId=0,it.emitterFollowBoneName="")}}),ma(()=>{for(const ne of i.systems){const me=fr(ne.config);me.renderLayerMode!=="slot"||!me.renderLayerSpineId||i.spines.some(Me=>Me.id===me.renderLayerSpineId)||(me.renderLayerSpineId=0,me.renderLayerSlotName="")}}),ma(()=>{for(const ne of i.colliders)ne.followPathId==null&&(ne.followPathId=0),ne.followDuration>0||(ne.followDuration=2),ne.followPathRotation==null&&(ne.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(ne.followCurveMode)||(ne.followCurveMode="跟随导出"),(!Array.isArray(ne.followCurve)||ne.followCurve.length<2)&&(ne.followCurve=[{x:0,y:0},{x:1,y:1}])});const ls=qo({config:!0,scene:!i.settings.floatingMenuEnabled,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function yv(ne){const me=eE.find(Me=>Me.key===ne);return!!me&&(!me.requiresParticle||mt.value==="particle"&&!!re.value)}function sE(ne){yv(ne)&&(lt.value=ne)}function rE(ne){return!i.settings.floatingMenuEnabled||lt.value===ne}function oE(ne){return i.settings.floatingMenuEnabled?lt.value===ne:!ls[ne]}function aE(ne){i.settings.floatingMenuEnabled||(ls[ne]=!ls[ne])}Ut(()=>i.settings.floatingMenuEnabled,ne=>{ne&&(lt.value=null,ls.scene=!0)},{immediate:!0}),Ut(()=>[i.activeObjectType,i.activeObjectId],([ne])=>{i.settings.floatingMenuEnabled&&ne!=="particle"&&(ls.scene=!1,lt.value="scene")});function lE(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;me&&(me.mode=ne,ne==="stream"&&!(me.duration>0)&&(me.duration=1))}function cE(ne){var it;const me=(it=re.value)==null?void 0:it.config;if(!me)return;const Me=Math.min(1800,Math.max(1,Math.ceil(Number(ne)||1)));me.loopDurationFrames=Me}function xv(ne){const me=lc();ne.emitterFollow=!1,ne.emitterFollowMode="none",ne.emitterFollowPathId=me.emitterFollowPathId,ne.emitterFollowSpineId=me.emitterFollowSpineId,ne.emitterFollowBoneName=me.emitterFollowBoneName,ne.emitterFollowBoneOffsetX=me.emitterFollowBoneOffsetX,ne.emitterFollowBoneOffsetY=me.emitterFollowBoneOffsetY,ne.emitterFollowBoneRotation=me.emitterFollowBoneRotation,ne.emitterFollowBoneScaleX=me.emitterFollowBoneScaleX,ne.emitterFollowBoneScaleY=me.emitterFollowBoneScaleY,ne.emitterAngleMode=me.emitterAngleMode,ne.emitterFollowCurve=me.emitterFollowCurve.map(Me=>({...Me})),ne.emitterFollowDuration=me.emitterFollowDuration,ne.emitterFollowSpace=me.emitterFollowSpace,ne.emitterFollowDirection=me.emitterFollowDirection,ne.emitterFollowOffset=me.emitterFollowOffset}function dE(ne){var un;const me=(un=re.value)==null?void 0:un.config;if(!me||me.streamBehavior===ne)return;const Me=ne==="loop",it=e(Me?"errors.confirmLoopFollowEnter":"errors.confirmLoopFollowExit");window.confirm(it)&&(xv(me),me.streamBehavior=ne,Me||(me.generateLoopStartAnimation=!1,me.generateLoopEndAnimation=!1))}function uE(ne,me){var un;const Me=(un=re.value)==null?void 0:un.config;if(!Me)return;const it=me.target.checked;ne==="start"?Me.generateLoopStartAnimation=it:Me.generateLoopEndAnimation=it}function hE(ne,me){var un;const Me=(un=re.value)==null?void 0:un.config;if(!Me)return;const it=Math.min(1800,Math.max(1,Math.ceil(Number(me.target.value)||30)));ne==="start"?Me.loopStartDurationFrames=it:Me.loopEndDurationFrames=it}function fE(ne,me){var un;const Me=(un=re.value)==null?void 0:un.config;if(!Me)return;const it=me.target.checked;ne==="start"?Me.loopStartUseCustomDuration=it:Me.loopEndUseCustomDuration=it}function pE(ne,me){const Me=ne.target.value;if(me.emitterFollowMode=Me,Me!=="bone"){me.emitterFollowSpineId=0,me.emitterFollowBoneName="";return}wv(me)}function wv(ne){const me=gi.value;if(!me){ne.emitterFollowMode="none",ne.emitterFollowSpineId=0,ne.emitterFollowBoneName="";return}ne.emitterFollowMode="bone",ne.emitterFollowSpineId=me.spine.id,ne.emitterFollowBoneName=me.boneName}const mE={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","eventEnabled","events","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function gE(ne){var it;const me=(it=re.value)==null?void 0:it.config;if(ne==="export"){i.settings.exportSettings=Hg();return}if(!me)return;const Me=lc();for(const un of mE[ne])me[un]=Me[un]}function vE(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function bE(ne){var me;i.selectSystem(((me=i.systems[ne])==null?void 0:me.id)??0)}function ul(){i.settings.floatingMenuEnabled&&(ls.scene=!1,lt.value="scene")}function yE(){ul(),i.addSystem()}function xE(){ul(),i.addCollider()}function wE(){ul(),i.addPath()}function SE(){ul(),i.addSpine()}function CE(){ul(),i.duplicateSelectedObject()}function Us(ne,me,Me=0,it=0,un=0,ia=0){return{x:ne,y:me,inX:Me,inY:it,outX:un,outY:ia}}function AE(){const ne=Kn.value;if(!(!ne||!ne.preset))if(ne.preset==="circle"){const Me=60.751328;ne.points=[Us(110,0,0,-Me,0,Me),Us(0,110,Me,0,-Me,0),Us(-110,0,0,Me,0,-Me),Us(0,-110,-Me,0,Me,0)],ne.closed=!0}else if(ne.preset==="square")ne.points=[Us(-100,-100),Us(100,-100),Us(100,100),Us(-100,100)],ne.closed=!0;else{const me=ne.preset==="star"?10:6;ne.points=Array.from({length:me},(Me,it)=>{const un=ne.preset==="star"&&it%2?50:110,ia=-Math.PI*.5+it/me*Math.PI*2;return Us(Math.cos(ia)*un,Math.sin(ia)*un)}),ne.closed=!0}}function TE(){Kn.value&&(Kn.value.points=[])}function EE(){re.value&&(re.value.config.seed=Math.floor(Math.random()*999999)+1)}function _E(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;!me||ne==="direction"||(me.speedOverLifeMode=ne,ne==="curve"&&me.speedOverLifeMin===me.speedOverLifeMax&&(me.speedOverLifeMin=0,me.speedOverLifeMax=1))}function Sv(){var me;const ne=(me=re.value)==null?void 0:me.config;!ne||ne.scaleOverLifeMode!=="curve"||(ne.scaleOverLifeMin===ne.scaleOverLifeMax&&(ne.scaleOverLifeMin=0,ne.scaleOverLifeMax=1),ne.scaleYOverLifeMin===ne.scaleYOverLifeMax&&(ne.scaleYOverLifeMin=0,ne.scaleYOverLifeMax=1))}function ME(ne){var Me;const me=(Me=re.value)==null?void 0:Me.config;!me||ne==="direction"||(me.scaleOverLifeMode=ne,Sv())}const PE={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function kE(){var Me;const ne=(Me=re.value)==null?void 0:Me.config;if(!ne)return;const me=PE[ne.shape];me&&Object.assign(ne,me)}function IE(){var me;const ne=(me=re.value)==null?void 0:me.config;!ne||ne.spawnPathId>0||(ne.emissionAngleMode==="path-normal"||ne.emissionAngleMode==="path-tangent")&&(ne.emissionAngleMode="fixed")}return{store:i,exportSettings:t,exportBusy:n,exportTarget:s,exportMessage:r,exportError:o,connectorPairUrl:a,connectorStatusText:c,connectorStatusClass:l,connectorReady:d,connectorAuthorizationUrl:u,connectorDisabledReason:h,connectorButtonTitle:f,refreshConnectorHealth:p,exportSpineJson:m,exportSpineProject:g,exportSpineImages:v,configFileInput:y,selectedPreset:b,presetOptions:x,presetLoading:T,configMessage:E,configError:S,localProjects:C,selectedLocalProjectName:z,selectLocalProject:K,projectSaveOpen:M,projectNameDraft:k,projectSaveError:P,projectStorageBusy:I,projectFilesInput:R,saveConfig:N,closeProjectSaveDialog:$,confirmSaveConfig:j,loadLocalProject:B,downloadLocalProject:Y,downloadCurrentProject:U,removeLocalProject:D,downloadAllLocalProjects:L,loadAllProjectFiles:X,onConfigFileChange:Z,refreshPresets:ae,loadSelectedPreset:ce,resolvedCurveEditorMode:ve,sys:re,textureFileInput:Ee,sequenceFileInput:q,trailTextureFileInput:J,addTrailResource:ie,openTrailTexturePicker:se,onTrailRigChange:G,onTrailResourceBoneCountChange:H,onTrailResourceRotationChange:O,onTrailTextureFile:V,resetTrailTexture:W,removeTrailResource:ee,setTrailResourceWeight:be,toggleTrailResourceLock:ye,setTrailColor:he,commitTrailColor:Be,addImageResource:Ae,openTexturePicker:de,openSequencePicker:ge,onTextureFile:Ve,onSequenceFiles:qe,resetTexture:bt,setResourceFixedColor:ft,commitResourceFixedColor:Oe,removeImageResource:ot,setResourceWeight:Te,toggleResourceLock:ue,automaticLoopDuration:fe,loopDurationFrames:nt,activeObjectType:mt,activeSection:lt,canUseSection:yv,activateSection:sE,sectionVisible:rE,sectionOpen:oE,activeCollider:ct,activePath:Kn,activeSpine:_i,canCopyObject:wn,selectedSpineBone:gi,boundSpineBone:Bn,renderLayerSlotPickerOpen:Pn,renderLayerSlotSearch:xt,renderLayerReadySpines:vi,renderLayerSpineReady:Ui,renderLayerSlots:Un,renderLayerFilteredSlots:Vi,renderLayerSlotLabel:ho,renderLayerResolvedLabel:Ic,renderLayerWarning:Rc,setRenderLayerSlotMode:al,selectRenderLayerSpine:Fc,pickRenderLayerSlot:ll,clearRenderLayerSlot:Lc,collisionPickerOpen:cl,selectedCollisionBodies:dl,availableCollisionBodies:Er,addCollisionBody:na,removeCollisionBody:Mh,collapsed:ls,toggle:aE,setEmitMode:lE,setLoopDurationFrames:cE,setStreamBehavior:dE,setLoopSection:uE,setLoopSectionDuration:hE,setLoopCustomDuration:fE,onEmitterFollowModeChange:pE,bindSelectedBone:wv,resetModule:gE,normalizeExportFps:vE,select:bE,addSys:yE,addCollider:xE,addPath:wE,addSpine:SE,copySelectedObject:CE,applyPathPreset:AE,clearPathAnchors:TE,randomizeSeed:EE,setSpeedOverLifeMode:_E,prepareScaleOverLifeCurve:Sv,setScaleOverLifeMode:ME,onShapeChange:kE,onSpawnPathChange:IE,LINEAR_CURVE:EV,FLAT_CURVE:Hm,ALPHA_CURVE:_V,RESOURCE_ALPHA_CURVE:Gm,TRAIL_ALPHA_CURVE:Wm,TRAIL_SHAPE_CURVE:qm}}const tE=Symbol("particle-panel");function kY(){const i=PY();return F1(tE,i),i}function Tr(){const i=No(tE);if(!i)throw new Error("Particle panel sections require a ParticlePanel parent");return i}const IY={class:"group config-management"},RY={class:"caret"},FY={class:"group-body config-management-body"},LY={class:"config-toolbar"},DY=["title"],OY=["title"],NY=["aria-label","disabled"],$Y={value:""},BY=["value"],UY={class:"project-library"},VY={class:"project-library-title"},XY={key:0,class:"project-list",role:"listbox"},YY=["title","aria-selected","onClick","onDblclick","onKeydown"],zY={class:"project-name"},jY={key:0,class:"project-size"},HY=["onClick"],GY=["onClick"],WY={key:1,class:"project-empty"},qY={class:"project-bulk-actions"},KY=["disabled"],JY=["disabled"],ZY={class:"project-save-head"},QY=["disabled"],ez=["placeholder"],tz={key:0,class:"project-save-error"},nz={class:"project-save-actions"},iz=["disabled"],sz=["disabled"],rz=Zt({__name:"ProjectConfigSection",setup(i){const{store:e,configFileInput:t,selectedPreset:n,presetOptions:s,presetLoading:r,configMessage:o,configError:a,localProjects:c,projectSaveOpen:l,projectNameDraft:d,projectSaveError:u,projectStorageBusy:h,saveConfig:f,closeProjectSaveDialog:p,confirmSaveConfig:m,loadLocalProject:g,downloadLocalProject:v,downloadCurrentProject:y,removeLocalProject:b,downloadAllLocalProjects:x,projectFilesInput:T,loadAllProjectFiles:E,selectedLocalProjectName:S,selectLocalProject:C,onConfigFileChange:M,refreshPresets:k,loadSelectedPreset:P,collapsed:I,toggle:N,sectionOpen:$,select:j}=Tr(),{locale:B}=mi();function Y(D){const L=Math.max(1,D/1024);if(L<1024)return`${L<10?L.toFixed(1):Math.round(L)} KB`;const R=L/1024;return`${R<10?R.toFixed(1):Math.round(R)} MB`}function U(D){return EY(D,B.value)}return(D,L)=>(Q(),te(_e,null,[w("div",IY,[w("div",{class:"group-head",onClick:L[1]||(L[1]=R=>_(N)("config"))},[w("span",RY,F(_(I).config?"▸":"▾"),1),w("span",null,F(D.$t("config.title")),1),w("button",{type:"button",class:"group-download",onClick:L[0]||(L[0]=We((...R)=>_(y)&&_(y)(...R),["stop"]))},F(D.$t("config.local.downloadCurrent")),1)]),pe(w("div",FY,[w("div",LY,[w("button",{title:D.$t("config.saveTitle"),onClick:L[2]||(L[2]=(...R)=>_(f)&&_(f)(...R))},F(D.$t("config.save")),9,DY),w("button",{title:D.$t("config.loadTitle"),onClick:L[3]||(L[3]=R=>{var X;return(X=_(t))==null?void 0:X.click()})},F(D.$t("config.load")),9,OY),pe(w("select",{"onUpdate:modelValue":L[4]||(L[4]=R=>Jt(n)?n.value=R:null),"aria-label":D.$t("config.presets"),disabled:!_(s).length||_(r),onPointerdown:L[5]||(L[5]=(...R)=>_(k)&&_(k)(...R)),onFocus:L[6]||(L[6]=(...R)=>_(k)&&_(k)(...R)),onChange:L[7]||(L[7]=(...R)=>_(P)&&_(P)(...R))},[w("option",$Y,F(_(s).length?D.$t("config.selectPreset"):D.$t("config.noPresets")),1),(Q(!0),te(_e,null,Mt(_(s),R=>(Q(),te("option",{key:R.file,value:R.file},F(U(R)),9,BY))),128))],40,NY),[[_t,_(n)]]),w("input",{ref_key:"configFileInput",ref:t,hidden:"",type:"file",accept:".json,application/json",onChange:L[8]||(L[8]=(...R)=>_(M)&&_(M)(...R))},null,544)]),_(o)?(Q(),te("div",{key:0,class:Pe(["config-message",{error:_(a)}])},F(_(o)),3)):xe("",!0),w("div",UY,[w("div",VY,F(D.$t("config.local.listTitle")),1),_(c).length?(Q(),te("div",XY,[(Q(!0),te(_e,null,Mt(_(c),R=>(Q(),te("div",{key:R.name,class:Pe(["project-row",{selected:_(S)===R.name}]),title:D.$t("config.local.loadHint"),role:"option",tabindex:"0","aria-selected":_(S)===R.name,onClick:X=>_(C)(R),onDblclick:X=>_(g)(R),onKeydown:[es(We(X=>_(g)(R),["prevent"]),["enter"]),es(We(X=>_(C)(R),["prevent"]),["space"])]},[w("span",zY,F(R.name),1),_(e).settings.showProjectSize?(Q(),te("span",jY,F(Y(R.size)),1)):xe("",!0),w("div",{class:"project-actions",onDblclick:L[9]||(L[9]=We(()=>{},["stop"]))},[w("button",{type:"button",onClick:We(X=>_(b)(R),["stop"])},F(D.$t("config.local.delete")),9,HY),w("button",{type:"button",onClick:We(X=>_(v)(R),["stop"])},F(D.$t("config.local.download")),9,GY)],32)],42,YY))),128))])):(Q(),te("div",WY,F(D.$t("config.local.empty")),1))]),w("div",qY,[w("button",{type:"button",disabled:_(h),onClick:L[10]||(L[10]=(...R)=>_(x)&&_(x)(...R))},F(D.$t("config.local.downloadAll")),9,KY),w("button",{type:"button",disabled:_(h),onClick:L[11]||(L[11]=R=>{var X;return(X=_(T))==null?void 0:X.click()})},F(D.$t("config.local.loadAll")),9,JY),w("input",{ref_key:"projectFilesInput",ref:T,hidden:"",type:"file",multiple:"",accept:".json,application/json",onChange:L[12]||(L[12]=(...R)=>_(E)&&_(E)(...R))},null,544)])],512),[[Xt,_($)("config")]])]),(Q(),kt(Qu,{to:"body"},[_(l)?(Q(),te("div",{key:0,class:"project-save-backdrop",onPointerdown:L[18]||(L[18]=We((...R)=>_(p)&&_(p)(...R),["self"]))},[w("form",{class:"project-save-dialog",onSubmit:L[16]||(L[16]=We((...R)=>_(m)&&_(m)(...R),["prevent"])),onKeydown:L[17]||(L[17]=es(We((...R)=>_(p)&&_(p)(...R),["prevent"]),["esc"]))},[w("div",ZY,[w("span",null,F(D.$t("config.local.saveTitle")),1),w("button",{type:"button",disabled:_(h),onClick:L[13]||(L[13]=(...R)=>_(p)&&_(p)(...R))},"✕",8,QY)]),w("label",null,[w("span",null,F(D.$t("config.local.name")),1),pe(w("input",{"onUpdate:modelValue":L[14]||(L[14]=R=>Jt(d)?d.value=R:null),class:"inp",placeholder:D.$t("config.local.namePlaceholder"),autofocus:""},null,8,ez),[[Je,_(d)]])]),_(u)?(Q(),te("div",tz,F(_(u)),1)):xe("",!0),w("div",nz,[w("button",{type:"button",disabled:_(h),onClick:L[15]||(L[15]=(...R)=>_(p)&&_(p)(...R))},F(D.$t("common.cancel")),9,iz),w("button",{type:"submit",class:"primary",disabled:_(h)},F(D.$t("config.save")),9,sz)])],32)],32)):xe("",!0)]))],64))}}),Hx=dn(rz,[["__scopeId","data-v-2e5d6a49"]]),oz={class:"ns-label"},az=["min","max","step","value","disabled"],lz=["min","max","step","value","disabled"],cz=Zt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=e,s=Re(String(t.modelValue));Ut(()=>t.modelValue,c=>{s.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||n("update:modelValue",l)}function o(c){s.value=c.target.value;const l=parseFloat(s.value);Number.isNaN(l)||n("update:modelValue",l)}function a(){const c=parseFloat(s.value);Number.isNaN(c)&&(s.value=String(t.modelValue))}return(c,l)=>(Q(),te("div",{class:Pe(["ns",{disabled:i.disabled}])},[w("span",oz,F(i.label),1),w("input",{type:"range",class:"ns-range",min:i.min,max:i.max,step:i.step,value:i.modelValue,disabled:i.disabled,onInput:r},null,40,az),w("input",{type:"number",class:"ns-num",min:i.min,max:i.max,step:i.step,value:s.value,disabled:i.disabled,onInput:o,onBlur:a},null,40,lz)],2))}}),Ue=dn(cz,[["__scopeId","data-v-7c2fbed0"]]),dz={class:"ce"},uz={class:"ce-editor"},hz={class:"ce-grid"},fz=["x1","x2","y2"],pz=["y1","x2","y2"],mz=["x","y","width","height"],gz=["d"],vz={key:0,class:"ce-handles"},bz=["x1","y1","x2","y2"],yz=["cx","cy","onPointerdown"],xz=["x1","y1","x2","y2"],wz=["cx","cy","onPointerdown"],Sz=["cx","cy"],Cz=["cx","cy","onPointerdown","onDblclick"],Az={class:"ce-nav"},Tz={class:"ce-tip"},Ez=["title"],kr=8,_z=Zt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=e,s=Re(null),r=Re(300),o=Re(110);let a=null;function c(){if(!s.value)return;const P=s.value.getBoundingClientRect();r.value=P.width,o.value=P.height}function l(P){return kr+P*(r.value-kr*2)}function d(P){return kr+(1-P)*(o.value-kr*2)}function u(){return[...t.modelValue].sort((P,I)=>P.x-I.x)}function h(P){n("update:modelValue",[...P].sort((I,N)=>I.x-N.x))}function f(){h(t.defaultValue.map(P=>({...P})))}const p=Le(()=>u());function m(P){const I=p.value[P],N=p.value[Math.max(0,P-1)];return{x:I.x-(I.x-N.x)/3,y:I.y-(I.y-N.y)/3}}function g(P){const I=p.value[P],N=p.value[Math.min(p.value.length-1,P+1)];return{x:I.x+(N.x-I.x)/3,y:I.y+(N.y-I.y)/3}}function v(P){const I=p.value[P],N=m(P);return{x:I.x+(I.inX??N.x-I.x),y:I.y+(I.inY??N.y-I.y)}}function y(P){const I=p.value[P],N=g(P);return{x:I.x+(I.outX??N.x-I.x),y:I.y+(I.outY??N.y-I.y)}}const b=Le(()=>{if(!p.value.length)return"";let P=`M ${l(p.value[0].x)} ${d(p.value[0].y)}`;for(let I=1;IMath.abs(j.x-I)>.02);$.push({x:I,y:N}),h($)}let S={t:0,i:-1,x:0,y:0};function C(P,I){P.stopPropagation();const N=u().findIndex(Y=>Math.abs(Y.x-p.value[I].x)<1e-6&&Math.abs(Y.y-p.value[I].y)<1e-6);if(N<0)return;const $=Date.now();if($-S.t<300&&S.i===I&&Math.abs(P.clientX-S.x)<8&&Math.abs(P.clientY-S.y)<8){S={t:0,i:-1,x:0,y:0},k(I);return}S={t:$,i:I,x:P.clientX,y:P.clientY};const j=Y=>{(Math.abs(Y.clientX-P.clientX)>8||Math.abs(Y.clientY-P.clientY)>8)&&(S={t:0,i:-1,x:0,y:0});const{x:U,y:D}=x(Y.clientX,Y.clientY),L=u();L[N]={x:U,y:D},h(L)},B=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",B)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",B)}function M(P,I,N){P.stopPropagation();const $=B=>{const Y=x(B.clientX,B.clientY),U=u(),D=U[I],L=N==="in"?U[Math.max(0,I-1)].x:D.x,R=N==="in"?D.x:U[Math.min(U.length-1,I+1)].x,X=Math.min(R,Math.max(L,Y.x)),z=Math.round((X-D.x)*100)/100,K=Math.round((Y.y-D.y)*100)/100;U[I]=N==="in"?{...D,inX:z,inY:K}:{...D,outX:z,outY:K},h(U)},j=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",j)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",j)}function k(P,I){I==null||I.stopPropagation();const N=u();N.length<=2||(T=Date.now(),h(N.filter(($,j)=>j!==P)))}return Ti(()=>{c(),a=new ResizeObserver(c),s.value&&a.observe(s.value)}),nl(()=>{a==null||a.disconnect()}),(P,I)=>(Q(),te("div",dz,[w("div",uz,[(Q(),te("svg",{ref_key:"svg",ref:s,class:"ce-svg",onDblclick:E},[w("g",hz,[(Q(),te(_e,null,Mt([.25,.5,.75],N=>w("line",{key:"v"+N,x1:l(N),y1:"0",x2:l(N),y2:d(0)},null,8,fz)),64)),(Q(),te(_e,null,Mt([.25,.5,.75],N=>w("line",{key:"h"+N,x1:"0",y1:d(N),x2:l(1),y2:d(N)},null,8,pz)),64))]),w("rect",{x:l(0),y:d(1),width:l(1)-l(0),height:d(0)-d(1),class:"ce-frame",fill:"none"},null,8,mz),w("path",{d:b.value,class:"ce-line",fill:"none"},null,8,gz),i.mode==="bezier"?(Q(),te("g",vz,[(Q(!0),te(_e,null,Mt(p.value,(N,$)=>(Q(),te(_e,{key:"handles-"+$},[$>0?(Q(),te("line",{key:0,x1:l(N.x),y1:d(N.y),x2:l(v($).x),y2:d(v($).y)},null,8,bz)):xe("",!0),$>0?(Q(),te("circle",{key:1,cx:l(v($).x),cy:d(v($).y),r:"4",onPointerdown:j=>M(j,$,"in")},null,40,yz)):xe("",!0),$M(j,$,"out")},null,40,wz)):xe("",!0)],64))),128))])):xe("",!0),(Q(!0),te(_e,null,Mt(p.value,(N,$)=>(Q(),te("g",{key:$},[w("circle",{cx:l(N.x),cy:d(N.y),r:"5",class:"ce-node"},null,8,Sz),w("circle",{cx:l(N.x),cy:d(N.y),r:"9",class:"ce-hit",onPointerdown:j=>C(j,$),onDblclick:j=>k($,j)},null,40,Cz)]))),128))],544)),w("div",Az,[w("span",Tz,F(i.mode==="bezier"?P.$t("curve.bezierHint"):P.$t("curve.linearHint")),1)])]),w("button",{class:"ce-reset",type:"button",title:P.$t("curve.resetTitle"),onClick:f},F(P.$t("common.reset")),9,Ez)]))}}),Ts=dn(_z,[["__scopeId","data-v-8f475293"]]),Mz={class:"spine-editor"},Pz={class:"editor-title"},kz={class:"field wide"},Iz={class:"grid three"},Rz={class:"field"},Fz={class:"field"},Lz={class:"field"},Dz={class:"grid three"},Oz={class:"field"},Nz={class:"field"},$z={class:"field"},Bz={class:"section-title"},Uz=["disabled"],Vz={class:"folder-hint"},Xz={class:"asset-row"},Yz=["title"],zz={class:"asset-row"},jz=["title"],Hz={class:"asset-row"},Gz=["title"],Wz={class:"asset-actions"},qz=["disabled"],Kz={class:"runtime-note"},Jz={key:0},Zz={key:0,class:"error"},Qz={class:"section-box"},e6={class:"section-title"},t6={key:0,class:"empty"},n6={key:1,class:"field wide"},i6={value:""},s6=["value"],r6={class:"section-box"},o6={class:"tree-title-row"},a6={class:"section-title"},l6=["disabled","title"],c6=["disabled","title"],d6={class:"tree-tabs"},u6={key:0,class:"empty"},h6={key:1,class:"bone-search"},f6=["aria-label","placeholder"],p6=["title","aria-label"],m6={key:2,class:"empty"},g6={key:3,class:"bone-tree"},v6=["onClick","onKeydown"],b6=["title","onClick"],y6={key:1,class:"bone-leaf"},x6={class:"bone-name"},w6={key:0,class:"empty"},S6={key:1,class:"bone-search"},C6=["aria-label","placeholder"],A6=["title","aria-label"],T6={key:2,class:"empty"},E6={key:3,class:"bone-tree slot-tree"},_6=["title","onClick","onKeydown"],M6={class:"slot-order"},P6={class:"bone-name"},k6={class:"slot-attachment"},I6=Zt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(i){const e=i,{t}=mi(),n=Zo(),s=Re(null),r=Re(null),o=Re(null),a=Re(null),c=Re(new Set),l=Re(""),d=Re("bone"),u=Re(""),h=Re(null),f=Re(null),p=Re([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const m=Le(()=>{var X;return((X=h.value)==null?void 0:X.name)||e.spineObject.skeletonFileName}),g=Le(()=>{var X;return((X=f.value)==null?void 0:X.name)||e.spineObject.atlasFileName}),v=Le(()=>p.value.length?p.value.map(X=>X.name):e.spineObject.textureFileNames),y=Le(()=>v.value.length?t("spine.textureSummary",{count:v.value.length,names:v.value.join(", ")}):"PNG / JPEG / WebP..."),b=Le(()=>new Set(e.spineObject.bones.map(X=>X.parent).filter(X=>!!X))),x=Le(()=>new Map(e.spineObject.bones.map(X=>[X.name,X]))),T=Le(()=>e.spineObject.bones.filter(X=>{var Z;const z=l.value.trim().toLocaleLowerCase();if(z)return X.name.toLocaleLowerCase().includes(z);let K=X.parent;for(;K;){if(c.value.has(K))return!1;K=((Z=x.value.get(K))==null?void 0:Z.parent)||null}return!0})),E=Le(()=>b.value.size>0&&[...b.value].every(X=>c.value.has(X))),S=Le(()=>{const X=u.value.trim().toLocaleLowerCase(),z=[...e.spineObject.slots].sort((K,Z)=>K.order-Z.order);return X?z.filter(K=>K.name.toLocaleLowerCase().includes(X)||K.attachment.toLocaleLowerCase().includes(X)):z});function C(X){const z=e.spineObject.selectedBone===X;for(const K of n.spines)K.selectedBone="";z||(e.spineObject.selectedBone=X)}function M(X){const z=e.spineObject.selectedSlot===X;for(const K of n.spines)K.selectedSlot="";z||(e.spineObject.selectedSlot=X)}function k(X){c.value.has(X)?c.value.delete(X):c.value.add(X)}function P(){c.value=E.value?new Set:new Set(b.value)}function I(X){var z;return((z=X.target.files)==null?void 0:z[0])||null}function N(X){h.value=I(X)}function $(X){f.value=I(X)}function j(X){p.value=Array.from(X.target.files||[])}function B(X){return X.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function Y(X){const z=Array.from(X.target.files||[]);if(!z.length)return;const K=z.filter(re=>/\.(json|skel)$/i.test(re.name)),Z=z.filter(re=>/\.atlas$/i.test(re.name)),ae=z.filter(re=>/\.(png|jpe?g|webp|wepb)$/i.test(re.name)),ce=Z.map(re=>({atlas:re,skeleton:K.find(Ee=>B(Ee)===B(re))})).find(re=>re.skeleton),ve=(ce==null?void 0:ce.skeleton)||K[0]||null,we=(ce==null?void 0:ce.atlas)||Z[0]||null;if(h.value=ve,f.value=we,p.value=ae,!ve||!we||!ae.length){const re=[!ve&&"JSON / SKEL",!we&&"Atlas",!ae.length&&t("spine.textureImages")].filter(Boolean).join(", ");e.spineObject.status="error",e.spineObject.error=t("spine.missingFolderAssets",{missing:re});return}await L()}function U(){n.recalcTotalFrames()}function D(){U(),n.timeline.frame=0}async function L(){var K;const X=h.value,z=f.value;if(!X||!z||!p.value.length){e.spineObject.status="error",e.spineObject.error=t("spine.chooseAssets");return}e.spineObject.status="loading",e.spineObject.error="";try{const Z=await zA(X,z,p.value);gh(e.spineObject.id,Z),e.spineObject.skeletonFileName=X.name,e.spineObject.atlasFileName=z.name,e.spineObject.textureFileNames=p.value.map(ae=>ae.name),e.spineObject.dataVersion=Z.dataVersion,e.spineObject.animations=Z.animations,e.spineObject.bones=Z.bones,e.spineObject.slots=Z.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",u.value="",c.value=new Set,e.spineObject.selectedAnimation=((K=Z.animations[0])==null?void 0:K.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",U(),n.timeline.frame=0;try{e.spineObject.sourceBundle=await uU(X,z,p.value)}catch(ae){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",ae)}}catch(Z){e.spineObject.status="error",e.spineObject.error=Z instanceof Error?Z.message:String(Z)}}function R(){Ec(e.spineObject.id),h.value=null,f.value=null,p.value=[],s.value&&(s.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),a.value&&(a.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",u.value="",c.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",U()}return(X,z)=>(Q(),te("div",Mz,[w("div",Pz,F(X.$t("spine.title")),1),w("label",kz,[w("span",null,F(X.$t("spine.name")),1),pe(w("input",{"onUpdate:modelValue":z[0]||(z[0]=K=>i.spineObject.name=K)},null,512),[[Je,i.spineObject.name]])]),w("div",Iz,[w("label",Rz,[w("span",null,F(X.$t("spine.xPosition")),1),pe(w("input",{"onUpdate:modelValue":z[1]||(z[1]=K=>i.spineObject.x=K),type:"number"},null,512),[[Je,i.spineObject.x,void 0,{number:!0}]])]),w("label",Fz,[w("span",null,F(X.$t("spine.yPosition")),1),pe(w("input",{"onUpdate:modelValue":z[2]||(z[2]=K=>i.spineObject.y=K),type:"number"},null,512),[[Je,i.spineObject.y,void 0,{number:!0}]])]),w("label",Lz,[w("span",null,F(X.$t("spine.rotation")),1),pe(w("input",{"onUpdate:modelValue":z[3]||(z[3]=K=>i.spineObject.rotation=K),type:"number"},null,512),[[Je,i.spineObject.rotation,void 0,{number:!0}]])])]),w("div",Dz,[w("label",Oz,[z[20]||(z[20]=w("span",null,"Scale X",-1)),pe(w("input",{"onUpdate:modelValue":z[4]||(z[4]=K=>i.spineObject.scaleX=K),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleX,void 0,{number:!0}]])]),w("label",Nz,[z[21]||(z[21]=w("span",null,"Scale Y",-1)),pe(w("input",{"onUpdate:modelValue":z[5]||(z[5]=K=>i.spineObject.scaleY=K),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleY,void 0,{number:!0}]])]),w("label",$z,[w("span",null,F(X.$t("spine.startTime")),1),pe(w("input",{"onUpdate:modelValue":z[6]||(z[6]=K=>i.spineObject.timeOffset=K),type:"number",min:"0",step:"0.033333",onChange:U},null,544),[[Je,i.spineObject.timeOffset,void 0,{number:!0}]])])]),z[22]||(z[22]=w("div",{class:"divider"},null,-1)),w("div",Bz,F(X.$t("spine.resources")),1),w("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:N},null,544),w("input",{ref_key:"atlasInput",ref:r,hidden:"",type:"file",accept:".atlas,text/plain",onChange:$},null,544),w("input",{ref_key:"textureInput",ref:o,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:j},null,544),w("input",{ref_key:"folderInput",ref:a,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:Y},null,544),w("button",{class:"folder-select",disabled:i.spineObject.status==="loading",onClick:z[7]||(z[7]=K=>{var Z;return(Z=a.value)==null?void 0:Z.click()})},F(X.$t("spine.chooseFolder")),9,Uz),w("div",Vz,F(X.$t("spine.folderHint")),1),w("div",Xz,[w("div",{class:"asset-name",title:m.value},F(m.value||"JSON / SKEL..."),9,Yz),w("button",{onClick:z[8]||(z[8]=K=>{var Z;return(Z=s.value)==null?void 0:Z.click()})},F(X.$t("spine.choose")),1)]),w("div",zz,[w("div",{class:"asset-name",title:g.value},F(g.value||"Atlas..."),9,jz),w("button",{onClick:z[9]||(z[9]=K=>{var Z;return(Z=r.value)==null?void 0:Z.click()})},F(X.$t("spine.choose")),1)]),w("div",Hz,[w("div",{class:"asset-name",title:v.value.join(", ")},F(y.value),9,Gz),w("button",{onClick:z[10]||(z[10]=K=>{var Z;return(Z=o.value)==null?void 0:Z.click()})},F(X.$t("spine.chooseMultiple")),1)]),w("div",Wz,[w("button",{class:"load",disabled:i.spineObject.status==="loading",onClick:L},F(i.spineObject.status==="loading"?X.$t("spine.loading"):X.$t("spine.load")),9,qz),w("button",{class:"clear",onClick:R},F(X.$t("spine.clear")),1)]),w("div",Kz,[Ct(F(X.$t("spine.supportNote"))+" ",1),i.spineObject.dataVersion?(Q(),te("span",Jz," · "+F(X.$t("spine.currentResource",{version:i.spineObject.dataVersion})),1)):xe("",!0)]),i.spineObject.error?(Q(),te("div",Zz,F(i.spineObject.error),1)):xe("",!0),w("div",Qz,[w("div",e6,F(X.$t("spine.animations")),1),i.spineObject.animations.length?(Q(),te("label",n6,[w("span",null,F(X.$t("spine.timelineAnimation")),1),pe(w("select",{"onUpdate:modelValue":z[11]||(z[11]=K=>i.spineObject.selectedAnimation=K),onChange:D},[w("option",i6,F(X.$t("spine.no")),1),(Q(!0),te(_e,null,Mt(i.spineObject.animations,K=>(Q(),te("option",{key:K.name,value:K.name},F(K.name)+"("+F(K.duration.toFixed(2))+"s) ",9,s6))),128))],544),[[_t,i.spineObject.selectedAnimation]])])):(Q(),te("div",t6,F(X.$t("spine.noAnimations")),1))]),w("div",r6,[w("div",o6,[w("div",a6,F(X.$t("spine.hierarchy")),1),d.value==="bone"?(Q(),te("button",{key:0,class:Pe(["selected-bone",{active:i.spineObject.selectedBone}]),disabled:!i.spineObject.selectedBone,title:i.spineObject.selectedBone?X.$t("spine.clearBoneTitle"):X.$t("spine.noBoneTitle"),onClick:z[12]||(z[12]=K=>i.spineObject.selectedBone="")},[i.spineObject.selectedBone?(Q(),te(_e,{key:0},[Ct(F(X.$t("spine.clearBone",{name:""})),1),w("strong",null,F(i.spineObject.selectedBone),1)],64)):(Q(),te(_e,{key:1},[Ct(F(X.$t("spine.currentBone")),1),w("strong",null,F(X.$t("spine.notSelected")),1)],64))],10,l6)):(Q(),te("button",{key:1,class:Pe(["selected-bone",{active:i.spineObject.selectedSlot}]),disabled:!i.spineObject.selectedSlot,title:i.spineObject.selectedSlot?X.$t("spine.clearSlotTitle"):X.$t("spine.noSlotTitle"),onClick:z[13]||(z[13]=K=>i.spineObject.selectedSlot="")},[i.spineObject.selectedSlot?(Q(),te(_e,{key:0},[Ct(F(X.$t("spine.clearSlot",{name:""})),1),w("strong",null,F(i.spineObject.selectedSlot),1)],64)):(Q(),te(_e,{key:1},[Ct(F(X.$t("spine.currentSlot")),1),w("strong",null,F(X.$t("spine.notSelected")),1)],64))],10,c6)),d.value==="bone"&&i.spineObject.bones.length?(Q(),te("button",{key:2,class:"tree-action",onClick:P},F(E.value?X.$t("spine.expandAll"):X.$t("spine.collapseAll")),1)):xe("",!0)]),w("div",d6,[w("button",{class:Pe({on:d.value==="bone"}),onClick:z[14]||(z[14]=K=>d.value="bone")},F(X.$t("spine.bones")),3),w("button",{class:Pe({on:d.value==="slot"}),onClick:z[15]||(z[15]=K=>d.value="slot")},F(X.$t("spine.slots")),3)]),d.value==="bone"?(Q(),te(_e,{key:0},[i.spineObject.bones.length?(Q(),te("div",h6,[pe(w("input",{"onUpdate:modelValue":z[16]||(z[16]=K=>l.value=K),type:"search","aria-label":X.$t("spine.searchBones"),placeholder:X.$t("spine.searchBonesPlaceholder")},null,8,f6),[[Je,l.value,void 0,{trim:!0}]]),l.value?(Q(),te("button",{key:0,title:X.$t("spine.clearSearch"),"aria-label":X.$t("spine.clearBoneSearch"),onClick:z[17]||(z[17]=K=>l.value="")},"✕",8,p6)):xe("",!0)])):(Q(),te("div",u6,F(X.$t("spine.notLoaded")),1)),i.spineObject.bones.length&&!T.value.length?(Q(),te("div",m6,F(X.$t("spine.noMatchingBones")),1)):i.spineObject.bones.length?(Q(),te("div",g6,[(Q(!0),te(_e,null,Mt(T.value,K=>(Q(),te("div",{key:K.name,class:Pe(["bone",{selected:i.spineObject.selectedBone===K.name}]),style:zt({paddingLeft:`${6+K.depth*16}px`}),role:"button",tabindex:"0",onClick:Z=>C(K.name),onKeydown:es(We(Z=>C(K.name),["prevent"]),["enter"])},[b.value.has(K.name)?(Q(),te("button",{key:0,class:"bone-toggle",title:c.value.has(K.name)?X.$t("spine.expandChildren"):X.$t("spine.collapseChildren"),onClick:We(Z=>k(K.name),["stop"])},F(c.value.has(K.name)?"▸":"▾"),9,b6)):(Q(),te("span",y6,"•")),w("span",x6,F(K.name),1)],46,v6))),128))])):xe("",!0)],64)):(Q(),te(_e,{key:1},[i.spineObject.slots.length?(Q(),te("div",S6,[pe(w("input",{"onUpdate:modelValue":z[18]||(z[18]=K=>u.value=K),type:"search","aria-label":X.$t("spine.searchSlots"),placeholder:X.$t("spine.searchSlotsPlaceholder")},null,8,C6),[[Je,u.value,void 0,{trim:!0}]]),u.value?(Q(),te("button",{key:0,title:X.$t("spine.clearSearch"),"aria-label":X.$t("spine.clearSlotSearch"),onClick:z[19]||(z[19]=K=>u.value="")},"✕",8,A6)):xe("",!0)])):(Q(),te("div",w6,F(X.$t("spine.notLoadedSlots")),1)),i.spineObject.slots.length&&!S.value.length?(Q(),te("div",T6,F(X.$t("spine.noMatchingSlots")),1)):i.spineObject.slots.length?(Q(),te("div",E6,[(Q(!0),te(_e,null,Mt(S.value,K=>(Q(),te("div",{key:K.name,class:Pe(["bone slot-row",{selected:i.spineObject.selectedSlot===K.name}]),role:"button",tabindex:"0",title:X.$t("spine.slotTitle",{name:K.name,bone:K.bone||"-",attachment:K.attachment||X.$t("spine.empty")}),onClick:Z=>M(K.name),onKeydown:es(We(Z=>M(K.name),["prevent"]),["enter"])},[w("span",M6,F(K.order+1),1),w("span",P6,F(K.name),1),w("span",k6,F(K.attachment||X.$t("spine.empty")),1)],42,_6))),128))])):xe("",!0)],64))])]))}}),R6=dn(I6,[["__scopeId","data-v-35137928"]]),F6={class:"group"},L6={class:"caret"},D6={class:"scene-actions"},O6=["title"],N6=["title"],$6=["title"],B6=["title"],U6=["disabled","title"],V6={class:"group-body"},X6={class:"tree scene-tree"},Y6=["onClick"],z6={key:0,class:"sub-branch"},j6={key:1,class:"tdot"},H6={class:"tlabel"},G6=["title","aria-label","onClick"],W6={viewBox:"0 0 24 24","aria-hidden":"true"},q6={key:0,class:"eye-slash",d:"M4 4l16 16"},K6=["title","onClick"],J6=["onClick"],Z6={class:"tlabel"},Q6=["title","aria-label","onClick"],ej={viewBox:"0 0 24 24","aria-hidden":"true"},tj={key:0,class:"eye-slash",d:"M4 4l16 16"},nj={class:"scene-object-kind"},ij=["title","onClick"],sj=["onClick"],rj={class:"tlabel"},oj=["title","aria-label","onClick"],aj={viewBox:"0 0 24 24","aria-hidden":"true"},lj={key:0,class:"eye-slash",d:"M4 4l16 16"},cj={class:"scene-object-kind"},dj=["title","onClick"],uj=["onClick"],hj={class:"tlabel"},fj=["title","aria-label","onClick"],pj={viewBox:"0 0 24 24","aria-hidden":"true"},mj={key:0,class:"eye-slash",d:"M4 4l16 16"},gj=["title","onClick"],vj={key:0,class:"empty"},bj={class:"row"},yj={class:"seed-row scene-seed"},xj={for:"system-seed"},wj=["title"],Sj=["title"],Cj={class:"seed-hint"},Aj={class:"object-editor-title"},Tj={class:"field-block"},Ej={class:"field-grid"},_j={class:"field-block"},Mj={value:"circle"},Pj={value:"ellipse"},kj={value:"rect"},Ij={value:"polygon"},Rj={value:"custom"},Fj={class:"field-block check-field"},Lj={class:"field-grid"},Dj={class:"compact-field"},Oj={class:"compact-field"},Nj={class:"field-grid"},$j={class:"compact-field"},Bj={class:"compact-field"},Uj={key:1,class:"field-grid"},Vj={class:"compact-field"},Xj={class:"compact-field"},Yj={key:2,class:"field-grid"},zj={class:"compact-field"},jj={class:"compact-field"},Hj={class:"field-block"},Gj={value:"physics"},Wj={value:"pause"},qj={value:"destroy"},Kj={key:4,class:"field-grid"},Jj={class:"compact-field"},Zj={class:"compact-field"},Qj={class:"collider-follow-section"},eH={class:"follow-path"},tH={class:"field-block"},nH={value:0},iH=["value"],sH={class:"field-grid"},rH={class:"compact-field"},oH={class:"compact-field"},aH={value:"跟随导出"},lH={value:"线性"},cH={value:"贝塞尔"},dH={class:"follow-path"},uH={class:"collider-curve-title"},hH={class:"object-editor-title"},fH={class:"field-block"},pH={class:"field-grid"},mH={class:"compact-field"},gH={class:"compact-field"},vH={class:"field-grid"},bH={class:"compact-field"},yH={class:"compact-field"},xH={class:"setting-line"},wH={class:"setting-line"},SH={class:"path-help"},CH={class:"field-block"},AH={value:""},TH={value:"circle"},EH={value:"square"},_H={value:"polygon"},MH={value:"star"},PH={key:4,class:"panel-hint"},kH=Zt({__name:"SceneObjectsSection",setup(i){const{store:e,resolvedCurveEditorMode:t,sys:n,activeObjectType:s,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:c,collapsed:l,toggle:d,sectionOpen:u,addSys:h,addCollider:f,addPath:p,addSpine:m,copySelectedObject:g,applyPathPreset:v,clearPathAnchors:y,randomizeSeed:b,LINEAR_CURVE:x}=Tr(),T=Le(()=>{const E=new Map(e.systems.map(I=>[I.id,I])),S=new Map;for(const I of e.systems)if(I.config.eventEnabled!==!1)for(const N of I.config.events||[])N.targetSystemId<=0||N.targetSystemId===I.id||!E.has(N.targetSystemId)||S.has(N.targetSystemId)||S.set(N.targetSystemId,I.id);const C=new Map;for(const[I,N]of S){const $=C.get(N);$?$.push(I):C.set(N,[I])}const M=[],k=new Set,P=(I,N)=>{if(!k.has(I.id)){k.add(I.id),M.push({system:I,depth:N});for(const $ of C.get(I.id)||[]){const j=E.get($);j&&P(j,N+1)}}};for(const I of e.systems)S.has(I.id)||P(I,0);for(const I of e.systems)k.has(I.id)||P(I,0);return M});return(E,S)=>(Q(),te("div",F6,[w("div",{class:"group-head scene-head",onClick:S[5]||(S[5]=C=>_(d)("scene"))},[w("span",L6,F(_(l).scene?"▸":"▾"),1),w("span",null,F(E.$t("scene.title")),1),w("div",D6,[w("button",{class:"scene-add",title:E.$t("scene.addParticle"),onClick:S[0]||(S[0]=We((...C)=>_(h)&&_(h)(...C),["stop"]))},F(E.$t("scene.addParticleShort")),9,O6),w("button",{class:"scene-add",title:E.$t("scene.addCollider"),onClick:S[1]||(S[1]=We((...C)=>_(f)&&_(f)(...C),["stop"]))},F(E.$t("scene.addColliderShort")),9,N6),w("button",{class:"scene-add",title:E.$t("scene.addPath"),onClick:S[2]||(S[2]=We((...C)=>_(p)&&_(p)(...C),["stop"]))},F(E.$t("scene.addPathShort")),9,$6),w("button",{class:"scene-add",title:E.$t("scene.addSpine"),onClick:S[3]||(S[3]=We((...C)=>_(m)&&_(m)(...C),["stop"]))},"+Spine",8,B6),w("button",{class:"scene-add",disabled:!_(c),title:E.$t("scene.copyTitle"),onClick:S[4]||(S[4]=We((...C)=>_(g)&&_(g)(...C),["stop"]))},"+Copy",8,U6)])]),pe(w("div",V6,[w("div",X6,[(Q(!0),te(_e,null,Mt(T.value,C=>(Q(),te("div",{key:`particle-${C.system.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="particle"&&C.system.id===_(e).activeObjectId,"scene-object-child":C.depth>0}]),style:zt(C.depth>0?{paddingLeft:`${C.depth*18}px`}:void 0),onClick:M=>_(e).selectSystem(C.system.id)},[C.depth>0?(Q(),te("span",z6,"└")):(Q(),te("span",j6,"●")),w("span",H6,F(C.system.config.name||"ParticleSystem"),1),w("button",{class:Pe(["scene-object-eye",{off:C.system.visible===!1}]),title:C.system.visible===!1?E.$t("scene.showParticle"):E.$t("scene.hideParticle"),"aria-label":C.system.visible===!1?E.$t("scene.showParticle"):E.$t("scene.hideParticle"),onClick:We(M=>C.system.visible=C.system.visible===!1,["stop"])},[(Q(),te("svg",W6,[S[50]||(S[50]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[51]||(S[51]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.system.visible===!1?(Q(),te("path",q6)):xe("",!0)]))],10,G6),w("span",{class:Pe(["scene-object-kind",{"sub-emitter-kind":C.depth>0}])},F(C.depth>0?E.$t("scene.subEmitter"):E.$t("scene.particle")),3),w("button",{class:"scene-object-delete",title:E.$t("scene.deleteParticle"),onClick:We(M=>_(e).removeSystem(C.system.id),["stop"])},"✕",8,K6)],14,Y6))),128)),(Q(!0),te(_e,null,Mt(_(e).colliders,C=>(Q(),te("div",{key:`collision-${C.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="collision"&&C.id===_(e).activeObjectId}]),onClick:M=>_(e).selectSceneObject("collision",C.id)},[S[54]||(S[54]=w("span",{class:"tdot collision-dot"},"■",-1)),w("span",Z6,F(C.name),1),w("button",{class:Pe(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?E.$t("scene.showCollider"):E.$t("scene.hideCollider"),"aria-label":C.visible===!1?E.$t("scene.showCollider"):E.$t("scene.hideCollider"),onClick:We(M=>C.visible=C.visible===!1,["stop"])},[(Q(),te("svg",ej,[S[52]||(S[52]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[53]||(S[53]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(Q(),te("path",tj)):xe("",!0)]))],10,Q6),w("span",nj,F(E.$t("scene.collision")),1),w("button",{class:"scene-object-delete",title:E.$t("scene.deleteCollider"),onClick:We(M=>_(e).removeCollider(C.id),["stop"])},"✕",8,ij)],10,J6))),128)),(Q(!0),te(_e,null,Mt(_(e).paths,C=>(Q(),te("div",{key:`path-${C.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="path"&&C.id===_(e).activeObjectId}]),onClick:M=>_(e).selectSceneObject("path",C.id)},[S[57]||(S[57]=w("span",{class:"tdot path-dot"},"◇",-1)),w("span",rj,F(C.name),1),w("button",{class:Pe(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?E.$t("scene.showPath"):E.$t("scene.hidePath"),"aria-label":C.visible===!1?E.$t("scene.showPath"):E.$t("scene.hidePath"),onClick:We(M=>C.visible=C.visible===!1,["stop"])},[(Q(),te("svg",aj,[S[55]||(S[55]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[56]||(S[56]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(Q(),te("path",lj)):xe("",!0)]))],10,oj),w("span",cj,F(E.$t("scene.path")),1),w("button",{class:"scene-object-delete",title:E.$t("scene.deletePath"),onClick:We(M=>_(e).removePath(C.id),["stop"])},"✕",8,dj)],10,sj))),128)),(Q(!0),te(_e,null,Mt(_(e).spines,C=>(Q(),te("div",{key:`spine-${C.id}`,class:Pe(["tree-item scene-object-item",{on:_(s)==="spine"&&C.id===_(e).activeObjectId}]),onClick:M=>_(e).selectSceneObject("spine",C.id)},[S[60]||(S[60]=w("span",{class:"tdot spine-dot"},"◆",-1)),w("span",hj,F(C.name),1),w("button",{class:Pe(["scene-object-eye",{off:C.visible===!1}]),title:C.visible===!1?E.$t("scene.showSpine"):E.$t("scene.hideSpine"),"aria-label":C.visible===!1?E.$t("scene.showSpine"):E.$t("scene.hideSpine"),onClick:We(M=>C.visible=C.visible===!1,["stop"])},[(Q(),te("svg",pj,[S[58]||(S[58]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),S[59]||(S[59]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),C.visible===!1?(Q(),te("path",mj)):xe("",!0)]))],10,fj),S[61]||(S[61]=w("span",{class:"scene-object-kind"},"Spine",-1)),w("button",{class:"scene-object-delete",title:E.$t("scene.deleteSpine"),onClick:We(M=>_(e).removeSpine(C.id),["stop"])},"✕",8,gj)],10,uj))),128)),!_(e).systems.length&&!_(e).colliders.length&&!_(e).paths.length&&!_(e).spines.length?(Q(),te("div",vj,F(E.$t("scene.empty")),1)):xe("",!0)]),_(s)==="particle"&&_(n)?(Q(),te(_e,{key:0},[w("label",bj,[w("span",null,F(E.$t("scene.name")),1),pe(w("input",{"onUpdate:modelValue":S[6]||(S[6]=C=>_(n).config.name=C),class:"inp"},null,512),[[Je,_(n).config.name]])]),Ce(Ue,{label:E.$t("scene.positionX"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.centerX,"onUpdate:modelValue":S[7]||(S[7]=C=>_(n).config.centerX=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.positionY"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.centerY,"onUpdate:modelValue":S[8]||(S[8]=C=>_(n).config.centerY=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.offsetX"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.offsetX,"onUpdate:modelValue":S[9]||(S[9]=C=>_(n).config.offsetX=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.offsetY"),min:-2e3,max:2e3,step:1,modelValue:_(n).config.offsetY,"onUpdate:modelValue":S[10]||(S[10]=C=>_(n).config.offsetY=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:_(n).config.rootRotation,"onUpdate:modelValue":S[11]||(S[11]=C=>_(n).config.rootRotation=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.scaleX"),min:.05,max:10,step:.05,modelValue:_(n).config.rootScaleX,"onUpdate:modelValue":S[12]||(S[12]=C=>_(n).config.rootScaleX=C)},null,8,["label","modelValue"]),Ce(Ue,{label:E.$t("scene.scaleY"),min:.05,max:10,step:.05,modelValue:_(n).config.rootScaleY,"onUpdate:modelValue":S[13]||(S[13]=C=>_(n).config.rootScaleY=C)},null,8,["label","modelValue"]),w("div",yj,[w("label",xj,F(E.$t("scene.seed")),1),pe(w("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[14]||(S[14]=C=>_(n).config.seed=C),title:E.$t("scene.seedTitle")},null,8,wj),[[Je,_(n).config.seed,void 0,{number:!0}]]),w("button",{class:"seed-random",title:E.$t("scene.randomizeSeed"),onClick:S[15]||(S[15]=(...C)=>_(b)&&_(b)(...C))},"⚄",8,Sj)]),w("div",Cj,F(E.$t("scene.seedHint")),1)],64)):_(r)?(Q(),te(_e,{key:1},[w("div",Aj,F(E.$t("scene.colliderTitle")),1),w("label",Tj,[w("span",null,F(E.$t("scene.colliderName")),1),pe(w("input",{"onUpdate:modelValue":S[16]||(S[16]=C=>_(r).name=C),class:"inp"},null,512),[[Je,_(r).name]])]),w("div",Ej,[w("label",_j,[w("span",null,F(E.$t("scene.type")),1),pe(w("select",{"onUpdate:modelValue":S[17]||(S[17]=C=>_(r).shape=C),class:"inp"},[w("option",Mj,F(E.$t("scene.circle")),1),w("option",Pj,F(E.$t("scene.ellipse")),1),w("option",kj,F(E.$t("scene.rect")),1),w("option",Ij,F(E.$t("scene.polygon")),1),w("option",Rj,F(E.$t("scene.custom")),1)],512),[[_t,_(r).shape]])]),w("label",Fj,[w("span",null,F(E.$t("scene.enabled")),1),pe(w("input",{"onUpdate:modelValue":S[18]||(S[18]=C=>_(r).enabled=C),type:"checkbox"},null,512),[[vt,_(r).enabled]])])]),w("div",Lj,[w("label",Dj,[w("span",null,F(E.$t("scene.xPosition")),1),pe(w("input",{"onUpdate:modelValue":S[19]||(S[19]=C=>_(r).x=C),type:"number",class:"inp"},null,512),[[Je,_(r).x,void 0,{number:!0}]])]),w("label",Oj,[w("span",null,F(E.$t("scene.yPosition")),1),pe(w("input",{"onUpdate:modelValue":S[20]||(S[20]=C=>_(r).y=C),type:"number",class:"inp"},null,512),[[Je,_(r).y,void 0,{number:!0}]])])]),Ce(Ue,{label:E.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:_(r).rotation,"onUpdate:modelValue":S[21]||(S[21]=C=>_(r).rotation=C)},null,8,["label","modelValue"]),w("div",Nj,[w("label",$j,[w("span",null,F(E.$t("scene.scaleXShort")),1),pe(w("input",{"onUpdate:modelValue":S[22]||(S[22]=C=>_(r).scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(r).scaleX,void 0,{number:!0}]])]),w("label",Bj,[w("span",null,F(E.$t("scene.scaleYShort")),1),pe(w("input",{"onUpdate:modelValue":S[23]||(S[23]=C=>_(r).scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(r).scaleY,void 0,{number:!0}]])])]),_(r).shape==="circle"?(Q(),kt(Ue,{key:0,label:E.$t("scene.radius"),min:1,max:1e3,step:1,modelValue:_(r).radius,"onUpdate:modelValue":S[24]||(S[24]=C=>_(r).radius=C)},null,8,["label","modelValue"])):_(r).shape==="ellipse"?(Q(),te("div",Uj,[w("label",Vj,[w("span",null,F(E.$t("scene.radiusX")),1),pe(w("input",{"onUpdate:modelValue":S[25]||(S[25]=C=>_(r).radiusX=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).radiusX,void 0,{number:!0}]])]),w("label",Xj,[w("span",null,F(E.$t("scene.radiusY")),1),pe(w("input",{"onUpdate:modelValue":S[26]||(S[26]=C=>_(r).radiusY=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).radiusY,void 0,{number:!0}]])])])):(Q(),te("div",Yj,[w("label",zj,[w("span",null,F(E.$t("scene.width")),1),pe(w("input",{"onUpdate:modelValue":S[27]||(S[27]=C=>_(r).width=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).width,void 0,{number:!0}]])]),w("label",jj,[w("span",null,F(E.$t("scene.height")),1),pe(w("input",{"onUpdate:modelValue":S[28]||(S[28]=C=>_(r).height=C),type:"number",min:"1",class:"inp"},null,512),[[Je,_(r).height,void 0,{number:!0}]])])])),_(r).shape==="polygon"||_(r).shape==="custom"?(Q(),kt(Ue,{key:3,label:E.$t("scene.sides"),min:3,max:16,step:1,modelValue:_(r).sides,"onUpdate:modelValue":S[29]||(S[29]=C=>_(r).sides=C)},null,8,["label","modelValue"])):xe("",!0),w("label",Hj,[w("span",null,F(E.$t("scene.collisionResponse")),1),pe(w("select",{"onUpdate:modelValue":S[30]||(S[30]=C=>_(r).response=C),class:"inp"},[w("option",Gj,F(E.$t("scene.physics")),1),w("option",Wj,F(E.$t("scene.pause")),1),w("option",qj,F(E.$t("scene.destroy")),1)],512),[[_t,_(r).response]])]),_(r).response==="physics"?(Q(),te("div",Kj,[w("label",Jj,[w("span",null,F(E.$t("scene.elasticity")),1),pe(w("input",{"onUpdate:modelValue":S[31]||(S[31]=C=>_(r).elasticity=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,_(r).elasticity,void 0,{number:!0}]])]),w("label",Zj,[w("span",null,F(E.$t("scene.friction")),1),pe(w("input",{"onUpdate:modelValue":S[32]||(S[32]=C=>_(r).friction=C),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,_(r).friction,void 0,{number:!0}]])])])):xe("",!0),w("div",Qj,[w("label",eH,[pe(w("input",{"onUpdate:modelValue":S[33]||(S[33]=C=>_(r).followPath=C),type:"checkbox"},null,512),[[vt,_(r).followPath]]),Ct(F(E.$t("scene.followPath")),1)]),_(r).followPath?(Q(),te(_e,{key:0},[w("label",tH,[w("span",null,F(E.$t("scene.targetPath")),1),pe(w("select",{"onUpdate:modelValue":S[34]||(S[34]=C=>_(r).followPathId=C),class:"inp"},[w("option",nH,F(E.$t("scene.notSelected")),1),(Q(!0),te(_e,null,Mt(_(e).paths,C=>(Q(),te("option",{key:C.id,value:C.id},F(C.name),9,iH))),128))],512),[[_t,_(r).followPathId,void 0,{number:!0}]])]),w("div",sH,[w("label",rH,[w("span",null,F(E.$t("scene.moveDuration")),1),pe(w("input",{"onUpdate:modelValue":S[35]||(S[35]=C=>_(r).followDuration=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(r).followDuration,void 0,{number:!0}]])]),w("label",oH,[w("span",null,F(E.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":S[36]||(S[36]=C=>_(r).followCurveMode=C),class:"inp"},[w("option",aH,F(E.$t("common.followExport")),1),w("option",lH,F(E.$t("common.linear")),1),w("option",cH,F(E.$t("common.bezier")),1)],512),[[_t,_(r).followCurveMode]])])]),w("label",dH,[pe(w("input",{"onUpdate:modelValue":S[37]||(S[37]=C=>_(r).followPathRotation=C),type:"checkbox"},null,512),[[vt,_(r).followPathRotation]]),Ct(F(E.$t("scene.followDirection")),1)]),w("div",uH,[Ct(F(E.$t("scene.moveProgressCurve"))+" ",1),w("small",null,F(E.$t("scene.moveProgressHelp")),1)]),Ce(Ts,{"model-value":_(r).followCurve||_(x),"default-value":_(x),mode:_(t)(_(r).followCurveMode),"onUpdate:modelValue":S[38]||(S[38]=C=>_(r).followCurve=C)},null,8,["model-value","default-value","mode"])],64)):xe("",!0)])],64)):_(o)?(Q(),te(_e,{key:2},[w("div",hH,F(E.$t("scene.pathTitle")),1),w("label",fH,[w("span",null,F(E.$t("scene.pathName")),1),pe(w("input",{"onUpdate:modelValue":S[39]||(S[39]=C=>_(o).name=C),class:"inp"},null,512),[[Je,_(o).name]])]),w("div",pH,[w("label",mH,[w("span",null,F(E.$t("scene.xPosition")),1),pe(w("input",{"onUpdate:modelValue":S[40]||(S[40]=C=>_(o).x=C),type:"number",class:"inp"},null,512),[[Je,_(o).x,void 0,{number:!0}]])]),w("label",gH,[w("span",null,F(E.$t("scene.yPosition")),1),pe(w("input",{"onUpdate:modelValue":S[41]||(S[41]=C=>_(o).y=C),type:"number",class:"inp"},null,512),[[Je,_(o).y,void 0,{number:!0}]])])]),Ce(Ue,{label:E.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:_(o).rotation,"onUpdate:modelValue":S[42]||(S[42]=C=>_(o).rotation=C)},null,8,["label","modelValue"]),w("div",vH,[w("label",bH,[w("span",null,F(E.$t("scene.scaleXShort")),1),pe(w("input",{"onUpdate:modelValue":S[43]||(S[43]=C=>_(o).scaleX=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(o).scaleX,void 0,{number:!0}]])]),w("label",yH,[w("span",null,F(E.$t("scene.scaleYShort")),1),pe(w("input",{"onUpdate:modelValue":S[44]||(S[44]=C=>_(o).scaleY=C),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(o).scaleY,void 0,{number:!0}]])])]),w("label",xH,[w("span",null,F(E.$t("scene.closedPath")),1),pe(w("input",{"onUpdate:modelValue":S[45]||(S[45]=C=>_(o).closed=C),type:"checkbox"},null,512),[[vt,_(o).closed]])]),w("label",wH,[w("span",null,F(E.$t("scene.pathColor")),1),pe(w("input",{"onUpdate:modelValue":S[46]||(S[46]=C=>_(o).color=C),type:"color",class:"path-color"},null,512),[[Je,_(o).color]])]),w("div",SH,[w("span",null,F(E.$t("scene.pathHelp")),1),w("ul",null,[w("li",null,F(E.$t("scene.pathHelpItems.0")),1),w("li",null,F(E.$t("scene.pathHelpItems.1")),1),w("li",null,F(E.$t("scene.pathHelpItems.2")),1),w("li",null,F(E.$t("scene.pathHelpItems.3")),1),w("li",null,F(E.$t("scene.pathHelpItems.4")),1),w("li",null,F(E.$t("scene.pathHelpItems.5")),1),w("li",null,F(E.$t("scene.pathHelpItems.6")),1),w("li",null,F(E.$t("scene.pathHelpItems.7")),1),w("li",null,F(E.$t("scene.pathHelpItems.8")),1),w("li",null,F(E.$t("scene.pathHelpItems.9")),1)])]),w("label",CH,[w("span",null,F(E.$t("scene.applyPresetShape")),1),pe(w("select",{"onUpdate:modelValue":S[47]||(S[47]=C=>_(o).preset=C),class:"inp"},[w("option",AH,F(E.$t("scene.choosePreset")),1),w("option",TH,F(E.$t("scene.circle")),1),w("option",EH,F(E.$t("scene.square")),1),w("option",_H,F(E.$t("scene.polygon")),1),w("option",MH,F(E.$t("scene.star")),1)],512),[[_t,_(o).preset]])]),w("button",{class:"path-action primary",onClick:S[48]||(S[48]=(...C)=>_(v)&&_(v)(...C))},F(E.$t("scene.applyPreset")),1),w("button",{class:"path-action",onClick:S[49]||(S[49]=(...C)=>_(y)&&_(y)(...C))},F(E.$t("scene.clearAnchors")),1)],64)):_(a)?(Q(),kt(R6,{key:3,"spine-object":_(a)},null,8,["spine-object"])):(Q(),te("div",PH,F(E.$t("scene.panelHint")),1))],512),[[Xt,_(u)("scene")]])]))}}),Gx=dn(kH,[["__scopeId","data-v-f0cc6209"]]),IH={class:"group"},RH={class:"caret"},FH=["title"],LH={class:"group-body"},DH={class:"segs"},OH={class:"segs stream-behavior-segs"},NH={key:2,class:"stream-loop-options"},$H={class:"loop-section-row"},BH={class:"switch-row"},UH=["checked"],VH={key:0,class:"loop-duration-control"},XH={class:"switch-row loop-duration-toggle"},YH=["checked"],zH={class:"loop-section-duration"},jH=["value","aria-label"],HH={key:1},GH={key:2,class:"loop-auto-duration"},WH={class:"loop-section-row"},qH={class:"switch-row"},KH=["checked"],JH={key:0,class:"loop-duration-control"},ZH={class:"switch-row loop-duration-toggle"},QH=["checked"],eG={class:"loop-section-duration"},tG=["value","aria-label"],nG={key:1},iG={key:2,class:"loop-auto-duration"},sG={key:3,class:"modifier-hint stream-loop-hint"},rG={class:"group"},oG={class:"caret"},aG=["title"],lG={class:"group-body"},cG={class:"row"},dG={value:"point"},uG={value:"circle"},hG={value:"rect"},fG={value:"cone"},pG={value:"path"},mG={class:"row"},gG={value:0},vG=["value","disabled"],bG={key:0,class:"row"},yG={value:"fixed"},xG={value:"random"},wG={class:"row"},SG={value:"fixed"},CG={value:"random"},AG={key:0,value:"radial"},TG={key:1,value:"path-normal"},EG={key:2,value:"path-tangent"},_G={key:6,class:"switch-row"},MG=Zt({__name:"EmissionSection",setup(i){const{store:e,sys:t,automaticLoopDuration:n,loopDurationFrames:s,collapsed:r,toggle:o,sectionVisible:a,sectionOpen:c,setEmitMode:l,setLoopDurationFrames:d,setStreamBehavior:u,setLoopSection:h,setLoopSectionDuration:f,setLoopCustomDuration:p,resetModule:m,select:g,onShapeChange:v,onSpawnPathChange:y}=Tr();return(b,x)=>(Q(),te(_e,null,[pe(w("div",IH,[w("div",{class:"group-head",onClick:x[1]||(x[1]=T=>_(o)("emitMode"))},[w("span",RH,F(_(r).emitMode?"▸":"▾"),1),w("span",null,F(b.$t("emission.title")),1),w("button",{class:"group-reset",title:b.$t("emission.reset"),onClick:x[0]||(x[0]=We(T=>_(m)("emitMode"),["stop"]))},F(b.$t("common.reset")),9,FH)]),pe(w("div",LH,[w("div",DH,[w("button",{class:Pe(["seg",{on:_(t).config.mode==="stream"}]),onClick:x[2]||(x[2]=T=>_(l)("stream"))},F(b.$t("emission.stream")),3),w("button",{class:Pe(["seg",{on:_(t).config.mode==="burst"}]),onClick:x[3]||(x[3]=T=>_(l)("burst"))},F(b.$t("emission.burst")),3)]),_(t).config.mode==="stream"?(Q(),te(_e,{key:0},[w("div",OH,[w("button",{class:Pe(["seg",{on:_(t).config.streamBehavior==="normal"}]),onClick:x[4]||(x[4]=T=>_(u)("normal"))},F(b.$t("emission.normalStream")),3),w("button",{class:Pe(["seg",{on:_(t).config.streamBehavior==="loop"}]),onClick:x[5]||(x[5]=T=>_(u)("loop"))},F(b.$t("emission.loopStream")),3)]),Ce(Ue,{label:b.$t("emission.rate"),min:1,max:300,step:1,modelValue:_(t).config.rate,"onUpdate:modelValue":x[6]||(x[6]=T=>_(t).config.rate=T)},null,8,["label","modelValue"]),_(t).config.streamBehavior==="normal"?(Q(),kt(Ue,{key:0,label:b.$t("emission.duration"),min:1/30,max:60,step:1/30,modelValue:_(t).config.duration,"onUpdate:modelValue":x[7]||(x[7]=T=>_(t).config.duration=T)},null,8,["label","modelValue"])):(Q(),kt(Ue,{key:1,label:b.$t("emission.loopDuration"),min:1,max:1800,step:1,"model-value":_(s),"onUpdate:modelValue":_(d)},null,8,["label","model-value","onUpdate:modelValue"])),_(t).config.streamBehavior==="loop"?(Q(),te("div",NH,[w("div",$H,[w("label",BH,[w("input",{type:"checkbox",checked:_(t).config.generateLoopStartAnimation,onChange:x[8]||(x[8]=T=>_(h)("start",T))},null,40,UH),x[36]||(x[36]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.generateStart")),1)]),_(t).config.generateLoopStartAnimation?(Q(),te("div",VH,[w("label",XH,[w("input",{type:"checkbox",checked:_(t).config.loopStartUseCustomDuration,onChange:x[9]||(x[9]=T=>_(p)("start",T))},null,40,YH),x[37]||(x[37]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.customDuration")),1)]),w("label",zH,[_(t).config.loopStartUseCustomDuration?(Q(),te("input",{key:0,value:_(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":b.$t("emission.startLoopDuration"),onChange:x[10]||(x[10]=T=>_(f)("start",T))},null,40,jH)):xe("",!0),_(t).config.loopStartUseCustomDuration?(Q(),te("span",HH,"f")):(Q(),te("span",GH,F(b.$t("emission.auto",{frames:_(n)})),1))])])):xe("",!0)]),w("div",WH,[w("label",qH,[w("input",{type:"checkbox",checked:_(t).config.generateLoopEndAnimation,onChange:x[11]||(x[11]=T=>_(h)("end",T))},null,40,KH),x[38]||(x[38]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.generateEnd")),1)]),_(t).config.generateLoopEndAnimation?(Q(),te("div",JH,[w("label",ZH,[w("input",{type:"checkbox",checked:_(t).config.loopEndUseCustomDuration,onChange:x[12]||(x[12]=T=>_(p)("end",T))},null,40,QH),x[39]||(x[39]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.customDuration")),1)]),w("label",eG,[_(t).config.loopEndUseCustomDuration?(Q(),te("input",{key:0,value:_(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":b.$t("emission.endLoopDuration"),onChange:x[13]||(x[13]=T=>_(f)("end",T))},null,40,tG)):xe("",!0),_(t).config.loopEndUseCustomDuration?(Q(),te("span",nG,"f")):(Q(),te("span",iG,F(b.$t("emission.auto",{frames:_(n)})),1))])])):xe("",!0)])])):xe("",!0),_(t).config.streamBehavior==="loop"?(Q(),te("div",sG,F(b.$t("emission.loopWarning")),1)):xe("",!0)],64)):(Q(),kt(Ue,{key:1,label:b.$t("emission.burstCount"),min:1,max:1e3,step:1,modelValue:_(t).config.burstCount,"onUpdate:modelValue":x[14]||(x[14]=T=>_(t).config.burstCount=T)},null,8,["label","modelValue"])),Ce(Ue,{label:b.$t("emission.delay"),min:0,max:5,step:.1,modelValue:_(t).config.delay,"onUpdate:modelValue":x[15]||(x[15]=T=>_(t).config.delay=T)},null,8,["label","modelValue"])],512),[[Xt,_(c)("emitMode")]])],512),[[Xt,_(a)("emitMode")]]),pe(w("div",rG,[w("div",{class:"group-head",onClick:x[17]||(x[17]=T=>_(o)("shape"))},[w("span",oG,F(_(r).shape?"▸":"▾"),1),w("span",null,F(b.$t("emission.shapeTitle")),1),w("button",{class:"group-reset",title:b.$t("emission.shapeReset"),onClick:x[16]||(x[16]=We(T=>_(m)("shape"),["stop"]))},F(b.$t("common.reset")),9,aG)]),pe(w("div",lG,[w("label",cG,[w("span",null,F(b.$t("emission.shape")),1),pe(w("select",{"onUpdate:modelValue":x[18]||(x[18]=T=>_(t).config.shape=T),class:"inp",onChange:x[19]||(x[19]=(...T)=>_(v)&&_(v)(...T))},[w("option",dG,F(b.$t("emission.point")),1),w("option",uG,F(b.$t("emission.circle")),1),w("option",hG,F(b.$t("emission.rect")),1),w("option",fG,F(b.$t("emission.cone")),1),w("option",pG,F(b.$t("emission.path")),1)],544),[[_t,_(t).config.shape]])]),_(t).config.shape==="circle"||_(t).config.shape==="cone"?(Q(),te(_e,{key:0},[Ce(Ue,{label:_(t).config.shape==="cone"?b.$t("emission.innerDiameter"):b.$t("emission.innerRadius"),min:0,max:_(t).config.outerRadius,step:1,modelValue:_(t).config.innerRadius,"onUpdate:modelValue":x[20]||(x[20]=T=>_(t).config.innerRadius=T)},null,8,["label","max","modelValue"]),Ce(Ue,{label:_(t).config.shape==="cone"?b.$t("emission.outerDiameter"):b.$t("emission.outerRadius"),min:_(t).config.innerRadius,max:300,step:1,modelValue:_(t).config.outerRadius,"onUpdate:modelValue":x[21]||(x[21]=T=>_(t).config.outerRadius=T)},null,8,["label","min","modelValue"])],64)):xe("",!0),_(t).config.shape==="cone"?(Q(),te(_e,{key:1},[Ce(Ue,{label:b.$t("emission.coneDirection"),min:-360,max:360,step:1,modelValue:_(t).config.coneDirection,"onUpdate:modelValue":x[22]||(x[22]=T=>_(t).config.coneDirection=T)},null,8,["label","modelValue"]),Ce(Ue,{label:b.$t("emission.coneAngle"),min:1,max:360,step:1,modelValue:_(t).config.coneAngle,"onUpdate:modelValue":x[23]||(x[23]=T=>_(t).config.coneAngle=T)},null,8,["label","modelValue"])],64)):_(t).config.shape==="rect"?(Q(),te(_e,{key:2},[Ce(Ue,{label:b.$t("emission.innerWidth"),min:0,max:_(t).config.outerRectW,step:1,modelValue:_(t).config.innerRectW,"onUpdate:modelValue":x[24]||(x[24]=T=>_(t).config.innerRectW=T)},null,8,["label","max","modelValue"]),Ce(Ue,{label:b.$t("emission.innerHeight"),min:0,max:_(t).config.outerRectH,step:1,modelValue:_(t).config.innerRectH,"onUpdate:modelValue":x[25]||(x[25]=T=>_(t).config.innerRectH=T)},null,8,["label","max","modelValue"]),Ce(Ue,{label:b.$t("emission.outerWidth"),min:_(t).config.innerRectW,max:400,step:1,modelValue:_(t).config.outerRectW,"onUpdate:modelValue":x[26]||(x[26]=T=>_(t).config.outerRectW=T)},null,8,["label","min","modelValue"]),Ce(Ue,{label:b.$t("emission.outerHeight"),min:_(t).config.innerRectH,max:400,step:1,modelValue:_(t).config.outerRectH,"onUpdate:modelValue":x[27]||(x[27]=T=>_(t).config.outerRectH=T)},null,8,["label","min","modelValue"])],64)):_(t).config.shape==="path"?(Q(),te(_e,{key:3},[w("label",mG,[w("span",null,F(b.$t("emission.selectPath")),1),pe(w("select",{"onUpdate:modelValue":x[28]||(x[28]=T=>_(t).config.spawnPathId=T),class:"inp",onChange:x[29]||(x[29]=(...T)=>_(y)&&_(y)(...T))},[w("option",gG,F(b.$t("emission.noPath")),1),(Q(!0),te(_e,null,Mt(_(e).paths,T=>(Q(),te("option",{key:T.id,value:T.id,disabled:!T.enabled},F(T.name),9,vG))),128))],544),[[_t,_(t).config.spawnPathId,void 0,{number:!0}]])]),_(t).config.spawnPathId>0?(Q(),te("label",bG,[w("span",null,F(b.$t("emission.birthDistribution")),1),pe(w("select",{"onUpdate:modelValue":x[30]||(x[30]=T=>_(t).config.spawnPathDistribution=T),class:"inp"},[w("option",yG,F(b.$t("emission.evenDistribution")),1),w("option",xG,F(b.$t("emission.randomDistribution")),1)],512),[[_t,_(t).config.spawnPathDistribution]])])):xe("",!0)],64)):xe("",!0),x[41]||(x[41]=w("div",{class:"divider"},null,-1)),w("label",wG,[w("span",null,F(b.$t("emission.emissionAngle")),1),pe(w("select",{"onUpdate:modelValue":x[31]||(x[31]=T=>_(t).config.emissionAngleMode=T),class:"inp"},[w("option",SG,F(b.$t("common.fixed")),1),w("option",CG,F(b.$t("common.random")),1),_(t).config.shape==="circle"||_(t).config.shape==="rect"||_(t).config.shape==="cone"?(Q(),te("option",AG,F(b.$t("emission.radial")),1)):xe("",!0),_(t).config.shape==="path"&&_(t).config.spawnPathId>0?(Q(),te("option",TG,F(b.$t("emission.pathNormal")),1)):xe("",!0),_(t).config.shape==="path"&&_(t).config.spawnPathId>0?(Q(),te("option",EG,F(b.$t("emission.pathTangent")),1)):xe("",!0)],512),[[_t,_(t).config.emissionAngleMode]])]),_(t).config.emissionAngleMode==="fixed"?(Q(),kt(Ue,{key:4,label:b.$t("emission.fixedAngle"),min:-360,max:360,step:1,modelValue:_(t).config.direction,"onUpdate:modelValue":x[32]||(x[32]=T=>_(t).config.direction=T)},null,8,["label","modelValue"])):_(t).config.emissionAngleMode==="random"?(Q(),te(_e,{key:5},[Ce(Ue,{label:b.$t("emission.baseAngle"),min:-360,max:360,step:1,modelValue:_(t).config.direction,"onUpdate:modelValue":x[33]||(x[33]=T=>_(t).config.direction=T)},null,8,["label","modelValue"]),Ce(Ue,{label:b.$t("emission.randomRange"),min:0,max:360,step:1,modelValue:_(t).config.spread,"onUpdate:modelValue":x[34]||(x[34]=T=>_(t).config.spread=T)},null,8,["label","modelValue"])],64)):xe("",!0),_(t).config.shape!=="point"?(Q(),te("label",_G,[pe(w("input",{type:"checkbox","onUpdate:modelValue":x[35]||(x[35]=T=>_(t).config.showShape=T)},null,512),[[vt,_(t).config.showShape]]),x[40]||(x[40]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(b.$t("emission.showShape")),1)])):xe("",!0)],512),[[Xt,_(c)("shape")]])],512),[[Xt,_(a)("shape")]])],64))}}),Wx=dn(MG,[["__scopeId","data-v-fc08ba9a"]]),PG={class:"pac"},kG={class:"pac-head"},IG={class:"pac-label"},RG={key:0,class:"pac-modes"},FG=["onClick"],LG={class:"pac-range"},DG={class:"pac-curve"},OG={class:"pac-axis"},NG=Zt({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:""}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(i){const e=i,{t}=mi(),n=Le(()=>{const s=[{label:t("common.fixed"),value:"fixed"},{label:t("common.random"),value:"random"}];return e.allowCurve&&s.push({label:t("common.curve"),value:"curve"}),e.allowDirection&&s.push({label:t("attributeControl.direction"),value:"direction"}),s});return(s,r)=>(Q(),te("div",PG,[w("div",kG,[w("span",IG,F(i.label),1),i.showModes?(Q(),te("div",RG,[(Q(!0),te(_e,null,Mt(n.value,o=>(Q(),te("button",{key:o.value,class:Pe(["pac-mode",{on:i.mode===o.value}]),onClick:a=>s.$emit("update:mode",o.value)},F(o.label),11,FG))),128))])):xe("",!0)]),i.mode==="fixed"||i.mode==="direction"?(Q(),kt(Ue,{key:0,label:i.mode==="direction"?s.$t("attributeControl.angleOffset"):s.$t("attributeControl.value"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":r[0]||(r[0]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"])):i.mode==="random"?(Q(),te(_e,{key:1},[Ce(Ue,{label:s.$t("attributeControl.lower"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":r[1]||(r[1]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"]),Ce(Ue,{label:s.$t("attributeControl.upper"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":r[2]||(r[2]=o=>s.$emit("update:valueMax",o))},null,8,["label","min","max","step","model-value"])],64)):(Q(),te(_e,{key:2},[w("div",LG,[Ce(Ue,{label:s.$t("attributeControl.rangeLower"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":r[3]||(r[3]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"]),Ce(Ue,{label:s.$t("attributeControl.rangeUpper"),min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":r[4]||(r[4]=o=>s.$emit("update:valueMax",o))},null,8,["label","min","max","step","model-value"])]),w("div",DG,[Ce(Ts,{"model-value":i.curve,"default-value":i.defaultCurve,"onUpdate:modelValue":r[5]||(r[5]=o=>s.$emit("update:curve",o))},null,8,["model-value","default-value"]),w("div",OG,[r[6]||(r[6]=w("span",null,"0",-1)),w("span",null,F(i.curveLabel||s.$t("attributeControl.curveInput")),1),r[7]||(r[7]=w("span",null,"1",-1))])])],64))]))}}),Hs=dn(NG,[["__scopeId","data-v-a3a8dde3"]]),$G={class:"group"},BG={class:"caret"},UG=["title"],VG={class:"group-body attr-body"},XG={class:"attr-section-title"},YG={class:"attr-axis-head"},zG={class:"axis-modes"},jG={class:"attr-section-title life-title"},HG={class:"life-item"},GG={class:"switch-row"},WG={class:"life-item"},qG={class:"switch-row"},KG={class:"axis-modes life-axis"},JG={class:"life-item"},ZG={class:"switch-row"},QG=Zt({__name:"ParticleAttributesSection",setup(i){const{sys:e,collapsed:t,toggle:n,sectionOpen:s,resetModule:r,setSpeedOverLifeMode:o,prepareScaleOverLifeCurve:a,setScaleOverLifeMode:c,LINEAR_CURVE:l,FLAT_CURVE:d}=Tr();return(u,h)=>(Q(),te("div",$G,[w("div",{class:"group-head",onClick:h[1]||(h[1]=f=>_(n)("attr"))},[w("span",BG,F(_(t).attr?"▸":"▾"),1),w("span",null,F(u.$t("attributes.title")),1),w("button",{class:"group-reset",title:u.$t("attributes.reset"),onClick:h[0]||(h[0]=We(f=>_(r)("attr"),["stop"]))},F(u.$t("common.reset")),9,UG)]),pe(w("div",VG,[w("div",XG,F(u.$t("attributes.initialParams")),1),Ce(Hs,{label:u.$t("attributes.initialLife"),"allow-curve":!1,mode:_(e).config.lifeMode,"onUpdate:mode":h[2]||(h[2]=f=>_(e).config.lifeMode=f),"value-min":_(e).config.lifeMin,"onUpdate:valueMin":h[3]||(h[3]=f=>_(e).config.lifeMin=f),"value-max":_(e).config.lifeMax,"onUpdate:valueMax":h[4]||(h[4]=f=>_(e).config.lifeMax=f),curve:_(e).config.lifeCurve,"onUpdate:curve":h[5]||(h[5]=f=>_(e).config.lifeCurve=f),min:.1,max:10,step:.1,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),Ce(Hs,{label:u.$t("attributes.initialSpeed"),"allow-curve":!1,mode:_(e).config.speedMode,"onUpdate:mode":h[6]||(h[6]=f=>_(e).config.speedMode=f),"value-min":_(e).config.speedMin,"onUpdate:valueMin":h[7]||(h[7]=f=>_(e).config.speedMin=f),"value-max":_(e).config.speedMax,"onUpdate:valueMax":h[8]||(h[8]=f=>_(e).config.speedMax=f),curve:_(e).config.speedCurve,"onUpdate:curve":h[9]||(h[9]=f=>_(e).config.speedCurve=f),min:0,max:1e3,step:1,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),w("div",YG,[w("span",null,F(u.$t("attributes.initialScale")),1),w("div",zG,[w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleAxisMode==="uniform"}]),onClick:h[10]||(h[10]=f=>_(e).config.scaleAxisMode="uniform")},F(u.$t("attributes.uniform")),3),w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleAxisMode==="separate"}]),onClick:h[11]||(h[11]=f=>_(e).config.scaleAxisMode="separate")},F(u.$t("attributes.separateXY")),3)])]),Ce(Hs,{label:_(e).config.scaleAxisMode==="uniform"?u.$t("attributes.initialScale"):u.$t("attributes.scaleX"),"allow-curve":!1,mode:_(e).config.scaleMode,"onUpdate:mode":h[12]||(h[12]=f=>_(e).config.scaleMode=f),"value-min":_(e).config.scaleMin,"onUpdate:valueMin":h[13]||(h[13]=f=>_(e).config.scaleMin=f),"value-max":_(e).config.scaleMax,"onUpdate:valueMax":h[14]||(h[14]=f=>_(e).config.scaleMax=f),curve:_(e).config.scaleCurve,"onUpdate:curve":h[15]||(h[15]=f=>_(e).config.scaleCurve=f),min:0,max:5,step:.05,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),_(e).config.scaleAxisMode==="separate"?(Q(),kt(Hs,{key:0,label:u.$t("attributes.scaleY"),"show-modes":!1,"allow-curve":!1,mode:_(e).config.scaleMode,"onUpdate:mode":h[16]||(h[16]=f=>_(e).config.scaleMode=f),"value-min":_(e).config.scaleYMin,"onUpdate:valueMin":h[17]||(h[17]=f=>_(e).config.scaleYMin=f),"value-max":_(e).config.scaleYMax,"onUpdate:valueMax":h[18]||(h[18]=f=>_(e).config.scaleYMax=f),curve:_(e).config.scaleYCurve,"onUpdate:curve":h[19]||(h[19]=f=>_(e).config.scaleYCurve=f),min:0,max:5,step:.05,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"])):xe("",!0),Ce(Hs,{label:u.$t("attributes.initialRotation"),"allow-direction":"","allow-curve":!1,mode:_(e).config.initialRotationMode,"onUpdate:mode":h[20]||(h[20]=f=>_(e).config.initialRotationMode=f),"value-min":_(e).config.initialRotationMin,"onUpdate:valueMin":h[21]||(h[21]=f=>_(e).config.initialRotationMin=f),"value-max":_(e).config.initialRotationMax,"onUpdate:valueMax":h[22]||(h[22]=f=>_(e).config.initialRotationMax=f),curve:_(e).config.initialRotationCurve,"onUpdate:curve":h[23]||(h[23]=f=>_(e).config.initialRotationCurve=f),min:-360,max:360,step:1,"curve-label":u.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),w("div",jG,F(u.$t("attributes.lifecycleTitle")),1),w("div",HG,[w("label",GG,[pe(w("input",{type:"checkbox","onUpdate:modelValue":h[24]||(h[24]=f=>_(e).config.speedOverLifeEnabled=f)},null,512),[[vt,_(e).config.speedOverLifeEnabled]]),h[44]||(h[44]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(u.$t("attributes.speedOverLife")),1)]),_(e).config.speedOverLifeEnabled?(Q(),kt(Hs,{key:0,label:u.$t("attributes.speedMultiplier"),mode:_(e).config.speedOverLifeMode,"onUpdate:mode":_(o),"value-min":_(e).config.speedOverLifeMin,"onUpdate:valueMin":h[25]||(h[25]=f=>_(e).config.speedOverLifeMin=f),"value-max":_(e).config.speedOverLifeMax,"onUpdate:valueMax":h[26]||(h[26]=f=>_(e).config.speedOverLifeMax=f),curve:_(e).config.speedOverLifeCurve,"onUpdate:curve":h[27]||(h[27]=f=>_(e).config.speedOverLifeCurve=f),"default-curve":_(d),min:0,max:3,step:.05,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve","curve-label"])):xe("",!0)]),w("div",WG,[w("label",qG,[pe(w("input",{type:"checkbox","onUpdate:modelValue":h[28]||(h[28]=f=>_(e).config.scaleOverLifeEnabled=f),onChange:h[29]||(h[29]=(...f)=>_(a)&&_(a)(...f))},null,544),[[vt,_(e).config.scaleOverLifeEnabled]]),h[45]||(h[45]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(u.$t("attributes.scaleOverLife")),1)]),_(e).config.scaleOverLifeEnabled?(Q(),te(_e,{key:0},[w("div",KG,[w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:h[30]||(h[30]=f=>_(e).config.scaleOverLifeAxisMode="uniform")},F(u.$t("attributes.uniform")),3),w("button",{class:Pe(["axis-mode",{on:_(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:h[31]||(h[31]=f=>_(e).config.scaleOverLifeAxisMode="separate")},F(u.$t("attributes.separateXY")),3)]),Ce(Hs,{label:_(e).config.scaleOverLifeAxisMode==="uniform"?u.$t("attributes.scaleMultiplier"):u.$t("attributes.multiplierX"),mode:_(e).config.scaleOverLifeMode,"onUpdate:mode":_(c),"value-min":_(e).config.scaleOverLifeMin,"onUpdate:valueMin":h[32]||(h[32]=f=>_(e).config.scaleOverLifeMin=f),"value-max":_(e).config.scaleOverLifeMax,"onUpdate:valueMax":h[33]||(h[33]=f=>_(e).config.scaleOverLifeMax=f),curve:_(e).config.scaleOverLifeCurve,"onUpdate:curve":h[34]||(h[34]=f=>_(e).config.scaleOverLifeCurve=f),"default-curve":_(d),min:0,max:3,step:.05,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve","curve-label"]),_(e).config.scaleOverLifeAxisMode==="separate"?(Q(),kt(Hs,{key:0,label:u.$t("attributes.multiplierY"),"show-modes":!1,mode:_(e).config.scaleOverLifeMode,"onUpdate:mode":h[35]||(h[35]=f=>_(e).config.scaleOverLifeMode=f),"value-min":_(e).config.scaleYOverLifeMin,"onUpdate:valueMin":h[36]||(h[36]=f=>_(e).config.scaleYOverLifeMin=f),"value-max":_(e).config.scaleYOverLifeMax,"onUpdate:valueMax":h[37]||(h[37]=f=>_(e).config.scaleYOverLifeMax=f),curve:_(e).config.scaleYOverLifeCurve,"onUpdate:curve":h[38]||(h[38]=f=>_(e).config.scaleYOverLifeCurve=f),"default-curve":_(d),min:0,max:3,step:.05,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","value-min","value-max","curve","default-curve","curve-label"])):xe("",!0)],64)):xe("",!0)]),w("div",JG,[w("label",ZG,[pe(w("input",{type:"checkbox","onUpdate:modelValue":h[39]||(h[39]=f=>_(e).config.rotationOverLifeEnabled=f)},null,512),[[vt,_(e).config.rotationOverLifeEnabled]]),h[46]||(h[46]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(u.$t("attributes.rotationOverLife")),1)]),_(e).config.rotationOverLifeEnabled?(Q(),kt(Hs,{key:0,label:u.$t("attributes.rotationSpeed"),mode:_(e).config.rotationOverLifeMode,"onUpdate:mode":h[40]||(h[40]=f=>_(e).config.rotationOverLifeMode=f),"value-min":_(e).config.rotationSpeedMin,"onUpdate:valueMin":h[41]||(h[41]=f=>_(e).config.rotationSpeedMin=f),"value-max":_(e).config.rotationSpeedMax,"onUpdate:valueMax":h[42]||(h[42]=f=>_(e).config.rotationSpeedMax=f),curve:_(e).config.rotationOverLifeCurve,"onUpdate:curve":h[43]||(h[43]=f=>_(e).config.rotationOverLifeCurve=f),"default-curve":_(l),min:-720,max:720,step:10,"curve-label":u.$t("attributes.lifeTo")},null,8,["label","mode","value-min","value-max","curve","default-curve","curve-label"])):xe("",!0)])],512),[[Xt,_(s)("attr")]])]))}}),qx=dn(QG,[["__scopeId","data-v-b713ad99"]]),eW={class:"gradient-editor"},tW=["title"],nW=["title","onClick","onDblclick","onPointerdown"],iW={key:0,class:"gradient-controls"},sW=["value","aria-label"],rW=["value","aria-label"],oW={class:"gradient-position"},aW=["value","aria-label"],lW=["title"],cW=["title","disabled"],dW={class:"gradient-hint"},uW=Zt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,n=e,s=Re(null),r=Re(0),o=Le(()=>t.modelValue[r.value]||null),a=Le(()=>[...t.modelValue].sort((C,M)=>C.position-M.position)),c=Le(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(M=>`${M.color} ${l(M.position)*100}%`).join(", ")})`:"#ffffff"});Ut(()=>t.modelValue.length,C=>{r.value>=C&&(r.value=Math.max(0,C-1))});function l(C){return Math.min(1,Math.max(0,Number(C)||0))}function d(){return t.modelValue.map(C=>({position:l(C.position),color:C.color}))}function u(C,M){const k=d();k[C]&&(k[C]={...k[C],...M},n("update:modelValue",k))}function h(C){u(r.value,{color:C.target.value})}function f(C){var P;const M=C.target,k=S(M.value,((P=o.value)==null?void 0:P.color)||"#ffffff");M.value=k,u(r.value,{color:k})}function p(C){const M=C.target;f(C),M.blur()}function m(C){const M=Number(C.target.value);Number.isFinite(M)&&u(r.value,{position:l(M/100)})}function g(C){const M=d();M.push({position:l(C),color:T(M,C)}),r.value=M.length-1,n("update:modelValue",M)}function v(C){if(!s.value)return;const M=s.value.getBoundingClientRect();g((C.clientX-M.left)/Math.max(1,M.width))}function y(){const C=a.value;let M=.5;if(C.length>1){let k=-1;for(let P=0;Pk&&(k=I,M=(C[P].position+C[P+1].position)/2)}}g(M)}function b(C){if(t.modelValue.length<=2||C<0)return;const M=d().filter((k,P)=>P!==C);r.value=Math.min(C,M.length-1),n("update:modelValue",M)}function x(C,M){if(!s.value)return;r.value=M;const k=I=>{const N=s.value.getBoundingClientRect();u(M,{position:l((I.clientX-N.left)/Math.max(1,N.width))})},P=()=>{window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)};window.addEventListener("pointermove",k),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P),C.preventDefault()}function T(C,M){const k=[...C].sort((P,I)=>P.position-I.position);if(!k.length)return"#ffffff";if(M<=k[0].position)return k[0].color;if(M>=k[k.length-1].position)return k[k.length-1].color;for(let P=0;PN.position)continue;const $=(M-I.position)/Math.max(1e-4,N.position-I.position);return E(I.color,N.color,$)}return k[k.length-1].color}function E(C,M,k){const P=j=>{const B=parseInt(j.replace("#","").padEnd(6,"0").slice(0,6),16);return[B>>16&255,B>>8&255,B&255]},I=P(C),N=P(M),$=j=>Math.round(I[j]+(N[j]-I[j])*k);return`#${[$(0),$(1),$(2)].map(j=>j.toString(16).padStart(2,"0")).join("")}`}function S(C,M){let k=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(k)&&(k=k.split("").map(P=>P+P).join("")),/^[0-9a-f]{6}$/i.test(k)?`#${k.toLowerCase()}`:M}return(C,M)=>(Q(),te("div",eW,[w("div",{ref_key:"bar",ref:s,class:"gradient-bar",style:zt({background:c.value}),title:C.$t("gradient.addTitle"),onDblclick:v},[(Q(!0),te(_e,null,Mt(i.modelValue,(k,P)=>(Q(),te("button",{key:P,type:"button",class:Pe(["gradient-stop",{selected:P===r.value}]),style:zt({left:`${l(k.position)*100}%`,"--stop-color":k.color}),title:`${Math.round(l(k.position)*100)}% · ${k.color}`,onClick:We(I=>r.value=P,["stop"]),onDblclick:We(I=>b(P),["stop"]),onPointerdown:We(I=>x(I,P),["stop"])},null,46,nW))),128))],44,tW),o.value?(Q(),te("div",iW,[w("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":C.$t("gradient.color"),onInput:h},null,40,sW),w("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":C.$t("gradient.colorValue"),spellcheck:"false",onChange:f,onKeydown:es(p,["enter"])},null,40,rW),w("label",oW,[w("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":C.$t("gradient.position"),onInput:m},null,40,aW),M[1]||(M[1]=w("span",null,"%",-1))]),w("button",{type:"button",class:"gradient-action",title:C.$t("gradient.addMiddle"),onClick:y},"+",8,lW),w("button",{type:"button",class:"gradient-action danger",title:C.$t("gradient.delete"),disabled:i.modelValue.length<=2,onClick:M[0]||(M[0]=k=>b(r.value))},"×",8,cW)])):xe("",!0),w("div",dW,F(C.$t("gradient.hint")),1)]))}}),nE=dn(uW,[["__scopeId","data-v-cb6cfaf8"]]),hW={class:"pivot-toolbar"},fW={class:"pivot-hint"},pW={class:"pivot-zoom"},mW=["disabled","title"],gW=["disabled","title"],vW=["title"],bW=["title"],yW=["src","alt"],xW={key:2,class:"pivot-empty"},wW={class:"pivot-bottom"},SW={class:"pivot-card"},CW={class:"pivot-presets"},AW=["title","aria-label","onClick"],TW={class:"pivot-card"},EW={class:"pivot-card-head"},_W={class:"pivot-coords"},MW=["value"],PW=["value"],kW={class:"pivot-card-head pivot-rotate-head"},IW={class:"pivot-rotate-state"},RW={class:"pivot-rotate-body"},FW={class:"pivot-rotate-modes"},LW={class:"pivot-rotate-preview"},DW=["src","alt"],Pp=1e3,OW=Zt({__name:"PivotEditor",props:{previewUrl:{},anchorX:{},anchorY:{},large:{type:Boolean,default:!1}},emits:["update:anchorX","update:anchorY","fullscreen"],setup(i,{emit:e}){const t=i,n=e,{t:s}=mi(),r=Le(()=>[{icon:"↖",label:s("pivot.topLeft"),x:0,y:0},{icon:"↑",label:s("pivot.top"),x:50,y:0},{icon:"↗",label:s("pivot.topRight"),x:100,y:0},{icon:"←",label:s("pivot.left"),x:0,y:50},{icon:"◯",label:s("pivot.center"),x:50,y:50},{icon:"→",label:s("pivot.right"),x:100,y:50},{icon:"↙",label:s("pivot.bottomLeft"),x:0,y:100},{icon:"↓",label:s("pivot.bottom"),x:50,y:100},{icon:"↘",label:s("pivot.bottomRight"),x:100,y:100}]),o=Re(null),a=Re(null),c=Re({w:0,h:0}),l=Re({w:1,h:1}),d=Re(100),u=Re({x:0,y:0}),h=Re(!1),f=Re("static");let p=null;const m=U=>Math.min(Pp,Math.max(-Pp,Number.isFinite(U)?U:0)),g=Le(()=>m(t.anchorX*100).toFixed(1)),v=Le(()=>m(t.anchorY*100).toFixed(1));function y(U,D){const L=l.value.w/Math.max(1,l.value.h);let R=U,X=R/L;return X>D&&(X=D,R=X*L),{w:Math.max(1,R),h:Math.max(1,X)}}const b=Le(()=>{const U=t.large?26:12,D=Math.max(1,c.value.w-U*2),L=Math.max(1,c.value.h-U*2);return y(D,L)}),x=Le(()=>({width:`${b.value.w}px`,height:`${b.value.h}px`,transform:`translate(${u.value.x}px, ${u.value.y}px) scale(${d.value/100})`})),T=Le(()=>{const U=d.value/100;return{x:c.value.w/2+u.value.x+(m(t.anchorX*100)/100-.5)*b.value.w*U,y:c.value.h/2+u.value.y+(m(t.anchorY*100)/100-.5)*b.value.h*U}}),E=Le(()=>{const U=t.large?128:72,D=y(U,U);return{width:`${D.w}px`,height:`${D.h}px`,transformOrigin:`${m(t.anchorX*100)}% ${m(t.anchorY*100)}%`}});function S(U,D){const L=Pp/100;n("update:anchorX",Math.min(L,Math.max(-L,Number.isFinite(U)?U:0))),n("update:anchorY",Math.min(L,Math.max(-L,Number.isFinite(D)?D:0)))}function C(U){const D=a.value;if(!D)return;const L=D.getBoundingClientRect();L.width<=0||L.height<=0||S((U.clientX-L.left)/L.width,(U.clientY-L.top)/L.height)}function M(U){if(!t.previewUrl)return;if(U.button===2){k(U);return}if(U.button!==0)return;U.preventDefault(),C(U);const D=R=>C(R),L=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L)}function k(U){U.preventDefault(),h.value=!0;const D=U.clientX,L=U.clientY,R=u.value.x,X=u.value.y,z=Z=>{u.value={x:R+Z.clientX-D,y:X+Z.clientY-L}},K=()=>{h.value=!1,window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K)}function P(U){const D=U.deltaY<0?1.12:.8928571428571428,L=Math.min(400,Math.max(100,Math.round(d.value*D)));if(L===d.value)return;const R=o.value;if(!R){d.value=L;return}const X=R.getBoundingClientRect(),z=U.clientX-X.left,K=U.clientY-X.top,Z=L/d.value;u.value={x:u.value.x+(z-X.width/2-u.value.x)*(1-Z),y:u.value.y+(K-X.height/2-u.value.y)*(1-Z)},d.value=L}function I(U){const D=U.target;l.value={w:D.naturalWidth||1,h:D.naturalHeight||1}}function N(U){d.value=Math.min(400,Math.max(100,d.value+U))}function $(){S(.5,.5)}function j(U){S(U.x/100,U.y/100)}function B(U){return Math.abs(m(t.anchorX*100)-U.x)<.05&&Math.abs(m(t.anchorY*100)-U.y)<.05}function Y(U,D){const L=m(Number(D.target.value));n(U==="x"?"update:anchorX":"update:anchorY",L/100)}return Ut(()=>t.previewUrl,()=>{l.value={w:1,h:1},u.value={x:0,y:0},d.value=100}),Ti(()=>{o.value&&(p=new ResizeObserver(U=>{var L;const D=(L=U[0])==null?void 0:L.contentRect;D&&(c.value={w:D.width,h:D.height})}),p.observe(o.value))}),Ar(()=>{p==null||p.disconnect(),p=null}),(U,D)=>(Q(),te("div",{class:Pe(["pivot-editor",{"pivot-large":i.large}])},[w("div",hW,[w("div",fW,[D[9]||(D[9]=w("span",{class:"pivot-hint-icon"},"⊕",-1)),w("span",null,F(U.$t("pivot.title")),1)]),w("div",pW,[w("button",{type:"button",disabled:d.value<=100,title:U.$t("pivot.zoomOut"),onClick:D[0]||(D[0]=L=>N(-25))},"−",8,mW),w("span",null,F(d.value)+"%",1),w("button",{type:"button",disabled:d.value>=400,title:U.$t("pivot.zoomIn"),onClick:D[1]||(D[1]=L=>N(25))},"+",8,gW)]),i.large?xe("",!0):(Q(),te("button",{key:0,type:"button",class:"pivot-expand",title:U.$t("pivot.expand"),onClick:D[2]||(D[2]=L=>U.$emit("fullscreen"))},"⤢",8,vW))]),w("div",{ref_key:"stageRef",ref:o,class:Pe(["pivot-stage",{panning:h.value}]),title:U.$t("pivot.interaction"),onPointerdown:M,onWheel:We(P,["prevent"]),onContextmenu:D[3]||(D[3]=We(()=>{},["prevent"]))},[i.previewUrl?(Q(),te("div",{key:0,ref_key:"boxRef",ref:a,class:"pivot-box",style:zt(x.value)},[w("img",{src:i.previewUrl,alt:U.$t("pivot.previewAlt"),draggable:"false",onLoad:I},null,40,yW)],4)):xe("",!0),i.previewUrl?(Q(),te(_e,{key:1},[w("div",{class:"pivot-cross vertical",style:zt({left:`${T.value.x}px`})},null,4),w("div",{class:"pivot-cross horizontal",style:zt({top:`${T.value.y}px`})},null,4),w("div",{class:"pivot-marker",style:zt({left:`${T.value.x}px`,top:`${T.value.y}px`})},null,4),w("div",{class:"pivot-badge",style:zt({left:`${T.value.x}px`,top:`${T.value.y}px`})},"X: "+F(g.value)+"% | Y: "+F(v.value)+"%",5)],64)):(Q(),te("div",xW,F(U.$t("pivot.noImage")),1))],42,bW),w("div",wW,[w("div",SW,[w("div",CW,[(Q(!0),te(_e,null,Mt(r.value,L=>(Q(),te("button",{key:L.label,type:"button",class:Pe(["pivot-preset",{on:B(L)}]),title:`${L.label}(${L.x}%, ${L.y}%)`,"aria-label":L.label,onClick:R=>j(L)},F(L.icon),11,AW))),128))]),w("button",{type:"button",class:"pivot-reset",onClick:$},"↺ "+F(U.$t("pivot.resetCenter")),1)]),w("div",TW,[w("div",EW,[w("span",null,[D[10]||(D[10]=w("span",{class:"pivot-card-icon"},"◎",-1)),Ct(" "+F(U.$t("pivot.coordinates")),1)])]),w("div",_W,[w("label",null,[D[11]||(D[11]=Ct("X: ",-1)),w("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:g.value,onInput:D[4]||(D[4]=L=>Y("x",L))},null,40,MW),D[12]||(D[12]=w("span",null,"%",-1))]),w("label",null,[D[13]||(D[13]=Ct("Y: ",-1)),w("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:v.value,onInput:D[5]||(D[5]=L=>Y("y",L))},null,40,PW),D[14]||(D[14]=w("span",null,"%",-1))])]),i.large?(Q(),te(_e,{key:0},[w("div",kW,[w("span",null,[D[15]||(D[15]=w("span",{class:"pivot-card-icon"},"✥",-1)),Ct(" "+F(U.$t("pivot.rotationTest")),1)]),w("span",IW,F(f.value==="static"?U.$t("pivot.static"):f.value==="spin"?U.$t("pivot.spin"):U.$t("pivot.swing")),1)]),w("div",RW,[w("div",FW,[w("button",{type:"button",class:Pe({on:f.value==="static"}),onClick:D[6]||(D[6]=L=>f.value="static")},F(U.$t("pivot.static")),3),w("button",{type:"button",class:Pe({on:f.value==="spin"}),onClick:D[7]||(D[7]=L=>f.value="spin")},"↻ "+F(U.$t("pivot.spin")),3),w("button",{type:"button",class:Pe({on:f.value==="swing"}),onClick:D[8]||(D[8]=L=>f.value="swing")},"⇄ "+F(U.$t("pivot.swing")),3)]),w("div",LW,[i.previewUrl?(Q(),te("img",{key:0,src:i.previewUrl,alt:U.$t("pivot.rotationAlt"),draggable:"false",class:Pe(f.value),style:zt(E.value)},null,14,DW)):xe("",!0)])])],64)):xe("",!0)])])],2))}}),Kx=dn(OW,[["__scopeId","data-v-a5622844"]]),NW={class:"image-card"},$W={class:"imgrow"},BW=["title"],UW=["src","alt"],VW={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},XW={class:"img-fields"},YW={key:0,class:"row"},zW={class:"row"},jW=["placeholder"],HW={class:"img-actions"},GW=["title"],WW=["title","disabled"],qW={class:"thumb-note"},KW={key:0,class:"row"},JW={value:"fixed"},ZW={value:"sequence"},QW={class:"row"},eq={value:"once-hide"},tq={value:"once-hold"},nq={value:"loop-forward"},iq={value:"loop-reverse"},sq={class:"row"},rq={class:"sequence-note"},oq={class:"resource-weight-row"},aq=["disabled","title"],lq={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},cq={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},dq={key:2,class:"pivot-toggle-row"},uq={class:"pivot-toggle-text"},hq={class:"pivot-toggle-title"},fq=["title"],pq=["title"],mq=["aria-label"],gq={class:"pivot-modal-head"},vq={class:"pivot-modal-info"},bq={class:"pivot-modal-title"},yq={class:"pivot-modal-badge"},xq={class:"pivot-modal-desc"},wq=["title"],Sq={class:"pivot-modal-hint"},Cq={class:"pivot-modal-actions"},Jx="SpineParticle.PivotPanels.v1",Aq=Zt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1},pivotKey:{}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(i,{emit:e}){const t=i,n=e,{t:s}=mi(),r=Le(()=>{var M,k;if(t.resource.imageMode==="sequence"){const P=t.resource.sequenceFrames||[];if(!P.length)return s("image.noSequence");const I=((M=P[0])==null?void 0:M.name)||s("image.firstFrame"),N=((k=P[P.length-1])==null?void 0:k.name)||I;return P.length===1?s("image.frameCountOne",{name:I}):s("image.frameCountMany",{count:P.length,first:I,last:N})}const C=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return C.includes(".")?C:`${C}.png`}),o=Le(()=>{var C,M;return t.resource.imageMode==="sequence"?((M=(C=t.resource.sequenceFrames)==null?void 0:C[0])==null?void 0:M.previewUrl)||"":t.resource.previewUrl});function a(){try{const C=JSON.parse(sessionStorage.getItem(Jx)||"{}");return C&&typeof C=="object"?C:{}}catch{return{}}}const c=a(),l=Le(()=>t.pivotKey||`particle-image:${t.resource.id}`),d=Le(()=>typeof t.resource.anchorX=="number"&&typeof t.resource.anchorY=="number"),u=Le(()=>Math.abs((t.resource.anchorX??.5)-.5)<1e-4&&Math.abs((t.resource.anchorY??.5)-.5)<1e-4),h=typeof c[l.value]=="boolean",f=Re(h?c[l.value]:!u.value);Ut(f,C=>{c[l.value]=C;try{sessionStorage.setItem(Jx,JSON.stringify(c))}catch{}}),Ut(l,C=>{f.value=typeof c[C]=="boolean"?c[C]:!u.value}),Ut(()=>u.value,C=>{C||(f.value=!0)},{immediate:!0});const p=Re(!1),m=Re(.5),g=Re(.5),v=Le(()=>{const C=((t.resource.anchorX??.5)*100).toFixed(1),M=((t.resource.anchorY??.5)*100).toFixed(1);return f.value?s("image.pivotOn",{x:C,y:M}):u.value?s("image.pivotOff"):s("image.pivotCustom",{x:C,y:M})});function y(){m.value=t.resource.anchorX??.5,g.value=t.resource.anchorY??.5,p.value=!0}function b(){f.value||(t.resource.anchorX=.5,t.resource.anchorY=.5,p.value=!1)}function x(C){C&&(t.resource.anchorX=m.value,t.resource.anchorY=g.value),p.value=!1}function T(C){C.key==="Escape"&&p.value&&x(!1)}Ti(()=>window.addEventListener("keydown",T)),Ar(()=>window.removeEventListener("keydown",T));const E=Le(()=>{var P,I;const C=t.resource.sequenceFrames||[];if(!C.length)return s("image.noSequence");const M=((P=C[0])==null?void 0:P.name)||s("image.firstImage"),k=((I=C[C.length-1])==null?void 0:I.name)||s("image.lastImage");return s("image.sequenceSelected",{count:C.length,first:M,last:k})});function S(){t.supportsSequence&&t.resource.imageMode==="sequence"?n("pickSequence",t.resource.id):n("pick",t.resource.id)}return(C,M)=>(Q(),te(_e,null,[w("div",NW,[w("div",$W,[w("button",{class:"img-thumb",title:i.supportsSequence&&i.resource.imageMode==="sequence"?C.$t("image.chooseSequence"):C.$t("image.chooseLocal"),onClick:S},[o.value?(Q(),te("img",{key:0,src:o.value,alt:i.resource.textureName},null,8,UW)):(Q(),te("svg",VW,[...M[19]||(M[19]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),w("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),w("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,BW),w("div",XW,[i.showFolder?(Q(),te("label",YW,[w("span",null,F(C.$t("image.subfolder")),1),pe(w("input",{"onUpdate:modelValue":M[0]||(M[0]=k=>i.resource.textureFolder=k),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Je,i.resource.textureFolder]])])):xe("",!0),w("label",zW,[w("span",null,F(C.$t("image.name")),1),pe(w("input",{"onUpdate:modelValue":M[1]||(M[1]=k=>i.resource.textureName=k),type:"text",class:"inp",placeholder:i.namePlaceholder},null,8,jW),[[Je,i.resource.textureName]])])]),w("div",HW,[w("button",{class:"mini-btn2",title:C.$t("image.restore",{name:i.defaultFile}),onClick:M[2]||(M[2]=k=>C.$emit("reset",i.resource.id))},"⟳",8,GW),w("button",{class:"mini-btn2",title:C.$t("image.deleteResource"),disabled:i.resourceCount===1,onClick:M[3]||(M[3]=k=>C.$emit("remove",i.resource.id))},"🗑",8,WW)])]),w("div",qW,F(r.value),1),i.supportsSequence?(Q(),te("label",KW,[w("span",null,F(C.$t("image.imageMode")),1),pe(w("select",{"onUpdate:modelValue":M[4]||(M[4]=k=>i.resource.imageMode=k),class:"inp"},[w("option",JW,F(C.$t("image.fixed")),1),w("option",ZW,F(C.$t("image.sequence")),1)],512),[[_t,i.resource.imageMode]])])):xe("",!0),i.supportsSequence&&i.resource.imageMode==="sequence"?(Q(),te(_e,{key:1},[w("label",QW,[w("span",null,F(C.$t("image.playbackMode")),1),pe(w("select",{"onUpdate:modelValue":M[5]||(M[5]=k=>i.resource.sequencePlayback=k),class:"inp"},[w("option",eq,F(C.$t("image.onceHide")),1),w("option",tq,F(C.$t("image.onceHold")),1),w("option",nq,F(C.$t("image.loopForward")),1),w("option",iq,F(C.$t("image.loopReverse")),1)],512),[[_t,i.resource.sequencePlayback]])]),w("label",sq,[w("span",null,F(C.$t("image.playbackFps")),1),pe(w("input",{"onUpdate:modelValue":M[6]||(M[6]=k=>i.resource.sequenceFps=k),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Je,i.resource.sequenceFps,void 0,{number:!0}]])]),w("button",{class:"sequence-pick",onClick:M[7]||(M[7]=k=>C.$emit("pickSequence",i.resource.id))},F(C.$t("image.chooseSequenceMulti")),1),w("div",rq,F(E.value),1)],64)):xe("",!0),w("div",oq,[Ce(Ue,{class:"resource-weight-control",label:C.$t("image.weight"),min:0,max:100,step:1,"model-value":i.resource.weight,disabled:i.resource.locked||i.resourceCount===1,"onUpdate:modelValue":M[8]||(M[8]=k=>C.$emit("updateWeight",i.resource.id,k))},null,8,["label","model-value","disabled"]),w("button",{class:Pe(["weight-lock",{on:i.resource.locked}]),disabled:i.resourceCount===1,title:i.resource.locked?C.$t("image.unlockWeight"):C.$t("image.lockWeight"),onClick:M[9]||(M[9]=k=>C.$emit("toggleLock",i.resource.id))},[i.resource.locked?(Q(),te("svg",lq,[...M[20]||(M[20]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(Q(),te("svg",cq,[...M[21]||(M[21]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,aq)]),j_(C.$slots,"default",{},void 0),d.value?(Q(),te("div",dq,[M[23]||(M[23]=w("div",{class:"pivot-toggle-icon"},"◎",-1)),w("div",uq,[w("div",hq,F(C.$t("image.pivot")),1),w("div",{class:"pivot-toggle-sub",title:v.value},F(v.value),9,fq)]),w("label",{class:"pivot-switch",title:f.value?C.$t("image.collapsePivot"):C.$t("image.expandPivot")},[pe(w("input",{"onUpdate:modelValue":M[10]||(M[10]=k=>f.value=k),type:"checkbox",onChange:b},null,544),[[vt,f.value]]),M[22]||(M[22]=w("span",{class:"pivot-switch-ui"},null,-1))],8,pq)])):xe("",!0),d.value&&f.value?(Q(),kt(Kx,{key:3,"preview-url":o.value,"anchor-x":i.resource.anchorX??.5,"anchor-y":i.resource.anchorY??.5,"onUpdate:anchorX":M[11]||(M[11]=k=>i.resource.anchorX=k),"onUpdate:anchorY":M[12]||(M[12]=k=>i.resource.anchorY=k),onFullscreen:y},null,8,["preview-url","anchor-x","anchor-y"])):xe("",!0)]),(Q(),kt(Qu,{to:"body"},[p.value?(Q(),te("div",{key:0,class:"pivot-modal-backdrop",onPointerdown:M[18]||(M[18]=We(k=>x(!1),["self"]))},[w("div",{class:"pivot-modal",role:"dialog","aria-modal":"true","aria-label":C.$t("image.pivotModal")},[w("div",gq,[M[24]||(M[24]=w("div",{class:"pivot-modal-icon"},"◎",-1)),w("div",vq,[w("div",bq,[Ct(F(C.$t("image.pivotModal"))+" ",1),w("span",yq,F(i.resource.textureName||i.defaultFile),1)]),w("div",xq,F(C.$t("image.pivotModalDesc")),1)]),w("button",{type:"button",class:"pivot-modal-close",title:C.$t("common.close"),onClick:M[13]||(M[13]=k=>x(!1))},"✕",8,wq)]),w("div",Sq,F(C.$t("image.pivotZoomHint")),1),Ce(Kx,{large:"","preview-url":o.value,"anchor-x":m.value,"anchor-y":g.value,"onUpdate:anchorX":M[14]||(M[14]=k=>m.value=k),"onUpdate:anchorY":M[15]||(M[15]=k=>g.value=k)},null,8,["preview-url","anchor-x","anchor-y"]),w("div",Cq,[w("button",{type:"button",class:"pivot-modal-cancel",onClick:M[16]||(M[16]=k=>x(!1))},F(C.$t("common.cancel")),1),w("button",{type:"button",class:"pivot-modal-confirm",onClick:M[17]||(M[17]=k=>x(!0))},F(C.$t("image.confirmPivot")),1)])],8,mq)],32)):xe("",!0)]))],64))}}),iE=dn(Aq,[["__scopeId","data-v-89f1e08d"]]),Tq={class:"group"},Eq={class:"caret"},_q=["title"],Mq={class:"group-body"},Pq={class:"look-title"},kq={class:"seg"},Iq={class:"row"},Rq={value:"跟随导出"},Fq={value:"线性"},Lq={value:"贝塞尔"},Dq={class:"curve-wrap"},Oq={class:"curve-labels"},Nq={class:"look-title"},$q={class:"seg"},Bq={class:"row"},Uq=["value"],Vq={value:0},Xq=["value"],Yq={class:"render-layer-current"},zq=["title"],jq={key:0,class:"slot-picker"},Hq=["placeholder","aria-label"],Gq={class:"slot-list"},Wq=["onClick"],qq={class:"slot-order"},Kq={class:"slot-name"},Jq={class:"slot-attachment"},Zq={key:0,class:"modifier-hint"},Qq={class:"seg"},e7={class:"switch-row render-layer-switch"},t7=["disabled"],n7={key:0,class:"modifier-hint"},i7={key:2,class:"modifier-hint render-layer-warning"},s7={class:"modifier-hint"},r7={class:"look-title image-title"},o7=["title"],a7={class:"row resource-color-row"},l7=["onUpdate:modelValue"],c7={value:"fixed"},d7={value:"random"},u7={value:"lifetime"},h7=["onUpdate:modelValue"],f7={value:"normal"},p7={value:"add"},m7={value:"multiply"},g7={value:"screen"},v7={key:0,class:"row resource-color-picker"},b7=["onUpdate:modelValue"],y7=["value","aria-label","onChange","onKeydown"],x7={key:0,class:"random-color-hint"},w7={class:"resource-alpha-head"},S7={class:"alpha-modes"},C7=["onClick"],A7=["onClick"],T7=["onClick"],E7={class:"row"},_7=["onUpdate:modelValue"],M7={value:"跟随导出"},P7={value:"线性"},k7={value:"贝塞尔"},I7={class:"resource-alpha-curve"},R7=Zt({__name:"ParticleAppearanceSection",setup(i){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:n,sequenceFileInput:s,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:c,onSequenceFiles:l,resetTexture:d,setResourceFixedColor:u,commitResourceFixedColor:h,removeImageResource:f,setResourceWeight:p,toggleResourceLock:m,collapsed:g,toggle:v,sectionOpen:y,resetModule:b,select:x,renderLayerSlotPickerOpen:T,renderLayerSlotSearch:E,renderLayerReadySpines:S,renderLayerSpineReady:C,renderLayerFilteredSlots:M,renderLayerSlotLabel:k,renderLayerResolvedLabel:P,renderLayerWarning:I,setRenderLayerSlotMode:N,selectRenderLayerSpine:$,pickRenderLayerSlot:j,clearRenderLayerSlot:B,ALPHA_CURVE:Y,RESOURCE_ALPHA_CURVE:U}=Tr();return(D,L)=>(Q(),te("div",Tq,[w("div",{class:"group-head",onClick:L[1]||(L[1]=R=>_(v)("look"))},[w("span",Eq,F(_(g).look?"▸":"▾"),1),w("span",null,F(D.$t("appearance.title")),1),w("button",{class:"group-reset",title:D.$t("appearance.reset"),onClick:L[0]||(L[0]=We(R=>_(b)("look"),["stop"]))},F(D.$t("common.reset")),9,_q)]),pe(w("div",Mq,[w("div",Pq,F(D.$t("appearance.opacity")),1),w("div",kq,[w("button",{class:Pe(["seg-btn",{active:_(t).config.alphaMode==="curve"}]),onClick:L[2]||(L[2]=R=>_(t).config.alphaMode="curve")},F(D.$t("common.curve")),3),w("button",{class:Pe(["seg-btn",{active:_(t).config.alphaMode==="fixed"}]),onClick:L[3]||(L[3]=R=>_(t).config.alphaMode="fixed")},F(D.$t("common.fixed")),3)]),_(t).config.alphaMode==="fixed"?(Q(),kt(Ue,{key:0,label:D.$t("appearance.opacity"),min:0,max:1,step:.01,modelValue:_(t).config.alpha,"onUpdate:modelValue":L[4]||(L[4]=R=>_(t).config.alpha=R)},null,8,["label","modelValue"])):(Q(),te(_e,{key:1},[w("label",Iq,[w("span",null,F(D.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":L[5]||(L[5]=R=>_(t).config.curveMode=R),class:"inp"},[w("option",Rq,F(D.$t("common.followExport")),1),w("option",Fq,F(D.$t("common.linear")),1),w("option",Lq,F(D.$t("common.bezier")),1)],512),[[_t,_(t).config.curveMode]])]),w("div",Dq,[Ce(Ts,{modelValue:_(t).config.alphaCurve,"onUpdate:modelValue":L[6]||(L[6]=R=>_(t).config.alphaCurve=R),"default-value":_(Y),mode:_(e)(_(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),w("div",Oq,[w("span",null,F(D.$t("appearance.transparent")),1),w("span",null,F(D.$t("attributes.lifeTo")),1),w("span",null,F(D.$t("appearance.opaque")),1)])])],64)),w("div",Nq,F(D.$t("appearance.renderLayer")),1),w("div",$q,[w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerMode==="top"}]),onClick:L[7]||(L[7]=R=>_(t).config.renderLayerMode="top")},F(D.$t("appearance.top")),3),w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerMode==="slot"}]),onClick:L[8]||(L[8]=(...R)=>_(N)&&_(N)(...R))},F(D.$t("appearance.spineSlot")),3)]),_(t).config.renderLayerMode==="slot"?(Q(),te(_e,{key:2},[w("label",Bq,[L[19]||(L[19]=w("span",null,"Spine",-1)),w("select",{class:"inp",value:_(t).config.renderLayerSpineId,onChange:L[9]||(L[9]=(...R)=>_($)&&_($)(...R))},[w("option",Vq,F(_(S).length?D.$t("appearance.selectSpine"):D.$t("appearance.noSpine")),1),(Q(!0),te(_e,null,Mt(_(S),R=>(Q(),te("option",{key:R.id,value:R.id},F(R.name),9,Xq))),128))],40,Uq)]),_(C)?(Q(),te(_e,{key:0},[w("div",Yq,[w("span",{class:"render-layer-text",title:_(k)},F(_(k)||D.$t("appearance.noSlot")),9,zq),w("button",{class:"mini-btn",onClick:L[10]||(L[10]=R=>T.value=!_(T))},F(_(k)?D.$t("appearance.reselect"):D.$t("appearance.selectSlot")),1),_(t).config.renderLayerSlotName?(Q(),te("button",{key:0,class:"mini-btn ghost",onClick:L[11]||(L[11]=(...R)=>_(B)&&_(B)(...R))},F(D.$t("common.clear")),1)):xe("",!0)]),_(T)?(Q(),te("div",jq,[pe(w("input",{"onUpdate:modelValue":L[12]||(L[12]=R=>Jt(E)?E.value=R:null),class:"inp",type:"search",placeholder:D.$t("appearance.searchSlots"),"aria-label":D.$t("appearance.searchSlotsAria")},null,8,Hq),[[Je,_(E),void 0,{trim:!0}]]),w("div",Gq,[(Q(!0),te(_e,null,Mt(_(M),R=>(Q(),te("button",{key:R.name,class:Pe(["slot-item",{on:_(t).config.renderLayerSlotName===R.name}]),onClick:X=>_(j)(R)},[w("span",qq,F(R.order+1),1),w("span",Kq,F(R.name),1),w("span",Jq,F(R.attachment||D.$t("appearance.emptySlot")),1)],10,Wq))),128)),_(M).length?xe("",!0):(Q(),te("div",Zq,F(D.$t("appearance.noMatchingSlots")),1))])])):xe("",!0),_(t).config.renderLayerSlotName?(Q(),te(_e,{key:1},[w("div",Qq,[w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerSlotPosition==="above"}]),onClick:L[13]||(L[13]=R=>_(t).config.renderLayerSlotPosition="above")},F(D.$t("appearance.above")),3),w("button",{class:Pe(["seg-btn",{active:_(t).config.renderLayerSlotPosition==="below"}]),onClick:L[14]||(L[14]=R=>_(t).config.renderLayerSlotPosition="below")},F(D.$t("appearance.below")),3)]),w("label",e7,[pe(w("input",{"onUpdate:modelValue":L[15]||(L[15]=R=>_(t).config.renderLayerFollowAttachment=R),type:"checkbox",disabled:_(t).config.renderLayerSlotPosition==="below"},null,8,t7),[[vt,_(t).config.renderLayerFollowAttachment]]),L[20]||(L[20]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(D.$t("appearance.followAttachment")),1)]),_(P)?(Q(),te("div",n7,F(_(P)),1)):xe("",!0)],64)):xe("",!0),_(I)?(Q(),te("div",i7,F(_(I)),1)):xe("",!0),w("div",s7,F(D.$t("appearance.previewOnly")),1)],64)):xe("",!0)],64)):xe("",!0),w("div",r7,[w("span",null,F(D.$t("appearance.imageResources")),1),w("button",{class:"image-add",title:D.$t("appearance.addImage"),onClick:L[16]||(L[16]=(...R)=>_(r)&&_(r)(...R))},"+",8,o7)]),(Q(!0),te(_e,null,Mt(_(t).config.imageResources,R=>(Q(),kt(iE,{key:`${_(t).id}:${R.id}`,resource:R,"resource-count":_(t).config.imageResources.length,"pivot-key":`${_(t).id}:${R.id}`,"supports-sequence":"","default-file":"star.png",onPick:_(o),onPickSequence:_(a),onReset:_(d),onRemove:_(f),onUpdateWeight:_(p),onToggleLock:_(m)},{default:Ju(()=>[Ce(Ue,{label:D.$t("appearance.scale"),min:.1,max:3,step:.05,modelValue:R.scale,"onUpdate:modelValue":X=>R.scale=X},null,8,["label","modelValue","onUpdate:modelValue"]),L[21]||(L[21]=w("div",{class:"resource-divider"},null,-1)),w("label",a7,[w("span",null,F(D.$t("appearance.color")),1),pe(w("select",{"onUpdate:modelValue":X=>R.colorMode=X,class:"inp"},[w("option",c7,F(D.$t("appearance.fixedColor")),1),w("option",d7,F(D.$t("appearance.randomColor")),1),w("option",u7,F(D.$t("appearance.lifetime")),1)],8,l7),[[_t,R.colorMode]]),pe(w("select",{"onUpdate:modelValue":X=>R.blend=X,class:"inp blend-select"},[w("option",f7,F(D.$t("appearance.normal")),1),w("option",p7,F(D.$t("appearance.add")),1),w("option",m7,F(D.$t("appearance.multiply")),1),w("option",g7,F(D.$t("appearance.screen")),1)],8,h7),[[_t,R.blend]])]),R.colorMode==="fixed"?(Q(),te("label",v7,[w("span",null,F(D.$t("appearance.fixedColor")),1),pe(w("input",{type:"color","onUpdate:modelValue":X=>R.colorStart=X,class:"colr"},null,8,b7),[[Je,R.colorStart]]),w("input",{type:"text",class:"hex-input",value:R.colorStart,spellcheck:"false","aria-label":D.$t("appearance.fixedColorValue"),onChange:X=>_(u)(R,X),onKeydown:es(X=>_(h)(R,X),["enter"])},null,40,y7)])):(Q(),te(_e,{key:1},[Ce(nE,{modelValue:R.colorGradient,"onUpdate:modelValue":X=>R.colorGradient=X},null,8,["modelValue","onUpdate:modelValue"]),R.colorMode==="random"?(Q(),te("div",x7,F(D.$t("appearance.randomColorHint")),1)):xe("",!0)],64)),w("div",w7,[w("span",null,F(D.$t("appearance.independentAlpha")),1),w("div",S7,[w("button",{class:Pe({on:R.independentAlpha==="off"}),onClick:X=>R.independentAlpha="off"},F(D.$t("appearance.off")),11,C7),w("button",{class:Pe({on:R.independentAlpha==="fixed"}),onClick:X=>R.independentAlpha="fixed"},F(D.$t("common.fixed")),11,A7),w("button",{class:Pe({on:R.independentAlpha==="curve"}),onClick:X=>R.independentAlpha="curve"},F(D.$t("common.curve")),11,T7)])]),R.independentAlpha==="fixed"?(Q(),kt(Ue,{key:2,label:D.$t("appearance.opacity"),min:0,max:1,step:.01,modelValue:R.alpha,"onUpdate:modelValue":X=>R.alpha=X},null,8,["label","modelValue","onUpdate:modelValue"])):R.independentAlpha==="curve"?(Q(),te(_e,{key:3},[w("label",E7,[w("span",null,F(D.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":X=>R.alphaCurveMode=X,class:"inp"},[w("option",M7,F(D.$t("common.followExport")),1),w("option",P7,F(D.$t("common.linear")),1),w("option",k7,F(D.$t("common.bezier")),1)],8,_7),[[_t,R.alphaCurveMode]])]),w("div",I7,[Ce(Ts,{modelValue:R.alphaCurve,"onUpdate:modelValue":X=>R.alphaCurve=X,"default-value":_(U),mode:_(e)(R.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):xe("",!0)]),_:2},1032,["resource","resource-count","pivot-key","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),w("input",{ref_key:"textureFileInput",ref:n,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:L[17]||(L[17]=(...R)=>_(c)&&_(c)(...R))},null,544),w("input",{ref_key:"sequenceFileInput",ref:s,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:L[18]||(L[18]=(...R)=>_(l)&&_(l)(...R))},null,544)],512),[[Xt,_(y)("look")]])]))}}),Zx=dn(R7,[["__scopeId","data-v-bfe00f1f"]]),F7={class:"group"},L7={class:"caret"},D7=["title"],O7={class:"group-body"},N7={class:"modifier-item damping-item"},$7={class:"modifier-item"},B7={class:"switch-row modifier-switch"},U7={key:0,class:"modifier-params"},V7={class:"modifier-hint"},X7={class:"modifier-item"},Y7={class:"switch-row modifier-switch"},z7={key:0,class:"modifier-params gravity-params"},j7={class:"modifier-mode-row"},H7={class:"gravity-curve-title"},G7={class:"gravity-curve-axis"},W7={class:"modifier-hint"},q7={class:"modifier-item"},K7={class:"switch-row modifier-switch"},J7={key:0,class:"modifier-params gravity-params"},Z7={class:"modifier-mode-row"},Q7={class:"gravity-curve-title"},e9={class:"gravity-curve-axis"},t9={class:"modifier-hint"},n9={class:"modifier-item"},i9={class:"switch-row modifier-switch"},s9={key:0,class:"modifier-params"},r9={class:"row"},o9={value:"constant"},a9={value:"linear"},l9={value:"inverse"},c9={class:"modifier-hint"},d9={class:"switch-row"},u9={class:"modifier-item"},h9={class:"switch-row modifier-switch"},f9={key:0,class:"modifier-params"},p9={class:"row"},m9={value:"constant"},g9={value:"linear"},v9={value:"inverse"},b9={class:"modifier-hint"},y9={class:"switch-row"},x9={class:"modifier-item"},w9={class:"switch-row modifier-switch"},S9={key:0,class:"modifier-params"},C9={class:"row"},A9={value:"global"},T9={value:"particle"},E9={class:"row"},_9={value:"linear"},M9={value:"curve"},P9={class:"modifier-hint"},k9={class:"switch-row"},I9={class:"modifier-item"},R9={class:"switch-row modifier-switch"},F9={key:0,class:"modifier-params trail-params"},L9={class:"trail-section-head"},D9={class:"trail-section-title"},O9=["title"],N9={class:"row"},$9=["onUpdate:modelValue"],B9={value:"fixed"},U9={value:"random"},V9={class:"row"},X9=["onUpdate:modelValue"],Y9={value:"fixed"},z9={value:"random"},j9={class:"row"},H9=["onUpdate:modelValue"],G9={value:"particle"},W9={value:"fixed"},q9={class:"switch-row trail-sub-switch"},K9=["onUpdate:modelValue"],J9={class:"switch-row trail-sub-switch"},Z9=["onUpdate:modelValue"],Q9={class:"trail-mode-head"},eK={class:"alpha-modes"},tK=["onClick"],nK=["onClick"],iK=["onClick"],sK={class:"row"},rK=["onUpdate:modelValue"],oK={value:"normal"},aK={value:"add"},lK={value:"multiply"},cK={value:"screen"},dK={key:6,class:"row trail-fixed-color"},uK=["onUpdate:modelValue"],hK=["value","onChange","onKeydown"],fK={class:"trail-mode-head"},pK={class:"alpha-modes"},mK=["onClick"],gK=["onClick"],vK=["onClick"],bK={class:"trail-grid-row"},yK={class:"modifier-hint"},xK={class:"modifier-item"},wK={class:"switch-row modifier-switch"},SK=["disabled"],CK={key:0,class:"modifier-params emitter-follow-params"},AK={class:"field-block"},TK=["value"],EK={value:"none"},_K={value:"path"},MK={key:0,value:"bone"},PK={class:"field-block"},kK={value:0},IK=["value"],RK={class:"field-block"},FK={value:"fixed"},LK={value:"direction"},DK={class:"gravity-curve-title"},OK={class:"field-grid follow-grid"},NK={class:"compact-field"},$K={class:"compact-field"},BK={value:"local"},UK={value:"world"},VK={class:"field-block"},XK={value:"forward"},YK={value:"reverse"},zK={class:"modifier-hint"},jK={key:0,class:"bone-follow-target"},HK={key:1,class:"bone-follow-missing"},GK={class:"field-block"},WK={value:"local"},qK={value:"world"},KK={class:"field-grid follow-grid"},JK={class:"compact-field"},ZK={class:"compact-field"},QK={class:"bone-follow-transform-grid"},eJ={class:"compact-field"},tJ={class:"compact-field"},nJ={class:"compact-field"},iJ={class:"modifier-hint"},sJ={class:"modifier-item"},rJ={class:"switch-row modifier-switch"},oJ={key:0,class:"modifier-params collision-filter-params"},aJ={class:"collision-filter-title"},lJ={class:"collision-filter-tags"},cJ=["title"],dJ=["aria-label","onClick"],uJ=["disabled","title"],hJ={key:0,class:"collision-filter-empty"},fJ={key:1,class:"collision-filter-picker"},pJ=["onClick"],mJ={class:"modifier-hint"},gJ={class:"modifier-item events-item"},vJ={class:"switch-row modifier-switch"},bJ={key:0,class:"event-rules"},yJ={class:"event-selects"},xJ=["onUpdate:modelValue","title"],wJ={value:"birth"},SJ={value:"death"},CJ={value:"collision"},AJ=["onUpdate:modelValue","title"],TJ={value:0},EJ=["value"],_J=["title","onClick"],MJ={class:"event-probability"},PJ=["onUpdate:modelValue"],kJ={key:0,class:"event-probability event-collision-limit"},IJ=["value","onInput"],RJ={class:"event-probability event-inherit"},FJ=["onClick"],LJ={class:"inherit-summary"},DJ={key:1,class:"event-probability event-color-mode"},OJ=["onUpdate:modelValue"],NJ={value:"add"},$J={value:"replace"},BJ={class:"inherit-check"},UJ={class:"inherit-check"},VJ=["onClick"],XJ={class:"inherit-check"},YJ=Zt({__name:"ParticleModifiersSection",setup(i){const{store:e,sys:t,trailTextureFileInput:n,addTrailResource:s,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:c,onTrailTextureFile:l,resetTrailTexture:d,removeTrailResource:u,setTrailResourceWeight:h,toggleTrailResourceLock:f,setTrailColor:p,commitTrailColor:m,selectedSpineBone:g,boundSpineBone:v,collisionPickerOpen:y,selectedCollisionBodies:b,availableCollisionBodies:x,addCollisionBody:T,removeCollisionBody:E,collapsed:S,toggle:C,sectionOpen:M,onEmitterFollowModeChange:k,bindSelectedBone:P,resetModule:I,select:N,LINEAR_CURVE:$,FLAT_CURVE:j,TRAIL_ALPHA_CURVE:B,TRAIL_SHAPE_CURVE:Y}=Tr(),{t:U}=mi(),D=Le(()=>{var O;const G=(O=t.value)==null?void 0:O.id;if(!G)return[];const H=tC(e.systems,G);return e.systems.filter(V=>V.id!==G&&!H.has(V.id))}),L=Le(()=>[{key:"color",label:U("modifiers.inheritColor")},{key:"scale",label:U("modifiers.inheritScale")},{key:"rotation",label:U("modifiers.inheritRotation")},{key:"life",label:U("modifiers.inheritLife")}]),R=Re(null),X=Le(()=>{var O;const G=R.value,H=(O=t.value)==null?void 0:O.config.events;return!G||!Array.isArray(H)?null:H.find(V=>V.id===G.ruleId)||null});function z(G){return Array.isArray(G.inherit)||(G.inherit=[]),G.inherit}function K(G){const H=z(G);return H.length?H.length===L.value.length?U("modifiers.inheritAll"):L.value.filter(O=>H.includes(O.key)).map(O=>O.label).join("、"):U("modifiers.inheritNone")}function Z(G,H){return z(G).includes(H)}function ae(G,H){const O=z(G),V=O.indexOf(H);V>=0?O.splice(V,1):O.push(H)}function ce(G){z(G).splice(0)}function ve(G){z(G).splice(0,z(G).length,...L.value.map(H=>H.key))}function we(G,H){var he;if(((he=R.value)==null?void 0:he.ruleId)===G.id){R.value=null;return}const O=H.currentTarget;if(!O)return;const V=O.getBoundingClientRect(),W=Math.max(168,V.width),ee=212,be=Math.min(Math.max(8,V.left),Math.max(8,window.innerWidth-W-8));let ye=V.bottom+4;ye+ee>window.innerHeight-8&&(ye=Math.max(8,V.top-ee-4)),R.value={ruleId:G.id,left:be,top:ye,width:W}}function re(){R.value=null}function Ee(){re()}function q(G){G.key==="Escape"&&re()}Ti(()=>{document.addEventListener("pointerdown",re),window.addEventListener("scroll",Ee,!0),window.addEventListener("resize",Ee),window.addEventListener("keydown",q)}),Ar(()=>{document.removeEventListener("pointerdown",re),window.removeEventListener("scroll",Ee,!0),window.removeEventListener("resize",Ee),window.removeEventListener("keydown",q)});function J(){var O;const G=(O=t.value)==null?void 0:O.config;if(!G)return;Array.isArray(G.events)||(G.events=[]);const H=Math.max(0,...G.events.map(V=>V.id))+1;G.events.push({id:H,event:"birth",targetSystemId:0,probability:1,collisionLimit:1,inherit:[],colorInheritMode:"add"})}function ie(G){var H;(H=t.value)==null||H.config.events.splice(G,1)}function se(G,H){const O=H.target,V=Math.round(Number(O.value));G.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(V)?V:1)),O.value=String(G.collisionLimit)}return(G,H)=>(Q(),te(_e,null,[w("div",F7,[w("div",{class:"group-head",onClick:H[1]||(H[1]=O=>_(C)("mods"))},[w("span",L7,F(_(S).mods?"▸":"▾"),1),w("span",null,F(G.$t("modifiers.title")),1),w("button",{class:"group-reset",title:G.$t("modifiers.reset"),onClick:H[0]||(H[0]=We(O=>_(I)("mods"),["stop"]))},F(G.$t("common.reset")),9,D7)]),pe(w("div",O7,[w("div",N7,[Ce(Ue,{label:G.$t("modifiers.damping"),min:0,max:2,step:.05,modelValue:_(t).config.damping,"onUpdate:modelValue":H[2]||(H[2]=O=>_(t).config.damping=O)},null,8,["label","modelValue"])]),w("div",$7,[w("label",B7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[3]||(H[3]=O=>_(t).config.noise=O)},null,512),[[vt,_(t).config.noise]]),H[74]||(H[74]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableNoise")),1)]),_(t).config.noise?(Q(),te("div",U7,[Ce(Ue,{label:G.$t("modifiers.strength"),min:0,max:100,step:1,modelValue:_(t).config.noiseAmt,"onUpdate:modelValue":H[4]||(H[4]=O=>_(t).config.noiseAmt=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.noiseRange"),min:0,max:500,step:1,modelValue:_(t).config.noiseRange,"onUpdate:modelValue":H[5]||(H[5]=O=>_(t).config.noiseRange=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.noiseSpeed"),min:0,max:10,step:.1,modelValue:_(t).config.noiseSpeed,"onUpdate:modelValue":H[6]||(H[6]=O=>_(t).config.noiseSpeed=O)},null,8,["label","modelValue"]),w("div",V7,F(G.$t("modifiers.noiseHint")),1)])):xe("",!0)]),w("div",X7,[w("label",Y7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[7]||(H[7]=O=>_(t).config.useGravity=O)},null,512),[[vt,_(t).config.useGravity]]),H[75]||(H[75]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableGravity")),1)]),_(t).config.useGravity?(Q(),te("div",z7,[w("div",j7,[w("button",{class:Pe(["axis-mode",{on:_(t).config.gravityMode==="fixed"}]),onClick:H[8]||(H[8]=O=>_(t).config.gravityMode="fixed")},F(G.$t("common.fixed")),3),w("button",{class:Pe(["axis-mode",{on:_(t).config.gravityMode==="random"}]),onClick:H[9]||(H[9]=O=>_(t).config.gravityMode="random")},F(G.$t("common.random")),3)]),_(t).config.gravityMode==="fixed"?(Q(),kt(Ue,{key:0,label:G.$t("modifiers.gravityStrength"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.gravityMin,"onUpdate:modelValue":H[10]||(H[10]=O=>_(t).config.gravityMin=O)},null,8,["label","modelValue"])):(Q(),te(_e,{key:1},[Ce(Ue,{label:G.$t("modifiers.strengthMin"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.gravityMin,"onUpdate:modelValue":H[11]||(H[11]=O=>_(t).config.gravityMin=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.strengthMax"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.gravityMax,"onUpdate:modelValue":H[12]||(H[12]=O=>_(t).config.gravityMax=O)},null,8,["label","modelValue"])],64)),Ce(Ue,{label:G.$t("modifiers.direction"),min:-360,max:360,step:1,modelValue:_(t).config.gravityDirection,"onUpdate:modelValue":H[13]||(H[13]=O=>_(t).config.gravityDirection=O)},null,8,["label","modelValue"]),w("div",H7,[w("span",null,F(G.$t("modifiers.gravityOverLife")),1),w("span",null,F(G.$t("modifiers.axisStrength")),1)]),Ce(Ts,{modelValue:_(t).config.gravityCurve,"onUpdate:modelValue":H[14]||(H[14]=O=>_(t).config.gravityCurve=O),"default-value":_(j)},null,8,["modelValue","default-value"]),w("div",G7,[H[76]||(H[76]=w("span",null,"0",-1)),w("span",null,F(G.$t("attributes.lifeTo")),1),H[77]||(H[77]=w("span",null,"1",-1))]),w("div",W7,F(G.$t("modifiers.directionHint")),1)])):xe("",!0)]),w("div",q7,[w("label",K7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[15]||(H[15]=O=>_(t).config.wind=O)},null,512),[[vt,_(t).config.wind]]),H[78]||(H[78]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableWind")),1)]),_(t).config.wind?(Q(),te("div",J7,[w("div",Z7,[w("button",{class:Pe(["axis-mode",{on:_(t).config.windMode==="fixed"}]),onClick:H[16]||(H[16]=O=>_(t).config.windMode="fixed")},F(G.$t("common.fixed")),3),w("button",{class:Pe(["axis-mode",{on:_(t).config.windMode==="random"}]),onClick:H[17]||(H[17]=O=>_(t).config.windMode="random")},F(G.$t("common.random")),3)]),_(t).config.windMode==="fixed"?(Q(),kt(Ue,{key:0,label:G.$t("modifiers.windStrength"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.windMin,"onUpdate:modelValue":H[18]||(H[18]=O=>_(t).config.windMin=O)},null,8,["label","modelValue"])):(Q(),te(_e,{key:1},[Ce(Ue,{label:G.$t("modifiers.strengthMin"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.windMin,"onUpdate:modelValue":H[19]||(H[19]=O=>_(t).config.windMin=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.strengthMax"),min:-3e3,max:3e3,step:10,modelValue:_(t).config.windMax,"onUpdate:modelValue":H[20]||(H[20]=O=>_(t).config.windMax=O)},null,8,["label","modelValue"])],64)),Ce(Ue,{label:G.$t("modifiers.direction"),min:-360,max:360,step:1,modelValue:_(t).config.windDirection,"onUpdate:modelValue":H[21]||(H[21]=O=>_(t).config.windDirection=O)},null,8,["label","modelValue"]),w("div",Q7,[w("span",null,F(G.$t("modifiers.windOverLife")),1),w("span",null,F(G.$t("modifiers.axisStrength")),1)]),Ce(Ts,{modelValue:_(t).config.windCurve,"onUpdate:modelValue":H[22]||(H[22]=O=>_(t).config.windCurve=O),"default-value":_(j)},null,8,["modelValue","default-value"]),w("div",e9,[H[79]||(H[79]=w("span",null,"0",-1)),w("span",null,F(G.$t("attributes.lifeTo")),1),H[80]||(H[80]=w("span",null,"1",-1))]),w("div",t9,F(G.$t("modifiers.directionHint")),1)])):xe("",!0)]),w("div",n9,[w("label",i9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[23]||(H[23]=O=>_(t).config.forceField=O)},null,512),[[vt,_(t).config.forceField]]),H[81]||(H[81]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableForceField")),1)]),_(t).config.forceField?(Q(),te("div",s9,[Ce(Ue,{label:G.$t("modifiers.centerX"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.forceCenterX,"onUpdate:modelValue":H[24]||(H[24]=O=>_(t).config.forceCenterX=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.centerY"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.forceCenterY,"onUpdate:modelValue":H[25]||(H[25]=O=>_(t).config.forceCenterY=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceStrength"),min:-300,max:300,step:1,modelValue:_(t).config.forceStrength,"onUpdate:modelValue":H[26]||(H[26]=O=>_(t).config.forceStrength=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceRadius"),min:1,max:2e3,step:1,modelValue:_(t).config.forceRadius,"onUpdate:modelValue":H[27]||(H[27]=O=>_(t).config.forceRadius=O)},null,8,["label","modelValue"]),w("label",r9,[w("span",null,F(G.$t("modifiers.falloffMode")),1),pe(w("select",{"onUpdate:modelValue":H[28]||(H[28]=O=>_(t).config.forceFalloff=O),class:"inp"},[w("option",o9,F(G.$t("modifiers.constant")),1),w("option",a9,F(G.$t("modifiers.linearFalloff")),1),w("option",l9,F(G.$t("modifiers.inverseFalloff")),1)],512),[[_t,_(t).config.forceFalloff]])]),w("div",c9,F(G.$t("modifiers.forceHint")),1),w("label",d9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[29]||(H[29]=O=>_(t).config.showForceFieldShape=O)},null,512),[[vt,_(t).config.showForceFieldShape]]),H[82]||(H[82]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.showShape")),1)])])):xe("",!0)]),w("div",u9,[w("label",h9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[30]||(H[30]=O=>_(t).config.vortex=O)},null,512),[[vt,_(t).config.vortex]]),H[83]||(H[83]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableVortex")),1)]),_(t).config.vortex?(Q(),te("div",f9,[Ce(Ue,{label:G.$t("modifiers.centerX"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.vortexCenterX,"onUpdate:modelValue":H[31]||(H[31]=O=>_(t).config.vortexCenterX=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.centerY"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.vortexCenterY,"onUpdate:modelValue":H[32]||(H[32]=O=>_(t).config.vortexCenterY=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceStrength"),min:-300,max:300,step:1,modelValue:_(t).config.vortexStrength,"onUpdate:modelValue":H[33]||(H[33]=O=>_(t).config.vortexStrength=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.forceRadius"),min:1,max:2e3,step:1,modelValue:_(t).config.vortexRadius,"onUpdate:modelValue":H[34]||(H[34]=O=>_(t).config.vortexRadius=O)},null,8,["label","modelValue"]),w("label",p9,[w("span",null,F(G.$t("modifiers.falloffMode")),1),pe(w("select",{"onUpdate:modelValue":H[35]||(H[35]=O=>_(t).config.vortexFalloff=O),class:"inp"},[w("option",m9,F(G.$t("modifiers.constant")),1),w("option",g9,F(G.$t("modifiers.linearFalloff")),1),w("option",v9,F(G.$t("modifiers.inverseFalloff")),1)],512),[[_t,_(t).config.vortexFalloff]])]),w("div",b9,F(G.$t("modifiers.vortexHint")),1),w("label",y9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[36]||(H[36]=O=>_(t).config.showVortexShape=O)},null,512),[[vt,_(t).config.showVortexShape]]),H[84]||(H[84]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.showShape")),1)])])):xe("",!0)]),w("div",x9,[w("label",w9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[37]||(H[37]=O=>_(t).config.attraction=O)},null,512),[[vt,_(t).config.attraction]]),H[85]||(H[85]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableAttraction")),1)]),_(t).config.attraction?(Q(),te("div",S9,[Ce(Ue,{label:G.$t("modifiers.attractionX"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.attractionCenterX,"onUpdate:modelValue":H[38]||(H[38]=O=>_(t).config.attractionCenterX=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.attractionY"),min:-5e3,max:5e3,step:1,modelValue:_(t).config.attractionCenterY,"onUpdate:modelValue":H[39]||(H[39]=O=>_(t).config.attractionCenterY=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.attractionRadius"),min:0,max:2e3,step:1,modelValue:_(t).config.attractionRadius,"onUpdate:modelValue":H[40]||(H[40]=O=>_(t).config.attractionRadius=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.attractionDuration"),min:.05,max:30,step:.05,modelValue:_(t).config.attractionDuration,"onUpdate:modelValue":H[41]||(H[41]=O=>_(t).config.attractionDuration=O)},null,8,["label","modelValue"]),Ce(Ue,{label:G.$t("modifiers.delay"),min:0,max:30,step:.05,modelValue:_(t).config.attractionDelay,"onUpdate:modelValue":H[42]||(H[42]=O=>_(t).config.attractionDelay=O)},null,8,["label","modelValue"]),w("label",C9,[w("span",null,F(G.$t("modifiers.delayMode")),1),pe(w("select",{"onUpdate:modelValue":H[43]||(H[43]=O=>_(t).config.attractionDelayMode=O),class:"inp"},[w("option",A9,F(G.$t("modifiers.globalTime")),1),w("option",T9,F(G.$t("modifiers.particleLife")),1)],512),[[_t,_(t).config.attractionDelayMode]])]),w("label",E9,[w("span",null,F(G.$t("modifiers.attractionPath")),1),pe(w("select",{"onUpdate:modelValue":H[44]||(H[44]=O=>_(t).config.attractionPath=O),class:"inp"},[w("option",_9,F(G.$t("modifiers.straight")),1),w("option",M9,F(G.$t("common.curve")),1)],512),[[_t,_(t).config.attractionPath]])]),w("div",P9,F(G.$t("modifiers.attractionHint")),1),w("label",k9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[45]||(H[45]=O=>_(t).config.showAttractionShape=O)},null,512),[[vt,_(t).config.showAttractionShape]]),H[86]||(H[86]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.showShape")),1)])])):xe("",!0)]),w("div",I9,[w("label",R9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[46]||(H[46]=O=>_(t).config.trail=O)},null,512),[[vt,_(t).config.trail]]),H[87]||(H[87]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableTrail")),1)]),_(t).config.trail?(Q(),te("div",F9,[w("div",L9,[w("div",D9,F(G.$t("modifiers.trailImages")),1),w("button",{class:"image-add",title:G.$t("modifiers.addTrailImage"),onClick:H[47]||(H[47]=(...O)=>_(s)&&_(s)(...O))},"+",8,O9)]),(Q(!0),te(_e,null,Mt(_(t).config.trailResources,O=>(Q(),kt(iE,{key:O.id,resource:O,"resource-count":_(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:_(r),onReset:_(d),onRemove:_(u),onUpdateWeight:_(h),onToggleLock:_(f)},{default:Ju(()=>[H[90]||(H[90]=w("div",{class:"resource-divider"},null,-1)),Ce(Ue,{label:G.$t("modifiers.trailRotation"),min:-360,max:360,step:1,"model-value":O.rotation,"onUpdate:modelValue":V=>_(c)(O.id,V)},null,8,["label","model-value","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.trailBones"),min:2,max:16,step:1,"model-value":O.boneCount,"onUpdate:modelValue":V=>_(a)(O.id,V)},null,8,["label","model-value","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.trailRatio"),min:0,max:100,step:1,modelValue:O.trailRatio,"onUpdate:modelValue":V=>O.trailRatio=V},null,8,["label","modelValue","onUpdate:modelValue"]),w("label",N9,[w("span",null,F(G.$t("modifiers.trailLength")),1),pe(w("select",{"onUpdate:modelValue":V=>O.lengthMode=V,class:"inp"},[w("option",B9,F(G.$t("common.fixed")),1),w("option",U9,F(G.$t("modifiers.randomRange")),1)],8,$9),[[_t,O.lengthMode]])]),O.lengthMode==="fixed"?(Q(),kt(Ue,{key:0,label:G.$t("modifiers.lengthRatio"),min:0,max:500,step:1,modelValue:O.length,"onUpdate:modelValue":V=>O.length=V},null,8,["label","modelValue","onUpdate:modelValue"])):(Q(),te(_e,{key:1},[Ce(Ue,{label:G.$t("modifiers.lengthMin"),min:0,max:500,step:1,modelValue:O.lengthMin,"onUpdate:modelValue":V=>O.lengthMin=V},null,8,["label","modelValue","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.lengthMax"),min:0,max:500,step:1,modelValue:O.lengthMax,"onUpdate:modelValue":V=>O.lengthMax=V},null,8,["label","modelValue","onUpdate:modelValue"])],64)),w("label",V9,[w("span",null,F(G.$t("modifiers.trailWidth")),1),pe(w("select",{"onUpdate:modelValue":V=>O.widthSizeMode=V,class:"inp"},[w("option",Y9,F(G.$t("common.fixed")),1),w("option",z9,F(G.$t("modifiers.randomRange")),1)],8,X9),[[_t,O.widthSizeMode]])]),O.widthSizeMode==="fixed"?(Q(),kt(Ue,{key:2,label:G.$t("modifiers.widthRatio"),min:0,max:500,step:1,modelValue:O.width,"onUpdate:modelValue":V=>O.width=V},null,8,["label","modelValue","onUpdate:modelValue"])):(Q(),te(_e,{key:3},[Ce(Ue,{label:G.$t("modifiers.widthMin"),min:0,max:500,step:1,modelValue:O.widthMin,"onUpdate:modelValue":V=>O.widthMin=V},null,8,["label","modelValue","onUpdate:modelValue"]),Ce(Ue,{label:G.$t("modifiers.widthMax"),min:0,max:500,step:1,modelValue:O.widthMax,"onUpdate:modelValue":V=>O.widthMax=V},null,8,["label","modelValue","onUpdate:modelValue"])],64)),w("label",j9,[w("span",null,F(G.$t("modifiers.widthScale")),1),pe(w("select",{"onUpdate:modelValue":V=>O.widthMode=V,class:"inp"},[w("option",G9,F(G.$t("modifiers.followParticle")),1),w("option",W9,F(G.$t("common.fixed")),1)],8,H9),[[_t,O.widthMode]])]),w("label",q9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":V=>O.lifeLengthEnabled=V},null,8,K9),[[vt,O.lifeLengthEnabled]]),H[88]||(H[88]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.lifeLengthCurve")),1)]),O.lifeLengthEnabled?(Q(),kt(Ts,{key:4,modelValue:O.lifeLengthCurve,"onUpdate:modelValue":V=>O.lifeLengthCurve=V,"default-value":_(j)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),w("label",J9,[pe(w("input",{type:"checkbox","onUpdate:modelValue":V=>O.shapeEnabled=V},null,8,Z9),[[vt,O.shapeEnabled]]),H[89]||(H[89]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.shapeCurve")),1)]),O.shapeEnabled?(Q(),kt(Ts,{key:5,modelValue:O.shapeCurve,"onUpdate:modelValue":V=>O.shapeCurve=V,"default-value":_(Y)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),w("div",Q9,[w("span",null,F(G.$t("modifiers.colorMode")),1),w("div",eK,[w("button",{class:Pe(["axis-mode",{on:O.colorMode==="particle"}]),onClick:V=>O.colorMode="particle"},F(G.$t("modifiers.followParticle")),11,tK),w("button",{class:Pe(["axis-mode",{on:O.colorMode==="fixed"}]),onClick:V=>O.colorMode="fixed"},F(G.$t("common.fixed")),11,nK),w("button",{class:Pe(["axis-mode",{on:O.colorMode==="curve"}]),onClick:V=>O.colorMode="curve"},F(G.$t("common.curve")),11,iK)])]),w("label",sK,[w("span",null,F(G.$t("modifiers.blendMode")),1),pe(w("select",{"onUpdate:modelValue":V=>O.blend=V,class:"inp"},[w("option",oK,F(G.$t("appearance.normal")),1),w("option",aK,F(G.$t("appearance.add")),1),w("option",lK,F(G.$t("appearance.multiply")),1),w("option",cK,F(G.$t("appearance.screen")),1)],8,rK),[[_t,O.blend]])]),O.colorMode==="fixed"?(Q(),te("label",dK,[w("span",null,F(G.$t("modifiers.fixedColor")),1),pe(w("input",{class:"colr",type:"color","onUpdate:modelValue":V=>O.color=V},null,8,uK),[[Je,O.color]]),w("input",{class:"hex-input",value:O.color,onChange:V=>_(p)(O,V),onKeydown:es(We(V=>_(m)(O,V),["prevent"]),["enter"])},null,40,hK)])):O.colorMode==="curve"?(Q(),kt(nE,{key:7,modelValue:O.colorGradient,"onUpdate:modelValue":V=>O.colorGradient=V},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),w("div",fK,[w("span",null,F(G.$t("modifiers.alphaMode")),1),w("div",pK,[w("button",{class:Pe(["axis-mode",{on:O.alphaMode==="particle"}]),onClick:V=>O.alphaMode="particle"},F(G.$t("modifiers.followParticle")),11,mK),w("button",{class:Pe(["axis-mode",{on:O.alphaMode==="fixed"}]),onClick:V=>O.alphaMode="fixed"},F(G.$t("common.fixed")),11,gK),w("button",{class:Pe(["axis-mode",{on:O.alphaMode==="curve"}]),onClick:V=>O.alphaMode="curve"},F(G.$t("common.curve")),11,vK)])]),O.alphaMode==="fixed"?(Q(),kt(Ue,{key:8,label:G.$t("modifiers.opacity"),min:0,max:1,step:.01,modelValue:O.alpha,"onUpdate:modelValue":V=>O.alpha=V},null,8,["label","modelValue","onUpdate:modelValue"])):xe("",!0),O.alphaMode==="curve"?(Q(),kt(Ts,{key:9,modelValue:O.alphaCurve,"onUpdate:modelValue":V=>O.alphaCurve=V,"default-value":_(B)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),w("input",{ref_key:"trailTextureFileInput",ref:n,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:H[48]||(H[48]=(...O)=>_(l)&&_(l)(...O))},null,544),w("div",bK,[Ce(Ue,{label:G.$t("modifiers.gridRows"),min:2,max:16,step:1,"model-value":_(t).config.trailGridRows,"onUpdate:modelValue":H[49]||(H[49]=O=>_(o)("trailGridRows",O))},null,8,["label","model-value"]),Ce(Ue,{label:G.$t("modifiers.gridCols"),min:2,max:32,step:1,"model-value":_(t).config.trailGridCols,"onUpdate:modelValue":H[50]||(H[50]=O=>_(o)("trailGridCols",O))},null,8,["label","model-value"])]),w("div",yK,F(G.$t("modifiers.trailHint")),1)])):xe("",!0)]),w("div",xK,[w("label",wK,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[51]||(H[51]=O=>_(t).config.emitterFollow=O),disabled:_(t).config.streamBehavior==="loop"},null,8,SK),[[vt,_(t).config.emitterFollow]]),H[91]||(H[91]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableFollow")),1)]),_(t).config.emitterFollow&&_(t).config.streamBehavior!=="loop"?(Q(),te("div",CK,[w("label",AK,[w("span",null,F(G.$t("modifiers.followMode")),1),w("select",{value:_(t).config.emitterFollowMode,class:"inp",onChange:H[52]||(H[52]=O=>_(k)(O,_(t).config))},[w("option",EK,F(G.$t("modifiers.noFollow")),1),w("option",_K,F(G.$t("modifiers.followPath")),1),_(g)||_(t).config.emitterFollowMode==="bone"?(Q(),te("option",MK,F(G.$t("modifiers.selectedBone")),1)):xe("",!0)],40,TK)]),_(t).config.emitterFollowMode==="path"?(Q(),te(_e,{key:0},[w("label",PK,[w("span",null,F(G.$t("modifiers.followPath")),1),pe(w("select",{"onUpdate:modelValue":H[53]||(H[53]=O=>_(t).config.emitterFollowPathId=O),class:"inp"},[w("option",kK,F(G.$t("modifiers.noFollow")),1),(Q(!0),te(_e,null,Mt(_(e).paths,O=>(Q(),te("option",{key:O.id,value:O.id},F(O.name),9,IK))),128))],512),[[_t,_(t).config.emitterFollowPathId,void 0,{number:!0}]])]),w("label",RK,[w("span",null,F(G.$t("modifiers.emitterAngleMode")),1),pe(w("select",{"onUpdate:modelValue":H[54]||(H[54]=O=>_(t).config.emitterAngleMode=O),class:"inp"},[w("option",FK,F(G.$t("modifiers.fixedAngle")),1),w("option",LK,F(G.$t("modifiers.followMoveDirection")),1)],512),[[_t,_(t).config.emitterAngleMode]])]),w("div",DK,[w("span",null,F(G.$t("modifiers.moveProgressCurve")),1)]),Ce(Ts,{modelValue:_(t).config.emitterFollowCurve,"onUpdate:modelValue":H[55]||(H[55]=O=>_(t).config.emitterFollowCurve=O),"default-value":_($)},null,8,["modelValue","default-value"]),w("div",OK,[w("label",NK,[w("span",null,F(G.$t("modifiers.moveDuration")),1),pe(w("input",{"onUpdate:modelValue":H[56]||(H[56]=O=>_(t).config.emitterFollowDuration=O),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,_(t).config.emitterFollowDuration,void 0,{number:!0}]])]),w("label",$K,[w("span",null,F(G.$t("modifiers.followSpace")),1),pe(w("select",{"onUpdate:modelValue":H[57]||(H[57]=O=>_(t).config.emitterFollowSpace=O),class:"inp"},[w("option",BK,F(G.$t("modifiers.localSpace")),1),w("option",UK,F(G.$t("modifiers.worldSpace")),1)],512),[[_t,_(t).config.emitterFollowSpace]])])]),w("label",VK,[w("span",null,F(G.$t("modifiers.moveDirection")),1),pe(w("select",{"onUpdate:modelValue":H[58]||(H[58]=O=>_(t).config.emitterFollowDirection=O),class:"inp"},[w("option",XK,F(G.$t("modifiers.forward")),1),w("option",YK,F(G.$t("modifiers.reverse")),1)],512),[[_t,_(t).config.emitterFollowDirection]])]),Ce(Ue,{label:G.$t("modifiers.followOffset"),min:0,max:1,step:.01,modelValue:_(t).config.emitterFollowOffset,"onUpdate:modelValue":H[59]||(H[59]=O=>_(t).config.emitterFollowOffset=O)},null,8,["label","modelValue"]),w("div",zK,F(G.$t("modifiers.followSpaceHint")),1)],64)):_(t).config.emitterFollowMode==="bone"?(Q(),te(_e,{key:1},[_(v)?(Q(),te("div",jK,[Ct(F(G.$t("modifiers.followTarget")),1),w("strong",null,F(_(v).spine.name)+" / "+F(_(v).boneName),1)])):(Q(),te("div",HK,F(G.$t("modifiers.noValidBone")),1)),_(g)&&(!_(v)||_(g).spine.id!==_(v).spine.id||_(g).boneName!==_(v).boneName)?(Q(),te("button",{key:2,class:"bone-follow-rebind",onClick:H[60]||(H[60]=O=>_(P)(_(t).config))},F(_(v)?G.$t("modifiers.rebind"):G.$t("modifiers.bind"))+F(G.$t("modifiers.selectedBoneLabel"))+F(_(g).spine.name)+" / "+F(_(g).boneName),1)):xe("",!0),_(v)?(Q(),te(_e,{key:3},[w("label",GK,[w("span",null,F(G.$t("modifiers.followSpace")),1),pe(w("select",{"onUpdate:modelValue":H[61]||(H[61]=O=>_(t).config.emitterFollowSpace=O),class:"inp"},[w("option",WK,F(G.$t("modifiers.boneLocalSpace")),1),w("option",qK,F(G.$t("modifiers.boneWorldSpace")),1)],512),[[_t,_(t).config.emitterFollowSpace]])]),w("div",KK,[w("label",JK,[w("span",null,F(G.$t("modifiers.offsetX")),1),pe(w("input",{"onUpdate:modelValue":H[62]||(H[62]=O=>_(t).config.emitterFollowBoneOffsetX=O),type:"number",step:"1",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),w("label",ZK,[w("span",null,F(G.$t("modifiers.offsetY")),1),pe(w("input",{"onUpdate:modelValue":H[63]||(H[63]=O=>_(t).config.emitterFollowBoneOffsetY=O),type:"number",step:"1",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),w("div",QK,[w("label",eJ,[w("span",null,F(G.$t("modifiers.rotationOffset")),1),pe(w("input",{"onUpdate:modelValue":H[64]||(H[64]=O=>_(t).config.emitterFollowBoneRotation=O),type:"number",step:"1",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),w("label",tJ,[w("span",null,F(G.$t("modifiers.scaleOffsetX")),1),pe(w("input",{"onUpdate:modelValue":H[65]||(H[65]=O=>_(t).config.emitterFollowBoneScaleX=O),type:"number",step:"0.05",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),w("label",nJ,[w("span",null,F(G.$t("modifiers.scaleOffsetY")),1),pe(w("input",{"onUpdate:modelValue":H[66]||(H[66]=O=>_(t).config.emitterFollowBoneScaleY=O),type:"number",step:"0.05",class:"inp"},null,512),[[Je,_(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),w("div",iJ,F(G.$t("modifiers.boneFollowHint")),1)],64)):xe("",!0)],64)):xe("",!0)])):xe("",!0)]),w("div",sJ,[w("label",rJ,[pe(w("input",{type:"checkbox","onUpdate:modelValue":H[67]||(H[67]=O=>_(t).config.collision=O)},null,512),[[vt,_(t).config.collision]]),H[92]||(H[92]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableCollision")),1)]),_(t).config.collision?(Q(),te("div",oJ,[w("div",aJ,F(G.$t("modifiers.collisionObjects")),1),w("div",lJ,[(Q(!0),te(_e,null,Mt(_(b),O=>(Q(),te("span",{key:O.id,class:Pe(["collision-filter-tag",{disabled:!O.enabled}]),title:O.enabled?O.name:G.$t("modifiers.colliderDisabled",{name:O.name})},[w("span",null,F(O.name),1),w("button",{type:"button","aria-label":G.$t("modifiers.clearCollider",{name:O.name}),onClick:V=>_(E)(O.id)},"×",8,dJ)],10,cJ))),128)),w("button",{type:"button",class:Pe(["collision-filter-add",{active:_(y)}]),disabled:_(x).length===0,title:_(x).length?G.$t("modifiers.addCollider"):G.$t("modifiers.noAvailableColliders"),onClick:H[68]||(H[68]=O=>y.value=!_(y))},"+",10,uJ)]),_(b).length===0?(Q(),te("div",hJ,F(G.$t("modifiers.noCollidersSelected")),1)):xe("",!0),_(y)&&_(x).length?(Q(),te("div",fJ,[(Q(!0),te(_e,null,Mt(_(x),O=>(Q(),te("button",{key:O.id,type:"button",onClick:V=>_(T)(O.id)},[w("span",null,F(O.name),1),w("small",null,F(O.enabled?G.$t("modifiers.available"):G.$t("modifiers.disabled")),1)],8,pJ))),128))])):xe("",!0),w("div",mJ,F(G.$t("modifiers.collisionHint")),1)])):xe("",!0)]),w("div",gJ,[w("label",vJ,[pe(w("input",{"onUpdate:modelValue":H[69]||(H[69]=O=>_(t).config.eventEnabled=O),type:"checkbox"},null,512),[[vt,_(t).config.eventEnabled]]),H[93]||(H[93]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(G.$t("modifiers.enableSubEmitter")),1)]),_(t).config.eventEnabled?(Q(),te("div",bJ,[(Q(!0),te(_e,null,Mt(_(t).config.events,(O,V)=>(Q(),te("div",{key:O.id,class:"event-card"},[w("div",yJ,[pe(w("select",{"onUpdate:modelValue":W=>O.event=W,class:"inp event-select",title:G.$t("modifiers.triggerTiming")},[w("option",wJ,F(G.$t("modifiers.birth")),1),w("option",SJ,F(G.$t("modifiers.death")),1),w("option",CJ,F(G.$t("modifiers.collision")),1)],8,xJ),[[_t,O.event]]),pe(w("select",{"onUpdate:modelValue":W=>O.targetSystemId=W,class:"inp event-target",title:G.$t("modifiers.chooseTarget")},[w("option",TJ,F(G.$t("modifiers.noTarget")),1),(Q(!0),te(_e,null,Mt(D.value,W=>(Q(),te("option",{key:W.id,value:W.id},F(W.config.name||`ParticleSystem${W.id}`),9,EJ))),128))],8,AJ),[[_t,O.targetSystemId,void 0,{number:!0}]]),w("button",{type:"button",class:"event-remove",title:G.$t("modifiers.deleteSubEmitter"),onClick:W=>ie(V)},"✕",8,_J)]),w("label",MJ,[w("span",null,F(G.$t("modifiers.probability")),1),pe(w("input",{"onUpdate:modelValue":W=>O.probability=W,type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,8,PJ),[[Je,O.probability,void 0,{number:!0}]])]),O.event==="collision"?(Q(),te("label",kJ,[w("span",null,F(G.$t("modifiers.collisionLimit")),1),w("input",{value:O.collisionLimit??1,type:"number",min:"1",max:"4",step:"1",class:"inp",onInput:W=>se(O,W)},null,40,IJ)])):xe("",!0),w("div",RJ,[w("span",null,F(G.$t("modifiers.inherit")),1),w("button",{type:"button",class:"inherit-trigger",onPointerdown:H[70]||(H[70]=We(()=>{},["stop"])),onClick:We(W=>we(O,W),["stop"])},[w("span",LJ,F(K(O)),1),H[94]||(H[94]=w("i",null,"⌄",-1))],40,FJ)]),Z(O,"color")?(Q(),te("label",DJ,[w("span",null,F(G.$t("modifiers.colorInheritMode")),1),pe(w("select",{"onUpdate:modelValue":W=>O.colorInheritMode=W,class:"inp"},[w("option",NJ,F(G.$t("modifiers.add")),1),w("option",$J,F(G.$t("modifiers.replace")),1)],8,OJ),[[_t,O.colorInheritMode]])])):xe("",!0)]))),128)),w("button",{type:"button",class:"event-add",onClick:J},F(G.$t("modifiers.addSubEmitter")),1)])):xe("",!0)])],512),[[Xt,_(M)("mods")]])]),(Q(),kt(Qu,{to:"body"},[R.value&&X.value?(Q(),te("div",{key:0,class:"inherit-menu",style:zt({left:`${R.value.left}px`,top:`${R.value.top}px`,width:`${R.value.width}px`}),onPointerdown:H[73]||(H[73]=We(()=>{},["stop"]))},[w("button",{type:"button",class:"inherit-option",onClick:H[71]||(H[71]=O=>ce(X.value))},[w("span",BJ,F(z(X.value).length===0?"✓":""),1),Ct(F(G.$t("modifiers.inheritNone")),1)]),w("button",{type:"button",class:"inherit-option",onClick:H[72]||(H[72]=O=>ve(X.value))},[w("span",UJ,F(z(X.value).length===4?"✓":""),1),Ct(F(G.$t("modifiers.inheritAll")),1)]),H[95]||(H[95]=w("div",{class:"inherit-divider"},null,-1)),(Q(!0),te(_e,null,Mt(L.value,O=>(Q(),te("button",{key:O.key,type:"button",class:"inherit-option",onClick:V=>ae(X.value,O.key)},[w("span",XJ,F(Z(X.value,O.key)?"✓":""),1),Ct(F(O.label),1)],8,VJ))),128))],36)):xe("",!0)]))],64))}}),Qx=dn(YJ,[["__scopeId","data-v-54af9ba1"]]),zJ={class:"spine-export-actions"},jJ=["disabled","title"],HJ=["disabled","title"],GJ=["disabled","title"],WJ={key:0},qJ=["href","title"],KJ=["title"],JJ=["href"],ZJ=Zt({__name:"ParticleExportFooter",setup(i){const{exportSettings:e,exportBusy:t,exportTarget:n,exportMessage:s,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:d,connectorDisabledReason:u,connectorButtonTitle:h,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=Tr();return(v,y)=>(Q(),te(_e,null,[w("div",zJ,[w("button",{type:"button",class:"export-spine-json",disabled:_(t),title:_(t)?v.$t("export.baking"):v.$t("export.exportJsonTitle",{version:_(e).spineVersion}),onClick:y[0]||(y[0]=(...b)=>_(p)&&_(p)(...b))},F(_(t)&&_(n)==="json"?v.$t("export.preparing"):v.$t("export.exportJson")),9,jJ),w("button",{type:"button",class:"export-spine-images",disabled:_(t),title:v.$t("export.exportImagesTitle"),onClick:y[1]||(y[1]=(...b)=>_(g)&&_(g)(...b))},F(_(t)&&_(n)==="images"?v.$t("export.organizingImages"):v.$t("export.exportImages")),9,HJ),w("button",{type:"button",class:"export-spine-project",disabled:_(t)||!_(l),title:_(h),onClick:y[2]||(y[2]=(...b)=>_(m)&&_(m)(...b))},[w("span",null,F(_(t)&&_(n)==="spine"?v.$t("export.generatingProject"):v.$t("export.exportSpine")),1),!_(t)&&_(u)?(Q(),te("small",WJ,F(_(u)),1)):xe("",!0)],8,GJ)]),w("div",{class:Pe(["connector-status",_(c)])},[y[5]||(y[5]=w("span",{class:"connector-dot"},null,-1)),Ct(F(_(a))+" ",1),_(d)?(Q(),te("a",{key:0,href:_(d),target:"_blank",rel:"noopener",title:v.$t("export.authorizeTitle")},F(v.$t("export.authorize")),9,qJ)):xe("",!0),w("button",{type:"button",title:v.$t("export.refreshConnector"),onClick:y[3]||(y[3]=(...b)=>_(f)&&_(f)(...b))},F(v.$t("export.refresh")),9,KJ)],2),_(s)?(Q(),te("div",{key:0,class:Pe(["export-message",{error:_(r)}])},[Ct(F(_(s))+" ",1),_(o)?(Q(),te("a",{key:0,href:_(o),target:"_blank",rel:"noopener",onClick:y[4]||(y[4]=b=>o.value="")},F(v.$t("export.authorize")),9,JJ)):xe("",!0)],2)):xe("",!0)],64))}}),QJ=dn(ZJ,[["__scopeId","data-v-33af5045"]]),eZ={class:"group"},tZ={class:"caret"},nZ=["title"],iZ={class:"group-body export-settings"},sZ={class:"export-field"},rZ={class:"export-field"},oZ={class:"export-field"},aZ={value:"linear"},lZ={value:"bezier"},cZ={class:"export-help"},dZ={key:0,class:"export-help"},uZ={class:"export-fps-row"},hZ={class:"export-field export-fps-field"},fZ={class:"export-checkbox"},pZ={class:"export-help"},mZ={class:"export-switches"},gZ={class:"switch-row export-switch"},vZ={class:"switch-row export-switch"},bZ={class:"switch-row export-switch export-switch-last"},yZ={class:"export-resource-actions"},xZ=Zt({__name:"ExportSettingsSection",setup(i){const{exportSettings:e,collapsed:t,toggle:n,sectionOpen:s,resetModule:r,normalizeExportFps:o,select:a}=Tr();return(c,l)=>(Q(),te("div",eZ,[w("div",{class:"group-head",onClick:l[1]||(l[1]=d=>_(n)("export"))},[w("span",tZ,F(_(t).export?"▸":"▾"),1),w("span",null,F(c.$t("export.title")),1),w("button",{class:"group-reset",title:c.$t("export.reset"),onClick:l[0]||(l[0]=We(d=>_(r)("export"),["stop"]))},F(c.$t("common.reset")),9,nZ)]),pe(w("div",iZ,[w("label",sZ,[w("span",null,F(c.$t("export.imagesPath")),1),pe(w("input",{"onUpdate:modelValue":l[2]||(l[2]=d=>_(e).imagesPath=d),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Je,_(e).imagesPath,void 0,{trim:!0}]])]),w("label",rZ,[w("span",null,F(c.$t("export.spineVersion")),1),pe(w("select",{"onUpdate:modelValue":l[3]||(l[3]=d=>_(e).spineVersion=d),class:"inp export-input"},[...l[11]||(l[11]=[xM('',5)])],512),[[_t,_(e).spineVersion]])]),w("label",oZ,[w("span",null,F(c.$t("export.keyframeCurve")),1),pe(w("select",{"onUpdate:modelValue":l[4]||(l[4]=d=>_(e).keyframeCurve=d),class:"inp export-input"},[w("option",aZ,F(c.$t("export.linear")),1),w("option",lZ,F(c.$t("export.smoothBezier")),1)],512),[[_t,_(e).keyframeCurve]])]),w("div",cZ,F(c.$t("export.bezierHelp")),1),_(e).spineVersion==="3.8"?(Q(),te("div",dZ,F(c.$t("export.spine38Help")),1)):xe("",!0),w("div",uZ,[w("label",hZ,[w("span",null,F(c.$t("export.fps")),1),pe(w("input",{"onUpdate:modelValue":l[5]||(l[5]=d=>_(e).fps=d),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:l[6]||(l[6]=(...d)=>_(o)&&_(o)(...d))},null,544),[[Je,_(e).fps,void 0,{number:!0}]])]),w("label",fZ,[pe(w("input",{"onUpdate:modelValue":l[7]||(l[7]=d=>_(e).omitFps=d),type:"checkbox"},null,512),[[vt,_(e).omitFps]]),Ct(F(c.$t("export.omitFps")),1)])]),w("div",pZ,F(c.$t("export.fpsHelp")),1),w("div",mZ,[w("label",gZ,[pe(w("input",{"onUpdate:modelValue":l[8]||(l[8]=d=>_(e).integerFrameAlignment=d),type:"checkbox"},null,512),[[vt,_(e).integerFrameAlignment]]),l[12]||(l[12]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(c.$t("export.integerFrames")),1)]),w("label",vZ,[pe(w("input",{"onUpdate:modelValue":l[9]||(l[9]=d=>_(e).bonePool=d),type:"checkbox"},null,512),[[vt,_(e).bonePool]]),l[13]||(l[13]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(c.$t("export.bonePool")),1)]),w("label",bZ,[pe(w("input",{"onUpdate:modelValue":l[10]||(l[10]=d=>_(e).excludeEmptyAnimations=d),type:"checkbox"},null,512),[[vt,_(e).excludeEmptyAnimations]]),l[14]||(l[14]=w("span",{class:"switch-ui"},null,-1)),w("span",null,F(c.$t("export.excludeEmpty")),1)])]),w("div",yZ,[Ce(QJ)])],512),[[Xt,_(s)("export")]])]))}}),e1=dn(xZ,[["__scopeId","data-v-43ee846c"]]),wZ={class:"panel"},SZ={class:"panel-header"},CZ=["title"],AZ=["data-active-section"],TZ=["data-active-section"],EZ=["data-active-section"],_Z=["data-active-section"],MZ=["data-active-section"],PZ=["data-active-section"],kZ=["data-active-section"],IZ=Zt({__name:"ParticlePanel",setup(i){const{store:e,activeObjectType:t,activeSection:n,sys:s,canUseSection:r}=Tr(),o=Re(null);function a(){n.value=null}const c=Le(()=>{const l=n.value;return!l||!r(l)||l!=="config"&&l!=="scene"&&(t.value!=="particle"||!s.value)?null:l});return Ut(c,async()=>{var l,d;await tl(),(d=(l=o.value)==null?void 0:l.querySelector('[data-active-section="true"]'))==null||d.scrollIntoView({block:"start"})}),(l,d)=>(Q(),te("div",wZ,[w("div",SZ,[w("span",null,F(l.$t("app.title")),1),_(e).settings.floatingMenuEnabled&&_(n)?(Q(),te("button",{key:0,type:"button",class:"panel-collapse",title:l.$t("common.collapse"),onClick:a},F(l.$t("common.collapse")),9,CZ)):xe("",!0)]),w("div",{ref_key:"panelScroll",ref:o,class:"panel-scroll"},[_(e).settings.floatingMenuEnabled?(Q(),te(_e,{key:0},[pe(w("div",{class:"section-detail","data-active-section":c.value==="config"?!0:void 0},[Ce(Hx)],8,AZ),[[Xt,_(n)==="config"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="scene"?!0:void 0},[Ce(Gx)],8,TZ),[[Xt,_(n)==="scene"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="emitMode"||c.value==="shape"?!0:void 0},[Ce(Wx)],8,EZ),[[Xt,c.value==="emitMode"||c.value==="shape"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="attr"?!0:void 0},[Ce(qx)],8,_Z),[[Xt,c.value==="attr"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="look"?!0:void 0},[Ce(Zx)],8,MZ),[[Xt,c.value==="look"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="mods"?!0:void 0},[Ce(Qx)],8,PZ),[[Xt,c.value==="mods"]]),pe(w("div",{class:"section-detail","data-active-section":c.value==="export"?!0:void 0},[Ce(e1)],8,kZ),[[Xt,c.value==="export"]])],64)):(Q(),te(_e,{key:1},[Ce(Hx),Ce(Gx),_(t)==="particle"&&_(s)?(Q(),te(_e,{key:0},[Ce(Wx),Ce(qx),Ce(Zx),Ce(Qx),Ce(e1)],64)):xe("",!0)],64))],512)]))}}),RZ=dn(IZ,[["__scopeId","data-v-01c761d3"]]),fa=i=>Math.max(0,Number(i)||0);function FZ(i,e){const t=Math.max(1,e),n=new Map(i.map(y=>[y.id,y])),s=new Set;for(const y of i)if(y.config.eventEnabled)for(const b of y.config.events||[])b.targetSystemId>0&&b.targetSystemId!==y.id&&n.has(b.targetSystemId)&&s.add(b.targetSystemId);const r=new Map;for(const y of i)if(y.config.eventEnabled)for(const b of y.config.events||[]){if(b.targetSystemId<=0||b.targetSystemId===y.id||!n.has(b.targetSystemId))continue;const x=r.get(b.targetSystemId);x?x.push({parent:y,rule:b}):r.set(b.targetSystemId,[{parent:y,rule:b}])}const o=y=>fa(y.delay),a=y=>fa(y.delay),c=y=>{const b=o(y);return y.mode!=="stream"?b:y.streamBehavior==="loop"?b+Ji(y,t).total/t:b+Math.max(1/t,Number(y.duration)||0)},l=y=>{const b=fa(y.lifeMin),x=fa(y.lifeMax);return y.lifeMode==="fixed"?b:Math.min(b,x)},d=y=>{const b=fa(y.lifeMin),x=fa(y.lifeMax);return y.lifeMode==="fixed"?b:Math.max(b,x)},u=new Map,h=new Map,f=new Set,p=new Set,m=y=>{const b=u.get(y.id);if(b!=null)return b;if(f.has(y.id))return o(y.config);f.add(y.id);let x=1/0;for(const{parent:T,rule:E}of r.get(y.id)||[]){const S=s.has(T.id)?m(T)+a(T.config):o(T.config),C=E.event==="death"?l(T.config):0;x=Math.min(x,S+C)}return Number.isFinite(x)||(x=o(y.config)),f.delete(y.id),u.set(y.id,x),x},g=y=>{const b=h.get(y.id);if(b!=null)return b;if(p.has(y.id))return c(y.config);p.add(y.id);let x=-1/0;for(const{parent:T,rule:E}of r.get(y.id)||[]){const S=s.has(T.id)?g(T)+a(T.config):c(T.config),C=E.event==="birth"?0:d(T.config);x=Math.max(x,S+C)}return Number.isFinite(x)||(x=c(y.config)),p.delete(y.id),h.set(y.id,x),x},v=new Map;for(const y of s){const b=n.get(y);if(!b)continue;const x=m(b),T=g(b);v.set(y,{firstTrigger:x,lastTrigger:T,end:Math.max(x,T)+d(b.config)})}return v}const LZ={class:"timeline"},DZ={class:"tl-controls"},OZ=["title"],NZ=["title"],$Z=["title"],BZ=["title"],UZ=["title"],VZ=["title","aria-label"],XZ={class:"tl-ab-loop"},YZ=["title"],zZ={class:"tl-ab-title"},jZ=["title"],HZ=["max","aria-label","onKeydown"],GZ=["title"],WZ=["min","max","aria-label","onKeydown"],qZ={class:"tl-frame"},KZ={class:"tl-legend"},JZ=["disabled","title"],ZZ={class:"tl-animation-menu-title"},QZ=["onClick"],eQ={key:0},tQ={class:"tl-animation-editor"},nQ=["aria-label"],iQ=["title"],sQ={key:0,class:"tl-animation-error"},rQ={class:"tl-animation-actions"},oQ=["disabled"],aQ={key:1,class:"tl-animation-hint"},lQ={class:"tl-anim tl-spine-preview"},cQ=["value","disabled"],dQ={value:""},uQ=["value"],hQ={class:"tl-zoom"},fQ={class:"tl-ticks"},pQ={class:"tl-ticklabel"},mQ={class:"tl-lanes"},gQ=["onPointerdown"],vQ={class:"lane-name"},bQ=["title","onPointerdown"],yQ=["title","onPointerdown"],xQ=["title","onPointerdown"],wQ={class:"lane-name"},SQ={key:0,class:"tl-empty"},CQ=Zt({__name:"Timeline",setup(i){const e=Zo(),{t}=mi(),n=Re(null),s=Re(0);let r=null;const o=Re(null),a=Re(!1),c=Re("animation"),l=Re("");ma(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const V of e.systems)(!V.animation||!e.timeline.animations.includes(V.animation))&&(V.animation=e.timeline.animations[0])});const d=Le(()=>e.systems.find(V=>V.id===e.activeId)||null);function u(){d.value&&(a.value=!a.value,c.value=d.value.animation,l.value="")}function h(V){const W=d.value;W&&(e.setSystemAnimation(W.id,V),c.value=V,l.value="")}function f(){const V=e.addAnimation();c.value=V,l.value=""}function p(){var ee;const V=((ee=d.value)==null?void 0:ee.animation)||e.timeline.animation,W=c.value.trim();if(!W){l.value=t("timeline.animationNameEmpty");return}if(W!==V&&e.timeline.animations.includes(W)){l.value=t("timeline.animationNameDuplicate");return}if(!e.renameAnimation(V,W)){l.value=t("timeline.animationRenameFailed");return}c.value=W,l.value=""}function m(){var ee,be;const V=((ee=d.value)==null?void 0:ee.animation)||e.timeline.animation;if(!e.removeAnimation(V)){l.value=t("timeline.keepOneAnimation");return}const W=((be=d.value)==null?void 0:be.animation)||e.timeline.animation;c.value=W,l.value=""}function g(V){var W;(W=o.value)!=null&&W.contains(V.target)||(a.value=!1)}Ti(()=>{document.addEventListener("pointerdown",g);const V=n.value;V&&(s.value=V.clientWidth,r=new ResizeObserver(([W])=>{s.value=Math.max(1,W.contentRect.width)}),r.observe(V))}),Ar(()=>{document.removeEventListener("pointerdown",g),r==null||r.disconnect(),r=null});const v=Le(()=>Math.max(1,e.timeline.fps||30)),y=Re(Math.max(120,e.timeline.totalFrames)),b=Re({}),x=Re({}),T=Re({}),E=Re({}),S=Re(String(e.timeline.playbackStart)),C=Re(String(e.timeline.playbackEnd));Ut(()=>e.timeline.playbackStart,V=>{S.value=String(V)}),Ut(()=>e.timeline.playbackEnd,V=>{C.value=String(V)});const M=Le(()=>e.timeline.totalFrames);Ut(M,V=>{V>y.value&&(y.value=Math.min(2e3,V))});const k=Le(()=>y.value<=30?t("timeline.zoomIn"):y.value>=300?t("timeline.zoomOut"):t("timeline.zoomFit")),P=Le(()=>e.spines.filter(V=>V.selectedAnimation&&V.animations.some(W=>W.name===V.selectedAnimation&&W.duration>0))),I=Le(()=>(e.activeObjectType==="spine"?e.spines.find(W=>W.id===e.activeObjectId&&W.animations.length):null)||e.spines.find(W=>W.animations.length)||null);function N(V){const W=I.value;W&&(W.selectedAnimation=V.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function $(){e.setPlaybackStart(Number(S.value)),S.value=String(e.timeline.playbackStart)}function j(){e.setPlaybackEnd(Number(C.value)),C.value=String(e.timeline.playbackEnd)}function B(){var W;const V=s.value||((W=n.value)==null?void 0:W.clientWidth)||600;return y.value/V}const Y=Le(()=>{const V=[],W=y.value;let ee=1;y.value<=10?ee=1:y.value<=50?ee=5:y.value<=200?ee=10:y.value<=500?ee=50:ee=100;for(let be=0;be<=W;be+=ee)V.push({f:be,px:be/B()});return V}),U=Le(()=>e.timeline.frame/B()),D=Le(()=>ja(e.systems)),L=Le(()=>FZ(e.systems,v.value));function R(V){return D.value.has(V.id)}function X(V){var ee;return(R(V)?((ee=L.value.get(V.id))==null?void 0:ee.firstTrigger)??0:0)*v.value/B()+4}function z(V){var be;const W=V.config;if(R(V)){const ye=((be=L.value.get(V.id))==null?void 0:be.firstTrigger)??0,he=b.value[V.id]??Math.max(0,Number(W.delay)||0);return(ye+he)*v.value/B()}return(b.value[V.id]??Math.max(0,Number(W.delay)||0))*v.value/B()}function K(V){const W=V.config,ee=Math.max(0,Number(W.lifeMin)||0),be=Math.max(0,Number(W.lifeMax)||0);return W.lifeMode==="fixed"?ee:Math.max(ee,be)}function Z(V){if(R(V)){const W=L.value.get(V.id),ee=(W==null?void 0:W.firstTrigger)??0,be=(W==null?void 0:W.end)??ee;return Math.max(0,be-ee)*v.value/B()}return ce(V)}function ae(V){if(R(V)||V.config.mode!=="stream")return 0;if(V.config.streamBehavior==="loop"){const ee=V.config;return(T.value[V.id]??Ji(ee,v.value).loop)/B()}return(x.value[V.id]??Math.max(1/v.value,Number(V.config.duration)||1))*v.value/B()}function ce(V){if(R(V))return Z(V);const W=V.config;return W.mode==="stream"&&W.streamBehavior==="loop"?we(V)+ae(V)+re(V):ae(V)+K(V)*v.value/B()}function ve(V){const W=V.config;return W.mode==="stream"&&W.streamBehavior==="loop"}function we(V){return ve(V)?Ji(V.config,v.value).start/B():0}function re(V){return ve(V)?Ji(V.config,v.value).end/B():0}function Ee(V){var W;return((W=V.animations.find(ee=>ee.name===V.selectedAnimation))==null?void 0:W.duration)||0}function q(V){return(E.value[V.id]??Math.max(0,Number(V.timeOffset)||0))*v.value/B()}function J(V){return Ee(V)*v.value/B()}function ie(V){const W=V.deltaY<0?.8:1.25;let ee=y.value*W;ee=Math.min(2e3,Math.max(10,ee)),y.value=Math.round(ee)}function se(V){const W=n.value;e.pause();const ee=ye=>{const he=W.getBoundingClientRect(),Be=Math.floor((ye.clientX-he.left)/he.width*y.value);e.timeline.frame=Math.max(0,Math.min(Be,M.value-1))};ee(V);const be=()=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",be)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",be)}function G(V,W){V.stopPropagation();const ee=V.clientX,be=Math.max(0,Number(W.config.delay)||0),ye=B()/v.value,he=ge=>{const Ve=(ge.clientX-ee)*ye,qe=Math.max(0,Math.min(be+Ve,600));b.value[W.id]=Math.round(qe*v.value)/v.value},Be=ge=>{window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",Ae),window.removeEventListener("pointercancel",de);const Ve=b.value[W.id];delete b.value[W.id],ge&&Ve!=null&&Ve!==be&&(W.config.delay=Ve)},Ae=()=>Be(!0),de=()=>Be(!1);window.addEventListener("pointermove",he),window.addEventListener("pointerup",Ae),window.addEventListener("pointercancel",de)}function H(V,W){var ft;V.stopPropagation();const ee=ve(W),be=Math.max(0,Number(W.config.duration)||0),ye=Ji(W.config,v.value).loop,he=B()/v.value,Be=((ft=V.currentTarget.closest(".lane-bar"))==null?void 0:ft.getBoundingClientRect().left)??V.clientX,Ae=we(W);let de=!1;const ge=Oe=>{if(de=!0,ee){const ot=Math.min(1800,Math.max(1,Math.round((Oe.clientX-Be-Ae)/B())));T.value[W.id]=ot}else{const ot=Math.max(1/v.value,Math.min((Oe.clientX-Be)*he,600));x.value[W.id]=Math.round(ot*v.value)/v.value}},Ve=Oe=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",qe),window.removeEventListener("pointercancel",bt);const ot=x.value[W.id],Te=T.value[W.id];delete x.value[W.id],delete T.value[W.id],Oe&&de&&ee&&Te!=null&&Te!==ye?W.config.loopDurationFrames=Te:Oe&&de&&!ee&&ot!=null&&ot!==be&&(W.config.duration=ot)},qe=()=>Ve(!0),bt=()=>Ve(!1);window.addEventListener("pointermove",ge),window.addEventListener("pointerup",qe),window.addEventListener("pointercancel",bt)}function O(V,W){V.stopPropagation();const ee=V.clientX,be=Math.max(0,Number(W.timeOffset)||0),ye=B()/v.value,he=ge=>{const Ve=Math.max(0,Math.min(be+(ge.clientX-ee)*ye,600));E.value[W.id]=Math.round(Ve*v.value)/v.value},Be=ge=>{window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",Ae),window.removeEventListener("pointercancel",de);const Ve=E.value[W.id];delete E.value[W.id],ge&&Ve!=null&&Ve!==be&&(W.timeOffset=Ve,e.recalcTotalFrames())},Ae=()=>Be(!0),de=()=>Be(!1);window.addEventListener("pointermove",he),window.addEventListener("pointerup",Ae),window.addEventListener("pointercancel",de)}return(V,W)=>{var ee,be,ye;return Q(),te("div",LZ,[(Q(),kt(Qu,{defer:"",to:"#timeline-controls-host"},[w("div",DZ,[w("button",{class:Pe(["tl-btn",{on:_(e).timeline.playing}]),onClick:W[0]||(W[0]=he=>_(e).togglePlay()),title:_(e).timeline.playing?V.$t("timeline.pause"):V.$t("timeline.play")},F(_(e).timeline.playing?"❚❚":"▶"),11,OZ),w("button",{class:"tl-btn",onClick:W[1]||(W[1]=he=>_(e).toStart()),title:V.$t("timeline.toStart")},"⏮",8,NZ),w("button",{class:"tl-btn",onClick:W[2]||(W[2]=he=>_(e).previousFrame()),title:V.$t("timeline.previous")},"◀",8,$Z),w("button",{class:"tl-btn",onClick:W[3]||(W[3]=he=>_(e).nextFrame()),title:V.$t("timeline.next")},"▶",8,BZ),w("button",{class:"tl-btn",onClick:W[4]||(W[4]=he=>_(e).toEnd()),title:V.$t("timeline.toEnd")},"⏭",8,UZ),w("button",{class:Pe(["tl-btn",{on:_(e).timeline.loop}]),title:V.$t("timeline.continuousLoop"),"aria-label":V.$t("timeline.continuousLoop"),onClick:W[5]||(W[5]=he=>_(e).toggleLoop())},"⟳",10,VZ),w("div",XZ,[w("button",{class:Pe(["tl-ab-toggle",{on:_(e).timeline.abLoop}]),title:V.$t("timeline.abLoop"),onClick:W[6]||(W[6]=he=>_(e).toggleABLoop())},[w("span",null,F(V.$t("timeline.abLoopShort")),1),W[12]||(W[12]=w("i",{class:"tl-switch"},[w("b")],-1))],10,YZ),_(e).timeline.abLoop?(Q(),te("div",{key:0,class:"tl-ab-popover",onPointerdown:W[9]||(W[9]=We(()=>{},["stop"]))},[w("div",zZ,F(V.$t("timeline.abRange")),1),w("label",{class:"tl-range",title:V.$t("timeline.playbackStart")},[W[13]||(W[13]=w("span",null,"A",-1)),pe(w("input",{"onUpdate:modelValue":W[7]||(W[7]=he=>S.value=he),type:"number",min:"0",max:Math.max(0,_(e).timeline.playbackEnd-1),"aria-label":V.$t("timeline.startFrame"),onChange:$,onKeydown:es(We($,["prevent"]),["enter"])},null,40,HZ),[[Je,S.value]])],8,jZ),w("label",{class:"tl-range",title:V.$t("timeline.playbackEnd")},[W[14]||(W[14]=w("span",null,"B",-1)),pe(w("input",{"onUpdate:modelValue":W[8]||(W[8]=he=>C.value=he),type:"number",min:_(e).timeline.playbackStart+1,max:Math.max(1,_(e).timeline.totalFrames-1),"aria-label":V.$t("timeline.endFrame"),onChange:j,onKeydown:es(We(j,["prevent"]),["enter"])},null,40,WZ),[[Je,C.value]])],8,GZ)],32)):xe("",!0)]),w("span",qZ,F(V.$t("timeline.frameStatus",{current:_(e).timeline.frame,total:Math.max(0,_(e).timeline.totalFrames-1)})),1),w("span",KZ,[W[15]||(W[15]=w("i",{class:"legend-emission"},null,-1)),Ct(F(V.$t("timeline.emission"))+" ",1),W[16]||(W[16]=w("i",{class:"legend-life"},null,-1)),Ct(F(V.$t("timeline.particleLife"))+" ",1),W[17]||(W[17]=w("i",{class:"legend-spine"},null,-1)),Ct(F(V.$t("timeline.spineAnimation")),1)]),w("div",{ref_key:"animationMenuRef",ref:o,class:"tl-anim tl-owner-animation"},[w("span",null,F(V.$t("timeline.ownerAnimation")),1),w("button",{class:"tl-animation-trigger",disabled:!d.value,title:V.$t("timeline.setOwnerAnimation"),onClick:We(u,["stop"])},[w("span",null,F(((ee=d.value)==null?void 0:ee.animation)||_(e).timeline.animation),1),W[18]||(W[18]=w("i",null,"⌄",-1))],8,JZ),a.value?(Q(),te("div",{key:0,class:"tl-animation-menu",onPointerdown:W[11]||(W[11]=We(()=>{},["stop"]))},[w("div",ZZ,F(V.$t("timeline.chooseOwnerAnimation")),1),(Q(!0),te(_e,null,Mt(_(e).timeline.animations,he=>{var Be,Ae;return Q(),te("button",{key:he,class:Pe(["tl-animation-option",{on:((Be=d.value)==null?void 0:Be.animation)===he}]),onClick:de=>h(he)},[w("span",null,F(he),1),((Ae=d.value)==null?void 0:Ae.animation)===he?(Q(),te("i",eQ,"✓")):xe("",!0)],10,QZ)}),128)),w("div",tQ,[pe(w("input",{"onUpdate:modelValue":W[10]||(W[10]=he=>c.value=he),class:"tl-animation-name",maxlength:"64","aria-label":V.$t("timeline.animationName"),onKeydown:es(p,["enter"])},null,40,nQ),[[Je,c.value]]),w("button",{title:V.$t("timeline.renameAnimation"),onClick:p},F(V.$t("timeline.rename")),9,iQ)]),l.value?(Q(),te("div",sQ,F(l.value),1)):xe("",!0),w("div",rQ,[w("button",{onClick:f},F(V.$t("timeline.newAnimation")),1),w("button",{disabled:_(e).timeline.animations.length<=1,onClick:m},F(V.$t("common.delete")),9,oQ)]),_(e).timeline.animations.length<=1?(Q(),te("div",aQ,F(V.$t("timeline.keepOneAnimation")),1)):xe("",!0)],32)):xe("",!0)],512),w("label",lQ,[Ct(F(V.$t("timeline.spinePreview"))+" ",1),w("select",{class:"tl-sel",value:((be=I.value)==null?void 0:be.selectedAnimation)||"",disabled:!I.value,onChange:N},[w("option",dQ,F(I.value?V.$t("timeline.none"):V.$t("timeline.noSpineAnimation")),1),(Q(!0),te(_e,null,Mt(((ye=I.value)==null?void 0:ye.animations)||[],he=>(Q(),te("option",{key:he.name,value:he.name},F(he.name)+"("+F(he.duration.toFixed(2))+"s) ",9,uQ))),128))],40,cQ)]),w("span",hQ,F(k.value),1)])])),w("div",{class:"tl-viewport",ref_key:"vpRef",ref:n,onWheel:We(ie,["prevent"]),onPointerdown:se},[w("div",fQ,[(Q(!0),te(_e,null,Mt(Y.value,he=>(Q(),te("div",{key:he.f,class:"tl-tickline",style:zt({left:he.px+"px"})},[w("span",pQ,F(he.f)+"f",1)],4))),128))]),w("div",{class:"tl-playhead",style:zt({left:U.value+"px"})},null,4),w("div",mQ,[(Q(!0),te(_e,null,Mt(_(e).systems,(he,Be)=>(Q(),te("div",{key:he.id,class:"tl-lane"},[w("span",{class:Pe(["lane-ico",{"sub-lane-ico":R(he)}]),style:zt({left:X(he)+"px"})},"●",6),w("div",{class:Pe(["lane-bar",{"sub-emitter-bar":R(he)}]),style:zt({left:z(he)+"px",width:Z(he)+"px"}),onPointerdown:We(Ae=>G(Ae,he),["stop"])},[w("span",vQ,F(he.config.name||V.$t("timeline.systemName",{index:Be+1})),1),w("span",{class:Pe(["bar-life",{"loop-life":!R(he)&&ve(he)}]),style:zt({width:ce(he)+"px"})},null,6),!R(he)&&ve(he)?(Q(),te(_e,{key:0},[we(he)?(Q(),te("span",{key:0,class:"bar-loop-transition bar-loop-start",style:zt({width:we(he)+"px"})},null,4)):xe("",!0),w("span",{class:"bar-emission bar-loop",style:zt({left:we(he)+"px",width:ae(he)+"px"})},[w("span",{class:"bar-handle",title:V.$t("timeline.dragLoopDuration"),onPointerdown:We(Ae=>H(Ae,he),["stop"])},null,40,bQ)],4),re(he)?(Q(),te("span",{key:1,class:"bar-loop-transition bar-loop-end",style:zt({left:we(he)+ae(he)+"px",width:re(he)+"px"})},null,4)):xe("",!0)],64)):!R(he)&&he.config.mode==="stream"?(Q(),te("span",{key:1,class:"bar-emission",style:zt({width:ae(he)+"px"})},[w("span",{class:"bar-handle",title:V.$t("timeline.dragEmissionDuration"),onPointerdown:We(Ae=>H(Ae,he),["stop"])},null,40,yQ)],4)):xe("",!0)],46,gQ)]))),128)),(Q(!0),te(_e,null,Mt(P.value,he=>(Q(),te("div",{key:`spine-${he.id}`,class:"tl-lane spine-lane"},[W[19]||(W[19]=w("span",{class:"lane-ico spine-ico"},"◆",-1)),w("div",{class:"spine-bar",style:zt({left:q(he)+"px",width:J(he)+"px"}),title:V.$t("timeline.dragSpineStart"),onPointerdown:We(Be=>O(Be,he),["stop"])},[w("span",wQ,F(he.name)+" · "+F(he.selectedAnimation),1)],44,xQ)]))),128)),!_(e).systems.length&&!P.value.length?(Q(),te("div",SQ,F(V.$t("timeline.noAnimationData")),1)):xe("",!0)])],544)])}}}),AQ=dn(CQ,[["__scopeId","data-v-d8a5c3cb"]]),TQ={class:"transfer-heading"},EQ={key:0},_Q={class:"transfer-detail"},MQ=Zt({__name:"TransferProgressOverlay",setup(i){const e=Re(null);return Ut(()=>hn.visible,async t=>{var n;t&&(await tl(),(n=e.value)==null||n.focus({preventScroll:!0}))},{flush:"post"}),(t,n)=>(Q(),kt(OM,{name:"transfer-fade"},{default:Ju(()=>[_(hn).visible?(Q(),te("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:n[0]||(n[0]=We(()=>{},["stop","prevent"])),onPointerup:n[1]||(n[1]=We(()=>{},["stop","prevent"])),onClick:n[2]||(n[2]=We(()=>{},["stop","prevent"])),onDblclick:n[3]||(n[3]=We(()=>{},["stop","prevent"])),onContextmenu:n[4]||(n[4]=We(()=>{},["stop","prevent"])),onWheel:n[5]||(n[5]=We(()=>{},["stop","prevent"])),onKeydown:n[6]||(n[6]=We(()=>{},["stop","prevent"]))},[w("div",{class:Pe(["transfer-dialog",{failed:_(hn).failed}])},[w("div",TQ,[w("span",null,F(_(hn).title),1),_(hn).indeterminate?xe("",!0):(Q(),te("strong",EQ,F(Math.round(_(hn).progress))+"%",1))]),w("div",{class:Pe(["transfer-track",{indeterminate:_(hn).indeterminate}])},[w("div",{class:"transfer-bar",style:zt(_(hn).indeterminate?void 0:{width:`${_(hn).progress}%`})},null,4)],2),w("div",_Q,F(_(hn).detail),1)],2)],544)):xe("",!0)]),_:1}))}}),PQ=dn(MQ,[["__scopeId","data-v-592b922e"]]),kQ=["inert","aria-hidden"],IQ={class:"right"},RQ={class:"stage-area"},FQ=["aria-label"],LQ=["disabled","aria-selected","title","onClick"],DQ={class:"floating-section-index"},OQ={class:"floating-section-label"},NQ=["title"],$Q=Zt({__name:"App",setup(i){const e=Zo();g3(e);const{activeSection:t,activateSection:n,canUseSection:s}=kY(),r=Le(()=>!e.settings.floatingMenuEnabled||t.value!==null),o=Re(360),a=Re(180);function c(d){d.preventDefault();const u=f=>{const p=e.settings.parameterPanelOnRight?window.innerWidth-f.clientX:f.clientX,m=Math.max(240,Math.min(p,window.innerWidth-200));o.value=m},h=()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",u),window.addEventListener("pointerup",h)}function l(d){d.preventDefault();const u=d.clientY,h=a.value,f=m=>{const g=Math.max(80,Math.min(h+(u-m.clientY),window.innerHeight-200));a.value=g},p=()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",p)}return(d,u)=>(Q(),te(_e,null,[w("div",{class:Pe(["layout",{"panel-right":_(e).settings.parameterPanelOnRight}]),inert:_(hn).visible?!0:void 0,"aria-hidden":_(hn).visible?"true":void 0},[pe(w("div",{class:"parameter-panel",style:zt({width:o.value+"px"})},[Ce(RZ)],4),[[Xt,r.value]]),pe(w("div",{class:"resizer-col",onPointerdown:c},null,544),[[Xt,r.value]]),w("div",IQ,[w("div",RQ,[Ce(TV),_(e).settings.floatingMenuEnabled?(Q(),te("nav",{key:0,class:Pe(["floating-section-nav",{"nav-left":!_(e).settings.parameterPanelOnRight}]),role:"tablist","aria-label":d.$t("settings.floatingMenu")},[(Q(!0),te(_e,null,Mt(_(eE),(h,f)=>(Q(),te("button",{key:h.key,type:"button",role:"tab",class:Pe(["floating-section-tab",{selected:_(t)===h.key&&_(s)(h.key)}]),disabled:!_(s)(h.key),"aria-selected":_(t)===h.key&&_(s)(h.key),title:_(s)(h.key)?d.$t(h.titleKey):d.$t("settings.floatingMenuParticleOnly"),onClick:p=>_(n)(h.key)},[w("span",DQ,F(f+1),1),w("span",OQ,F(d.$t(h.titleKey)),1)],10,LQ))),128))],10,FQ)):xe("",!0)]),w("div",{class:"resizer-row",onPointerdown:l,title:d.$t("app.resizeTimeline")},null,40,NQ),w("div",{class:"timeline-area",style:zt({height:a.value+"px"})},[Ce(AQ)],4)])],10,kQ),Ce(PQ)],64))}}),BQ=dn($Q,[["__scopeId","data-v-f71cd31c"]]);dP(BQ).use(fP()).use(pc).mount("#app");export{Ux as $,Is as A,Ou as B,Ot as C,Mn as D,$e as E,ai as F,Ns as G,at as H,Pt as I,zT as J,ti as K,Ei as L,Bi as M,so as N,Th as O,ks as P,oc as Q,Ka as R,Ki as S,lX as T,Ze as U,Lx as V,ts as W,mte as X,rY as Y,bc as Z,jg as _,tt as a,tg as a$,Bx as a0,CT as a1,uv as a2,fte as a3,Ru as a4,Yl as a5,bX as a6,zl as a7,Eh as a8,Jm as a9,cg as aA,dg as aB,Cd as aC,Ur as aD,Bd as aE,Zm as aF,_T as aG,an as aH,xT as aI,rte as aJ,Va as aK,$x as aL,Fe as aM,Ge as aN,eg as aO,Ud as aP,IT as aQ,Qm as aR,PT as aS,kT as aT,_h as aU,LT as aV,Vd as aW,NT as aX,RT as aY,DT as aZ,$T as a_,ta as aa,hv as ab,fv as ac,Ox as ad,Pc as ae,kc as af,Mc as ag,ea as ah,lr as ai,ate as aj,ET as ak,vX as al,Za as am,eo as an,gv as ao,YT as ap,mX as aq,vc as ar,ui as as,Nx as at,dte as au,rl as av,lg as aw,ug as ax,hg as ay,fg as az,Wa as b,Sr as b$,Du as b0,FT as b1,uo as b2,OT as b3,pv as b4,aX as b5,VT as b6,XT as b7,mv as b8,Os as b9,BT as bA,vv as bB,Ah as bC,jT as bD,ng as bE,En as bF,rX as bG,dX as bH,cT as bI,lT as bJ,lte as bK,Gt as bL,ol as bM,HT as bN,qT as bO,KT as bP,JT as bQ,GT as bR,WT as bS,pX as bT,bv as bU,Lt as bV,ag as bW,MT as bX,uT as bY,hT as bZ,fT as b_,oX as ba,ote as bb,rt as bc,TT as bd,AT as be,wT as bf,ST as bg,Yo as bh,Fu as bi,gX as bj,pT as bk,mT as bl,ri as bm,gT as bn,Ja as bo,Nn as bp,dT as bq,Lu as br,vT as bs,bT as bt,yT as bu,Vx as bv,rg as bw,Io as bx,UT as by,sg as bz,qa as c,cte as c0,hX as c1,fX as c2,uX as c3,Qe as d,He as e,ute as f,st as g,Fn as h,lu as i,fi as j,Kt as k,je as l,ss as m,Yt as n,$g as o,pn as p,ac as q,Nr as r,Xe as s,Yw as t,zg as u,fu as v,ig as w,Po as x,Dx as y,og as z}; diff --git a/dist/assets/index-B57-mKhk.js b/dist/assets/index-DbHSUVPi.js similarity index 99% rename from dist/assets/index-B57-mKhk.js rename to dist/assets/index-DbHSUVPi.js index bc547d7..5b35f38 100644 --- a/dist/assets/index-B57-mKhk.js +++ b/dist/assets/index-DbHSUVPi.js @@ -1,4 +1,4 @@ -var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-C2X4Q0zX.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-C2X4Q0zX.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-BGsgtkNi.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-BGsgtkNi.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` +var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-DaC3oTyd.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-DaC3oTyd.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-D87AMfy0.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-D87AMfy0.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; diff --git a/dist/index.html b/dist/index.html index ad5421f..898637d 100644 --- a/dist/index.html +++ b/dist/index.html @@ -9,7 +9,7 @@ html, body { margin: 0; padding: 0; background: #111; color: #eee; font-family: system-ui, -apple-system, sans-serif; } #app { display: flex; flex-direction: column; height: 100vh; } - + diff --git a/scripts/verify-render-layer.mjs b/scripts/verify-render-layer.mjs index a1162f8..356281d 100644 --- a/scripts/verify-render-layer.mjs +++ b/scripts/verify-render-layer.mjs @@ -14,6 +14,7 @@ const { resolveRenderTarget } = await import( const spines = [{ id: 7, enabled: true, + visible: true, status: 'ready', slots: [ { name: 'slot_back', order: 0 }, @@ -68,6 +69,7 @@ expect( ) expect(resolveRenderTarget(spines, { ...base, renderLayerSlotName: 'missing' }), null, '插槽不存在时应回退') expect(resolveRenderTarget([{ ...spines[0], enabled: false }], base), null, 'Spine 停用时应回退') +expect(resolveRenderTarget([{ ...spines[0], visible: false }], base), null, 'Spine 隐藏时应回退且不影响粒子可见性') expect(resolveRenderTarget([{ ...spines[0], status: 'loading' }], base), null, 'Spine 未就绪时应回退') -console.log('渲染层级解析校验通过:最上层 / 插槽之上 / 插槽之下 / 动画 drawOrder / 失效回退') +console.log('渲染层级解析校验通过:最上层 / 插槽之上 / 插槽之下 / 动画 drawOrder / 隐藏与失效回退') diff --git a/src/views/stage/renderLayer.ts b/src/views/stage/renderLayer.ts index 34a6eeb..109ef44 100644 --- a/src/views/stage/renderLayer.ts +++ b/src/views/stage/renderLayer.ts @@ -15,6 +15,7 @@ export interface RenderLayerSlot { export interface RenderLayerSpine { id: number enabled: boolean + visible: boolean status: string slots?: RenderLayerSlot[] } @@ -40,7 +41,13 @@ export function resolveRenderTarget( drawOrder?: readonly string[] | null, ): RenderTarget | null { if (config.renderLayerMode !== 'slot') return null - const spine = spines.find((item) => item.id === config.renderLayerSpineId && item.enabled && item.status === 'ready') + // 隐藏 Spine 时回退到 world 层,粒子不随插槽容器隐藏;重新显示后再恢复原渲染层级。 + const spine = spines.find((item) => + item.id === config.renderLayerSpineId + && item.enabled + && item.visible !== false + && item.status === 'ready', + ) if (!spine) return null const slots = spine.slots || [] const target = slots.find((slot) => slot.name === config.renderLayerSlotName)