reacthub-pixitweenjs 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/components/AepComposition/AepComposition.d.ts +2 -0
  2. package/dist/components/AepComposition/index.d.ts +2 -1
  3. package/dist/components/AepComposition/model3d/animation.d.ts +21 -0
  4. package/dist/components/AepComposition/model3d/index.d.ts +2 -0
  5. package/dist/components/AepComposition/model3d/threeUtils.d.ts +15 -0
  6. package/dist/components/AepComposition/model3d/toon.d.ts +26 -0
  7. package/dist/components/AepComposition/stage3d/AepStageLayoutContext.d.ts +21 -0
  8. package/dist/components/AepComposition/stage3d/Pixi3DStageLayer.d.ts +11 -0
  9. package/dist/components/AepComposition/stage3d/StageRuntime.d.ts +66 -0
  10. package/dist/components/AepComposition/stage3d/buildWorld.d.ts +52 -0
  11. package/dist/components/AepComposition/stage3d/clipBinding.d.ts +29 -0
  12. package/dist/components/AepComposition/stage3d/convert.d.ts +9 -0
  13. package/dist/components/AepComposition/stage3d/index.d.ts +14 -0
  14. package/dist/components/AepComposition/stage3d/layout.d.ts +16 -0
  15. package/dist/components/AepComposition/stage3d/members/actor3d.d.ts +10 -0
  16. package/dist/components/AepComposition/stage3d/members/normalize.d.ts +19 -0
  17. package/dist/components/AepComposition/stage3d/members/prop3d.d.ts +3 -0
  18. package/dist/components/AepComposition/stage3d/members/registry.d.ts +9 -0
  19. package/dist/components/AepComposition/stage3d/members/types.d.ts +43 -0
  20. package/dist/components/AepComposition/stage3d/reconcile.d.ts +22 -0
  21. package/dist/components/AepComposition/stage3d/sampleStage3D.d.ts +75 -0
  22. package/dist/components/AepComposition/stage3d/style.d.ts +21 -0
  23. package/dist/components/AepComposition/useAepLayerTransform.d.ts +2 -2
  24. package/dist/components/AepComposition/useResolveAsset.d.ts +1 -0
  25. package/dist/importers/aep/index.d.ts +1 -0
  26. package/dist/importers/aep/stageLint.d.ts +3 -0
  27. package/dist/index.es.js +10871 -9480
  28. package/dist/index.umd.js +73 -70
  29. package/dist/types/aep/composition.d.ts +2 -1
  30. package/dist/types/aep/index.d.ts +1 -0
  31. package/dist/types/aep/layer.d.ts +10557 -4046
  32. package/dist/types/aep/stage3d.d.ts +18 -0
  33. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(_,Ir){typeof exports=="object"&&typeof module<"u"?Ir(exports,require("pixi.js/gif"),require("@pixi/react"),require("pixi.js"),require("react"),require("gsap"),require("gsap/CustomEase"),require("gsap/PixiPlugin"),require("pixi-filters"),require("audiomotion-analyzer"),require("@react-three/fiber"),require("three"),require("three/examples/jsm/loaders/GLTFLoader.js"),require("gl-transitions"),require("lottie-web"),require("three/examples/jsm/environments/RoomEnvironment.js"),require("@react-three/postprocessing"),require("@react-three/drei")):typeof define=="function"&&define.amd?define(["exports","pixi.js/gif","@pixi/react","pixi.js","react","gsap","gsap/CustomEase","gsap/PixiPlugin","pixi-filters","audiomotion-analyzer","@react-three/fiber","three","three/examples/jsm/loaders/GLTFLoader.js","gl-transitions","lottie-web","three/examples/jsm/environments/RoomEnvironment.js","@react-three/postprocessing","@react-three/drei"],Ir):(_=typeof globalThis<"u"?globalThis:_||self,Ir(_["reacthub-pixitweenjs"]={},_.PIXI.gif,_.PIXIReact,_.PIXI,_.React,_.gsap,_.CustomEase,_.PixiPlugin,_.PIXI.filters,_.AudioMotionAnalyzer,_.ReactThreeFiber,_.THREE,_.GLTFLoader,_.glTransitions,_.lottie,_.RoomEnvironment,_.ReactThreePostprocessing,_.Drei))})(this,(function(_,Ir,at,B,S,E,wn,Kn,Zn,eE,is,qd,Vd,os,tE,nE,$n,Kd){"use strict";function Mi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const W=Mi(B),I=Mi(S),ne=Mi(Zn),V=Mi(qd);var He=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGLLoader="webgl-loader",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.WebGPULoader="webgpu-loader",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.CanvasLoader="canvas-loader",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.TextureUploaderWebGL="texture-uploader-webgl",t.TextureUploaderWebGPU="texture-uploader-webgpu",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(He||{});const ss=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Li=(t,e)=>ss(t).priority??e,rE={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(ss).forEach(e=>{e.type.forEach(n=>this._removeHandlers[n]?.(e))}),this},add(...t){return t.map(ss).forEach(e=>{e.type.forEach(n=>{const r=this._addHandlers,i=this._queue;r[n]?r[n]?.(e):(i[n]=i[n]||[],i[n]?.push(e))})}),this},handle(t,e,n){const r=this._addHandlers,i=this._removeHandlers;if(r[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);r[t]=e,i[t]=n;const o=this._queue;return o[t]&&(o[t]?.forEach(s=>e(s)),delete o[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,r=>{e.findIndex(o=>o.name===r.name)>=0||(e.push({name:r.name,value:r.ref}),e.sort((o,s)=>Li(s.value,n)-Li(o.value,n)))},r=>{const i=e.findIndex(o=>o.name===r.name);i!==-1&&e.splice(i,1)})},handleByList(t,e,n=-1){return this.handle(t,r=>{e.includes(r.ref)||(e.push(r.ref),e.sort((i,o)=>Li(o,n)-Li(i,n)))},r=>{const i=e.indexOf(r.ref);i!==-1&&e.splice(i,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},as=Object.create(null),Zd=Object.create(null);function Pi(t,e){let n=Zd[t];return n===void 0&&(as[e]===void 0&&(as[e]=1),Zd[t]=n=as[e]++),n}let $d={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};const iE={get(){return $d},set(t){$d=t}};let Ni;function oE(){return(!Ni||Ni?.isContextLost())&&(Ni=iE.get().createCanvas().getContext("webgl",{})),Ni}let ki;function sE(){if(!ki){ki="mediump";const t=oE();t&&t.getShaderPrecisionFormat&&(ki=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return ki}function aE(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
1
+ (function(b,Yr){typeof exports=="object"&&typeof module<"u"?Yr(exports,require("pixi.js/gif"),require("@pixi/react"),require("pixi.js"),require("react"),require("gsap"),require("gsap/CustomEase"),require("gsap/PixiPlugin"),require("pixi-filters"),require("audiomotion-analyzer"),require("@react-three/fiber"),require("three"),require("three/examples/jsm/loaders/GLTFLoader.js"),require("gl-transitions"),require("lottie-web"),require("three/examples/jsm/environments/RoomEnvironment.js"),require("three/examples/jsm/utils/BufferGeometryUtils.js"),require("three/examples/jsm/utils/SkeletonUtils.js"),require("@react-three/postprocessing"),require("@react-three/drei")):typeof define=="function"&&define.amd?define(["exports","pixi.js/gif","@pixi/react","pixi.js","react","gsap","gsap/CustomEase","gsap/PixiPlugin","pixi-filters","audiomotion-analyzer","@react-three/fiber","three","three/examples/jsm/loaders/GLTFLoader.js","gl-transitions","lottie-web","three/examples/jsm/environments/RoomEnvironment.js","three/examples/jsm/utils/BufferGeometryUtils.js","three/examples/jsm/utils/SkeletonUtils.js","@react-three/postprocessing","@react-three/drei"],Yr):(b=typeof globalThis<"u"?globalThis:b||self,Yr(b["reacthub-pixitweenjs"]={},b.PIXI.gif,b.PIXIReact,b.PIXI,b.React,b.gsap,b.CustomEase,b.PixiPlugin,b.PIXI.filters,b.AudioMotionAnalyzer,b.ReactThreeFiber,b.THREE,b.GLTFLoader,b.glTransitions,b.lottie,b.RoomEnvironment,b.BufferGeometryUtils_js,b.SkeletonUtils_js,b.ReactThreePostprocessing,b.Drei))})(this,(function(b,Yr,st,G,O,S,Dn,sr,ar,pS,As,Lh,Os,Ms,mS,gS,yS,_S,cr,kh){"use strict";function qi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const K=qi(G),I=qi(O),oe=qi(ar),B=qi(Lh);var qe=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGLLoader="webgl-loader",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.WebGPULoader="webgpu-loader",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.CanvasLoader="canvas-loader",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.TextureUploaderWebGL="texture-uploader-webgl",t.TextureUploaderWebGPU="texture-uploader-webgpu",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(qe||{});const Is=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Vi=(t,e)=>Is(t).priority??e,bS={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Is).forEach(e=>{e.type.forEach(n=>this._removeHandlers[n]?.(e))}),this},add(...t){return t.map(Is).forEach(e=>{e.type.forEach(n=>{const r=this._addHandlers,i=this._queue;r[n]?r[n]?.(e):(i[n]=i[n]||[],i[n]?.push(e))})}),this},handle(t,e,n){const r=this._addHandlers,i=this._removeHandlers;if(r[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);r[t]=e,i[t]=n;const o=this._queue;return o[t]&&(o[t]?.forEach(s=>e(s)),delete o[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,r=>{e.findIndex(o=>o.name===r.name)>=0||(e.push({name:r.name,value:r.ref}),e.sort((o,s)=>Vi(s.value,n)-Vi(o.value,n)))},r=>{const i=e.findIndex(o=>o.name===r.name);i!==-1&&e.splice(i,1)})},handleByList(t,e,n=-1){return this.handle(t,r=>{e.includes(r.ref)||(e.push(r.ref),e.sort((i,o)=>Vi(o,n)-Vi(i,n)))},r=>{const i=e.indexOf(r.ref);i!==-1&&e.splice(i,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},Cs=Object.create(null),Ph=Object.create(null);function Ki(t,e){let n=Ph[t];return n===void 0&&(Cs[e]===void 0&&(Cs[e]=1),Ph[t]=n=Cs[e]++),n}let Dh={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};const vS={get(){return Dh},set(t){Dh=t}};let $i;function xS(){return(!$i||$i?.isContextLost())&&($i=vS.get().createCanvas().getContext("webgl",{})),$i}let Zi;function TS(){if(!Zi){Zi="mediump";const t=xS();t&&t.getShaderPrecisionFormat&&(Zi=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return Zi}function ES(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
2
2
 
3
3
  #ifdef GL_ES // This checks if it is WebGL1
4
4
  #define in varying
@@ -13,14 +13,14 @@
13
13
  #define out varying
14
14
  #endif
15
15
  ${t}
16
- `}const cE=/\buniform\s+([iu]?sampler\w+)/g,lE=/\bprecision\s+\w+\s+([iu]?sampler\w+)\s*;/g,uE={sampler2D:"lowp",samplerCube:"lowp"};function fE(t,e,n){const r=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let o=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;o==="highp"&&r!=="highp"&&(o="mediump"),t=`precision ${o} float;
17
- ${t}`}else r!=="highp"&&t.substring(0,15)==="precision highp"&&(t=t.replace("precision highp","precision mediump"));const i=e.maxSupportedFragmentPrecision==="highp"?"highp":"mediump";return dE(t,i)}function dE(t,e){const n=new Set;let r="";for(const[,i]of t.matchAll(lE))n.add(i);for(const[,i]of t.matchAll(cE))n.has(i)||(n.add(i),r+=`precision ${uE[i]??e} ${i};
18
- `);return r+t}function hE(t,e){return e?`#version 300 es
19
- ${t}`:t}const pE={},mE={};function gE(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const r=n?pE:mE;return r[e]?(r[e]++,e+=`-${r[e]}`):r[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
20
- ${t}`}function yE(t,e){return e?t.replace("#version 300 es",""):t}const cs={stripVersion:yE,ensurePrecision:fE,addProgramDefines:aE,setProgramName:gE,insertVersion:hE},Mr=Object.create(null),Jd=class Wd{constructor(e){e={...Wd.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:sE()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let i=e.fragment,o=e.vertex;Object.keys(cs).forEach(s=>{const a=r[s];i=cs[s](i,a,!0),o=cs[s](o,a,!1)}),this.fragment=i,this.vertex=o,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Pi(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Mr[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Mr[n]||(Mr[n]=new Wd(e),Mr[n]._cacheKey=n),Mr[n]}};Jd.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let ls=Jd;const Qd={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function _E(t){return Qd[t]??Qd.float32}const bE={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},eh=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function th(t,e){let n;for(;(n=eh.exec(t))!==null;){const r=bE[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:r,stride:_E(r).stride,offset:0,instance:!1,start:0}}eh.lastIndex=0}function xE(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function vE({source:t,entryPoint:e}){const n={},r=xE(t),i=r.indexOf(`fn ${e}(`);if(i===-1)return n;const o=r.indexOf("->",i);if(o===-1)return n;const s=r.substring(i,o);if(th(s,n),Object.keys(n).length===0){const a=s.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const l=a[1],c=new RegExp(`struct\\s+${l}\\s*\\{([^}]+)\\}`,"s"),u=r.match(c);u&&th(u[1],n)}}return n}function us(t){const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,o=/:\s*([\w<>]+)/,s=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,c=t.match(e)?.map(f=>{const d=f.match(i),h=d?.[1]??"";let p;return h==="<uniform>"?p="uniform":h.startsWith("<storage")&&(p="storage"),{group:parseInt(f.match(n)[1],10),binding:parseInt(f.match(r)[1],10),name:d[2],accessMode:p,type:f.match(o)[1]}});if(!c)return{groups:[],structs:[]};const u=t.match(s)?.map(f=>{const d=f.match(l)[1],h=f.match(a).reduce((p,m)=>{const[g,y]=m.split(":");return p[g.trim()]=y.trim(),p},{});return h?{name:d,members:h}:null}).filter(({name:f})=>c.some(d=>d.type===f||d.type.includes(`<${f}>`)))??[];return{groups:c,structs:u}}var Ve=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Ve||{});function Di(t){return t.endsWith("<u32>")?"uint":t.endsWith("<i32>")?"sint":"float"}function TE({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]=[]),r.accessMode==="uniform"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,buffer:{type:"uniform"}}):r.accessMode==="storage"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,buffer:{type:"read-only-storage"}}):r.type==="sampler"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,sampler:{type:"filtering"}}):r.type==="sampler_comparison"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,sampler:{type:"comparison"}}):r.type==="texture_2d"||r.type.startsWith("texture_2d<")?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d_array"?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_2d_array"||r.type.startsWith("texture_2d_array<")?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_3d"||r.type.startsWith("texture_3d<")?e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"3d",multisampled:!1}}):(r.type==="texture_cube"||r.type.startsWith("texture_cube<"))&&e[r.group].push({binding:r.binding,visibility:Ve.VERTEX|Ve.FRAGMENT,texture:{sampleType:Di(r.type),viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function EE({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]={}),e[r.group][r.name]=r.binding}return e}function SE(t,e){const n=new Set,r=new Set,i=[...t.structs,...e.structs].filter(s=>n.has(s.name)?!1:(n.add(s.name),!0)),o=[...t.groups,...e.groups].filter(s=>{const a=`${s.name}-${s.binding}`;return r.has(a)?!1:(r.add(a),!0)});return{structs:i,groups:o}}const Lr=Object.create(null);class Pr{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:r,layout:i,gpuLayout:o,name:s}=e;if(this.name=s,this.fragment=n,this.vertex=r,n.source===r.source){const a=us(n.source);this.structsAndGroups=a}else{const a=us(r.source),l=us(n.source);this.structsAndGroups=SE(a,l)}this.layout=i??EE(this.structsAndGroups),this.gpuLayout=o??TE(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,r=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=Pi(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=vE(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Lr[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Lr[n]||(Lr[n]=new Pr(e),Lr[n]._cacheKey=n),Lr[n]}}var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fs={exports:{}},nh;function wE(){return nh||(nh=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},a.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(c,u,f,d,h,p){var m=n?n+c:c;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,b,x;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];g.fn.apply(g.context,b)}else{var v=g.length,T;for(x=0;x<v;x++)switch(g[x].once&&this.removeListener(c,g[x].fn,void 0,!0),y){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!b)for(T=1,b=new Array(y-1);T<y;T++)b[T-1]=arguments[T];g[x].fn.apply(g[x].context,b)}}return!0},a.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},a.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},a.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&s(this,h);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==u||d&&!p[m].once||f&&p[m].context!==f)&&g.push(p[m]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(fs)),fs.exports}var AE=wE();const Nr=Jn(AE),ds={default:-1};function Pt(t="default"){return ds[t]===void 0&&(ds[t]=-1),++ds[t]}const rh=["f32","i32","u32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>","vec2<u32>","vec3<u32>","vec4<u32>"],OE=rh.reduce((t,e)=>(t[e]=!0,t),{});function CE(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const ih=class ZT extends Nr{constructor(e,n){super(),this.uid=Pt("uniform"),this._resourceType="uniformGroup",this._resourceId=Pt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...ZT.defaultOptions,...n},this.uniformStructures=e;const r={};for(const i in e){const o=e[i];if(o.name=i,o.size=o.size??1,!OE[o.type]){const s=o.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(s){const[,a,l]=s;throw new Error(`Uniform type ${o.type} is not supported. Use type: '${a}', size: ${l} instead.`)}throw new Error(`Uniform type ${o.type} is not supported. Supported uniform types are: ${rh.join(", ")}`)}o.value??(o.value=CE(o.type,o.size)),r[i]=o.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Pi(Object.keys(r).map(i=>`${i}-${e[i].type}`).join("-"),"uniform-group")}get buffer(){return this._buffer}set buffer(e){this._buffer!==e&&(this._buffer?.off("change",this.onBufferChange,this),this._buffer=e,e?.on("change",this.onBufferChange,this))}get _gcLastUsed(){return this._buffer?._gcLastUsed??-1}set _gcLastUsed(e){this._buffer&&(this._buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=Pt("resource"),this.emit("change",this)}update(){this._dirtyId++}};ih.defaultOptions={ubo:!1,isStatic:!1};let oh=ih;const RE=Math.PI*2;class qt{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new qt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return hs.x=0,hs.y=0,hs}}const hs=new qt;class An{constructor(e=1,n=0,r=0,i=1,o=0,s=0){this.array=null,this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,r,i,o,s){return this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const r=n||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(e,n){n=n||new qt;const r=e.x,i=e.y;return n.x=this.a*r+this.c*i+this.tx,n.y=this.b*r+this.d*i+this.ty,n}applyInverse(e,n){n=n||new qt;const r=this.a,i=this.b,o=this.c,s=this.d,a=this.tx,l=this.ty,c=1/(r*s+o*-i),u=e.x,f=e.y;return n.x=s*c*u+-o*c*f+(l*o-a*s)*c,n.y=r*c*f+-i*c*u+(-l*r+a*i)*c,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.a,o=this.c,s=this.tx;return this.a=i*n-this.b*r,this.b=i*r+this.b*n,this.c=o*n-this.d*r,this.d=o*r+this.d*n,this.tx=s*n-this.ty*r,this.ty=s*r+this.ty*n,this}append(e){const n=this.a,r=this.b,i=this.c,o=this.d;return this.a=e.a*n+e.b*i,this.b=e.a*r+e.b*o,this.c=e.c*n+e.d*i,this.d=e.c*r+e.d*o,this.tx=e.tx*n+e.ty*i+this.tx,this.ty=e.tx*r+e.ty*o+this.ty,this}appendFrom(e,n){const r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,c=n.a,u=n.b,f=n.c,d=n.d;return this.a=r*c+i*f,this.b=r*u+i*d,this.c=o*c+s*f,this.d=o*u+s*d,this.tx=a*c+l*f+n.tx,this.ty=a*u+l*d+n.ty,this}setTransform(e,n,r,i,o,s,a,l,c){return this.a=Math.cos(a+c)*o,this.b=Math.sin(a+c)*o,this.c=-Math.sin(a-l)*s,this.d=Math.cos(a-l)*s,this.tx=e-(r*this.a+i*this.c),this.ty=n-(r*this.b+i*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const r=this.a,i=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,r=this.b,i=this.c,o=this.d,s=e.pivot,a=-Math.atan2(-i,o),l=Math.atan2(r,n),c=Math.abs(a+l);let u=Math.sqrt(n*n+r*r);return c<1e-5||Math.abs(RE-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):Math.abs(Math.PI-c)<1e-5?(e.rotation=l-Math.PI,e.skew.x=e.skew.y=0,u=-u):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=u,e.scale.y=Math.sqrt(i*i+o*o),e.position.x=this.tx+(s.x*n+s.y*i),e.position.y=this.ty+(s.x*r+s.y*o),e}invert(){const e=this.a,n=this.b,r=this.c,i=this.d,o=this.tx,s=e*i-n*r;return this.a=i/s,this.b=-n/s,this.c=-r/s,this.d=e/s,this.tx=(r*this.ty-i*o)/s,this.ty=-(e*this.ty-n*o)/s,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new An;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return ME.identity()}static get shared(){return IE.identity()}}const IE=new An,ME=new An,On=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Cn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Rn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],In=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ps=[],sh=[],Bi=Math.sign;function LE(){for(let t=0;t<16;t++){const e=[];ps.push(e);for(let n=0;n<16;n++){const r=Bi(On[t]*On[n]+Rn[t]*Cn[n]),i=Bi(Cn[t]*On[n]+In[t]*Cn[n]),o=Bi(On[t]*Rn[n]+Rn[t]*In[n]),s=Bi(Cn[t]*Rn[n]+In[t]*In[n]);for(let a=0;a<16;a++)if(On[a]===r&&Cn[a]===i&&Rn[a]===o&&In[a]===s){e.push(a);break}}}for(let t=0;t<16;t++){const e=new An;e.set(On[t],Cn[t],Rn[t],In[t],0,0),sh.push(e)}}LE();const Ne={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>On[t],uY:t=>Cn[t],vX:t=>Rn[t],vY:t=>In[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>ps[t][e],sub:(t,e)=>ps[t][Ne.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?Ne.S:Ne.N:Math.abs(e)*2<=Math.abs(t)?t>0?Ne.E:Ne.W:e>0?t>0?Ne.SE:Ne.SW:t>0?Ne.NE:Ne.NW,matrixAppendRotationInv:(t,e,n=0,r=0,i=0,o=0)=>{const s=sh[Ne.inv(e)],a=s.a,l=s.b,c=s.c,u=s.d,f=n-Math.min(0,a*i,c*o,a*i+c*o),d=r-Math.min(0,l*i,u*o,l*i+u*o),h=t.a,p=t.b,m=t.c,g=t.d;t.a=a*h+l*m,t.b=a*p+l*g,t.c=c*h+u*m,t.d=c*p+u*g,t.tx=f*h+d*m+t.tx,t.ty=f*p+d*g+t.ty},transformRectCoords:(t,e,n,r)=>{const{x:i,y:o,width:s,height:a}=t,{x:l,y:c,width:u,height:f}=e;return n===Ne.E?(r.set(i+l,o+c,s,a),r):n===Ne.S?r.set(u-o-a+l,i+c,a,s):n===Ne.W?r.set(u-i-s+l,f-o-a+c,s,a):n===Ne.N?r.set(o+l,f-i-s+c,a,s):r.set(i+l,o+c,s,a)}},Ui=[new qt,new qt,new qt,new qt];class kr{constructor(e=0,n=0,r=0,i=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(r),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new kr(0,0,0,0)}clone(){return new kr(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,r,i=.5){const{width:o,height:s}=this;if(o<=0||s<=0)return!1;const a=this.x,l=this.y,c=r*(1-i),u=r-c,f=a-c,d=a+o+c,h=l-c,p=l+s+c,m=a+u,g=a+o-u,y=l+u,b=l+s-u;return e>=f&&e<=d&&n>=h&&n<=p&&!(e>m&&e<g&&n>y&&n<b)}intersects(e,n){if(!n){const C=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=C)return!1;const P=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>P}const r=this.left,i=this.right,o=this.top,s=this.bottom;if(i<=r||s<=o)return!1;const a=Ui[0].set(e.left,e.top),l=Ui[1].set(e.left,e.bottom),c=Ui[2].set(e.right,e.top),u=Ui[3].set(e.right,e.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const f=Math.sign(n.a*n.d-n.b*n.c);if(f===0||(n.apply(a,a),n.apply(l,l),n.apply(c,c),n.apply(u,u),Math.max(a.x,l.x,c.x,u.x)<=r||Math.min(a.x,l.x,c.x,u.x)>=i||Math.max(a.y,l.y,c.y,u.y)<=o||Math.min(a.y,l.y,c.y,u.y)>=s))return!1;const d=f*(l.y-a.y),h=f*(a.x-l.x),p=d*r+h*o,m=d*i+h*o,g=d*r+h*s,y=d*i+h*s;if(Math.max(p,m,g,y)<=d*a.x+h*a.y||Math.min(p,m,g,y)>=d*u.x+h*u.y)return!1;const b=f*(a.y-c.y),x=f*(c.x-a.x),v=b*r+x*o,T=b*i+x*o,w=b*r+x*s,O=b*i+x*s;return!(Math.max(v,T,w,O)<=b*a.x+x*a.y||Math.min(v,T,w,O)>=b*u.x+x*u.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}getBounds(e){return e||(e=new kr),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,r=e.y,i=e.x+e.width,o=e.y+e.height;return n>=this.x&&n<this.x+this.width&&r>=this.y&&r<this.y+this.height&&i>=this.x&&i<=this.x+this.width&&o>=this.y&&o<=this.y+this.height}set(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ah=new Set,ch="8.0.0",PE="8.22.0",Qn={quiet:!1,noColor:!1},Gi=((t,e,n=3)=>{if(Qn.quiet||ah.has(e))return;let r=new Error().stack;const i=`${e}
21
- Deprecated since v${t}`,o=typeof console.groupCollapsed=="function"&&!Qn.noColor;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",i):(r=r.split(`
16
+ `}const SS=/\buniform\s+([iu]?sampler\w+)/g,wS=/\bprecision\s+\w+\s+([iu]?sampler\w+)\s*;/g,AS={sampler2D:"lowp",samplerCube:"lowp"};function OS(t,e,n){const r=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let o=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;o==="highp"&&r!=="highp"&&(o="mediump"),t=`precision ${o} float;
17
+ ${t}`}else r!=="highp"&&t.substring(0,15)==="precision highp"&&(t=t.replace("precision highp","precision mediump"));const i=e.maxSupportedFragmentPrecision==="highp"?"highp":"mediump";return MS(t,i)}function MS(t,e){const n=new Set;let r="";for(const[,i]of t.matchAll(wS))n.add(i);for(const[,i]of t.matchAll(SS))n.has(i)||(n.add(i),r+=`precision ${AS[i]??e} ${i};
18
+ `);return r+t}function IS(t,e){return e?`#version 300 es
19
+ ${t}`:t}const CS={},RS={};function LS(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const r=n?CS:RS;return r[e]?(r[e]++,e+=`-${r[e]}`):r[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
20
+ ${t}`}function kS(t,e){return e?t.replace("#version 300 es",""):t}const Rs={stripVersion:kS,ensurePrecision:OS,addProgramDefines:ES,setProgramName:LS,insertVersion:IS},Wr=Object.create(null),Nh=class Ch{constructor(e){e={...Ch.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:TS()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let i=e.fragment,o=e.vertex;Object.keys(Rs).forEach(s=>{const a=r[s];i=Rs[s](i,a,!0),o=Rs[s](o,a,!1)}),this.fragment=i,this.vertex=o,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Ki(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Wr[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Wr[n]||(Wr[n]=new Ch(e),Wr[n]._cacheKey=n),Wr[n]}};Nh.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Ls=Nh;const Fh={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function PS(t){return Fh[t]??Fh.float32}const DS={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},Bh=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Uh(t,e){let n;for(;(n=Bh.exec(t))!==null;){const r=DS[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:r,stride:PS(r).stride,offset:0,instance:!1,start:0}}Bh.lastIndex=0}function NS(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function FS({source:t,entryPoint:e}){const n={},r=NS(t),i=r.indexOf(`fn ${e}(`);if(i===-1)return n;const o=r.indexOf("->",i);if(o===-1)return n;const s=r.substring(i,o);if(Uh(s,n),Object.keys(n).length===0){const a=s.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const l=a[1],c=new RegExp(`struct\\s+${l}\\s*\\{([^}]+)\\}`,"s"),u=r.match(c);u&&Uh(u[1],n)}}return n}function ks(t){const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,o=/:\s*([\w<>]+)/,s=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,c=t.match(e)?.map(f=>{const d=f.match(i),h=d?.[1]??"";let m;return h==="<uniform>"?m="uniform":h.startsWith("<storage")&&(m="storage"),{group:parseInt(f.match(n)[1],10),binding:parseInt(f.match(r)[1],10),name:d[2],accessMode:m,type:f.match(o)[1]}});if(!c)return{groups:[],structs:[]};const u=t.match(s)?.map(f=>{const d=f.match(l)[1],h=f.match(a).reduce((m,p)=>{const[g,y]=p.split(":");return m[g.trim()]=y.trim(),m},{});return h?{name:d,members:h}:null}).filter(({name:f})=>c.some(d=>d.type===f||d.type.includes(`<${f}>`)))??[];return{groups:c,structs:u}}var Qe=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Qe||{});function Ji(t){return t.endsWith("<u32>")?"uint":t.endsWith("<i32>")?"sint":"float"}function BS({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]=[]),r.accessMode==="uniform"?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,buffer:{type:"uniform"}}):r.accessMode==="storage"?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,buffer:{type:"read-only-storage"}}):r.type==="sampler"?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,sampler:{type:"filtering"}}):r.type==="sampler_comparison"?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,sampler:{type:"comparison"}}):r.type==="texture_2d"||r.type.startsWith("texture_2d<")?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,texture:{sampleType:Ji(r.type),viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d"?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d",multisampled:!1}}):r.type==="texture_depth_2d_array"?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,texture:{sampleType:"depth",viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_2d_array"||r.type.startsWith("texture_2d_array<")?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,texture:{sampleType:Ji(r.type),viewDimension:"2d-array",multisampled:!1}}):r.type==="texture_3d"||r.type.startsWith("texture_3d<")?e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,texture:{sampleType:Ji(r.type),viewDimension:"3d",multisampled:!1}}):(r.type==="texture_cube"||r.type.startsWith("texture_cube<"))&&e[r.group].push({binding:r.binding,visibility:Qe.VERTEX|Qe.FRAGMENT,texture:{sampleType:Ji(r.type),viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function US({groups:t}){const e=[];for(let n=0;n<t.length;n++){const r=t[n];e[r.group]||(e[r.group]={}),e[r.group][r.name]=r.binding}return e}function GS(t,e){const n=new Set,r=new Set,i=[...t.structs,...e.structs].filter(s=>n.has(s.name)?!1:(n.add(s.name),!0)),o=[...t.groups,...e.groups].filter(s=>{const a=`${s.name}-${s.binding}`;return r.has(a)?!1:(r.add(a),!0)});return{structs:i,groups:o}}const Xr=Object.create(null);class zr{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:r,layout:i,gpuLayout:o,name:s}=e;if(this.name=s,this.fragment=n,this.vertex=r,n.source===r.source){const a=ks(n.source);this.structsAndGroups=a}else{const a=ks(r.source),l=ks(n.source);this.structsAndGroups=GS(a,l)}this.layout=i??US(this.structsAndGroups),this.gpuLayout=o??BS(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,r=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=Ki(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=FS(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Xr[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Xr[n]||(Xr[n]=new zr(e),Xr[n]._cacheKey=n),Xr[n]}}var Qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ps={exports:{}},Gh;function jS(){return Gh||(Gh=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),m=n?n+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],h]:l._events[m].push(h):(l._events[m]=h,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,m=new Array(h);d<h;d++)m[d]=f[d].fn;return m},a.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(c,u,f,d,h,m){var p=n?n+c:c;if(!this._events[p])return!1;var g=this._events[p],y=arguments.length,_,v;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,m),!0}for(v=1,_=new Array(y-1);v<y;v++)_[v-1]=arguments[v];g.fn.apply(g.context,_)}else{var x=g.length,E;for(v=0;v<x;v++)switch(g[v].once&&this.removeListener(c,g[v].fn,void 0,!0),y){case 1:g[v].fn.call(g[v].context);break;case 2:g[v].fn.call(g[v].context,u);break;case 3:g[v].fn.call(g[v].context,u,f);break;case 4:g[v].fn.call(g[v].context,u,f,d);break;default:if(!_)for(E=1,_=new Array(y-1);E<y;E++)_[E-1]=arguments[E];g[v].fn.apply(g[v].context,_)}}return!0},a.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},a.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},a.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var m=this._events[h];if(m.fn)m.fn===u&&(!d||m.once)&&(!f||m.context===f)&&s(this,h);else{for(var p=0,g=[],y=m.length;p<y;p++)(m[p].fn!==u||d&&!m[p].once||f&&m[p].context!==f)&&g.push(m[p]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(Ps)),Ps.exports}var HS=jS();const qr=lr(HS),Ds={default:-1};function Gt(t="default"){return Ds[t]===void 0&&(Ds[t]=-1),++Ds[t]}const jh=["f32","i32","u32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>","vec2<u32>","vec3<u32>","vec4<u32>"],YS=jh.reduce((t,e)=>(t[e]=!0,t),{});function WS(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Hh=class uS extends qr{constructor(e,n){super(),this.uid=Gt("uniform"),this._resourceType="uniformGroup",this._resourceId=Gt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...uS.defaultOptions,...n},this.uniformStructures=e;const r={};for(const i in e){const o=e[i];if(o.name=i,o.size=o.size??1,!YS[o.type]){const s=o.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(s){const[,a,l]=s;throw new Error(`Uniform type ${o.type} is not supported. Use type: '${a}', size: ${l} instead.`)}throw new Error(`Uniform type ${o.type} is not supported. Supported uniform types are: ${jh.join(", ")}`)}o.value??(o.value=WS(o.type,o.size)),r[i]=o.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Ki(Object.keys(r).map(i=>`${i}-${e[i].type}`).join("-"),"uniform-group")}get buffer(){return this._buffer}set buffer(e){this._buffer!==e&&(this._buffer?.off("change",this.onBufferChange,this),this._buffer=e,e?.on("change",this.onBufferChange,this))}get _gcLastUsed(){return this._buffer?._gcLastUsed??-1}set _gcLastUsed(e){this._buffer&&(this._buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=Gt("resource"),this.emit("change",this)}update(){this._dirtyId++}};Hh.defaultOptions={ubo:!1,isStatic:!1};let Yh=Hh;const XS=Math.PI*2;class nn{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new nn(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Ns.x=0,Ns.y=0,Ns}}const Ns=new nn;class Nn{constructor(e=1,n=0,r=0,i=1,o=0,s=0){this.array=null,this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,r,i,o,s){return this.a=e,this.b=n,this.c=r,this.d=i,this.tx=o,this.ty=s,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const r=n||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(e,n){n=n||new nn;const r=e.x,i=e.y;return n.x=this.a*r+this.c*i+this.tx,n.y=this.b*r+this.d*i+this.ty,n}applyInverse(e,n){n=n||new nn;const r=this.a,i=this.b,o=this.c,s=this.d,a=this.tx,l=this.ty,c=1/(r*s+o*-i),u=e.x,f=e.y;return n.x=s*c*u+-o*c*f+(l*o-a*s)*c,n.y=r*c*f+-i*c*u+(-l*r+a*i)*c,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.a,o=this.c,s=this.tx;return this.a=i*n-this.b*r,this.b=i*r+this.b*n,this.c=o*n-this.d*r,this.d=o*r+this.d*n,this.tx=s*n-this.ty*r,this.ty=s*r+this.ty*n,this}append(e){const n=this.a,r=this.b,i=this.c,o=this.d;return this.a=e.a*n+e.b*i,this.b=e.a*r+e.b*o,this.c=e.c*n+e.d*i,this.d=e.c*r+e.d*o,this.tx=e.tx*n+e.ty*i+this.tx,this.ty=e.tx*r+e.ty*o+this.ty,this}appendFrom(e,n){const r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,l=e.ty,c=n.a,u=n.b,f=n.c,d=n.d;return this.a=r*c+i*f,this.b=r*u+i*d,this.c=o*c+s*f,this.d=o*u+s*d,this.tx=a*c+l*f+n.tx,this.ty=a*u+l*d+n.ty,this}setTransform(e,n,r,i,o,s,a,l,c){return this.a=Math.cos(a+c)*o,this.b=Math.sin(a+c)*o,this.c=-Math.sin(a-l)*s,this.d=Math.cos(a-l)*s,this.tx=e-(r*this.a+i*this.c),this.ty=n-(r*this.b+i*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const r=this.a,i=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,r=this.b,i=this.c,o=this.d,s=e.pivot,a=-Math.atan2(-i,o),l=Math.atan2(r,n),c=Math.abs(a+l);let u=Math.sqrt(n*n+r*r);return c<1e-5||Math.abs(XS-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):Math.abs(Math.PI-c)<1e-5?(e.rotation=l-Math.PI,e.skew.x=e.skew.y=0,u=-u):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=u,e.scale.y=Math.sqrt(i*i+o*o),e.position.x=this.tx+(s.x*n+s.y*i),e.position.y=this.ty+(s.x*r+s.y*o),e}invert(){const e=this.a,n=this.b,r=this.c,i=this.d,o=this.tx,s=e*i-n*r;return this.a=i/s,this.b=-n/s,this.c=-r/s,this.d=e/s,this.tx=(r*this.ty-i*o)/s,this.ty=-(e*this.ty-n*o)/s,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Nn;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return qS.identity()}static get shared(){return zS.identity()}}const zS=new Nn,qS=new Nn,Fn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Bn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Un=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Gn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Fs=[],Wh=[],eo=Math.sign;function VS(){for(let t=0;t<16;t++){const e=[];Fs.push(e);for(let n=0;n<16;n++){const r=eo(Fn[t]*Fn[n]+Un[t]*Bn[n]),i=eo(Bn[t]*Fn[n]+Gn[t]*Bn[n]),o=eo(Fn[t]*Un[n]+Un[t]*Gn[n]),s=eo(Bn[t]*Un[n]+Gn[t]*Gn[n]);for(let a=0;a<16;a++)if(Fn[a]===r&&Bn[a]===i&&Un[a]===o&&Gn[a]===s){e.push(a);break}}}for(let t=0;t<16;t++){const e=new Nn;e.set(Fn[t],Bn[t],Un[t],Gn[t],0,0),Wh.push(e)}}VS();const De={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Fn[t],uY:t=>Bn[t],vX:t=>Un[t],vY:t=>Gn[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Fs[t][e],sub:(t,e)=>Fs[t][De.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?De.S:De.N:Math.abs(e)*2<=Math.abs(t)?t>0?De.E:De.W:e>0?t>0?De.SE:De.SW:t>0?De.NE:De.NW,matrixAppendRotationInv:(t,e,n=0,r=0,i=0,o=0)=>{const s=Wh[De.inv(e)],a=s.a,l=s.b,c=s.c,u=s.d,f=n-Math.min(0,a*i,c*o,a*i+c*o),d=r-Math.min(0,l*i,u*o,l*i+u*o),h=t.a,m=t.b,p=t.c,g=t.d;t.a=a*h+l*p,t.b=a*m+l*g,t.c=c*h+u*p,t.d=c*m+u*g,t.tx=f*h+d*p+t.tx,t.ty=f*m+d*g+t.ty},transformRectCoords:(t,e,n,r)=>{const{x:i,y:o,width:s,height:a}=t,{x:l,y:c,width:u,height:f}=e;return n===De.E?(r.set(i+l,o+c,s,a),r):n===De.S?r.set(u-o-a+l,i+c,a,s):n===De.W?r.set(u-i-s+l,f-o-a+c,s,a):n===De.N?r.set(o+l,f-i-s+c,a,s):r.set(i+l,o+c,s,a)}},to=[new nn,new nn,new nn,new nn];class Vr{constructor(e=0,n=0,r=0,i=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(r),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Vr(0,0,0,0)}clone(){return new Vr(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,r,i=.5){const{width:o,height:s}=this;if(o<=0||s<=0)return!1;const a=this.x,l=this.y,c=r*(1-i),u=r-c,f=a-c,d=a+o+c,h=l-c,m=l+s+c,p=a+u,g=a+o-u,y=l+u,_=l+s-u;return e>=f&&e<=d&&n>=h&&n<=m&&!(e>p&&e<g&&n>y&&n<_)}intersects(e,n){if(!n){const M=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=M)return!1;const k=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>k}const r=this.left,i=this.right,o=this.top,s=this.bottom;if(i<=r||s<=o)return!1;const a=to[0].set(e.left,e.top),l=to[1].set(e.left,e.bottom),c=to[2].set(e.right,e.top),u=to[3].set(e.right,e.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const f=Math.sign(n.a*n.d-n.b*n.c);if(f===0||(n.apply(a,a),n.apply(l,l),n.apply(c,c),n.apply(u,u),Math.max(a.x,l.x,c.x,u.x)<=r||Math.min(a.x,l.x,c.x,u.x)>=i||Math.max(a.y,l.y,c.y,u.y)<=o||Math.min(a.y,l.y,c.y,u.y)>=s))return!1;const d=f*(l.y-a.y),h=f*(a.x-l.x),m=d*r+h*o,p=d*i+h*o,g=d*r+h*s,y=d*i+h*s;if(Math.max(m,p,g,y)<=d*a.x+h*a.y||Math.min(m,p,g,y)>=d*u.x+h*u.y)return!1;const _=f*(a.y-c.y),v=f*(c.x-a.x),x=_*r+v*o,E=_*i+v*o,T=_*r+v*s,A=_*i+v*s;return!(Math.max(x,E,T,A)<=_*a.x+v*a.y||Math.min(x,E,T,A)>=_*u.x+v*u.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}getBounds(e){return e||(e=new Vr),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,r=e.y,i=e.x+e.width,o=e.y+e.height;return n>=this.x&&n<this.x+this.width&&r>=this.y&&r<this.y+this.height&&i>=this.x&&i<=this.x+this.width&&o>=this.y&&o<=this.y+this.height}set(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Xh=new Set,zh="8.0.0",KS="8.22.0",ur={quiet:!1,noColor:!1},no=((t,e,n=3)=>{if(ur.quiet||Xh.has(e))return;let r=new Error().stack;const i=`${e}
21
+ Deprecated since v${t}`,o=typeof console.groupCollapsed=="function"&&!ur.noColor;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",i):(r=r.split(`
22
22
  `).splice(n).join(`
23
- `),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(r))),ah.add(e)});Object.defineProperties(Gi,{quiet:{get:()=>Qn.quiet,set:t=>{Qn.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>Qn.noColor,set:t=>{Qn.noColor=t},enumerable:!0,configurable:!1}});const lh=()=>{};function NE(t){return t.endsWith("int")}function uh(t){return!(t&t-1)&&!!t}function kE(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const fh=Object.create(null);function DE(t){const e=fh[t];return e===void 0&&(fh[t]=Pt("resource")),e}const dh=class $T extends Nr{constructor(e={}){super(),this._resourceType="textureSampler",this._maxAnisotropy=1,this.destroyed=!1,e={...$T.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){Gi(ch,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=DE(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};dh.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let FE=dh;const hh=class JT extends Nr{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Pt("textureSource"),this._resourceType="textureSource",this._resourceId=Pt("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.depth=1,this._ownsStyle=!1,this.antialias=!1,this.transient=!1,this.storage=!1,this._batchTick=-1,this._textureBindLocation=-1;const n=e;e={...JT.defaultOptions,...e};const r=BE(e),i=r==="3d"||r==="1d"?r:"2d";UE(n,r,i),this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=i,this.viewDimension=r,this.arrayLayerCount=e.arrayLayerCount,this.depth=i==="3d"?e.depth??1:1,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=i==="3d"?!1:e.antialias,this.transient=e.transient??!1,this.storage=e.storage??!1,this.alphaMode=e.alphaMode,this.style=new FE(kE(e)),this._ownsStyle=!0,this.destroyed=!1,this._refreshPOT()}get depthOrArrayLayers(){return this.dimension==="3d"?this.depth:this.arrayLayerCount||1}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._ownsStyle=!1,this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._ownsStyle&&this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Pt("resource"),this.emit("change",this),this.emit("unload",this);for(const e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,r){r||(r=this._resolution),e||(e=this.width),n||(n=this.height);const i=Math.round(e*r),o=Math.round(n*r);return this.width=i/r,this.height=o/r,this._resolution=r,this.pixelWidth===i&&this.pixelHeight===o?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=o,this.emit("resize",this),this._resourceId=Pt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=uh(this.pixelWidth)&&uh(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};hh.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let ms=hh;function BE(t){return t.viewDimension?t.viewDimension:t.depth?"3d":t.arrayLayerCount>1?"2d-array":"2d"}function UE(t,e,n){if(t.depth!==void 0&&typeof t.depth!="number")throw new Error(`[TextureSource] depth is a 3D texture's depth in texels, but got ${t.depth}. For a depth buffer, use the depth option of a RenderTarget or the renderer.`);if(t.depth&&t.arrayLayerCount>1)throw new Error("[TextureSource] depth and arrayLayerCount can't be combined: use depth for a 3D texture or arrayLayerCount for a 2D array.");if(t.depth&&e!=="3d")throw new Error(`[TextureSource] depth makes a 3D texture, but viewDimension is '${e}'. Use arrayLayerCount for layered textures.`);if(e==="3d"&&t.arrayLayerCount>1)throw new Error("[TextureSource] a 3D texture takes depth, not arrayLayerCount.");if(t.dimensions&&t.dimensions!==n)throw new Error(`[TextureSource] dimensions '${t.dimensions}' doesn't match viewDimension '${e}'. Leave dimensions out; it is derived from the view.`);if(t.dimensions&&Gi(PE,"TextureSource dimensions is derived from viewDimension and depth; leave it out."),n==="3d"&&t.antialias)throw new Error("[TextureSource] a 3D texture can't be antialiased: WebGPU has no multisampled 3D textures.")}class ph extends ms{constructor(e){const n=e.depth??e.arrayLayerCount??1,r=e.resource||new Float32Array(e.width*e.height*n*4);let i=e.format;i||(r instanceof Float32Array?i="rgba32float":r instanceof Int32Array||r instanceof Uint32Array?i="rgba32uint":r instanceof Int16Array||r instanceof Uint16Array?i="rgba16uint":(r instanceof Int8Array,i="bgra8unorm"));const o=NE(i)||n>1;super({...o&&{alphaMode:"no-premultiply-alpha"},...e,resource:r,format:i}),this.uploadMethodId="buffer",this._updateStart=0,this._updateEnd=1/0}update(e=0,n=1/0){if((e>0||n<1/0)&&this.depthOrArrayLayers>1)throw new Error("[BufferImageSource] a 3D texture or 2D array uploads whole: call update() with no range.");this._updateStart=e,this._updateEnd=n,super.update(),this._updateStart=0,this._updateEnd=1/0}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}ph.extension=He.TextureSource;const mh=new An;class GE{constructor(e,n){this.mapCoord=new An,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this)),this.update()}destroy(){this._texture?.removeListener("update",this.update,this),this._texture=null}multiplyUvs(e,n){n===void 0&&(n=e);const r=this.mapCoord;for(let i=0;i<e.length;i+=2){const o=e[i],s=e[i+1];n[i]=o*r.a+s*r.c+r.tx,n[i+1]=o*r.b+s*r.d+r.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const r=e.orig,i=e.trim;i&&(mh.set(r.width/i.width,0,0,r.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(mh));const o=e.source,s=this.uClampFrame,a=this.clampMargin/o._resolution,l=this.clampOffset/o._resolution;return s[0]=(e.frame.x+a+l)/o.width,s[1]=(e.frame.y+a+l)/o.height,s[2]=(e.frame.x+e.frame.width-a+l)/o.width,s[3]=(e.frame.y+e.frame.height-a+l)/o.height,this.uClampOffset[0]=this.clampOffset/o.pixelWidth,this.uClampOffset[1]=this.clampOffset/o.pixelHeight,this.isSimple=e.frame.width===o.width&&e.frame.height===o.height&&e.rotate===0,!0}}class Mn extends Nr{constructor({source:e,label:n,frame:r,orig:i,trim:o,defaultAnchor:s,defaultBorders:a,rotate:l,dynamic:c}={}){if(super(),this.uid=Pt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new kr,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=e?.source??new ms,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:u,height:f}=this._source;this.frame.width=u,this.frame.height=f}this.orig=i||this.frame,this.trim=o,this.rotate=l??0,this.defaultAnchor=s,this.defaultBorders=a,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new GE(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:r,height:i}=this._source,o=n.x/r,s=n.y/i,a=n.width/r,l=n.height/i;let c=this.rotate;if(c){const u=a/2,f=l/2,d=o+u,h=s+f;c=Ne.add(c,Ne.NW),e.x0=d+u*Ne.uX(c),e.y0=h+f*Ne.uY(c),c=Ne.add(c,2),e.x1=d+u*Ne.uX(c),e.y1=h+f*Ne.uY(c),c=Ne.add(c,2),e.x2=d+u*Ne.uX(c),e.y2=h+f*Ne.uY(c),c=Ne.add(c,2),e.x3=d+u*Ne.uX(c),e.y3=h+f*Ne.uY(c)}else e.x0=o,e.y0=s,e.x1=o+a,e.y1=s,e.x2=o+a,e.y2=s+l,e.x3=o,e.y3=s+l}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return Gi(ch,"Texture.baseTexture is now Texture.source"),this._source}}Mn.EMPTY=new Mn({label:"EMPTY",source:new ms({label:"EMPTY"})}),Mn.EMPTY.destroy=lh,Mn.WHITE=new Mn({source:new ph({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),Mn.WHITE.destroy=lh;let gs=0;const gh=500;function yh(...t){gs!==gh&&(gs++,gs===gh?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}class ys{constructor(e){this.resources=Object.create(null),this._resourceKeysValue=null,this._dirty=!0;let n=0;for(const r in e){const i=e[r];this.setResource(i,n++)}}get _resourceKeys(){return this._resourceKeysValue??(this._resourceKeysValue=Object.keys(this.resources).map(Number)),this._resourceKeysValue}get _key(){if(this._dirty){this._dirty=!1;const e=[];let n=0;for(const r in this.resources)e[n++]=this.resources[r]?this.resources[r]._resourceId:-1;this._keyValue=e.join("|")}return this._keyValue}setResource(e,n){const r=this.resources[n];e!==r&&(r&&r.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),r===void 0&&(this._resourceKeysValue=null),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const n=this.resources,r=this._resourceKeys;for(let i=0;i<r.length;i++){const o=n[r[i]];o&&(o._gcLastUsed=e)}}destroy(){const e=this.resources;for(const n in e)e[n]?.off?.("change",this.onResourceChange,this);this.resources=null,this._resourceKeysValue=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const n=this.resources;for(const r in n)n[r]===e&&(n[r]=null);yh(`[BindGroup] a '${e._resourceType}' was destroyed while still bound to a shader. Remove it from the shader before destroying it.`)}}}var _s=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(_s||{});class ji{constructor(e){this.data={...e};const n=Object.keys(e).sort().map(r=>`${r}:${e[r]}`).join("|");this.id=Pi(n,"shader-overrides")}static from(e){return e instanceof ji?e:new ji(e)}}class bs extends Nr{constructor(e){super(),this.uid=Pt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:r,groups:i,resources:o,compatibleRenderers:s,groupMap:a,overrides:l}=e;this._overrides=l?ji.from(l):null,this.gpuProgram=n,this.glProgram=r,s===void 0&&(s=0,n&&(s|=_s.WEBGPU),r&&(s|=_s.WEBGL)),this.compatibleRenderers=s;const c={};if(a)for(const u in a)for(const f in a[u]){const d=a[u][f];c[d]={group:u,binding:f,name:d}}if(!o&&!i&&(o={}),o&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(n&&i&&!a){const u=n.structsAndGroups.groups;a={},u.forEach(f=>{a[f.group]=a[f.group]||{},a[f.group][f.binding]=f.name,c[f.name]=f})}else if(o){i={},a||(a={}),n&&n.structsAndGroups.groups.forEach(d=>{a[d.group]=a[d.group]||{},a[d.group][d.binding]=d.name,c[d.name]=d});let u=0;for(const f in o)c[f]||(n&&!r&&yh(`[Shader] the resource '${f}' matches no binding in the WGSL source — is the name correct?`),i[99]||(i[99]=new ys,this._ownedBindGroups.push(i[99])),c[f]={group:99,binding:u,name:f},a[99]=a[99]||{},a[99][u]=f,u++);for(const f in o){const d=f;let h=o[f];!h.source&&!h._resourceType&&(h=new oh(h));const p=c[d];p&&(i[p.group]||(i[p.group]=new ys,this._ownedBindGroups.push(i[p.group])),i[p.group].setResource(h,p.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,c)}addResource(e,n,r){var i,o;(i=this._uniformBindMap)[n]||(i[n]={}),(o=this._uniformBindMap[n])[r]||(o[r]=e),this.groups[n]||(this.groups[n]=new ys,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const r={};for(const i in n){const o=n[i];Object.defineProperty(r,o.name,{get(){return e[o.group].getResource(o.binding)},set(s){e[o.group].setResource(s,o.binding)}})}return r}destroy(e=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(n=>{n.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null,this._overrides=null)}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=Pr.from(n)),r&&(s=ls.from(r)),new bs({gpuProgram:o,glProgram:s,...i})}}const jE={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},HE={BLEND:0,OFFSET:1,CULLING:2,DEPTH_TEST:3,WINDING:4,DEPTH_MASK:5},{BLEND:xs,OFFSET:vs,CULLING:Ts,DEPTH_TEST:Es,WINDING:Ss,DEPTH_MASK:ws}=HE,As=class QT{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<xs)}set blend(e){!!(this.data&1<<xs)!==e&&(this.data^=1<<xs)}get offsets(){return!!(this.data&1<<vs)}set offsets(e){!!(this.data&1<<vs)!==e&&(this.data^=1<<vs)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Ts)}set culling(e){!!(this.data&1<<Ts)!==e&&(this.data^=1<<Ts)}get depthTest(){return!!(this.data&1<<Es)}set depthTest(e){!!(this.data&1<<Es)!==e&&(this.data^=1<<Es)}get depthMask(){return!!(this.data&1<<ws)}set depthMask(e){!!(this.data&1<<ws)!==e&&(this.data^=1<<ws)}get clockwiseFrontFace(){return!!(this.data&1<<Ss)}set clockwiseFrontFace(e){!!(this.data&1<<Ss)!==e&&(this.data^=1<<Ss)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=jE[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new QT;return e.depthTest=!1,e.depthMask=!1,e.blend=!0,e}};As.default2d=As.for2d();let YE=As;const _h=class zd extends bs{constructor(e){e={...zd.defaultOptions,...e},super(e),this.enabled=!0,this._state=YE.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,r,i){e.applyFilter(this,n,r,i)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=Pr.from(n)),r&&(s=ls.from(r)),new zd({gpuProgram:o,glProgram:s,...i})}};_h.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let XE=_h;var WE=`
23
+ `),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",i),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",i),console.warn(r))),Xh.add(e)});Object.defineProperties(no,{quiet:{get:()=>ur.quiet,set:t=>{ur.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>ur.noColor,set:t=>{ur.noColor=t},enumerable:!0,configurable:!1}});const qh=()=>{};function $S(t){return t.endsWith("int")}function Vh(t){return!(t&t-1)&&!!t}function ZS(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const Kh=Object.create(null);function JS(t){const e=Kh[t];return e===void 0&&(Kh[t]=Gt("resource")),e}const $h=class dS extends qr{constructor(e={}){super(),this._resourceType="textureSampler",this._maxAnisotropy=1,this.destroyed=!1,e={...dS.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){no(zh,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=JS(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};$h.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let QS=$h;const Zh=class fS extends qr{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Gt("textureSource"),this._resourceType="textureSource",this._resourceId=Gt("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.depth=1,this._ownsStyle=!1,this.antialias=!1,this.transient=!1,this.storage=!1,this._batchTick=-1,this._textureBindLocation=-1;const n=e;e={...fS.defaultOptions,...e};const r=ew(e),i=r==="3d"||r==="1d"?r:"2d";tw(n,r,i),this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=i,this.viewDimension=r,this.arrayLayerCount=e.arrayLayerCount,this.depth=i==="3d"?e.depth??1:1,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=i==="3d"?!1:e.antialias,this.transient=e.transient??!1,this.storage=e.storage??!1,this.alphaMode=e.alphaMode,this.style=new QS(ZS(e)),this._ownsStyle=!0,this.destroyed=!1,this._refreshPOT()}get depthOrArrayLayers(){return this.dimension==="3d"?this.depth:this.arrayLayerCount||1}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._ownsStyle=!1,this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._ownsStyle&&this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Gt("resource"),this.emit("change",this),this.emit("unload",this);for(const e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,r){r||(r=this._resolution),e||(e=this.width),n||(n=this.height);const i=Math.round(e*r),o=Math.round(n*r);return this.width=i/r,this.height=o/r,this._resolution=r,this.pixelWidth===i&&this.pixelHeight===o?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=o,this.emit("resize",this),this._resourceId=Gt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Vh(this.pixelWidth)&&Vh(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};Zh.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Bs=Zh;function ew(t){return t.viewDimension?t.viewDimension:t.depth?"3d":t.arrayLayerCount>1?"2d-array":"2d"}function tw(t,e,n){if(t.depth!==void 0&&typeof t.depth!="number")throw new Error(`[TextureSource] depth is a 3D texture's depth in texels, but got ${t.depth}. For a depth buffer, use the depth option of a RenderTarget or the renderer.`);if(t.depth&&t.arrayLayerCount>1)throw new Error("[TextureSource] depth and arrayLayerCount can't be combined: use depth for a 3D texture or arrayLayerCount for a 2D array.");if(t.depth&&e!=="3d")throw new Error(`[TextureSource] depth makes a 3D texture, but viewDimension is '${e}'. Use arrayLayerCount for layered textures.`);if(e==="3d"&&t.arrayLayerCount>1)throw new Error("[TextureSource] a 3D texture takes depth, not arrayLayerCount.");if(t.dimensions&&t.dimensions!==n)throw new Error(`[TextureSource] dimensions '${t.dimensions}' doesn't match viewDimension '${e}'. Leave dimensions out; it is derived from the view.`);if(t.dimensions&&no(KS,"TextureSource dimensions is derived from viewDimension and depth; leave it out."),n==="3d"&&t.antialias)throw new Error("[TextureSource] a 3D texture can't be antialiased: WebGPU has no multisampled 3D textures.")}class Jh extends Bs{constructor(e){const n=e.depth??e.arrayLayerCount??1,r=e.resource||new Float32Array(e.width*e.height*n*4);let i=e.format;i||(r instanceof Float32Array?i="rgba32float":r instanceof Int32Array||r instanceof Uint32Array?i="rgba32uint":r instanceof Int16Array||r instanceof Uint16Array?i="rgba16uint":(r instanceof Int8Array,i="bgra8unorm"));const o=$S(i)||n>1;super({...o&&{alphaMode:"no-premultiply-alpha"},...e,resource:r,format:i}),this.uploadMethodId="buffer",this._updateStart=0,this._updateEnd=1/0}update(e=0,n=1/0){if((e>0||n<1/0)&&this.depthOrArrayLayers>1)throw new Error("[BufferImageSource] a 3D texture or 2D array uploads whole: call update() with no range.");this._updateStart=e,this._updateEnd=n,super.update(),this._updateStart=0,this._updateEnd=1/0}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}Jh.extension=qe.TextureSource;const Qh=new Nn;class nw{constructor(e,n){this.mapCoord=new Nn,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this)),this.update()}destroy(){this._texture?.removeListener("update",this.update,this),this._texture=null}multiplyUvs(e,n){n===void 0&&(n=e);const r=this.mapCoord;for(let i=0;i<e.length;i+=2){const o=e[i],s=e[i+1];n[i]=o*r.a+s*r.c+r.tx,n[i+1]=o*r.b+s*r.d+r.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const r=e.orig,i=e.trim;i&&(Qh.set(r.width/i.width,0,0,r.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(Qh));const o=e.source,s=this.uClampFrame,a=this.clampMargin/o._resolution,l=this.clampOffset/o._resolution;return s[0]=(e.frame.x+a+l)/o.width,s[1]=(e.frame.y+a+l)/o.height,s[2]=(e.frame.x+e.frame.width-a+l)/o.width,s[3]=(e.frame.y+e.frame.height-a+l)/o.height,this.uClampOffset[0]=this.clampOffset/o.pixelWidth,this.uClampOffset[1]=this.clampOffset/o.pixelHeight,this.isSimple=e.frame.width===o.width&&e.frame.height===o.height&&e.rotate===0,!0}}class jn extends qr{constructor({source:e,label:n,frame:r,orig:i,trim:o,defaultAnchor:s,defaultBorders:a,rotate:l,dynamic:c}={}){if(super(),this.uid=Gt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Vr,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=e?.source??new Bs,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:u,height:f}=this._source;this.frame.width=u,this.frame.height=f}this.orig=i||this.frame,this.trim=o,this.rotate=l??0,this.defaultAnchor=s,this.defaultBorders=a,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new nw(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:r,height:i}=this._source,o=n.x/r,s=n.y/i,a=n.width/r,l=n.height/i;let c=this.rotate;if(c){const u=a/2,f=l/2,d=o+u,h=s+f;c=De.add(c,De.NW),e.x0=d+u*De.uX(c),e.y0=h+f*De.uY(c),c=De.add(c,2),e.x1=d+u*De.uX(c),e.y1=h+f*De.uY(c),c=De.add(c,2),e.x2=d+u*De.uX(c),e.y2=h+f*De.uY(c),c=De.add(c,2),e.x3=d+u*De.uX(c),e.y3=h+f*De.uY(c)}else e.x0=o,e.y0=s,e.x1=o+a,e.y1=s,e.x2=o+a,e.y2=s+l,e.x3=o,e.y3=s+l}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return no(zh,"Texture.baseTexture is now Texture.source"),this._source}}jn.EMPTY=new jn({label:"EMPTY",source:new Bs({label:"EMPTY"})}),jn.EMPTY.destroy=qh,jn.WHITE=new jn({source:new Jh({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),jn.WHITE.destroy=qh;let Us=0;const ep=500;function tp(...t){Us!==ep&&(Us++,Us===ep?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}class Gs{constructor(e){this.resources=Object.create(null),this._resourceKeysValue=null,this._dirty=!0;let n=0;for(const r in e){const i=e[r];this.setResource(i,n++)}}get _resourceKeys(){return this._resourceKeysValue??(this._resourceKeysValue=Object.keys(this.resources).map(Number)),this._resourceKeysValue}get _key(){if(this._dirty){this._dirty=!1;const e=[];let n=0;for(const r in this.resources)e[n++]=this.resources[r]?this.resources[r]._resourceId:-1;this._keyValue=e.join("|")}return this._keyValue}setResource(e,n){const r=this.resources[n];e!==r&&(r&&r.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),r===void 0&&(this._resourceKeysValue=null),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const n=this.resources,r=this._resourceKeys;for(let i=0;i<r.length;i++){const o=n[r[i]];o&&(o._gcLastUsed=e)}}destroy(){const e=this.resources;for(const n in e)e[n]?.off?.("change",this.onResourceChange,this);this.resources=null,this._resourceKeysValue=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const n=this.resources;for(const r in n)n[r]===e&&(n[r]=null);tp(`[BindGroup] a '${e._resourceType}' was destroyed while still bound to a shader. Remove it from the shader before destroying it.`)}}}var js=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(js||{});class ro{constructor(e){this.data={...e};const n=Object.keys(e).sort().map(r=>`${r}:${e[r]}`).join("|");this.id=Ki(n,"shader-overrides")}static from(e){return e instanceof ro?e:new ro(e)}}class Hs extends qr{constructor(e){super(),this.uid=Gt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:r,groups:i,resources:o,compatibleRenderers:s,groupMap:a,overrides:l}=e;this._overrides=l?ro.from(l):null,this.gpuProgram=n,this.glProgram=r,s===void 0&&(s=0,n&&(s|=js.WEBGPU),r&&(s|=js.WEBGL)),this.compatibleRenderers=s;const c={};if(a)for(const u in a)for(const f in a[u]){const d=a[u][f];c[d]={group:u,binding:f,name:d}}if(!o&&!i&&(o={}),o&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(n&&i&&!a){const u=n.structsAndGroups.groups;a={},u.forEach(f=>{a[f.group]=a[f.group]||{},a[f.group][f.binding]=f.name,c[f.name]=f})}else if(o){i={},a||(a={}),n&&n.structsAndGroups.groups.forEach(d=>{a[d.group]=a[d.group]||{},a[d.group][d.binding]=d.name,c[d.name]=d});let u=0;for(const f in o)c[f]||(n&&!r&&tp(`[Shader] the resource '${f}' matches no binding in the WGSL source — is the name correct?`),i[99]||(i[99]=new Gs,this._ownedBindGroups.push(i[99])),c[f]={group:99,binding:u,name:f},a[99]=a[99]||{},a[99][u]=f,u++);for(const f in o){const d=f;let h=o[f];!h.source&&!h._resourceType&&(h=new Yh(h));const m=c[d];m&&(i[m.group]||(i[m.group]=new Gs,this._ownedBindGroups.push(i[m.group])),i[m.group].setResource(h,m.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,c)}addResource(e,n,r){var i,o;(i=this._uniformBindMap)[n]||(i[n]={}),(o=this._uniformBindMap[n])[r]||(o[r]=e),this.groups[n]||(this.groups[n]=new Gs,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const r={};for(const i in n){const o=n[i];Object.defineProperty(r,o.name,{get(){return e[o.group].getResource(o.binding)},set(s){e[o.group].setResource(s,o.binding)}})}return r}destroy(e=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(n=>{n.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null,this._overrides=null)}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=zr.from(n)),r&&(s=Ls.from(r)),new Hs({gpuProgram:o,glProgram:s,...i})}}const rw={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},iw={BLEND:0,OFFSET:1,CULLING:2,DEPTH_TEST:3,WINDING:4,DEPTH_MASK:5},{BLEND:Ys,OFFSET:Ws,CULLING:Xs,DEPTH_TEST:zs,WINDING:qs,DEPTH_MASK:Vs}=iw,Ks=class hS{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Ys)}set blend(e){!!(this.data&1<<Ys)!==e&&(this.data^=1<<Ys)}get offsets(){return!!(this.data&1<<Ws)}set offsets(e){!!(this.data&1<<Ws)!==e&&(this.data^=1<<Ws)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Xs)}set culling(e){!!(this.data&1<<Xs)!==e&&(this.data^=1<<Xs)}get depthTest(){return!!(this.data&1<<zs)}set depthTest(e){!!(this.data&1<<zs)!==e&&(this.data^=1<<zs)}get depthMask(){return!!(this.data&1<<Vs)}set depthMask(e){!!(this.data&1<<Vs)!==e&&(this.data^=1<<Vs)}get clockwiseFrontFace(){return!!(this.data&1<<qs)}set clockwiseFrontFace(e){!!(this.data&1<<qs)!==e&&(this.data^=1<<qs)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=rw[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new hS;return e.depthTest=!1,e.depthMask=!1,e.blend=!0,e}};Ks.default2d=Ks.for2d();let ow=Ks;const np=class Rh extends Hs{constructor(e){e={...Rh.defaultOptions,...e},super(e),this.enabled=!0,this._state=ow.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,r,i){e.applyFilter(this,n,r,i)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:r,...i}=e;let o,s;return n&&(o=zr.from(n)),r&&(s=Ls.from(r)),new Rh({gpuProgram:o,glProgram:s,...i})}};np.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let sw=np;var aw=`
24
24
  in vec2 vTextureCoord;
25
25
  in vec4 vColor;
26
26
 
@@ -41,7 +41,7 @@ void main()
41
41
 
42
42
  {MAIN}
43
43
  }
44
- `,zE=`in vec2 aPosition;
44
+ `,cw=`in vec2 aPosition;
45
45
  out vec2 vTextureCoord;
46
46
  out vec2 backgroundUv;
47
47
 
@@ -69,7 +69,7 @@ void main(void)
69
69
  gl_Position = filterVertexPosition();
70
70
  vTextureCoord = filterTextureCoord();
71
71
  }
72
- `,qE=`
72
+ `,lw=`
73
73
  struct GlobalFilterUniforms {
74
74
  uInputSize:vec4<f32>,
75
75
  uInputPixel:vec4<f32>,
@@ -143,7 +143,7 @@ fn mainFragment(
143
143
  {MAIN}
144
144
 
145
145
  return out;
146
- }`;class Ke extends XE{constructor(e){const n=e.gpu,r=bh({source:qE,...n}),i=Pr.from({vertex:{source:r,entryPoint:"mainVertex"},fragment:{source:r,entryPoint:"mainFragment"}}),o=e.gl,s=bh({source:WE,...o}),a=ls.from({vertex:zE,fragment:s}),l=new oh({uBlend:{value:1,type:"f32"}});super({gpuProgram:i,glProgram:a,blendRequired:!0,resources:{blendUniforms:l,uBackTexture:Mn.EMPTY}})}}function bh(t){const{source:e,functions:n,main:r}=t;return e.replace("{FUNCTIONS}",n).replace("{MAIN}",r)}const Os=`
146
+ }`;class et extends sw{constructor(e){const n=e.gpu,r=rp({source:lw,...n}),i=zr.from({vertex:{source:r,entryPoint:"mainVertex"},fragment:{source:r,entryPoint:"mainFragment"}}),o=e.gl,s=rp({source:aw,...o}),a=Ls.from({vertex:cw,fragment:s}),l=new Yh({uBlend:{value:1,type:"f32"}});super({gpuProgram:i,glProgram:a,blendRequired:!0,resources:{blendUniforms:l,uBackTexture:jn.EMPTY}})}}function rp(t){const{source:e,functions:n,main:r}=t;return e.replace("{FUNCTIONS}",n).replace("{MAIN}",r)}const $s=`
147
147
  float getLuminosity(vec3 c) {
148
148
  return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
149
149
  }
@@ -222,7 +222,7 @@ fn mainFragment(
222
222
 
223
223
  return color;
224
224
  }
225
- `,Cs=`
225
+ `,Zs=`
226
226
  fn getLuminosity(c: vec3<f32>) -> f32
227
227
  {
228
228
  return 0.3*c.r + 0.59*c.g + 0.11*c.b;
@@ -319,8 +319,8 @@ fn mainFragment(
319
319
 
320
320
  return color;
321
321
  }
322
- `;class xh extends Ke{constructor(){super({gl:{functions:`
323
- ${Os}
322
+ `;class ip extends et{constructor(){super({gl:{functions:`
323
+ ${$s}
324
324
 
325
325
  vec3 blendColor(vec3 base, vec3 blend, float opacity)
326
326
  {
@@ -329,7 +329,7 @@ fn mainFragment(
329
329
  `,main:`
330
330
  finalColor = vec4(blendColor(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
331
331
  `},gpu:{functions:`
332
- ${Cs}
332
+ ${Zs}
333
333
 
334
334
  fn blendColorOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
335
335
  {
@@ -337,7 +337,7 @@ fn mainFragment(
337
337
  }
338
338
  `,main:`
339
339
  out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
340
- `}})}}xh.extension={name:"color",type:He.BlendMode};class vh extends Ke{constructor(){super({gl:{functions:`
340
+ `}})}}ip.extension={name:"color",type:qe.BlendMode};class op extends et{constructor(){super({gl:{functions:`
341
341
  float colorBurn(float base, float blend)
342
342
  {
343
343
  return max((1.0 - ((1.0 - base) / blend)), 0.0);
@@ -373,7 +373,7 @@ fn mainFragment(
373
373
  }
374
374
  `,main:`
375
375
  out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
376
- `}})}}vh.extension={name:"color-burn",type:He.BlendMode};class Th extends Ke{constructor(){super({gl:{functions:`
376
+ `}})}}op.extension={name:"color-burn",type:qe.BlendMode};class sp extends et{constructor(){super({gl:{functions:`
377
377
  float colorDodge(float base, float blend)
378
378
  {
379
379
  return base / (1.0 - blend);
@@ -409,7 +409,7 @@ fn mainFragment(
409
409
  }
410
410
  `,main:`
411
411
  out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
412
- `}})}}Th.extension={name:"color-dodge",type:He.BlendMode};class Eh extends Ke{constructor(){super({gl:{functions:`
412
+ `}})}}sp.extension={name:"color-dodge",type:qe.BlendMode};class ap extends et{constructor(){super({gl:{functions:`
413
413
  vec3 blendDarken(vec3 base, vec3 blend, float opacity)
414
414
  {
415
415
  return (min(base, blend) * opacity + base * (1.0 - opacity));
@@ -423,7 +423,7 @@ fn mainFragment(
423
423
  }
424
424
  `,main:`
425
425
  out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
426
- `}})}}Eh.extension={name:"darken",type:He.BlendMode};class Sh extends Ke{constructor(){super({gl:{functions:`
426
+ `}})}}ap.extension={name:"darken",type:qe.BlendMode};class cp extends et{constructor(){super({gl:{functions:`
427
427
  vec3 blendDifference(vec3 base, vec3 blend, float opacity)
428
428
  {
429
429
  return (abs(blend - base) * opacity + base * (1.0 - opacity));
@@ -437,7 +437,7 @@ fn mainFragment(
437
437
  }
438
438
  `,main:`
439
439
  out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
440
- `}})}}Sh.extension={name:"difference",type:He.BlendMode};class wh extends Ke{constructor(){super({gl:{functions:`
440
+ `}})}}cp.extension={name:"difference",type:qe.BlendMode};class lp extends et{constructor(){super({gl:{functions:`
441
441
  float divide(float base, float blend)
442
442
  {
443
443
  return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;
@@ -472,7 +472,7 @@ fn mainFragment(
472
472
  }
473
473
  `,main:`
474
474
  out = vec4<f32>(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
475
- `}})}}wh.extension={name:"divide",type:He.BlendMode};class Ah extends Ke{constructor(){super({gl:{functions:`
475
+ `}})}}lp.extension={name:"divide",type:qe.BlendMode};class up extends et{constructor(){super({gl:{functions:`
476
476
  vec3 exclusion(vec3 base, vec3 blend)
477
477
  {
478
478
  return base + blend - 2.0 * base * blend;
@@ -496,7 +496,7 @@ fn mainFragment(
496
496
  }
497
497
  `,main:`
498
498
  out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
499
- `}})}}Ah.extension={name:"exclusion",type:He.BlendMode};class Oh extends Ke{constructor(){super({gl:{functions:`
499
+ `}})}}up.extension={name:"exclusion",type:qe.BlendMode};class dp extends et{constructor(){super({gl:{functions:`
500
500
  float hardLight(float base, float blend)
501
501
  {
502
502
  return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
@@ -531,7 +531,7 @@ fn mainFragment(
531
531
  }
532
532
  `,main:`
533
533
  out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
534
- `}})}}Oh.extension={name:"hard-light",type:He.BlendMode};class Ch extends Ke{constructor(){super({gl:{functions:`
534
+ `}})}}dp.extension={name:"hard-light",type:qe.BlendMode};class fp extends et{constructor(){super({gl:{functions:`
535
535
  float hardMix(float base, float blend)
536
536
  {
537
537
  return (base + blend >= 1.0) ? 1.0 : 0.0;
@@ -565,7 +565,7 @@ fn mainFragment(
565
565
  }
566
566
  `,main:`
567
567
  out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
568
- `}})}}Ch.extension={name:"hard-mix",type:He.BlendMode};class Rh extends Ke{constructor(){super({gl:{functions:`
568
+ `}})}}fp.extension={name:"hard-mix",type:qe.BlendMode};class hp extends et{constructor(){super({gl:{functions:`
569
569
  vec3 blendLighten(vec3 base, vec3 blend, float opacity)
570
570
  {
571
571
  return (max(base, blend) * opacity + base * (1.0 - opacity));
@@ -579,7 +579,7 @@ fn mainFragment(
579
579
  }
580
580
  `,main:`
581
581
  out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
582
- `}})}}Rh.extension={name:"lighten",type:He.BlendMode};class Ih extends Ke{constructor(){super({gl:{functions:`
582
+ `}})}}hp.extension={name:"lighten",type:qe.BlendMode};class pp extends et{constructor(){super({gl:{functions:`
583
583
  float linearBurn(float base, float blend)
584
584
  {
585
585
  return max(0.0, base + blend - 1.0);
@@ -615,7 +615,7 @@ fn mainFragment(
615
615
  }
616
616
  `,main:`
617
617
  out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
618
- `}})}}Ih.extension={name:"linear-burn",type:He.BlendMode};class Mh extends Ke{constructor(){super({gl:{functions:`
618
+ `}})}}pp.extension={name:"linear-burn",type:qe.BlendMode};class mp extends et{constructor(){super({gl:{functions:`
619
619
  float linearDodge(float base, float blend) {
620
620
  return min(1.0, base + blend);
621
621
  }
@@ -648,7 +648,7 @@ fn mainFragment(
648
648
  }
649
649
  `,main:`
650
650
  out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
651
- `}})}}Mh.extension={name:"linear-dodge",type:He.BlendMode};class Lh extends Ke{constructor(){super({gl:{functions:`
651
+ `}})}}mp.extension={name:"linear-dodge",type:qe.BlendMode};class gp extends et{constructor(){super({gl:{functions:`
652
652
  float linearBurn(float base, float blend) {
653
653
  return max(0.0, base + blend - 1.0);
654
654
  }
@@ -700,8 +700,8 @@ fn mainFragment(
700
700
  }
701
701
  `,main:`
702
702
  out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
703
- `}})}}Lh.extension={name:"linear-light",type:He.BlendMode};class Ph extends Ke{constructor(){super({gl:{functions:`
704
- ${Os}
703
+ `}})}}gp.extension={name:"linear-light",type:qe.BlendMode};class yp extends et{constructor(){super({gl:{functions:`
704
+ ${$s}
705
705
 
706
706
  vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
707
707
  {
@@ -711,7 +711,7 @@ fn mainFragment(
711
711
  `,main:`
712
712
  finalColor = vec4(blendLuminosity(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
713
713
  `},gpu:{functions:`
714
- ${Cs}
714
+ ${Zs}
715
715
 
716
716
  fn blendLuminosity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
717
717
  {
@@ -720,7 +720,7 @@ fn mainFragment(
720
720
  }
721
721
  `,main:`
722
722
  out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
723
- `}})}}Ph.extension={name:"luminosity",type:He.BlendMode};class Nh extends Ke{constructor(){super({gl:{functions:`
723
+ `}})}}yp.extension={name:"luminosity",type:qe.BlendMode};class _p extends et{constructor(){super({gl:{functions:`
724
724
  vec3 negation(vec3 base, vec3 blend)
725
725
  {
726
726
  return 1.0-abs(1.0-base-blend);
@@ -744,7 +744,7 @@ fn mainFragment(
744
744
  }
745
745
  `,main:`
746
746
  out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
747
- `}})}}Nh.extension={name:"negation",type:He.BlendMode};class kh extends Ke{constructor(){super({gl:{functions:`
747
+ `}})}}_p.extension={name:"negation",type:qe.BlendMode};class bp extends et{constructor(){super({gl:{functions:`
748
748
  float overlay(float base, float blend)
749
749
  {
750
750
  return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));
@@ -780,7 +780,7 @@ fn mainFragment(
780
780
  }
781
781
  `,main:`
782
782
  out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
783
- `}})}}kh.extension={name:"overlay",type:He.BlendMode};class Dh extends Ke{constructor(){super({gl:{functions:`
783
+ `}})}}bp.extension={name:"overlay",type:qe.BlendMode};class vp extends et{constructor(){super({gl:{functions:`
784
784
  float pinLight(float base, float blend)
785
785
  {
786
786
  return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));
@@ -816,8 +816,8 @@ fn mainFragment(
816
816
  }
817
817
  `,main:`
818
818
  out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
819
- `}})}}Dh.extension={name:"pin-light",type:He.BlendMode};class Fh extends Ke{constructor(){super({gl:{functions:`
820
- ${Os}
819
+ `}})}}vp.extension={name:"pin-light",type:qe.BlendMode};class xp extends et{constructor(){super({gl:{functions:`
820
+ ${$s}
821
821
 
822
822
  vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
823
823
  {
@@ -827,7 +827,7 @@ fn mainFragment(
827
827
  `,main:`
828
828
  finalColor = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
829
829
  `},gpu:{functions:`
830
- ${Cs}
830
+ ${Zs}
831
831
 
832
832
  fn blendSaturation(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
833
833
  {
@@ -836,7 +836,7 @@ fn mainFragment(
836
836
  }
837
837
  `,main:`
838
838
  out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
839
- `}})}}Fh.extension={name:"saturation",type:He.BlendMode};class Bh extends Ke{constructor(){super({gl:{functions:`
839
+ `}})}}xp.extension={name:"saturation",type:qe.BlendMode};class Tp extends et{constructor(){super({gl:{functions:`
840
840
  float softLight(float base, float blend)
841
841
  {
842
842
  return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));
@@ -872,7 +872,7 @@ fn mainFragment(
872
872
  }
873
873
  `,main:`
874
874
  out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
875
- `}})}}Bh.extension={name:"soft-light",type:He.BlendMode};class Uh extends Ke{constructor(){super({gl:{functions:`
875
+ `}})}}Tp.extension={name:"soft-light",type:qe.BlendMode};class Ep extends et{constructor(){super({gl:{functions:`
876
876
  float subtract(float base, float blend)
877
877
  {
878
878
  return max(0.0, base - blend);
@@ -908,7 +908,7 @@ fn mainFragment(
908
908
  }
909
909
  `,main:`
910
910
  out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
911
- `}})}}Uh.extension={name:"subtract",type:He.BlendMode};class Gh extends Ke{constructor(){super({gl:{functions:`
911
+ `}})}}Ep.extension={name:"subtract",type:qe.BlendMode};class Sp extends et{constructor(){super({gl:{functions:`
912
912
  float colorBurn(float base, float blend)
913
913
  {
914
914
  return max((1.0-((1.0-base)/blend)),0.0);
@@ -964,7 +964,7 @@ fn mainFragment(
964
964
  }
965
965
  `,main:`
966
966
  out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
967
- `}})}}Gh.extension={name:"vivid-light",type:He.BlendMode},rE.add(xh,vh,Th,Eh,Sh,wh,Ah,Oh,Ch,Rh,Ih,Lh,Mh,Ph,Nh,kh,Dh,Fh,Bh,Uh,Gh),at.extend({AnimatedSprite:B.AnimatedSprite,Container:B.Container,Graphics:B.Graphics,Mesh:B.Mesh,Sprite:B.Sprite,Text:B.Text,TilingSprite:B.TilingSprite,GifSprite:Ir.GifSprite});var Rs={exports:{}},Dr={};var jh;function VE(){if(jh)return Dr;jh=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:o}}return Dr.Fragment=e,Dr.jsx=n,Dr.jsxs=n,Dr}var Hh;function KE(){return Hh||(Hh=1,Rs.exports=VE()),Rs.exports}var M=KE();const ue={Normal:"Normal",None:"None",Warm:"Warm",Cool:"Cool",BlackAndWhite:"BlackAndWhite",Vivid:"Vivid",Fade:"Fade",RetroVintage:"RetroVintage",Sepia:"Sepia",OldFilm:"OldFilm",Polaroid:"Polaroid",Seventies:"70s",Cinematic:"Cinematic",Dramatic:"Dramatic",Moody:"Moody",FilmNoir:"FilmNoir",SoftFocus:"SoftFocus",Dreamy:"Dreamy",DreamyVintage:"DreamyVintage",DarkMood:"DarkMood",HDR:"HDR",Pop:"Pop",Pastel:"Pastel",Neon:"Neon",Pixelize:"Pixelize",RadialPixel:"RadialPixel",CrossCut:"CrossCut",Liquid:"Liquid",Outliner:"Outliner",DotPattern:"DotPattern",CRT:"CRT",Posterize:"Posterize",TVGlitch:"TVGlitch",HalfTone:"HalfTone",Linocut:"Linocut",Shifter:"Shifter",Mirror:"Mirror",ASCII:"ASCII",Emboss:"Emboss",Glow:"Glow",TiltShift:"TiltShift",ExtrudeBlur:"ExtrudeBlur",Sharpie:"Sharpie",Recolor:"Recolor",GreenScreen:"GreenScreen",Godray:"Godray",MotionBlur:"MotionBlur",AdvancedBloom:"AdvancedBloom",RetroHalfTone:"RetroHalfTone",NightVision:"NightVision",Vignette:"Vignette",CYAN:"CYAN"};var Nt=(t=>(t.NONE="none",t.EQUALIZER="equalizer",t.ROUNDBARS="roundbars",t.LED="led",t.RADIAL_SPECTRUM="radial_spectrum",t.LUMI_BARS="lumi_bars",t))(Nt||{});let Yh;function Xh(){return Yh=document.body,Yh}function Ze(t,e,n){let r;return S.useEffect(()=>{r=r||Xh();const i=o=>{const s=o.detail;e(s)};return r.addEventListener(t,i,!1),()=>{r?.removeEventListener(t,i,!1)}},n),i=>{r=i}}function Ln(t,e){const n=Xh(),r=new CustomEvent(t,{detail:e});n.dispatchEvent(r)}function ZE(){let t;function e(n){t=n}return e.emit=function(n,r){const i=new CustomEvent(n,{bubbles:!0,detail:r});t?.dispatchEvent(i)},e}const Ye=I.createContext({}),ke={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END",FONTS_LOADED:"FONTS_LOADED"},$E=({children:t})=>{const[e,n]=S.useState(0),r=S.useRef(void 0),i=S.useRef(void 0),o=S.useRef(0),s=S.useRef(!1),a=S.useRef(!1),[l,c]=S.useState(!1),u=S.useRef(new Set),f=S.useRef(!1),d=S.useRef(!1);S.useLayoutEffect(()=>(i.current=E.context(()=>{r.current&&r.current.progress(0).kill(),r.current&&r.current.clear(),r.current&&E.killTweensOf(r.current),r.current=E.timeline({paused:!0,defaults:{duration:0}})}),()=>{r.current&&r.current.revert(),i.current.revert()}),[]);const h=S.useCallback(()=>{if(r.current){const R=r.current.time();R<o.current?s.current=!0:s.current=!1,o.current=R,u.current.forEach(P=>{try{P(R)}catch(A){typeof console<"u"&&console.warn&&console.warn("[GsapPixi] timeUpdate listener error:",A)}})}},[]);S.useEffect(()=>{if(r.current){const C=r.current;C.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){C.pause(),h()}).eventCallback("onUpdate",function(){h()}).eventCallback("onRepeat",function(){console.log("onrepeat",C.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",C.progress())}).eventCallback("onComplete",function(){C.seek(.01),C.pause(),f.current=!1,Ln(ke.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),h()})}},[]),S.useEffect(()=>{r.current&&e>0&&o.current===0&&(r.current.seek(.01),o.current=.01)},[e]);const p=S.useCallback(()=>{r.current&&r.current.revert()},[]),m=S.useCallback(()=>{r.current&&(r.current.restart(),f.current=!0,Ln(ke.RESUME))},[]),g=S.useCallback(()=>{if(!r.current)return;const C=r.current;C.repeat(1),C.restart(),f.current=!0,Ln(ke.RESUME)},[]),y=S.useCallback(C=>{r.current&&(r.current.seek(C),h())},[h]),b=S.useCallback(()=>{r.current&&r.current.seek(4)},[]),x=S.useCallback(()=>{const C=r.current;return C?C.totalDuration():0},[]),v=S.useCallback(C=>{u.current.add(C)},[]),T=S.useCallback(C=>{u.current.delete(C)},[]),w=()=>{r.current&&(r.current.pause(),f.current=!1,Ln(ke.PAUSE))},O=()=>{r.current&&(r.current.resume(),f.current=!0,Ln(ke.RESUME))};return Ze(ke.SEEK_START,()=>{a.current=!0,d.current=!0}),Ze(ke.SCRUBBER_PLAY,()=>{O()}),Ze(ke.SCRUBBER_PAUSE,()=>{w()}),Ze(ke.SCRUBBER_SEEK,C=>{y(C)}),Ze(ke.SEEK_END,()=>{a.current=!1,d.current=!1}),Ze(ke.REVERSE_MODE_START,()=>{s.current=!0}),Ze(ke.REVERSE_MODE_END,()=>{s.current=!1}),Ze(ke.SCRUBBER_PROGRESS_UPDATE,C=>{}),M.jsx(Ye,{value:{gsapCtx:i,tl:r,handlePlay:O,handlePause:w,handleReset:p,handleSeek:y,handleSeekTest:b,handleRestart:m,handleRepeat:g,playerTimeRef:o,getTimelineDuration:x,totalDuration:e,setTotalDuration:n,reverseModeRef:s,dragModeRef:a,isRemotion:l,setIsRemotion:c,registerTimeUpdateListener:v,unregisterTimeUpdateListener:T,playStateRef:f,isSeekingRef:d},children:t})};var Is,Wh;function Hi(){if(Wh)return Is;Wh=1;var t=Object.prototype;function e(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||t;return n===i}return Is=e,Is}var Ms,zh;function qh(){if(zh)return Ms;zh=1;function t(e,n){return function(r){return e(n(r))}}return Ms=t,Ms}var Ls,Vh;function JE(){if(Vh)return Ls;Vh=1;var t=qh(),e=t(Object.keys,Object);return Ls=e,Ls}var Ps,Kh;function Zh(){if(Kh)return Ps;Kh=1;var t=Hi(),e=JE(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!t(o))return e(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return Ps=i,Ps}var Ns,$h;function Jh(){if($h)return Ns;$h=1;var t=typeof Fi=="object"&&Fi&&Fi.Object===Object&&Fi;return Ns=t,Ns}var ks,Qh;function St(){if(Qh)return ks;Qh=1;var t=Jh(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return ks=n,ks}var Ds,ep;function er(){if(ep)return Ds;ep=1;var t=St(),e=t.Symbol;return Ds=e,Ds}var Fs,tp;function QE(){if(tp)return Fs;tp=1;var t=er(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[i]=l:delete s[i]),u}return Fs=o,Fs}var Bs,np;function eS(){if(np)return Bs;np=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Bs=n,Bs}var Us,rp;function tr(){if(rp)return Us;rp=1;var t=er(),e=QE(),n=eS(),r="[object Null]",i="[object Undefined]",o=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?e(a):n(a)}return Us=s,Us}var Gs,ip;function Pn(){if(ip)return Gs;ip=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Gs=t,Gs}var js,op;function sp(){if(op)return js;op=1;var t=tr(),e=Pn(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!e(a))return!1;var l=t(a);return l==r||l==i||l==n||l==o}return js=s,js}var Hs,ap;function tS(){if(ap)return Hs;ap=1;var t=St(),e=t["__core-js_shared__"];return Hs=e,Hs}var Ys,cp;function nS(){if(cp)return Ys;cp=1;var t=tS(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return Ys=n,Ys}var Xs,lp;function up(){if(lp)return Xs;lp=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return Xs=n,Xs}var Ws,fp;function rS(){if(fp)return Ws;fp=1;var t=sp(),e=nS(),n=Pn(),r=up(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||e(d))return!1;var h=t(d)?u:o;return h.test(r(d))}return Ws=f,Ws}var zs,dp;function iS(){if(dp)return zs;dp=1;function t(e,n){return e?.[n]}return zs=t,zs}var qs,hp;function Nn(){if(hp)return qs;hp=1;var t=rS(),e=iS();function n(r,i){var o=e(r,i);return t(o)?o:void 0}return qs=n,qs}var Vs,pp;function oS(){if(pp)return Vs;pp=1;var t=Nn(),e=St(),n=t(e,"DataView");return Vs=n,Vs}var Ks,mp;function Zs(){if(mp)return Ks;mp=1;var t=Nn(),e=St(),n=t(e,"Map");return Ks=n,Ks}var $s,gp;function sS(){if(gp)return $s;gp=1;var t=Nn(),e=St(),n=t(e,"Promise");return $s=n,$s}var Js,yp;function aS(){if(yp)return Js;yp=1;var t=Nn(),e=St(),n=t(e,"Set");return Js=n,Js}var Qs,_p;function cS(){if(_p)return Qs;_p=1;var t=Nn(),e=St(),n=t(e,"WeakMap");return Qs=n,Qs}var ea,bp;function Fr(){if(bp)return ea;bp=1;var t=oS(),e=Zs(),n=sS(),r=aS(),i=cS(),o=tr(),s=up(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",f="[object WeakMap]",d="[object DataView]",h=s(t),p=s(e),m=s(n),g=s(r),y=s(i),b=o;return(t&&b(new t(new ArrayBuffer(1)))!=d||e&&b(new e)!=a||n&&b(n.resolve())!=c||r&&b(new r)!=u||i&&b(new i)!=f)&&(b=function(x){var v=o(x),T=v==l?x.constructor:void 0,w=T?s(T):"";if(w)switch(w){case h:return d;case p:return a;case m:return c;case g:return u;case y:return f}return v}),ea=b,ea}var ta,xp;function dn(){if(xp)return ta;xp=1;function t(e){return e!=null&&typeof e=="object"}return ta=t,ta}var na,vp;function lS(){if(vp)return na;vp=1;var t=tr(),e=dn(),n="[object Arguments]";function r(i){return e(i)&&t(i)==n}return na=r,na}var ra,Tp;function ia(){if(Tp)return ra;Tp=1;var t=lS(),e=dn(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=t((function(){return arguments})())?t:function(s){return e(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return ra=o,ra}var oa,Ep;function Vt(){if(Ep)return oa;Ep=1;var t=Array.isArray;return oa=t,oa}var sa,Sp;function wp(){if(Sp)return sa;Sp=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return sa=e,sa}var aa,Ap;function ca(){if(Ap)return aa;Ap=1;var t=sp(),e=wp();function n(r){return r!=null&&e(r.length)&&!t(r)}return aa=n,aa}var Br={exports:{}},la,Op;function uS(){if(Op)return la;Op=1;function t(){return!1}return la=t,la}Br.exports;var Cp;function Yi(){return Cp||(Cp=1,(function(t,e){var n=St(),r=uS(),i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;t.exports=c})(Br,Br.exports)),Br.exports}var ua,Rp;function fS(){if(Rp)return ua;Rp=1;var t=tr(),e=wp(),n=dn(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",x="[object Float64Array]",v="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",O="[object Uint8Array]",C="[object Uint8ClampedArray]",R="[object Uint16Array]",P="[object Uint32Array]",A={};A[b]=A[x]=A[v]=A[T]=A[w]=A[O]=A[C]=A[R]=A[P]=!0,A[r]=A[i]=A[g]=A[o]=A[y]=A[s]=A[a]=A[l]=A[c]=A[u]=A[f]=A[d]=A[h]=A[p]=A[m]=!1;function L(N){return n(N)&&e(N.length)&&!!A[t(N)]}return ua=L,ua}var fa,Ip;function da(){if(Ip)return fa;Ip=1;function t(e){return function(n){return e(n)}}return fa=t,fa}var Ur={exports:{}};Ur.exports;var Mp;function ha(){return Mp||(Mp=1,(function(t,e){var n=Jh(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();t.exports=a})(Ur,Ur.exports)),Ur.exports}var pa,Lp;function ma(){if(Lp)return pa;Lp=1;var t=fS(),e=da(),n=ha(),r=n&&n.isTypedArray,i=r?e(r):t;return pa=i,pa}var ga,Pp;function dS(){if(Pp)return ga;Pp=1;var t=Zh(),e=Fr(),n=ia(),r=Vt(),i=ca(),o=Yi(),s=Hi(),a=ma(),l="[object Map]",c="[object Set]",u=Object.prototype,f=u.hasOwnProperty;function d(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var p=e(h);if(p==l||p==c)return!h.size;if(s(h))return!t(h).length;for(var m in h)if(f.call(h,m))return!1;return!0}return ga=d,ga}var hS=dS();const ya=Jn(hS);var Np=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Np||{});const _a={normal:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:0},lensflare:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},filmstrip:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},grunge:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},bricks:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"MULTIPLY",alpha:1}},kp=t=>{const{overlay:e,width:n,height:r,x:i,y:o}=t,{src:s}=_a[e]||_a.normal,[a,l]=I.useState(null);return I.useEffect(()=>{let c=!1;return W.Assets.load(s).then(u=>{c||l(u)}).catch(()=>{}),()=>{c=!0}},[s]),a?M.jsx("pixiTilingSprite",{texture:a,width:n,height:r,x:i,y:o,tilePosition:{x:0,y:0},tileScale:{x:.5,y:.5},alpha:.5,anchor:.5}):null};var Gr=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Gr||{});var pS=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,mS=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,gS=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,yS=/(^[#\.][a-z]|[a-y][a-z])/i,_S=Math.PI/180,bS=180/Math.PI,Xi=Math.sin,Wi=Math.cos,mt=Math.abs,Kt=Math.sqrt,jr=Math.atan2,ba=1e8,Dp=function(e){return typeof e=="string"},Fp=function(e){return typeof e=="number"},xS=function(e){return typeof e>"u"},vS={},TS={},zi=1e5,Bp=function(e){return Math.round((e+ba)%1*zi)/zi||(e<0?0:1)},Oe=function(e){return Math.round(e*zi)/zi||0},Up=function(e){return Math.round(e*1e10)/1e10||0},Gp=function(e){return e.closed=Math.abs(e[0]-e[e.length-2])<.001&&Math.abs(e[1]-e[e.length-1])<.001},jp=function(e,n,r,i){var o=e[n],s=i===1?6:Ta(o,r,i);if((s||!i)&&s+r+2<o.length)return e.splice(n,0,o.slice(0,r+s+2)),o.splice(0,r+s),1},xa=function(e,n,r){var i=e.length,o=~~(r*i);if(e[o]>n){for(;--o&&e[o]>n;);o<0&&(o=0)}else for(;e[++o]<n&&o<i;);return o<i?o:i-1},ES=function(e,n){var r=e.length;for(e.reverse();r--;)e[r].reversed||nr(e[r])},Hp=function(e,n){return n.totalLength=e.totalLength,e.samples?(n.samples=e.samples.slice(0),n.lookup=e.lookup.slice(0),n.minLength=e.minLength,n.resolution=e.resolution):e.totalPoints&&(n.totalPoints=e.totalPoints),n},SS=function(e,n){var r=e.length,i=e[r-1]||[],o=i.length;r&&n[0]===i[o-2]&&n[1]===i[o-1]&&(n=i.concat(n.slice(2)),r--),e[r]=n};function Hr(t){t=Dp(t)&&yS.test(t)&&document.querySelector(t)||t;var e=t.getAttribute?t:0,n;return e&&(t=t.getAttribute("d"))?(e._gsPath||(e._gsPath={}),n=e._gsPath[t],n&&!n._dirty?n:e._gsPath[t]=kt(t)):t?Dp(t)?kt(t):Fp(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function wS(t){for(var e=[],n=0;n<t.length;n++)e[n]=Hp(t[n],t[n].slice(0));return Hp(t,e)}function nr(t){var e=0,n;for(t.reverse();e<t.length;e+=2)n=t[e],t[e]=t[e+1],t[e+1]=n;t.reversed=!t.reversed}var AS=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(e.attributes),o=i.length,s;for(n=","+n+",";--o>-1;)s=i[o].nodeName.toLowerCase(),n.indexOf(","+s+",")<0&&r.setAttributeNS(null,s,i[o].nodeValue);return r},OS={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"},CS=function(e,n){for(var r=n?n.split(","):[],i={},o=r.length;--o>-1;)i[r[o]]=+e.getAttribute(r[o])||0;return i};function va(t,e){var n=t.tagName.toLowerCase(),r=.552284749831,i,o,s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R;return n==="path"||!t.getBBox?t:(c=AS(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),R=CS(t,OS[n]),n==="rect"?(a=R.rx,l=R.ry||a,o=R.x,s=R.y,h=R.width-a*2,p=R.height-l*2,a||l?(m=o+a*(1-r),g=o+a,y=g+h,b=y+a*r,x=y+a,v=s+l*(1-r),T=s+l,w=T+p,O=w+l*r,C=w+l,i="M"+x+","+T+" V"+w+" C"+[x,O,b,C,y,C,y-(y-g)/3,C,g+(y-g)/3,C,g,C,m,C,o,O,o,w,o,w-(w-T)/3,o,T+(w-T)/3,o,T,o,v,m,s,g,s,g+(y-g)/3,s,y-(y-g)/3,s,y,s,b,s,x,v,x,T].join(",")+"z"):i="M"+(o+h)+","+s+" v"+p+" h"+-h+" v"+-p+" h"+h+"z"):n==="circle"||n==="ellipse"?(n==="circle"?(a=l=R.r,f=a*r):(a=R.rx,l=R.ry,f=l*r),o=R.cx,s=R.cy,u=a*r,i="M"+(o+a)+","+s+" C"+[o+a,s+f,o+u,s+l,o,s+l,o-u,s+l,o-a,s+f,o-a,s,o-a,s-f,o-u,s-l,o,s-l,o+u,s-l,o+a,s-f,o+a,s].join(",")+"z"):n==="line"?i="M"+R.x1+","+R.y1+" L"+R.x2+","+R.y2:(n==="polyline"||n==="polygon")&&(d=(t.getAttribute("points")+"").match(mS)||[],o=d.shift(),s=d.shift(),i="M"+o+","+s+" L"+d.join(","),n==="polygon"&&(i+=","+o+","+s+"z")),c.setAttribute("d",hn(c._gsRawPath=kt(i))),e&&t.parentNode&&(t.parentNode.insertBefore(c,t),t.parentNode.removeChild(t)),c)}function Yp(t,e,n){var r=t[e],i=t[e+2],o=t[e+4],s;return r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,s=i+(o+(t[e+6]-o)*n-i)*n-r,r=t[e+1],i=t[e+3],o=t[e+5],r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,Oe(jr(i+(o+(t[e+7]-o)*n-i)*n-r,s)*bS)}function Xp(t,e,n){n=xS(n)?1:Up(n)||0,e=Up(e)||0;var r=Math.max(0,~~(mt(n-e)-1e-8)),i=wS(t);if(e>n&&(e=1-e,n=1-n,ES(i),i.totalLength=0),e<0||n<0){var o=Math.abs(~~Math.min(e,n))+1;e+=o,n+=o}i.totalLength||Zt(i);var s=n>1,a=zp(i,e,vS,!0),l=zp(i,n,TS),c=l.segment,u=a.segment,f=l.segIndex,d=a.segIndex,h=l.i,p=a.i,m=d===f,g=h===p&&m,y,b,x,v,T,w,O,C;if(s||r){for(y=f<d||m&&h<p||g&&l.t<a.t,jp(i,d,p,a.t)&&(d++,y||(f++,g?(l.t=(l.t-a.t)/(1-a.t),h=0):m&&(h-=p))),Math.abs(1-(n-e))<1e-5?f=d-1:!l.t&&f?f--:jp(i,f,h,l.t)&&y&&d++,a.t===1&&(d=(d+1)%i.length),T=[],w=i.length,O=1+w*r,C=d,O+=(w-d+f)%w,v=0;v<O;v++)SS(T,i[C++%w]);i=T}else if(x=l.t===1?6:Ta(c,h,l.t),e!==n)for(b=Ta(u,p,g?a.t/l.t:a.t),m&&(x+=b),c.splice(h+x+2),(b||p)&&u.splice(0,p+b),v=i.length;v--;)(v<d||v>f)&&i.splice(v,1);else c.angle=Yp(c,h+x,0),h+=x,a=c[h],l=c[h+1],c.length=c.totalLength=0,c.totalPoints=i.totalPoints=8,c.push(a,l,a,l,a,l,a,l);return i.totalLength=0,i}function Wp(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var r=~~t.resolution||12,i=1/r,o=t.length,s=t[e],a=t[e+1],l=e?e/6*r:0,c=t.samples,u=t.lookup,f=(e?t.minLength:ba)||ba,d=c[l+n*r-1],h=e?c[l-1]:0,p,m,g,y,b,x,v,T,w,O,C,R,P,A,L,N,D;for(c.length=u.length=0,m=e+2;m<o;m+=6){if(g=t[m+4]-s,y=t[m+2]-s,b=t[m]-s,T=t[m+5]-a,w=t[m+3]-a,O=t[m+1]-a,x=v=C=R=0,mt(g)<.01&&mt(T)<.01&&mt(b)+mt(O)<.01)t.length>8&&(t.splice(m,6),m-=6,o-=6);else for(p=1;p<=r;p++)A=i*p,P=1-A,x=v-(v=(A*A*g+3*P*(A*y+P*b))*A),C=R-(R=(A*A*T+3*P*(A*w+P*O))*A),N=Kt(C*C+x*x),N<f&&(f=N),h+=N,c[l++]=h;s+=g,a+=T}if(d)for(d-=h;l<c.length;l++)c[l]+=d;if(c.length&&f){if(t.totalLength=D=c[c.length-1]||0,t.minLength=f,D/f<9999)for(N=L=0,p=0;p<D;p+=f)u[N++]=c[L]<p?++L:L}else t.totalLength=c[0]=0;return e?h-c[e/2-1]:h}function Zt(t,e){var n,r,i;for(i=n=r=0;i<t.length;i++)t[i].resolution=~~e||12,n+=Wp(t[i]),r+=t[i].length;return t.totalPoints=r,t.totalLength=n,t}function Ta(t,e,n){if(n<=0||n>=1)return 0;var r=t[e],i=t[e+1],o=t[e+2],s=t[e+3],a=t[e+4],l=t[e+5],c=t[e+6],u=t[e+7],f=r+(o-r)*n,d=o+(a-o)*n,h=i+(s-i)*n,p=s+(l-s)*n,m=f+(d-f)*n,g=h+(p-h)*n,y=a+(c-a)*n,b=l+(u-l)*n;return d+=(y-d)*n,p+=(b-p)*n,t.splice(e+2,4,Oe(f),Oe(h),Oe(m),Oe(g),Oe(m+(d-m)*n),Oe(g+(p-g)*n),Oe(d),Oe(p),Oe(y),Oe(b)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}function zp(t,e,n,r){n=n||{},t.totalLength||Zt(t),(e<0||e>1)&&(e=Bp(e));var i=0,o=t[0],s,a,l,c,u,f,d;if(!e)d=f=i=0,o=t[0];else if(e===1)d=1,i=t.length-1,o=t[i],f=o.length-8;else{if(t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=f;o=t[i],c=u-o.totalLength,e=(l-c)/(u-c)||0}s=o.samples,a=o.resolution,l=o.totalLength*e,f=o.lookup.length?o.lookup[~~(l/o.minLength)]||0:xa(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a),f=~~(f/a)*6,r&&d===1&&(f+6<o.length?(f+=6,d=0):i+1<t.length&&(f=d=0,o=t[++i]))}return n.t=d,n.i=f,n.path=t,n.segment=o,n.segIndex=i,n}function qp(t,e,n,r){var i=t[0],o=r||{},s,a,l,c,u,f,d,h,p;if((e<0||e>1)&&(e=Bp(e)),i.lookup||Zt(t),t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=t[f];c=u-i.totalLength,e=(l-c)/(u-c)||0}return s=i.samples,a=i.resolution,l=i.totalLength*e,f=i.lookup.length?i.lookup[e<1?~~(l/i.minLength):i.lookup.length-1]||0:xa(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a)||0,p=1-d,f=~~(f/a)*6,h=i[f],o.x=Oe((d*d*(i[f+6]-h)+3*p*(d*(i[f+4]-h)+p*(i[f+2]-h)))*d+h),o.y=Oe((d*d*(i[f+7]-(h=i[f+1]))+3*p*(d*(i[f+5]-h)+p*(i[f+3]-h)))*d+h),n&&(o.angle=i.totalLength?Yp(i,f,d>=1?1-1e-9:d||1e-9):i.angle||0),o}function Yr(t,e,n,r,i,o,s){for(var a=t.length,l,c,u,f,d;--a>-1;)for(l=t[a],c=l.length,u=0;u<c;u+=2)f=l[u],d=l[u+1],l[u]=f*e+d*r+o,l[u+1]=f*n+d*i+s;return t._dirty=1,t}function RS(t,e,n,r,i,o,s,a,l){if(!(t===a&&e===l)){n=mt(n),r=mt(r);var c=i%360*_S,u=Wi(c),f=Xi(c),d=Math.PI,h=d*2,p=(t-a)/2,m=(e-l)/2,g=u*p+f*m,y=-f*p+u*m,b=g*g,x=y*y,v=b/(n*n)+x/(r*r);v>1&&(n=Kt(v)*n,r=Kt(v)*r);var T=n*n,w=r*r,O=(T*w-T*x-w*b)/(T*x+w*b);O<0&&(O=0);var C=(o===s?-1:1)*Kt(O),R=C*(n*y/r),P=C*-(r*g/n),A=(t+a)/2,L=(e+l)/2,N=A+(u*R-f*P),D=L+(f*R+u*P),F=(g-R)/n,G=(y-P)/r,z=(-g-R)/n,K=(-y-P)/r,se=F*F+G*G,pe=(G<0?-1:1)*Math.acos(F/Kt(se)),X=(F*K-G*z<0?-1:1)*Math.acos((F*z+G*K)/Kt(se*(z*z+K*K)));isNaN(X)&&(X=d),!s&&X>0?X-=h:s&&X<0&&(X+=h),pe%=h,X%=h;var he=Math.ceil(mt(X)/(h/4)),j=[],te=X/he,H=4/3*Xi(te/2)/(1+Wi(te/2)),ae=u*n,Z=f*n,ce=f*-r,J=u*r,ie;for(ie=0;ie<he;ie++)i=pe+ie*te,g=Wi(i),y=Xi(i),F=Wi(i+=te),G=Xi(i),j.push(g-H*y,y+H*g,F+H*G,G-H*F,F,G);for(ie=0;ie<j.length;ie+=2)g=j[ie],y=j[ie+1],j[ie]=g*ae+y*ce+N,j[ie+1]=g*Z+y*J+D;return j[ie-2]=a,j[ie-1]=l,j}}function kt(t){var e=(t+"").replace(gS,function(R){var P=+R;return P<1e-4&&P>-1e-4?0:P}).match(pS)||[],n=[],r=0,i=0,o=2/3,s=e.length,a=0,l="ERROR: malformed path: "+t,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C=function(P,A,L,N){b=(L-P)/3,x=(N-A)/3,m.push(P+b,A+x,L-b,N-x,L,N)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(l),n;for(c=0;c<s;c++)if(T=h,isNaN(e[c])?(h=e[c].toUpperCase(),p=h!==e[c]):c--,f=+e[c+1],d=+e[c+2],p&&(f+=r,d+=i),c||(g=f,y=d),h==="M")m&&(m.length<8?n.length-=1:a+=m.length,Gp(m)),r=g=f,i=y=d,m=[f,d],n.push(m),c+=2,h="L";else if(h==="C")m||(m=[0,0]),p||(r=i=0),m.push(f,d,r+e[c+3]*1,i+e[c+4]*1,r+=e[c+5]*1,i+=e[c+6]*1),c+=6;else if(h==="S")b=r,x=i,(T==="C"||T==="S")&&(b+=r-m[m.length-4],x+=i-m[m.length-3]),p||(r=i=0),m.push(b,x,f,d,r+=e[c+3]*1,i+=e[c+4]*1),c+=4;else if(h==="Q")b=r+(f-r)*o,x=i+(d-i)*o,p||(r=i=0),r+=e[c+3]*1,i+=e[c+4]*1,m.push(b,x,r+(f-r)*o,i+(d-i)*o,r,i),c+=4;else if(h==="T")b=r-m[m.length-4],x=i-m[m.length-3],m.push(r+b,i+x,f+(r+b*1.5-f)*o,d+(i+x*1.5-d)*o,r=f,i=d),c+=2;else if(h==="H")C(r,i,r=f,i),c+=1;else if(h==="V")C(r,i,r,i=f+(p?i-r:0)),c+=1;else if(h==="L"||h==="Z")h==="Z"&&(f=g,d=y,m.closed=!0),(h==="L"||mt(r-f)>.5||mt(i-d)>.5)&&(C(r,i,f,d),h==="L"&&(c+=2)),r=f,i=d;else if(h==="A"){if(w=e[c+4],O=e[c+5],b=e[c+6],x=e[c+7],u=7,w.length>1&&(w.length<3?(x=b,b=O,u--):(x=O,b=w.substr(2),u-=2),O=w.charAt(1),w=w.charAt(0)),v=RS(r,i,+e[c+1],+e[c+2],+e[c+3],+w,+O,(p?r:0)+b*1,(p?i:0)+x*1),c+=u,v)for(u=0;u<v.length;u++)m.push(v[u]);r=m[m.length-2],i=m[m.length-1]}else console.log(l);return c=m.length,c<6?(n.pop(),c=0):Gp(m),n.totalPoints=a+c,n}function IS(t,e){e===void 0&&(e=1);for(var n=t[0],r=0,i=[n,r],o=2;o<t.length;o+=2)i.push(n,r,t[o],r=(t[o]-n)*e/2,n=t[o],-r);return i}function MS(t,e){t.samples||Wp(t);for(var n=t.samples,r=t.lookup,i=t.resolution,o=t.totalLength,s=t.slice(0,2),a=[],l=t.length-4,c=6,u=.2,f=0,d=0,h,p,m,g,y,b,x,v,T,w,O,C,R,P;c<l;c+=6)Math.abs(jr(t[c+1]-t[c-1],t[c]-t[c-2])-jr(t[c+3]-t[c+1],t[c+2]-t[c]))>u&&a.push(c);if(a.push(t.length-2),l=a.length,s.nonSmooth=C=[1],e>l)for(e-=l,y=0;y<l;y++){for(R=a[y],P=Math.round(R/6*i),T=n[P-1]-f,p=Math.round(n[P-1]/o*e)-d,d+=p,b=1/(p+1),x=1;x<=p;x++)w=f+T*x*b,c=r.length?r[w<o?~~(w/t.minLength):r.length-1]||0:xa(n,w,w/o),m=c?n[c-1]:0,g=n[c],g<w&&(m=g,g=n[++c]),h=1/i*((w-m)/(g-m)+c%i)||0,v=1-h,c=~~(c/i)*6,O=t[c],s.push(Oe((h*h*(t[c+6]-O)+3*v*(h*(t[c+4]-O)+v*(t[c+2]-O)))*h+O),Oe((h*h*(t[c+7]-(O=t[c+1]))+3*v*(h*(t[c+5]-O)+v*(t[c+3]-O)))*h+O));C[s.length]=1,s.push(t[R],t[R+1]),f+=T}return c=t.length-2,t.closed&&Math.abs(jr(t[c+1]-t[c-1],t[c]-t[c-2])-jr(t[3]-t[1],t[2]-t[0]))<=u&&(C[0]=C[C.length-1]=0),s}function qi(t,e){mt(t[0]-t[2])<1e-4&&mt(t[1]-t[3])<1e-4&&(t=t.slice(2));var n=t.length-2,r=+t[0],i=+t[1],o=+t[2],s=+t[3],a=[r,i,r,i],l=o-r,c=s-i,u=t.nonSmooth||[],f=Math.abs(t[n]-r)<.001&&Math.abs(t[n+1]-i)<.001,d,h,p,m,g,y,b,x,v,T,w,O,C,R,P;if(!n)return[r,i,r,i,r,i,r,i];for(f&&(t.push(o,s),o=r,s=i,r=t[n-2],i=t[n-1],t.unshift(r,i),n+=4,u=[0,0].concat(u)),e=e||e===0?+e:1,p=2;p<n;p+=2)if(d=r,h=i,r=o,i=s,o=+t[p+2],s=+t[p+3],!(r===o&&i===s)){if(m=l,g=c,l=o-r,c=s-i,u[p]){a.push(r-(r-d)/4,i-(i-h)/4,r,i,r+(o-r)/4,i+(s-i)/4);continue}y=Kt(m*m+g*g),b=Kt(l*l+c*c),x=Kt(Math.pow(l/b+m/y,2)+Math.pow(c/b+g/y,2)),v=(y+b)*e*.25/x,T=r-(r-d)*(y?v/y:0),w=r+(o-r)*(b?v/b:0),O=r-(T+((w-T)*(y*3/(y+b)+.5)/4||0)),C=i-(i-h)*(y?v/y:0),R=i+(s-i)*(b?v/b:0),P=i-(C+((R-C)*(y*3/(y+b)+.5)/4||0)),a.push(Oe(T+O),Oe(C+P),Oe(r),Oe(i),Oe(w+O),Oe(R+P))}return r!==o||i!==s||a.length<4?a.push(Oe(o),Oe(s),Oe(o),Oe(s)):a.length-=2,a.length===2?a.push(r,i,r,i,r,i):f&&(a.splice(0,6),a.length-=6),a.closed=f,a}function hn(t){Fp(t[0])&&(t=[t]);var e="",n=t.length,r,i,o,s;for(i=0;i<n;i++){for(s=t[i],e+="M"+Oe(s[0])+","+Oe(s[1])+" C",r=s.length,o=2;o<r;o++)e+=Oe(s[o++])+","+Oe(s[o++])+" "+Oe(s[o++])+","+Oe(s[o++])+" "+Oe(s[o++])+","+Oe(s[o])+" ";s.closed&&(e+="z")}return e}var $t,kn,Ea,Vi,Xr,Ki,Zi,Wr,wt="transform",Sa=wt+"Origin",Vp,Kp=function(e){var n=e.ownerDocument||e;for(!(wt in e.style)&&("msTransform"in e.style)&&(wt="msTransform",Sa=wt+"Origin");n.parentNode&&(n=n.parentNode););if(kn=window,Zi=new zr,n){$t=n,Ea=n.documentElement,Vi=n.body,Wr=$t.createElementNS("http://www.w3.org/2000/svg","g"),Wr.style.transform="none";var r=n.createElement("div"),i=n.createElement("div"),o=n&&(n.body||n.firstElementChild);o&&o.appendChild&&(o.appendChild(r),r.appendChild(i),r.style.position="static",r.style.transform="translate3d(0,0,1px)",Vp=i.offsetParent!==r,o.removeChild(r))}return n},LS=function(e){for(var n,r;e&&e!==Vi;)r=e._gsap,r&&r.uncache&&r.get(e,"x"),r&&!r.scaleX&&!r.scaleY&&r.renderTransform&&(r.scaleX=r.scaleY=1e-4,r.renderTransform(1,r),n?n.push(r):n=[r]),e=e.parentNode;return n},Zp=[],$p=[],PS=function(){return kn.pageYOffset||$t.scrollTop||Ea.scrollTop||Vi.scrollTop||0},NS=function(){return kn.pageXOffset||$t.scrollLeft||Ea.scrollLeft||Vi.scrollLeft||0},wa=function(e){return e.ownerSVGElement||((e.tagName+"").toLowerCase()==="svg"?e:null)},kS=function t(e){if(kn.getComputedStyle(e).position==="fixed")return!0;if(e=e.parentNode,e&&e.nodeType===1)return t(e)},Aa=function t(e,n){if(e.parentNode&&($t||Kp(e))){var r=wa(e),i=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o=r?n?"rect":"g":"div",s=n!==2?0:100,a=n===3?100:0,l={position:"absolute",display:"block",pointerEvents:"none",margin:"0",padding:"0"},c=$t.createElementNS?$t.createElementNS(i.replace(/^https/,"http"),o):$t.createElement(o);return n&&(r?(Ki||(Ki=t(e)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+s+","+a+")"),c.setAttribute("fill","transparent"),Ki.appendChild(c)):(Xr||(Xr=t(e),Object.assign(Xr.style,l)),Object.assign(c.style,l,{width:"0.1px",height:"0.1px",top:a+"px",left:s+"px"}),Xr.appendChild(c))),c}throw"Need document and parent."},DS=function(e){for(var n=new zr,r=0;r<e.numberOfItems;r++)n.multiply(e.getItem(r).matrix);return n},FS=function(e){var n=e.getCTM(),r;return n||(r=e.style[wt],e.style[wt]="none",e.appendChild(Wr),n=Wr.getCTM(),e.removeChild(Wr),r?e.style[wt]=r:e.style.removeProperty(wt.replace(/([A-Z])/g,"-$1").toLowerCase())),n||Zi.clone()},BS=function(e,n){var r=wa(e),i=e===r,o=r?Zp:$p,s=e.parentNode,a=s&&!r&&s.shadowRoot&&s.shadowRoot.appendChild?s.shadowRoot:s,l,c,u,f,d,h;if(e===kn)return e;if(o.length||o.push(Aa(e,1),Aa(e,2),Aa(e,3)),l=r?Ki:Xr,r)i?(u=FS(e),f=-u.e/u.a,d=-u.f/u.d,c=Zi):e.getBBox?(u=e.getBBox(),c=e.transform?e.transform.baseVal:{},c=c.numberOfItems?c.numberOfItems>1?DS(c):c.getItem(0).matrix:Zi,f=c.a*u.x+c.c*u.y,d=c.b*u.x+c.d*u.y):(c=new zr,f=d=0),n&&e.tagName.toLowerCase()==="g"&&(f=d=0),(i||!e.getBoundingClientRect().width?r:s).appendChild(l),l.setAttribute("transform","matrix("+c.a+","+c.b+","+c.c+","+c.d+","+(c.e+f)+","+(c.f+d)+")");else{if(f=d=0,Vp)for(c=e.offsetParent,u=e;u&&(u=u.parentNode)&&u!==c&&u.parentNode;)(kn.getComputedStyle(u)[wt]+"").length>4&&(f=u.offsetLeft,d=u.offsetTop,u=0);if(h=kn.getComputedStyle(e),h.position!=="absolute"&&h.position!=="fixed")for(c=e.offsetParent;s&&s!==c;)f+=s.scrollLeft||0,d+=s.scrollTop||0,s=s.parentNode;u=l.style,u.top=e.offsetTop-d+"px",u.left=e.offsetLeft-f+"px",u[wt]=h[wt],u[Sa]=h[Sa],u.position=h.position==="fixed"?"fixed":"absolute",a.appendChild(l)}return l},Oa=function(e,n,r,i,o,s,a){return e.a=n,e.b=r,e.c=i,e.d=o,e.e=s,e.f=a,e},zr=(function(){function t(n,r,i,o,s,a){n===void 0&&(n=1),r===void 0&&(r=0),i===void 0&&(i=0),o===void 0&&(o=1),s===void 0&&(s=0),a===void 0&&(a=0),Oa(this,n,r,i,o,s,a)}var e=t.prototype;return e.inverse=function(){var r=this.a,i=this.b,o=this.c,s=this.d,a=this.e,l=this.f,c=r*s-i*o||1e-10;return Oa(this,s/c,-i/c,-o/c,r/c,(o*l-s*a)/c,-(r*l-i*a)/c)},e.multiply=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f,u=r.a,f=r.c,d=r.b,h=r.d,p=r.e,m=r.f;return Oa(this,u*i+d*s,u*o+d*a,f*i+h*s,f*o+h*a,l+p*i+m*s,c+p*o+m*a)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f;return i===r.a&&o===r.b&&s===r.c&&a===r.d&&l===r.e&&c===r.f},e.apply=function(r,i){i===void 0&&(i={});var o=r.x,s=r.y,a=this.a,l=this.b,c=this.c,u=this.d,f=this.e,d=this.f;return i.x=o*a+s*c+f||0,i.y=o*l+s*u+d||0,i},t})();function rr(t,e,n,r){if(!t||!t.parentNode||($t||Kp(t)).documentElement===t)return new zr;var i=LS(t),o=wa(t),s=o?Zp:$p,a=BS(t,n),l=s[0].getBoundingClientRect(),c=s[1].getBoundingClientRect(),u=s[2].getBoundingClientRect(),f=a.parentNode,d=!r&&kS(t),h=new zr((c.left-l.left)/100,(c.top-l.top)/100,(u.left-l.left)/100,(u.top-l.top)/100,l.left+(d?0:NS()),l.top+(d?0:PS()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return e?h.inverse():h}var US="x,translateX,left,marginLeft,xPercent".split(","),GS="y,translateY,top,marginTop,yPercent".split(","),jS=Math.PI/180,gt,Jp,ir,Ca,Ra,Qp,HS=function(){return gt||typeof window<"u"&&(gt=window.gsap)&&gt.registerPlugin&&gt},qr=function(e,n,r,i){for(var o=n.length,s=i===2?0:i,a=0;a<o;a++)e[s]=parseFloat(n[a][r]),i===2&&(e[s+1]=0),s+=2;return e},or=function(e,n,r){return parseFloat(e._gsap.get(e,n,r||"px"))||0},em=function(e){var n=e[0],r=e[1],i;for(i=2;i<e.length;i+=2)n=e[i]+=n,r=e[i+1]+=r},tm=function(e,n,r,i,o,s,a,l,c){if(a.type==="cubic")n=[n];else{a.fromCurrent!==!1&&n.unshift(or(r,i,l),o?or(r,o,c):0),a.relative&&em(n);var u=o?qi:IS;n=[u(n,a.curviness)]}return n=s(rm(n,r,a)),$i(e,r,i,n,"x",l),o&&$i(e,r,o,n,"y",c),Zt(n,a.resolution||(a.curviness===0?20:12))},YS=function(e){return e},XS=/[-+\.]*\d+\.?(?:e-|e\+)?\d*/g,nm=function(e,n,r){var i=rr(e),o=0,s=0,a;return(e.tagName+"").toLowerCase()==="svg"?(a=e.viewBox.baseVal,a.width||(a={width:+e.getAttribute("width"),height:+e.getAttribute("height")})):a=n&&e.getBBox&&e.getBBox(),n&&n!=="auto"&&(o=n.push?n[0]*(a?a.width:e.offsetWidth||0):n.x,s=n.push?n[1]*(a?a.height:e.offsetHeight||0):n.y),r.apply(o||s?i.apply({x:o,y:s}):{x:i.e,y:i.f})},Ia=function(e,n,r,i){var o=rr(e.parentNode,!0,!0),s=o.clone().multiply(rr(n)),a=nm(e,r,o),l=nm(n,i,o),c=l.x,u=l.y,f;return s.e=s.f=0,i==="auto"&&n.getTotalLength&&n.tagName.toLowerCase()==="path"&&(f=n.getAttribute("d").match(XS)||[],f=s.apply({x:+f[0],y:+f[1]}),c+=f.x,u+=f.y),f&&(f=s.apply(n.getBBox()),c-=f.x,u-=f.y),s.e=c-a.x,s.f=u-a.y,s},rm=function(e,n,r){var i=r.align,o=r.matrix,s=r.offsetX,a=r.offsetY,l=r.alignOrigin,c=e[0][0],u=e[0][1],f=or(n,"x"),d=or(n,"y"),h,p,m;return!e||!e.length?Hr("M0,0L0,0"):(i&&(i==="self"||(h=Ca(i)[0]||n)===n?Yr(e,1,0,0,1,f-c,d-u):(l&&l[2]!==!1?gt.set(n,{transformOrigin:l[0]*100+"% "+l[1]*100+"%"}):l=[or(n,"xPercent")/-100,or(n,"yPercent")/-100],p=Ia(n,h,l,"auto"),m=p.apply({x:c,y:u}),Yr(e,p.a,p.b,p.c,p.d,f+p.e-(m.x-p.e),d+p.f-(m.y-p.f)))),o?Yr(e,o.a,o.b,o.c,o.d,o.e,o.f):(s||a)&&Yr(e,1,0,0,1,s||0,a||0),e)},$i=function(e,n,r,i,o,s){var a=n._gsap,l=a.harness,c=l&&l.aliases&&l.aliases[r],u=c&&c.indexOf(",")<0?c:r,f=e._pt=new Jp(e._pt,n,u,0,0,YS,0,a.set(n,u,e));f.u=ir(a.get(n,u,s))||0,f.path=i,f.pp=o,e._props.push(u)},WS=function(e,n){return function(r){return e||n!==1?Xp(r,e,n):r}},im={version:"3.15.0",name:"motionPath",register:function(e,n,r){gt=e,ir=gt.utils.getUnit,Ca=gt.utils.toArray,Ra=gt.core.getStyleSaver,Qp=gt.core.reverting||function(){},Jp=r},init:function(e,n,r){if(!gt)return console.warn("Please gsap.registerPlugin(MotionPathPlugin)"),!1;(!(typeof n=="object"&&!n.style)||!n.path)&&(n={path:n});var i=[],o=n,s=o.path,a=o.autoRotate,l=o.unitX,c=o.unitY,u=o.x,f=o.y,d=s[0],h=WS(n.start,"end"in n?n.end:1),p,m;if(this.rawPaths=i,this.target=e,this.tween=r,this.styles=Ra&&Ra(e,"transform"),(this.rotate=a||a===0)&&(this.rOffset=parseFloat(a)||0,this.radians=!!n.useRadians,this.rProp=n.rotation||"rotation",this.rSet=e._gsap.set(e,this.rProp,this),this.ru=ir(e._gsap.get(e,this.rProp))||0),Array.isArray(s)&&!("closed"in s)&&typeof d!="number"){for(m in d)!u&&~US.indexOf(m)?u=m:!f&&~GS.indexOf(m)&&(f=m);u&&f?i.push(tm(this,qr(qr([],s,u,0),s,f,1),e,u,f,h,n,l||ir(s[0][u]),c||ir(s[0][f]))):u=f=0;for(m in d)m!==u&&m!==f&&i.push(tm(this,qr([],s,m,2),e,m,0,h,n,ir(s[0][m])))}else p=h(rm(Hr(n.path),e,n)),Zt(p,n.resolution),i.push(p),$i(this,e,n.x||"x",p,"x",n.unitX||"px"),$i(this,e,n.y||"y",p,"y",n.unitY||"px");r.vars.immediateRender&&this.render(r.progress(),this)},render:function(e,n){var r=n.rawPaths,i=r.length,o=n._pt;if(n.tween._time||!Qp()){for(e>1?e=1:e<0&&(e=0);i--;)qp(r[i],e,!i&&n.rotate,r[i]);for(;o;)o.set(o.t,o.p,o.path[o.pp]+o.u,o.d,e),o=o._next;n.rotate&&n.rSet(n.target,n.rProp,r[0].angle*(n.radians?jS:1)+n.rOffset+n.ru,n,e)}else n.styles.revert()},getLength:function(e){return Zt(Hr(e)).totalLength},sliceRawPath:Xp,getRawPath:Hr,pointsToSegment:qi,stringToRawPath:kt,rawPathToString:hn,transformRawPath:Yr,getGlobalMatrix:rr,getPositionOnPath:qp,cacheRawPathMeasurements:Zt,convertToPath:function(e,n){return Ca(e).map(function(r){return va(r,n!==!1)})},convertCoordinates:function(e,n,r){var i=rr(n,!0,!0).multiply(rr(e));return r?i.apply(r):i},getAlignMatrix:Ia,getRelativePosition:function(e,n,r,i){var o=Ia(e,n,r,i);return{x:o.e,y:o.f}},arrayToRawPath:function(e,n){n=n||{};var r=qr(qr([],e,n.x||"x",0),e,n.y||"y",1);return n.relative&&em(r),[n.type==="cubic"?r:qi(r,n.curviness)]}};HS()&&gt.registerPlugin(im),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerPlugin(wn),wn.create("springBounce","0.32, 1.06, 0.61, 0.93"),E.registerEffect({name:"HEART_BEAT",effect(t,e){try{const{canvasWidth:r,canvasHeight:i,...o}=e;return E.timeline({repeat:e.repeat||0,defaults:{ease:"power2.out",...o}}).to(t,{pixi:{scale:1*1.3},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.14,ease:"power2.in"}).to(t,{pixi:{scale:1*1.2},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.28,ease:"power2.in"})}catch(n){return console.error("[HEART_BEAT] Animation error:",n),E.timeline()}}});const re={IN:"IN",OUT:"OUT",ATTENTION:"ATTENTION"},ee={NONE:"NONE",FADE:"FADE",SLIDE:"SLIDE",ZOOM:"ZOOM",BOUNCE:"BOUNCE",BACK:"BACK",FLIP:"FLIP",ROTATE:"ROTATE",ROLL:"ROLL",LIGHT_SPEED:"LIGHT_SPEED",WIPE:"WIPE",SHAKE:"SHAKE",SPECIAL:"SPECIAL"},Pe={OFFSET_MEDIUM:2e3}.OFFSET_MEDIUM,Te={NONE:{id:"NONE",category:ee.NONE,direction:null,keyframes:{},gsapEasing:"none",defaultDuration:0},FADE_IN:{id:"FADE_IN",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5},FADE_IN_DOWN:{id:"FADE_IN_DOWN",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_UP:{id:"FADE_IN_UP",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_LEFT:{id:"FADE_IN_LEFT",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_RIGHT:{id:"FADE_IN_RIGHT",category:ee.FADE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_OUT:{id:"FADE_OUT",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_DOWN:{id:"FADE_OUT_DOWN",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_UP:{id:"FADE_OUT_UP",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_LEFT:{id:"FADE_OUT_LEFT",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_RIGHT:{id:"FADE_OUT_RIGHT",category:ee.FADE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_DOWN:{id:"SLIDE_IN_DOWN",category:ee.SLIDE,direction:re.IN,keyframes:{translateY:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_UP:{id:"SLIDE_IN_UP",category:ee.SLIDE,direction:re.IN,keyframes:{translateY:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_LEFT:{id:"SLIDE_IN_LEFT",category:ee.SLIDE,direction:re.IN,keyframes:{translateX:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_RIGHT:{id:"SLIDE_IN_RIGHT",category:ee.SLIDE,direction:re.IN,keyframes:{translateX:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_DOWN:{id:"SLIDE_OUT_DOWN",category:ee.SLIDE,direction:re.OUT,keyframes:{translateY:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_UP:{id:"SLIDE_OUT_UP",category:ee.SLIDE,direction:re.OUT,keyframes:{translateY:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_LEFT:{id:"SLIDE_OUT_LEFT",category:ee.SLIDE,direction:re.OUT,keyframes:{translateX:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_RIGHT:{id:"SLIDE_OUT_RIGHT",category:ee.SLIDE,direction:re.OUT,keyframes:{translateX:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN:{id:"ZOOM_IN",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1,midPoint:.5},scale:{from:.3,to:1}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN_DOWN:{id:"ZOOM_IN_DOWN",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:-1e3,mid:60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_UP:{id:"ZOOM_IN_UP",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:1e3,mid:-60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_LEFT:{id:"ZOOM_IN_LEFT",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:-1e3,mid:10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_RIGHT:{id:"ZOOM_IN_RIGHT",category:ee.ZOOM,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:1e3,mid:-10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_OUT:{id:"ZOOM_OUT",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0,midPoint:.5},scale:{from:1,to:.3}},gsapEasing:"power2.in",defaultDuration:.5},ZOOM_OUT_DOWN:{id:"ZOOM_OUT_DOWN",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:-60,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_UP:{id:"ZOOM_OUT_UP",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:60,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_LEFT:{id:"ZOOM_OUT_LEFT",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:42,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_RIGHT:{id:"ZOOM_OUT_RIGHT",category:ee.ZOOM,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:-42,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},BACK_IN_DOWN:{id:"BACK_IN_DOWN",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_UP:{id:"BACK_IN_UP",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_LEFT:{id:"BACK_IN_LEFT",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_RIGHT:{id:"BACK_IN_RIGHT",category:ee.BACK,direction:re.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_OUT_DOWN:{id:"BACK_OUT_DOWN",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_UP:{id:"BACK_OUT_UP",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_LEFT:{id:"BACK_OUT_LEFT",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_RIGHT:{id:"BACK_OUT_RIGHT",category:ee.BACK,direction:re.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BOUNCE_IN:{id:"BOUNCE_IN",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.3,to:1}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_DOWN:{id:"BOUNCE_IN_DOWN",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_UP:{id:"BOUNCE_IN_UP",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_LEFT:{id:"BOUNCE_IN_LEFT",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_RIGHT:{id:"BOUNCE_IN_RIGHT",category:ee.BOUNCE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_OUT:{id:"BOUNCE_OUT",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,to:.3}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_DOWN:{id:"BOUNCE_OUT_DOWN",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_UP:{id:"BOUNCE_OUT_UP",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_LEFT:{id:"BOUNCE_OUT_LEFT",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_RIGHT:{id:"BOUNCE_OUT_RIGHT",category:ee.BOUNCE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},FLIP:{id:"FLIP",category:ee.FLIP,direction:re.ATTENTION,keyframes:{rotation:{from:-360,mid1:-190,mid2:-170,to:0},scale:{from:1,mid:.95,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_X:{id:"FLIP_IN_X",category:ee.FLIP,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleY:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_Y:{id:"FLIP_IN_Y",category:ee.FLIP,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleX:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_X:{id:"FLIP_OUT_X",category:ee.FLIP,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scaleY:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_Y:{id:"FLIP_OUT_Y",category:ee.FLIP,direction:re.OUT,keyframes:{opacity:{from:1,to:0},scaleX:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_LEFT:{id:"LIGHT_SPEED_IN_LEFT",category:ee.LIGHT_SPEED,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"-100%",to:0,atPercent:60},skewX:{from:30,mid1:-20,mid2:5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_RIGHT:{id:"LIGHT_SPEED_IN_RIGHT",category:ee.LIGHT_SPEED,direction:re.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"100%",to:0,atPercent:60},skewX:{from:-30,mid1:20,mid2:-5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_OUT_LEFT:{id:"LIGHT_SPEED_OUT_LEFT",category:ee.LIGHT_SPEED,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"-100%"},skewX:{from:0,to:-30}},gsapEasing:"power2.in",defaultDuration:.5},LIGHT_SPEED_OUT_RIGHT:{id:"LIGHT_SPEED_OUT_RIGHT",category:ee.LIGHT_SPEED,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},skewX:{from:0,to:30}},gsapEasing:"power2.in",defaultDuration:.5},ROTATE_IN:{id:"ROTATE_IN",category:ee.ROTATE,direction:re.IN,keyframes:{opacity:{from:0,to:1},rotation:{from:-200,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROTATE_OUT:{id:"ROTATE_OUT",category:ee.ROTATE,direction:re.OUT,keyframes:{opacity:{from:1,to:0},rotation:{from:0,to:200}},gsapEasing:"power1.in",defaultDuration:.5},ROLL_IN:{id:"ROLL_IN",category:ee.ROLL,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:"-100%",to:0},rotation:{from:-120,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROLL_OUT:{id:"ROLL_OUT",category:ee.ROLL,direction:re.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},rotation:{from:0,to:120}},gsapEasing:"power1.in",defaultDuration:.5},SHAKE:{id:"SHAKE",category:ee.SHAKE,direction:re.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_X:{id:"SHAKE_X",category:ee.SHAKE,direction:re.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_Y:{id:"SHAKE_Y",category:ee.SHAKE,direction:re.ATTENTION,keyframes:{shakeY:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},HEART_BEAT:{id:"HEART_BEAT",category:ee.SPECIAL,direction:re.ATTENTION,keyframes:{pulseScale:{min:1,max:1.3}},gsapEasing:"power1.inOut",defaultDuration:.5},PULSE:{id:"PULSE",category:ee.SPECIAL,direction:re.ATTENTION,keyframes:{pulseScale:{min:1,max:1.05}},gsapEasing:"power1.inOut",defaultDuration:.5},WIPE_LEFT:{id:"WIPE_LEFT",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_RIGHT:{id:"WIPE_RIGHT",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_UP:{id:"WIPE_UP",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_DOWN:{id:"WIPE_DOWN",category:ee.WIPE,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},RISE:{id:"RISE",category:ee.SPECIAL,direction:re.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:30,to:0},scale:{from:.95,to:1}},gsapEasing:"power2.out",defaultDuration:.5},TYPEWRITER:{id:"TYPEWRITER",category:ee.SPECIAL,direction:re.IN,keyframes:{typewriter:{text:"",duration:2,charactersPerSecond:20}},gsapEasing:"none",defaultDuration:2}};E.registerEffect({name:"FADE_IN",effect(t,e){try{const n=Te.FADE_IN;if(!n)return console.error("[FADE_IN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_DOWN",effect(t,e){try{const n=Te.FADE_IN_DOWN;if(!n)return console.error("[FADE_IN_DOWN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return E.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_UP",effect(t,e){try{const n=Te.FADE_IN_UP;if(!n)return console.error("[FADE_IN_UP] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return E.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_LEFT",effect(t,e){try{const n=Te.FADE_IN_LEFT;if(!n)return console.error("[FADE_IN_LEFT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return E.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){try{const n=Te.FADE_IN_RIGHT;if(!n)return console.error("[FADE_IN_RIGHT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return E.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT",effect(t,e){try{const n=Te.FADE_OUT;if(!n)return console.error("[FADE_OUT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_DOWN",effect(t,e){try{const n=Te.FADE_OUT_DOWN;if(!n)return console.error("[FADE_OUT_DOWN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_UP",effect(t,e){try{const n=Te.FADE_OUT_UP;if(!n)return console.error("[FADE_OUT_UP] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_LEFT",effect(t,e){try{const n=Te.FADE_OUT_LEFT;if(!n)return console.error("[FADE_OUT_LEFT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"FADE_OUT_RIGHT",effect(t,e){try{const n=Te.FADE_OUT_RIGHT;if(!n)return console.error("[FADE_OUT_RIGHT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return E.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_RIGHT] Animation error:",n),E.timeline()}}});function Ma(t){const e=Array.isArray(t)?t[0]:t;return e&&typeof e.addChild=="function"?e:null}const om=200;function zS(t){try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return om}function qS(t){try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return om}function pn(t,e,n,r){E.registerEffect({name:t,effect(i,o){try{const s=Te[t];if(!s)return console.error(`[${t}] Animation config not found`),E.timeline();const{duration:a=s?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=o,u=o.x??0,f=o.y??0,d=o.scaleX??1,h=o.scaleY??1,p=o.alpha??1,m=o.rotation??0,g=Ma(i)??i,y=e==="x"?zS(g):qS(g),b=e==="x"?u+r*y:u,x=e==="y"?f+r*y:f,v=n==="in"?{x:b,y:x,alpha:0}:{x:u,y:f,alpha:p},T=n==="in"?{x:u,y:f,alpha:p}:{x:b,y:x,alpha:0};return E.fromTo(i,{pixi:{x:v.x,y:v.y,scaleX:d,scaleY:h,alpha:v.alpha,rotation:m}},{pixi:{x:T.x,y:T.y,scaleX:d,scaleY:h,alpha:T.alpha,rotation:m},duration:a,ease:o.ease||s?.gsapEasing||"power2.out",immediateRender:l,overwrite:c})}catch(s){return console.error(`[${t}] Animation error:`,s),E.timeline()}}})}pn("SLIDE_IN_DOWN","y","in",-1),pn("SLIDE_IN_UP","y","in",1),pn("SLIDE_IN_LEFT","x","in",-1),pn("SLIDE_IN_RIGHT","x","in",1),pn("SLIDE_OUT_DOWN","y","out",1),pn("SLIDE_OUT_UP","y","out",-1),pn("SLIDE_OUT_LEFT","x","out",-1),pn("SLIDE_OUT_RIGHT","x","out",1),E.registerEffect({name:"ZOOM_IN",effect(t,e){try{const n=Te.ZOOM_IN;if(!n)return console.error("[ZOOM_IN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return E.fromTo(t,{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l}},{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l},duration:i,ease:e.ease||"power2.out",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_DOWN",effect(t,e){try{const n=Te.ZOOM_IN_DOWN;if(!n)return console.error("[ZOOM_IN_DOWN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||-1e3,s=n?.keyframes?.translateY?.mid||60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:m}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_UP",effect(t,e){try{const n=Te.ZOOM_IN_UP;if(!n)return console.error("[ZOOM_IN_UP] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||1e3,s=n?.keyframes?.translateY?.mid||-60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:m}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_LEFT",effect(t,e){try{const n=Te.ZOOM_IN_LEFT;if(!n)return console.error("[ZOOM_IN_LEFT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||-1e3,s=n?.keyframes?.translateX?.mid||10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:m,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_IN_RIGHT",effect(t,e){try{const n=Te.ZOOM_IN_RIGHT;if(!n)return console.error("[ZOOM_IN_RIGHT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||1e3,s=n?.keyframes?.translateX?.mid||-10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:m,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:p,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT",effect(t,e){try{const n=Te.ZOOM_OUT;if(!n)return console.error("[ZOOM_OUT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.to||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return E.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l}},{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l},duration:i,ease:e.ease||"power2.in",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_DOWN",effect(t,e){try{const n=Te.ZOOM_OUT_DOWN;if(!n)return console.error("[ZOOM_OUT_DOWN] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||-60,s=n?.keyframes?.translateY?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:m},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_DOWN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_UP",effect(t,e){try{const n=Te.ZOOM_OUT_UP;if(!n)return console.error("[ZOOM_OUT_UP] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||60,s=n?.keyframes?.translateY?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=f+o,g=f+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:m},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_UP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_LEFT",effect(t,e){try{const n=Te.ZOOM_OUT_LEFT;if(!n)return console.error("[ZOOM_OUT_LEFT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||42,s=n?.keyframes?.translateX?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:m,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ZOOM_OUT_RIGHT",effect(t,e){try{const n=Te.ZOOM_OUT_RIGHT;if(!n)return console.error("[ZOOM_OUT_RIGHT] Animation config not found"),E.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||-42,s=n?.keyframes?.translateX?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,p=e.alpha??1,m=u+o,g=u+s,y=E.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:p,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:m,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_RIGHT] Animation error:",n),E.timeline()}}});const sr=.7,La=.7,sm={BACK_IN_DOWN:{axis:"y",delta:-1200},BACK_IN_UP:{axis:"y",delta:1200},BACK_IN_LEFT:{axis:"x",delta:-2e3},BACK_IN_RIGHT:{axis:"x",delta:2e3}},am={BACK_OUT_DOWN:{axis:"y",delta:700},BACK_OUT_UP:{axis:"y",delta:-700},BACK_OUT_LEFT:{axis:"x",delta:-2e3},BACK_OUT_RIGHT:{axis:"x",delta:2e3}};function VS(t){const{axis:e,delta:n}=sm[t];E.registerEffect({name:t,effect(r,i){try{const o=Te[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,p=i.rotation??0,m=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.8,b=s*.2,x=E.timeline();return x.fromTo(r,{pixi:{x:m,y:g,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p}},{pixi:{x:c,y:u,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),x.to(r,{pixi:{scaleX:f,scaleY:d,alpha:h},duration:b,ease:"power1.out",immediateRender:!1},y),x}catch(o){return console.error(`[${t}] Animation error:`,o),E.timeline()}}})}function KS(t){const{axis:e,delta:n}=am[t];E.registerEffect({name:t,effect(r,i){try{const o=Te[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,p=i.rotation??0,m=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.2,b=s*.8,x=E.timeline();return x.fromTo(r,{pixi:{x:c,y:u,scaleX:f,scaleY:d,alpha:h,rotation:p}},{pixi:{x:c,y:u,scaleX:f*sr,scaleY:d*sr,alpha:La,rotation:p},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),x.to(r,{pixi:{x:m,y:g},duration:b,ease:"power1.in",immediateRender:!1},y),x}catch(o){return console.error(`[${t}] Animation error:`,o),E.timeline()}}})}Object.keys(sm).forEach(VS),Object.keys(am).forEach(KS);function ZS(t){const e=Te[t];if(!e){console.error(`[effectGenerator] Animation config not found: ${t}`);return}const{keyframes:n,gsapEasing:r,defaultDuration:i}=e;E.registerEffect({name:t,effect(o,s){try{const a=s.x??0,l=s.y??0,c=s.scaleX??1,u=s.scaleY??1,f=s.alpha??1,d=s.rotation??0,h={pixi:{}},p={pixi:{}};return h.pixi.x=a,h.pixi.y=l,p.pixi.x=a,p.pixi.y=l,n.opacity!==void 0?(h.pixi.alpha=n.opacity.from!==void 0?n.opacity.from:f,p.pixi.alpha=n.opacity.to!==void 0?n.opacity.to:f):(h.pixi.alpha=f,p.pixi.alpha=f),n.scale!==void 0&&(h.pixi.scale=n.scale.from,p.pixi.scale=n.scale.to),n.scaleX!==void 0?(h.pixi.scaleX=(n.scaleX.from??1)*c,p.pixi.scaleX=(n.scaleX.to??1)*c):n.scale||(h.pixi.scaleX=c,p.pixi.scaleX=c),n.scaleY!==void 0?(h.pixi.scaleY=(n.scaleY.from??1)*u,p.pixi.scaleY=(n.scaleY.to??1)*u):n.scale||(h.pixi.scaleY=u,p.pixi.scaleY=u),n.rotation!==void 0?(h.pixi.rotation=n.rotation.from??d,p.pixi.rotation=n.rotation.to??d):(h.pixi.rotation=d,p.pixi.rotation=d),n.skewX!==void 0&&(h.pixi.skewX=n.skewX.from??0,p.pixi.skewX=n.skewX.to??0),n.skewY!==void 0&&(h.pixi.skewY=n.skewY.from??0,p.pixi.skewY=n.skewY.to??0),n.translateX!==void 0&&(h.pixi.x=a+(n.translateX.from??0),p.pixi.x=a+(n.translateX.to??0)),n.translateY!==void 0&&(h.pixi.y=l+(n.translateY.from??0),p.pixi.y=l+(n.translateY.to??0)),E.fromTo(o,h,{...p,duration:s.duration||i,ease:s.ease||r,immediateRender:s.immediateRender??!0,overwrite:s.overwrite??"auto"})}catch(a){return console.error(`[${t}] Animation error:`,a),E.timeline()}}})}function Pa(t){t.forEach(e=>{try{ZS(e)}catch(n){console.error(`[effectGenerator] Failed to register effect: ${e}`,n)}})}Pa(["BOUNCE_IN","BOUNCE_IN_DOWN","BOUNCE_IN_UP","BOUNCE_IN_LEFT","BOUNCE_IN_RIGHT","BOUNCE_OUT","BOUNCE_OUT_DOWN","BOUNCE_OUT_UP","BOUNCE_OUT_LEFT","BOUNCE_OUT_RIGHT"]),E.registerEffect({name:"FLIP",effect(t,e){const n=Te.FLIP,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-360}},{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-190},duration:r*.4,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-170},duration:r*.1,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s*.95,scaleY:a*.95},duration:r*.3,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s,scaleY:a},duration:r*.2,ease:"power1.in"}),u}}),E.registerEffect({name:"FLIP_IN_X",effect(t,e){const n=Te.FLIP_IN_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a},duration:r*.2,ease:"power1.out"}),u}}),E.registerEffect({name:"FLIP_IN_Y",effect(t,e){const n=Te.FLIP_IN_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s},duration:r*.2,ease:"power1.out"}),u}}),E.registerEffect({name:"FLIP_OUT_X",effect(t,e){const n=Te.FLIP_OUT_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0},duration:r*.7,ease:"power1.in"}),u}}),E.registerEffect({name:"FLIP_OUT_Y",effect(t,e){const n=Te.FLIP_OUT_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0},duration:r*.7,ease:"power1.in"}),u}}),E.registerEffect({name:"LIGHT_SPEED_IN_LEFT",effect(t,e){try{const n=Te.LIGHT_SPEED_IN_LEFT;if(!n)return console.error("[LIGHT_SPEED_IN_LEFT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_IN_RIGHT",effect(t,e){try{const n=Te.LIGHT_SPEED_IN_RIGHT;if(!n)return console.error("[LIGHT_SPEED_IN_RIGHT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_OUT_LEFT",effect(t,e){try{const n=Te.LIGHT_SPEED_OUT_LEFT;if(!n)return console.error("[LIGHT_SPEED_OUT_LEFT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"LIGHT_SPEED_OUT_RIGHT",effect(t,e){try{const n=Te.LIGHT_SPEED_OUT_RIGHT;if(!n)return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=E.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation error:",n),E.timeline()}}});const cm=2e3;E.registerEffect({name:"ROLL_IN",effect(t,e){try{const n=Te.ROLL_IN;if(!n)return console.error("[ROLL_IN] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||cm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=E.timeline();return f.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u-120}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u},duration:r,ease:"power1.out"}),f}catch(n){return console.error("[ROLL_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROLL_OUT",effect(t,e){try{const n=Te.ROLL_OUT;if(!n)return console.error("[ROLL_OUT] Animation config not found"),E.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||cm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=E.timeline();return f.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u+120},duration:r,ease:"power1.in"}),f}catch(n){return console.error("[ROLL_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN",effect(t,e){try{const n=Te.ROTATE_IN;if(!n)return console.error("[ROTATE_IN] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u-200}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u},duration:r,ease:"power1.out",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_IN] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT",effect(t,e){try{const n=Te.ROTATE_OUT;if(!n)return console.error("[ROTATE_OUT] Animation config not found"),E.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return E.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u+200},duration:r,ease:"power1.in",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_OUT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_IN_DOWN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+45}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_IN_DOWN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_IN_UP_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_IN_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-90}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_IN_UP_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_OUT_DOWN_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:d,pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_OUT_DOWN_RIGHT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,p=E.timeline();return p.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),p.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),p}catch(n){return console.error("[ROTATE_OUT_UP_LEFT] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"ROTATE_OUT_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,p=t.pivot?.y||0,m=E.timeline();return m.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),m.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+90},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:d,pivotX:h,pivotY:p,x:a,y:l}}),m}catch(n){return console.error("[ROTATE_OUT_UP_RIGHT] Animation error:",n),E.timeline()}}});const ar=Te.PULSE,lm=ar?.keyframes?.pulseScale?.min||1,um=ar?.keyframes?.pulseScale?.max||1.05;E.registerEffect({name:"PULSE",effect(t,e){try{const n=e.scaleX??1,r=e.scaleY??1;return E.timeline().fromTo(t,{pixi:{scaleX:n*lm,scaleY:r*lm}},{pixi:{scaleX:n*um,scaleY:r*um},duration:e.duration||ar?.defaultDuration||.5,repeat:e.repeat||2,yoyo:!0,ease:e.ease||ar?.gsapEasing||"power1.inOut",yoyoEase:e.yoyoEase||"power3"}).to(t,{pixi:{scaleX:n,scaleY:r},duration:e.resetDuration||.3,ease:e.resetEase||"power1.out"})}catch(n){return console.error("[PULSE] Animation error:",n),E.timeline()}},defaults:{duration:ar?.defaultDuration||.5,repeat:2,resetDuration:.3,ease:ar?.gsapEasing||"power1.inOut",resetEase:"power1.out"},extendTimeline:!0}),E.registerEffect({name:"SHAKE_X",effect(t,e){try{const n=Te.SHAKE_X;if(!n)return console.error("[SHAKE_X] Animation config not found"),E.timeline();const r=n?.keyframes?.shakeX?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.x??0,a=i/10,l=E.timeline();return l.fromTo(t,{pixi:{x:s}},{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_X] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"SHAKE_Y",effect(t,e){try{const n=Te.SHAKE_Y;if(!n)return console.error("[SHAKE_Y] Animation config not found"),E.timeline();const r=n?.keyframes?.shakeY?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.y??0,a=i/10,l=E.timeline();return l.fromTo(t,{pixi:{y:s}},{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_Y] Animation error:",n),E.timeline()}}}),Pa(["WIPE_LEFT","WIPE_RIGHT","WIPE_UP","WIPE_DOWN"]),Pa(["RISE"]),E.registerEffect({name:"TYPEWRITER",effect(t,e){try{const{text:n="",onTextChange:r}=e;if(!n||!t)return E.timeline();const i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=E.timeline();u.set(t,{pixi:{x:i,y:o,scaleX:s,scaleY:a,alpha:l,rotation:c}},0);const f=n.length;return u.to(t,{duration:e.duration||2,ease:"none",onStart(){t&&(t.text="",t.updateText&&t.updateText()),r&&r("","START")},onUpdate(){const d=this.progress(),h=Math.min(Math.round(d*f),f),p=n.substring(0,h);r&&r(p,"UPDATE"),t&&(t.text=p,t.updateText&&t.updateText())},onComplete(){r&&r(n,"COMPLETE"),t&&(t.text=n,t.updateText&&t.updateText())},onInterrupt(){r&&r("","INTERRUPT")},onReverseComplete(){r&&r("","REVERSE_COMPLETE")}},0),u}catch(n){return console.error("[TYPEWRITER] Animation error:",n),E.timeline()}},defaults:{duration:2,text:""},extendTimeline:!0});const Ji="__logoRevealMask";function $S(t,e){const n=typeof e.width=="number"&&e.width>0?e.width:0,r=typeof e.height=="number"&&e.height>0?e.height:0;if(n&&r)return{w:n,h:r};try{const i=t.getLocalBounds();if(i.width>1&&i.height>1)return{w:i.width,h:i.height}}catch{}return{w:Math.max(1,t.width||240),h:Math.max(1,t.height||240)}}function JS(t){const e=t[Ji];if(e&&!e.destroyed)return t.mask=e,e;const n=new W.Graphics;return t[Ji]=n,t.addChild(n),t.mask=n,n}function QS(t){const e=t[Ji];t.mask=null,e&&!e.destroyed&&(e.parent&&e.parent.removeChild(e),e.destroy()),t[Ji]=void 0}const ew={draw:(t,e,n)=>{t.rect(0,-n/2,e,n).fill(16777215)},origin:(t,e,n)=>({x:t-n/2,y:e}),axes:"x"},tw={draw:(t,e,n)=>{t.circle(0,0,Math.hypot(e,n)*.55).fill(16777215)},origin:(t,e)=>({x:t,y:e}),axes:"both"},nw={draw:(t,e,n)=>{const r=Math.max(e,n)*.2,i=e+n+r*2,o=-n/2-r,s=n/2+r;t.moveTo(0,o).lineTo(i,o).lineTo(i-n,s).lineTo(-n,s).closePath().fill(16777215)},origin:(t,e,n,r)=>({x:t-n/2-Math.max(n,r)*.2,y:e}),axes:"x"};function Na(t,e,n,r){try{const i=Ma(t);if(!i)throw new Error("LOGO_REVEAL target is not a PIXI.Container");const o=e.duration??.9,s=e.ease||r,a=e.x??0,l=e.y??0,c=e.alpha??1,{w:u,h:f}=$S(i,e);E.set(i,{pixi:{alpha:c,x:a,y:l,scaleX:e.scaleX??1,scaleY:e.scaleY??1}});const d=JS(i),{x:h,y:p}=n.origin(a,l,u,f);d.clear(),n.draw(d,u,f),d.position.set(h,p),d.pivot.set(0,0);const m=n.axes==="both";return E.fromTo(d.scale,{x:0,y:m?0:1},{x:1,y:1,duration:o,ease:s,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto",onReverseComplete:()=>{QS(i)}})}catch(i){return console.error("[LOGO_REVEAL] mask effect error:",i),E.timeline()}}E.registerEffect({name:"SCALE_POP",effect(t,e){try{const n=e.duration??.65,r=e.x??0,i=e.y??0,o=e.scaleX??1,s=e.scaleY??1,a=e.alpha??1,l=e.ease||"back.out(1.7)";return E.fromTo(t,{pixi:{scaleX:.28*o,scaleY:.28*s,alpha:0,x:r,y:i}},{pixi:{scaleX:o,scaleY:s,alpha:a,x:r,y:i},duration:n,ease:l,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(n){return console.error("[SCALE_POP] Animation error:",n),E.timeline()}}}),E.registerEffect({name:"WIPE_LEFT_RIGHT",effect(t,e){return Na(t,e,ew,"power2.inOut")}}),E.registerEffect({name:"WIPE_RADIAL",effect(t,e){return Na(t,e,tw,"power2.out")}}),E.registerEffect({name:"MASK_PAINT_ON",effect(t,e){return Na(t,e,nw,"power3.out")}});const fm="__staggerSplitText",Qi="__staggerBaseX",eo="__staggerBaseY";function ka(t){const e=[t];for(;e.length;){const n=e.shift();for(const r of n.children??[]){if(r instanceof W.Text)return r;r instanceof W.Container&&e.push(r)}}return null}const Da=t=>t==null?"-":typeof t=="number"?String(t):`${t.x},${t.y}`;function rw(t,e,n){const r=t.style;return[e,t.text,r.fontFamily,r.fontSize,r.fontWeight,r.letterSpacing,r.wordWrap?r.wordWrapWidth:"nowrap",Da(n.charAnchor),Da(n.wordAnchor),Da(n.lineAnchor)].join("|")}function iw(t,e,n){const r=ka(t);if(!r)return null;const i=t,o=i[fm],s=rw(r,e,n);if(o&&!o.split.destroyed&&o.signature===s)return o.split;o&&!o.split.destroyed&&(o.split.parent?.removeChild(o.split),o.split.destroy({children:!0}));const a=W.SplitText.from(r,n);return a.position.copyFrom(r.position),a.rotation=r.rotation,a.scale.copyFrom(r.scale),(r.parent??t).addChild(a),r.alpha=0,i[fm]={signature:s,split:a},a}function Fa(t,e){const n=Ma(t);return n||(console.error(`[${e}] target is not a PIXI.Container`),null)}function dm(t,e){E.set(t,{pixi:{alpha:e.alpha??1,x:e.x??0,y:e.y??0,scaleX:e.scaleX??1,scaleY:e.scaleY??1}})}function hm(t,e,n={}){const r=iw(t,e,n),i=r?e==="letter"?r.chars:r.words:[];if(i.length===0)return null;for(const s of i){const a=s;typeof a[Qi]!="number"&&(a[Qi]=s.x),typeof a[eo]!="number"&&(a[eo]=s.y)}const o=s=>a=>a[s]??0;return{node:t,units:i,baseX:o(Qi),baseY:o(eo),fontSize:Number(ka(t)?.style?.fontSize)||48}}function pm(t,e,n){const i=(typeof t.stagger=="number"&&t.stagger>=0?t.stagger:Math.min(.12,n/Math.max(e,1)/2))*Math.max(e-1,0);return{amount:i,unitDuration:Math.max(.12,n-i)}}function mm(t,e,n="start"){return{amount:e,from:t.staggerFrom??n,...t.staggerEase?{ease:t.staggerEase}:{}}}const gm="__textUnitMask";function ow(t,e){const n=t.parent;if(!n)return null;const r=t,i=r[gm];if(i&&!i.mask.destroyed)if(i.signature!==e)i.mask.parent?.removeChild(i.mask),i.mask.destroy();else return i.mask.parent||n.addChild(i.mask),t.mask=i.mask,i.mask;let o=0,s=0,a=0,l=0;try{const h=t.getLocalBounds();h.width>0&&h.height>0&&(o=h.x,s=h.y,a=h.width,l=h.height)}catch{}if(!(a>0&&l>0))return null;const c=ym(r,Qi,t.x),u=ym(r,eo,t.y),f=Math.max(6,l*.12),d=new W.Graphics;return d.rect(c+o-f,u+s-f,a+f*2,l+f*2).fill(16777215),n.addChild(d),t.mask=d,r[gm]={signature:e,mask:d},d}function ym(t,e,n){const r=t[e];return typeof r=="number"?r:n}const sw={};function At(t){sw[t.name]={from:t.from??"start",unit:t.unit??"word"},E.registerEffect({name:t.name,effect(e,n){const r=Fa(e,t.name);if(!r)return E.timeline();try{const i=n.duration??.75,o=n.ease||t.ease,s=n.revealUnit==="letter"||n.revealUnit==="word"?n.revealUnit:t.unit??"word";dm(r,n);const a=hm(r,s,t.anchors);if(!a)return Ba(r,n,!1,o);const{units:l,baseX:c,baseY:u,fontSize:f}=a,d=new Map;if(t.masked){for(const g of l){let y=f;try{const b=g.getLocalBounds();b.height>0&&(y=b.height)}catch{}d.set(g,y)}for(const g of l)ow(g,t.name)}const h={baseX:c,baseY:u,unitH:g=>d.get(g)??f,fontSize:f},{amount:p,unitDuration:m}=pm(n,l.length,i);return E.fromTo(l,t.from_(h),{...t.to(h),duration:m,ease:o,stagger:mm(n,p,t.from??"start"),immediateRender:n.immediateRender??!0,overwrite:n.overwrite??"auto"})}catch(i){return console.error(`[${t.name}] Animation error:`,i),E.timeline()}}})}function Ba(t,e,n,r){const i=e.duration??.75,o=e.ease||r,s=e.alpha??1,a=e.y??0,l=n?e.yOffset??24:0;return E.fromTo(t,{pixi:{alpha:0,y:a+l}},{pixi:{alpha:s,y:a},duration:i,ease:o,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}function Ua(t,e,n,r){const i=Fa(t,"STAGGER_TEXT");if(!i)return E.timeline();try{const o=e.duration??.75,s=e.ease||r,a=e.revealUnit==="letter"?"letter":"word";dm(i,e);const l=hm(i,a);if(!l)return Ba(i,e,n,s);const{units:c,baseY:u,fontSize:f}=l,d=n?e.yOffset??Math.max(12,f*.35):0,{amount:h,unitDuration:p}=pm(e,c.length,o);return E.fromTo(c,{alpha:0,y:(m,g)=>u(g)+d},{alpha:1,y:(m,g)=>u(g),duration:p,ease:s,stagger:mm(e,h),immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(o){return console.error("[STAGGER_TEXT] Animation error:",o),E.timeline()}}E.registerEffect({name:"STAGGER_FADE_UP_TEXT",effect(t,e){return Ua(t,e,!0,"power2.out")}}),E.registerEffect({name:"STAGGER_FADE_TEXT",effect(t,e){return Ua(t,e,!1,"power1.out")}});function _m(t,e,n,r){const i=Fa(t,"STAGGER_FADE");return i?ka(i)?Ua(t,e,n,r):Ba(i,e,n,e.ease||r):E.timeline()}E.registerEffect({name:"STAGGER_FADE_UP",effect(t,e){return _m(t,e,!0,"power2.out")}}),E.registerEffect({name:"STAGGER_FADE",effect(t,e){return _m(t,e,!1,"power1.out")}});const Vr=Math.PI/180;function aw(t,e){let n=Math.imul(t+1,374761393)+Math.imul(e+1,668265263);return n=Math.imul(n^n>>>13,1274126177),((n^n>>>16)>>>0)/4294967296}const Kr=(t,e,n,r)=>n+aw(t,e)*(r-n);At({name:"TEXT_CASCADE",ease:"back.out(1.4)",from:"start",unit:"word",from_:({baseY:t,fontSize:e})=>({alpha:0,rotation:-15*Vr,y:(n,r)=>t(r)-e*1.2}),to:({baseY:t})=>({alpha:1,rotation:0,y:(e,n)=>t(n)})}),At({name:"TEXT_SPOTLIGHT",ease:"power2.out",from:"center",unit:"word",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:.1,pixi:{scaleX:.8,scaleY:.8}}),to:()=>({alpha:1,pixi:{scaleX:1,scaleY:1}})}),At({name:"TEXT_BLINDS",ease:"power2.out",from:"edges",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:0,pixi:{scaleX:0}}),to:()=>({alpha:1,pixi:{scaleX:1}})}),At({name:"TEXT_POPCORN",ease:"back.out(2)",from:"random",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:({baseY:t,fontSize:e})=>({alpha:0,pixi:{scaleX:0,scaleY:0},rotation:n=>Kr(n,1,-20,20)*Vr,y:(n,r)=>t(r)+Kr(n,2,.2,.8)*e}),to:({baseY:t})=>({alpha:1,pixi:{scaleX:1,scaleY:1},rotation:0,y:(e,n)=>t(n)})}),At({name:"TEXT_RIPPLE",ease:"elastic.out(1, 0.6)",from:"start",unit:"letter",from_:({baseY:t,fontSize:e})=>({alpha:0,y:(n,r)=>t(r)+Math.sin(n*.8)*e*.9}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_SHUFFLE",ease:"power3.out",from:"random",unit:"word",anchors:{wordAnchor:.5,charAnchor:.5},from_:({baseX:t,baseY:e,fontSize:n})=>({alpha:0,rotation:r=>Kr(r,3,-15,15)*Vr,x:(r,i)=>t(i)+Kr(r,4,-1.6,1.6)*n,y:(r,i)=>e(i)+Kr(r,5,-.9,.9)*n}),to:({baseX:t,baseY:e})=>({alpha:1,rotation:0,x:(n,r)=>t(r),y:(n,r)=>e(r)})}),At({name:"TEXT_DOMINO",ease:"power3.out",from:"start",unit:"letter",anchors:{charAnchor:{x:0,y:1},wordAnchor:{x:0,y:1}},from_:()=>({alpha:0,rotation:-90*Vr}),to:()=>({alpha:1,rotation:0})}),At({name:"TEXT_PENDULUM",ease:"elastic.out(1, 0.5)",from:"start",unit:"letter",anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,rotation:90*Vr}),to:()=>({alpha:1,rotation:0})}),At({name:"TEXT_SLIDE_REVEAL",ease:"power3.out",from:"start",unit:"word",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)+e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_SLOT",ease:"back.out(1.3)",from:"start",unit:"letter",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)-e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),At({name:"TEXT_CURTAIN",ease:"power2.inOut",from:"start",unit:"word",masked:!0,anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,pixi:{scaleY:0}}),to:()=>({alpha:1,pixi:{scaleY:1}})}),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerEffect({name:"SWING",effect(t,e){return E.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),E.registerEffect({name:"JELLO",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),E.registerEffect({name:"WOOBLE",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),E.registerEffect({name:"NONE",effect(t){return E.timeline().to(t,{duration:0})}}),E.registerEffect({name:"FLASH",effect(t,e){return E.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),E.registerPlugin(Kn.PixiPlugin),Kn.PixiPlugin.registerPIXI(W),E.registerPlugin(wn),E.registerPlugin(im);const Xe=t=>{E.effects[t.name]||E.registerEffect(t)};wn.create("springBounce","0.32, 1.06, 0.61, 0.93"),wn.create("springStiff","M0,0 C0.18,0 0.28,1.2 0.5,1 C0.66,0.88 0.78,1.05 1,1"),Xe({name:"PULSE",effect(t,e){return E.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),Xe({name:"SHAKE",effect(t,e){return E.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),Xe({name:"SWING",effect(t,e){return E.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Xe({name:"JELLO",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Xe({name:"WOOBLE",effect(t,e){return E.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),Xe({name:"NONE",effect(t,e){return E.timeline().to(t,{duration:0})}}),Xe({name:"FLASH",effect(t,e){return E.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),Xe({name:"BOUNCE_IN",effect(t,e){return E.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e?.x,y:e?.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),Xe({name:"BOUNCE_IN_DOWN",effect(t,e){return E.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e?.x,y:-2500,alpha:0}})}}),Xe({name:"BOUNCE_IN_LEFT",effect(t,e){return E.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),Xe({name:"BOUNCE_IN_RIGHT",effect(t,e){const n=Math.max(1e3,e?.maxX+500);return E.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:n}})}}),Xe({name:"BOUNCE_IN_UP",effect(t,e){return E.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),Xe({name:"BOUNCE_OUT",effect(t,e){return E.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),Xe({name:"FADE_IN",effect(t){return E.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),Xe({name:"FADE_IN_DOWN",effect(t,e){return E.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Xe({name:"FADE_IN_LEFT",effect(t,e){return E.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),Xe({name:"FADE_IN_RIGHT",effect(t,e){return E.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),Xe({name:"FADE_IN_UP",effect(t,e){return E.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Xe({name:"MOTION_PATH_SPRING",effect(t,e){const{path:n,duration:r=2,autoRotate:i=!1,alignOrigin:o=[.5,.5],ease:s="springStiff",repeat:a=0,yoyo:l=!1,start:c=0,end:u=1}=e||{};return E.to(t,{duration:r,ease:s,repeat:a,yoyo:l,motionPath:{path:n,autoRotate:i,alignOrigin:o,start:c,end:u}})}}),Xe({name:"SPIN",effect(t){return E.to(t,{rotation:(e,n)=>E.utils.snap(360,Number(E.getProperty(n,"rotation"))+360)})}});const bm=200,cw=t=>{try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return bm},lw=t=>{try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return bm},mn=(t,e,n,r)=>{Xe({name:t,effect(i,o){const s=o?.x??0,a=o?.y??0,l=o?.scaleX??1,c=o?.scaleY??1,u=o?.alpha??1,f=o?.rotation??0,d=o?.duration??.5,h=e==="x"?cw(i):lw(i),p=e==="x"?s+r*h:s,m=e==="y"?a+r*h:a,g=n==="in"?{x:p,y:m,alpha:0}:{x:s,y:a,alpha:u},y=n==="in"?{x:s,y:a,alpha:u}:{x:p,y:m,alpha:0};return E.fromTo(i,{pixi:{x:g.x,y:g.y,scaleX:l,scaleY:c,alpha:g.alpha,rotation:f}},{pixi:{x:y.x,y:y.y,scaleX:l,scaleY:c,alpha:y.alpha,rotation:f},duration:d,ease:o?.ease||"power2.out",immediateRender:o?.immediateRender??!0,overwrite:o?.overwrite})}})};mn("SLIDE_IN_LEFT","x","in",-1),mn("SLIDE_IN_RIGHT","x","in",1),mn("SLIDE_IN_TOP","y","in",-1),mn("SLIDE_IN_BOTTOM","y","in",1),mn("SLIDE_OUT_LEFT","x","out",-1),mn("SLIDE_OUT_RIGHT","x","out",1),mn("SLIDE_OUT_TOP","y","out",-1),mn("SLIDE_OUT_BOTTOM","y","out",1);const cr=.7,Ga=.7,uw=-1200,fw=700;Xe({name:"BACK_IN",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+uw,u=l*.8,f=l*.2,d=E.timeline();return d.fromTo(t,{pixi:{x:n,y:c,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a}},{pixi:{x:n,y:r,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{scaleX:i,scaleY:o,alpha:s},duration:f,ease:"power1.out",immediateRender:!1},u),d}}),Xe({name:"BACK_OUT",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+fw,u=l*.2,f=l*.8,d=E.timeline();return d.fromTo(t,{pixi:{x:n,y:r,scaleX:i,scaleY:o,alpha:s,rotation:a}},{pixi:{x:n,y:r,scaleX:i*cr,scaleY:o*cr,alpha:Ga,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{x:n,y:c},duration:f,ease:"power1.in",immediateRender:!1},u),d}});function xm(){return{updateEffect:S.useCallback((e,n,r)=>{if(!e)return console.warn("useGsapEffect: Target container is null or undefined"),E.to({},{duration:0});if(!n||typeof n!="string")return console.warn("useGsapEffect: Invalid effect name provided"),E.to(e,{duration:0});const i={immediateRender:!1,overwrite:!0,...r};try{return E.effects[n]?E.effects[n](e,i):E.effects.NONE?(console.warn(`useGsapEffect: Effect "${n}" not found, falling back to NONE`),E.effects.NONE(e,i)):(console.warn("useGsapEffect: NONE effect not found, returning empty tween"),E.to(e,{duration:0}))}catch(o){return console.error("useGsapEffect: Error applying effect:",o),E.to(e,{duration:0})}},[])}}const Dt={DEFAULT_DURATION_MS:1e3,DEFAULT_DURATION_SEC:1,MIN_DURATION_SEC:.1,MAX_DURATION_SEC:5,ENTRANCE_OVERLAP_SEC:.25,DEFAULT_LOOP_ROTATIONS_PER_SEC:.25,MIN_LOOP_ROTATIONS_PER_SEC:.05,MAX_LOOP_ROTATIONS_PER_SEC:1},Zr={WIDTH:1920,HEIGHT:1080},ja=new Set(["NONE","HEART_BEAT","PULSE","SHAKE","SHAKE_X","SHAKE_Y","HEAD_SHAKE","SWING","TADA","WOBBLE","JELLO","RUBBER_BAND","TYPEWRITER","RISE","TEXT_CASCADE","TEXT_SPOTLIGHT","TEXT_BLINDS","TEXT_POPCORN","TEXT_RIPPLE","TEXT_SHUFFLE","TEXT_DOMINO","TEXT_PENDULUM","TEXT_SLIDE_REVEAL","TEXT_SLOT","TEXT_CURTAIN"]),$r=new Set(["TYPEWRITER","RISE"]),vm=new Set(["SPIN_360"]);function Tm(t){return vm.has(t)}const Em={NONE:"NONE",BOUNCE:"BOUNCE",FLASH:"FLASH",PULSE:"PULSE",RUBBER_BAND:"RUBBER_BAND",SHAKE_X:"SHAKE_X",SHAKE_Y:"SHAKE_Y",HEAD_SHAKE:"HEAD_SHAKE",SWING:"SWING",TADA:"TADA",WOBBLE:"WOBBLE",JELLO:"JELLO",HEART_BEAT:"HEART_BEAT",BACK_IN_DOWN:"BACK_IN_DOWN",BACK_IN_LEFT:"BACK_IN_LEFT",BACK_IN_RIGHT:"BACK_IN_RIGHT",BACK_IN_UP:"BACK_IN_UP",BACK_OUT_DOWN:"BACK_OUT_DOWN",BACK_OUT_LEFT:"BACK_OUT_LEFT",BACK_OUT_RIGHT:"BACK_OUT_RIGHT",BACK_OUT_UP:"BACK_OUT_UP",BOUNCE_IN:"BOUNCE_IN",BOUNCE_IN_DOWN:"BOUNCE_IN_DOWN",BOUNCE_IN_LEFT:"BOUNCE_IN_LEFT",BOUNCE_IN_RIGHT:"BOUNCE_IN_RIGHT",BOUNCE_IN_UP:"BOUNCE_IN_UP",BOUNCE_OUT:"BOUNCE_OUT",BOUNCE_OUT_DOWN:"BOUNCE_OUT_DOWN",BOUNCE_OUT_LEFT:"BOUNCE_OUT_LEFT",BOUNCE_OUT_RIGHT:"BOUNCE_OUT_RIGHT",BOUNCE_OUT_UP:"BOUNCE_OUT_UP",FADE_IN:"FADE_IN",FADE_IN_DOWN:"FADE_IN_DOWN",FADE_IN_DOWN_BIG:"FADE_IN_DOWN_BIG",FADE_IN_LEFT:"FADE_IN_LEFT",FADE_IN_LEFT_BIG:"FADE_IN_LEFT_BIG",FADE_IN_RIGHT:"FADE_IN_RIGHT",FADE_IN_RIGHT_BIG:"FADE_IN_RIGHT_BIG",FADE_IN_UP:"FADE_IN_UP",FADE_IN_UP_BIG:"FADE_IN_UP_BIG",FADE_IN_TOP_LEFT:"FADE_IN_TOP_LEFT",FADE_IN_TOP_RIGHT:"FADE_IN_TOP_RIGHT",FADE_IN_BOTTOM_LEFT:"FADE_IN_BOTTOM_LEFT",FADE_IN_BOTTOM_RIGHT:"FADE_IN_BOTTOM_RIGHT",FADE_OUT:"FADE_OUT",FADE_OUT_DOWN:"FADE_OUT_DOWN",FADE_OUT_DOWN_BIG:"FADE_OUT_DOWN_BIG",FADE_OUT_LEFT:"FADE_OUT_LEFT",FADE_OUT_LEFT_BIG:"FADE_OUT_LEFT_BIG",FADE_OUT_RIGHT:"FADE_OUT_RIGHT",FADE_OUT_RIGHT_BIG:"FADE_OUT_RIGHT_BIG",FADE_OUT_UP:"FADE_OUT_UP",FADE_OUT_UP_BIG:"FADE_OUT_UP_BIG",FADE_OUT_TOP_LEFT:"FADE_OUT_TOP_LEFT",FADE_OUT_TOP_RIGHT:"FADE_OUT_TOP_RIGHT",FADE_OUT_BOTTOM_RIGHT:"FADE_OUT_BOTTOM_RIGHT",FADE_OUT_BOTTOM_LEFT:"FADE_OUT_BOTTOM_LEFT",FLIP:"FLIP",FLIP_IN_X:"FLIP_IN_X",FLIP_IN_Y:"FLIP_IN_Y",FLIP_OUT_X:"FLIP_OUT_X",FLIP_OUT_Y:"FLIP_OUT_Y",LIGHT_SPEED_IN_RIGHT:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_IN_LEFT:"LIGHT_SPEED_IN_LEFT",LIGHT_SPEED_OUT_RIGHT:"LIGHT_SPEED_OUT_RIGHT",LIGHT_SPEED_OUT_LEFT:"LIGHT_SPEED_OUT_LEFT",ROTATE_IN:"ROTATE_IN",ROTATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROTATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROTATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROTATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT",ROTATE_OUT:"ROTATE_OUT",ROTATE_OUT_DOWN_LEFT:"ROTATE_OUT_DOWN_LEFT",ROTATE_OUT_DOWN_RIGHT:"ROTATE_OUT_DOWN_RIGHT",ROTATE_OUT_UP_LEFT:"ROTATE_OUT_UP_LEFT",ROTATE_OUT_UP_RIGHT:"ROTATE_OUT_UP_RIGHT",HINGE:"HINGE",JACK_IN_THE_BOX:"JACK_IN_THE_BOX",ROLL_IN:"ROLL_IN",ROLL_OUT:"ROLL_OUT",ZOOM_IN:"ZOOM_IN",ZOOM_IN_DOWN:"ZOOM_IN_DOWN",ZOOM_IN_LEFT:"ZOOM_IN_LEFT",ZOOM_IN_RIGHT:"ZOOM_IN_RIGHT",ZOOM_IN_UP:"ZOOM_IN_UP",ZOOM_OUT:"ZOOM_OUT",ZOOM_OUT_DOWN:"ZOOM_OUT_DOWN",ZOOM_OUT_LEFT:"ZOOM_OUT_LEFT",ZOOM_OUT_RIGHT:"ZOOM_OUT_RIGHT",ZOOM_OUT_UP:"ZOOM_OUT_UP",SLIDE_IN_DOWN:"SLIDE_IN_DOWN",SLIDE_IN_LEFT:"SLIDE_IN_LEFT",SLIDE_IN_RIGHT:"SLIDE_IN_RIGHT",SLIDE_IN_UP:"SLIDE_IN_UP",SLIDE_OUT_DOWN:"SLIDE_OUT_DOWN",SLIDE_OUT_LEFT:"SLIDE_OUT_LEFT",SLIDE_OUT_RIGHT:"SLIDE_OUT_RIGHT",SLIDE_OUT_UP:"SLIDE_OUT_UP",SPIN_360:"SPIN_360",SCALE_POP:"SCALE_POP",WIPE_LEFT_RIGHT:"WIPE_LEFT_RIGHT",WIPE_RADIAL:"WIPE_RADIAL",MASK_PAINT_ON:"MASK_PAINT_ON",TYPEWRITER:"TYPEWRITER",RISE:"RISE",STAGGER_FADE_UP_TEXT:"STAGGER_FADE_UP_TEXT",STAGGER_FADE_TEXT:"STAGGER_FADE_TEXT",STAGGER_FADE_UP:"STAGGER_FADE_UP",STAGGER_FADE:"STAGGER_FADE",TEXT_CASCADE:"TEXT_CASCADE",TEXT_SPOTLIGHT:"TEXT_SPOTLIGHT",TEXT_BLINDS:"TEXT_BLINDS",TEXT_POPCORN:"TEXT_POPCORN",TEXT_RIPPLE:"TEXT_RIPPLE",TEXT_SHUFFLE:"TEXT_SHUFFLE",TEXT_DOMINO:"TEXT_DOMINO",TEXT_PENDULUM:"TEXT_PENDULUM",TEXT_SLIDE_REVEAL:"TEXT_SLIDE_REVEAL",TEXT_SLOT:"TEXT_SLOT",TEXT_CURTAIN:"TEXT_CURTAIN",LIGHT_SPEED_IN:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_OUT:"LIGHT_SPEED_OUT_RIGHT",ROATATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROATATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROATATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROATATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT"},Sm={bounce:"BOUNCE",flash:"FLASH",pulse:"PULSE",rubberBand:"RUBBER_BAND",shakeX:"SHAKE_X",shakeY:"SHAKE_Y",headShake:"HEAD_SHAKE",swing:"SWING",tada:"TADA",wobble:"WOBBLE",jello:"JELLO",heartBeat:"HEART_BEAT",backInDown:"BACK_IN_DOWN",backInLeft:"BACK_IN_LEFT",backInRight:"BACK_IN_RIGHT",backInUp:"BACK_IN_UP",backOutDown:"BACK_OUT_DOWN",backOutLeft:"BACK_OUT_LEFT",backOutRight:"BACK_OUT_RIGHT",backOutUp:"BACK_OUT_UP",bounceIn:"BOUNCE_IN",bounceInDown:"BOUNCE_IN_DOWN",bounceInLeft:"BOUNCE_IN_LEFT",bounceInRight:"BOUNCE_IN_RIGHT",bounceInUp:"BOUNCE_IN_UP",bounceOut:"BOUNCE_OUT",bounceOutDown:"BOUNCE_OUT_DOWN",bounceOutLeft:"BOUNCE_OUT_LEFT",bounceOutRight:"BOUNCE_OUT_RIGHT",bounceOutUp:"BOUNCE_OUT_UP",fadeIn:"FADE_IN",fadeInDown:"FADE_IN_DOWN",fadeInDownBig:"FADE_IN_DOWN_BIG",fadeInLeft:"FADE_IN_LEFT",fadeInLeftBig:"FADE_IN_LEFT_BIG",fadeInRight:"FADE_IN_RIGHT",fadeInRightBig:"FADE_IN_RIGHT_BIG",fadeInUp:"FADE_IN_UP",fadeInUpBig:"FADE_IN_UP_BIG",fadeInTopLeft:"FADE_IN_TOP_LEFT",fadeInTopRight:"FADE_IN_TOP_RIGHT",fadeInBottomLeft:"FADE_IN_BOTTOM_LEFT",fadeInBottomRight:"FADE_IN_BOTTOM_RIGHT",fadeOut:"FADE_OUT",fadeOutDown:"FADE_OUT_DOWN",fadeOutDownBig:"FADE_OUT_DOWN_BIG",fadeOutLeft:"FADE_OUT_LEFT",fadeOutLeftBig:"FADE_OUT_LEFT_BIG",fadeOutRight:"FADE_OUT_RIGHT",fadeOutRightBig:"FADE_OUT_RIGHT_BIG",fadeOutUp:"FADE_OUT_UP",fadeOutUpBig:"FADE_OUT_UP_BIG",fadeOutTopLeft:"FADE_OUT_TOP_LEFT",fadeOutTopRight:"FADE_OUT_TOP_RIGHT",fadeOutBottomRight:"FADE_OUT_BOTTOM_RIGHT",fadeOutBottomLeft:"FADE_OUT_BOTTOM_LEFT",flip:"FLIP",flipInX:"FLIP_IN_X",flipInY:"FLIP_IN_Y",flipOutX:"FLIP_OUT_X",flipOutY:"FLIP_OUT_Y",lightSpeedInRight:"LIGHT_SPEED_IN_RIGHT",lightSpeedInLeft:"LIGHT_SPEED_IN_LEFT",lightSpeedOutRight:"LIGHT_SPEED_OUT_RIGHT",lightSpeedOutLeft:"LIGHT_SPEED_OUT_LEFT",rotateIn:"ROTATE_IN",rotateInDownLeft:"ROTATE_IN_DOWN_LEFT",rotateInDownRight:"ROTATE_IN_DOWN_RIGHT",rotateInUpLeft:"ROTATE_IN_UP_LEFT",rotateInUpRight:"ROTATE_IN_UP_RIGHT",rotateOut:"ROTATE_OUT",rotateOutDownLeft:"ROTATE_OUT_DOWN_LEFT",rotateOutDownRight:"ROTATE_OUT_DOWN_RIGHT",rotateOutUpLeft:"ROTATE_OUT_UP_LEFT",rotateOutUpRight:"ROTATE_OUT_UP_RIGHT",hinge:"HINGE",jackInTheBox:"JACK_IN_THE_BOX",rollIn:"ROLL_IN",rollOut:"ROLL_OUT",zoomIn:"ZOOM_IN",zoomInDown:"ZOOM_IN_DOWN",zoomInLeft:"ZOOM_IN_LEFT",zoomInRight:"ZOOM_IN_RIGHT",zoomInUp:"ZOOM_IN_UP",scalePop:"SCALE_POP",wipeLeftRight:"WIPE_LEFT_RIGHT",wipeRadial:"WIPE_RADIAL",maskPaintOn:"MASK_PAINT_ON",typewriter:"TYPEWRITER",rise:"RISE",textCascade:"TEXT_CASCADE",textSpotlight:"TEXT_SPOTLIGHT",textBlinds:"TEXT_BLINDS",textPopcorn:"TEXT_POPCORN",textRipple:"TEXT_RIPPLE",textShuffle:"TEXT_SHUFFLE",textDomino:"TEXT_DOMINO",textPendulum:"TEXT_PENDULUM",textSlideReveal:"TEXT_SLIDE_REVEAL",textSlot:"TEXT_SLOT",textCurtain:"TEXT_CURTAIN",staggerFadeUpText:"STAGGER_FADE_UP_TEXT",staggerFadeText:"STAGGER_FADE_TEXT",staggerFadeUp:"STAGGER_FADE_UP",staggerFade:"STAGGER_FADE",zoomOut:"ZOOM_OUT",zoomOutDown:"ZOOM_OUT_DOWN",zoomOutLeft:"ZOOM_OUT_LEFT",zoomOutRight:"ZOOM_OUT_RIGHT",zoomOutUp:"ZOOM_OUT_UP",slideInDown:"SLIDE_IN_DOWN",slideInLeft:"SLIDE_IN_LEFT",slideInRight:"SLIDE_IN_RIGHT",slideInUp:"SLIDE_IN_UP",slideOutDown:"SLIDE_OUT_DOWN",slideOutLeft:"SLIDE_OUT_LEFT",slideOutRight:"SLIDE_OUT_RIGHT",slideOutUp:"SLIDE_OUT_UP"};function lr(t){return t?t===t.toUpperCase()?t:Sm[t]?Sm[t]:t.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,""):"NONE"}function Ha(t){const e={name:"NONE",durationSec:Dt.DEFAULT_DURATION_SEC};if(t==null)return e;if(typeof t=="string")return{name:lr(t)||"NONE",durationSec:Dt.DEFAULT_DURATION_SEC};if(typeof t=="object"){const n=lr(t.name??"NONE"),r=t.duration??Dt.DEFAULT_DURATION_MS;return{name:n,durationSec:r/1e3}}return e}function wm(t){const e={name:"NONE",rotationsPerSecond:Dt.DEFAULT_LOOP_ROTATIONS_PER_SEC,direction:1};if(t==null)return e;if(typeof t=="string")return{...e,name:lr(t)||"NONE"};if(typeof t=="object"){const n=lr(t.name??"NONE"),r=typeof t.rotationsPerSecond=="number"&&t.rotationsPerSecond>0?Math.min(Math.max(t.rotationsPerSecond,Dt.MIN_LOOP_ROTATIONS_PER_SEC),Dt.MAX_LOOP_ROTATIONS_PER_SEC):Dt.DEFAULT_LOOP_ROTATIONS_PER_SEC,i=t.direction===-1?-1:1;return{name:n,rotationsPerSecond:r,direction:i}}return e}function dw(t){return!ja.has(t)}function hw(t){return $r.has(t)}function pw(t){if(!t||t==="NONE")return!1;if(typeof window<"u"&&window.gsap){const e=window.gsap;if(e.effects)return typeof e.effects[t]=="function"}return Object.values(Em).includes(t)}const Am=({targetRef:t,transformation:e,start:n,end:r,effectOptions:i={}})=>{const{tl:o}=S.useContext(Ye),s=S.useRef(null),{x:a=0,y:l=0,maxX:c=Zr.WIDTH,maxY:u=Zr.HEIGHT,scale:f=1,rotation:d=0,opacity:h=1,animationIn:p,animationOut:m,animationLoop:g,keyframes:y}=e||{},b=d*(180/Math.PI),x=S.useMemo(()=>Ha(p),[p]),v=S.useMemo(()=>Ha(m),[m]),T=S.useMemo(()=>wm(g),[g]),w=T.name!=="NONE"&&Tm(T.name),O=S.useMemo(()=>!Array.isArray(y)||y.length===0?[]:[...y].sort((N,D)=>N.time-D.time),[y]),C=S.useMemo(()=>{if(Array.isArray(f))return f;const N=typeof f=="number"?f:1;return[N,N]},[f]),R=Number(n)||0,P=Number(r)||R,A=Math.max(P-R,0),L=Math.min(Math.max(Number(e?.entranceOverlapSec)||0,0),A);return S.useLayoutEffect(()=>{const N=t?.current,D=o?.current,F=D;if(!N||!D||A<=0)return;s.current&&(D.remove(s.current),s.current.kill(),s.current=null);const G=C[0]??1,z=C[1]??1,K={x:a,y:l,rotation:b,scaleX:G,scaleY:z,alpha:h},se=x.name&&x.name!=="NONE"&&!$r.has(x.name)&&E.effects[x.name],pe=v.name&&v.name!=="NONE"&&!$r.has(v.name)&&E.effects[v.name];se&&ja.has(x.name);const X=x.durationSec,he=v.durationSec,j=se?X:0,te=pe?Math.max(A-he,j):A,H=c||Zr.WIDTH,ae=u||Zr.HEIGHT,Z={x:K.x,y:K.y,rotation:K.rotation,scaleX:K.scaleX,scaleY:K.scaleY,alpha:K.alpha,maxX:c,maxY:u,canvasWidth:H,canvasHeight:ae,...i,immediateRender:!0,overwrite:!1},ce=p&&typeof p=="object"&&typeof p.ease=="string"?p.ease:void 0,J=m&&typeof m=="object"&&typeof m.ease=="string"?m.ease:void 0,ie=p&&typeof p=="object"?{revealUnit:p.revealUnit,stagger:p.stagger,staggerFrom:p.staggerFrom,staggerEase:p.staggerEase,text:typeof p.text=="string"?p.text:void 0,yOffset:p.yOffset}:{},xe=E.timeline();if(se){const ye=N.x,$=N.y,we=N.alpha,me=N.rotation,Ue=N.scale?.x??1,ze=N.scale?.y??1,ht=N.skew?.x??0,zt=N.skew?.y??0,ve=E.effects[x.name](N,{duration:X,...Z,...ie,...ce?{ease:ce}:{}});N.x=ye,N.y=$,N.alpha=we,N.rotation=me,N.scale&&N.scale.set(Ue,ze),N.skew&&N.skew.set(ht,zt),xe.add(ve,0)}else xe.set(N,{pixi:K},0);const Y=ye=>{const $={};return ye.x!==void 0&&($.x=ye.x),ye.y!==void 0&&($.y=ye.y),ye.scaleX!==void 0&&($.scaleX=ye.scaleX),ye.scaleY!==void 0&&($.scaleY=ye.scaleY),ye.rotation!==void 0&&($.rotation=ye.rotation),ye.alpha!==void 0&&($.alpha=ye.alpha),$};if(O.length>0){const ye=O[0],$=O[O.length-1],we=Math.max(ye.time,j);we>j&&xe.to(N,{pixi:K,duration:we-j,immediateRender:!1},j),xe.set(N,{pixi:Y(ye.properties)},we);for(let me=1;me<O.length;me++){const Ue=O[me-1],ze=O[me],ht=ze.time-Ue.time;ht<=0?xe.set(N,{pixi:Y(ze.properties)},ze.time):xe.to(N,{pixi:Y(ze.properties),duration:ht,ease:ze.easing||"none",immediateRender:!1},Ue.time)}te>$.time&&xe.to(N,{pixi:Y($.properties),duration:te-$.time,immediateRender:!1},$.time)}else if(w&&te>j){const ye=te-j,$=360*T.rotationsPerSecond*T.direction*ye;xe.set(N,{pixi:{rotation:K.rotation}},j),xe.to(N,{pixi:{rotation:K.rotation+$},duration:ye,ease:"none",immediateRender:!1},j)}else te>j&&xe.to(N,{duration:te-j,pixi:K,immediateRender:!1},j);if(pe){const ye=E.effects[v.name](N,{duration:he,...Z,immediateRender:!1,...J?{ease:J}:{}});xe.add(ye,te)}s.current=xe,D.add(xe,R-L);const De=D.time();return D.time(De,!1),()=>{s.current&&(F&&F.remove(s.current),s.current.kill(),s.current=null)}},[t,o,a,l,d,b,C,h,c,u,x,v,T,w,O,R,P,A,L,i,p,m]),{childTimelineRef:s}};var to=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t.SPIN="SPIN",t))(to||{});const Ya=0,Om=1,mw=2,Cm=3,gw=new Set([2,4,5,6,7,8,9,10]),yw=t=>t==null||t===Ya?"none":t===Om||t===Cm||gw.has(t)?"native":"none",_w={[Ya]:"normal",[Om]:"add",[mw]:"multiply",[Cm]:"screen",4:"overlay",5:"darken",6:"lighten",7:"color-dodge",8:"color-burn",9:"hard-light",10:"soft-light"},Xa=t=>t==null?"normal":_w[t]??"normal",Rm=(t=Ya)=>S.useMemo(()=>Xa(t),[t]),no=`in vec2 aPosition;
967
+ `}})}}Sp.extension={name:"vivid-light",type:qe.BlendMode},bS.add(ip,op,sp,ap,cp,lp,up,dp,fp,hp,pp,gp,mp,yp,_p,bp,vp,xp,Tp,Ep,Sp),st.extend({AnimatedSprite:G.AnimatedSprite,Container:G.Container,Graphics:G.Graphics,Mesh:G.Mesh,Sprite:G.Sprite,Text:G.Text,TilingSprite:G.TilingSprite,GifSprite:Yr.GifSprite});var Js={exports:{}},Kr={};var wp;function uw(){if(wp)return Kr;wp=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:o}}return Kr.Fragment=e,Kr.jsx=n,Kr.jsxs=n,Kr}var Ap;function dw(){return Ap||(Ap=1,Js.exports=uw()),Js.exports}var R=dw();const pe={Normal:"Normal",None:"None",Warm:"Warm",Cool:"Cool",BlackAndWhite:"BlackAndWhite",Vivid:"Vivid",Fade:"Fade",RetroVintage:"RetroVintage",Sepia:"Sepia",OldFilm:"OldFilm",Polaroid:"Polaroid",Seventies:"70s",Cinematic:"Cinematic",Dramatic:"Dramatic",Moody:"Moody",FilmNoir:"FilmNoir",SoftFocus:"SoftFocus",Dreamy:"Dreamy",DreamyVintage:"DreamyVintage",DarkMood:"DarkMood",HDR:"HDR",Pop:"Pop",Pastel:"Pastel",Neon:"Neon",Pixelize:"Pixelize",RadialPixel:"RadialPixel",CrossCut:"CrossCut",Liquid:"Liquid",Outliner:"Outliner",DotPattern:"DotPattern",CRT:"CRT",Posterize:"Posterize",TVGlitch:"TVGlitch",HalfTone:"HalfTone",Linocut:"Linocut",Shifter:"Shifter",Mirror:"Mirror",ASCII:"ASCII",Emboss:"Emboss",Glow:"Glow",TiltShift:"TiltShift",ExtrudeBlur:"ExtrudeBlur",Sharpie:"Sharpie",Recolor:"Recolor",GreenScreen:"GreenScreen",Godray:"Godray",MotionBlur:"MotionBlur",AdvancedBloom:"AdvancedBloom",RetroHalfTone:"RetroHalfTone",NightVision:"NightVision",Vignette:"Vignette",CYAN:"CYAN"};var jt=(t=>(t.NONE="none",t.EQUALIZER="equalizer",t.ROUNDBARS="roundbars",t.LED="led",t.RADIAL_SPECTRUM="radial_spectrum",t.LUMI_BARS="lumi_bars",t))(jt||{});let Op;function Mp(){return Op=document.body,Op}function tt(t,e,n){let r;return O.useEffect(()=>{r=r||Mp();const i=o=>{const s=o.detail;e(s)};return r.addEventListener(t,i,!1),()=>{r?.removeEventListener(t,i,!1)}},n),i=>{r=i}}function Hn(t,e){const n=Mp(),r=new CustomEvent(t,{detail:e});n.dispatchEvent(r)}function fw(){let t;function e(n){t=n}return e.emit=function(n,r){const i=new CustomEvent(n,{bubbles:!0,detail:r});t?.dispatchEvent(i)},e}const Ve=I.createContext({}),Ne={STOP:"GSAP_STOP",PAUSE:"GSAP_PAUSE",PLAY:"GSAP_PLAY",RESUME:"GSAP_RESUME",RESTART:"GSAP_RESTART",REPEAT:"GSAP_REPEAT",SEEK:"GSAP_SEEK",RESET:"GSAP_RESET",COMPLETE:"GSAP_COMPLETE",SEEK_START:"GSAP_SEEK_START",SEEK_END:"GSAP_SEEK_END",SCRUBBER_SEEK:"GSAP_SCRUBBER_SEEK",SCRUBBER_PROGRESS_UPDATE:"GSAP_SCRUBBER_PROGRESS_UPDATE",SCRUBBER_PLAY:"GSAP_SCRUBBER_PLAY",SCRUBBER_PAUSE:"GSAP_SCRUBBER_PAUSE",SCRUBBER_CLICKED:"GSAP_SCRUBBER_CLICKED",TRANSFORMER_DRAG_START:"TRANSFORMER_DRAG_START",TRANSFORMER_DRAG_END:"TRANSFORMER_DRAG_END",REVERSE_MODE_START:"REVERSE_MODE_START",REVERSE_MODE_END:"REVERSE_MODE_END",FONTS_LOADED:"FONTS_LOADED"},hw=({children:t})=>{const[e,n]=O.useState(0),r=O.useRef(void 0),i=O.useRef(void 0),o=O.useRef(0),s=O.useRef(!1),a=O.useRef(!1),[l,c]=O.useState(!1),u=O.useRef(new Set),f=O.useRef(!1),d=O.useRef(!1);O.useLayoutEffect(()=>(i.current=S.context(()=>{r.current&&r.current.progress(0).kill(),r.current&&r.current.clear(),r.current&&S.killTweensOf(r.current),r.current=S.timeline({paused:!0,defaults:{duration:0}})}),()=>{r.current&&r.current.revert(),i.current.revert()}),[]);const h=O.useCallback(()=>{if(r.current){const C=r.current.time();C<o.current?s.current=!0:s.current=!1,o.current=C,u.current.forEach(k=>{try{k(C)}catch(w){typeof console<"u"&&console.warn&&console.warn("[GsapPixi] timeUpdate listener error:",w)}})}},[]);O.useEffect(()=>{if(r.current){const M=r.current;M.eventCallback("onStart",function(){}).eventCallback("onInterrupt",function(){M.pause(),h()}).eventCallback("onUpdate",function(){h()}).eventCallback("onRepeat",function(){console.log("onrepeat",M.progress())}).eventCallback("onReverseComplete",function(){console.log("onReverseComplete",M.progress())}).eventCallback("onComplete",function(){M.seek(.01),M.pause(),f.current=!1,Hn(Ne.COMPLETE,{uniqueId:"timeline"}),console.log("Emitted events"),h()})}},[]),O.useEffect(()=>{r.current&&e>0&&o.current===0&&(r.current.seek(.01),o.current=.01)},[e]);const m=O.useCallback(()=>{r.current&&r.current.revert()},[]),p=O.useCallback(()=>{r.current&&(r.current.restart(),f.current=!0,Hn(Ne.RESUME))},[]),g=O.useCallback(()=>{if(!r.current)return;const M=r.current;M.repeat(1),M.restart(),f.current=!0,Hn(Ne.RESUME)},[]),y=O.useCallback(M=>{r.current&&(r.current.seek(M),h())},[h]),_=O.useCallback(()=>{r.current&&r.current.seek(4)},[]),v=O.useCallback(()=>{const M=r.current;return M?M.totalDuration():0},[]),x=O.useCallback(M=>{u.current.add(M)},[]),E=O.useCallback(M=>{u.current.delete(M)},[]),T=()=>{r.current&&(r.current.pause(),f.current=!1,Hn(Ne.PAUSE))},A=()=>{r.current&&(r.current.resume(),f.current=!0,Hn(Ne.RESUME))};return tt(Ne.SEEK_START,()=>{a.current=!0,d.current=!0}),tt(Ne.SCRUBBER_PLAY,()=>{A()}),tt(Ne.SCRUBBER_PAUSE,()=>{T()}),tt(Ne.SCRUBBER_SEEK,M=>{y(M)}),tt(Ne.SEEK_END,()=>{a.current=!1,d.current=!1}),tt(Ne.REVERSE_MODE_START,()=>{s.current=!0}),tt(Ne.REVERSE_MODE_END,()=>{s.current=!1}),tt(Ne.SCRUBBER_PROGRESS_UPDATE,M=>{}),R.jsx(Ve,{value:{gsapCtx:i,tl:r,handlePlay:A,handlePause:T,handleReset:m,handleSeek:y,handleSeekTest:_,handleRestart:p,handleRepeat:g,playerTimeRef:o,getTimelineDuration:v,totalDuration:e,setTotalDuration:n,reverseModeRef:s,dragModeRef:a,isRemotion:l,setIsRemotion:c,registerTimeUpdateListener:x,unregisterTimeUpdateListener:E,playStateRef:f,isSeekingRef:d},children:t})};var Qs,Ip;function io(){if(Ip)return Qs;Ip=1;var t=Object.prototype;function e(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||t;return n===i}return Qs=e,Qs}var ea,Cp;function Rp(){if(Cp)return ea;Cp=1;function t(e,n){return function(r){return e(n(r))}}return ea=t,ea}var ta,Lp;function pw(){if(Lp)return ta;Lp=1;var t=Rp(),e=t(Object.keys,Object);return ta=e,ta}var na,kp;function Pp(){if(kp)return na;kp=1;var t=io(),e=pw(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!t(o))return e(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return na=i,na}var ra,Dp;function Np(){if(Dp)return ra;Dp=1;var t=typeof Qi=="object"&&Qi&&Qi.Object===Object&&Qi;return ra=t,ra}var ia,Fp;function Rt(){if(Fp)return ia;Fp=1;var t=Np(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return ia=n,ia}var oa,Bp;function dr(){if(Bp)return oa;Bp=1;var t=Rt(),e=t.Symbol;return oa=e,oa}var sa,Up;function mw(){if(Up)return sa;Up=1;var t=dr(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[i]=l:delete s[i]),u}return sa=o,sa}var aa,Gp;function gw(){if(Gp)return aa;Gp=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return aa=n,aa}var ca,jp;function fr(){if(jp)return ca;jp=1;var t=dr(),e=mw(),n=gw(),r="[object Null]",i="[object Undefined]",o=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?e(a):n(a)}return ca=s,ca}var la,Hp;function Yn(){if(Hp)return la;Hp=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return la=t,la}var ua,Yp;function Wp(){if(Yp)return ua;Yp=1;var t=fr(),e=Yn(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!e(a))return!1;var l=t(a);return l==r||l==i||l==n||l==o}return ua=s,ua}var da,Xp;function yw(){if(Xp)return da;Xp=1;var t=Rt(),e=t["__core-js_shared__"];return da=e,da}var fa,zp;function _w(){if(zp)return fa;zp=1;var t=yw(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return fa=n,fa}var ha,qp;function Vp(){if(qp)return ha;qp=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return ha=n,ha}var pa,Kp;function bw(){if(Kp)return pa;Kp=1;var t=Wp(),e=_w(),n=Yn(),r=Vp(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,u=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!n(d)||e(d))return!1;var h=t(d)?u:o;return h.test(r(d))}return pa=f,pa}var ma,$p;function vw(){if($p)return ma;$p=1;function t(e,n){return e?.[n]}return ma=t,ma}var ga,Zp;function Wn(){if(Zp)return ga;Zp=1;var t=bw(),e=vw();function n(r,i){var o=e(r,i);return t(o)?o:void 0}return ga=n,ga}var ya,Jp;function xw(){if(Jp)return ya;Jp=1;var t=Wn(),e=Rt(),n=t(e,"DataView");return ya=n,ya}var _a,Qp;function ba(){if(Qp)return _a;Qp=1;var t=Wn(),e=Rt(),n=t(e,"Map");return _a=n,_a}var va,em;function Tw(){if(em)return va;em=1;var t=Wn(),e=Rt(),n=t(e,"Promise");return va=n,va}var xa,tm;function Ew(){if(tm)return xa;tm=1;var t=Wn(),e=Rt(),n=t(e,"Set");return xa=n,xa}var Ta,nm;function Sw(){if(nm)return Ta;nm=1;var t=Wn(),e=Rt(),n=t(e,"WeakMap");return Ta=n,Ta}var Ea,rm;function $r(){if(rm)return Ea;rm=1;var t=xw(),e=ba(),n=Tw(),r=Ew(),i=Sw(),o=fr(),s=Vp(),a="[object Map]",l="[object Object]",c="[object Promise]",u="[object Set]",f="[object WeakMap]",d="[object DataView]",h=s(t),m=s(e),p=s(n),g=s(r),y=s(i),_=o;return(t&&_(new t(new ArrayBuffer(1)))!=d||e&&_(new e)!=a||n&&_(n.resolve())!=c||r&&_(new r)!=u||i&&_(new i)!=f)&&(_=function(v){var x=o(v),E=x==l?v.constructor:void 0,T=E?s(E):"";if(T)switch(T){case h:return d;case m:return a;case p:return c;case g:return u;case y:return f}return x}),Ea=_,Ea}var Sa,im;function xn(){if(im)return Sa;im=1;function t(e){return e!=null&&typeof e=="object"}return Sa=t,Sa}var wa,om;function ww(){if(om)return wa;om=1;var t=fr(),e=xn(),n="[object Arguments]";function r(i){return e(i)&&t(i)==n}return wa=r,wa}var Aa,sm;function Oa(){if(sm)return Aa;sm=1;var t=ww(),e=xn(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=t((function(){return arguments})())?t:function(s){return e(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return Aa=o,Aa}var Ma,am;function rn(){if(am)return Ma;am=1;var t=Array.isArray;return Ma=t,Ma}var Ia,cm;function lm(){if(cm)return Ia;cm=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return Ia=e,Ia}var Ca,um;function Ra(){if(um)return Ca;um=1;var t=Wp(),e=lm();function n(r){return r!=null&&e(r.length)&&!t(r)}return Ca=n,Ca}var Zr={exports:{}},La,dm;function Aw(){if(dm)return La;dm=1;function t(){return!1}return La=t,La}Zr.exports;var fm;function oo(){return fm||(fm=1,(function(t,e){var n=Rt(),r=Aw(),i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;t.exports=c})(Zr,Zr.exports)),Zr.exports}var ka,hm;function Ow(){if(hm)return ka;hm=1;var t=fr(),e=lm(),n=xn(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",u="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",m="[object String]",p="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",_="[object Float32Array]",v="[object Float64Array]",x="[object Int8Array]",E="[object Int16Array]",T="[object Int32Array]",A="[object Uint8Array]",M="[object Uint8ClampedArray]",C="[object Uint16Array]",k="[object Uint32Array]",w={};w[_]=w[v]=w[x]=w[E]=w[T]=w[A]=w[M]=w[C]=w[k]=!0,w[r]=w[i]=w[g]=w[o]=w[y]=w[s]=w[a]=w[l]=w[c]=w[u]=w[f]=w[d]=w[h]=w[m]=w[p]=!1;function L(D){return n(D)&&e(D.length)&&!!w[t(D)]}return ka=L,ka}var Pa,pm;function Da(){if(pm)return Pa;pm=1;function t(e){return function(n){return e(n)}}return Pa=t,Pa}var Jr={exports:{}};Jr.exports;var mm;function Na(){return mm||(mm=1,(function(t,e){var n=Np(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();t.exports=a})(Jr,Jr.exports)),Jr.exports}var Fa,gm;function Ba(){if(gm)return Fa;gm=1;var t=Ow(),e=Da(),n=Na(),r=n&&n.isTypedArray,i=r?e(r):t;return Fa=i,Fa}var Ua,ym;function Mw(){if(ym)return Ua;ym=1;var t=Pp(),e=$r(),n=Oa(),r=rn(),i=Ra(),o=oo(),s=io(),a=Ba(),l="[object Map]",c="[object Set]",u=Object.prototype,f=u.hasOwnProperty;function d(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var m=e(h);if(m==l||m==c)return!h.size;if(s(h))return!t(h).length;for(var p in h)if(f.call(h,p))return!1;return!0}return Ua=d,Ua}var Iw=Mw();const Ga=lr(Iw);var _m=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(_m||{});const ja={normal:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:0},lensflare:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},filmstrip:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},grunge:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"ADD",alpha:1},bricks:{src:"https://assets.codepen.io/32795/poster.png",blendmode:"MULTIPLY",alpha:1}},bm=t=>{const{overlay:e,width:n,height:r,x:i,y:o}=t,{src:s}=ja[e]||ja.normal,[a,l]=I.useState(null);return I.useEffect(()=>{let c=!1;return K.Assets.load(s).then(u=>{c||l(u)}).catch(()=>{}),()=>{c=!0}},[s]),a?R.jsx("pixiTilingSprite",{texture:a,width:n,height:r,x:i,y:o,tilePosition:{x:0,y:0},tileScale:{x:.5,y:.5},alpha:.5,anchor:.5}):null};var Qr=(t=>(t.NONE="none",t.NORMAL="normal",t.LENSFLARE="lensflare",t.FILMSTRIP="filmstrip",t.GRUNGE="grunge",t.BRICKS="bricks",t))(Qr||{});var Cw=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,Rw=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,Lw=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,kw=/(^[#\.][a-z]|[a-y][a-z])/i,Pw=Math.PI/180,Dw=180/Math.PI,so=Math.sin,ao=Math.cos,_t=Math.abs,on=Math.sqrt,ei=Math.atan2,Ha=1e8,vm=function(e){return typeof e=="string"},xm=function(e){return typeof e=="number"},Nw=function(e){return typeof e>"u"},Fw={},Bw={},co=1e5,Tm=function(e){return Math.round((e+Ha)%1*co)/co||(e<0?0:1)},Ie=function(e){return Math.round(e*co)/co||0},Em=function(e){return Math.round(e*1e10)/1e10||0},Sm=function(e){return e.closed=Math.abs(e[0]-e[e.length-2])<.001&&Math.abs(e[1]-e[e.length-1])<.001},wm=function(e,n,r,i){var o=e[n],s=i===1?6:Xa(o,r,i);if((s||!i)&&s+r+2<o.length)return e.splice(n,0,o.slice(0,r+s+2)),o.splice(0,r+s),1},Ya=function(e,n,r){var i=e.length,o=~~(r*i);if(e[o]>n){for(;--o&&e[o]>n;);o<0&&(o=0)}else for(;e[++o]<n&&o<i;);return o<i?o:i-1},Uw=function(e,n){var r=e.length;for(e.reverse();r--;)e[r].reversed||hr(e[r])},Am=function(e,n){return n.totalLength=e.totalLength,e.samples?(n.samples=e.samples.slice(0),n.lookup=e.lookup.slice(0),n.minLength=e.minLength,n.resolution=e.resolution):e.totalPoints&&(n.totalPoints=e.totalPoints),n},Gw=function(e,n){var r=e.length,i=e[r-1]||[],o=i.length;r&&n[0]===i[o-2]&&n[1]===i[o-1]&&(n=i.concat(n.slice(2)),r--),e[r]=n};function ti(t){t=vm(t)&&kw.test(t)&&document.querySelector(t)||t;var e=t.getAttribute?t:0,n;return e&&(t=t.getAttribute("d"))?(e._gsPath||(e._gsPath={}),n=e._gsPath[t],n&&!n._dirty?n:e._gsPath[t]=Ht(t)):t?vm(t)?Ht(t):xm(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function jw(t){for(var e=[],n=0;n<t.length;n++)e[n]=Am(t[n],t[n].slice(0));return Am(t,e)}function hr(t){var e=0,n;for(t.reverse();e<t.length;e+=2)n=t[e],t[e]=t[e+1],t[e+1]=n;t.reversed=!t.reversed}var Hw=function(e,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(e.attributes),o=i.length,s;for(n=","+n+",";--o>-1;)s=i[o].nodeName.toLowerCase(),n.indexOf(","+s+",")<0&&r.setAttributeNS(null,s,i[o].nodeValue);return r},Yw={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"},Ww=function(e,n){for(var r=n?n.split(","):[],i={},o=r.length;--o>-1;)i[r[o]]=+e.getAttribute(r[o])||0;return i};function Wa(t,e){var n=t.tagName.toLowerCase(),r=.552284749831,i,o,s,a,l,c,u,f,d,h,m,p,g,y,_,v,x,E,T,A,M,C;return n==="path"||!t.getBBox?t:(c=Hw(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),C=Ww(t,Yw[n]),n==="rect"?(a=C.rx,l=C.ry||a,o=C.x,s=C.y,h=C.width-a*2,m=C.height-l*2,a||l?(p=o+a*(1-r),g=o+a,y=g+h,_=y+a*r,v=y+a,x=s+l*(1-r),E=s+l,T=E+m,A=T+l*r,M=T+l,i="M"+v+","+E+" V"+T+" C"+[v,A,_,M,y,M,y-(y-g)/3,M,g+(y-g)/3,M,g,M,p,M,o,A,o,T,o,T-(T-E)/3,o,E+(T-E)/3,o,E,o,x,p,s,g,s,g+(y-g)/3,s,y-(y-g)/3,s,y,s,_,s,v,x,v,E].join(",")+"z"):i="M"+(o+h)+","+s+" v"+m+" h"+-h+" v"+-m+" h"+h+"z"):n==="circle"||n==="ellipse"?(n==="circle"?(a=l=C.r,f=a*r):(a=C.rx,l=C.ry,f=l*r),o=C.cx,s=C.cy,u=a*r,i="M"+(o+a)+","+s+" C"+[o+a,s+f,o+u,s+l,o,s+l,o-u,s+l,o-a,s+f,o-a,s,o-a,s-f,o-u,s-l,o,s-l,o+u,s-l,o+a,s-f,o+a,s].join(",")+"z"):n==="line"?i="M"+C.x1+","+C.y1+" L"+C.x2+","+C.y2:(n==="polyline"||n==="polygon")&&(d=(t.getAttribute("points")+"").match(Rw)||[],o=d.shift(),s=d.shift(),i="M"+o+","+s+" L"+d.join(","),n==="polygon"&&(i+=","+o+","+s+"z")),c.setAttribute("d",Tn(c._gsRawPath=Ht(i))),e&&t.parentNode&&(t.parentNode.insertBefore(c,t),t.parentNode.removeChild(t)),c)}function Om(t,e,n){var r=t[e],i=t[e+2],o=t[e+4],s;return r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,s=i+(o+(t[e+6]-o)*n-i)*n-r,r=t[e+1],i=t[e+3],o=t[e+5],r+=(i-r)*n,i+=(o-i)*n,r+=(i-r)*n,Ie(ei(i+(o+(t[e+7]-o)*n-i)*n-r,s)*Dw)}function Mm(t,e,n){n=Nw(n)?1:Em(n)||0,e=Em(e)||0;var r=Math.max(0,~~(_t(n-e)-1e-8)),i=jw(t);if(e>n&&(e=1-e,n=1-n,Uw(i),i.totalLength=0),e<0||n<0){var o=Math.abs(~~Math.min(e,n))+1;e+=o,n+=o}i.totalLength||sn(i);var s=n>1,a=Cm(i,e,Fw,!0),l=Cm(i,n,Bw),c=l.segment,u=a.segment,f=l.segIndex,d=a.segIndex,h=l.i,m=a.i,p=d===f,g=h===m&&p,y,_,v,x,E,T,A,M;if(s||r){for(y=f<d||p&&h<m||g&&l.t<a.t,wm(i,d,m,a.t)&&(d++,y||(f++,g?(l.t=(l.t-a.t)/(1-a.t),h=0):p&&(h-=m))),Math.abs(1-(n-e))<1e-5?f=d-1:!l.t&&f?f--:wm(i,f,h,l.t)&&y&&d++,a.t===1&&(d=(d+1)%i.length),E=[],T=i.length,A=1+T*r,M=d,A+=(T-d+f)%T,x=0;x<A;x++)Gw(E,i[M++%T]);i=E}else if(v=l.t===1?6:Xa(c,h,l.t),e!==n)for(_=Xa(u,m,g?a.t/l.t:a.t),p&&(v+=_),c.splice(h+v+2),(_||m)&&u.splice(0,m+_),x=i.length;x--;)(x<d||x>f)&&i.splice(x,1);else c.angle=Om(c,h+v,0),h+=v,a=c[h],l=c[h+1],c.length=c.totalLength=0,c.totalPoints=i.totalPoints=8,c.push(a,l,a,l,a,l,a,l);return i.totalLength=0,i}function Im(t,e,n){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var r=~~t.resolution||12,i=1/r,o=t.length,s=t[e],a=t[e+1],l=e?e/6*r:0,c=t.samples,u=t.lookup,f=(e?t.minLength:Ha)||Ha,d=c[l+n*r-1],h=e?c[l-1]:0,m,p,g,y,_,v,x,E,T,A,M,C,k,w,L,D,N;for(c.length=u.length=0,p=e+2;p<o;p+=6){if(g=t[p+4]-s,y=t[p+2]-s,_=t[p]-s,E=t[p+5]-a,T=t[p+3]-a,A=t[p+1]-a,v=x=M=C=0,_t(g)<.01&&_t(E)<.01&&_t(_)+_t(A)<.01)t.length>8&&(t.splice(p,6),p-=6,o-=6);else for(m=1;m<=r;m++)w=i*m,k=1-w,v=x-(x=(w*w*g+3*k*(w*y+k*_))*w),M=C-(C=(w*w*E+3*k*(w*T+k*A))*w),D=on(M*M+v*v),D<f&&(f=D),h+=D,c[l++]=h;s+=g,a+=E}if(d)for(d-=h;l<c.length;l++)c[l]+=d;if(c.length&&f){if(t.totalLength=N=c[c.length-1]||0,t.minLength=f,N/f<9999)for(D=L=0,m=0;m<N;m+=f)u[D++]=c[L]<m?++L:L}else t.totalLength=c[0]=0;return e?h-c[e/2-1]:h}function sn(t,e){var n,r,i;for(i=n=r=0;i<t.length;i++)t[i].resolution=~~e||12,n+=Im(t[i]),r+=t[i].length;return t.totalPoints=r,t.totalLength=n,t}function Xa(t,e,n){if(n<=0||n>=1)return 0;var r=t[e],i=t[e+1],o=t[e+2],s=t[e+3],a=t[e+4],l=t[e+5],c=t[e+6],u=t[e+7],f=r+(o-r)*n,d=o+(a-o)*n,h=i+(s-i)*n,m=s+(l-s)*n,p=f+(d-f)*n,g=h+(m-h)*n,y=a+(c-a)*n,_=l+(u-l)*n;return d+=(y-d)*n,m+=(_-m)*n,t.splice(e+2,4,Ie(f),Ie(h),Ie(p),Ie(g),Ie(p+(d-p)*n),Ie(g+(m-g)*n),Ie(d),Ie(m),Ie(y),Ie(_)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}function Cm(t,e,n,r){n=n||{},t.totalLength||sn(t),(e<0||e>1)&&(e=Tm(e));var i=0,o=t[0],s,a,l,c,u,f,d;if(!e)d=f=i=0,o=t[0];else if(e===1)d=1,i=t.length-1,o=t[i],f=o.length-8;else{if(t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=f;o=t[i],c=u-o.totalLength,e=(l-c)/(u-c)||0}s=o.samples,a=o.resolution,l=o.totalLength*e,f=o.lookup.length?o.lookup[~~(l/o.minLength)]||0:Ya(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a),f=~~(f/a)*6,r&&d===1&&(f+6<o.length?(f+=6,d=0):i+1<t.length&&(f=d=0,o=t[++i]))}return n.t=d,n.i=f,n.path=t,n.segment=o,n.segIndex=i,n}function Rm(t,e,n,r){var i=t[0],o=r||{},s,a,l,c,u,f,d,h,m;if((e<0||e>1)&&(e=Tm(e)),i.lookup||sn(t),t.length>1){for(l=t.totalLength*e,u=f=0;(u+=t[f++].totalLength)<l;)i=t[f];c=u-i.totalLength,e=(l-c)/(u-c)||0}return s=i.samples,a=i.resolution,l=i.totalLength*e,f=i.lookup.length?i.lookup[e<1?~~(l/i.minLength):i.lookup.length-1]||0:Ya(s,l,e),c=f?s[f-1]:0,u=s[f],u<l&&(c=u,u=s[++f]),d=1/a*((l-c)/(u-c)+f%a)||0,m=1-d,f=~~(f/a)*6,h=i[f],o.x=Ie((d*d*(i[f+6]-h)+3*m*(d*(i[f+4]-h)+m*(i[f+2]-h)))*d+h),o.y=Ie((d*d*(i[f+7]-(h=i[f+1]))+3*m*(d*(i[f+5]-h)+m*(i[f+3]-h)))*d+h),n&&(o.angle=i.totalLength?Om(i,f,d>=1?1-1e-9:d||1e-9):i.angle||0),o}function ni(t,e,n,r,i,o,s){for(var a=t.length,l,c,u,f,d;--a>-1;)for(l=t[a],c=l.length,u=0;u<c;u+=2)f=l[u],d=l[u+1],l[u]=f*e+d*r+o,l[u+1]=f*n+d*i+s;return t._dirty=1,t}function Xw(t,e,n,r,i,o,s,a,l){if(!(t===a&&e===l)){n=_t(n),r=_t(r);var c=i%360*Pw,u=ao(c),f=so(c),d=Math.PI,h=d*2,m=(t-a)/2,p=(e-l)/2,g=u*m+f*p,y=-f*m+u*p,_=g*g,v=y*y,x=_/(n*n)+v/(r*r);x>1&&(n=on(x)*n,r=on(x)*r);var E=n*n,T=r*r,A=(E*T-E*v-T*_)/(E*v+T*_);A<0&&(A=0);var M=(o===s?-1:1)*on(A),C=M*(n*y/r),k=M*-(r*g/n),w=(t+a)/2,L=(e+l)/2,D=w+(u*C-f*k),N=L+(f*C+u*k),F=(g-C)/n,H=(y-k)/r,V=(-g-C)/n,$=(-y-k)/r,re=F*F+H*H,he=(H<0?-1:1)*Math.acos(F/on(re)),q=(F*$-H*V<0?-1:1)*Math.acos((F*V+H*$)/on(re*(V*V+$*$)));isNaN(q)&&(q=d),!s&&q>0?q-=h:s&&q<0&&(q+=h),he%=h,q%=h;var fe=Math.ceil(_t(q)/(h/4)),Y=[],te=q/fe,z=4/3*so(te/2)/(1+ao(te/2)),le=u*n,Q=f*n,ce=f*-r,ye=u*r,U;for(U=0;U<fe;U++)i=he+U*te,g=ao(i),y=so(i),F=ao(i+=te),H=so(i),Y.push(g-z*y,y+z*g,F+z*H,H-z*F,F,H);for(U=0;U<Y.length;U+=2)g=Y[U],y=Y[U+1],Y[U]=g*le+y*ce+D,Y[U+1]=g*Q+y*ye+N;return Y[U-2]=a,Y[U-1]=l,Y}}function Ht(t){var e=(t+"").replace(Lw,function(C){var k=+C;return k<1e-4&&k>-1e-4?0:k}).match(Cw)||[],n=[],r=0,i=0,o=2/3,s=e.length,a=0,l="ERROR: malformed path: "+t,c,u,f,d,h,m,p,g,y,_,v,x,E,T,A,M=function(k,w,L,D){_=(L-k)/3,v=(D-w)/3,p.push(k+_,w+v,L-_,D-v,L,D)};if(!t||!isNaN(e[0])||isNaN(e[1]))return console.log(l),n;for(c=0;c<s;c++)if(E=h,isNaN(e[c])?(h=e[c].toUpperCase(),m=h!==e[c]):c--,f=+e[c+1],d=+e[c+2],m&&(f+=r,d+=i),c||(g=f,y=d),h==="M")p&&(p.length<8?n.length-=1:a+=p.length,Sm(p)),r=g=f,i=y=d,p=[f,d],n.push(p),c+=2,h="L";else if(h==="C")p||(p=[0,0]),m||(r=i=0),p.push(f,d,r+e[c+3]*1,i+e[c+4]*1,r+=e[c+5]*1,i+=e[c+6]*1),c+=6;else if(h==="S")_=r,v=i,(E==="C"||E==="S")&&(_+=r-p[p.length-4],v+=i-p[p.length-3]),m||(r=i=0),p.push(_,v,f,d,r+=e[c+3]*1,i+=e[c+4]*1),c+=4;else if(h==="Q")_=r+(f-r)*o,v=i+(d-i)*o,m||(r=i=0),r+=e[c+3]*1,i+=e[c+4]*1,p.push(_,v,r+(f-r)*o,i+(d-i)*o,r,i),c+=4;else if(h==="T")_=r-p[p.length-4],v=i-p[p.length-3],p.push(r+_,i+v,f+(r+_*1.5-f)*o,d+(i+v*1.5-d)*o,r=f,i=d),c+=2;else if(h==="H")M(r,i,r=f,i),c+=1;else if(h==="V")M(r,i,r,i=f+(m?i-r:0)),c+=1;else if(h==="L"||h==="Z")h==="Z"&&(f=g,d=y,p.closed=!0),(h==="L"||_t(r-f)>.5||_t(i-d)>.5)&&(M(r,i,f,d),h==="L"&&(c+=2)),r=f,i=d;else if(h==="A"){if(T=e[c+4],A=e[c+5],_=e[c+6],v=e[c+7],u=7,T.length>1&&(T.length<3?(v=_,_=A,u--):(v=A,_=T.substr(2),u-=2),A=T.charAt(1),T=T.charAt(0)),x=Xw(r,i,+e[c+1],+e[c+2],+e[c+3],+T,+A,(m?r:0)+_*1,(m?i:0)+v*1),c+=u,x)for(u=0;u<x.length;u++)p.push(x[u]);r=p[p.length-2],i=p[p.length-1]}else console.log(l);return c=p.length,c<6?(n.pop(),c=0):Sm(p),n.totalPoints=a+c,n}function zw(t,e){e===void 0&&(e=1);for(var n=t[0],r=0,i=[n,r],o=2;o<t.length;o+=2)i.push(n,r,t[o],r=(t[o]-n)*e/2,n=t[o],-r);return i}function qw(t,e){t.samples||Im(t);for(var n=t.samples,r=t.lookup,i=t.resolution,o=t.totalLength,s=t.slice(0,2),a=[],l=t.length-4,c=6,u=.2,f=0,d=0,h,m,p,g,y,_,v,x,E,T,A,M,C,k;c<l;c+=6)Math.abs(ei(t[c+1]-t[c-1],t[c]-t[c-2])-ei(t[c+3]-t[c+1],t[c+2]-t[c]))>u&&a.push(c);if(a.push(t.length-2),l=a.length,s.nonSmooth=M=[1],e>l)for(e-=l,y=0;y<l;y++){for(C=a[y],k=Math.round(C/6*i),E=n[k-1]-f,m=Math.round(n[k-1]/o*e)-d,d+=m,_=1/(m+1),v=1;v<=m;v++)T=f+E*v*_,c=r.length?r[T<o?~~(T/t.minLength):r.length-1]||0:Ya(n,T,T/o),p=c?n[c-1]:0,g=n[c],g<T&&(p=g,g=n[++c]),h=1/i*((T-p)/(g-p)+c%i)||0,x=1-h,c=~~(c/i)*6,A=t[c],s.push(Ie((h*h*(t[c+6]-A)+3*x*(h*(t[c+4]-A)+x*(t[c+2]-A)))*h+A),Ie((h*h*(t[c+7]-(A=t[c+1]))+3*x*(h*(t[c+5]-A)+x*(t[c+3]-A)))*h+A));M[s.length]=1,s.push(t[C],t[C+1]),f+=E}return c=t.length-2,t.closed&&Math.abs(ei(t[c+1]-t[c-1],t[c]-t[c-2])-ei(t[3]-t[1],t[2]-t[0]))<=u&&(M[0]=M[M.length-1]=0),s}function lo(t,e){_t(t[0]-t[2])<1e-4&&_t(t[1]-t[3])<1e-4&&(t=t.slice(2));var n=t.length-2,r=+t[0],i=+t[1],o=+t[2],s=+t[3],a=[r,i,r,i],l=o-r,c=s-i,u=t.nonSmooth||[],f=Math.abs(t[n]-r)<.001&&Math.abs(t[n+1]-i)<.001,d,h,m,p,g,y,_,v,x,E,T,A,M,C,k;if(!n)return[r,i,r,i,r,i,r,i];for(f&&(t.push(o,s),o=r,s=i,r=t[n-2],i=t[n-1],t.unshift(r,i),n+=4,u=[0,0].concat(u)),e=e||e===0?+e:1,m=2;m<n;m+=2)if(d=r,h=i,r=o,i=s,o=+t[m+2],s=+t[m+3],!(r===o&&i===s)){if(p=l,g=c,l=o-r,c=s-i,u[m]){a.push(r-(r-d)/4,i-(i-h)/4,r,i,r+(o-r)/4,i+(s-i)/4);continue}y=on(p*p+g*g),_=on(l*l+c*c),v=on(Math.pow(l/_+p/y,2)+Math.pow(c/_+g/y,2)),x=(y+_)*e*.25/v,E=r-(r-d)*(y?x/y:0),T=r+(o-r)*(_?x/_:0),A=r-(E+((T-E)*(y*3/(y+_)+.5)/4||0)),M=i-(i-h)*(y?x/y:0),C=i+(s-i)*(_?x/_:0),k=i-(M+((C-M)*(y*3/(y+_)+.5)/4||0)),a.push(Ie(E+A),Ie(M+k),Ie(r),Ie(i),Ie(T+A),Ie(C+k))}return r!==o||i!==s||a.length<4?a.push(Ie(o),Ie(s),Ie(o),Ie(s)):a.length-=2,a.length===2?a.push(r,i,r,i,r,i):f&&(a.splice(0,6),a.length-=6),a.closed=f,a}function Tn(t){xm(t[0])&&(t=[t]);var e="",n=t.length,r,i,o,s;for(i=0;i<n;i++){for(s=t[i],e+="M"+Ie(s[0])+","+Ie(s[1])+" C",r=s.length,o=2;o<r;o++)e+=Ie(s[o++])+","+Ie(s[o++])+" "+Ie(s[o++])+","+Ie(s[o++])+" "+Ie(s[o++])+","+Ie(s[o])+" ";s.closed&&(e+="z")}return e}var an,Xn,za,uo,ri,fo,ho,ii,Lt="transform",qa=Lt+"Origin",Lm,km=function(e){var n=e.ownerDocument||e;for(!(Lt in e.style)&&("msTransform"in e.style)&&(Lt="msTransform",qa=Lt+"Origin");n.parentNode&&(n=n.parentNode););if(Xn=window,ho=new oi,n){an=n,za=n.documentElement,uo=n.body,ii=an.createElementNS("http://www.w3.org/2000/svg","g"),ii.style.transform="none";var r=n.createElement("div"),i=n.createElement("div"),o=n&&(n.body||n.firstElementChild);o&&o.appendChild&&(o.appendChild(r),r.appendChild(i),r.style.position="static",r.style.transform="translate3d(0,0,1px)",Lm=i.offsetParent!==r,o.removeChild(r))}return n},Vw=function(e){for(var n,r;e&&e!==uo;)r=e._gsap,r&&r.uncache&&r.get(e,"x"),r&&!r.scaleX&&!r.scaleY&&r.renderTransform&&(r.scaleX=r.scaleY=1e-4,r.renderTransform(1,r),n?n.push(r):n=[r]),e=e.parentNode;return n},Pm=[],Dm=[],Kw=function(){return Xn.pageYOffset||an.scrollTop||za.scrollTop||uo.scrollTop||0},$w=function(){return Xn.pageXOffset||an.scrollLeft||za.scrollLeft||uo.scrollLeft||0},Va=function(e){return e.ownerSVGElement||((e.tagName+"").toLowerCase()==="svg"?e:null)},Zw=function t(e){if(Xn.getComputedStyle(e).position==="fixed")return!0;if(e=e.parentNode,e&&e.nodeType===1)return t(e)},Ka=function t(e,n){if(e.parentNode&&(an||km(e))){var r=Va(e),i=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o=r?n?"rect":"g":"div",s=n!==2?0:100,a=n===3?100:0,l={position:"absolute",display:"block",pointerEvents:"none",margin:"0",padding:"0"},c=an.createElementNS?an.createElementNS(i.replace(/^https/,"http"),o):an.createElement(o);return n&&(r?(fo||(fo=t(e)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+s+","+a+")"),c.setAttribute("fill","transparent"),fo.appendChild(c)):(ri||(ri=t(e),Object.assign(ri.style,l)),Object.assign(c.style,l,{width:"0.1px",height:"0.1px",top:a+"px",left:s+"px"}),ri.appendChild(c))),c}throw"Need document and parent."},Jw=function(e){for(var n=new oi,r=0;r<e.numberOfItems;r++)n.multiply(e.getItem(r).matrix);return n},Qw=function(e){var n=e.getCTM(),r;return n||(r=e.style[Lt],e.style[Lt]="none",e.appendChild(ii),n=ii.getCTM(),e.removeChild(ii),r?e.style[Lt]=r:e.style.removeProperty(Lt.replace(/([A-Z])/g,"-$1").toLowerCase())),n||ho.clone()},eA=function(e,n){var r=Va(e),i=e===r,o=r?Pm:Dm,s=e.parentNode,a=s&&!r&&s.shadowRoot&&s.shadowRoot.appendChild?s.shadowRoot:s,l,c,u,f,d,h;if(e===Xn)return e;if(o.length||o.push(Ka(e,1),Ka(e,2),Ka(e,3)),l=r?fo:ri,r)i?(u=Qw(e),f=-u.e/u.a,d=-u.f/u.d,c=ho):e.getBBox?(u=e.getBBox(),c=e.transform?e.transform.baseVal:{},c=c.numberOfItems?c.numberOfItems>1?Jw(c):c.getItem(0).matrix:ho,f=c.a*u.x+c.c*u.y,d=c.b*u.x+c.d*u.y):(c=new oi,f=d=0),n&&e.tagName.toLowerCase()==="g"&&(f=d=0),(i||!e.getBoundingClientRect().width?r:s).appendChild(l),l.setAttribute("transform","matrix("+c.a+","+c.b+","+c.c+","+c.d+","+(c.e+f)+","+(c.f+d)+")");else{if(f=d=0,Lm)for(c=e.offsetParent,u=e;u&&(u=u.parentNode)&&u!==c&&u.parentNode;)(Xn.getComputedStyle(u)[Lt]+"").length>4&&(f=u.offsetLeft,d=u.offsetTop,u=0);if(h=Xn.getComputedStyle(e),h.position!=="absolute"&&h.position!=="fixed")for(c=e.offsetParent;s&&s!==c;)f+=s.scrollLeft||0,d+=s.scrollTop||0,s=s.parentNode;u=l.style,u.top=e.offsetTop-d+"px",u.left=e.offsetLeft-f+"px",u[Lt]=h[Lt],u[qa]=h[qa],u.position=h.position==="fixed"?"fixed":"absolute",a.appendChild(l)}return l},$a=function(e,n,r,i,o,s,a){return e.a=n,e.b=r,e.c=i,e.d=o,e.e=s,e.f=a,e},oi=(function(){function t(n,r,i,o,s,a){n===void 0&&(n=1),r===void 0&&(r=0),i===void 0&&(i=0),o===void 0&&(o=1),s===void 0&&(s=0),a===void 0&&(a=0),$a(this,n,r,i,o,s,a)}var e=t.prototype;return e.inverse=function(){var r=this.a,i=this.b,o=this.c,s=this.d,a=this.e,l=this.f,c=r*s-i*o||1e-10;return $a(this,s/c,-i/c,-o/c,r/c,(o*l-s*a)/c,-(r*l-i*a)/c)},e.multiply=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f,u=r.a,f=r.c,d=r.b,h=r.d,m=r.e,p=r.f;return $a(this,u*i+d*s,u*o+d*a,f*i+h*s,f*o+h*a,l+m*i+p*s,c+m*o+p*a)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(r){var i=this.a,o=this.b,s=this.c,a=this.d,l=this.e,c=this.f;return i===r.a&&o===r.b&&s===r.c&&a===r.d&&l===r.e&&c===r.f},e.apply=function(r,i){i===void 0&&(i={});var o=r.x,s=r.y,a=this.a,l=this.b,c=this.c,u=this.d,f=this.e,d=this.f;return i.x=o*a+s*c+f||0,i.y=o*l+s*u+d||0,i},t})();function pr(t,e,n,r){if(!t||!t.parentNode||(an||km(t)).documentElement===t)return new oi;var i=Vw(t),o=Va(t),s=o?Pm:Dm,a=eA(t,n),l=s[0].getBoundingClientRect(),c=s[1].getBoundingClientRect(),u=s[2].getBoundingClientRect(),f=a.parentNode,d=!r&&Zw(t),h=new oi((c.left-l.left)/100,(c.top-l.top)/100,(u.left-l.left)/100,(u.top-l.top)/100,l.left+(d?0:$w()),l.top+(d?0:Kw()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return e?h.inverse():h}var tA="x,translateX,left,marginLeft,xPercent".split(","),nA="y,translateY,top,marginTop,yPercent".split(","),rA=Math.PI/180,bt,Nm,mr,Za,Ja,Fm,iA=function(){return bt||typeof window<"u"&&(bt=window.gsap)&&bt.registerPlugin&&bt},si=function(e,n,r,i){for(var o=n.length,s=i===2?0:i,a=0;a<o;a++)e[s]=parseFloat(n[a][r]),i===2&&(e[s+1]=0),s+=2;return e},gr=function(e,n,r){return parseFloat(e._gsap.get(e,n,r||"px"))||0},Bm=function(e){var n=e[0],r=e[1],i;for(i=2;i<e.length;i+=2)n=e[i]+=n,r=e[i+1]+=r},Um=function(e,n,r,i,o,s,a,l,c){if(a.type==="cubic")n=[n];else{a.fromCurrent!==!1&&n.unshift(gr(r,i,l),o?gr(r,o,c):0),a.relative&&Bm(n);var u=o?lo:zw;n=[u(n,a.curviness)]}return n=s(jm(n,r,a)),po(e,r,i,n,"x",l),o&&po(e,r,o,n,"y",c),sn(n,a.resolution||(a.curviness===0?20:12))},oA=function(e){return e},sA=/[-+\.]*\d+\.?(?:e-|e\+)?\d*/g,Gm=function(e,n,r){var i=pr(e),o=0,s=0,a;return(e.tagName+"").toLowerCase()==="svg"?(a=e.viewBox.baseVal,a.width||(a={width:+e.getAttribute("width"),height:+e.getAttribute("height")})):a=n&&e.getBBox&&e.getBBox(),n&&n!=="auto"&&(o=n.push?n[0]*(a?a.width:e.offsetWidth||0):n.x,s=n.push?n[1]*(a?a.height:e.offsetHeight||0):n.y),r.apply(o||s?i.apply({x:o,y:s}):{x:i.e,y:i.f})},Qa=function(e,n,r,i){var o=pr(e.parentNode,!0,!0),s=o.clone().multiply(pr(n)),a=Gm(e,r,o),l=Gm(n,i,o),c=l.x,u=l.y,f;return s.e=s.f=0,i==="auto"&&n.getTotalLength&&n.tagName.toLowerCase()==="path"&&(f=n.getAttribute("d").match(sA)||[],f=s.apply({x:+f[0],y:+f[1]}),c+=f.x,u+=f.y),f&&(f=s.apply(n.getBBox()),c-=f.x,u-=f.y),s.e=c-a.x,s.f=u-a.y,s},jm=function(e,n,r){var i=r.align,o=r.matrix,s=r.offsetX,a=r.offsetY,l=r.alignOrigin,c=e[0][0],u=e[0][1],f=gr(n,"x"),d=gr(n,"y"),h,m,p;return!e||!e.length?ti("M0,0L0,0"):(i&&(i==="self"||(h=Za(i)[0]||n)===n?ni(e,1,0,0,1,f-c,d-u):(l&&l[2]!==!1?bt.set(n,{transformOrigin:l[0]*100+"% "+l[1]*100+"%"}):l=[gr(n,"xPercent")/-100,gr(n,"yPercent")/-100],m=Qa(n,h,l,"auto"),p=m.apply({x:c,y:u}),ni(e,m.a,m.b,m.c,m.d,f+m.e-(p.x-m.e),d+m.f-(p.y-m.f)))),o?ni(e,o.a,o.b,o.c,o.d,o.e,o.f):(s||a)&&ni(e,1,0,0,1,s||0,a||0),e)},po=function(e,n,r,i,o,s){var a=n._gsap,l=a.harness,c=l&&l.aliases&&l.aliases[r],u=c&&c.indexOf(",")<0?c:r,f=e._pt=new Nm(e._pt,n,u,0,0,oA,0,a.set(n,u,e));f.u=mr(a.get(n,u,s))||0,f.path=i,f.pp=o,e._props.push(u)},aA=function(e,n){return function(r){return e||n!==1?Mm(r,e,n):r}},Hm={version:"3.15.0",name:"motionPath",register:function(e,n,r){bt=e,mr=bt.utils.getUnit,Za=bt.utils.toArray,Ja=bt.core.getStyleSaver,Fm=bt.core.reverting||function(){},Nm=r},init:function(e,n,r){if(!bt)return console.warn("Please gsap.registerPlugin(MotionPathPlugin)"),!1;(!(typeof n=="object"&&!n.style)||!n.path)&&(n={path:n});var i=[],o=n,s=o.path,a=o.autoRotate,l=o.unitX,c=o.unitY,u=o.x,f=o.y,d=s[0],h=aA(n.start,"end"in n?n.end:1),m,p;if(this.rawPaths=i,this.target=e,this.tween=r,this.styles=Ja&&Ja(e,"transform"),(this.rotate=a||a===0)&&(this.rOffset=parseFloat(a)||0,this.radians=!!n.useRadians,this.rProp=n.rotation||"rotation",this.rSet=e._gsap.set(e,this.rProp,this),this.ru=mr(e._gsap.get(e,this.rProp))||0),Array.isArray(s)&&!("closed"in s)&&typeof d!="number"){for(p in d)!u&&~tA.indexOf(p)?u=p:!f&&~nA.indexOf(p)&&(f=p);u&&f?i.push(Um(this,si(si([],s,u,0),s,f,1),e,u,f,h,n,l||mr(s[0][u]),c||mr(s[0][f]))):u=f=0;for(p in d)p!==u&&p!==f&&i.push(Um(this,si([],s,p,2),e,p,0,h,n,mr(s[0][p])))}else m=h(jm(ti(n.path),e,n)),sn(m,n.resolution),i.push(m),po(this,e,n.x||"x",m,"x",n.unitX||"px"),po(this,e,n.y||"y",m,"y",n.unitY||"px");r.vars.immediateRender&&this.render(r.progress(),this)},render:function(e,n){var r=n.rawPaths,i=r.length,o=n._pt;if(n.tween._time||!Fm()){for(e>1?e=1:e<0&&(e=0);i--;)Rm(r[i],e,!i&&n.rotate,r[i]);for(;o;)o.set(o.t,o.p,o.path[o.pp]+o.u,o.d,e),o=o._next;n.rotate&&n.rSet(n.target,n.rProp,r[0].angle*(n.radians?rA:1)+n.rOffset+n.ru,n,e)}else n.styles.revert()},getLength:function(e){return sn(ti(e)).totalLength},sliceRawPath:Mm,getRawPath:ti,pointsToSegment:lo,stringToRawPath:Ht,rawPathToString:Tn,transformRawPath:ni,getGlobalMatrix:pr,getPositionOnPath:Rm,cacheRawPathMeasurements:sn,convertToPath:function(e,n){return Za(e).map(function(r){return Wa(r,n!==!1)})},convertCoordinates:function(e,n,r){var i=pr(n,!0,!0).multiply(pr(e));return r?i.apply(r):i},getAlignMatrix:Qa,getRelativePosition:function(e,n,r,i){var o=Qa(e,n,r,i);return{x:o.e,y:o.f}},arrayToRawPath:function(e,n){n=n||{};var r=si(si([],e,n.x||"x",0),e,n.y||"y",1);return n.relative&&Bm(r),[n.type==="cubic"?r:lo(r,n.curviness)]}};iA()&&bt.registerPlugin(Hm),S.registerPlugin(sr.PixiPlugin),sr.PixiPlugin.registerPIXI(K),S.registerPlugin(Dn),Dn.create("springBounce","0.32, 1.06, 0.61, 0.93"),S.registerEffect({name:"HEART_BEAT",effect(t,e){try{const{canvasWidth:r,canvasHeight:i,...o}=e;return S.timeline({repeat:e.repeat||0,defaults:{ease:"power2.out",...o}}).to(t,{pixi:{scale:1*1.3},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.14,ease:"power2.in"}).to(t,{pixi:{scale:1*1.2},duration:.14,ease:"power1.out"}).to(t,{pixi:{scale:1},duration:.28,ease:"power2.in"})}catch(n){return console.error("[HEART_BEAT] Animation error:",n),S.timeline()}}});const se={IN:"IN",OUT:"OUT",ATTENTION:"ATTENTION"},ie={NONE:"NONE",FADE:"FADE",SLIDE:"SLIDE",ZOOM:"ZOOM",BOUNCE:"BOUNCE",BACK:"BACK",FLIP:"FLIP",ROTATE:"ROTATE",ROLL:"ROLL",LIGHT_SPEED:"LIGHT_SPEED",WIPE:"WIPE",SHAKE:"SHAKE",SPECIAL:"SPECIAL"},Pe={OFFSET_MEDIUM:2e3}.OFFSET_MEDIUM,Se={NONE:{id:"NONE",category:ie.NONE,direction:null,keyframes:{},gsapEasing:"none",defaultDuration:0},FADE_IN:{id:"FADE_IN",category:ie.FADE,direction:se.IN,keyframes:{opacity:{from:0,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5},FADE_IN_DOWN:{id:"FADE_IN_DOWN",category:ie.FADE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_UP:{id:"FADE_IN_UP",category:ie.FADE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_LEFT:{id:"FADE_IN_LEFT",category:ie.FADE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_IN_RIGHT:{id:"FADE_IN_RIGHT",category:ie.FADE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power1.out",defaultDuration:.5},FADE_OUT:{id:"FADE_OUT",category:ie.FADE,direction:se.OUT,keyframes:{opacity:{from:1,to:0}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_DOWN:{id:"FADE_OUT_DOWN",category:ie.FADE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_UP:{id:"FADE_OUT_UP",category:ie.FADE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_LEFT:{id:"FADE_OUT_LEFT",category:ie.FADE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"power2.out",defaultDuration:.5},FADE_OUT_RIGHT:{id:"FADE_OUT_RIGHT",category:ie.FADE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_DOWN:{id:"SLIDE_IN_DOWN",category:ie.SLIDE,direction:se.IN,keyframes:{translateY:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_UP:{id:"SLIDE_IN_UP",category:ie.SLIDE,direction:se.IN,keyframes:{translateY:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_LEFT:{id:"SLIDE_IN_LEFT",category:ie.SLIDE,direction:se.IN,keyframes:{translateX:{from:"-100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_IN_RIGHT:{id:"SLIDE_IN_RIGHT",category:ie.SLIDE,direction:se.IN,keyframes:{translateX:{from:"100%",to:0}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_DOWN:{id:"SLIDE_OUT_DOWN",category:ie.SLIDE,direction:se.OUT,keyframes:{translateY:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_UP:{id:"SLIDE_OUT_UP",category:ie.SLIDE,direction:se.OUT,keyframes:{translateY:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_LEFT:{id:"SLIDE_OUT_LEFT",category:ie.SLIDE,direction:se.OUT,keyframes:{translateX:{from:0,to:"-100%"}},gsapEasing:"power2.out",defaultDuration:.5},SLIDE_OUT_RIGHT:{id:"SLIDE_OUT_RIGHT",category:ie.SLIDE,direction:se.OUT,keyframes:{translateX:{from:0,to:"100%"}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN:{id:"ZOOM_IN",category:ie.ZOOM,direction:se.IN,keyframes:{opacity:{from:0,to:1,midPoint:.5},scale:{from:.3,to:1}},gsapEasing:"power2.out",defaultDuration:.5},ZOOM_IN_DOWN:{id:"ZOOM_IN_DOWN",category:ie.ZOOM,direction:se.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:-1e3,mid:60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_UP:{id:"ZOOM_IN_UP",category:ie.ZOOM,direction:se.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateY:{from:1e3,mid:-60,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_LEFT:{id:"ZOOM_IN_LEFT",category:ie.ZOOM,direction:se.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:-1e3,mid:10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_IN_RIGHT:{id:"ZOOM_IN_RIGHT",category:ie.ZOOM,direction:se.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.1,mid:.475,to:1},translateX:{from:1e3,mid:-10,to:0}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.out",defaultDuration:.5,midPoint:.6},ZOOM_OUT:{id:"ZOOM_OUT",category:ie.ZOOM,direction:se.OUT,keyframes:{opacity:{from:1,to:0,midPoint:.5},scale:{from:1,to:.3}},gsapEasing:"power2.in",defaultDuration:.5},ZOOM_OUT_DOWN:{id:"ZOOM_OUT_DOWN",category:ie.ZOOM,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:-60,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_UP:{id:"ZOOM_OUT_UP",category:ie.ZOOM,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateY:{from:0,mid:60,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_LEFT:{id:"ZOOM_OUT_LEFT",category:ie.ZOOM,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:42,to:-1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},ZOOM_OUT_RIGHT:{id:"ZOOM_OUT_RIGHT",category:ie.ZOOM,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,mid:.475,to:.1},translateX:{from:0,mid:-42,to:1e3}},gsapEasingIn:"power2.in",gsapEasingOut:"power2.out",gsapEasing:"power2.in",defaultDuration:.5,midPoint:.4},BACK_IN_DOWN:{id:"BACK_IN_DOWN",category:ie.BACK,direction:se.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_UP:{id:"BACK_IN_UP",category:ie.BACK,direction:se.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateY:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_LEFT:{id:"BACK_IN_LEFT",category:ie.BACK,direction:se.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_IN_RIGHT:{id:"BACK_IN_RIGHT",category:ie.BACK,direction:se.IN,keyframes:{opacity:{from:.7,to:1},scale:{from:.7,to:1},translateX:{from:Pe,to:0}},gsapEasing:"back.out(1.7)",defaultDuration:.5},BACK_OUT_DOWN:{id:"BACK_OUT_DOWN",category:ie.BACK,direction:se.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_UP:{id:"BACK_OUT_UP",category:ie.BACK,direction:se.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateY:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_LEFT:{id:"BACK_OUT_LEFT",category:ie.BACK,direction:se.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:-Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BACK_OUT_RIGHT:{id:"BACK_OUT_RIGHT",category:ie.BACK,direction:se.OUT,keyframes:{opacity:{from:1,to:.7},scale:{from:1,to:.7},translateX:{from:0,to:Pe}},gsapEasing:"back.in(1.7)",defaultDuration:.5},BOUNCE_IN:{id:"BOUNCE_IN",category:ie.BOUNCE,direction:se.IN,keyframes:{opacity:{from:0,to:1},scale:{from:.3,to:1}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_DOWN:{id:"BOUNCE_IN_DOWN",category:ie.BOUNCE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_UP:{id:"BOUNCE_IN_UP",category:ie.BOUNCE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_LEFT:{id:"BOUNCE_IN_LEFT",category:ie.BOUNCE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_IN_RIGHT:{id:"BOUNCE_IN_RIGHT",category:ie.BOUNCE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"bounce.out",defaultDuration:.75},BOUNCE_OUT:{id:"BOUNCE_OUT",category:ie.BOUNCE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scale:{from:1,to:.3}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_DOWN:{id:"BOUNCE_OUT_DOWN",category:ie.BOUNCE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_UP:{id:"BOUNCE_OUT_UP",category:ie.BOUNCE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateY:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_LEFT:{id:"BOUNCE_OUT_LEFT",category:ie.BOUNCE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:-Pe}},gsapEasing:"bounce.in",defaultDuration:.75},BOUNCE_OUT_RIGHT:{id:"BOUNCE_OUT_RIGHT",category:ie.BOUNCE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:Pe}},gsapEasing:"bounce.in",defaultDuration:.75},FLIP:{id:"FLIP",category:ie.FLIP,direction:se.ATTENTION,keyframes:{rotation:{from:-360,mid1:-190,mid2:-170,to:0},scale:{from:1,mid:.95,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_X:{id:"FLIP_IN_X",category:ie.FLIP,direction:se.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleY:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_IN_Y:{id:"FLIP_IN_Y",category:ie.FLIP,direction:se.IN,keyframes:{opacity:{from:0,to:1,atPercent:40},scaleX:{from:0,mid1:1.1,mid2:.95,mid3:1.02,to:1}},gsapEasing:"power1.inOut",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_X:{id:"FLIP_OUT_X",category:ie.FLIP,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scaleY:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},FLIP_OUT_Y:{id:"FLIP_OUT_Y",category:ie.FLIP,direction:se.OUT,keyframes:{opacity:{from:1,to:0},scaleX:{from:1,mid:1.05,to:0}},gsapEasing:"power1.in",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_LEFT:{id:"LIGHT_SPEED_IN_LEFT",category:ie.LIGHT_SPEED,direction:se.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"-100%",to:0,atPercent:60},skewX:{from:30,mid1:-20,mid2:5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_IN_RIGHT:{id:"LIGHT_SPEED_IN_RIGHT",category:ie.LIGHT_SPEED,direction:se.IN,keyframes:{opacity:{from:0,to:1,atPercent:60},translateX:{from:"100%",to:0,atPercent:60},skewX:{from:-30,mid1:20,mid2:-5,to:0}},gsapEasing:"power2.out",defaultDuration:.5,multiKeyframe:!0},LIGHT_SPEED_OUT_LEFT:{id:"LIGHT_SPEED_OUT_LEFT",category:ie.LIGHT_SPEED,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"-100%"},skewX:{from:0,to:-30}},gsapEasing:"power2.in",defaultDuration:.5},LIGHT_SPEED_OUT_RIGHT:{id:"LIGHT_SPEED_OUT_RIGHT",category:ie.LIGHT_SPEED,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},skewX:{from:0,to:30}},gsapEasing:"power2.in",defaultDuration:.5},ROTATE_IN:{id:"ROTATE_IN",category:ie.ROTATE,direction:se.IN,keyframes:{opacity:{from:0,to:1},rotation:{from:-200,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROTATE_OUT:{id:"ROTATE_OUT",category:ie.ROTATE,direction:se.OUT,keyframes:{opacity:{from:1,to:0},rotation:{from:0,to:200}},gsapEasing:"power1.in",defaultDuration:.5},ROLL_IN:{id:"ROLL_IN",category:ie.ROLL,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:"-100%",to:0},rotation:{from:-120,to:0}},gsapEasing:"power1.out",defaultDuration:.5},ROLL_OUT:{id:"ROLL_OUT",category:ie.ROLL,direction:se.OUT,keyframes:{opacity:{from:1,to:0},translateX:{from:0,to:"100%"},rotation:{from:0,to:120}},gsapEasing:"power1.in",defaultDuration:.5},SHAKE:{id:"SHAKE",category:ie.SHAKE,direction:se.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_X:{id:"SHAKE_X",category:ie.SHAKE,direction:se.ATTENTION,keyframes:{shakeX:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},SHAKE_Y:{id:"SHAKE_Y",category:ie.SHAKE,direction:se.ATTENTION,keyframes:{shakeY:{amplitude:15}},gsapEasing:"power1.inOut",defaultDuration:.5},HEART_BEAT:{id:"HEART_BEAT",category:ie.SPECIAL,direction:se.ATTENTION,keyframes:{pulseScale:{min:1,max:1.3}},gsapEasing:"power1.inOut",defaultDuration:.5},PULSE:{id:"PULSE",category:ie.SPECIAL,direction:se.ATTENTION,keyframes:{pulseScale:{min:1,max:1.05}},gsapEasing:"power1.inOut",defaultDuration:.5},WIPE_LEFT:{id:"WIPE_LEFT",category:ie.WIPE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_RIGHT:{id:"WIPE_RIGHT",category:ie.WIPE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateX:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_UP:{id:"WIPE_UP",category:ie.WIPE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},WIPE_DOWN:{id:"WIPE_DOWN",category:ie.WIPE,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:-Pe,to:0}},gsapEasing:"power2.inOut",defaultDuration:1},RISE:{id:"RISE",category:ie.SPECIAL,direction:se.IN,keyframes:{opacity:{from:0,to:1},translateY:{from:30,to:0},scale:{from:.95,to:1}},gsapEasing:"power2.out",defaultDuration:.5},TYPEWRITER:{id:"TYPEWRITER",category:ie.SPECIAL,direction:se.IN,keyframes:{typewriter:{text:"",duration:2,charactersPerSecond:20}},gsapEasing:"none",defaultDuration:2}};S.registerEffect({name:"FADE_IN",effect(t,e){try{const n=Se.FADE_IN;if(!n)return console.error("[FADE_IN] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return S.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_IN_DOWN",effect(t,e){try{const n=Se.FADE_IN_DOWN;if(!n)return console.error("[FADE_IN_DOWN] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return S.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_DOWN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_IN_UP",effect(t,e){try{const n=Se.FADE_IN_UP;if(!n)return console.error("[FADE_IN_UP] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return S.fromTo(t,{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_UP] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_IN_LEFT",effect(t,e){try{const n=Se.FADE_IN_LEFT;if(!n)return console.error("[FADE_IN_LEFT] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return S.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_IN_RIGHT",effect(t,e){try{const n=Se.FADE_IN_RIGHT;if(!n)return console.error("[FADE_IN_RIGHT] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.from||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return S.fromTo(t,{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d}},{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_IN_RIGHT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_OUT",effect(t,e){try{const n=Se.FADE_OUT;if(!n)return console.error("[FADE_OUT] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0;return S.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:f},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_OUT_DOWN",effect(t,e){try{const n=Se.FADE_OUT_DOWN;if(!n)return console.error("[FADE_OUT_DOWN] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l+s;return S.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_DOWN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_OUT_UP",effect(t,e){try{const n=Se.FADE_OUT_UP;if(!n)return console.error("[FADE_OUT_UP] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateY?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=l-s;return S.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:a,y:h,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_UP] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_OUT_LEFT",effect(t,e){try{const n=Se.FADE_OUT_LEFT;if(!n)return console.error("[FADE_OUT_LEFT] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a-s;return S.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"FADE_OUT_RIGHT",effect(t,e){try{const n=Se.FADE_OUT_RIGHT;if(!n)return console.error("[FADE_OUT_RIGHT] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=Math.abs(n.keyframes?.translateX?.to||2e3),a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=a+s;return S.fromTo(t,{pixi:{x:a,y:l,scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{x:h,y:l,scaleX:c,scaleY:u,alpha:0,rotation:d},duration:r,ease:n.gsapEasing,immediateRender:i,overwrite:o})}catch(n){return console.error("[FADE_OUT_RIGHT] Animation error:",n),S.timeline()}}});function ec(t){const e=Array.isArray(t)?t[0]:t;return e&&typeof e.addChild=="function"?e:null}const Ym=200;function cA(t){try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return Ym}function lA(t){try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return Ym}function En(t,e,n,r){S.registerEffect({name:t,effect(i,o){try{const s=Se[t];if(!s)return console.error(`[${t}] Animation config not found`),S.timeline();const{duration:a=s?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=o,u=o.x??0,f=o.y??0,d=o.scaleX??1,h=o.scaleY??1,m=o.alpha??1,p=o.rotation??0,g=ec(i)??i,y=e==="x"?cA(g):lA(g),_=e==="x"?u+r*y:u,v=e==="y"?f+r*y:f,x=n==="in"?{x:_,y:v,alpha:0}:{x:u,y:f,alpha:m},E=n==="in"?{x:u,y:f,alpha:m}:{x:_,y:v,alpha:0};return S.fromTo(i,{pixi:{x:x.x,y:x.y,scaleX:d,scaleY:h,alpha:x.alpha,rotation:p}},{pixi:{x:E.x,y:E.y,scaleX:d,scaleY:h,alpha:E.alpha,rotation:p},duration:a,ease:o.ease||s?.gsapEasing||"power2.out",immediateRender:l,overwrite:c})}catch(s){return console.error(`[${t}] Animation error:`,s),S.timeline()}}})}En("SLIDE_IN_DOWN","y","in",-1),En("SLIDE_IN_UP","y","in",1),En("SLIDE_IN_LEFT","x","in",-1),En("SLIDE_IN_RIGHT","x","in",1),En("SLIDE_OUT_DOWN","y","out",1),En("SLIDE_OUT_UP","y","out",-1),En("SLIDE_OUT_LEFT","x","out",-1),En("SLIDE_OUT_RIGHT","x","out",1),S.registerEffect({name:"ZOOM_IN",effect(t,e){try{const n=Se.ZOOM_IN;if(!n)return console.error("[ZOOM_IN] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.from||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return S.fromTo(t,{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l}},{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l},duration:i,ease:e.ease||"power2.out",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_IN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_IN_DOWN",effect(t,e){try{const n=Se.ZOOM_IN_DOWN;if(!n)return console.error("[ZOOM_IN_DOWN] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||-1e3,s=n?.keyframes?.translateY?.mid||60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=f+o,g=f+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:p}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:m,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_DOWN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_IN_UP",effect(t,e){try{const n=Se.ZOOM_IN_UP;if(!n)return console.error("[ZOOM_IN_UP] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateY?.from||1e3,s=n?.keyframes?.translateY?.mid||-60,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=f+o,g=f+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:u,y:p}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:m,x:u,y:g},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_UP] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_IN_LEFT",effect(t,e){try{const n=Se.ZOOM_IN_LEFT;if(!n)return console.error("[ZOOM_IN_LEFT] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||-1e3,s=n?.keyframes?.translateX?.mid||10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=u+o,g=u+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:p,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:m,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_IN_RIGHT",effect(t,e){try{const n=Se.ZOOM_IN_RIGHT;if(!n)return console.error("[ZOOM_IN_RIGHT] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.from||.1,i=n?.keyframes?.scale?.mid||.475,o=n?.keyframes?.translateX?.from||1e3,s=n?.keyframes?.translateX?.mid||-10,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=u+o,g=u+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:r*d,scaleY:r*h,alpha:0,x:p,y:f}},{pixi:{scaleX:i*d,scaleY:i*h,alpha:m,x:g,y:f},duration:a*.6,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:d,scaleY:h,x:u,y:f},duration:a*.4,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_IN_RIGHT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_OUT",effect(t,e){try{const n=Se.ZOOM_OUT;if(!n)return console.error("[ZOOM_OUT] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.to||.3,{duration:i=n?.defaultDuration||.5,immediateRender:o=!0,overwrite:s}=e,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1;return S.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,x:a,y:l}},{pixi:{scaleX:r*c,scaleY:r*u,alpha:0,x:a,y:l},duration:i,ease:e.ease||"power2.in",immediateRender:o,overwrite:s})}catch(n){return console.error("[ZOOM_OUT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_OUT_DOWN",effect(t,e){try{const n=Se.ZOOM_OUT_DOWN;if(!n)return console.error("[ZOOM_OUT_DOWN] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||-60,s=n?.keyframes?.translateY?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=f+o,g=f+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:m,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:p},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_DOWN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_OUT_UP",effect(t,e){try{const n=Se.ZOOM_OUT_UP;if(!n)return console.error("[ZOOM_OUT_UP] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateY?.mid||60,s=n?.keyframes?.translateY?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=f+o,g=f+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:m,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:u,y:p},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:u,y:g},duration:a*.6,ease:"power2.out"}),y}catch(n){return console.error("[ZOOM_OUT_UP] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_OUT_LEFT",effect(t,e){try{const n=Se.ZOOM_OUT_LEFT;if(!n)return console.error("[ZOOM_OUT_LEFT] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||42,s=n?.keyframes?.translateX?.to||-1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=u+o,g=u+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:m,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:p,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ZOOM_OUT_RIGHT",effect(t,e){try{const n=Se.ZOOM_OUT_RIGHT;if(!n)return console.error("[ZOOM_OUT_RIGHT] Animation config not found"),S.timeline();const r=n?.keyframes?.scale?.mid||.475,i=n?.keyframes?.scale?.to||.1,o=n?.keyframes?.translateX?.mid||-42,s=n?.keyframes?.translateX?.to||1e3,{duration:a=n?.defaultDuration||.5,immediateRender:l=!0,overwrite:c}=e,u=e.x??0,f=e.y??0,d=e.scaleX??1,h=e.scaleY??1,m=e.alpha??1,p=u+o,g=u+s,y=S.timeline();return y.fromTo(t,{pixi:{scaleX:d,scaleY:h,alpha:m,x:u,y:f}},{pixi:{scaleX:r*d,scaleY:r*h,x:p,y:f},duration:a*.4,ease:"power2.in",immediateRender:l,overwrite:c}),y.to(t,{pixi:{scaleX:i*d,scaleY:i*h,alpha:0,x:g,y:f},duration:a*.6,ease:"power2.in"}),y}catch(n){return console.error("[ZOOM_OUT_RIGHT] Animation error:",n),S.timeline()}}});const yr=.7,tc=.7,Wm={BACK_IN_DOWN:{axis:"y",delta:-1200},BACK_IN_UP:{axis:"y",delta:1200},BACK_IN_LEFT:{axis:"x",delta:-2e3},BACK_IN_RIGHT:{axis:"x",delta:2e3}},Xm={BACK_OUT_DOWN:{axis:"y",delta:700},BACK_OUT_UP:{axis:"y",delta:-700},BACK_OUT_LEFT:{axis:"x",delta:-2e3},BACK_OUT_RIGHT:{axis:"x",delta:2e3}};function uA(t){const{axis:e,delta:n}=Wm[t];S.registerEffect({name:t,effect(r,i){try{const o=Se[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,m=i.rotation??0,p=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.8,_=s*.2,v=S.timeline();return v.fromTo(r,{pixi:{x:p,y:g,scaleX:f*yr,scaleY:d*yr,alpha:tc,rotation:m}},{pixi:{x:c,y:u,scaleX:f*yr,scaleY:d*yr,alpha:tc,rotation:m},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),v.to(r,{pixi:{scaleX:f,scaleY:d,alpha:h},duration:_,ease:"power1.out",immediateRender:!1},y),v}catch(o){return console.error(`[${t}] Animation error:`,o),S.timeline()}}})}function dA(t){const{axis:e,delta:n}=Xm[t];S.registerEffect({name:t,effect(r,i){try{const o=Se[t],s=i.duration||o?.defaultDuration||.5,{immediateRender:a=!0,overwrite:l}=i,c=i.x??0,u=i.y??0,f=i.scaleX??1,d=i.scaleY??1,h=i.alpha??1,m=i.rotation??0,p=e==="x"?c+n:c,g=e==="y"?u+n:u,y=s*.2,_=s*.8,v=S.timeline();return v.fromTo(r,{pixi:{x:c,y:u,scaleX:f,scaleY:d,alpha:h,rotation:m}},{pixi:{x:c,y:u,scaleX:f*yr,scaleY:d*yr,alpha:tc,rotation:m},duration:y,ease:"power1.out",immediateRender:a,overwrite:l},0),v.to(r,{pixi:{x:p,y:g},duration:_,ease:"power1.in",immediateRender:!1},y),v}catch(o){return console.error(`[${t}] Animation error:`,o),S.timeline()}}})}Object.keys(Wm).forEach(uA),Object.keys(Xm).forEach(dA);function fA(t){const e=Se[t];if(!e){console.error(`[effectGenerator] Animation config not found: ${t}`);return}const{keyframes:n,gsapEasing:r,defaultDuration:i}=e;S.registerEffect({name:t,effect(o,s){try{const a=s.x??0,l=s.y??0,c=s.scaleX??1,u=s.scaleY??1,f=s.alpha??1,d=s.rotation??0,h={pixi:{}},m={pixi:{}};return h.pixi.x=a,h.pixi.y=l,m.pixi.x=a,m.pixi.y=l,n.opacity!==void 0?(h.pixi.alpha=n.opacity.from!==void 0?n.opacity.from:f,m.pixi.alpha=n.opacity.to!==void 0?n.opacity.to:f):(h.pixi.alpha=f,m.pixi.alpha=f),n.scale!==void 0&&(h.pixi.scale=n.scale.from,m.pixi.scale=n.scale.to),n.scaleX!==void 0?(h.pixi.scaleX=(n.scaleX.from??1)*c,m.pixi.scaleX=(n.scaleX.to??1)*c):n.scale||(h.pixi.scaleX=c,m.pixi.scaleX=c),n.scaleY!==void 0?(h.pixi.scaleY=(n.scaleY.from??1)*u,m.pixi.scaleY=(n.scaleY.to??1)*u):n.scale||(h.pixi.scaleY=u,m.pixi.scaleY=u),n.rotation!==void 0?(h.pixi.rotation=n.rotation.from??d,m.pixi.rotation=n.rotation.to??d):(h.pixi.rotation=d,m.pixi.rotation=d),n.skewX!==void 0&&(h.pixi.skewX=n.skewX.from??0,m.pixi.skewX=n.skewX.to??0),n.skewY!==void 0&&(h.pixi.skewY=n.skewY.from??0,m.pixi.skewY=n.skewY.to??0),n.translateX!==void 0&&(h.pixi.x=a+(n.translateX.from??0),m.pixi.x=a+(n.translateX.to??0)),n.translateY!==void 0&&(h.pixi.y=l+(n.translateY.from??0),m.pixi.y=l+(n.translateY.to??0)),S.fromTo(o,h,{...m,duration:s.duration||i,ease:s.ease||r,immediateRender:s.immediateRender??!0,overwrite:s.overwrite??"auto"})}catch(a){return console.error(`[${t}] Animation error:`,a),S.timeline()}}})}function nc(t){t.forEach(e=>{try{fA(e)}catch(n){console.error(`[effectGenerator] Failed to register effect: ${e}`,n)}})}nc(["BOUNCE_IN","BOUNCE_IN_DOWN","BOUNCE_IN_UP","BOUNCE_IN_LEFT","BOUNCE_IN_RIGHT","BOUNCE_OUT","BOUNCE_OUT_DOWN","BOUNCE_OUT_UP","BOUNCE_OUT_LEFT","BOUNCE_OUT_RIGHT"]),S.registerEffect({name:"FLIP",effect(t,e){const n=Se.FLIP,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=S.timeline();return u.fromTo(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-360}},{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-190},duration:r*.4,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,scaleX:s,scaleY:a,rotation:c-170},duration:r*.1,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s*.95,scaleY:a*.95},duration:r*.3,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,alpha:l,rotation:c,scaleX:s,scaleY:a},duration:r*.2,ease:"power1.in"}),u}}),S.registerEffect({name:"FLIP_IN_X",effect(t,e){const n=Se.FLIP_IN_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=S.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a},duration:r*.2,ease:"power1.out"}),u}}),S.registerEffect({name:"FLIP_IN_Y",effect(t,e){const n=Se.FLIP_IN_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=S.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.1},duration:r*.4,ease:"power1.in"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*.95},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.02},duration:r*.2,ease:"power1.inOut"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s},duration:r*.2,ease:"power1.out"}),u}}),S.registerEffect({name:"FLIP_OUT_X",effect(t,e){const n=Se.FLIP_OUT_X,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=S.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a}},{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:l,scaleY:a*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleX:s,alpha:0,scaleY:0},duration:r*.7,ease:"power1.in"}),u}}),S.registerEffect({name:"FLIP_OUT_Y",effect(t,e){const n=Se.FLIP_OUT_Y,r=e.duration||n.defaultDuration,i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=S.timeline();return u.fromTo(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s}},{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:l,scaleX:s*1.05},duration:r*.3,ease:"power1.out"}),u.to(t,{pixi:{x:i,y:o,rotation:c,scaleY:a,alpha:0,scaleX:0},duration:r*.7,ease:"power1.in"}),u}}),S.registerEffect({name:"LIGHT_SPEED_IN_LEFT",effect(t,e){try{const n=Se.LIGHT_SPEED_IN_LEFT;if(!n)return console.error("[LIGHT_SPEED_IN_LEFT] Animation config not found"),S.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=S.timeline();return d.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"LIGHT_SPEED_IN_RIGHT",effect(t,e){try{const n=Se.LIGHT_SPEED_IN_RIGHT;if(!n)return console.error("[LIGHT_SPEED_IN_RIGHT] Animation config not found"),S.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=S.timeline();return d.fromTo(t,{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:20},duration:r*.6,ease:"power2.out"},0),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:-5},duration:r*.2,ease:"power2.out"}),d.to(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f},duration:r*.2,ease:"power2.out"}),d}catch(n){return console.error("[LIGHT_SPEED_IN_RIGHT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"LIGHT_SPEED_OUT_LEFT",effect(t,e){try{const n=Se.LIGHT_SPEED_OUT_LEFT;if(!n)return console.error("[LIGHT_SPEED_OUT_LEFT] Animation config not found"),S.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=S.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:-30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"LIGHT_SPEED_OUT_RIGHT",effect(t,e){try{const n=Se.LIGHT_SPEED_OUT_RIGHT;if(!n)return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation config not found"),S.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||1080,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=e.skewX??0,d=S.timeline();return d.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u,skewX:f}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u,skewX:30},duration:r,ease:"power2.in"},0),d}catch(n){return console.error("[LIGHT_SPEED_OUT_RIGHT] Animation error:",n),S.timeline()}}});const zm=2e3;S.registerEffect({name:"ROLL_IN",effect(t,e){try{const n=Se.ROLL_IN;if(!n)return console.error("[ROLL_IN] Animation config not found"),S.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||zm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=S.timeline();return f.fromTo(t,{pixi:{x:o-i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u-120}},{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u},duration:r,ease:"power1.out"}),f}catch(n){return console.error("[ROLL_IN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROLL_OUT",effect(t,e){try{const n=Se.ROLL_OUT;if(!n)return console.error("[ROLL_OUT] Animation config not found"),S.timeline();const r=e.duration||n.defaultDuration,i=e.canvasWidth||zm,o=e.x??0,s=e.y??0,a=e.scaleX??1,l=e.scaleY??1,c=e.alpha??1,u=e.rotation??0,f=S.timeline();return f.fromTo(t,{pixi:{x:o,y:s,scaleX:a,scaleY:l,alpha:c,rotation:u}},{pixi:{x:o+i,y:s,scaleX:a,scaleY:l,alpha:0,rotation:u+120},duration:r,ease:"power1.in"}),f}catch(n){return console.error("[ROLL_OUT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_IN",effect(t,e){try{const n=Se.ROTATE_IN;if(!n)return console.error("[ROTATE_IN] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return S.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u-200}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u},duration:r,ease:"power1.out",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_IN] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_OUT",effect(t,e){try{const n=Se.ROTATE_OUT;if(!n)return console.error("[ROTATE_OUT] Animation config not found"),S.timeline();const{duration:r=n.defaultDuration,immediateRender:i=!0,overwrite:o}=e,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.rotation??0,f=e.alpha??1;return S.fromTo(t,{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:f,rotation:u}},{pixi:{x:s,y:a,scaleX:l,scaleY:c,alpha:0,rotation:u+200},duration:r,ease:"power1.in",immediateRender:i,overwrite:o})}catch(n){return console.error("[ROTATE_OUT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_IN_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,m=S.timeline();return m.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),m.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),m}catch(n){return console.error("[ROTATE_IN_DOWN_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_IN_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,m=t.pivot?.y||0,p=S.timeline();return p.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),p.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+45}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:h,pivotY:m,x:a,y:l}}),p}catch(n){return console.error("[ROTATE_IN_DOWN_RIGHT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_IN_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,m=S.timeline();return m.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),m.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45}},{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{pivotX:d,pivotY:h,x:s,y:a}}),m}catch(n){return console.error("[ROTATE_IN_UP_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_IN_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,m=t.pivot?.y||0,p=S.timeline();return p.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),p.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-90}},{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d},duration:n,ease:"power1.out",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{pivotX:h,pivotY:m,x:a,y:l}}),p}catch(n){return console.error("[ROTATE_IN_UP_RIGHT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_OUT_DOWN_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,m=S.timeline();return m.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),m.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f+45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),m}catch(n){return console.error("[ROTATE_OUT_DOWN_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_OUT_DOWN_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,m=t.pivot?.y||0,p=S.timeline();return p.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),p.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:d,pivotX:h,pivotY:m,x:a,y:l}}),p}catch(n){return console.error("[ROTATE_OUT_DOWN_RIGHT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_OUT_UP_LEFT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.height||100,s=e.x??0,a=e.y??0,l=e.scaleX??1,c=e.scaleY??1,u=e.alpha??1,f=e.rotation??0,d=t.pivot?.x||0,h=t.pivot?.y||0,m=S.timeline();return m.set(t,{pixi:{pivotX:0,pivotY:o,x:s,y:a+o}},0),m.fromTo(t,{pixi:{scaleX:l,scaleY:c,alpha:u,rotation:f}},{pixi:{scaleX:l,scaleY:c,alpha:0,rotation:f-45},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),m.set(t,{pixi:{rotation:f,pivotX:d,pivotY:h,x:s,y:a}}),m}catch(n){return console.error("[ROTATE_OUT_UP_LEFT] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"ROTATE_OUT_UP_RIGHT",effect(t,e){try{const{duration:n=.5,immediateRender:r=!0,overwrite:i}=e,o=t.width||100,s=t.height||100,a=e.x??0,l=e.y??0,c=e.scaleX??1,u=e.scaleY??1,f=e.alpha??1,d=e.rotation??0,h=t.pivot?.x||0,m=t.pivot?.y||0,p=S.timeline();return p.set(t,{pixi:{pivotX:o,pivotY:s,x:a+o,y:l+s}},0),p.fromTo(t,{pixi:{scaleX:c,scaleY:u,alpha:f,rotation:d}},{pixi:{scaleX:c,scaleY:u,alpha:0,rotation:d+90},duration:n,ease:"power1.in",immediateRender:r,overwrite:i},0),p.set(t,{pixi:{rotation:d,pivotX:h,pivotY:m,x:a,y:l}}),p}catch(n){return console.error("[ROTATE_OUT_UP_RIGHT] Animation error:",n),S.timeline()}}});const _r=Se.PULSE,qm=_r?.keyframes?.pulseScale?.min||1,Vm=_r?.keyframes?.pulseScale?.max||1.05;S.registerEffect({name:"PULSE",effect(t,e){try{const n=e.scaleX??1,r=e.scaleY??1;return S.timeline().fromTo(t,{pixi:{scaleX:n*qm,scaleY:r*qm}},{pixi:{scaleX:n*Vm,scaleY:r*Vm},duration:e.duration||_r?.defaultDuration||.5,repeat:e.repeat||2,yoyo:!0,ease:e.ease||_r?.gsapEasing||"power1.inOut",yoyoEase:e.yoyoEase||"power3"}).to(t,{pixi:{scaleX:n,scaleY:r},duration:e.resetDuration||.3,ease:e.resetEase||"power1.out"})}catch(n){return console.error("[PULSE] Animation error:",n),S.timeline()}},defaults:{duration:_r?.defaultDuration||.5,repeat:2,resetDuration:.3,ease:_r?.gsapEasing||"power1.inOut",resetEase:"power1.out"},extendTimeline:!0}),S.registerEffect({name:"SHAKE_X",effect(t,e){try{const n=Se.SHAKE_X;if(!n)return console.error("[SHAKE_X] Animation config not found"),S.timeline();const r=n?.keyframes?.shakeX?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.x??0,a=i/10,l=S.timeline();return l.fromTo(t,{pixi:{x:s}},{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s+r},duration:a,ease:o}).to(t,{pixi:{x:s-r},duration:a,ease:o}).to(t,{pixi:{x:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_X] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"SHAKE_Y",effect(t,e){try{const n=Se.SHAKE_Y;if(!n)return console.error("[SHAKE_Y] Animation config not found"),S.timeline();const r=n?.keyframes?.shakeY?.amplitude||15,i=e.duration||n.defaultDuration||.5,o=e.ease||n.gsapEasing||"power1.inOut",s=e.y??0,a=i/10,l=S.timeline();return l.fromTo(t,{pixi:{y:s}},{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s+r},duration:a,ease:o}).to(t,{pixi:{y:s-r},duration:a,ease:o}).to(t,{pixi:{y:s},duration:a,ease:o}),l}catch(n){return console.error("[SHAKE_Y] Animation error:",n),S.timeline()}}}),nc(["WIPE_LEFT","WIPE_RIGHT","WIPE_UP","WIPE_DOWN"]),nc(["RISE"]),S.registerEffect({name:"TYPEWRITER",effect(t,e){try{const{text:n="",onTextChange:r}=e;if(!n||!t)return S.timeline();const i=e.x??0,o=e.y??0,s=e.scaleX??1,a=e.scaleY??1,l=e.alpha??1,c=e.rotation??0,u=S.timeline();u.set(t,{pixi:{x:i,y:o,scaleX:s,scaleY:a,alpha:l,rotation:c}},0);const f=n.length;return u.to(t,{duration:e.duration||2,ease:"none",onStart(){t&&(t.text="",t.updateText&&t.updateText()),r&&r("","START")},onUpdate(){const d=this.progress(),h=Math.min(Math.round(d*f),f),m=n.substring(0,h);r&&r(m,"UPDATE"),t&&(t.text=m,t.updateText&&t.updateText())},onComplete(){r&&r(n,"COMPLETE"),t&&(t.text=n,t.updateText&&t.updateText())},onInterrupt(){r&&r("","INTERRUPT")},onReverseComplete(){r&&r("","REVERSE_COMPLETE")}},0),u}catch(n){return console.error("[TYPEWRITER] Animation error:",n),S.timeline()}},defaults:{duration:2,text:""},extendTimeline:!0});const mo="__logoRevealMask";function hA(t,e){const n=typeof e.width=="number"&&e.width>0?e.width:0,r=typeof e.height=="number"&&e.height>0?e.height:0;if(n&&r)return{w:n,h:r};try{const i=t.getLocalBounds();if(i.width>1&&i.height>1)return{w:i.width,h:i.height}}catch{}return{w:Math.max(1,t.width||240),h:Math.max(1,t.height||240)}}function pA(t){const e=t[mo];if(e&&!e.destroyed)return t.mask=e,e;const n=new K.Graphics;return t[mo]=n,t.addChild(n),t.mask=n,n}function mA(t){const e=t[mo];t.mask=null,e&&!e.destroyed&&(e.parent&&e.parent.removeChild(e),e.destroy()),t[mo]=void 0}const gA={draw:(t,e,n)=>{t.rect(0,-n/2,e,n).fill(16777215)},origin:(t,e,n)=>({x:t-n/2,y:e}),axes:"x"},yA={draw:(t,e,n)=>{t.circle(0,0,Math.hypot(e,n)*.55).fill(16777215)},origin:(t,e)=>({x:t,y:e}),axes:"both"},_A={draw:(t,e,n)=>{const r=Math.max(e,n)*.2,i=e+n+r*2,o=-n/2-r,s=n/2+r;t.moveTo(0,o).lineTo(i,o).lineTo(i-n,s).lineTo(-n,s).closePath().fill(16777215)},origin:(t,e,n,r)=>({x:t-n/2-Math.max(n,r)*.2,y:e}),axes:"x"};function rc(t,e,n,r){try{const i=ec(t);if(!i)throw new Error("LOGO_REVEAL target is not a PIXI.Container");const o=e.duration??.9,s=e.ease||r,a=e.x??0,l=e.y??0,c=e.alpha??1,{w:u,h:f}=hA(i,e);S.set(i,{pixi:{alpha:c,x:a,y:l,scaleX:e.scaleX??1,scaleY:e.scaleY??1}});const d=pA(i),{x:h,y:m}=n.origin(a,l,u,f);d.clear(),n.draw(d,u,f),d.position.set(h,m),d.pivot.set(0,0);const p=n.axes==="both";return S.fromTo(d.scale,{x:0,y:p?0:1},{x:1,y:1,duration:o,ease:s,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto",onReverseComplete:()=>{mA(i)}})}catch(i){return console.error("[LOGO_REVEAL] mask effect error:",i),S.timeline()}}S.registerEffect({name:"SCALE_POP",effect(t,e){try{const n=e.duration??.65,r=e.x??0,i=e.y??0,o=e.scaleX??1,s=e.scaleY??1,a=e.alpha??1,l=e.ease||"back.out(1.7)";return S.fromTo(t,{pixi:{scaleX:.28*o,scaleY:.28*s,alpha:0,x:r,y:i}},{pixi:{scaleX:o,scaleY:s,alpha:a,x:r,y:i},duration:n,ease:l,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(n){return console.error("[SCALE_POP] Animation error:",n),S.timeline()}}}),S.registerEffect({name:"WIPE_LEFT_RIGHT",effect(t,e){return rc(t,e,gA,"power2.inOut")}}),S.registerEffect({name:"WIPE_RADIAL",effect(t,e){return rc(t,e,yA,"power2.out")}}),S.registerEffect({name:"MASK_PAINT_ON",effect(t,e){return rc(t,e,_A,"power3.out")}});const Km="__staggerSplitText",go="__staggerBaseX",yo="__staggerBaseY";function ic(t){const e=[t];for(;e.length;){const n=e.shift();for(const r of n.children??[]){if(r instanceof K.Text)return r;r instanceof K.Container&&e.push(r)}}return null}const oc=t=>t==null?"-":typeof t=="number"?String(t):`${t.x},${t.y}`;function bA(t,e,n){const r=t.style;return[e,t.text,r.fontFamily,r.fontSize,r.fontWeight,r.letterSpacing,r.wordWrap?r.wordWrapWidth:"nowrap",oc(n.charAnchor),oc(n.wordAnchor),oc(n.lineAnchor)].join("|")}function vA(t,e,n){const r=ic(t);if(!r)return null;const i=t,o=i[Km],s=bA(r,e,n);if(o&&!o.split.destroyed&&o.signature===s)return o.split;o&&!o.split.destroyed&&(o.split.parent?.removeChild(o.split),o.split.destroy({children:!0}));const a=K.SplitText.from(r,n);return a.position.copyFrom(r.position),a.rotation=r.rotation,a.scale.copyFrom(r.scale),(r.parent??t).addChild(a),r.alpha=0,i[Km]={signature:s,split:a},a}function sc(t,e){const n=ec(t);return n||(console.error(`[${e}] target is not a PIXI.Container`),null)}function $m(t,e){S.set(t,{pixi:{alpha:e.alpha??1,x:e.x??0,y:e.y??0,scaleX:e.scaleX??1,scaleY:e.scaleY??1}})}function Zm(t,e,n={}){const r=vA(t,e,n),i=r?e==="letter"?r.chars:r.words:[];if(i.length===0)return null;for(const s of i){const a=s;typeof a[go]!="number"&&(a[go]=s.x),typeof a[yo]!="number"&&(a[yo]=s.y)}const o=s=>a=>a[s]??0;return{node:t,units:i,baseX:o(go),baseY:o(yo),fontSize:Number(ic(t)?.style?.fontSize)||48}}function Jm(t,e,n){const i=(typeof t.stagger=="number"&&t.stagger>=0?t.stagger:Math.min(.12,n/Math.max(e,1)/2))*Math.max(e-1,0);return{amount:i,unitDuration:Math.max(.12,n-i)}}function Qm(t,e,n="start"){return{amount:e,from:t.staggerFrom??n,...t.staggerEase?{ease:t.staggerEase}:{}}}const e0="__textUnitMask";function xA(t,e){const n=t.parent;if(!n)return null;const r=t,i=r[e0];if(i&&!i.mask.destroyed)if(i.signature!==e)i.mask.parent?.removeChild(i.mask),i.mask.destroy();else return i.mask.parent||n.addChild(i.mask),t.mask=i.mask,i.mask;let o=0,s=0,a=0,l=0;try{const h=t.getLocalBounds();h.width>0&&h.height>0&&(o=h.x,s=h.y,a=h.width,l=h.height)}catch{}if(!(a>0&&l>0))return null;const c=t0(r,go,t.x),u=t0(r,yo,t.y),f=Math.max(6,l*.12),d=new K.Graphics;return d.rect(c+o-f,u+s-f,a+f*2,l+f*2).fill(16777215),n.addChild(d),t.mask=d,r[e0]={signature:e,mask:d},d}function t0(t,e,n){const r=t[e];return typeof r=="number"?r:n}const TA={};function kt(t){TA[t.name]={from:t.from??"start",unit:t.unit??"word"},S.registerEffect({name:t.name,effect(e,n){const r=sc(e,t.name);if(!r)return S.timeline();try{const i=n.duration??.75,o=n.ease||t.ease,s=n.revealUnit==="letter"||n.revealUnit==="word"?n.revealUnit:t.unit??"word";$m(r,n);const a=Zm(r,s,t.anchors);if(!a)return ac(r,n,!1,o);const{units:l,baseX:c,baseY:u,fontSize:f}=a,d=new Map;if(t.masked){for(const g of l){let y=f;try{const _=g.getLocalBounds();_.height>0&&(y=_.height)}catch{}d.set(g,y)}for(const g of l)xA(g,t.name)}const h={baseX:c,baseY:u,unitH:g=>d.get(g)??f,fontSize:f},{amount:m,unitDuration:p}=Jm(n,l.length,i);return S.fromTo(l,t.from_(h),{...t.to(h),duration:p,ease:o,stagger:Qm(n,m,t.from??"start"),immediateRender:n.immediateRender??!0,overwrite:n.overwrite??"auto"})}catch(i){return console.error(`[${t.name}] Animation error:`,i),S.timeline()}}})}function ac(t,e,n,r){const i=e.duration??.75,o=e.ease||r,s=e.alpha??1,a=e.y??0,l=n?e.yOffset??24:0;return S.fromTo(t,{pixi:{alpha:0,y:a+l}},{pixi:{alpha:s,y:a},duration:i,ease:o,immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}function cc(t,e,n,r){const i=sc(t,"STAGGER_TEXT");if(!i)return S.timeline();try{const o=e.duration??.75,s=e.ease||r,a=e.revealUnit==="letter"?"letter":"word";$m(i,e);const l=Zm(i,a);if(!l)return ac(i,e,n,s);const{units:c,baseY:u,fontSize:f}=l,d=n?e.yOffset??Math.max(12,f*.35):0,{amount:h,unitDuration:m}=Jm(e,c.length,o);return S.fromTo(c,{alpha:0,y:(p,g)=>u(g)+d},{alpha:1,y:(p,g)=>u(g),duration:m,ease:s,stagger:Qm(e,h),immediateRender:e.immediateRender??!0,overwrite:e.overwrite??"auto"})}catch(o){return console.error("[STAGGER_TEXT] Animation error:",o),S.timeline()}}S.registerEffect({name:"STAGGER_FADE_UP_TEXT",effect(t,e){return cc(t,e,!0,"power2.out")}}),S.registerEffect({name:"STAGGER_FADE_TEXT",effect(t,e){return cc(t,e,!1,"power1.out")}});function n0(t,e,n,r){const i=sc(t,"STAGGER_FADE");return i?ic(i)?cc(t,e,n,r):ac(i,e,n,e.ease||r):S.timeline()}S.registerEffect({name:"STAGGER_FADE_UP",effect(t,e){return n0(t,e,!0,"power2.out")}}),S.registerEffect({name:"STAGGER_FADE",effect(t,e){return n0(t,e,!1,"power1.out")}});const ai=Math.PI/180;function EA(t,e){let n=Math.imul(t+1,374761393)+Math.imul(e+1,668265263);return n=Math.imul(n^n>>>13,1274126177),((n^n>>>16)>>>0)/4294967296}const ci=(t,e,n,r)=>n+EA(t,e)*(r-n);kt({name:"TEXT_CASCADE",ease:"back.out(1.4)",from:"start",unit:"word",from_:({baseY:t,fontSize:e})=>({alpha:0,rotation:-15*ai,y:(n,r)=>t(r)-e*1.2}),to:({baseY:t})=>({alpha:1,rotation:0,y:(e,n)=>t(n)})}),kt({name:"TEXT_SPOTLIGHT",ease:"power2.out",from:"center",unit:"word",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:.1,pixi:{scaleX:.8,scaleY:.8}}),to:()=>({alpha:1,pixi:{scaleX:1,scaleY:1}})}),kt({name:"TEXT_BLINDS",ease:"power2.out",from:"edges",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:()=>({alpha:0,pixi:{scaleX:0}}),to:()=>({alpha:1,pixi:{scaleX:1}})}),kt({name:"TEXT_POPCORN",ease:"back.out(2)",from:"random",unit:"letter",anchors:{charAnchor:.5,wordAnchor:.5},from_:({baseY:t,fontSize:e})=>({alpha:0,pixi:{scaleX:0,scaleY:0},rotation:n=>ci(n,1,-20,20)*ai,y:(n,r)=>t(r)+ci(n,2,.2,.8)*e}),to:({baseY:t})=>({alpha:1,pixi:{scaleX:1,scaleY:1},rotation:0,y:(e,n)=>t(n)})}),kt({name:"TEXT_RIPPLE",ease:"elastic.out(1, 0.6)",from:"start",unit:"letter",from_:({baseY:t,fontSize:e})=>({alpha:0,y:(n,r)=>t(r)+Math.sin(n*.8)*e*.9}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),kt({name:"TEXT_SHUFFLE",ease:"power3.out",from:"random",unit:"word",anchors:{wordAnchor:.5,charAnchor:.5},from_:({baseX:t,baseY:e,fontSize:n})=>({alpha:0,rotation:r=>ci(r,3,-15,15)*ai,x:(r,i)=>t(i)+ci(r,4,-1.6,1.6)*n,y:(r,i)=>e(i)+ci(r,5,-.9,.9)*n}),to:({baseX:t,baseY:e})=>({alpha:1,rotation:0,x:(n,r)=>t(r),y:(n,r)=>e(r)})}),kt({name:"TEXT_DOMINO",ease:"power3.out",from:"start",unit:"letter",anchors:{charAnchor:{x:0,y:1},wordAnchor:{x:0,y:1}},from_:()=>({alpha:0,rotation:-90*ai}),to:()=>({alpha:1,rotation:0})}),kt({name:"TEXT_PENDULUM",ease:"elastic.out(1, 0.5)",from:"start",unit:"letter",anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,rotation:90*ai}),to:()=>({alpha:1,rotation:0})}),kt({name:"TEXT_SLIDE_REVEAL",ease:"power3.out",from:"start",unit:"word",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)+e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),kt({name:"TEXT_SLOT",ease:"back.out(1.3)",from:"start",unit:"letter",masked:!0,from_:({baseY:t,unitH:e})=>({alpha:0,y:(n,r)=>t(r)-e(r)}),to:({baseY:t})=>({alpha:1,y:(e,n)=>t(n)})}),kt({name:"TEXT_CURTAIN",ease:"power2.inOut",from:"start",unit:"word",masked:!0,anchors:{charAnchor:{x:.5,y:0},wordAnchor:{x:.5,y:0}},from_:()=>({alpha:0,pixi:{scaleY:0}}),to:()=>({alpha:1,pixi:{scaleY:1}})}),S.registerPlugin(sr.PixiPlugin),sr.PixiPlugin.registerPIXI(K),S.registerEffect({name:"SWING",effect(t,e){return S.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),S.registerEffect({name:"JELLO",effect(t,e){return S.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),S.registerEffect({name:"WOOBLE",effect(t,e){return S.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),S.registerEffect({name:"NONE",effect(t){return S.timeline().to(t,{duration:0})}}),S.registerEffect({name:"FLASH",effect(t,e){return S.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),S.registerPlugin(sr.PixiPlugin),sr.PixiPlugin.registerPIXI(K),S.registerPlugin(Dn),S.registerPlugin(Hm);const Ke=t=>{S.effects[t.name]||S.registerEffect(t)};Dn.create("springBounce","0.32, 1.06, 0.61, 0.93"),Dn.create("springStiff","M0,0 C0.18,0 0.28,1.2 0.5,1 C0.66,0.88 0.78,1.05 1,1"),Ke({name:"PULSE",effect(t,e){return S.timeline().fromTo(t,{pixi:{scaleX:.9,scaleY:.9}},{pixi:{scaleX:1.2,scaleY:1.2},duration:.5,ease:"slow"}).to(t,{pixi:{scaleX:1,scaleY:1,...e},duration:.5})}}),Ke({name:"SHAKE",effect(t,e){return S.timeline().to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=10"}}).to(t,{duration:.1,pixi:{x:"-=10"}}).to(t,{duration:.1,pixi:{x:"+=5"}}).to(t,{pixi:{...e},duration:.5})}}),Ke({name:"SWING",effect(t,e){return S.timeline().to(t,{duration:.5,pixi:{rotation:1}}).to(t,{duration:.5,pixi:{rotation:-1.5}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Ke({name:"JELLO",effect(t,e){return S.timeline().to(t,{duration:.3,pixi:{scaleX:.5,rotation:-1}}).to(t,{duration:.4,pixi:{scaleX:1.5,rotation:1}}).to(t,{duration:.3,pixi:{scaleX:1,rotation:0}}).to(t,{pixi:{rotation:0,...e},duration:.5})}}),Ke({name:"WOOBLE",effect(t,e){return S.timeline().to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.5}}).to(t,{duration:.3,pixi:{scaleX:1.5,x:e.x*1.5}}).to(t,{duration:.3,pixi:{scaleX:.5,x:e.x*-.01}}).to(t,{duration:.3,pixi:{scaleX:1,x:e.x}}).to(t,{rotation:0,pixi:{...e,rotation:0},duration:.5})}}),Ke({name:"NONE",effect(t,e){return S.timeline().to(t,{duration:0})}}),Ke({name:"FLASH",effect(t,e){return S.timeline().to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1}).to(t,{duration:.2,alpha:0}).to(t,{duration:.2,alpha:1,...e})}}),Ke({name:"BOUNCE_IN",effect(t,e){return S.timeline().fromTo(t,{pixi:{scaleX:1.5,scaleY:1.5}},{...e,pixi:{x:e?.x,y:e?.y,scaleX:1,scaleY:1},duration:2,ease:"bounce.out"})}}),Ke({name:"BOUNCE_IN_DOWN",effect(t,e){return S.timeline().from(t,{duration:2,ease:"bounce.out",immediateRender:!0,pixi:{...e,x:e?.x,y:-2500,alpha:0}})}}),Ke({name:"BOUNCE_IN_LEFT",effect(t,e){return S.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:-1500,alpha:0}})}}),Ke({name:"BOUNCE_IN_RIGHT",effect(t,e){const n=Math.max(1e3,e?.maxX+500);return S.timeline().from(t,{ease:"bounce.out",duration:2,pixi:{...e,x:n}})}}),Ke({name:"BOUNCE_IN_UP",effect(t,e){return S.timeline().from(t,{ease:"bounce.out",pixi:{...e,y:2e3},duration:2})}}),Ke({name:"BOUNCE_OUT",effect(t,e){return S.timeline().from(t,{...e,ease:"bounce.in",pixi:{y:2e3},duration:1.5})}}),Ke({name:"FADE_IN",effect(t){return S.timeline().fromTo(t,{alpha:0},{ease:"power4.in",alpha:1,duration:1})}}),Ke({name:"FADE_IN_DOWN",effect(t,e){return S.timeline().fromTo(t,{pixi:{y:-1500,alpha:0}},{duration:1,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Ke({name:"FADE_IN_LEFT",effect(t,e){return S.timeline().fromTo(t,{pixi:{alpha:0,x:-2e3}},{ease:"power4.in",pixi:{x:0,alpha:1,...e},duration:1})}}),Ke({name:"FADE_IN_RIGHT",effect(t,e){return S.fromTo(t,{pixi:{x:2e3,alpha:0}},{duration:1,ease:"power4.in",pixi:{x:0,alpha:1,...e}})}}),Ke({name:"FADE_IN_UP",effect(t,e){return S.fromTo(t,{pixi:{y:2e3,alpha:0}},{duration:.8,ease:"power4.in",pixi:{y:0,alpha:1,...e}})}}),Ke({name:"MOTION_PATH_SPRING",effect(t,e){const{path:n,duration:r=2,autoRotate:i=!1,alignOrigin:o=[.5,.5],ease:s="springStiff",repeat:a=0,yoyo:l=!1,start:c=0,end:u=1}=e||{};return S.to(t,{duration:r,ease:s,repeat:a,yoyo:l,motionPath:{path:n,autoRotate:i,alignOrigin:o,start:c,end:u}})}}),Ke({name:"SPIN",effect(t){return S.to(t,{rotation:(e,n)=>S.utils.snap(360,Number(S.getProperty(n,"rotation"))+360)})}});const r0=200,SA=t=>{try{const e=t?.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.width)&&n.width>0)return n.width}catch{}return r0},wA=t=>{try{const e=t?.height;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=t?.getLocalBounds?.();if(n&&Number.isFinite(n.height)&&n.height>0)return n.height}catch{}return r0},Sn=(t,e,n,r)=>{Ke({name:t,effect(i,o){const s=o?.x??0,a=o?.y??0,l=o?.scaleX??1,c=o?.scaleY??1,u=o?.alpha??1,f=o?.rotation??0,d=o?.duration??.5,h=e==="x"?SA(i):wA(i),m=e==="x"?s+r*h:s,p=e==="y"?a+r*h:a,g=n==="in"?{x:m,y:p,alpha:0}:{x:s,y:a,alpha:u},y=n==="in"?{x:s,y:a,alpha:u}:{x:m,y:p,alpha:0};return S.fromTo(i,{pixi:{x:g.x,y:g.y,scaleX:l,scaleY:c,alpha:g.alpha,rotation:f}},{pixi:{x:y.x,y:y.y,scaleX:l,scaleY:c,alpha:y.alpha,rotation:f},duration:d,ease:o?.ease||"power2.out",immediateRender:o?.immediateRender??!0,overwrite:o?.overwrite})}})};Sn("SLIDE_IN_LEFT","x","in",-1),Sn("SLIDE_IN_RIGHT","x","in",1),Sn("SLIDE_IN_TOP","y","in",-1),Sn("SLIDE_IN_BOTTOM","y","in",1),Sn("SLIDE_OUT_LEFT","x","out",-1),Sn("SLIDE_OUT_RIGHT","x","out",1),Sn("SLIDE_OUT_TOP","y","out",-1),Sn("SLIDE_OUT_BOTTOM","y","out",1);const br=.7,lc=.7,AA=-1200,OA=700;Ke({name:"BACK_IN",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+AA,u=l*.8,f=l*.2,d=S.timeline();return d.fromTo(t,{pixi:{x:n,y:c,scaleX:i*br,scaleY:o*br,alpha:lc,rotation:a}},{pixi:{x:n,y:r,scaleX:i*br,scaleY:o*br,alpha:lc,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{scaleX:i,scaleY:o,alpha:s},duration:f,ease:"power1.out",immediateRender:!1},u),d}}),Ke({name:"BACK_OUT",effect(t,e){const n=e?.x??0,r=e?.y??0,i=e?.scaleX??1,o=e?.scaleY??1,s=e?.alpha??1,a=e?.rotation??0,l=e?.duration??1,c=r+OA,u=l*.2,f=l*.8,d=S.timeline();return d.fromTo(t,{pixi:{x:n,y:r,scaleX:i,scaleY:o,alpha:s,rotation:a}},{pixi:{x:n,y:r,scaleX:i*br,scaleY:o*br,alpha:lc,rotation:a},duration:u,ease:"power1.out",immediateRender:e?.immediateRender??!0,overwrite:e?.overwrite},0),d.to(t,{pixi:{x:n,y:c},duration:f,ease:"power1.in",immediateRender:!1},u),d}});function i0(){return{updateEffect:O.useCallback((e,n,r)=>{if(!e)return console.warn("useGsapEffect: Target container is null or undefined"),S.to({},{duration:0});if(!n||typeof n!="string")return console.warn("useGsapEffect: Invalid effect name provided"),S.to(e,{duration:0});const i={immediateRender:!1,overwrite:!0,...r};try{return S.effects[n]?S.effects[n](e,i):S.effects.NONE?(console.warn(`useGsapEffect: Effect "${n}" not found, falling back to NONE`),S.effects.NONE(e,i)):(console.warn("useGsapEffect: NONE effect not found, returning empty tween"),S.to(e,{duration:0}))}catch(o){return console.error("useGsapEffect: Error applying effect:",o),S.to(e,{duration:0})}},[])}}const Yt={DEFAULT_DURATION_MS:1e3,DEFAULT_DURATION_SEC:1,MIN_DURATION_SEC:.1,MAX_DURATION_SEC:5,ENTRANCE_OVERLAP_SEC:.25,DEFAULT_LOOP_ROTATIONS_PER_SEC:.25,MIN_LOOP_ROTATIONS_PER_SEC:.05,MAX_LOOP_ROTATIONS_PER_SEC:1},li={WIDTH:1920,HEIGHT:1080},uc=new Set(["NONE","HEART_BEAT","PULSE","SHAKE","SHAKE_X","SHAKE_Y","HEAD_SHAKE","SWING","TADA","WOBBLE","JELLO","RUBBER_BAND","TYPEWRITER","RISE","TEXT_CASCADE","TEXT_SPOTLIGHT","TEXT_BLINDS","TEXT_POPCORN","TEXT_RIPPLE","TEXT_SHUFFLE","TEXT_DOMINO","TEXT_PENDULUM","TEXT_SLIDE_REVEAL","TEXT_SLOT","TEXT_CURTAIN"]),ui=new Set(["TYPEWRITER","RISE"]),o0=new Set(["SPIN_360"]);function s0(t){return o0.has(t)}const a0={NONE:"NONE",BOUNCE:"BOUNCE",FLASH:"FLASH",PULSE:"PULSE",RUBBER_BAND:"RUBBER_BAND",SHAKE_X:"SHAKE_X",SHAKE_Y:"SHAKE_Y",HEAD_SHAKE:"HEAD_SHAKE",SWING:"SWING",TADA:"TADA",WOBBLE:"WOBBLE",JELLO:"JELLO",HEART_BEAT:"HEART_BEAT",BACK_IN_DOWN:"BACK_IN_DOWN",BACK_IN_LEFT:"BACK_IN_LEFT",BACK_IN_RIGHT:"BACK_IN_RIGHT",BACK_IN_UP:"BACK_IN_UP",BACK_OUT_DOWN:"BACK_OUT_DOWN",BACK_OUT_LEFT:"BACK_OUT_LEFT",BACK_OUT_RIGHT:"BACK_OUT_RIGHT",BACK_OUT_UP:"BACK_OUT_UP",BOUNCE_IN:"BOUNCE_IN",BOUNCE_IN_DOWN:"BOUNCE_IN_DOWN",BOUNCE_IN_LEFT:"BOUNCE_IN_LEFT",BOUNCE_IN_RIGHT:"BOUNCE_IN_RIGHT",BOUNCE_IN_UP:"BOUNCE_IN_UP",BOUNCE_OUT:"BOUNCE_OUT",BOUNCE_OUT_DOWN:"BOUNCE_OUT_DOWN",BOUNCE_OUT_LEFT:"BOUNCE_OUT_LEFT",BOUNCE_OUT_RIGHT:"BOUNCE_OUT_RIGHT",BOUNCE_OUT_UP:"BOUNCE_OUT_UP",FADE_IN:"FADE_IN",FADE_IN_DOWN:"FADE_IN_DOWN",FADE_IN_DOWN_BIG:"FADE_IN_DOWN_BIG",FADE_IN_LEFT:"FADE_IN_LEFT",FADE_IN_LEFT_BIG:"FADE_IN_LEFT_BIG",FADE_IN_RIGHT:"FADE_IN_RIGHT",FADE_IN_RIGHT_BIG:"FADE_IN_RIGHT_BIG",FADE_IN_UP:"FADE_IN_UP",FADE_IN_UP_BIG:"FADE_IN_UP_BIG",FADE_IN_TOP_LEFT:"FADE_IN_TOP_LEFT",FADE_IN_TOP_RIGHT:"FADE_IN_TOP_RIGHT",FADE_IN_BOTTOM_LEFT:"FADE_IN_BOTTOM_LEFT",FADE_IN_BOTTOM_RIGHT:"FADE_IN_BOTTOM_RIGHT",FADE_OUT:"FADE_OUT",FADE_OUT_DOWN:"FADE_OUT_DOWN",FADE_OUT_DOWN_BIG:"FADE_OUT_DOWN_BIG",FADE_OUT_LEFT:"FADE_OUT_LEFT",FADE_OUT_LEFT_BIG:"FADE_OUT_LEFT_BIG",FADE_OUT_RIGHT:"FADE_OUT_RIGHT",FADE_OUT_RIGHT_BIG:"FADE_OUT_RIGHT_BIG",FADE_OUT_UP:"FADE_OUT_UP",FADE_OUT_UP_BIG:"FADE_OUT_UP_BIG",FADE_OUT_TOP_LEFT:"FADE_OUT_TOP_LEFT",FADE_OUT_TOP_RIGHT:"FADE_OUT_TOP_RIGHT",FADE_OUT_BOTTOM_RIGHT:"FADE_OUT_BOTTOM_RIGHT",FADE_OUT_BOTTOM_LEFT:"FADE_OUT_BOTTOM_LEFT",FLIP:"FLIP",FLIP_IN_X:"FLIP_IN_X",FLIP_IN_Y:"FLIP_IN_Y",FLIP_OUT_X:"FLIP_OUT_X",FLIP_OUT_Y:"FLIP_OUT_Y",LIGHT_SPEED_IN_RIGHT:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_IN_LEFT:"LIGHT_SPEED_IN_LEFT",LIGHT_SPEED_OUT_RIGHT:"LIGHT_SPEED_OUT_RIGHT",LIGHT_SPEED_OUT_LEFT:"LIGHT_SPEED_OUT_LEFT",ROTATE_IN:"ROTATE_IN",ROTATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROTATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROTATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROTATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT",ROTATE_OUT:"ROTATE_OUT",ROTATE_OUT_DOWN_LEFT:"ROTATE_OUT_DOWN_LEFT",ROTATE_OUT_DOWN_RIGHT:"ROTATE_OUT_DOWN_RIGHT",ROTATE_OUT_UP_LEFT:"ROTATE_OUT_UP_LEFT",ROTATE_OUT_UP_RIGHT:"ROTATE_OUT_UP_RIGHT",HINGE:"HINGE",JACK_IN_THE_BOX:"JACK_IN_THE_BOX",ROLL_IN:"ROLL_IN",ROLL_OUT:"ROLL_OUT",ZOOM_IN:"ZOOM_IN",ZOOM_IN_DOWN:"ZOOM_IN_DOWN",ZOOM_IN_LEFT:"ZOOM_IN_LEFT",ZOOM_IN_RIGHT:"ZOOM_IN_RIGHT",ZOOM_IN_UP:"ZOOM_IN_UP",ZOOM_OUT:"ZOOM_OUT",ZOOM_OUT_DOWN:"ZOOM_OUT_DOWN",ZOOM_OUT_LEFT:"ZOOM_OUT_LEFT",ZOOM_OUT_RIGHT:"ZOOM_OUT_RIGHT",ZOOM_OUT_UP:"ZOOM_OUT_UP",SLIDE_IN_DOWN:"SLIDE_IN_DOWN",SLIDE_IN_LEFT:"SLIDE_IN_LEFT",SLIDE_IN_RIGHT:"SLIDE_IN_RIGHT",SLIDE_IN_UP:"SLIDE_IN_UP",SLIDE_OUT_DOWN:"SLIDE_OUT_DOWN",SLIDE_OUT_LEFT:"SLIDE_OUT_LEFT",SLIDE_OUT_RIGHT:"SLIDE_OUT_RIGHT",SLIDE_OUT_UP:"SLIDE_OUT_UP",SPIN_360:"SPIN_360",SCALE_POP:"SCALE_POP",WIPE_LEFT_RIGHT:"WIPE_LEFT_RIGHT",WIPE_RADIAL:"WIPE_RADIAL",MASK_PAINT_ON:"MASK_PAINT_ON",TYPEWRITER:"TYPEWRITER",RISE:"RISE",STAGGER_FADE_UP_TEXT:"STAGGER_FADE_UP_TEXT",STAGGER_FADE_TEXT:"STAGGER_FADE_TEXT",STAGGER_FADE_UP:"STAGGER_FADE_UP",STAGGER_FADE:"STAGGER_FADE",TEXT_CASCADE:"TEXT_CASCADE",TEXT_SPOTLIGHT:"TEXT_SPOTLIGHT",TEXT_BLINDS:"TEXT_BLINDS",TEXT_POPCORN:"TEXT_POPCORN",TEXT_RIPPLE:"TEXT_RIPPLE",TEXT_SHUFFLE:"TEXT_SHUFFLE",TEXT_DOMINO:"TEXT_DOMINO",TEXT_PENDULUM:"TEXT_PENDULUM",TEXT_SLIDE_REVEAL:"TEXT_SLIDE_REVEAL",TEXT_SLOT:"TEXT_SLOT",TEXT_CURTAIN:"TEXT_CURTAIN",LIGHT_SPEED_IN:"LIGHT_SPEED_IN_RIGHT",LIGHT_SPEED_OUT:"LIGHT_SPEED_OUT_RIGHT",ROATATE_IN_DOWN_LEFT:"ROTATE_IN_DOWN_LEFT",ROATATE_IN_DOWN_RIGHT:"ROTATE_IN_DOWN_RIGHT",ROATATE_IN_UP_LEFT:"ROTATE_IN_UP_LEFT",ROATATE_IN_UP_RIGHT:"ROTATE_IN_UP_RIGHT"},c0={bounce:"BOUNCE",flash:"FLASH",pulse:"PULSE",rubberBand:"RUBBER_BAND",shakeX:"SHAKE_X",shakeY:"SHAKE_Y",headShake:"HEAD_SHAKE",swing:"SWING",tada:"TADA",wobble:"WOBBLE",jello:"JELLO",heartBeat:"HEART_BEAT",backInDown:"BACK_IN_DOWN",backInLeft:"BACK_IN_LEFT",backInRight:"BACK_IN_RIGHT",backInUp:"BACK_IN_UP",backOutDown:"BACK_OUT_DOWN",backOutLeft:"BACK_OUT_LEFT",backOutRight:"BACK_OUT_RIGHT",backOutUp:"BACK_OUT_UP",bounceIn:"BOUNCE_IN",bounceInDown:"BOUNCE_IN_DOWN",bounceInLeft:"BOUNCE_IN_LEFT",bounceInRight:"BOUNCE_IN_RIGHT",bounceInUp:"BOUNCE_IN_UP",bounceOut:"BOUNCE_OUT",bounceOutDown:"BOUNCE_OUT_DOWN",bounceOutLeft:"BOUNCE_OUT_LEFT",bounceOutRight:"BOUNCE_OUT_RIGHT",bounceOutUp:"BOUNCE_OUT_UP",fadeIn:"FADE_IN",fadeInDown:"FADE_IN_DOWN",fadeInDownBig:"FADE_IN_DOWN_BIG",fadeInLeft:"FADE_IN_LEFT",fadeInLeftBig:"FADE_IN_LEFT_BIG",fadeInRight:"FADE_IN_RIGHT",fadeInRightBig:"FADE_IN_RIGHT_BIG",fadeInUp:"FADE_IN_UP",fadeInUpBig:"FADE_IN_UP_BIG",fadeInTopLeft:"FADE_IN_TOP_LEFT",fadeInTopRight:"FADE_IN_TOP_RIGHT",fadeInBottomLeft:"FADE_IN_BOTTOM_LEFT",fadeInBottomRight:"FADE_IN_BOTTOM_RIGHT",fadeOut:"FADE_OUT",fadeOutDown:"FADE_OUT_DOWN",fadeOutDownBig:"FADE_OUT_DOWN_BIG",fadeOutLeft:"FADE_OUT_LEFT",fadeOutLeftBig:"FADE_OUT_LEFT_BIG",fadeOutRight:"FADE_OUT_RIGHT",fadeOutRightBig:"FADE_OUT_RIGHT_BIG",fadeOutUp:"FADE_OUT_UP",fadeOutUpBig:"FADE_OUT_UP_BIG",fadeOutTopLeft:"FADE_OUT_TOP_LEFT",fadeOutTopRight:"FADE_OUT_TOP_RIGHT",fadeOutBottomRight:"FADE_OUT_BOTTOM_RIGHT",fadeOutBottomLeft:"FADE_OUT_BOTTOM_LEFT",flip:"FLIP",flipInX:"FLIP_IN_X",flipInY:"FLIP_IN_Y",flipOutX:"FLIP_OUT_X",flipOutY:"FLIP_OUT_Y",lightSpeedInRight:"LIGHT_SPEED_IN_RIGHT",lightSpeedInLeft:"LIGHT_SPEED_IN_LEFT",lightSpeedOutRight:"LIGHT_SPEED_OUT_RIGHT",lightSpeedOutLeft:"LIGHT_SPEED_OUT_LEFT",rotateIn:"ROTATE_IN",rotateInDownLeft:"ROTATE_IN_DOWN_LEFT",rotateInDownRight:"ROTATE_IN_DOWN_RIGHT",rotateInUpLeft:"ROTATE_IN_UP_LEFT",rotateInUpRight:"ROTATE_IN_UP_RIGHT",rotateOut:"ROTATE_OUT",rotateOutDownLeft:"ROTATE_OUT_DOWN_LEFT",rotateOutDownRight:"ROTATE_OUT_DOWN_RIGHT",rotateOutUpLeft:"ROTATE_OUT_UP_LEFT",rotateOutUpRight:"ROTATE_OUT_UP_RIGHT",hinge:"HINGE",jackInTheBox:"JACK_IN_THE_BOX",rollIn:"ROLL_IN",rollOut:"ROLL_OUT",zoomIn:"ZOOM_IN",zoomInDown:"ZOOM_IN_DOWN",zoomInLeft:"ZOOM_IN_LEFT",zoomInRight:"ZOOM_IN_RIGHT",zoomInUp:"ZOOM_IN_UP",scalePop:"SCALE_POP",wipeLeftRight:"WIPE_LEFT_RIGHT",wipeRadial:"WIPE_RADIAL",maskPaintOn:"MASK_PAINT_ON",typewriter:"TYPEWRITER",rise:"RISE",textCascade:"TEXT_CASCADE",textSpotlight:"TEXT_SPOTLIGHT",textBlinds:"TEXT_BLINDS",textPopcorn:"TEXT_POPCORN",textRipple:"TEXT_RIPPLE",textShuffle:"TEXT_SHUFFLE",textDomino:"TEXT_DOMINO",textPendulum:"TEXT_PENDULUM",textSlideReveal:"TEXT_SLIDE_REVEAL",textSlot:"TEXT_SLOT",textCurtain:"TEXT_CURTAIN",staggerFadeUpText:"STAGGER_FADE_UP_TEXT",staggerFadeText:"STAGGER_FADE_TEXT",staggerFadeUp:"STAGGER_FADE_UP",staggerFade:"STAGGER_FADE",zoomOut:"ZOOM_OUT",zoomOutDown:"ZOOM_OUT_DOWN",zoomOutLeft:"ZOOM_OUT_LEFT",zoomOutRight:"ZOOM_OUT_RIGHT",zoomOutUp:"ZOOM_OUT_UP",slideInDown:"SLIDE_IN_DOWN",slideInLeft:"SLIDE_IN_LEFT",slideInRight:"SLIDE_IN_RIGHT",slideInUp:"SLIDE_IN_UP",slideOutDown:"SLIDE_OUT_DOWN",slideOutLeft:"SLIDE_OUT_LEFT",slideOutRight:"SLIDE_OUT_RIGHT",slideOutUp:"SLIDE_OUT_UP"};function vr(t){return t?t===t.toUpperCase()?t:c0[t]?c0[t]:t.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,""):"NONE"}function dc(t){const e={name:"NONE",durationSec:Yt.DEFAULT_DURATION_SEC};if(t==null)return e;if(typeof t=="string")return{name:vr(t)||"NONE",durationSec:Yt.DEFAULT_DURATION_SEC};if(typeof t=="object"){const n=vr(t.name??"NONE"),r=t.duration??Yt.DEFAULT_DURATION_MS;return{name:n,durationSec:r/1e3}}return e}function l0(t){const e={name:"NONE",rotationsPerSecond:Yt.DEFAULT_LOOP_ROTATIONS_PER_SEC,direction:1};if(t==null)return e;if(typeof t=="string")return{...e,name:vr(t)||"NONE"};if(typeof t=="object"){const n=vr(t.name??"NONE"),r=typeof t.rotationsPerSecond=="number"&&t.rotationsPerSecond>0?Math.min(Math.max(t.rotationsPerSecond,Yt.MIN_LOOP_ROTATIONS_PER_SEC),Yt.MAX_LOOP_ROTATIONS_PER_SEC):Yt.DEFAULT_LOOP_ROTATIONS_PER_SEC,i=t.direction===-1?-1:1;return{name:n,rotationsPerSecond:r,direction:i}}return e}function MA(t){return!uc.has(t)}function IA(t){return ui.has(t)}function CA(t){if(!t||t==="NONE")return!1;if(typeof window<"u"&&window.gsap){const e=window.gsap;if(e.effects)return typeof e.effects[t]=="function"}return Object.values(a0).includes(t)}const u0=({targetRef:t,transformation:e,start:n,end:r,effectOptions:i={}})=>{const{tl:o}=O.useContext(Ve),s=O.useRef(null),{x:a=0,y:l=0,maxX:c=li.WIDTH,maxY:u=li.HEIGHT,scale:f=1,rotation:d=0,opacity:h=1,animationIn:m,animationOut:p,animationLoop:g,keyframes:y}=e||{},_=d*(180/Math.PI),v=O.useMemo(()=>dc(m),[m]),x=O.useMemo(()=>dc(p),[p]),E=O.useMemo(()=>l0(g),[g]),T=E.name!=="NONE"&&s0(E.name),A=O.useMemo(()=>!Array.isArray(y)||y.length===0?[]:[...y].sort((D,N)=>D.time-N.time),[y]),M=O.useMemo(()=>{if(Array.isArray(f))return f;const D=typeof f=="number"?f:1;return[D,D]},[f]),C=Number(n)||0,k=Number(r)||C,w=Math.max(k-C,0),L=Math.min(Math.max(Number(e?.entranceOverlapSec)||0,0),w);return O.useLayoutEffect(()=>{const D=t?.current,N=o?.current,F=N;if(!D||!N||w<=0)return;s.current&&(N.remove(s.current),s.current.kill(),s.current=null);const H=M[0]??1,V=M[1]??1,$={x:a,y:l,rotation:_,scaleX:H,scaleY:V,alpha:h},re=v.name&&v.name!=="NONE"&&!ui.has(v.name)&&S.effects[v.name],he=x.name&&x.name!=="NONE"&&!ui.has(x.name)&&S.effects[x.name];re&&uc.has(v.name);const q=v.durationSec,fe=x.durationSec,Y=re?q:0,te=he?Math.max(w-fe,Y):w,z=c||li.WIDTH,le=u||li.HEIGHT,Q={x:$.x,y:$.y,rotation:$.rotation,scaleX:$.scaleX,scaleY:$.scaleY,alpha:$.alpha,maxX:c,maxY:u,canvasWidth:z,canvasHeight:le,...i,immediateRender:!0,overwrite:!1},ce=m&&typeof m=="object"&&typeof m.ease=="string"?m.ease:void 0,ye=p&&typeof p=="object"&&typeof p.ease=="string"?p.ease:void 0,U=m&&typeof m=="object"?{revealUnit:m.revealUnit,stagger:m.stagger,staggerFrom:m.staggerFrom,staggerEase:m.staggerEase,text:typeof m.text=="string"?m.text:void 0,yOffset:m.yOffset}:{},Z=S.timeline();if(re){const be=D.x,ee=D.y,Ee=D.alpha,de=D.rotation,ke=D.scale?.x??1,je=D.scale?.y??1,ut=D.skew?.x??0,dt=D.skew?.y??0,ot=S.effects[v.name](D,{duration:q,...Q,...U,...ce?{ease:ce}:{}});D.x=be,D.y=ee,D.alpha=Ee,D.rotation=de,D.scale&&D.scale.set(ke,je),D.skew&&D.skew.set(ut,dt),Z.add(ot,0)}else Z.set(D,{pixi:$},0);const W=be=>{const ee={};return be.x!==void 0&&(ee.x=be.x),be.y!==void 0&&(ee.y=be.y),be.scaleX!==void 0&&(ee.scaleX=be.scaleX),be.scaleY!==void 0&&(ee.scaleY=be.scaleY),be.rotation!==void 0&&(ee.rotation=be.rotation),be.alpha!==void 0&&(ee.alpha=be.alpha),ee};if(A.length>0){const be=A[0],ee=A[A.length-1],Ee=Math.max(be.time,Y);Ee>Y&&Z.to(D,{pixi:$,duration:Ee-Y,immediateRender:!1},Y),Z.set(D,{pixi:W(be.properties)},Ee);for(let de=1;de<A.length;de++){const ke=A[de-1],je=A[de],ut=je.time-ke.time;ut<=0?Z.set(D,{pixi:W(je.properties)},je.time):Z.to(D,{pixi:W(je.properties),duration:ut,ease:je.easing||"none",immediateRender:!1},ke.time)}te>ee.time&&Z.to(D,{pixi:W(ee.properties),duration:te-ee.time,immediateRender:!1},ee.time)}else if(T&&te>Y){const be=te-Y,ee=360*E.rotationsPerSecond*E.direction*be;Z.set(D,{pixi:{rotation:$.rotation}},Y),Z.to(D,{pixi:{rotation:$.rotation+ee},duration:be,ease:"none",immediateRender:!1},Y)}else te>Y&&Z.to(D,{duration:te-Y,pixi:$,immediateRender:!1},Y);if(he){const be=S.effects[x.name](D,{duration:fe,...Q,immediateRender:!1,...ye?{ease:ye}:{}});Z.add(be,te)}s.current=Z,N.add(Z,C-L);const _e=N.time();return N.time(_e,!1),()=>{s.current&&(F&&F.remove(s.current),s.current.kill(),s.current=null)}},[t,o,a,l,d,_,M,h,c,u,v,x,E,T,A,C,k,w,L,i,m,p]),{childTimelineRef:s}};var _o=(t=>(t.NONE="NONE",t.FLASH="FLASH",t.PULSE="PULSE",t.SHAKE="SHAKE",t.SWING="SWING",t.JELLO="JELLO",t.WOOBLE="WOOBLE",t.FADE_IN="FADE_IN",t.FADE_OUT="FADE_OUT",t.FADE_IN_OUT="FADE_IN_OUT",t.SLIDE_IN_LEFT="SLIDE_IN_LEFT",t.SLIDE_IN_RIGHT="SLIDE_IN_RIGHT",t.SLIDE_IN_TOP="SLIDE_IN_TOP",t.SLIDE_IN_BOTTOM="SLIDE_IN_BOTTOM",t.SLIDE_OUT_LEFT="SLIDE_OUT_LEFT",t.SLIDE_OUT_RIGHT="SLIDE_OUT_RIGHT",t.SLIDE_OUT_TOP="SLIDE_OUT_TOP",t.SLIDE_OUT_BOTTOM="SLIDE_OUT_BOTTOM",t.ZOOM_IN="ZOOM_IN",t.ZOOM_OUT="ZOOM_OUT",t.ZOOM_IN_OUT="ZOOM_IN_OUT",t.BOUNCE_IN="BOUNCE_IN",t.BOUNCE_OUT="BOUNCE_OUT",t.BOUNCE_IN_OUT="BOUNCE_IN_OUT",t.BOUNCE_IN_DOWN="BOUNCE_IN_DOWN",t.BOUNCE_IN_LEFT="BOUNCE_IN_LEFT",t.BOUNCE_IN_RIGHT="BOUNCE_IN_RIGHT",t.BOUNCE_IN_UP="BOUNCE_IN_UP",t.BOUNCE_OUT_DOWN="BOUNCE_OUT_DOWN",t.BOUNCE_OUT_LEFT="BOUNCE_OUT_LEFT",t.BOUNCE_OUT_RIGHT="BOUNCE_OUT_RIGHT",t.BOUNCE_OUT_UP="BOUNCE_OUT_UP",t.FADE_IN_DOWN="FADE_IN_DOWN",t.FADE_IN_LEFT="FADE_IN_LEFT",t.FADE_IN_RIGHT="FADE_IN_RIGHT",t.FADE_IN_UP="FADE_IN_UP",t.FADE_OUT_DOWN="FADE_OUT_DOWN",t.FADE_OUT_LEFT="FADE_OUT_LEFT",t.FADE_OUT_RIGHT="FADE_OUT_RIGHT",t.FADE_OUT_UP="FADE_OUT_UP",t.ELASTIC_IN="ELASTIC_IN",t.ELASTIC_OUT="ELASTIC_OUT",t.ELASTIC_IN_OUT="ELASTIC_IN_OUT",t.BACK_IN="BACK_IN",t.BACK_OUT="BACK_OUT",t.BACK_IN_OUT="BACK_IN_OUT",t.CIRCULAR_IN="CIRCULAR_IN",t.CIRCULAR_OUT="CIRCULAR_OUT",t.CIRCULAR_IN_OUT="CIRCULAR_IN_OUT",t.EXPO_IN="EXPO_IN",t.EXPO_OUT="EXPO_OUT",t.EXPO_IN_OUT="EXPO_IN_OUT",t.SINE_IN="SINE_IN",t.SINE_OUT="SINE_OUT",t.SINE_IN_OUT="SINE_IN_OUT",t.BOUNCE="BOUNCE",t.ELASTIC="ELASTIC",t.BACK="BACK",t.CIRCULAR="CIRCULAR",t.EXPO="EXPO",t.SINE="SINE",t.SPIN="SPIN",t))(_o||{});const fc=0,d0=1,RA=2,f0=3,LA=new Set([2,4,5,6,7,8,9,10]),kA=t=>t==null||t===fc?"none":t===d0||t===f0||LA.has(t)?"native":"none",PA={[fc]:"normal",[d0]:"add",[RA]:"multiply",[f0]:"screen",4:"overlay",5:"darken",6:"lighten",7:"color-dodge",8:"color-burn",9:"hard-light",10:"soft-light"},hc=t=>t==null?"normal":PA[t]??"normal",h0=(t=fc)=>O.useMemo(()=>hc(t),[t]),bo=`in vec2 aPosition;
968
968
  out vec2 vTextureCoord;
969
969
 
970
970
  uniform vec4 uInputSize;
@@ -989,7 +989,7 @@ void main(void)
989
989
  gl_Position = filterVertexPosition();
990
990
  vTextureCoord = filterTextureCoord();
991
991
  }
992
- `,bw=`precision highp float;
992
+ `,DA=`precision highp float;
993
993
 
994
994
  in vec2 vTextureCoord;
995
995
  out vec4 finalColor;
@@ -1023,7 +1023,7 @@ void main(void) {
1023
1023
 
1024
1024
  finalColor = color;
1025
1025
  }
1026
- `;class xw extends B.Filter{edge;constructor(e){const n=B.GlProgram.from({vertex:no,fragment:bw,name:"edge-feather-filter"});super({glProgram:n,resources:{edgeUniforms:{uDimensions:{value:new Float32Array(2),type:"vec2<f32>"},uFeatherAmount:{value:e,type:"f32"}}}}),this.edge=this.resources.edgeUniforms.uniforms}apply(e,n,r,i){this.edge.uDimensions[0]=n.frame.width,this.edge.uDimensions[1]=n.frame.height,e.applyFilter(this,n,r,i)}get featherAmount(){return this.edge.uFeatherAmount}set featherAmount(e){this.edge.uFeatherAmount=e}}const gn=t=>1+t/100,Dn=t=>t/100,Im=(t,e,n)=>Math.max(e,Math.min(n,t)),vw=(t,e)=>{const n=new Array(20).fill(0);n[0]=n[6]=n[12]=n[18]=1;const r=Dn(t),i=Dn(e);return n[4]=i*.3,n[9]=i*.3,n[14]=i*.3,n[0]+=r*.2,n[6]+=r*.2,n[12]+=r*.2,n},Tw=({brightness:t,contrast:e,saturation:n,red:r,green:i,blue:o,gamma:s,alpha:a})=>t!==0||e!==0||n!==0||r!==0||i!==0||o!==0||s!==1||a!==1?new ne.AdjustmentFilter({gamma:s,brightness:gn(t),contrast:gn(e),saturation:gn(n),red:gn(r),green:gn(i),blue:gn(o),alpha:a}):null,Ew=t=>{if(t===0)return null;const e=gn(t);return new ne.AdjustmentFilter({brightness:e,gamma:1/e})},Sw=(t,e)=>{if(t===0&&e===0)return null;const n=new W.ColorMatrixFilter,r=new Array(20).fill(0);if(r[0]=r[6]=r[12]=r[18]=1,t!==0){const i=Dn(t);r[0]+=i*.8,r[4]+=i*.15,r[6]+=i*.15,r[12]-=i*.8,r[14]+=-i*.1}if(e!==0){const i=Dn(e);r[0]-=i*.4,r[4]+=-i*.08,r[6]+=i*.6,r[9]+=i*.12,r[12]-=i*.4,r[14]+=-i*.08}return n.matrix=r,n},ww=(t,e)=>{if(t===0&&e===0)return null;const n=new W.ColorMatrixFilter;return n.matrix=vw(t,e),n},Aw=t=>{if(t===0)return null;const e=gn(t*.7);return new ne.AdjustmentFilter({saturation:e})},Ow=t=>{if(t===0)return null;const e=Im(t,-180,180);return new ne.HslAdjustmentFilter({hue:e,saturation:0,lightness:0,colorize:!1})},Cw=t=>{if(t===0)return null;const e=Dn(t)*.5;return new ne.ConvolutionFilter({matrix:[0,-e,0,-e,1+4*e,-e,0,-e,0],width:200,height:200})},Rw=t=>t===0?null:new ne.KawaseBlurFilter({strength:t,quality:1,clamp:!0}),Iw=t=>{if(t===0)return null;const e=Dn(t);return new ne.OldFilmFilter({vignetting:Math.abs(e),sepia:0,noise:0,scratch:0})},Mw=t=>{if(t===0)return null;const e=Dn(t);return new W.NoiseFilter({noise:Math.abs(e)*.5})},Lw=t=>t?new xw(Im(t/100,0,1)):null,Mm=(t={})=>{const{contrast:e=0,saturation:n=0,brightness:r=0,alpha:i=1,gamma:o=1,red:s=0,green:a=0,blue:l=0,temperature:c=0,tint:u=0,hue:f=0,highlights:d=0,shadows:h=0,exposure:p=0,vibrance:m=0,sharpness:g=0,blurRadius:y=0,vignette:b=0,noise:x=0,edgeFeather:v=0}=t,T=Tw({brightness:r,contrast:e,saturation:n,red:s,green:a,blue:l,gamma:o,alpha:i}),w=Ew(p),O=Sw(c,u),C=ww(d,h),R=Aw(m),P=Ow(f),A=Cw(g),L=Rw(y),N=Iw(b),D=Mw(x),F=Lw(v);return{adjustmentFilter:T,exposureFilter:w,temperatureTintFilter:O,tonalFilter:C,vibranceFilter:R,hslFilter:P,sharpnessFilter:A,blurFilter:L,vignetteFilter:N,noiseFilter:D,edgeFeatherFilter:F}},Pw=`precision highp float;
1026
+ `;class NA extends G.Filter{edge;constructor(e){const n=G.GlProgram.from({vertex:bo,fragment:DA,name:"edge-feather-filter"});super({glProgram:n,resources:{edgeUniforms:{uDimensions:{value:new Float32Array(2),type:"vec2<f32>"},uFeatherAmount:{value:e,type:"f32"}}}}),this.edge=this.resources.edgeUniforms.uniforms}apply(e,n,r,i){this.edge.uDimensions[0]=n.frame.width,this.edge.uDimensions[1]=n.frame.height,e.applyFilter(this,n,r,i)}get featherAmount(){return this.edge.uFeatherAmount}set featherAmount(e){this.edge.uFeatherAmount=e}}const wn=t=>1+t/100,zn=t=>t/100,p0=(t,e,n)=>Math.max(e,Math.min(n,t)),FA=(t,e)=>{const n=new Array(20).fill(0);n[0]=n[6]=n[12]=n[18]=1;const r=zn(t),i=zn(e);return n[4]=i*.3,n[9]=i*.3,n[14]=i*.3,n[0]+=r*.2,n[6]+=r*.2,n[12]+=r*.2,n},BA=({brightness:t,contrast:e,saturation:n,red:r,green:i,blue:o,gamma:s,alpha:a})=>t!==0||e!==0||n!==0||r!==0||i!==0||o!==0||s!==1||a!==1?new oe.AdjustmentFilter({gamma:s,brightness:wn(t),contrast:wn(e),saturation:wn(n),red:wn(r),green:wn(i),blue:wn(o),alpha:a}):null,UA=t=>{if(t===0)return null;const e=wn(t);return new oe.AdjustmentFilter({brightness:e,gamma:1/e})},GA=(t,e)=>{if(t===0&&e===0)return null;const n=new K.ColorMatrixFilter,r=new Array(20).fill(0);if(r[0]=r[6]=r[12]=r[18]=1,t!==0){const i=zn(t);r[0]+=i*.8,r[4]+=i*.15,r[6]+=i*.15,r[12]-=i*.8,r[14]+=-i*.1}if(e!==0){const i=zn(e);r[0]-=i*.4,r[4]+=-i*.08,r[6]+=i*.6,r[9]+=i*.12,r[12]-=i*.4,r[14]+=-i*.08}return n.matrix=r,n},jA=(t,e)=>{if(t===0&&e===0)return null;const n=new K.ColorMatrixFilter;return n.matrix=FA(t,e),n},HA=t=>{if(t===0)return null;const e=wn(t*.7);return new oe.AdjustmentFilter({saturation:e})},YA=t=>{if(t===0)return null;const e=p0(t,-180,180);return new oe.HslAdjustmentFilter({hue:e,saturation:0,lightness:0,colorize:!1})},WA=t=>{if(t===0)return null;const e=zn(t)*.5;return new oe.ConvolutionFilter({matrix:[0,-e,0,-e,1+4*e,-e,0,-e,0],width:200,height:200})},XA=t=>t===0?null:new oe.KawaseBlurFilter({strength:t,quality:1,clamp:!0}),zA=t=>{if(t===0)return null;const e=zn(t);return new oe.OldFilmFilter({vignetting:Math.abs(e),sepia:0,noise:0,scratch:0})},qA=t=>{if(t===0)return null;const e=zn(t);return new K.NoiseFilter({noise:Math.abs(e)*.5})},VA=t=>t?new NA(p0(t/100,0,1)):null,m0=(t={})=>{const{contrast:e=0,saturation:n=0,brightness:r=0,alpha:i=1,gamma:o=1,red:s=0,green:a=0,blue:l=0,temperature:c=0,tint:u=0,hue:f=0,highlights:d=0,shadows:h=0,exposure:m=0,vibrance:p=0,sharpness:g=0,blurRadius:y=0,vignette:_=0,noise:v=0,edgeFeather:x=0}=t,E=BA({brightness:r,contrast:e,saturation:n,red:s,green:a,blue:l,gamma:o,alpha:i}),T=UA(m),A=GA(c,u),M=jA(d,h),C=HA(p),k=YA(f),w=WA(g),L=XA(y),D=zA(_),N=qA(v),F=VA(x);return{adjustmentFilter:E,exposureFilter:T,temperatureTintFilter:A,tonalFilter:M,vibranceFilter:C,hslFilter:k,sharpnessFilter:w,blurFilter:L,vignetteFilter:D,noiseFilter:N,edgeFeatherFilter:F}},KA=`precision highp float;
1027
1027
  in vec2 vTextureCoord;
1028
1028
  out vec4 finalColor;
1029
1029
 
@@ -1052,8 +1052,8 @@ vec2 vfxCellHash(vec2 p) {
1052
1052
  }
1053
1053
 
1054
1054
  const vec3 LUMA = vec3(0.299, 0.587, 0.114);
1055
- `,Nw=no,kw=t=>`${Pw}
1056
- ${t}`;class Dw extends B.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,name:n,intensity:r,uniforms:i={}}){const o=B.GlProgram.from({vertex:Nw,fragment:e,name:n});super({glProgram:o,resources:{vfxUniforms:{uTime:{value:0,type:"f32"},uIntensity:{value:r,type:"f32"},uSeed:{value:Math.random()*100,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2<f32>"},...i}}}),this.vfx=this.resources.vfxUniforms.uniforms}apply(e,n,r,i){this.vfx.uDimensions[0]=n.frame.width,this.vfx.uDimensions[1]=n.frame.height,e.applyFilter(this,n,r,i)}get time(){return this.vfx.uTime}set time(e){this.vfx.uTime=e}get intensity(){return this.vfx.uIntensity}set intensity(e){this.vfx.uIntensity=e}}const Fw=`void main(void) {
1055
+ `,$A=bo,ZA=t=>`${KA}
1056
+ ${t}`;class JA extends G.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,name:n,intensity:r,uniforms:i={}}){const o=G.GlProgram.from({vertex:$A,fragment:e,name:n});super({glProgram:o,resources:{vfxUniforms:{uTime:{value:0,type:"f32"},uIntensity:{value:r,type:"f32"},uSeed:{value:Math.random()*100,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2<f32>"},...i}}}),this.vfx=this.resources.vfxUniforms.uniforms}apply(e,n,r,i){this.vfx.uDimensions[0]=n.frame.width,this.vfx.uDimensions[1]=n.frame.height,e.applyFilter(this,n,r,i)}get time(){return this.vfx.uTime}set time(e){this.vfx.uTime=e}get intensity(){return this.vfx.uIntensity}set intensity(e){this.vfx.uIntensity=e}}const QA=`void main(void) {
1057
1057
  vec2 uv = vTextureCoord;
1058
1058
  float t = uTime;
1059
1059
 
@@ -1081,7 +1081,7 @@ ${t}`;class Dw extends B.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,nam
1081
1081
  float a = texture(uTexture, vTextureCoord).a;
1082
1082
  finalColor = vec4(col, a);
1083
1083
  }
1084
- `,Bw=`void main(void) {
1084
+ `,eO=`void main(void) {
1085
1085
  vec2 uv = vTextureCoord;
1086
1086
  float t = uTime;
1087
1087
 
@@ -1102,7 +1102,7 @@ ${t}`;class Dw extends B.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,nam
1102
1102
  float a = texture(uTexture, uv).a;
1103
1103
  finalColor = vec4(col, a);
1104
1104
  }
1105
- `,Uw=`void main(void) {
1105
+ `,tO=`void main(void) {
1106
1106
  vec4 base = texture(uTexture, vTextureCoord);
1107
1107
  vec2 uv = vTextureCoord;
1108
1108
  float t = uTime;
@@ -1117,7 +1117,7 @@ ${t}`;class Dw extends B.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,nam
1117
1117
 
1118
1118
  finalColor = vec4(col, base.a);
1119
1119
  }
1120
- `,Gw=`void main(void) {
1120
+ `,nO=`void main(void) {
1121
1121
  vec4 base = texture(uTexture, vTextureCoord);
1122
1122
  vec2 uv = vTextureCoord;
1123
1123
  float t = uTime;
@@ -1135,7 +1135,7 @@ ${t}`;class Dw extends B.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,nam
1135
1135
 
1136
1136
  finalColor = vec4(col, base.a);
1137
1137
  }
1138
- `,jw=`void main(void) {
1138
+ `,rO=`void main(void) {
1139
1139
  vec2 uv = vTextureCoord;
1140
1140
  float t = uTime;
1141
1141
  vec2 dir = uv - vec2(0.5);
@@ -1147,7 +1147,7 @@ ${t}`;class Dw extends B.Filter{__vfxAnimated=!0;vfx;constructor({fragment:e,nam
1147
1147
  float b = texture(uTexture, uv - offset).b;
1148
1148
  finalColor = vec4(r, g, b, texture(uTexture, uv).a);
1149
1149
  }
1150
- `,Hw=`vec2 liquidGlassFlow(vec2 uv, float t) {
1150
+ `,iO=`vec2 liquidGlassFlow(vec2 uv, float t) {
1151
1151
  vec2 p = uv * 2.0 - 1.0;
1152
1152
  float aspect = uDimensions.x / max(uDimensions.y, 1.0);
1153
1153
  p.x *= aspect;
@@ -1226,7 +1226,7 @@ void main(void) {
1226
1226
 
1227
1227
  finalColor = vec4(col, texture(uTexture, uv).a);
1228
1228
  }
1229
- `,Yw=`void main(void) {
1229
+ `,oO=`void main(void) {
1230
1230
  vec2 uv = vTextureCoord;
1231
1231
  float t = uTime;
1232
1232
 
@@ -1262,7 +1262,7 @@ void main(void) {
1262
1262
 
1263
1263
  finalColor = vec4(col, texture(uTexture, uv).a);
1264
1264
  }
1265
- `,Xw=`void main(void) {
1265
+ `,sO=`void main(void) {
1266
1266
  vec2 uv = vTextureCoord;
1267
1267
  float t = uTime;
1268
1268
  vec2 px = uInputSize.zw;
@@ -1295,7 +1295,7 @@ void main(void) {
1295
1295
 
1296
1296
  finalColor = vec4(post, texture(uTexture, uv).a);
1297
1297
  }
1298
- `,Ww=`uniform vec2 uDirection;
1298
+ `,aO=`uniform vec2 uDirection;
1299
1299
 
1300
1300
  vec3 vfxInkSketch(vec2 uv, vec3 base) {
1301
1301
  float l = dot(base, LUMA);
@@ -1345,7 +1345,7 @@ void main(void) {
1345
1345
  vec3 col = mix(base, fx, clamp(uIntensity, 0.0, 1.0));
1346
1346
  finalColor = vec4(col, texture(uTexture, uv).a);
1347
1347
  }
1348
- `,zw=`void main(void) {
1348
+ `,cO=`void main(void) {
1349
1349
  vec2 uv = vTextureCoord;
1350
1350
  float t = uTime;
1351
1351
 
@@ -1367,7 +1367,7 @@ void main(void) {
1367
1367
  vec3 col = mix(base, fx, clamp(uIntensity, 0.0, 1.0));
1368
1368
  finalColor = vec4(col, texture(uTexture, uv).a);
1369
1369
  }
1370
- `,qw=(t,e=1)=>Math.max(0,Math.min(100,t))/100*e,ur={WaveTearDown:{shaderName:"vfx-wave-tear-down",direction:new Float32Array([0,1])},WaveTearUp:{shaderName:"vfx-wave-tear-up",direction:new Float32Array([0,-1])},WaveTearAcross:{shaderName:"vfx-wave-tear-across",direction:new Float32Array([1,.4])}},Ft=(t,e,n,r,i)=>new Dw({fragment:kw(t),name:e,intensity:qw(n,r),uniforms:i}),Wa=(t,e=50)=>Ft(Ww,t.shaderName,e,1,{uDirection:{value:t.direction,type:"vec2<f32>"}}),Lm={VHS:{shaderName:"vfx-vhs",defaultIntensity:50,create:(t=50)=>Ft(Fw,"vfx-vhs",t,1.2)},GlitchWave:{shaderName:"vfx-glitch-wave",defaultIntensity:50,create:(t=50)=>Ft(Bw,"vfx-glitch-wave",t,1.4)},LightLeak:{shaderName:"vfx-light-leak",defaultIntensity:50,create:(t=50)=>Ft(Uw,"vfx-light-leak",t,1.3)},FilmGrain:{shaderName:"vfx-film-grain",defaultIntensity:55,create:(t=50)=>Ft(Gw,"vfx-film-grain",t,1.2)},ChromaticWave:{shaderName:"vfx-chromatic-wave",defaultIntensity:50,create:(t=50)=>Ft(jw,"vfx-chromatic-wave",t,1.5)},LiquidGlass:{shaderName:"vfx-liquid-glass",defaultIntensity:65,create:(t=50)=>Ft(Hw,"vfx-liquid-glass",t,1.25)},BrokenGlass:{shaderName:"vfx-broken-glass",defaultIntensity:55,create:(t=50)=>Ft(Yw,"vfx-broken-glass",t,1)},Comic:{shaderName:"vfx-comic",defaultIntensity:60,create:(t=50)=>Ft(Xw,"vfx-comic",t,1)},WaveTearDown:{shaderName:ur.WaveTearDown.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearDown,t)},WaveTearUp:{shaderName:ur.WaveTearUp.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearUp,t)},WaveTearAcross:{shaderName:ur.WaveTearAcross.shaderName,defaultIntensity:100,create:(t=50)=>Wa(ur.WaveTearAcross,t)},WaveBrush:{shaderName:"vfx-wave-brush",defaultIntensity:100,create:(t=50)=>Ft(zw,"vfx-wave-brush",t,1)}},Vw=t=>t in Lm,Kw=(t=100)=>{const e=t/100;return new ne.HslAdjustmentFilter({hue:0,saturation:-1*e,lightness:0})},Zw=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.393*n+(1-n),.769*n,.189*n,0,0,.349*n,.686*n+(1-n),.168*n,0,0,.272*n,.534*n,.131*n+(1-n),0,0,0,0,0,1,0],e},$w=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100,r=[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0];for(let i=0;i<20;i++)e.matrix[i]=i===0?r[i]*1.1*n+(1-n):r[i]*n+(i<15?1-n:0);return e},Jw=()=>{const t=new ne.GlowFilter({distance:10,outerStrength:1,innerStrength:1,color:65280,quality:.5}),e=new W.ColorMatrixFilter;return e.matrix=[.1,.5,.1,0,0,.1,.8,.1,0,0,.1,.5,.1,0,0,0,0,0,1,0],[t,e]},Qw=(t=65535,e=50)=>{const n=e/50,r=new ne.GlowFilter({distance:8*n,outerStrength:1.5*n,innerStrength:.8*n,color:t,quality:.6}),i=new ne.GlowFilter({distance:16*n,outerStrength:.8*n,innerStrength:0,color:t,quality:.4});return[r,i]},eA=()=>{const t=new W.ColorMatrixFilter;return t.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],t},tA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,.05*n,0,0,.05*n,.05*n,1+.05*n,0,0,.02*n,0,0,1-.15*n,0,0,0,0,0,1,0],e},nA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1-.1*n,0,.05*n,0,0,0,1,.05*n,0,0,.05*n,.05*n,1+.15*n,0,.05*n,0,0,0,1,0],e},rA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({saturation:1+.5*e,contrast:1+.2*e,brightness:1+.05*e})},iA=(t=100)=>{const e=t/100,n=new W.ColorMatrixFilter,r=1-.3*e,i=.15*e;return n.matrix=[r*.9,.1*e,0,0,i,.1*e,r*.9,.1*e,0,i,0,.1*e,r*.9,0,i,0,0,0,1,0],n},oA=(t=100)=>{const e=t/100;return new ne.OldFilmFilter({sepia:.4*e,noise:.2*e,scratch:.3*e,scratchDensity:.2*e,vignetting:.3*e})},sA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1.1-.1*(1-n),.1*n,0,0,.05*n,.05*n,1.05-.05*(1-n),.05*n,0,.03*n,0,.1*n,.9+.1*(1-n),0,.02*n,0,0,0,1,0],e},aA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1.2*n+(1-n),.2*n,0,0,.1*n,.1*n,1*n+(1-n),.1*n,0,.05*n,0,.1*n,.7*n+(1-n),0,0,0,0,0,1,0],e},cA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,0,-.1*n,0,0,-.05*n,1+.05*n,.1*n,0,0,-.1*n,.1*n,1+.15*n,0,0,0,0,0,1,0],e},lA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({contrast:1+.5*e,brightness:1-.1*e,saturation:1+.2*e,gamma:1-.2*e})},uA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),0,.1*n,0,-.05*n,0,.9+.1*(1-n),.15*n,0,-.05*n,.1*n,.1*n,1+.1*n,0,0,0,0,0,1,0],e},fA=(t=100)=>{const e=t/100,n=new ne.HslAdjustmentFilter({saturation:-1*e,lightness:-.1*e}),r=new ne.AdjustmentFilter({contrast:1+.4*e,gamma:.9});return[n,r]},dA=(t=100)=>{const e=t/100,n=new ne.KawaseBlurFilter(2*e,1,!0),r=new ne.AdjustmentFilter({brightness:1+.05*e,contrast:1-.1*e});return[n,r]},hA=(t=100,e={})=>{const n=(e.intensity??t)/100,r=(e.spin??10)/100,i=(e.grain??30)/100*n,o=(e.glow??40)/100*n,s=(e.gloom??35)/100*n;e.centerX,e.centerY;const a=new ne.HslAdjustmentFilter({saturation:-.05-.14*s,lightness:-.03-.11*s}),l=new ne.AdjustmentFilter({contrast:1-.05-.1*s,gamma:.97-.05*s,brightness:1-.025*s}),c=new ne.AdvancedBloomFilter({bloomScale:.22+.8*o,threshold:.54-.16*o,blur:1.5+2.5*o,brightness:1+.04*o,quality:3});c.__vfxDreamy="bloom",c.__baseBloomScale=c.bloomScale,c.__baseBrightness=c.brightness,c.__spinSpeed=r;const u=new ne.KawaseBlurFilter(.35+1*o,1,!0);u.__vfxDreamy="blur",u.__baseBlur=.35+1*o,u.__spinSpeed=r;const f=new ne.OldFilmFilter({noise:.05+.4*i,vignetting:.18+.55*s,vignettingAlpha:.32+.4*s,vignettingBlur:.4,sepia:0,scratch:0,scratchDensity:0});return f.__vfxDreamy="grain",f.__baseVignetting=f.vignetting,f.__spinSpeed=r,[a,l,c,u,f]},pA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({brightness:1-.3*e,contrast:1+.2*e,saturation:1-.3*e,gamma:.8+.2*(1-e)})},mA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({contrast:1+.3*e,saturation:1+.4*e,brightness:1+.1*e})},gA=(t=100)=>{const e=t/100;return new ne.AdjustmentFilter({saturation:1+.6*e,contrast:1+.3*e,brightness:1+.1*e})},yA=(t=100)=>{const e=new W.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),.1*n,.1*n,0,.1*n,.1*n,.9+.1*(1-n),.1*n,0,.1*n,.1*n,.1*n,.9+.1*(1-n),0,.1*n,0,0,0,1,0],e},_A=(t=50,e={})=>{if(e.horizontalCount!=null||e.verticalCount!=null){const i=Math.max(1,e.horizontalCount??20),o=Math.max(1,e.verticalCount??20);return new ne.PixelateFilter([i,o])}const n=t/100,r=Math.max(1,Math.floor(1+31*n));return new ne.PixelateFilter(r)},bA=(t=50,e={})=>{if(e.radiusPerRow!=null||e.sizePerRow!=null){const s=e.radiusPerRow??5,a=e.sizePerRow??0,l=Math.max(1,s+a),c=new ne.PixelateFilter(l),u=new ne.ZoomBlurFilter({strength:.01*s,innerRadius:40+(20-s)*5,radius:-1});return[c,u]}const n=t/100,r=Math.max(1,Math.floor(1+20*n)),i=new ne.PixelateFilter(r),o=new ne.ZoomBlurFilter({strength:.05*n,innerRadius:100,radius:-1});return[i,o]},xA=(t=50,e={})=>{const n=new ne.CrossHatchFilter;if(e.horizontalOffset!=null||e.horizontalCuts!=null){const o=e.horizontalOffset??7,s=e.horizontalCuts??5,a=e.verticalOffset??50,l=e.variation??100;return[new ne.AdjustmentFilter({contrast:1+s/20*.6,brightness:1+o/100*.15,saturation:1-a/100*.7,gamma:1-l/100*.3+.15}),n]}const r=t/100;return[new ne.AdjustmentFilter({contrast:1+.3*r,saturation:1-.5*r}),n]},vA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.scale??62)/100,i=(e.variation??50)/100,o=new ne.BulgePinchFilter({radius:100+400*r,strength:.5*n,center:[.5,.5]}),s=new ne.TwistFilter({angle:3*n*i,radius:200+400*r,padding:20});return[o,s]},TA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.blending??50)/100,i=Math.max(1,Math.floor(1+4*n)),o=new ne.OutlineFilter(i,0,1);return[new ne.AdjustmentFilter({contrast:1+.4*r,saturation:1-.3*r}),o]},EA=(t=50,e={})=>{if(e.globalBlur!=null||e.numberOfDots!=null){const i=(e.globalBlur??30)/100,o=e.numberOfDots??30,s=Math.max(1,Math.floor(1+o/100*9)),a=new ne.DotFilter(s,45);return i>.01?[new ne.KawaseBlurFilter(1+4*i,1,!0),a]:a}const n=t/100,r=Math.max(1,Math.floor(2+6*n));return new ne.DotFilter(r,45)},SA=(t=50,e={})=>{const n=e.lineWidth??5,r=(e.curvature??50)/100,i=(e.lineContrast??30)/100;return new ne.CRTFilter({lineWidth:n,lineContrast:i*.5,curvature:r*10,noise:.1,noiseSize:1,vignetting:.2,vignettingAlpha:.5,vignettingBlur:.3,seed:Math.random()})},wA=(t=50,e={})=>{const r=(10-(e.numberOfLevels??Math.max(2,Math.floor(10-8*(t/100)))))/8,i=1+1.5*r,o=(1-i)/2,s=new W.ColorMatrixFilter;s.matrix=[i,0,0,0,o,0,i,0,0,o,0,0,i,0,o,0,0,0,1,0];const a=new ne.AdjustmentFilter({saturation:1+.5*r});return[s,a]},AA=(t=50,e={})=>{const n=e.roughDistortion??t/100*10,r=e.fineDistortion??t/100*5,i=e.verticalOffset??t/100*5,o=e.variance??t/100*5,s=new ne.GlitchFilter({slices:Math.max(3,Math.floor(3+n*1.5)),offset:5+n*4,direction:0,fillMode:2,average:!1,seed:Math.random()}),a=new ne.RGBSplitFilter({red:{x:-(1+r*.8),y:i*.5},green:{x:0,y:0},blue:{x:1+r*.8,y:-(i*.5)}}),l=new ne.AdjustmentFilter({contrast:1+o*.05,brightness:1-o*.02});return[s,a,l]},OA=(t=50,e={})=>{const n=e.angleOfPattern??5,r=e.scaleOfPattern??Math.max(1,Math.floor(2+8*(t/100))),i=Math.max(1,Math.floor(1+r/100*9)),o=new ne.DotFilter(i,n);return[new ne.AdjustmentFilter({contrast:1+.15}),o]},CA=(t=50,e={})=>{const n=e.charSize??Math.max(2,Math.floor(2+18*(t/100)));return new ne.AsciiFilter(n)},RA=(t=50,e={})=>{const n=(e.strength??t)/100;return new ne.EmbossFilter(2+8*n)},IA=(t=50,e={})=>{const n=(e.scaleOfPattern??50)/100,r=new ne.HslAdjustmentFilter({saturation:-1,lightness:0}),i=new ne.AdjustmentFilter({contrast:1+.5+1.5*n,brightness:1+.15*n,gamma:.6+.4*(1-n)}),o=new ne.CrossHatchFilter;return[r,i,o]},MA=(t=50,e={})=>{const n=e.distance??t/100*10,i=(e.shiftDirection??3)/10*Math.PI,o=n*Math.cos(i),s=n*Math.sin(i);return new ne.RGBSplitFilter({red:{x:-o,y:-s},green:{x:0,y:0},blue:{x:o,y:s}})},LA=(t=50,e={})=>{const n=e.mirroredSide??1,r=.5,i=new ne.ReflectionFilter({mirror:!0,boundary:r,amplitude:[0,0],waveLength:[0,0]});return n===0||n===1?i.boundary=.5:n===2?i.boundary=.3:i.boundary=.7,i},PA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.darkening??30)/100,i=e.bloom??4,o=new ne.GlowFilter({distance:i*3+10*n,outerStrength:1+3*n,innerStrength:.5+1.5*n,color:16777215,quality:.3});return r>.01?[new ne.AdjustmentFilter({brightness:1-.4*r,gamma:1-.3*r}),o]:o},NA=(t=50)=>{const e=t/100;return new ne.OldFilmFilter({vignetting:.3+.7*e,vignettingAlpha:.5+.5*e,vignettingBlur:.3,sepia:0,noise:0,scratch:0,scratchDensity:0})},kA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.position??40)/100,i=Math.floor(400*r);return new ne.TiltShiftFilter({blur:15+45*n,gradientBlur:400+800*n,start:{x:0,y:i},end:{x:600,y:i}})},DA=(t=50,e={})=>{const n=(e.intensity??t)/100;return new ne.ZoomBlurFilter({strength:.05+.15*n,center:[.5,.5],innerRadius:50+100*(1-n),radius:-1})},FA=(t=50)=>{const n=.3+.7*(t/100);return new ne.ConvolutionFilter([0,-n,0,-n,1+4*n,-n,0,-n,0])},BA=(t=50)=>{const e=t/100;return new ne.HslAdjustmentFilter({hue:180*e,saturation:0,lightness:0,colorize:!1})},UA=(t=50)=>{const e=t/100,n=new W.ColorMatrixFilter,r=1-.8*e;return n.matrix=[1,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,-.5*e,0,1,0],n},GA=(t=50,e={})=>{const n=(e.intensity??t)/100,r=e.angle??30,i=(e.lacunarity??25)/10;return new ne.GodrayFilter({gain:.3+.7*n,lacunarity:i,angle:r,parallel:!0,time:0})},jA=(t=50,e={})=>{const n=e.velocityX??t/100*20,r=e.velocityY??0;return new ne.MotionBlurFilter([n,r],5)},HA=(t=50,e={})=>{const n=(e.bloomStrength??t)/100,r=(e.threshold??50)/100,i=(e.bloomBlur??50)/100;return new ne.AdvancedBloomFilter({bloomScale:.5+2.5*n,threshold:r,blur:2+12*i,brightness:1+.5*n,quality:4})},YA=(t=50,e={})=>{const n=t/100,r=(e.dots??50)/100,i=(e.contrast??70)/100,o=(e.offset??20)/100,s=(e.texture??30)/100,a=(e.rasterize??0)/100,l=e.primaryColor??"#00BFFF",c=e.accentColor??"#FF44AA",u=[],f=new W.Color(l),d=new W.Color(c),h=f.toRgb(),p=d.toRgb(),m=[h.r,h.g,h.b],g=[p.r,p.g,p.b],y=m[0]-g[0],b=m[1]-g[1],x=m[2]-g[2],v=.299,T=.587,w=.114,O=n,C=new W.ColorMatrixFilter;if(C.matrix=[1+(g[0]-1+y*v)*O,y*T*O,y*w*O,0,g[0]*O,b*v*O,1+(g[1]-1+b*T)*O,b*w*O,0,g[1]*O,x*v*O,x*T*O,1+(g[2]-1+x*w)*O,0,g[2]*O,0,0,0,1,0],u.push(C),i>.05){const A=new ne.AdjustmentFilter({contrast:1+.4*i+.3*n,saturation:1+.3*n,brightness:1+.05*n,gamma:1-.1*n});u.push(A)}const R=Math.max(1,Math.floor(1+(r*.8+n*.2)*9)),P=new ne.DotFilter(R,45);if(u.push(P),o>.05){const A=1+o*6,L=new ne.RGBSplitFilter({red:{x:-(A*.7),y:A*.3},green:{x:0,y:0},blue:{x:A*.7,y:-(A*.3)}});u.push(L)}return a>.05&&u.push(new ne.CrossHatchFilter),s>.05&&u.push(new W.NoiseFilter(s*.25)),u},Pm=(t,e=null,n=100,r={})=>{if(typeof t=="string"&&Vw(t))return Lm[t].create(n);switch(t){case ue.Warm:case"Warm":return tA(n);case ue.Cool:case"Cool":return nA(n);case ue.BlackAndWhite:case"BlackAndWhite":return Kw(n);case ue.Vivid:case"Vivid":return rA(n);case ue.Fade:case"Fade":return iA(n);case ue.Sepia:case"Sepia":return Zw(n);case ue.RetroVintage:case"RetroVintage":return $w(n);case ue.OldFilm:case"OldFilm":return oA(n);case ue.Polaroid:case"Polaroid":return sA(n);case ue.Seventies:case"70s":return aA(n);case ue.Cinematic:case"Cinematic":return cA(n);case ue.Dramatic:case"Dramatic":return lA(n);case ue.Moody:case"Moody":return uA(n);case ue.FilmNoir:case"FilmNoir":return fA(n);case ue.SoftFocus:case"SoftFocus":return dA(n);case ue.Dreamy:case"Dreamy":case ue.DreamyVintage:case"DreamyVintage":return hA(n,r);case ue.DarkMood:case"DarkMood":return pA(n);case ue.HDR:case"HDR":return mA(n);case ue.Pop:case"Pop":return gA(n);case ue.Pastel:case"Pastel":return yA(n);case ue.Neon:case"Neon":{let i=65535;if(e!=null)if(typeof e=="string")try{e.startsWith("#")?i=parseInt(e.replace("#",""),16):e.startsWith("0x")?i=parseInt(e,16):i=new W.Color(e).toNumber()}catch{i=65535}else typeof e=="number"&&(i=e);return Qw(i,n)}case ue.Pixelize:case"Pixelize":return _A(n,r);case ue.RadialPixel:case"RadialPixel":return bA(n,r);case ue.CrossCut:case"CrossCut":return xA(n,r);case ue.Liquid:case"Liquid":return vA(n,r);case ue.Outliner:case"Outliner":return TA(n,r);case ue.DotPattern:case"DotPattern":return EA(n,r);case ue.CRT:case"CRT":return SA(n,r);case ue.Posterize:case"Posterize":return wA(n,r);case ue.TVGlitch:case"TVGlitch":return AA(n,r);case ue.HalfTone:case"HalfTone":return OA(n,r);case ue.Linocut:case"Linocut":return IA(n,r);case ue.Shifter:case"Shifter":return MA(n,r);case ue.Mirror:case"Mirror":return LA(n,r);case ue.ASCII:case"ASCII":return CA(n,r);case ue.Emboss:case"Emboss":return RA(n,r);case ue.Glow:case"Glow":return PA(n,r);case ue.Vignette:case"Vignette":return NA(n);case ue.TiltShift:case"TiltShift":return kA(n,r);case ue.ExtrudeBlur:case"ExtrudeBlur":return DA(n,r);case ue.Sharpie:case"Sharpie":return FA(n);case ue.Recolor:case"Recolor":return BA(n);case ue.GreenScreen:case"GreenScreen":return UA(n);case ue.Godray:case"Godray":return GA(n,r);case ue.MotionBlur:case"MotionBlur":return jA(n,r);case ue.AdvancedBloom:case"AdvancedBloom":return HA(n,r);case ue.RetroHalfTone:case"RetroHalfTone":return YA(n,r);case ue.NightVision:case"NightVision":return Jw();case ue.CYAN:case"CYAN":return eA();case ue.Normal:case ue.None:default:return null}},za=(t={})=>{const{effect:e=ue.Normal,neonColor:n=null,effectIntensity:r=100,effectParams:i={},neonGlowIntensity:o=null}=t,a=Pm(e,n,o??r,i);return{effectFilter:a,blackAndWhiteFilter:e===ue.BlackAndWhite?a:null,sepiaFilter:e===ue.Sepia?a:null,retroVintageFilter:e===ue.RetroVintage?a:null,nightVisionFilter:e===ue.NightVision?a:null,cyanFilter:e===ue.CYAN?a:null,neonFilter:e===ue.Neon?a:null}},XA=za,WA=`
1370
+ `,lO=(t,e=1)=>Math.max(0,Math.min(100,t))/100*e,xr={WaveTearDown:{shaderName:"vfx-wave-tear-down",direction:new Float32Array([0,1])},WaveTearUp:{shaderName:"vfx-wave-tear-up",direction:new Float32Array([0,-1])},WaveTearAcross:{shaderName:"vfx-wave-tear-across",direction:new Float32Array([1,.4])}},Wt=(t,e,n,r,i)=>new JA({fragment:ZA(t),name:e,intensity:lO(n,r),uniforms:i}),pc=(t,e=50)=>Wt(aO,t.shaderName,e,1,{uDirection:{value:t.direction,type:"vec2<f32>"}}),g0={VHS:{shaderName:"vfx-vhs",defaultIntensity:50,create:(t=50)=>Wt(QA,"vfx-vhs",t,1.2)},GlitchWave:{shaderName:"vfx-glitch-wave",defaultIntensity:50,create:(t=50)=>Wt(eO,"vfx-glitch-wave",t,1.4)},LightLeak:{shaderName:"vfx-light-leak",defaultIntensity:50,create:(t=50)=>Wt(tO,"vfx-light-leak",t,1.3)},FilmGrain:{shaderName:"vfx-film-grain",defaultIntensity:55,create:(t=50)=>Wt(nO,"vfx-film-grain",t,1.2)},ChromaticWave:{shaderName:"vfx-chromatic-wave",defaultIntensity:50,create:(t=50)=>Wt(rO,"vfx-chromatic-wave",t,1.5)},LiquidGlass:{shaderName:"vfx-liquid-glass",defaultIntensity:65,create:(t=50)=>Wt(iO,"vfx-liquid-glass",t,1.25)},BrokenGlass:{shaderName:"vfx-broken-glass",defaultIntensity:55,create:(t=50)=>Wt(oO,"vfx-broken-glass",t,1)},Comic:{shaderName:"vfx-comic",defaultIntensity:60,create:(t=50)=>Wt(sO,"vfx-comic",t,1)},WaveTearDown:{shaderName:xr.WaveTearDown.shaderName,defaultIntensity:100,create:(t=50)=>pc(xr.WaveTearDown,t)},WaveTearUp:{shaderName:xr.WaveTearUp.shaderName,defaultIntensity:100,create:(t=50)=>pc(xr.WaveTearUp,t)},WaveTearAcross:{shaderName:xr.WaveTearAcross.shaderName,defaultIntensity:100,create:(t=50)=>pc(xr.WaveTearAcross,t)},WaveBrush:{shaderName:"vfx-wave-brush",defaultIntensity:100,create:(t=50)=>Wt(cO,"vfx-wave-brush",t,1)}},uO=t=>t in g0,dO=(t=100)=>{const e=t/100;return new oe.HslAdjustmentFilter({hue:0,saturation:-1*e,lightness:0})},fO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[.393*n+(1-n),.769*n,.189*n,0,0,.349*n,.686*n+(1-n),.168*n,0,0,.272*n,.534*n,.131*n+(1-n),0,0,0,0,0,1,0],e},hO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100,r=[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0];for(let i=0;i<20;i++)e.matrix[i]=i===0?r[i]*1.1*n+(1-n):r[i]*n+(i<15?1-n:0);return e},pO=()=>{const t=new oe.GlowFilter({distance:10,outerStrength:1,innerStrength:1,color:65280,quality:.5}),e=new K.ColorMatrixFilter;return e.matrix=[.1,.5,.1,0,0,.1,.8,.1,0,0,.1,.5,.1,0,0,0,0,0,1,0],[t,e]},mO=(t=65535,e=50)=>{const n=e/50,r=new oe.GlowFilter({distance:8*n,outerStrength:1.5*n,innerStrength:.8*n,color:t,quality:.6}),i=new oe.GlowFilter({distance:16*n,outerStrength:.8*n,innerStrength:0,color:t,quality:.4});return[r,i]},gO=()=>{const t=new K.ColorMatrixFilter;return t.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],t},yO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,.05*n,0,0,.05*n,.05*n,1+.05*n,0,0,.02*n,0,0,1-.15*n,0,0,0,0,0,1,0],e},_O=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[1-.1*n,0,.05*n,0,0,0,1,.05*n,0,0,.05*n,.05*n,1+.15*n,0,.05*n,0,0,0,1,0],e},bO=(t=100)=>{const e=t/100;return new oe.AdjustmentFilter({saturation:1+.5*e,contrast:1+.2*e,brightness:1+.05*e})},vO=(t=100)=>{const e=t/100,n=new K.ColorMatrixFilter,r=1-.3*e,i=.15*e;return n.matrix=[r*.9,.1*e,0,0,i,.1*e,r*.9,.1*e,0,i,0,.1*e,r*.9,0,i,0,0,0,1,0],n},xO=(t=100)=>{const e=t/100;return new oe.OldFilmFilter({sepia:.4*e,noise:.2*e,scratch:.3*e,scratchDensity:.2*e,vignetting:.3*e})},TO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[1.1-.1*(1-n),.1*n,0,0,.05*n,.05*n,1.05-.05*(1-n),.05*n,0,.03*n,0,.1*n,.9+.1*(1-n),0,.02*n,0,0,0,1,0],e},EO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[1.2*n+(1-n),.2*n,0,0,.1*n,.1*n,1*n+(1-n),.1*n,0,.05*n,0,.1*n,.7*n+(1-n),0,0,0,0,0,1,0],e},SO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[1+.1*n,0,-.1*n,0,0,-.05*n,1+.05*n,.1*n,0,0,-.1*n,.1*n,1+.15*n,0,0,0,0,0,1,0],e},wO=(t=100)=>{const e=t/100;return new oe.AdjustmentFilter({contrast:1+.5*e,brightness:1-.1*e,saturation:1+.2*e,gamma:1-.2*e})},AO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),0,.1*n,0,-.05*n,0,.9+.1*(1-n),.15*n,0,-.05*n,.1*n,.1*n,1+.1*n,0,0,0,0,0,1,0],e},OO=(t=100)=>{const e=t/100,n=new oe.HslAdjustmentFilter({saturation:-1*e,lightness:-.1*e}),r=new oe.AdjustmentFilter({contrast:1+.4*e,gamma:.9});return[n,r]},MO=(t=100)=>{const e=t/100,n=new oe.KawaseBlurFilter(2*e,1,!0),r=new oe.AdjustmentFilter({brightness:1+.05*e,contrast:1-.1*e});return[n,r]},IO=(t=100,e={})=>{const n=(e.intensity??t)/100,r=(e.spin??10)/100,i=(e.grain??30)/100*n,o=(e.glow??40)/100*n,s=(e.gloom??35)/100*n;e.centerX,e.centerY;const a=new oe.HslAdjustmentFilter({saturation:-.05-.14*s,lightness:-.03-.11*s}),l=new oe.AdjustmentFilter({contrast:1-.05-.1*s,gamma:.97-.05*s,brightness:1-.025*s}),c=new oe.AdvancedBloomFilter({bloomScale:.22+.8*o,threshold:.54-.16*o,blur:1.5+2.5*o,brightness:1+.04*o,quality:3});c.__vfxDreamy="bloom",c.__baseBloomScale=c.bloomScale,c.__baseBrightness=c.brightness,c.__spinSpeed=r;const u=new oe.KawaseBlurFilter(.35+1*o,1,!0);u.__vfxDreamy="blur",u.__baseBlur=.35+1*o,u.__spinSpeed=r;const f=new oe.OldFilmFilter({noise:.05+.4*i,vignetting:.18+.55*s,vignettingAlpha:.32+.4*s,vignettingBlur:.4,sepia:0,scratch:0,scratchDensity:0});return f.__vfxDreamy="grain",f.__baseVignetting=f.vignetting,f.__spinSpeed=r,[a,l,c,u,f]},CO=(t=100)=>{const e=t/100;return new oe.AdjustmentFilter({brightness:1-.3*e,contrast:1+.2*e,saturation:1-.3*e,gamma:.8+.2*(1-e)})},RO=(t=100)=>{const e=t/100;return new oe.AdjustmentFilter({contrast:1+.3*e,saturation:1+.4*e,brightness:1+.1*e})},LO=(t=100)=>{const e=t/100;return new oe.AdjustmentFilter({saturation:1+.6*e,contrast:1+.3*e,brightness:1+.1*e})},kO=(t=100)=>{const e=new K.ColorMatrixFilter,n=t/100;return e.matrix=[.9+.1*(1-n),.1*n,.1*n,0,.1*n,.1*n,.9+.1*(1-n),.1*n,0,.1*n,.1*n,.1*n,.9+.1*(1-n),0,.1*n,0,0,0,1,0],e},PO=(t=50,e={})=>{if(e.horizontalCount!=null||e.verticalCount!=null){const i=Math.max(1,e.horizontalCount??20),o=Math.max(1,e.verticalCount??20);return new oe.PixelateFilter([i,o])}const n=t/100,r=Math.max(1,Math.floor(1+31*n));return new oe.PixelateFilter(r)},DO=(t=50,e={})=>{if(e.radiusPerRow!=null||e.sizePerRow!=null){const s=e.radiusPerRow??5,a=e.sizePerRow??0,l=Math.max(1,s+a),c=new oe.PixelateFilter(l),u=new oe.ZoomBlurFilter({strength:.01*s,innerRadius:40+(20-s)*5,radius:-1});return[c,u]}const n=t/100,r=Math.max(1,Math.floor(1+20*n)),i=new oe.PixelateFilter(r),o=new oe.ZoomBlurFilter({strength:.05*n,innerRadius:100,radius:-1});return[i,o]},NO=(t=50,e={})=>{const n=new oe.CrossHatchFilter;if(e.horizontalOffset!=null||e.horizontalCuts!=null){const o=e.horizontalOffset??7,s=e.horizontalCuts??5,a=e.verticalOffset??50,l=e.variation??100;return[new oe.AdjustmentFilter({contrast:1+s/20*.6,brightness:1+o/100*.15,saturation:1-a/100*.7,gamma:1-l/100*.3+.15}),n]}const r=t/100;return[new oe.AdjustmentFilter({contrast:1+.3*r,saturation:1-.5*r}),n]},FO=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.scale??62)/100,i=(e.variation??50)/100,o=new oe.BulgePinchFilter({radius:100+400*r,strength:.5*n,center:[.5,.5]}),s=new oe.TwistFilter({angle:3*n*i,radius:200+400*r,padding:20});return[o,s]},BO=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.blending??50)/100,i=Math.max(1,Math.floor(1+4*n)),o=new oe.OutlineFilter(i,0,1);return[new oe.AdjustmentFilter({contrast:1+.4*r,saturation:1-.3*r}),o]},UO=(t=50,e={})=>{if(e.globalBlur!=null||e.numberOfDots!=null){const i=(e.globalBlur??30)/100,o=e.numberOfDots??30,s=Math.max(1,Math.floor(1+o/100*9)),a=new oe.DotFilter(s,45);return i>.01?[new oe.KawaseBlurFilter(1+4*i,1,!0),a]:a}const n=t/100,r=Math.max(1,Math.floor(2+6*n));return new oe.DotFilter(r,45)},GO=(t=50,e={})=>{const n=e.lineWidth??5,r=(e.curvature??50)/100,i=(e.lineContrast??30)/100;return new oe.CRTFilter({lineWidth:n,lineContrast:i*.5,curvature:r*10,noise:.1,noiseSize:1,vignetting:.2,vignettingAlpha:.5,vignettingBlur:.3,seed:Math.random()})},jO=(t=50,e={})=>{const r=(10-(e.numberOfLevels??Math.max(2,Math.floor(10-8*(t/100)))))/8,i=1+1.5*r,o=(1-i)/2,s=new K.ColorMatrixFilter;s.matrix=[i,0,0,0,o,0,i,0,0,o,0,0,i,0,o,0,0,0,1,0];const a=new oe.AdjustmentFilter({saturation:1+.5*r});return[s,a]},HO=(t=50,e={})=>{const n=e.roughDistortion??t/100*10,r=e.fineDistortion??t/100*5,i=e.verticalOffset??t/100*5,o=e.variance??t/100*5,s=new oe.GlitchFilter({slices:Math.max(3,Math.floor(3+n*1.5)),offset:5+n*4,direction:0,fillMode:2,average:!1,seed:Math.random()}),a=new oe.RGBSplitFilter({red:{x:-(1+r*.8),y:i*.5},green:{x:0,y:0},blue:{x:1+r*.8,y:-(i*.5)}}),l=new oe.AdjustmentFilter({contrast:1+o*.05,brightness:1-o*.02});return[s,a,l]},YO=(t=50,e={})=>{const n=e.angleOfPattern??5,r=e.scaleOfPattern??Math.max(1,Math.floor(2+8*(t/100))),i=Math.max(1,Math.floor(1+r/100*9)),o=new oe.DotFilter(i,n);return[new oe.AdjustmentFilter({contrast:1+.15}),o]},WO=(t=50,e={})=>{const n=e.charSize??Math.max(2,Math.floor(2+18*(t/100)));return new oe.AsciiFilter(n)},XO=(t=50,e={})=>{const n=(e.strength??t)/100;return new oe.EmbossFilter(2+8*n)},zO=(t=50,e={})=>{const n=(e.scaleOfPattern??50)/100,r=new oe.HslAdjustmentFilter({saturation:-1,lightness:0}),i=new oe.AdjustmentFilter({contrast:1+.5+1.5*n,brightness:1+.15*n,gamma:.6+.4*(1-n)}),o=new oe.CrossHatchFilter;return[r,i,o]},qO=(t=50,e={})=>{const n=e.distance??t/100*10,i=(e.shiftDirection??3)/10*Math.PI,o=n*Math.cos(i),s=n*Math.sin(i);return new oe.RGBSplitFilter({red:{x:-o,y:-s},green:{x:0,y:0},blue:{x:o,y:s}})},VO=(t=50,e={})=>{const n=e.mirroredSide??1,r=.5,i=new oe.ReflectionFilter({mirror:!0,boundary:r,amplitude:[0,0],waveLength:[0,0]});return n===0||n===1?i.boundary=.5:n===2?i.boundary=.3:i.boundary=.7,i},KO=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.darkening??30)/100,i=e.bloom??4,o=new oe.GlowFilter({distance:i*3+10*n,outerStrength:1+3*n,innerStrength:.5+1.5*n,color:16777215,quality:.3});return r>.01?[new oe.AdjustmentFilter({brightness:1-.4*r,gamma:1-.3*r}),o]:o},$O=(t=50)=>{const e=t/100;return new oe.OldFilmFilter({vignetting:.3+.7*e,vignettingAlpha:.5+.5*e,vignettingBlur:.3,sepia:0,noise:0,scratch:0,scratchDensity:0})},ZO=(t=50,e={})=>{const n=(e.intensity??t)/100,r=(e.position??40)/100,i=Math.floor(400*r);return new oe.TiltShiftFilter({blur:15+45*n,gradientBlur:400+800*n,start:{x:0,y:i},end:{x:600,y:i}})},JO=(t=50,e={})=>{const n=(e.intensity??t)/100;return new oe.ZoomBlurFilter({strength:.05+.15*n,center:[.5,.5],innerRadius:50+100*(1-n),radius:-1})},QO=(t=50)=>{const n=.3+.7*(t/100);return new oe.ConvolutionFilter([0,-n,0,-n,1+4*n,-n,0,-n,0])},eM=(t=50)=>{const e=t/100;return new oe.HslAdjustmentFilter({hue:180*e,saturation:0,lightness:0,colorize:!1})},tM=(t=50)=>{const e=t/100,n=new K.ColorMatrixFilter,r=1-.8*e;return n.matrix=[1,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,-.5*e,0,1,0],n},nM=(t=50,e={})=>{const n=(e.intensity??t)/100,r=e.angle??30,i=(e.lacunarity??25)/10;return new oe.GodrayFilter({gain:.3+.7*n,lacunarity:i,angle:r,parallel:!0,time:0})},rM=(t=50,e={})=>{const n=e.velocityX??t/100*20,r=e.velocityY??0;return new oe.MotionBlurFilter([n,r],5)},iM=(t=50,e={})=>{const n=(e.bloomStrength??t)/100,r=(e.threshold??50)/100,i=(e.bloomBlur??50)/100;return new oe.AdvancedBloomFilter({bloomScale:.5+2.5*n,threshold:r,blur:2+12*i,brightness:1+.5*n,quality:4})},oM=(t=50,e={})=>{const n=t/100,r=(e.dots??50)/100,i=(e.contrast??70)/100,o=(e.offset??20)/100,s=(e.texture??30)/100,a=(e.rasterize??0)/100,l=e.primaryColor??"#00BFFF",c=e.accentColor??"#FF44AA",u=[],f=new K.Color(l),d=new K.Color(c),h=f.toRgb(),m=d.toRgb(),p=[h.r,h.g,h.b],g=[m.r,m.g,m.b],y=p[0]-g[0],_=p[1]-g[1],v=p[2]-g[2],x=.299,E=.587,T=.114,A=n,M=new K.ColorMatrixFilter;if(M.matrix=[1+(g[0]-1+y*x)*A,y*E*A,y*T*A,0,g[0]*A,_*x*A,1+(g[1]-1+_*E)*A,_*T*A,0,g[1]*A,v*x*A,v*E*A,1+(g[2]-1+v*T)*A,0,g[2]*A,0,0,0,1,0],u.push(M),i>.05){const w=new oe.AdjustmentFilter({contrast:1+.4*i+.3*n,saturation:1+.3*n,brightness:1+.05*n,gamma:1-.1*n});u.push(w)}const C=Math.max(1,Math.floor(1+(r*.8+n*.2)*9)),k=new oe.DotFilter(C,45);if(u.push(k),o>.05){const w=1+o*6,L=new oe.RGBSplitFilter({red:{x:-(w*.7),y:w*.3},green:{x:0,y:0},blue:{x:w*.7,y:-(w*.3)}});u.push(L)}return a>.05&&u.push(new oe.CrossHatchFilter),s>.05&&u.push(new K.NoiseFilter(s*.25)),u},y0=(t,e=null,n=100,r={})=>{if(typeof t=="string"&&uO(t))return g0[t].create(n);switch(t){case pe.Warm:case"Warm":return yO(n);case pe.Cool:case"Cool":return _O(n);case pe.BlackAndWhite:case"BlackAndWhite":return dO(n);case pe.Vivid:case"Vivid":return bO(n);case pe.Fade:case"Fade":return vO(n);case pe.Sepia:case"Sepia":return fO(n);case pe.RetroVintage:case"RetroVintage":return hO(n);case pe.OldFilm:case"OldFilm":return xO(n);case pe.Polaroid:case"Polaroid":return TO(n);case pe.Seventies:case"70s":return EO(n);case pe.Cinematic:case"Cinematic":return SO(n);case pe.Dramatic:case"Dramatic":return wO(n);case pe.Moody:case"Moody":return AO(n);case pe.FilmNoir:case"FilmNoir":return OO(n);case pe.SoftFocus:case"SoftFocus":return MO(n);case pe.Dreamy:case"Dreamy":case pe.DreamyVintage:case"DreamyVintage":return IO(n,r);case pe.DarkMood:case"DarkMood":return CO(n);case pe.HDR:case"HDR":return RO(n);case pe.Pop:case"Pop":return LO(n);case pe.Pastel:case"Pastel":return kO(n);case pe.Neon:case"Neon":{let i=65535;if(e!=null)if(typeof e=="string")try{e.startsWith("#")?i=parseInt(e.replace("#",""),16):e.startsWith("0x")?i=parseInt(e,16):i=new K.Color(e).toNumber()}catch{i=65535}else typeof e=="number"&&(i=e);return mO(i,n)}case pe.Pixelize:case"Pixelize":return PO(n,r);case pe.RadialPixel:case"RadialPixel":return DO(n,r);case pe.CrossCut:case"CrossCut":return NO(n,r);case pe.Liquid:case"Liquid":return FO(n,r);case pe.Outliner:case"Outliner":return BO(n,r);case pe.DotPattern:case"DotPattern":return UO(n,r);case pe.CRT:case"CRT":return GO(n,r);case pe.Posterize:case"Posterize":return jO(n,r);case pe.TVGlitch:case"TVGlitch":return HO(n,r);case pe.HalfTone:case"HalfTone":return YO(n,r);case pe.Linocut:case"Linocut":return zO(n,r);case pe.Shifter:case"Shifter":return qO(n,r);case pe.Mirror:case"Mirror":return VO(n,r);case pe.ASCII:case"ASCII":return WO(n,r);case pe.Emboss:case"Emboss":return XO(n,r);case pe.Glow:case"Glow":return KO(n,r);case pe.Vignette:case"Vignette":return $O(n);case pe.TiltShift:case"TiltShift":return ZO(n,r);case pe.ExtrudeBlur:case"ExtrudeBlur":return JO(n,r);case pe.Sharpie:case"Sharpie":return QO(n);case pe.Recolor:case"Recolor":return eM(n);case pe.GreenScreen:case"GreenScreen":return tM(n);case pe.Godray:case"Godray":return nM(n,r);case pe.MotionBlur:case"MotionBlur":return rM(n,r);case pe.AdvancedBloom:case"AdvancedBloom":return iM(n,r);case pe.RetroHalfTone:case"RetroHalfTone":return oM(n,r);case pe.NightVision:case"NightVision":return pO();case pe.CYAN:case"CYAN":return gO();case pe.Normal:case pe.None:default:return null}},mc=(t={})=>{const{effect:e=pe.Normal,neonColor:n=null,effectIntensity:r=100,effectParams:i={},neonGlowIntensity:o=null}=t,a=y0(e,n,o??r,i);return{effectFilter:a,blackAndWhiteFilter:e===pe.BlackAndWhite?a:null,sepiaFilter:e===pe.Sepia?a:null,retroVintageFilter:e===pe.RetroVintage?a:null,nightVisionFilter:e===pe.NightVision?a:null,cyanFilter:e===pe.CYAN?a:null,neonFilter:e===pe.Neon?a:null}},sM=mc,aM=`
1371
1371
  precision highp float;
1372
1372
 
1373
1373
  in vec2 vTextureCoord;
@@ -1378,7 +1378,7 @@ uniform sampler2D uTexture;
1378
1378
  void main(void) {
1379
1379
  finalColor = texture(uTexture, vTextureCoord);
1380
1380
  }
1381
- `,zA=t=>{const e=B.GlProgram.from({vertex:no,fragment:WA,name:"native-blend-passthrough"}),n=new B.Filter({glProgram:e});return n.blendMode=t,n},qA={overlay:B.OverlayBlend,darken:B.DarkenBlend,lighten:B.LightenBlend,"color-dodge":B.ColorDodgeBlend,"color-burn":B.ColorBurnBlend,"hard-light":B.HardLightBlend,"soft-light":B.SoftLightBlend},VA=t=>{const e=Xa(t);if(e==="normal")return null;if(e==="add"||e==="multiply"||e==="screen")return zA(e);const n=qA[e];return n?new n:null},KA=`precision highp float;
1381
+ `,cM=t=>{const e=G.GlProgram.from({vertex:bo,fragment:aM,name:"native-blend-passthrough"}),n=new G.Filter({glProgram:e});return n.blendMode=t,n},lM={overlay:G.OverlayBlend,darken:G.DarkenBlend,lighten:G.LightenBlend,"color-dodge":G.ColorDodgeBlend,"color-burn":G.ColorBurnBlend,"hard-light":G.HardLightBlend,"soft-light":G.SoftLightBlend},uM=t=>{const e=hc(t);if(e==="normal")return null;if(e==="add"||e==="multiply"||e==="screen")return cM(e);const n=lM[e];return n?new n:null},dM=`precision highp float;
1382
1382
 
1383
1383
  in vec2 vTextureCoord;
1384
1384
  out vec4 finalColor;
@@ -1414,15 +1414,15 @@ void main(void) {
1414
1414
  float outAlpha = color.a * keep;
1415
1415
  finalColor = vec4(straight * outAlpha, outAlpha);
1416
1416
  }
1417
- `;class ZA extends B.Filter{plate;constructor(e,n=.16,r=.05){const i=B.GlProgram.from({vertex:no,fragment:KA,name:"plate-key-filter"});super({glProgram:i,resources:{plateUniforms:{uKeyColor:{value:new Float32Array(e),type:"vec3<f32>"},uTolerance:{value:n,type:"f32"},uSoftness:{value:r,type:"f32"}}}}),this.plate=this.resources.plateUniforms.uniforms}get tolerance(){return this.plate.uTolerance}set tolerance(e){this.plate.uTolerance=e}set keyColor(e){this.plate.uKeyColor[0]=e[0],this.plate.uKeyColor[1]=e[1],this.plate.uKeyColor[2]=e[2]}}function $A(t){if(t==null)return null;if(typeof t=="number")return[(t>>16&255)/255,(t>>8&255)/255,(t&255)/255];const e=t.trim(),n=/^#?([0-9a-f]{6})$/i.exec(e)||/^0x([0-9a-f]{6})$/i.exec(e);if(n){const i=parseInt(n[1],16);return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255]}const r=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return r?[Number(r[1])/255,Number(r[2])/255,Number(r[3])/255]:null}const JA=[236/255,234/255,219/255],QA=t=>{if(!t)return{};const e={...t};for(const n of["brightness","contrast","saturation","red","green","blue"])typeof t[n]=="number"&&(e[n]=(t[n]-1)*100);return e},eO=[],Nm=t=>{if(t)for(const e of t)try{e.destroy()}catch{}},lt=({colorCorrection:t,effects:e,neonColor:n=null,blendMode:r=0,plateKey:i=null})=>{const{brightness:o=0,contrast:s=0,saturation:a=0,red:l=0,green:c=0,blue:u=0,gamma:f=1,alpha:d=1,temperature:h=0,tint:p=0,hue:m=0,highlights:g=0,shadows:y=0,exposure:b=0,vibrance:x=0,sharpness:v=0,blurRadius:T=0,vignette:w=0,noise:O=0,edgeFeather:C=0}=t??{},R=e?.name||"None",P=e?.intensity??(R==="None"||R==="Normal"?0:100),A=e?.params?JSON.stringify(e.params):"",L=i&&typeof i=="object"?JSON.stringify(i):i,N=S.useMemo(()=>{const{exposureFilter:pe,temperatureTintFilter:X,tonalFilter:he,adjustmentFilter:j,vibranceFilter:te,hslFilter:H,sharpnessFilter:ae,blurFilter:Z,vignetteFilter:ce,noiseFilter:J,edgeFeatherFilter:ie}=Mm({brightness:o,contrast:s,saturation:a,red:l,green:c,blue:u,gamma:f,alpha:d,temperature:h,tint:p,hue:m,highlights:g,shadows:y,exposure:b,vibrance:x,sharpness:v,blurRadius:T,vignette:w,noise:O,edgeFeather:C}),{effectFilter:xe}=za({effect:R,effectIntensity:P,effectParams:e?.params,neonColor:n}),Y=[];if(i){const De=typeof i=="object"?i:{},ye=typeof i=="string"?i:De.color??null,$=$A(ye)??JA;Y.push(new ZA($,De.tolerance??40/255))}if(pe&&Y.push(pe),X&&Y.push(X),he&&Y.push(he),j&&Y.push(j),te&&Y.push(te),H&&Y.push(H),ae&&Y.push(ae),ie&&C>0&&Y.push(ie),xe&&(Array.isArray(xe)?Y.push(...xe.filter(De=>De!=null)):Y.push(xe)),Z&&T>0&&Y.push(Z),ce&&w>0&&Y.push(ce),J&&O>0&&Y.push(J),Y.length>0){const De=VA(r);De&&Y.push(De)}return Y},[o,s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R,P,A,n,r,L]),D=S.useRef(null);S.useEffect(()=>{const pe=D.current;D.current=N,pe&&pe!==N&&Nm(pe)},[N]),S.useEffect(()=>()=>{Nm(D.current),D.current=null},[]);const F=S.useContext(Ye),G=F?.registerTimeUpdateListener,z=F?.unregisterTimeUpdateListener,K=S.useRef(eO);K.current=N;const se=S.useRef(-1);return S.useEffect(()=>{if(!G||!z)return;const pe=X=>{const he=X,j=K.current;if(!(!j||j.length===0))for(const te of j){if(!te)continue;const H=te;if(H.__vfxAnimated===!0){H.time=he;continue}if(typeof H.refresh=="function"){const Z=Math.floor(he*12);if(Z!==se.current){const ce=Math.sin(Z*12.9898)*43758.5453;H.seed=ce-Math.floor(ce),H.refresh(),se.current=Z}continue}if(typeof H.time=="number"&&(H.time=he*.5),typeof H.seed=="number"&&!H.__vfxDreamy&&(H.seed=Math.floor(he*24)%997/997),typeof H.angle=="number"&&typeof H.time!="number"&&H.offset!==null&&typeof H.offset=="object"&&(H.angle=Math.sin(he*1.5)*3),typeof H.strength=="number"&&typeof H.centerX=="number"&&typeof H.angle>"u"&&typeof H.time>"u"){H.centerX=.5+Math.sin(he*.8)*.12,H.centerY=.5+Math.cos(he*.6)*.12;continue}const ae=Z=>.35+(Z.__spinSpeed??.1)*2.5;if(H.__vfxDreamy==="bloom"){const Z=Math.sin(he*.8*ae(H));H.bloomScale=H.__baseBloomScale*(1+.08*Z),H.brightness=H.__baseBrightness*(1+.04*Z);continue}if(H.__vfxDreamy==="blur"){const Z=Math.sin(he*.6*ae(H)+.4);H.strength=H.__baseBlur*(1+.08*Z);continue}if(H.__vfxDreamy==="grain"){const Z=Math.floor(he*(6+ae(H)*14));if(H.seed=Z%997/997,typeof H.__baseVignetting=="number"){const ce=Math.sin(he*.45*ae(H));H.vignetting=H.__baseVignetting*(.94+.08*ce)}continue}}};return G(pe),()=>z(pe)},[G,z]),N},qa="element-",Va=t=>`${qa}${t}`,tO=t=>t?.startsWith(qa)?t.slice(qa.length):null,Ka=(t,e)=>!t||!e?null:t.getChildByLabel(e,!0)??null,nO=t=>{const e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${e}$`)},Za=(t,e)=>{if(!t)return[];const n=nO(e),r=[],i=o=>{for(const s of o.children){const a=s;a.label&&n.test(a.label)&&r.push(a),a.children?.length&&i(a)}};return i(t),r},rO=t=>{const e=(n=>Ka(t,n));return e.all=n=>Za(t,n),e.byId=n=>Ka(t,Va(n)),e.byType=n=>Za(t,`${n}-*`),e},iO={x:0,y:0,width:0,height:0,anchor:.5,animation:to.NONE,maxX:0,maxY:0,scale:1,rotation:0,effect:ue.Normal,overlay:Gr.NONE,fontSize:10},$e=({ref:t,...e})=>{const[n]=S.useState(!1),[r]=S.useState(!1),i=S.useRef(null),o=S.useRef(null),s=S.useRef(null),a=S.useRef(null),l=S.useRef(null),{tl:c}=S.useContext(Ye),{app:u}=at.useApplication(),f=u?.renderer?.screen,d=f?.width||1920,h=f?.height||1080,{uniqueId:p,visible:m,startAt:g,endAt:y,transformation:b=iO,disabled:x,pointerdown:v,pointerout:T,pointerover:w,isDragging:O,isGif:C,onContainerRefReady:R,onSpriteRefReady:P,id:A,sortableChildren:L,animationText:N,pivotOffset:D}=e,{x:F=0,y:G=0,width:z,height:K,scale:se=[1,1],rotation:pe=0,alpha:X,effect:he,effects:j,neonColor:te,blendMode:H,overlay:ae,animation:Z=to.NONE,fontFamily:ce,fontSize:J,fontWeight:ie,fill:xe,color:Y,letterSpacing:De}=b,ye=xm(),$=b,we=S.useMemo(()=>{const Re=Se=>Se!=null&&(typeof Se=="string"?Se!==""&&Se!=="NONE":typeof Se=="object"?(Se.name??"NONE")!=="NONE":!1);return Re($.animationIn)||Re($.animationOut)||Re($.animationLoop)||Array.isArray($.keyframes)&&$.keyframes.length>0},[$.animationIn,$.animationOut,$.animationLoop,$.keyframes]),me=Number(g)||0,Ue=Number(y),ze=we&&Number.isFinite(Ue)&&Ue>me;Am(ze?{targetRef:i,transformation:{...b,maxX:d,maxY:h},start:me,end:Ue,effectOptions:{width:typeof z=="number"?z:void 0,height:typeof K=="number"?K:void 0,text:typeof N=="string"?N:void 0,fontFamily:ce,fontSize:J,fontWeight:ie,fill:xe,color:Y,letterSpacing:De}}:{targetRef:{current:null},transformation:{},start:0,end:0,effectOptions:{}}),Ze(ke.COMPLETE,()=>{i.current}),I.useImperativeHandle(t,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>r}),[n,r]),I.useEffect(()=>{R&&R(p,i)},[R,p]),I.useEffect(()=>{P&&P(p,s)},[P,p]);const ht=S.useMemo(()=>({x:F,y:G,width:z,height:K,animation:Z,maxX:d,maxY:h}),[Z,F,G,z,K,d,h]);I.useEffect(()=>{if(o.current&&!we){if(c.current){const{x:Re,y:Se,animation:Ge,maxX:je,maxY:qe}=ht,it=c.current.progress(),Le=ye.updateEffect(i.current,Ge,{immediateRender:!1,x:Re,y:Se,overwrite:!0,maxX:je,maxY:qe});a.current&&(c.current.remove(a.current),a.current.progress(0).kill()),it>.1?(Le.eventCallback("onComplete",()=>{Le.remove("onComplete"),c.current.add(Le,g),a.current=Le}),Le.play()):(Le.progress(1),c.current.add(Le,g),a.current=Le)}else a.current&&a.current.progress(0).kill();return()=>{}}},[g,ht,we]);const ve=lt({effects:j??{name:he},neonColor:te}),Ie=Rm(H??0),ct=A||Va(p),ut=S.useCallback(Re=>{i.current=Re,Re&&R&&R(p,i)},[R,p]),Me=typeof se=="number"?se:{x:se[0]??1,y:se[1]??1};return M.jsx("pixiContainer",{ref:o,label:`container-${p}`,sortableChildren:L,blendMode:Ie,children:M.jsx("pixiContainer",{label:ct,ref:ut,position:{x:F+(D?.x??0),y:G+(D?.y??0)},pivot:{x:F+(D?.x??0),y:G+(D?.y??0)},scale:Me,rotation:pe,...!we&&typeof X=="number"?{alpha:X}:{},eventMode:"passive",children:M.jsxs("pixiContainer",{ref:l,children:[!C&&M.jsx("pixiContainer",{scale:1,filters:ve,children:M.jsx("pixiContainer",{ref:s,children:e.children})}),C&&M.jsx("pixiContainer",{ref:s,children:e.children}),!ya(ae)&&ae!==Gr.NONE&&ae!==Gr.NORMAL&&M.jsx(kp,{overlay:ae,width:z,height:K,x:F,y:G}),M.jsx("pixiSprite",{texture:W.Texture.WHITE,alpha:0,anchor:.5,x:F,y:G,width:z,height:K,eventMode:!x&&m&&!n&&!O?"static":"none",cursor:"pointer",onPointerDown:v,onPointerOver:w,onPointerOut:T})]})})})};var Bt=(t=>(t.NONE="none",t.HORIZONTAL="horizontal",t.MIRROR="mirror",t.CIRCLE="circle",t.RECTANGLE="rectangle",t.HEART="heart",t.STARS="stars",t))(Bt||{});function $a(t,e,n,r,i,o,s){const a=s?n-i/2+s.x+s.w/2:n,l=s?r-o/2+s.y+s.h/2:r,c=s?s.w:i,u=s?s.h:o,f=c/2,d=u/2;switch(e){case Bt.HORIZONTAL:{const h=u*.6;t.rect(a-f,l-h/2,c,h);break}case Bt.MIRROR:{const h=u*.35;t.rect(a-f,l-d,c,h),t.rect(a-f,l+d-h,c,h);break}case Bt.CIRCLE:{const h=Math.min(f,d);t.circle(a,l,h);break}case Bt.RECTANGLE:{const h=Math.min(c,u)*.15;t.roundRect(a-f,l-d,c,u,h);break}case Bt.HEART:{oO(t,a,l,c,u);break}case Bt.STARS:{const h=Math.min(f,d);t.star(a,l,5,h,h*.5,-Math.PI/2);break}default:t.rect(a-f,l-d,c,u)}}function oO(t,e,n,r,i){const o=e-r/2,s=e+r/2,a=n-i/2,l=n+i/2,c=a+i*.3,u=a+i*.6;t.moveTo(e,c),t.bezierCurveTo(e,a,o,a,o,c),t.bezierCurveTo(o,u,e,l-i*.1,e,l),t.bezierCurveTo(e,l-i*.1,s,u,s,c),t.bezierCurveTo(s,a,e,a,e,c),t.closePath()}const sO=t=>{if(t==null)return 0;if(typeof t=="number")return t;const e=t.replace("#",""),n=parseInt(e,16);return Number.isFinite(n)?n:0},Ot=({x:t=0,y:e=0,width:n=0,height:r=0,border:i,roundedCorners:o=!1,maskShape:s=Bt.NONE,crop:a,spriteRef:l,children:c})=>{const u=S.useRef(null),f=i?.width??0,d=i?.color??null,h=S.useMemo(()=>o?typeof o=="number"?o:Math.min(n,r)*.1:0,[o,n,r]),p=s&&s!==Bt.NONE?s:null,m=!!p||!!o&&h>0||!!a,g=f>0&&d!=null,y=S.useMemo(()=>sO(d),[d]),b=S.useCallback(T=>{if(T.clear(),!!m){if(p)$a(T,p,t,e,n,r,a);else{const w=a?t-n/2+a.x:t-n/2,O=a?e-r/2+a.y:e-r/2,C=a?a.w:n,R=a?a.h:r;T.roundRect(w,O,C,R,h)}T.fill({color:16777215,alpha:1})}},[m,p,t,e,n,r,h,a]),x=S.useCallback(T=>{if(T.clear(),!!g){if(p)$a(T,p,t,e,n,r,a);else{const w=a?t-n/2+a.x:t-n/2,O=a?e-r/2+a.y:e-r/2,C=a?a.w:n,R=a?a.h:r;h>0?T.roundRect(w,O,C,R,h):T.rect(w,O,C,R)}T.stroke({width:f,color:y,alpha:1})}},[g,f,y,h,p,a,t,e,n,r]),v=S.useRef(null);return S.useLayoutEffect(()=>{const T=l?.current??null,w=m&&u.current?u.current:null;v.current&&v.current!==T&&(v.current.mask=null),v.current=T,T&&(T.mask??null)!==w&&(T.mask=w)}),S.useLayoutEffect(()=>()=>{v.current&&(v.current.mask=null),v.current=null},[]),M.jsxs("pixiContainer",{children:[m&&M.jsx("pixiGraphics",{ref:u,draw:b,eventMode:"none"}),c,g&&M.jsx("pixiGraphics",{draw:x,eventMode:"none"})]})};Ot.displayName="BorderMaskContainer";const aO=3e3;function Ja(t=aO){const e=new Map,n=new Map;return{acquire(r){const i=n.get(r);i&&(clearTimeout(i),n.delete(r)),e.set(r,(e.get(r)??0)+1)},release(r){const i=(e.get(r)??1)-1;if(i>0){e.set(r,i);return}e.delete(r),!n.has(r)&&n.set(r,setTimeout(()=>{n.delete(r),!e.has(r)&&W.Assets.unload(r).catch(()=>{})},t))}}}function Qa(t){if(!t||typeof t!="string")return t;const e=t.indexOf("/data:");if(e!==-1&&t.startsWith("https://")){const n=t.slice(e+1),r=n.indexOf("?");return r!==-1?n.slice(0,r):n}return t}const km=Ja();function ro(t,e){const n=Qa(t)||t;let r=!1,i=!1;km.acquire(n);const o=()=>{i||(i=!0,km.release(n))};let s;const a=new Promise(c=>{s=c});return(e?.forceTextureParser===!1?W.Assets.load(n):W.Assets.load({src:n,loadParser:"loadTextures"})).then(c=>{if(r){s(null);return}try{c?.source&&(c.source.scaleMode=e?.scaleMode??"linear",c.source.autoGenerateMipmaps=e?.enableMipmap??!0)}catch{}s(c)}).catch(c=>{r||console.error("[loadSpriteTexture]",n,c),s(null)}),{promise:a,cancel:()=>{r=!0,s(null),o()},dispose:o}}async function cO(t,e){return ro(t,e)}var ec,Dm;function lO(){if(Dm)return ec;Dm=1;function t(){this.__data__=[],this.size=0}return ec=t,ec}var tc,Fm;function nc(){if(Fm)return tc;Fm=1;function t(e,n){return e===n||e!==e&&n!==n}return tc=t,tc}var rc,Bm;function io(){if(Bm)return rc;Bm=1;var t=nc();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return rc=e,rc}var ic,Um;function uO(){if(Um)return ic;Um=1;var t=io(),e=Array.prototype,n=e.splice;function r(i){var o=this.__data__,s=t(o,i);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():n.call(o,s,1),--this.size,!0}return ic=r,ic}var oc,Gm;function fO(){if(Gm)return oc;Gm=1;var t=io();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return oc=e,oc}var sc,jm;function dO(){if(jm)return sc;jm=1;var t=io();function e(n){return t(this.__data__,n)>-1}return sc=e,sc}var ac,Hm;function hO(){if(Hm)return ac;Hm=1;var t=io();function e(n,r){var i=this.__data__,o=t(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return ac=e,ac}var cc,Ym;function oo(){if(Ym)return cc;Ym=1;var t=lO(),e=uO(),n=fO(),r=dO(),i=hO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,cc=o,cc}var lc,Xm;function pO(){if(Xm)return lc;Xm=1;var t=oo();function e(){this.__data__=new t,this.size=0}return lc=e,lc}var uc,Wm;function mO(){if(Wm)return uc;Wm=1;function t(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}return uc=t,uc}var fc,zm;function gO(){if(zm)return fc;zm=1;function t(e){return this.__data__.get(e)}return fc=t,fc}var dc,qm;function yO(){if(qm)return dc;qm=1;function t(e){return this.__data__.has(e)}return dc=t,dc}var hc,Vm;function so(){if(Vm)return hc;Vm=1;var t=Nn(),e=t(Object,"create");return hc=e,hc}var pc,Km;function _O(){if(Km)return pc;Km=1;var t=so();function e(){this.__data__=t?t(null):{},this.size=0}return pc=e,pc}var mc,Zm;function bO(){if(Zm)return mc;Zm=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return mc=t,mc}var gc,$m;function xO(){if($m)return gc;$m=1;var t=so(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(t){var a=s[o];return a===e?void 0:a}return r.call(s,o)?s[o]:void 0}return gc=i,gc}var yc,Jm;function vO(){if(Jm)return yc;Jm=1;var t=so(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var o=this.__data__;return t?o[i]!==void 0:n.call(o,i)}return yc=r,yc}var _c,Qm;function TO(){if(Qm)return _c;Qm=1;var t=so(),e="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=t&&i===void 0?e:i,this}return _c=n,_c}var bc,e0;function EO(){if(e0)return bc;e0=1;var t=_O(),e=bO(),n=xO(),r=vO(),i=TO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,bc=o,bc}var xc,t0;function SO(){if(t0)return xc;t0=1;var t=EO(),e=oo(),n=Zs();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return xc=r,xc}var vc,n0;function wO(){if(n0)return vc;n0=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return vc=t,vc}var Tc,r0;function ao(){if(r0)return Tc;r0=1;var t=wO();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Tc=e,Tc}var Ec,i0;function AO(){if(i0)return Ec;i0=1;var t=ao();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return Ec=e,Ec}var Sc,o0;function OO(){if(o0)return Sc;o0=1;var t=ao();function e(n){return t(this,n).get(n)}return Sc=e,Sc}var wc,s0;function CO(){if(s0)return wc;s0=1;var t=ao();function e(n){return t(this,n).has(n)}return wc=e,wc}var Ac,a0;function RO(){if(a0)return Ac;a0=1;var t=ao();function e(n,r){var i=t(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ac=e,Ac}var Oc,c0;function Cc(){if(c0)return Oc;c0=1;var t=SO(),e=AO(),n=OO(),r=CO(),i=RO();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Oc=o,Oc}var Rc,l0;function IO(){if(l0)return Rc;l0=1;var t=oo(),e=Zs(),n=Cc(),r=200;function i(o,s){var a=this.__data__;if(a instanceof t){var l=a.__data__;if(!e||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(o,s),this.size=a.size,this}return Rc=i,Rc}var Ic,u0;function f0(){if(u0)return Ic;u0=1;var t=oo(),e=pO(),n=mO(),r=gO(),i=yO(),o=IO();function s(a){var l=this.__data__=new t(a);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=o,Ic=s,Ic}var Mc,d0;function MO(){if(d0)return Mc;d0=1;var t="__lodash_hash_undefined__";function e(n){return this.__data__.set(n,t),this}return Mc=e,Mc}var Lc,h0;function LO(){if(h0)return Lc;h0=1;function t(e){return this.__data__.has(e)}return Lc=t,Lc}var Pc,p0;function PO(){if(p0)return Pc;p0=1;var t=Cc(),e=MO(),n=LO();function r(i){var o=-1,s=i==null?0:i.length;for(this.__data__=new t;++o<s;)this.add(i[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=n,Pc=r,Pc}var Nc,m0;function NO(){if(m0)return Nc;m0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(e[r],r,e))return!0;return!1}return Nc=t,Nc}var kc,g0;function kO(){if(g0)return kc;g0=1;function t(e,n){return e.has(n)}return kc=t,kc}var Dc,y0;function _0(){if(y0)return Dc;y0=1;var t=PO(),e=NO(),n=kO(),r=1,i=2;function o(s,a,l,c,u,f){var d=l&r,h=s.length,p=a.length;if(h!=p&&!(d&&p>h))return!1;var m=f.get(s),g=f.get(a);if(m&&g)return m==a&&g==s;var y=-1,b=!0,x=l&i?new t:void 0;for(f.set(s,a),f.set(a,s);++y<h;){var v=s[y],T=a[y];if(c)var w=d?c(T,v,y,a,s,f):c(v,T,y,s,a,f);if(w!==void 0){if(w)continue;b=!1;break}if(x){if(!e(a,function(O,C){if(!n(x,C)&&(v===O||u(v,O,l,c,f)))return x.push(C)})){b=!1;break}}else if(!(v===T||u(v,T,l,c,f))){b=!1;break}}return f.delete(s),f.delete(a),b}return Dc=o,Dc}var Fc,b0;function x0(){if(b0)return Fc;b0=1;var t=St(),e=t.Uint8Array;return Fc=e,Fc}var Bc,v0;function DO(){if(v0)return Bc;v0=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i,o){r[++n]=[o,i]}),r}return Bc=t,Bc}var Uc,T0;function FO(){if(T0)return Uc;T0=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i){r[++n]=i}),r}return Uc=t,Uc}var Gc,E0;function BO(){if(E0)return Gc;E0=1;var t=er(),e=x0(),n=nc(),r=_0(),i=DO(),o=FO(),s=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",m="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",x=t?t.prototype:void 0,v=x?x.valueOf:void 0;function T(w,O,C,R,P,A,L){switch(C){case b:if(w.byteLength!=O.byteLength||w.byteOffset!=O.byteOffset)return!1;w=w.buffer,O=O.buffer;case y:return!(w.byteLength!=O.byteLength||!A(new e(w),new e(O)));case l:case c:case d:return n(+w,+O);case u:return w.name==O.name&&w.message==O.message;case h:case m:return w==O+"";case f:var N=i;case p:var D=R&s;if(N||(N=o),w.size!=O.size&&!D)return!1;var F=L.get(w);if(F)return F==O;R|=a,L.set(w,O);var G=r(N(w),N(O),R,P,A,L);return L.delete(w),G;case g:if(v)return v.call(w)==v.call(O)}return!1}return Gc=T,Gc}var jc,S0;function Hc(){if(S0)return jc;S0=1;function t(e,n){for(var r=-1,i=n.length,o=e.length;++r<i;)e[o+r]=n[r];return e}return jc=t,jc}var Yc,w0;function A0(){if(w0)return Yc;w0=1;var t=Hc(),e=Vt();function n(r,i,o){var s=i(r);return e(r)?s:t(s,o(r))}return Yc=n,Yc}var Xc,O0;function UO(){if(O0)return Xc;O0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=0,s=[];++r<i;){var a=e[r];n(a,r,e)&&(s[o++]=a)}return s}return Xc=t,Xc}var Wc,C0;function R0(){if(C0)return Wc;C0=1;function t(){return[]}return Wc=t,Wc}var zc,I0;function qc(){if(I0)return zc;I0=1;var t=UO(),e=R0(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(s){return s==null?[]:(s=Object(s),t(i(s),function(a){return r.call(s,a)}))}:e;return zc=o,zc}var Vc,M0;function GO(){if(M0)return Vc;M0=1;function t(e,n){for(var r=-1,i=Array(e);++r<e;)i[r]=n(r);return i}return Vc=t,Vc}var Kc,L0;function jO(){if(L0)return Kc;L0=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??t,!!i&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return Kc=n,Kc}var Zc,P0;function N0(){if(P0)return Zc;P0=1;var t=GO(),e=ia(),n=Vt(),r=Yi(),i=jO(),o=ma(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var f=n(c),d=!f&&e(c),h=!f&&!d&&r(c),p=!f&&!d&&!h&&o(c),m=f||d||h||p,g=m?t(c.length,String):[],y=g.length;for(var b in c)(u||a.call(c,b))&&!(m&&(b=="length"||h&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||i(b,y)))&&g.push(b);return g}return Zc=l,Zc}var $c,k0;function Jc(){if(k0)return $c;k0=1;var t=N0(),e=Zh(),n=ca();function r(i){return n(i)?t(i):e(i)}return $c=r,$c}var Qc,D0;function F0(){if(D0)return Qc;D0=1;var t=A0(),e=qc(),n=Jc();function r(i){return t(i,n,e)}return Qc=r,Qc}var el,B0;function HO(){if(B0)return el;B0=1;var t=F0(),e=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a,l,c,u){var f=a&e,d=t(o),h=d.length,p=t(s),m=p.length;if(h!=m&&!f)return!1;for(var g=h;g--;){var y=d[g];if(!(f?y in s:r.call(s,y)))return!1}var b=u.get(o),x=u.get(s);if(b&&x)return b==s&&x==o;var v=!0;u.set(o,s),u.set(s,o);for(var T=f;++g<h;){y=d[g];var w=o[y],O=s[y];if(l)var C=f?l(O,w,y,s,o,u):l(w,O,y,o,s,u);if(!(C===void 0?w===O||c(w,O,a,l,u):C)){v=!1;break}T||(T=y=="constructor")}if(v&&!T){var R=o.constructor,P=s.constructor;R!=P&&"constructor"in o&&"constructor"in s&&!(typeof R=="function"&&R instanceof R&&typeof P=="function"&&P instanceof P)&&(v=!1)}return u.delete(o),u.delete(s),v}return el=i,el}var tl,U0;function YO(){if(U0)return tl;U0=1;var t=f0(),e=_0(),n=BO(),r=HO(),i=Fr(),o=Vt(),s=Yi(),a=ma(),l=1,c="[object Arguments]",u="[object Array]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function p(m,g,y,b,x,v){var T=o(m),w=o(g),O=T?u:i(m),C=w?u:i(g);O=O==c?f:O,C=C==c?f:C;var R=O==f,P=C==f,A=O==C;if(A&&s(m)){if(!s(g))return!1;T=!0,R=!1}if(A&&!R)return v||(v=new t),T||a(m)?e(m,g,y,b,x,v):n(m,g,O,y,b,x,v);if(!(y&l)){var L=R&&h.call(m,"__wrapped__"),N=P&&h.call(g,"__wrapped__");if(L||N){var D=L?m.value():m,F=N?g.value():g;return v||(v=new t),x(D,F,y,b,v)}}return A?(v||(v=new t),r(m,g,y,b,x,v)):!1}return tl=p,tl}var nl,G0;function XO(){if(G0)return nl;G0=1;var t=YO(),e=dn();function n(r,i,o,s,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:t(r,i,o,s,n,a)}return nl=n,nl}var rl,j0;function WO(){if(j0)return rl;j0=1;var t=XO();function e(n,r){return t(n,r)}return rl=e,rl}var zO=WO();const qO=Jn(zO);var il,H0;function Y0(){if(H0)return il;H0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=n(e[r],r,e);return o}return il=t,il}var ol,X0;function VO(){if(X0)return ol;X0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i&&n(e[r],r,e)!==!1;);return e}return ol=t,ol}var sl,W0;function z0(){if(W0)return sl;W0=1;var t=Nn(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return sl=e,sl}var al,q0;function V0(){if(q0)return al;q0=1;var t=z0();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return al=e,al}var cl,K0;function Z0(){if(K0)return cl;K0=1;var t=V0(),e=nc(),n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a){var l=o[s];(!(r.call(o,s)&&e(l,a))||a===void 0&&!(s in o))&&t(o,s,a)}return cl=i,cl}var ll,$0;function Jr(){if($0)return ll;$0=1;var t=Z0(),e=V0();function n(r,i,o,s){var a=!o;o||(o={});for(var l=-1,c=i.length;++l<c;){var u=i[l],f=s?s(o[u],r[u],u,o,r):void 0;f===void 0&&(f=r[u]),a?e(o,u,f):t(o,u,f)}return o}return ll=n,ll}var ul,J0;function KO(){if(J0)return ul;J0=1;var t=Jr(),e=Jc();function n(r,i){return r&&t(i,e(i),r)}return ul=n,ul}var fl,Q0;function ZO(){if(Q0)return fl;Q0=1;function t(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}return fl=t,fl}var dl,eg;function $O(){if(eg)return dl;eg=1;var t=Pn(),e=Hi(),n=ZO(),r=Object.prototype,i=r.hasOwnProperty;function o(s){if(!t(s))return n(s);var a=e(s),l=[];for(var c in s)c=="constructor"&&(a||!i.call(s,c))||l.push(c);return l}return dl=o,dl}var hl,tg;function pl(){if(tg)return hl;tg=1;var t=N0(),e=$O(),n=ca();function r(i){return n(i)?t(i,!0):e(i)}return hl=r,hl}var ml,ng;function JO(){if(ng)return ml;ng=1;var t=Jr(),e=pl();function n(r,i){return r&&t(i,e(i),r)}return ml=n,ml}var Qr={exports:{}};Qr.exports;var rg;function QO(){return rg||(rg=1,(function(t,e){var n=St(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var f=c.length,d=a?a(f):new c.constructor(f);return c.copy(d),d}t.exports=l})(Qr,Qr.exports)),Qr.exports}var gl,ig;function eC(){if(ig)return gl;ig=1;function t(e,n){var r=-1,i=e.length;for(n||(n=Array(i));++r<i;)n[r]=e[r];return n}return gl=t,gl}var yl,og;function tC(){if(og)return yl;og=1;var t=Jr(),e=qc();function n(r,i){return t(r,e(r),i)}return yl=n,yl}var _l,sg;function bl(){if(sg)return _l;sg=1;var t=qh(),e=t(Object.getPrototypeOf,Object);return _l=e,_l}var xl,ag;function cg(){if(ag)return xl;ag=1;var t=Hc(),e=bl(),n=qc(),r=R0(),i=Object.getOwnPropertySymbols,o=i?function(s){for(var a=[];s;)t(a,n(s)),s=e(s);return a}:r;return xl=o,xl}var vl,lg;function nC(){if(lg)return vl;lg=1;var t=Jr(),e=cg();function n(r,i){return t(r,e(r),i)}return vl=n,vl}var Tl,ug;function fg(){if(ug)return Tl;ug=1;var t=A0(),e=cg(),n=pl();function r(i){return t(i,n,e)}return Tl=r,Tl}var El,dg;function rC(){if(dg)return El;dg=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return El=n,El}var Sl,hg;function wl(){if(hg)return Sl;hg=1;var t=x0();function e(n){var r=new n.constructor(n.byteLength);return new t(r).set(new t(n)),r}return Sl=e,Sl}var Al,pg;function iC(){if(pg)return Al;pg=1;var t=wl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return Al=e,Al}var Ol,mg;function oC(){if(mg)return Ol;mg=1;var t=/\w*$/;function e(n){var r=new n.constructor(n.source,t.exec(n));return r.lastIndex=n.lastIndex,r}return Ol=e,Ol}var Cl,gg;function sC(){if(gg)return Cl;gg=1;var t=er(),e=t?t.prototype:void 0,n=e?e.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return Cl=r,Cl}var Rl,yg;function aC(){if(yg)return Rl;yg=1;var t=wl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return Rl=e,Rl}var Il,_g;function cC(){if(_g)return Il;_g=1;var t=wl(),e=iC(),n=oC(),r=sC(),i=aC(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",f="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",p="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",x="[object Int32Array]",v="[object Uint8Array]",T="[object Uint8ClampedArray]",w="[object Uint16Array]",O="[object Uint32Array]";function C(R,P,A){var L=R.constructor;switch(P){case h:return t(R);case o:case s:return new L(+R);case p:return e(R,A);case m:case g:case y:case b:case x:case v:case T:case w:case O:return i(R,A);case a:return new L;case l:case f:return new L(R);case c:return n(R);case u:return new L;case d:return r(R)}}return Il=C,Il}var Ml,bg;function lC(){if(bg)return Ml;bg=1;var t=Pn(),e=Object.create,n=(function(){function r(){}return function(i){if(!t(i))return{};if(e)return e(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return Ml=n,Ml}var Ll,xg;function uC(){if(xg)return Ll;xg=1;var t=lC(),e=bl(),n=Hi();function r(i){return typeof i.constructor=="function"&&!n(i)?t(e(i)):{}}return Ll=r,Ll}var Pl,vg;function fC(){if(vg)return Pl;vg=1;var t=Fr(),e=dn(),n="[object Map]";function r(i){return e(i)&&t(i)==n}return Pl=r,Pl}var Nl,Tg;function dC(){if(Tg)return Nl;Tg=1;var t=fC(),e=da(),n=ha(),r=n&&n.isMap,i=r?e(r):t;return Nl=i,Nl}var kl,Eg;function hC(){if(Eg)return kl;Eg=1;var t=Fr(),e=dn(),n="[object Set]";function r(i){return e(i)&&t(i)==n}return kl=r,kl}var Dl,Sg;function pC(){if(Sg)return Dl;Sg=1;var t=hC(),e=da(),n=ha(),r=n&&n.isSet,i=r?e(r):t;return Dl=i,Dl}var Fl,wg;function mC(){if(wg)return Fl;wg=1;var t=f0(),e=VO(),n=Z0(),r=KO(),i=JO(),o=QO(),s=eC(),a=tC(),l=nC(),c=F0(),u=fg(),f=Fr(),d=rC(),h=cC(),p=uC(),m=Vt(),g=Yi(),y=dC(),b=Pn(),x=pC(),v=Jc(),T=pl(),w=1,O=2,C=4,R="[object Arguments]",P="[object Array]",A="[object Boolean]",L="[object Date]",N="[object Error]",D="[object Function]",F="[object GeneratorFunction]",G="[object Map]",z="[object Number]",K="[object Object]",se="[object RegExp]",pe="[object Set]",X="[object String]",he="[object Symbol]",j="[object WeakMap]",te="[object ArrayBuffer]",H="[object DataView]",ae="[object Float32Array]",Z="[object Float64Array]",ce="[object Int8Array]",J="[object Int16Array]",ie="[object Int32Array]",xe="[object Uint8Array]",Y="[object Uint8ClampedArray]",De="[object Uint16Array]",ye="[object Uint32Array]",$={};$[R]=$[P]=$[te]=$[H]=$[A]=$[L]=$[ae]=$[Z]=$[ce]=$[J]=$[ie]=$[G]=$[z]=$[K]=$[se]=$[pe]=$[X]=$[he]=$[xe]=$[Y]=$[De]=$[ye]=!0,$[N]=$[D]=$[j]=!1;function we(me,Ue,ze,ht,zt,ve){var Ie,ct=Ue&w,ut=Ue&O,Me=Ue&C;if(ze&&(Ie=zt?ze(me,ht,zt,ve):ze(me)),Ie!==void 0)return Ie;if(!b(me))return me;var Re=m(me);if(Re){if(Ie=d(me),!ct)return s(me,Ie)}else{var Se=f(me),Ge=Se==D||Se==F;if(g(me))return o(me,ct);if(Se==K||Se==R||Ge&&!zt){if(Ie=ut||Ge?{}:p(me),!ct)return ut?l(me,i(Ie,me)):a(me,r(Ie,me))}else{if(!$[Se])return zt?me:{};Ie=h(me,Se,ct)}}ve||(ve=new t);var je=ve.get(me);if(je)return je;ve.set(me,Ie),x(me)?me.forEach(function(Le){Ie.add(we(Le,Ue,ze,Le,me,ve))}):y(me)&&me.forEach(function(Le,ot){Ie.set(ot,we(Le,Ue,ze,ot,me,ve))});var qe=Me?ut?u:c:ut?T:v,it=Re?void 0:qe(me);return e(it||me,function(Le,ot){it&&(ot=Le,Le=me[ot]),n(Ie,ot,we(Le,Ue,ze,ot,me,ve))}),Ie}return Fl=we,Fl}var Bl,Ag;function co(){if(Ag)return Bl;Ag=1;var t=tr(),e=dn(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return Bl=r,Bl}var Ul,Og;function gC(){if(Og)return Ul;Og=1;var t=Vt(),e=co(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(t(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||e(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return Ul=i,Ul}var Gl,Cg;function yC(){if(Cg)return Gl;Cg=1;var t=Cc(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var o=function(){var s=arguments,a=i?i.apply(this,s):s[0],l=o.cache;if(l.has(a))return l.get(a);var c=r.apply(this,s);return o.cache=l.set(a,c)||l,c};return o.cache=new(n.Cache||t),o}return n.Cache=t,Gl=n,Gl}var jl,Rg;function _C(){if(Rg)return jl;Rg=1;var t=yC(),e=500;function n(r){var i=t(r,function(s){return o.size===e&&o.clear(),s}),o=i.cache;return i}return jl=n,jl}var Hl,Ig;function bC(){if(Ig)return Hl;Ig=1;var t=_C(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(e,function(s,a,l,c){o.push(l?c.replace(n,"$1"):a||s)}),o});return Hl=r,Hl}var Yl,Mg;function xC(){if(Mg)return Yl;Mg=1;var t=er(),e=Y0(),n=Vt(),r=co(),i=t?t.prototype:void 0,o=i?i.toString:void 0;function s(a){if(typeof a=="string")return a;if(n(a))return e(a,s)+"";if(r(a))return o?o.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return Yl=s,Yl}var Xl,Lg;function vC(){if(Lg)return Xl;Lg=1;var t=xC();function e(n){return n==null?"":t(n)}return Xl=e,Xl}var Wl,Pg;function zl(){if(Pg)return Wl;Pg=1;var t=Vt(),e=gC(),n=bC(),r=vC();function i(o,s){return t(o)?o:e(o,s)?[o]:n(r(o))}return Wl=i,Wl}var ql,Ng;function TC(){if(Ng)return ql;Ng=1;function t(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}return ql=t,ql}var Vl,kg;function Dg(){if(kg)return Vl;kg=1;var t=co();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Vl=e,Vl}var Kl,Fg;function EC(){if(Fg)return Kl;Fg=1;var t=zl(),e=Dg();function n(r,i){i=t(i,r);for(var o=0,s=i.length;r!=null&&o<s;)r=r[e(i[o++])];return o&&o==s?r:void 0}return Kl=n,Kl}var Zl,Bg;function SC(){if(Bg)return Zl;Bg=1;function t(e,n,r){var i=-1,o=e.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(o);++i<o;)s[i]=e[i+n];return s}return Zl=t,Zl}var $l,Ug;function wC(){if(Ug)return $l;Ug=1;var t=EC(),e=SC();function n(r,i){return i.length<2?r:t(r,e(i,0,-1))}return $l=n,$l}var Jl,Gg;function AC(){if(Gg)return Jl;Gg=1;var t=zl(),e=TC(),n=wC(),r=Dg();function i(o,s){return s=t(s,o),o=n(o,s),o==null||delete o[r(e(s))]}return Jl=i,Jl}var Ql,jg;function OC(){if(jg)return Ql;jg=1;var t=tr(),e=bl(),n=dn(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(u){if(!n(u)||t(u)!=r)return!1;var f=e(u);if(f===null)return!0;var d=a.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&s.call(d)==l}return Ql=c,Ql}var eu,Hg;function CC(){if(Hg)return eu;Hg=1;var t=OC();function e(n){return t(n)?void 0:n}return eu=e,eu}var tu,Yg;function RC(){if(Yg)return tu;Yg=1;var t=er(),e=ia(),n=Vt(),r=t?t.isConcatSpreadable:void 0;function i(o){return n(o)||e(o)||!!(r&&o&&o[r])}return tu=i,tu}var nu,Xg;function IC(){if(Xg)return nu;Xg=1;var t=Hc(),e=RC();function n(r,i,o,s,a){var l=-1,c=r.length;for(o||(o=e),a||(a=[]);++l<c;){var u=r[l];i>0&&o(u)?i>1?n(u,i-1,o,s,a):t(a,u):s||(a[a.length]=u)}return a}return nu=n,nu}var ru,Wg;function MC(){if(Wg)return ru;Wg=1;var t=IC();function e(n){var r=n==null?0:n.length;return r?t(n,1):[]}return ru=e,ru}var iu,zg;function LC(){if(zg)return iu;zg=1;function t(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}return iu=t,iu}var ou,qg;function PC(){if(qg)return ou;qg=1;var t=LC(),e=Math.max;function n(r,i,o){return i=e(i===void 0?r.length-1:i,0),function(){for(var s=arguments,a=-1,l=e(s.length-i,0),c=Array(l);++a<l;)c[a]=s[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=s[a];return u[i]=o(c),t(r,this,u)}}return ou=n,ou}var su,Vg;function NC(){if(Vg)return su;Vg=1;function t(e){return function(){return e}}return su=t,su}var au,Kg;function kC(){if(Kg)return au;Kg=1;function t(e){return e}return au=t,au}var cu,Zg;function DC(){if(Zg)return cu;Zg=1;var t=NC(),e=z0(),n=kC(),r=e?function(i,o){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n;return cu=r,cu}var lu,$g;function FC(){if($g)return lu;$g=1;var t=800,e=16,n=Date.now;function r(i){var o=0,s=0;return function(){var a=n(),l=e-(a-s);if(s=a,l>0){if(++o>=t)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return lu=r,lu}var uu,Jg;function BC(){if(Jg)return uu;Jg=1;var t=DC(),e=FC(),n=e(t);return uu=n,uu}var fu,Qg;function UC(){if(Qg)return fu;Qg=1;var t=MC(),e=PC(),n=BC();function r(i){return n(e(i,void 0,t),i+"")}return fu=r,fu}var du,ey;function GC(){if(ey)return du;ey=1;var t=Y0(),e=mC(),n=AC(),r=zl(),i=Jr(),o=CC(),s=UC(),a=fg(),l=1,c=2,u=4,f=s(function(d,h){var p={};if(d==null)return p;var m=!1;h=t(h,function(y){return y=r(y,d),m||(m=y.length>1),y}),i(d,a(d),p),m&&(p=e(p,l|c|u,o));for(var g=h.length;g--;)n(p,h[g]);return p});return du=f,du}var jC=GC();const ty=Jn(jC),ny=["mouseOverSpriteRef","mouseOverTransformerRef","spriteHelperRef","canvasImageRef","textEditorRef","onContainerRefReady","onSpriteRefReady"];function et(t,e,n=[]){if(e.mouseOverTransformerRef?.current?.isDragging)return!0;const i=[...ny,...n];return qO(ty(t,i),ty(e,i))}const HC=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),{src:s,uniqueId:a,visible:l,disabled:c,mouseOverSpriteRef:u,transformation:{x:f,y:d,width:h,height:p,anchor:m,colorCorrection:g,effect:y,effects:b,neonColor:x,blendMode:v,border:T,roundedCorners:w,maskShape:O,crop:C,plateKey:R},pointerdown:P}=e,A=Qa(s)||void 0,L=lt({colorCorrection:g,effects:b??{name:y},neonColor:x,blendMode:v,plateKey:R});S.useEffect(()=>{if(!A){r(null);return}const G=ro(A);let z=!0;return G.promise.then(K=>{z&&r(K)}),()=>{z=!1,G.cancel(),r(null),G.dispose()}},[A]),S.useEffect(()=>()=>{u&&(u.current=!1)},[u]);const N=h&&h>0?h:n?.orig?.width||0,D=p&&p>0?p:n?.orig?.height||0,F=!!n&&n!==W.Texture.EMPTY;return M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:o,children:M.jsx(Ot,{x:f,y:d,width:N,height:D,border:T,roundedCorners:w,maskShape:O,crop:C,spriteRef:i,children:F&&M.jsx("pixiSprite",{label:`sprite-${a}`,texture:n,width:N,height:D,anchor:m,ref:i,alpha:l?1:0,x:f,y:d,filters:L,...!c&&l&&{eventMode:"static",onPointerDown:P}})})})})},hu=I.memo(HC,(t,e)=>et(t,e,["isDragging"]));hu.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};var pu,ry;function YC(){if(ry)return pu;ry=1;var t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(h){return h===10||h===13||h===8232||h===8233||h===32||h===9||h===11||h===12||h===160||h>=5760&&e.indexOf(h)>=0}function r(h){switch(h|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function i(h){return(h|32)===97}function o(h){return h>=48&&h<=57}function s(h){return h>=48&&h<=57||h===43||h===45||h===46}function a(h){this.index=0,this.path=h,this.max=h.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function l(h){for(;h.index<h.max&&n(h.path.charCodeAt(h.index));)h.index++}function c(h){var p=h.path.charCodeAt(h.index);if(p===48){h.param=0,h.index++;return}if(p===49){h.param=1,h.index++;return}h.err="SvgPath: arc flag can be 0 or 1 only (at pos "+h.index+")"}function u(h){var p=h.index,m=p,g=h.max,y=!1,b=!1,x=!1,v=!1,T;if(m>=g){h.err="SvgPath: missed param (at pos "+m+")";return}if(T=h.path.charCodeAt(m),(T===43||T===45)&&(m++,T=m<g?h.path.charCodeAt(m):0),!o(T)&&T!==46){h.err="SvgPath: param should start with 0..9 or `.` (at pos "+m+")";return}if(T!==46){if(y=T===48,m++,T=m<g?h.path.charCodeAt(m):0,y&&m<g&&T&&o(T)){h.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+p+")";return}for(;m<g&&o(h.path.charCodeAt(m));)m++,b=!0;T=m<g?h.path.charCodeAt(m):0}if(T===46){for(v=!0,m++;o(h.path.charCodeAt(m));)m++,x=!0;T=m<g?h.path.charCodeAt(m):0}if(T===101||T===69){if(v&&!b&&!x){h.err="SvgPath: invalid float exponent (at pos "+m+")";return}if(m++,T=m<g?h.path.charCodeAt(m):0,(T===43||T===45)&&m++,m<g&&o(h.path.charCodeAt(m)))for(;m<g&&o(h.path.charCodeAt(m));)m++;else{h.err="SvgPath: invalid float exponent (at pos "+m+")";return}}h.index=m,h.param=parseFloat(h.path.slice(p,m))+0}function f(h){var p,m;p=h.path[h.segmentStart],m=p.toLowerCase();var g=h.data;if(m==="m"&&g.length>2&&(h.result.push([p,g[0],g[1]]),g=g.slice(2),m="l",p=p==="m"?"l":"L"),m==="r")h.result.push([p].concat(g));else for(;g.length>=t[m]&&(h.result.push([p].concat(g.splice(0,t[m]))),!!t[m]););}function d(h){var p=h.max,m,g,y,b,x;if(h.segmentStart=h.index,m=h.path.charCodeAt(h.index),g=i(m),!r(m)){h.err="SvgPath: bad command "+h.path[h.index]+" (at pos "+h.index+")";return}if(b=t[h.path[h.index].toLowerCase()],h.index++,l(h),h.data=[],!b){f(h);return}for(y=!1;;){for(x=b;x>0;x--){if(g&&(x===3||x===4)?c(h):u(h),h.err.length){f(h);return}h.data.push(h.param),l(h),y=!1,h.index<p&&h.path.charCodeAt(h.index)===44&&(h.index++,l(h),y=!0)}if(!y&&(h.index>=h.max||!s(h.path.charCodeAt(h.index))))break}f(h)}return pu=function(p){var m=new a(p),g=m.max;for(l(m);m.index<g&&!m.err.length;)d(m);return m.result.length&&("mM".indexOf(m.result[0][0])<0?(m.err="SvgPath: string should start with `M` or `m`",m.result=[]):m.result[0][0]="M"),{err:m.err,segments:m.result}},pu}var mu,iy;function oy(){if(iy)return mu;iy=1;function t(n,r){return[n[0]*r[0]+n[2]*r[1],n[1]*r[0]+n[3]*r[1],n[0]*r[2]+n[2]*r[3],n[1]*r[2]+n[3]*r[3],n[0]*r[4]+n[2]*r[5]+n[4],n[1]*r[4]+n[3]*r[5]+n[5]]}function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}return e.prototype.matrix=function(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0?this:(this.cache=null,this.queue.push(n),this)},e.prototype.translate=function(n,r){return(n!==0||r!==0)&&(this.cache=null,this.queue.push([1,0,0,1,n,r])),this},e.prototype.scale=function(n,r){return(n!==1||r!==1)&&(this.cache=null,this.queue.push([n,0,0,r,0,0])),this},e.prototype.rotate=function(n,r,i){var o,s,a;return n!==0&&(this.translate(r,i),o=n*Math.PI/180,s=Math.cos(o),a=Math.sin(o),this.queue.push([s,a,-a,s,0,0]),this.cache=null,this.translate(-r,-i)),this},e.prototype.skewX=function(n){return n!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(n*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(n){return n!==0&&(this.cache=null,this.queue.push([1,Math.tan(n*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var n=1;n<this.queue.length;n++)this.cache=t(this.cache,this.queue[n]);return this.cache},e.prototype.calc=function(n,r,i){var o;return this.queue.length?(this.cache||(this.cache=this.toArray()),o=this.cache,[n*o[0]+r*o[2]+(i?0:o[4]),n*o[1]+r*o[3]+(i?0:o[5])]):[n,r]},mu=e,mu}var gu,sy;function XC(){if(sy)return gu;sy=1;var t=oy(),e={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},n=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,r=/[\s,]+/;return gu=function(o){var s=new t,a,l;return o.split(n).forEach(function(c){if(c.length){if(typeof e[c]<"u"){a=c;return}switch(l=c.split(r).map(function(u){return+u||0}),a){case"matrix":l.length===6&&s.matrix(l);return;case"scale":l.length===1?s.scale(l[0],l[0]):l.length===2&&s.scale(l[0],l[1]);return;case"rotate":l.length===1?s.rotate(l[0],0,0):l.length===3&&s.rotate(l[0],l[1],l[2]);return;case"translate":l.length===1?s.translate(l[0],0):l.length===2&&s.translate(l[0],l[1]);return;case"skewX":l.length===1&&s.skewX(l[0]);return;case"skewY":l.length===1&&s.skewY(l[0]);return}}}),s},gu}var yu,ay;function WC(){if(ay)return yu;ay=1;var t=Math.PI*2;function e(i,o,s,a){var l=i*a-o*s<0?-1:1,c=i*s+o*a;return c>1&&(c=1),c<-1&&(c=-1),l*Math.acos(c)}function n(i,o,s,a,l,c,u,f,d,h){var p=h*(i-s)/2+d*(o-a)/2,m=-d*(i-s)/2+h*(o-a)/2,g=u*u,y=f*f,b=p*p,x=m*m,v=g*y-g*x-y*b;v<0&&(v=0),v/=g*x+y*b,v=Math.sqrt(v)*(l===c?-1:1);var T=v*u/f*m,w=v*-f/u*p,O=h*T-d*w+(i+s)/2,C=d*T+h*w+(o+a)/2,R=(p-T)/u,P=(m-w)/f,A=(-p-T)/u,L=(-m-w)/f,N=e(1,0,R,P),D=e(R,P,A,L);return c===0&&D>0&&(D-=t),c===1&&D<0&&(D+=t),[O,C,N,D]}function r(i,o){var s=1.3333333333333333*Math.tan(o/4),a=Math.cos(i),l=Math.sin(i),c=Math.cos(i+o),u=Math.sin(i+o);return[a,l,a-l*s,l+a*s,c+u*s,u-c*s,c,u]}return yu=function(o,s,a,l,c,u,f,d,h){var p=Math.sin(h*t/360),m=Math.cos(h*t/360),g=m*(o-a)/2+p*(s-l)/2,y=-p*(o-a)/2+m*(s-l)/2;if(g===0&&y===0)return[];if(f===0||d===0)return[];f=Math.abs(f),d=Math.abs(d);var b=g*g/(f*f)+y*y/(d*d);b>1&&(f*=Math.sqrt(b),d*=Math.sqrt(b));var x=n(o,s,a,l,c,u,f,d,p,m),v=[],T=x[2],w=x[3],O=Math.max(Math.ceil(Math.abs(w)/(t/4)),1);w/=O;for(var C=0;C<O;C++)v.push(r(T,w)),T+=w;return v.map(function(R){for(var P=0;P<R.length;P+=2){var A=R[P+0],L=R[P+1];A*=f,L*=d;var N=m*A-p*L,D=p*A+m*L;R[P+0]=N+x[0],R[P+1]=D+x[1]}return R})},yu}var _u,cy;function zC(){if(cy)return _u;cy=1;var t=1e-10,e=Math.PI/180;function n(r,i,o){if(!(this instanceof n))return new n(r,i,o);this.rx=r,this.ry=i,this.ax=o}return n.prototype.transform=function(r){var i=Math.cos(this.ax*e),o=Math.sin(this.ax*e),s=[this.rx*(r[0]*i+r[2]*o),this.rx*(r[1]*i+r[3]*o),this.ry*(-r[0]*o+r[2]*i),this.ry*(-r[1]*o+r[3]*i)],a=s[0]*s[0]+s[2]*s[2],l=s[1]*s[1]+s[3]*s[3],c=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(a+l)/2;if(c<t*u)return this.rx=this.ry=Math.sqrt(u),this.ax=0,this;var f=s[0]*s[1]+s[2]*s[3];c=Math.sqrt(c);var d=u+c/2,h=u-c/2;return this.ax=Math.abs(f)<t&&Math.abs(d-l)<t?90:Math.atan(Math.abs(f)>Math.abs(d-l)?(d-a)/f:f/(d-l))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)):(this.ax+=90,this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)),this},n.prototype.isDegenerate=function(){return this.rx<t*this.ry||this.ry<t*this.rx},_u=n,_u}var bu,ly;function qC(){if(ly)return bu;ly=1;var t=YC(),e=XC(),n=oy(),r=WC(),i=zC();function o(s){if(!(this instanceof o))return new o(s);var a=t(s);this.segments=a.segments,this.err=a.err,this.__stack=[]}return o.from=function(s){if(typeof s=="string")return new o(s);if(s instanceof o){var a=new o("");return a.err=s.err,a.segments=s.segments.map(function(l){return l.slice()}),a.__stack=s.__stack.map(function(l){return n().matrix(l.toArray())}),a}throw new Error("SvgPath.from: invalid param type "+s)},o.prototype.__matrix=function(s){var a=this,l;s.queue.length&&this.iterate(function(c,u,f,d){var h,p,m,g;switch(c[0]){case"v":h=s.calc(0,c[1],!0),p=h[0]===0?["v",h[1]]:["l",h[0],h[1]];break;case"V":h=s.calc(f,c[1],!1),p=h[0]===s.calc(f,d,!1)[0]?["V",h[1]]:["L",h[0],h[1]];break;case"h":h=s.calc(c[1],0,!0),p=h[1]===0?["h",h[0]]:["l",h[0],h[1]];break;case"H":h=s.calc(c[1],d,!1),p=h[1]===s.calc(f,d,!1)[1]?["H",h[0]]:["L",h[0],h[1]];break;case"a":case"A":var y=s.toArray(),b=i(c[1],c[2],c[3]).transform(y);if(y[0]*y[3]-y[1]*y[2]<0&&(c[5]=c[5]?"0":"1"),h=s.calc(c[6],c[7],c[0]==="a"),c[0]==="A"&&c[6]===f&&c[7]===d||c[0]==="a"&&c[6]===0&&c[7]===0){p=[c[0]==="a"?"l":"L",h[0],h[1]];break}b.isDegenerate()?p=[c[0]==="a"?"l":"L",h[0],h[1]]:p=[c[0],b.rx,b.ry,b.ax,c[4],c[5],h[0],h[1]];break;case"m":g=u>0,h=s.calc(c[1],c[2],g),p=["m",h[0],h[1]];break;default:for(m=c[0],p=[m],g=m.toLowerCase()===m,l=1;l<c.length;l+=2)h=s.calc(c[l],c[l+1],g),p.push(h[0],h[1])}a.segments[u]=p},!0)},o.prototype.__evaluateStack=function(){var s,a;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(s=n(),a=this.__stack.length;--a>=0;)s.matrix(this.__stack[a].toArray());this.__matrix(s),this.__stack=[]}},o.prototype.toString=function(){var s="",a="",l=!1;this.__evaluateStack();for(var c=0,u=this.segments.length;c<u;c++){var f=this.segments[c],d=f[0];d!==a||d==="m"||d==="M"?(d==="m"&&a==="z"&&(s+=" "),s+=d,l=!1):l=!0;for(var h=1;h<f.length;h++){var p=f[h];h===1?l&&p>=0&&(s+=" "):p>=0&&(s+=" "),s+=p}a=d}return s},o.prototype.translate=function(s,a){return this.__stack.push(n().translate(s,a||0)),this},o.prototype.scale=function(s,a){return this.__stack.push(n().scale(s,!a&&a!==0?s:a)),this},o.prototype.rotate=function(s,a,l){return this.__stack.push(n().rotate(s,a||0,l||0)),this},o.prototype.skewX=function(s){return this.__stack.push(n().skewX(s)),this},o.prototype.skewY=function(s){return this.__stack.push(n().skewY(s)),this},o.prototype.matrix=function(s){return this.__stack.push(n().matrix(s)),this},o.prototype.transform=function(s){return s.trim()?(this.__stack.push(e(s)),this):this},o.prototype.round=function(s){var a=0,l=0,c=0,u=0,f;return s=s||0,this.__evaluateStack(),this.segments.forEach(function(d){var h=d[0].toLowerCase()===d[0];switch(d[0]){case"H":case"h":h&&(d[1]+=c),c=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"V":case"v":h&&(d[1]+=u),u=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"Z":case"z":c=a,u=l;return;case"M":case"m":h&&(d[1]+=c,d[2]+=u),c=d[1]-d[1].toFixed(s),u=d[2]-d[2].toFixed(s),a=c,l=u,d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s);return;case"A":case"a":h&&(d[6]+=c,d[7]+=u),c=d[6]-d[6].toFixed(s),u=d[7]-d[7].toFixed(s),d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s),d[3]=+d[3].toFixed(s+2),d[6]=+d[6].toFixed(s),d[7]=+d[7].toFixed(s);return;default:f=d.length,h&&(d[f-2]+=c,d[f-1]+=u),c=d[f-2]-d[f-2].toFixed(s),u=d[f-1]-d[f-1].toFixed(s),d.forEach(function(p,m){m&&(d[m]=+d[m].toFixed(s))});return}}),this},o.prototype.iterate=function(s,a){var l=this.segments,c={},u=!1,f=0,d=0,h=0,p=0,m,g,y;if(a||this.__evaluateStack(),l.forEach(function(b,x){var v=s(b,x,f,d);Array.isArray(v)&&(c[x]=v,u=!0);var T=b[0]===b[0].toLowerCase();switch(b[0]){case"m":case"M":f=b[1]+(T?f:0),d=b[2]+(T?d:0),h=f,p=d;return;case"h":case"H":f=b[1]+(T?f:0);return;case"v":case"V":d=b[1]+(T?d:0);return;case"z":case"Z":f=h,d=p;return;default:f=b[b.length-2]+(T?f:0),d=b[b.length-1]+(T?d:0)}}),!u)return this;for(y=[],m=0;m<l.length;m++)if(typeof c[m]<"u")for(g=0;g<c[m].length;g++)y.push(c[m][g]);else y.push(l[m]);return this.segments=y,this},o.prototype.abs=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toUpperCase(),d;if(u!==f)switch(s[0]=f,u){case"v":s[1]+=c;return;case"a":s[6]+=l,s[7]+=c;return;default:for(d=1;d<s.length;d++)s[d]+=d%2?l:c}},!0),this},o.prototype.rel=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toLowerCase(),d;if(u!==f&&!(a===0&&u==="M"))switch(s[0]=f,u){case"V":s[1]-=c;return;case"A":s[6]-=l,s[7]-=c;return;default:for(d=1;d<s.length;d++)s[d]-=d%2?l:c}},!0),this},o.prototype.unarc=function(){return this.iterate(function(s,a,l,c){var u,f,d,h=[],p=s[0];return p!=="A"&&p!=="a"?null:(p==="a"?(f=l+s[6],d=c+s[7]):(f=s[6],d=s[7]),u=r(l,c,f,d,s[4],s[5],s[1],s[2],s[3]),u.length===0?[[s[0]==="a"?"l":"L",s[6],s[7]]]:(u.forEach(function(m){h.push(["C",m[2],m[3],m[4],m[5],m[6],m[7]])}),h))}),this},o.prototype.unshort=function(){var s=this.segments,a,l,c,u,f;return this.iterate(function(d,h,p,m){var g=d[0],y=g.toUpperCase(),b;h&&(y==="T"?(b=g==="t",c=s[h-1],c[0]==="Q"?(a=c[1]-p,l=c[2]-m):c[0]==="q"?(a=c[1]-c[3],l=c[2]-c[4]):(a=0,l=0),u=-a,f=-l,b||(u+=p,f+=m),s[h]=[b?"q":"Q",u,f,d[1],d[2]]):y==="S"&&(b=g==="s",c=s[h-1],c[0]==="C"?(a=c[3]-p,l=c[4]-m):c[0]==="c"?(a=c[3]-c[5],l=c[4]-c[6]):(a=0,l=0),u=-a,f=-l,b||(u+=p,f+=m),s[h]=[b?"c":"C",u,f,d[1],d[2],d[3],d[4]]))}),this},bu=o,bu}var xu,uy;function VC(){return uy||(uy=1,xu=qC()),xu}var KC=VC();const ZC=Jn(KC),fy=2,dy=t=>{const e=t.getAttribute("viewBox");if(e){const i=e.trim().split(/[\s,]+/);if(i.length>=4)return Math.max(parseFloat(i[2])||512,parseFloat(i[3])||512)}const n=parseFloat(t.getAttribute("width")||"")||512,r=parseFloat(t.getAttribute("height")||"")||512;return Math.max(n,r)},hy=t=>t.getAttribute("fill")==="none"||t.querySelector('[fill="none"]')!==null||t.querySelector("[stroke]")!==null,$C=({shouldApply:t,strokeWidth:e,resolution:n,renderWidth:r,renderHeight:i,originalSize:o,isOutline:s})=>{if(t&&e>0){const u=e*n;if(s){const d=Math.min(r,i)/o;return u/d}const f=Math.max(r,i);return u*(o/f)}const l=Math.max(r,i)/n/o,c=s?2:1.5;return Math.max(fy*l,c*n)},JC=(t,e,n)=>{t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(n)),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.querySelectorAll("path, rect, circle, ellipse, polygon, polyline, line").forEach(r=>{r.setAttribute("stroke",e),r.setAttribute("stroke-width",String(n)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");const i=r.getAttribute("fill");(i==="none"||!i)&&r.setAttribute("fill","none")})},QC=(t,e,n,r,i,o)=>{const s=t.getElementsByTagName("*");for(let a=0;a<s.length;a++){const l=s[a];if(l.hasAttribute("stroke-width")){const c=parseFloat(l.getAttribute("stroke-width")||"")||fy;l.setAttribute("stroke-width",String(Math.max(c*e,n*r*(i/o))))}}};function py(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.querySelector("svg");if(!r)return t;const{resolution:i,stroke:o,strokeWidth:s}=e,a=dy(r),l=hy(r),c=e.width||a,u=e.height||a,f=c*i,d=u*i,h=!!o&&(s||0)>0,p=$C({shouldApply:h,strokeWidth:s||0,resolution:i,renderWidth:f,renderHeight:d,originalSize:a,isOutline:l});if(r.getAttribute("viewBox")||r.setAttribute("viewBox",`0 0 ${a} ${a}`),r.setAttribute("width",String(f)),r.setAttribute("height",String(d)),r.setAttribute("preserveAspectRatio",l?"xMidYMid meet":"none"),h)JC(r,o,p);else if(l){const m=Math.max(c,u);QC(r,m/a,2,i,a,Math.max(f,d))}return new XMLSerializer().serializeToString(n)}function my(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.documentElement;if(r.tagName!=="svg")return t;if(!r.getAttribute("viewBox")){const i=parseFloat(r.getAttribute("width")||"")||e.width,o=parseFloat(r.getAttribute("height")||"")||e.height;r.setAttribute("viewBox",`0 0 ${i} ${o}`)}return r.setAttribute("width",String(e.width)),r.setAttribute("height",String(e.height)),e.fill&&r.setAttribute("fill",e.fill),e.stroke&&r.setAttribute("stroke",e.stroke),e.strokeWidth!=null&&r.setAttribute("stroke-width",String(e.strokeWidth)),new XMLSerializer().serializeToString(n)}const gy=t=>{const e=t.toLowerCase();return e.includes(".svg")||e.startsWith("data:image/svg")};function ei(t,e){const[n,r]=S.useState(t);return S.useEffect(()=>{if(Object.is(n,t))return;const i=setTimeout(()=>r(t),Math.max(0,e));return()=>clearTimeout(i)},[t,e]),n}const eR=({ref:t,...e})=>{const n=S.useRef(null),[r,i]=S.useState(null),{app:o}=at.useApplication(),{src:s,visible:a,mouseOverSpriteRef:l,transformation:{x:c,y:u,width:f,height:d,colorCorrection:h,effect:p,effects:m,neonColor:g,blendMode:y,border:b,roundedCorners:x,crop:v,fill:T,stroke:w,strokeWidth:O}}=e,C=lt({colorCorrection:h,effects:m??{name:p},neonColor:g,blendMode:y}),R=ei(f,120),P=ei(d,120);return S.useEffect(()=>{if(!s||!o?.renderer)return;let A=!1,L=null;return(async()=>{try{const D=Math.max(window.devicePixelRatio||2,2),F=Math.max((R||512)*D,512),G=Math.max((P||512)*D,512),z=await fetch(s);if(A||!z.ok)return;const K=await z.text();if(A)return;const se=new W.Graphics().svg(my(K,{width:F,height:G,fill:T,stroke:w,strokeWidth:O}));try{L=o.renderer.generateTexture(se)}finally{se.destroy()}if(A){L.destroy(!0),L=null;return}i(L)}catch{}})(),()=>{if(A=!0,L){const D=L;L=null,i(F=>F===D?null:F);try{D.destroy(!0)}catch{}}}},[o,s,T,w,O,R,P]),S.useEffect(()=>()=>{l&&(l.current=!1)},[l]),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:c,y:u,width:f,height:d,border:b,roundedCorners:x,crop:v,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r??W.Texture.EMPTY,alpha:r&&a?1:0,x:c,y:u,anchor:.5,width:f,height:d,filters:C,eventMode:"none"})})})},yy=I.memo(eR,(t,e)=>et(t,e,["isDragging"])),tR=({ref:t,...e})=>e.src&&!e.path&&!e.svg?M.jsx(yy,{...e,ref:t}):M.jsx(nR,{...e,ref:t}),nR=({ref:t,...e})=>{const[n,r]=I.useState(null),i=S.useRef(null),o=S.useRef(null),s=S.useRef(null),{path:a,svg:l,visible:c,disabled:u,transformation:{x:f,y:d,width:h,height:p,anchor:m,hexColor:g,fill:y,stroke:b="none",strokeWidth:x=0,colorCorrection:v={},effect:T},pointerdown:w,pointerup:O}=e,{app:C}=at.useApplication(),R=lt({colorCorrection:v,effects:{name:T}});return S.useEffect(()=>{if(!C?.renderer)return;let P;if(l)P=l;else if(a){const N=ZC(a).scale(5).translate(0,0).toString();P=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${p}">
1418
- <path stroke="${b}" stroke-width="${x}" fill="${g||y}" d="${N}">
1417
+ `;class fM extends G.Filter{plate;constructor(e,n=.16,r=.05){const i=G.GlProgram.from({vertex:bo,fragment:dM,name:"plate-key-filter"});super({glProgram:i,resources:{plateUniforms:{uKeyColor:{value:new Float32Array(e),type:"vec3<f32>"},uTolerance:{value:n,type:"f32"},uSoftness:{value:r,type:"f32"}}}}),this.plate=this.resources.plateUniforms.uniforms}get tolerance(){return this.plate.uTolerance}set tolerance(e){this.plate.uTolerance=e}set keyColor(e){this.plate.uKeyColor[0]=e[0],this.plate.uKeyColor[1]=e[1],this.plate.uKeyColor[2]=e[2]}}function hM(t){if(t==null)return null;if(typeof t=="number")return[(t>>16&255)/255,(t>>8&255)/255,(t&255)/255];const e=t.trim(),n=/^#?([0-9a-f]{6})$/i.exec(e)||/^0x([0-9a-f]{6})$/i.exec(e);if(n){const i=parseInt(n[1],16);return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255]}const r=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return r?[Number(r[1])/255,Number(r[2])/255,Number(r[3])/255]:null}const pM=[236/255,234/255,219/255],mM=t=>{if(!t)return{};const e={...t};for(const n of["brightness","contrast","saturation","red","green","blue"])typeof t[n]=="number"&&(e[n]=(t[n]-1)*100);return e},gM=[],_0=t=>{if(t)for(const e of t)try{e.destroy()}catch{}},lt=({colorCorrection:t,effects:e,neonColor:n=null,blendMode:r=0,plateKey:i=null})=>{const{brightness:o=0,contrast:s=0,saturation:a=0,red:l=0,green:c=0,blue:u=0,gamma:f=1,alpha:d=1,temperature:h=0,tint:m=0,hue:p=0,highlights:g=0,shadows:y=0,exposure:_=0,vibrance:v=0,sharpness:x=0,blurRadius:E=0,vignette:T=0,noise:A=0,edgeFeather:M=0}=t??{},C=e?.name||"None",k=e?.intensity??(C==="None"||C==="Normal"?0:100),w=e?.params?JSON.stringify(e.params):"",L=i&&typeof i=="object"?JSON.stringify(i):i,D=O.useMemo(()=>{const{exposureFilter:he,temperatureTintFilter:q,tonalFilter:fe,adjustmentFilter:Y,vibranceFilter:te,hslFilter:z,sharpnessFilter:le,blurFilter:Q,vignetteFilter:ce,noiseFilter:ye,edgeFeatherFilter:U}=m0({brightness:o,contrast:s,saturation:a,red:l,green:c,blue:u,gamma:f,alpha:d,temperature:h,tint:m,hue:p,highlights:g,shadows:y,exposure:_,vibrance:v,sharpness:x,blurRadius:E,vignette:T,noise:A,edgeFeather:M}),{effectFilter:Z}=mc({effect:C,effectIntensity:k,effectParams:e?.params,neonColor:n}),W=[];if(i){const _e=typeof i=="object"?i:{},be=typeof i=="string"?i:_e.color??null,ee=hM(be)??pM;W.push(new fM(ee,_e.tolerance??40/255))}if(he&&W.push(he),q&&W.push(q),fe&&W.push(fe),Y&&W.push(Y),te&&W.push(te),z&&W.push(z),le&&W.push(le),U&&M>0&&W.push(U),Z&&(Array.isArray(Z)?W.push(...Z.filter(_e=>_e!=null)):W.push(Z)),Q&&E>0&&W.push(Q),ce&&T>0&&W.push(ce),ye&&A>0&&W.push(ye),W.length>0){const _e=uM(r);_e&&W.push(_e)}return W},[o,s,a,l,c,u,f,d,h,m,p,g,y,_,v,x,E,T,A,M,C,k,w,n,r,L]),N=O.useRef(null);O.useEffect(()=>{const he=N.current;N.current=D,he&&he!==D&&_0(he)},[D]),O.useEffect(()=>()=>{_0(N.current),N.current=null},[]);const F=O.useContext(Ve),H=F?.registerTimeUpdateListener,V=F?.unregisterTimeUpdateListener,$=O.useRef(gM);$.current=D;const re=O.useRef(-1);return O.useEffect(()=>{if(!H||!V)return;const he=q=>{const fe=q,Y=$.current;if(!(!Y||Y.length===0))for(const te of Y){if(!te)continue;const z=te;if(z.__vfxAnimated===!0){z.time=fe;continue}if(typeof z.refresh=="function"){const Q=Math.floor(fe*12);if(Q!==re.current){const ce=Math.sin(Q*12.9898)*43758.5453;z.seed=ce-Math.floor(ce),z.refresh(),re.current=Q}continue}if(typeof z.time=="number"&&(z.time=fe*.5),typeof z.seed=="number"&&!z.__vfxDreamy&&(z.seed=Math.floor(fe*24)%997/997),typeof z.angle=="number"&&typeof z.time!="number"&&z.offset!==null&&typeof z.offset=="object"&&(z.angle=Math.sin(fe*1.5)*3),typeof z.strength=="number"&&typeof z.centerX=="number"&&typeof z.angle>"u"&&typeof z.time>"u"){z.centerX=.5+Math.sin(fe*.8)*.12,z.centerY=.5+Math.cos(fe*.6)*.12;continue}const le=Q=>.35+(Q.__spinSpeed??.1)*2.5;if(z.__vfxDreamy==="bloom"){const Q=Math.sin(fe*.8*le(z));z.bloomScale=z.__baseBloomScale*(1+.08*Q),z.brightness=z.__baseBrightness*(1+.04*Q);continue}if(z.__vfxDreamy==="blur"){const Q=Math.sin(fe*.6*le(z)+.4);z.strength=z.__baseBlur*(1+.08*Q);continue}if(z.__vfxDreamy==="grain"){const Q=Math.floor(fe*(6+le(z)*14));if(z.seed=Q%997/997,typeof z.__baseVignetting=="number"){const ce=Math.sin(fe*.45*le(z));z.vignetting=z.__baseVignetting*(.94+.08*ce)}continue}}};return H(he),()=>V(he)},[H,V]),D},gc="element-",yc=t=>`${gc}${t}`,yM=t=>t?.startsWith(gc)?t.slice(gc.length):null,_c=(t,e)=>!t||!e?null:t.getChildByLabel(e,!0)??null,_M=t=>{const e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${e}$`)},bc=(t,e)=>{if(!t)return[];const n=_M(e),r=[],i=o=>{for(const s of o.children){const a=s;a.label&&n.test(a.label)&&r.push(a),a.children?.length&&i(a)}};return i(t),r},bM=t=>{const e=(n=>_c(t,n));return e.all=n=>bc(t,n),e.byId=n=>_c(t,yc(n)),e.byType=n=>bc(t,`${n}-*`),e},vM={x:0,y:0,width:0,height:0,anchor:.5,animation:_o.NONE,maxX:0,maxY:0,scale:1,rotation:0,effect:pe.Normal,overlay:Qr.NONE,fontSize:10},Je=({ref:t,...e})=>{const[n]=O.useState(!1),[r]=O.useState(!1),i=O.useRef(null),o=O.useRef(null),s=O.useRef(null),a=O.useRef(null),l=O.useRef(null),{tl:c}=O.useContext(Ve),{app:u}=st.useApplication(),f=u?.renderer?.screen,d=f?.width||1920,h=f?.height||1080,{uniqueId:m,visible:p,startAt:g,endAt:y,transformation:_=vM,disabled:v,pointerdown:x,pointerout:E,pointerover:T,isDragging:A,isGif:M,onContainerRefReady:C,onSpriteRefReady:k,id:w,sortableChildren:L,animationText:D,pivotOffset:N}=e,{x:F=0,y:H=0,width:V,height:$,scale:re=[1,1],rotation:he=0,alpha:q,effect:fe,effects:Y,neonColor:te,blendMode:z,overlay:le,animation:Q=_o.NONE,fontFamily:ce,fontSize:ye,fontWeight:U,fill:Z,color:W,letterSpacing:_e}=_,be=i0(),ee=_,Ee=O.useMemo(()=>{const Le=Ae=>Ae!=null&&(typeof Ae=="string"?Ae!==""&&Ae!=="NONE":typeof Ae=="object"?(Ae.name??"NONE")!=="NONE":!1);return Le(ee.animationIn)||Le(ee.animationOut)||Le(ee.animationLoop)||Array.isArray(ee.keyframes)&&ee.keyframes.length>0},[ee.animationIn,ee.animationOut,ee.animationLoop,ee.keyframes]),de=Number(g)||0,ke=Number(y),je=Ee&&Number.isFinite(ke)&&ke>de;u0(je?{targetRef:i,transformation:{..._,maxX:d,maxY:h},start:de,end:ke,effectOptions:{width:typeof V=="number"?V:void 0,height:typeof $=="number"?$:void 0,text:typeof D=="string"?D:void 0,fontFamily:ce,fontSize:ye,fontWeight:U,fill:Z,color:W,letterSpacing:_e}}:{targetRef:{current:null},transformation:{},start:0,end:0,effectOptions:{}}),tt(Ne.COMPLETE,()=>{i.current}),I.useImperativeHandle(t,()=>({getIsTransformerDragging:()=>n,getIsMouseOverTransformer:()=>r}),[n,r]),I.useEffect(()=>{C&&C(m,i)},[C,m]),I.useEffect(()=>{k&&k(m,s)},[k,m]);const ut=O.useMemo(()=>({x:F,y:H,width:V,height:$,animation:Q,maxX:d,maxY:h}),[Q,F,H,V,$,d,h]);I.useEffect(()=>{if(o.current&&!Ee){if(c.current){const{x:Le,y:Ae,animation:Be,maxX:He,maxY:gt}=ut,ze=c.current.progress(),Re=be.updateEffect(i.current,Be,{immediateRender:!1,x:Le,y:Ae,overwrite:!0,maxX:He,maxY:gt});a.current&&(c.current.remove(a.current),a.current.progress(0).kill()),ze>.1?(Re.eventCallback("onComplete",()=>{Re.remove("onComplete"),c.current.add(Re,g),a.current=Re}),Re.play()):(Re.progress(1),c.current.add(Re,g),a.current=Re)}else a.current&&a.current.progress(0).kill();return()=>{}}},[g,ut,Ee]);const ot=lt({effects:Y??{name:fe},neonColor:te}),ve=h0(z??0),nt=w||yc(m),ct=O.useCallback(Le=>{i.current=Le,Le&&C&&C(m,i)},[C,m]),Me=typeof re=="number"?re:{x:re[0]??1,y:re[1]??1};return R.jsx("pixiContainer",{ref:o,label:`container-${m}`,sortableChildren:L,blendMode:ve,children:R.jsx("pixiContainer",{label:nt,ref:ct,position:{x:F+(N?.x??0),y:H+(N?.y??0)},pivot:{x:F+(N?.x??0),y:H+(N?.y??0)},scale:Me,rotation:he,...!Ee&&typeof q=="number"?{alpha:q}:{},eventMode:"passive",children:R.jsxs("pixiContainer",{ref:l,children:[!M&&R.jsx("pixiContainer",{scale:1,filters:ot,children:R.jsx("pixiContainer",{ref:s,children:e.children})}),M&&R.jsx("pixiContainer",{ref:s,children:e.children}),!Ga(le)&&le!==Qr.NONE&&le!==Qr.NORMAL&&R.jsx(bm,{overlay:le,width:V,height:$,x:F,y:H}),R.jsx("pixiSprite",{texture:K.Texture.WHITE,alpha:0,anchor:.5,x:F,y:H,width:V,height:$,eventMode:!v&&p&&!n&&!A?"static":"none",cursor:"pointer",onPointerDown:x,onPointerOver:T,onPointerOut:E})]})})})};var Xt=(t=>(t.NONE="none",t.HORIZONTAL="horizontal",t.MIRROR="mirror",t.CIRCLE="circle",t.RECTANGLE="rectangle",t.HEART="heart",t.STARS="stars",t))(Xt||{});function vc(t,e,n,r,i,o,s){const a=s?n-i/2+s.x+s.w/2:n,l=s?r-o/2+s.y+s.h/2:r,c=s?s.w:i,u=s?s.h:o,f=c/2,d=u/2;switch(e){case Xt.HORIZONTAL:{const h=u*.6;t.rect(a-f,l-h/2,c,h);break}case Xt.MIRROR:{const h=u*.35;t.rect(a-f,l-d,c,h),t.rect(a-f,l+d-h,c,h);break}case Xt.CIRCLE:{const h=Math.min(f,d);t.circle(a,l,h);break}case Xt.RECTANGLE:{const h=Math.min(c,u)*.15;t.roundRect(a-f,l-d,c,u,h);break}case Xt.HEART:{xM(t,a,l,c,u);break}case Xt.STARS:{const h=Math.min(f,d);t.star(a,l,5,h,h*.5,-Math.PI/2);break}default:t.rect(a-f,l-d,c,u)}}function xM(t,e,n,r,i){const o=e-r/2,s=e+r/2,a=n-i/2,l=n+i/2,c=a+i*.3,u=a+i*.6;t.moveTo(e,c),t.bezierCurveTo(e,a,o,a,o,c),t.bezierCurveTo(o,u,e,l-i*.1,e,l),t.bezierCurveTo(e,l-i*.1,s,u,s,c),t.bezierCurveTo(s,a,e,a,e,c),t.closePath()}const TM=t=>{if(t==null)return 0;if(typeof t=="number")return t;const e=t.replace("#",""),n=parseInt(e,16);return Number.isFinite(n)?n:0},Pt=({x:t=0,y:e=0,width:n=0,height:r=0,border:i,roundedCorners:o=!1,maskShape:s=Xt.NONE,crop:a,spriteRef:l,children:c})=>{const u=O.useRef(null),f=i?.width??0,d=i?.color??null,h=O.useMemo(()=>o?typeof o=="number"?o:Math.min(n,r)*.1:0,[o,n,r]),m=s&&s!==Xt.NONE?s:null,p=!!m||!!o&&h>0||!!a,g=f>0&&d!=null,y=O.useMemo(()=>TM(d),[d]),_=O.useCallback(E=>{if(E.clear(),!!p){if(m)vc(E,m,t,e,n,r,a);else{const T=a?t-n/2+a.x:t-n/2,A=a?e-r/2+a.y:e-r/2,M=a?a.w:n,C=a?a.h:r;E.roundRect(T,A,M,C,h)}E.fill({color:16777215,alpha:1})}},[p,m,t,e,n,r,h,a]),v=O.useCallback(E=>{if(E.clear(),!!g){if(m)vc(E,m,t,e,n,r,a);else{const T=a?t-n/2+a.x:t-n/2,A=a?e-r/2+a.y:e-r/2,M=a?a.w:n,C=a?a.h:r;h>0?E.roundRect(T,A,M,C,h):E.rect(T,A,M,C)}E.stroke({width:f,color:y,alpha:1})}},[g,f,y,h,m,a,t,e,n,r]),x=O.useRef(null);return O.useLayoutEffect(()=>{const E=l?.current??null,T=p&&u.current?u.current:null;x.current&&x.current!==E&&(x.current.mask=null),x.current=E,E&&(E.mask??null)!==T&&(E.mask=T)}),O.useLayoutEffect(()=>()=>{x.current&&(x.current.mask=null),x.current=null},[]),R.jsxs("pixiContainer",{children:[p&&R.jsx("pixiGraphics",{ref:u,draw:_,eventMode:"none"}),c,g&&R.jsx("pixiGraphics",{draw:v,eventMode:"none"})]})};Pt.displayName="BorderMaskContainer";const EM=3e3;function xc(t=EM){const e=new Map,n=new Map;return{acquire(r){const i=n.get(r);i&&(clearTimeout(i),n.delete(r)),e.set(r,(e.get(r)??0)+1)},release(r){const i=(e.get(r)??1)-1;if(i>0){e.set(r,i);return}e.delete(r),!n.has(r)&&n.set(r,setTimeout(()=>{n.delete(r),!e.has(r)&&K.Assets.unload(r).catch(()=>{})},t))}}}function Tc(t){if(!t||typeof t!="string")return t;const e=t.indexOf("/data:");if(e!==-1&&t.startsWith("https://")){const n=t.slice(e+1),r=n.indexOf("?");return r!==-1?n.slice(0,r):n}return t}const b0=xc();function vo(t,e){const n=Tc(t)||t;let r=!1,i=!1;b0.acquire(n);const o=()=>{i||(i=!0,b0.release(n))};let s;const a=new Promise(c=>{s=c});return(e?.forceTextureParser===!1?K.Assets.load(n):K.Assets.load({src:n,loadParser:"loadTextures"})).then(c=>{if(r){s(null);return}try{c?.source&&(c.source.scaleMode=e?.scaleMode??"linear",c.source.autoGenerateMipmaps=e?.enableMipmap??!0)}catch{}s(c)}).catch(c=>{r||console.error("[loadSpriteTexture]",n,c),s(null)}),{promise:a,cancel:()=>{r=!0,s(null),o()},dispose:o}}async function SM(t,e){return vo(t,e)}var Ec,v0;function wM(){if(v0)return Ec;v0=1;function t(){this.__data__=[],this.size=0}return Ec=t,Ec}var Sc,x0;function wc(){if(x0)return Sc;x0=1;function t(e,n){return e===n||e!==e&&n!==n}return Sc=t,Sc}var Ac,T0;function xo(){if(T0)return Ac;T0=1;var t=wc();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return Ac=e,Ac}var Oc,E0;function AM(){if(E0)return Oc;E0=1;var t=xo(),e=Array.prototype,n=e.splice;function r(i){var o=this.__data__,s=t(o,i);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():n.call(o,s,1),--this.size,!0}return Oc=r,Oc}var Mc,S0;function OM(){if(S0)return Mc;S0=1;var t=xo();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return Mc=e,Mc}var Ic,w0;function MM(){if(w0)return Ic;w0=1;var t=xo();function e(n){return t(this.__data__,n)>-1}return Ic=e,Ic}var Cc,A0;function IM(){if(A0)return Cc;A0=1;var t=xo();function e(n,r){var i=this.__data__,o=t(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return Cc=e,Cc}var Rc,O0;function To(){if(O0)return Rc;O0=1;var t=wM(),e=AM(),n=OM(),r=MM(),i=IM();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Rc=o,Rc}var Lc,M0;function CM(){if(M0)return Lc;M0=1;var t=To();function e(){this.__data__=new t,this.size=0}return Lc=e,Lc}var kc,I0;function RM(){if(I0)return kc;I0=1;function t(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r}return kc=t,kc}var Pc,C0;function LM(){if(C0)return Pc;C0=1;function t(e){return this.__data__.get(e)}return Pc=t,Pc}var Dc,R0;function kM(){if(R0)return Dc;R0=1;function t(e){return this.__data__.has(e)}return Dc=t,Dc}var Nc,L0;function Eo(){if(L0)return Nc;L0=1;var t=Wn(),e=t(Object,"create");return Nc=e,Nc}var Fc,k0;function PM(){if(k0)return Fc;k0=1;var t=Eo();function e(){this.__data__=t?t(null):{},this.size=0}return Fc=e,Fc}var Bc,P0;function DM(){if(P0)return Bc;P0=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return Bc=t,Bc}var Uc,D0;function NM(){if(D0)return Uc;D0=1;var t=Eo(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(t){var a=s[o];return a===e?void 0:a}return r.call(s,o)?s[o]:void 0}return Uc=i,Uc}var Gc,N0;function FM(){if(N0)return Gc;N0=1;var t=Eo(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var o=this.__data__;return t?o[i]!==void 0:n.call(o,i)}return Gc=r,Gc}var jc,F0;function BM(){if(F0)return jc;F0=1;var t=Eo(),e="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=t&&i===void 0?e:i,this}return jc=n,jc}var Hc,B0;function UM(){if(B0)return Hc;B0=1;var t=PM(),e=DM(),n=NM(),r=FM(),i=BM();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Hc=o,Hc}var Yc,U0;function GM(){if(U0)return Yc;U0=1;var t=UM(),e=To(),n=ba();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return Yc=r,Yc}var Wc,G0;function jM(){if(G0)return Wc;G0=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return Wc=t,Wc}var Xc,j0;function So(){if(j0)return Xc;j0=1;var t=jM();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Xc=e,Xc}var zc,H0;function HM(){if(H0)return zc;H0=1;var t=So();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return zc=e,zc}var qc,Y0;function YM(){if(Y0)return qc;Y0=1;var t=So();function e(n){return t(this,n).get(n)}return qc=e,qc}var Vc,W0;function WM(){if(W0)return Vc;W0=1;var t=So();function e(n){return t(this,n).has(n)}return Vc=e,Vc}var Kc,X0;function XM(){if(X0)return Kc;X0=1;var t=So();function e(n,r){var i=t(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Kc=e,Kc}var $c,z0;function Zc(){if(z0)return $c;z0=1;var t=GM(),e=HM(),n=YM(),r=WM(),i=XM();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,$c=o,$c}var Jc,q0;function zM(){if(q0)return Jc;q0=1;var t=To(),e=ba(),n=Zc(),r=200;function i(o,s){var a=this.__data__;if(a instanceof t){var l=a.__data__;if(!e||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(o,s),this.size=a.size,this}return Jc=i,Jc}var Qc,V0;function K0(){if(V0)return Qc;V0=1;var t=To(),e=CM(),n=RM(),r=LM(),i=kM(),o=zM();function s(a){var l=this.__data__=new t(a);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=o,Qc=s,Qc}var el,$0;function qM(){if($0)return el;$0=1;var t="__lodash_hash_undefined__";function e(n){return this.__data__.set(n,t),this}return el=e,el}var tl,Z0;function VM(){if(Z0)return tl;Z0=1;function t(e){return this.__data__.has(e)}return tl=t,tl}var nl,J0;function KM(){if(J0)return nl;J0=1;var t=Zc(),e=qM(),n=VM();function r(i){var o=-1,s=i==null?0:i.length;for(this.__data__=new t;++o<s;)this.add(i[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=n,nl=r,nl}var rl,Q0;function $M(){if(Q0)return rl;Q0=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(e[r],r,e))return!0;return!1}return rl=t,rl}var il,eg;function ZM(){if(eg)return il;eg=1;function t(e,n){return e.has(n)}return il=t,il}var ol,tg;function ng(){if(tg)return ol;tg=1;var t=KM(),e=$M(),n=ZM(),r=1,i=2;function o(s,a,l,c,u,f){var d=l&r,h=s.length,m=a.length;if(h!=m&&!(d&&m>h))return!1;var p=f.get(s),g=f.get(a);if(p&&g)return p==a&&g==s;var y=-1,_=!0,v=l&i?new t:void 0;for(f.set(s,a),f.set(a,s);++y<h;){var x=s[y],E=a[y];if(c)var T=d?c(E,x,y,a,s,f):c(x,E,y,s,a,f);if(T!==void 0){if(T)continue;_=!1;break}if(v){if(!e(a,function(A,M){if(!n(v,M)&&(x===A||u(x,A,l,c,f)))return v.push(M)})){_=!1;break}}else if(!(x===E||u(x,E,l,c,f))){_=!1;break}}return f.delete(s),f.delete(a),_}return ol=o,ol}var sl,rg;function ig(){if(rg)return sl;rg=1;var t=Rt(),e=t.Uint8Array;return sl=e,sl}var al,og;function JM(){if(og)return al;og=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i,o){r[++n]=[o,i]}),r}return al=t,al}var cl,sg;function QM(){if(sg)return cl;sg=1;function t(e){var n=-1,r=Array(e.size);return e.forEach(function(i){r[++n]=i}),r}return cl=t,cl}var ll,ag;function eI(){if(ag)return ll;ag=1;var t=dr(),e=ig(),n=wc(),r=ng(),i=JM(),o=QM(),s=1,a=2,l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Map]",d="[object Number]",h="[object RegExp]",m="[object Set]",p="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",_="[object DataView]",v=t?t.prototype:void 0,x=v?v.valueOf:void 0;function E(T,A,M,C,k,w,L){switch(M){case _:if(T.byteLength!=A.byteLength||T.byteOffset!=A.byteOffset)return!1;T=T.buffer,A=A.buffer;case y:return!(T.byteLength!=A.byteLength||!w(new e(T),new e(A)));case l:case c:case d:return n(+T,+A);case u:return T.name==A.name&&T.message==A.message;case h:case p:return T==A+"";case f:var D=i;case m:var N=C&s;if(D||(D=o),T.size!=A.size&&!N)return!1;var F=L.get(T);if(F)return F==A;C|=a,L.set(T,A);var H=r(D(T),D(A),C,k,w,L);return L.delete(T),H;case g:if(x)return x.call(T)==x.call(A)}return!1}return ll=E,ll}var ul,cg;function dl(){if(cg)return ul;cg=1;function t(e,n){for(var r=-1,i=n.length,o=e.length;++r<i;)e[o+r]=n[r];return e}return ul=t,ul}var fl,lg;function ug(){if(lg)return fl;lg=1;var t=dl(),e=rn();function n(r,i,o){var s=i(r);return e(r)?s:t(s,o(r))}return fl=n,fl}var hl,dg;function tI(){if(dg)return hl;dg=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=0,s=[];++r<i;){var a=e[r];n(a,r,e)&&(s[o++]=a)}return s}return hl=t,hl}var pl,fg;function hg(){if(fg)return pl;fg=1;function t(){return[]}return pl=t,pl}var ml,pg;function gl(){if(pg)return ml;pg=1;var t=tI(),e=hg(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(s){return s==null?[]:(s=Object(s),t(i(s),function(a){return r.call(s,a)}))}:e;return ml=o,ml}var yl,mg;function nI(){if(mg)return yl;mg=1;function t(e,n){for(var r=-1,i=Array(e);++r<e;)i[r]=n(r);return i}return yl=t,yl}var _l,gg;function rI(){if(gg)return _l;gg=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??t,!!i&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return _l=n,_l}var bl,yg;function _g(){if(yg)return bl;yg=1;var t=nI(),e=Oa(),n=rn(),r=oo(),i=rI(),o=Ba(),s=Object.prototype,a=s.hasOwnProperty;function l(c,u){var f=n(c),d=!f&&e(c),h=!f&&!d&&r(c),m=!f&&!d&&!h&&o(c),p=f||d||h||m,g=p?t(c.length,String):[],y=g.length;for(var _ in c)(u||a.call(c,_))&&!(p&&(_=="length"||h&&(_=="offset"||_=="parent")||m&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||i(_,y)))&&g.push(_);return g}return bl=l,bl}var vl,bg;function xl(){if(bg)return vl;bg=1;var t=_g(),e=Pp(),n=Ra();function r(i){return n(i)?t(i):e(i)}return vl=r,vl}var Tl,vg;function xg(){if(vg)return Tl;vg=1;var t=ug(),e=gl(),n=xl();function r(i){return t(i,n,e)}return Tl=r,Tl}var El,Tg;function iI(){if(Tg)return El;Tg=1;var t=xg(),e=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a,l,c,u){var f=a&e,d=t(o),h=d.length,m=t(s),p=m.length;if(h!=p&&!f)return!1;for(var g=h;g--;){var y=d[g];if(!(f?y in s:r.call(s,y)))return!1}var _=u.get(o),v=u.get(s);if(_&&v)return _==s&&v==o;var x=!0;u.set(o,s),u.set(s,o);for(var E=f;++g<h;){y=d[g];var T=o[y],A=s[y];if(l)var M=f?l(A,T,y,s,o,u):l(T,A,y,o,s,u);if(!(M===void 0?T===A||c(T,A,a,l,u):M)){x=!1;break}E||(E=y=="constructor")}if(x&&!E){var C=o.constructor,k=s.constructor;C!=k&&"constructor"in o&&"constructor"in s&&!(typeof C=="function"&&C instanceof C&&typeof k=="function"&&k instanceof k)&&(x=!1)}return u.delete(o),u.delete(s),x}return El=i,El}var Sl,Eg;function oI(){if(Eg)return Sl;Eg=1;var t=K0(),e=ng(),n=eI(),r=iI(),i=$r(),o=rn(),s=oo(),a=Ba(),l=1,c="[object Arguments]",u="[object Array]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function m(p,g,y,_,v,x){var E=o(p),T=o(g),A=E?u:i(p),M=T?u:i(g);A=A==c?f:A,M=M==c?f:M;var C=A==f,k=M==f,w=A==M;if(w&&s(p)){if(!s(g))return!1;E=!0,C=!1}if(w&&!C)return x||(x=new t),E||a(p)?e(p,g,y,_,v,x):n(p,g,A,y,_,v,x);if(!(y&l)){var L=C&&h.call(p,"__wrapped__"),D=k&&h.call(g,"__wrapped__");if(L||D){var N=L?p.value():p,F=D?g.value():g;return x||(x=new t),v(N,F,y,_,x)}}return w?(x||(x=new t),r(p,g,y,_,v,x)):!1}return Sl=m,Sl}var wl,Sg;function sI(){if(Sg)return wl;Sg=1;var t=oI(),e=xn();function n(r,i,o,s,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:t(r,i,o,s,n,a)}return wl=n,wl}var Al,wg;function aI(){if(wg)return Al;wg=1;var t=sI();function e(n,r){return t(n,r)}return Al=e,Al}var cI=aI();const lI=lr(cI);var Ol,Ag;function Og(){if(Ag)return Ol;Ag=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=n(e[r],r,e);return o}return Ol=t,Ol}var Ml,Mg;function uI(){if(Mg)return Ml;Mg=1;function t(e,n){for(var r=-1,i=e==null?0:e.length;++r<i&&n(e[r],r,e)!==!1;);return e}return Ml=t,Ml}var Il,Ig;function Cg(){if(Ig)return Il;Ig=1;var t=Wn(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Il=e,Il}var Cl,Rg;function Lg(){if(Rg)return Cl;Rg=1;var t=Cg();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return Cl=e,Cl}var Rl,kg;function Pg(){if(kg)return Rl;kg=1;var t=Lg(),e=wc(),n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a){var l=o[s];(!(r.call(o,s)&&e(l,a))||a===void 0&&!(s in o))&&t(o,s,a)}return Rl=i,Rl}var Ll,Dg;function di(){if(Dg)return Ll;Dg=1;var t=Pg(),e=Lg();function n(r,i,o,s){var a=!o;o||(o={});for(var l=-1,c=i.length;++l<c;){var u=i[l],f=s?s(o[u],r[u],u,o,r):void 0;f===void 0&&(f=r[u]),a?e(o,u,f):t(o,u,f)}return o}return Ll=n,Ll}var kl,Ng;function dI(){if(Ng)return kl;Ng=1;var t=di(),e=xl();function n(r,i){return r&&t(i,e(i),r)}return kl=n,kl}var Pl,Fg;function fI(){if(Fg)return Pl;Fg=1;function t(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}return Pl=t,Pl}var Dl,Bg;function hI(){if(Bg)return Dl;Bg=1;var t=Yn(),e=io(),n=fI(),r=Object.prototype,i=r.hasOwnProperty;function o(s){if(!t(s))return n(s);var a=e(s),l=[];for(var c in s)c=="constructor"&&(a||!i.call(s,c))||l.push(c);return l}return Dl=o,Dl}var Nl,Ug;function Fl(){if(Ug)return Nl;Ug=1;var t=_g(),e=hI(),n=Ra();function r(i){return n(i)?t(i,!0):e(i)}return Nl=r,Nl}var Bl,Gg;function pI(){if(Gg)return Bl;Gg=1;var t=di(),e=Fl();function n(r,i){return r&&t(i,e(i),r)}return Bl=n,Bl}var fi={exports:{}};fi.exports;var jg;function mI(){return jg||(jg=1,(function(t,e){var n=Rt(),r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var f=c.length,d=a?a(f):new c.constructor(f);return c.copy(d),d}t.exports=l})(fi,fi.exports)),fi.exports}var Ul,Hg;function gI(){if(Hg)return Ul;Hg=1;function t(e,n){var r=-1,i=e.length;for(n||(n=Array(i));++r<i;)n[r]=e[r];return n}return Ul=t,Ul}var Gl,Yg;function yI(){if(Yg)return Gl;Yg=1;var t=di(),e=gl();function n(r,i){return t(r,e(r),i)}return Gl=n,Gl}var jl,Wg;function Hl(){if(Wg)return jl;Wg=1;var t=Rp(),e=t(Object.getPrototypeOf,Object);return jl=e,jl}var Yl,Xg;function zg(){if(Xg)return Yl;Xg=1;var t=dl(),e=Hl(),n=gl(),r=hg(),i=Object.getOwnPropertySymbols,o=i?function(s){for(var a=[];s;)t(a,n(s)),s=e(s);return a}:r;return Yl=o,Yl}var Wl,qg;function _I(){if(qg)return Wl;qg=1;var t=di(),e=zg();function n(r,i){return t(r,e(r),i)}return Wl=n,Wl}var Xl,Vg;function Kg(){if(Vg)return Xl;Vg=1;var t=ug(),e=zg(),n=Fl();function r(i){return t(i,n,e)}return Xl=r,Xl}var zl,$g;function bI(){if($g)return zl;$g=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return zl=n,zl}var ql,Zg;function Vl(){if(Zg)return ql;Zg=1;var t=ig();function e(n){var r=new n.constructor(n.byteLength);return new t(r).set(new t(n)),r}return ql=e,ql}var Kl,Jg;function vI(){if(Jg)return Kl;Jg=1;var t=Vl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return Kl=e,Kl}var $l,Qg;function xI(){if(Qg)return $l;Qg=1;var t=/\w*$/;function e(n){var r=new n.constructor(n.source,t.exec(n));return r.lastIndex=n.lastIndex,r}return $l=e,$l}var Zl,ey;function TI(){if(ey)return Zl;ey=1;var t=dr(),e=t?t.prototype:void 0,n=e?e.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return Zl=r,Zl}var Jl,ty;function EI(){if(ty)return Jl;ty=1;var t=Vl();function e(n,r){var i=r?t(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return Jl=e,Jl}var Ql,ny;function SI(){if(ny)return Ql;ny=1;var t=Vl(),e=vI(),n=xI(),r=TI(),i=EI(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",u="[object Set]",f="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",m="[object DataView]",p="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",_="[object Int16Array]",v="[object Int32Array]",x="[object Uint8Array]",E="[object Uint8ClampedArray]",T="[object Uint16Array]",A="[object Uint32Array]";function M(C,k,w){var L=C.constructor;switch(k){case h:return t(C);case o:case s:return new L(+C);case m:return e(C,w);case p:case g:case y:case _:case v:case x:case E:case T:case A:return i(C,w);case a:return new L;case l:case f:return new L(C);case c:return n(C);case u:return new L;case d:return r(C)}}return Ql=M,Ql}var eu,ry;function wI(){if(ry)return eu;ry=1;var t=Yn(),e=Object.create,n=(function(){function r(){}return function(i){if(!t(i))return{};if(e)return e(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return eu=n,eu}var tu,iy;function AI(){if(iy)return tu;iy=1;var t=wI(),e=Hl(),n=io();function r(i){return typeof i.constructor=="function"&&!n(i)?t(e(i)):{}}return tu=r,tu}var nu,oy;function OI(){if(oy)return nu;oy=1;var t=$r(),e=xn(),n="[object Map]";function r(i){return e(i)&&t(i)==n}return nu=r,nu}var ru,sy;function MI(){if(sy)return ru;sy=1;var t=OI(),e=Da(),n=Na(),r=n&&n.isMap,i=r?e(r):t;return ru=i,ru}var iu,ay;function II(){if(ay)return iu;ay=1;var t=$r(),e=xn(),n="[object Set]";function r(i){return e(i)&&t(i)==n}return iu=r,iu}var ou,cy;function CI(){if(cy)return ou;cy=1;var t=II(),e=Da(),n=Na(),r=n&&n.isSet,i=r?e(r):t;return ou=i,ou}var su,ly;function RI(){if(ly)return su;ly=1;var t=K0(),e=uI(),n=Pg(),r=dI(),i=pI(),o=mI(),s=gI(),a=yI(),l=_I(),c=xg(),u=Kg(),f=$r(),d=bI(),h=SI(),m=AI(),p=rn(),g=oo(),y=MI(),_=Yn(),v=CI(),x=xl(),E=Fl(),T=1,A=2,M=4,C="[object Arguments]",k="[object Array]",w="[object Boolean]",L="[object Date]",D="[object Error]",N="[object Function]",F="[object GeneratorFunction]",H="[object Map]",V="[object Number]",$="[object Object]",re="[object RegExp]",he="[object Set]",q="[object String]",fe="[object Symbol]",Y="[object WeakMap]",te="[object ArrayBuffer]",z="[object DataView]",le="[object Float32Array]",Q="[object Float64Array]",ce="[object Int8Array]",ye="[object Int16Array]",U="[object Int32Array]",Z="[object Uint8Array]",W="[object Uint8ClampedArray]",_e="[object Uint16Array]",be="[object Uint32Array]",ee={};ee[C]=ee[k]=ee[te]=ee[z]=ee[w]=ee[L]=ee[le]=ee[Q]=ee[ce]=ee[ye]=ee[U]=ee[H]=ee[V]=ee[$]=ee[re]=ee[he]=ee[q]=ee[fe]=ee[Z]=ee[W]=ee[_e]=ee[be]=!0,ee[D]=ee[N]=ee[Y]=!1;function Ee(de,ke,je,ut,dt,ot){var ve,nt=ke&T,ct=ke&A,Me=ke&M;if(je&&(ve=dt?je(de,ut,dt,ot):je(de)),ve!==void 0)return ve;if(!_(de))return de;var Le=p(de);if(Le){if(ve=d(de),!nt)return s(de,ve)}else{var Ae=f(de),Be=Ae==N||Ae==F;if(g(de))return o(de,nt);if(Ae==$||Ae==C||Be&&!dt){if(ve=ct||Be?{}:m(de),!nt)return ct?l(de,i(ve,de)):a(de,r(ve,de))}else{if(!ee[Ae])return dt?de:{};ve=h(de,Ae,nt)}}ot||(ot=new t);var He=ot.get(de);if(He)return He;ot.set(de,ve),v(de)?de.forEach(function(Re){ve.add(Ee(Re,ke,je,Re,de,ot))}):y(de)&&de.forEach(function(Re,Ue){ve.set(Ue,Ee(Re,ke,je,Ue,de,ot))});var gt=Me?ct?u:c:ct?E:x,ze=Le?void 0:gt(de);return e(ze||de,function(Re,Ue){ze&&(Ue=Re,Re=de[Ue]),n(ve,Ue,Ee(Re,ke,je,Ue,de,ot))}),ve}return su=Ee,su}var au,uy;function wo(){if(uy)return au;uy=1;var t=fr(),e=xn(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return au=r,au}var cu,dy;function LI(){if(dy)return cu;dy=1;var t=rn(),e=wo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(t(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||e(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return cu=i,cu}var lu,fy;function kI(){if(fy)return lu;fy=1;var t=Zc(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var o=function(){var s=arguments,a=i?i.apply(this,s):s[0],l=o.cache;if(l.has(a))return l.get(a);var c=r.apply(this,s);return o.cache=l.set(a,c)||l,c};return o.cache=new(n.Cache||t),o}return n.Cache=t,lu=n,lu}var uu,hy;function PI(){if(hy)return uu;hy=1;var t=kI(),e=500;function n(r){var i=t(r,function(s){return o.size===e&&o.clear(),s}),o=i.cache;return i}return uu=n,uu}var du,py;function DI(){if(py)return du;py=1;var t=PI(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(e,function(s,a,l,c){o.push(l?c.replace(n,"$1"):a||s)}),o});return du=r,du}var fu,my;function NI(){if(my)return fu;my=1;var t=dr(),e=Og(),n=rn(),r=wo(),i=t?t.prototype:void 0,o=i?i.toString:void 0;function s(a){if(typeof a=="string")return a;if(n(a))return e(a,s)+"";if(r(a))return o?o.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return fu=s,fu}var hu,gy;function FI(){if(gy)return hu;gy=1;var t=NI();function e(n){return n==null?"":t(n)}return hu=e,hu}var pu,yy;function mu(){if(yy)return pu;yy=1;var t=rn(),e=LI(),n=DI(),r=FI();function i(o,s){return t(o)?o:e(o,s)?[o]:n(r(o))}return pu=i,pu}var gu,_y;function BI(){if(_y)return gu;_y=1;function t(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}return gu=t,gu}var yu,by;function vy(){if(by)return yu;by=1;var t=wo();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return yu=e,yu}var _u,xy;function UI(){if(xy)return _u;xy=1;var t=mu(),e=vy();function n(r,i){i=t(i,r);for(var o=0,s=i.length;r!=null&&o<s;)r=r[e(i[o++])];return o&&o==s?r:void 0}return _u=n,_u}var bu,Ty;function GI(){if(Ty)return bu;Ty=1;function t(e,n,r){var i=-1,o=e.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(o);++i<o;)s[i]=e[i+n];return s}return bu=t,bu}var vu,Ey;function jI(){if(Ey)return vu;Ey=1;var t=UI(),e=GI();function n(r,i){return i.length<2?r:t(r,e(i,0,-1))}return vu=n,vu}var xu,Sy;function HI(){if(Sy)return xu;Sy=1;var t=mu(),e=BI(),n=jI(),r=vy();function i(o,s){return s=t(s,o),o=n(o,s),o==null||delete o[r(e(s))]}return xu=i,xu}var Tu,wy;function YI(){if(wy)return Tu;wy=1;var t=fr(),e=Hl(),n=xn(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(u){if(!n(u)||t(u)!=r)return!1;var f=e(u);if(f===null)return!0;var d=a.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&s.call(d)==l}return Tu=c,Tu}var Eu,Ay;function WI(){if(Ay)return Eu;Ay=1;var t=YI();function e(n){return t(n)?void 0:n}return Eu=e,Eu}var Su,Oy;function XI(){if(Oy)return Su;Oy=1;var t=dr(),e=Oa(),n=rn(),r=t?t.isConcatSpreadable:void 0;function i(o){return n(o)||e(o)||!!(r&&o&&o[r])}return Su=i,Su}var wu,My;function zI(){if(My)return wu;My=1;var t=dl(),e=XI();function n(r,i,o,s,a){var l=-1,c=r.length;for(o||(o=e),a||(a=[]);++l<c;){var u=r[l];i>0&&o(u)?i>1?n(u,i-1,o,s,a):t(a,u):s||(a[a.length]=u)}return a}return wu=n,wu}var Au,Iy;function qI(){if(Iy)return Au;Iy=1;var t=zI();function e(n){var r=n==null?0:n.length;return r?t(n,1):[]}return Au=e,Au}var Ou,Cy;function VI(){if(Cy)return Ou;Cy=1;function t(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}return Ou=t,Ou}var Mu,Ry;function KI(){if(Ry)return Mu;Ry=1;var t=VI(),e=Math.max;function n(r,i,o){return i=e(i===void 0?r.length-1:i,0),function(){for(var s=arguments,a=-1,l=e(s.length-i,0),c=Array(l);++a<l;)c[a]=s[i+a];a=-1;for(var u=Array(i+1);++a<i;)u[a]=s[a];return u[i]=o(c),t(r,this,u)}}return Mu=n,Mu}var Iu,Ly;function $I(){if(Ly)return Iu;Ly=1;function t(e){return function(){return e}}return Iu=t,Iu}var Cu,ky;function ZI(){if(ky)return Cu;ky=1;function t(e){return e}return Cu=t,Cu}var Ru,Py;function JI(){if(Py)return Ru;Py=1;var t=$I(),e=Cg(),n=ZI(),r=e?function(i,o){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n;return Ru=r,Ru}var Lu,Dy;function QI(){if(Dy)return Lu;Dy=1;var t=800,e=16,n=Date.now;function r(i){var o=0,s=0;return function(){var a=n(),l=e-(a-s);if(s=a,l>0){if(++o>=t)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return Lu=r,Lu}var ku,Ny;function eC(){if(Ny)return ku;Ny=1;var t=JI(),e=QI(),n=e(t);return ku=n,ku}var Pu,Fy;function tC(){if(Fy)return Pu;Fy=1;var t=qI(),e=KI(),n=eC();function r(i){return n(e(i,void 0,t),i+"")}return Pu=r,Pu}var Du,By;function nC(){if(By)return Du;By=1;var t=Og(),e=RI(),n=HI(),r=mu(),i=di(),o=WI(),s=tC(),a=Kg(),l=1,c=2,u=4,f=s(function(d,h){var m={};if(d==null)return m;var p=!1;h=t(h,function(y){return y=r(y,d),p||(p=y.length>1),y}),i(d,a(d),m),p&&(m=e(m,l|c|u,o));for(var g=h.length;g--;)n(m,h[g]);return m});return Du=f,Du}var rC=nC();const Uy=lr(rC),Gy=["mouseOverSpriteRef","mouseOverTransformerRef","spriteHelperRef","canvasImageRef","textEditorRef","onContainerRefReady","onSpriteRefReady"];function rt(t,e,n=[]){if(e.mouseOverTransformerRef?.current?.isDragging)return!0;const i=[...Gy,...n];return lI(Uy(t,i),Uy(e,i))}const iC=({ref:t,...e})=>{const[n,r]=O.useState(null),i=O.useRef(null),o=O.useRef(null),{src:s,uniqueId:a,visible:l,disabled:c,mouseOverSpriteRef:u,transformation:{x:f,y:d,width:h,height:m,anchor:p,colorCorrection:g,effect:y,effects:_,neonColor:v,blendMode:x,border:E,roundedCorners:T,maskShape:A,crop:M,plateKey:C},pointerdown:k}=e,w=Tc(s)||void 0,L=lt({colorCorrection:g,effects:_??{name:y},neonColor:v,blendMode:x,plateKey:C});O.useEffect(()=>{if(!w){r(null);return}const H=vo(w);let V=!0;return H.promise.then($=>{V&&r($)}),()=>{V=!1,H.cancel(),r(null),H.dispose()}},[w]),O.useEffect(()=>()=>{u&&(u.current=!1)},[u]);const D=h&&h>0?h:n?.orig?.width||0,N=m&&m>0?m:n?.orig?.height||0,F=!!n&&n!==K.Texture.EMPTY;return R.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:R.jsx("pixiContainer",{ref:o,children:R.jsx(Pt,{x:f,y:d,width:D,height:N,border:E,roundedCorners:T,maskShape:A,crop:M,spriteRef:i,children:F&&R.jsx("pixiSprite",{label:`sprite-${a}`,texture:n,width:D,height:N,anchor:p,ref:i,alpha:l?1:0,x:f,y:d,filters:L,...!c&&l&&{eventMode:"static",onPointerDown:k}})})})})},Nu=I.memo(iC,(t,e)=>rt(t,e,["isDragging"]));Nu.whyDidYouRender={logOnDifferentValues:!0,customName:"ImageSprite"};var Fu,jy;function oC(){if(jy)return Fu;jy=1;var t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function n(h){return h===10||h===13||h===8232||h===8233||h===32||h===9||h===11||h===12||h===160||h>=5760&&e.indexOf(h)>=0}function r(h){switch(h|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function i(h){return(h|32)===97}function o(h){return h>=48&&h<=57}function s(h){return h>=48&&h<=57||h===43||h===45||h===46}function a(h){this.index=0,this.path=h,this.max=h.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function l(h){for(;h.index<h.max&&n(h.path.charCodeAt(h.index));)h.index++}function c(h){var m=h.path.charCodeAt(h.index);if(m===48){h.param=0,h.index++;return}if(m===49){h.param=1,h.index++;return}h.err="SvgPath: arc flag can be 0 or 1 only (at pos "+h.index+")"}function u(h){var m=h.index,p=m,g=h.max,y=!1,_=!1,v=!1,x=!1,E;if(p>=g){h.err="SvgPath: missed param (at pos "+p+")";return}if(E=h.path.charCodeAt(p),(E===43||E===45)&&(p++,E=p<g?h.path.charCodeAt(p):0),!o(E)&&E!==46){h.err="SvgPath: param should start with 0..9 or `.` (at pos "+p+")";return}if(E!==46){if(y=E===48,p++,E=p<g?h.path.charCodeAt(p):0,y&&p<g&&E&&o(E)){h.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+m+")";return}for(;p<g&&o(h.path.charCodeAt(p));)p++,_=!0;E=p<g?h.path.charCodeAt(p):0}if(E===46){for(x=!0,p++;o(h.path.charCodeAt(p));)p++,v=!0;E=p<g?h.path.charCodeAt(p):0}if(E===101||E===69){if(x&&!_&&!v){h.err="SvgPath: invalid float exponent (at pos "+p+")";return}if(p++,E=p<g?h.path.charCodeAt(p):0,(E===43||E===45)&&p++,p<g&&o(h.path.charCodeAt(p)))for(;p<g&&o(h.path.charCodeAt(p));)p++;else{h.err="SvgPath: invalid float exponent (at pos "+p+")";return}}h.index=p,h.param=parseFloat(h.path.slice(m,p))+0}function f(h){var m,p;m=h.path[h.segmentStart],p=m.toLowerCase();var g=h.data;if(p==="m"&&g.length>2&&(h.result.push([m,g[0],g[1]]),g=g.slice(2),p="l",m=m==="m"?"l":"L"),p==="r")h.result.push([m].concat(g));else for(;g.length>=t[p]&&(h.result.push([m].concat(g.splice(0,t[p]))),!!t[p]););}function d(h){var m=h.max,p,g,y,_,v;if(h.segmentStart=h.index,p=h.path.charCodeAt(h.index),g=i(p),!r(p)){h.err="SvgPath: bad command "+h.path[h.index]+" (at pos "+h.index+")";return}if(_=t[h.path[h.index].toLowerCase()],h.index++,l(h),h.data=[],!_){f(h);return}for(y=!1;;){for(v=_;v>0;v--){if(g&&(v===3||v===4)?c(h):u(h),h.err.length){f(h);return}h.data.push(h.param),l(h),y=!1,h.index<m&&h.path.charCodeAt(h.index)===44&&(h.index++,l(h),y=!0)}if(!y&&(h.index>=h.max||!s(h.path.charCodeAt(h.index))))break}f(h)}return Fu=function(m){var p=new a(m),g=p.max;for(l(p);p.index<g&&!p.err.length;)d(p);return p.result.length&&("mM".indexOf(p.result[0][0])<0?(p.err="SvgPath: string should start with `M` or `m`",p.result=[]):p.result[0][0]="M"),{err:p.err,segments:p.result}},Fu}var Bu,Hy;function Yy(){if(Hy)return Bu;Hy=1;function t(n,r){return[n[0]*r[0]+n[2]*r[1],n[1]*r[0]+n[3]*r[1],n[0]*r[2]+n[2]*r[3],n[1]*r[2]+n[3]*r[3],n[0]*r[4]+n[2]*r[5]+n[4],n[1]*r[4]+n[3]*r[5]+n[5]]}function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}return e.prototype.matrix=function(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0?this:(this.cache=null,this.queue.push(n),this)},e.prototype.translate=function(n,r){return(n!==0||r!==0)&&(this.cache=null,this.queue.push([1,0,0,1,n,r])),this},e.prototype.scale=function(n,r){return(n!==1||r!==1)&&(this.cache=null,this.queue.push([n,0,0,r,0,0])),this},e.prototype.rotate=function(n,r,i){var o,s,a;return n!==0&&(this.translate(r,i),o=n*Math.PI/180,s=Math.cos(o),a=Math.sin(o),this.queue.push([s,a,-a,s,0,0]),this.cache=null,this.translate(-r,-i)),this},e.prototype.skewX=function(n){return n!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(n*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(n){return n!==0&&(this.cache=null,this.queue.push([1,Math.tan(n*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var n=1;n<this.queue.length;n++)this.cache=t(this.cache,this.queue[n]);return this.cache},e.prototype.calc=function(n,r,i){var o;return this.queue.length?(this.cache||(this.cache=this.toArray()),o=this.cache,[n*o[0]+r*o[2]+(i?0:o[4]),n*o[1]+r*o[3]+(i?0:o[5])]):[n,r]},Bu=e,Bu}var Uu,Wy;function sC(){if(Wy)return Uu;Wy=1;var t=Yy(),e={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},n=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,r=/[\s,]+/;return Uu=function(o){var s=new t,a,l;return o.split(n).forEach(function(c){if(c.length){if(typeof e[c]<"u"){a=c;return}switch(l=c.split(r).map(function(u){return+u||0}),a){case"matrix":l.length===6&&s.matrix(l);return;case"scale":l.length===1?s.scale(l[0],l[0]):l.length===2&&s.scale(l[0],l[1]);return;case"rotate":l.length===1?s.rotate(l[0],0,0):l.length===3&&s.rotate(l[0],l[1],l[2]);return;case"translate":l.length===1?s.translate(l[0],0):l.length===2&&s.translate(l[0],l[1]);return;case"skewX":l.length===1&&s.skewX(l[0]);return;case"skewY":l.length===1&&s.skewY(l[0]);return}}}),s},Uu}var Gu,Xy;function aC(){if(Xy)return Gu;Xy=1;var t=Math.PI*2;function e(i,o,s,a){var l=i*a-o*s<0?-1:1,c=i*s+o*a;return c>1&&(c=1),c<-1&&(c=-1),l*Math.acos(c)}function n(i,o,s,a,l,c,u,f,d,h){var m=h*(i-s)/2+d*(o-a)/2,p=-d*(i-s)/2+h*(o-a)/2,g=u*u,y=f*f,_=m*m,v=p*p,x=g*y-g*v-y*_;x<0&&(x=0),x/=g*v+y*_,x=Math.sqrt(x)*(l===c?-1:1);var E=x*u/f*p,T=x*-f/u*m,A=h*E-d*T+(i+s)/2,M=d*E+h*T+(o+a)/2,C=(m-E)/u,k=(p-T)/f,w=(-m-E)/u,L=(-p-T)/f,D=e(1,0,C,k),N=e(C,k,w,L);return c===0&&N>0&&(N-=t),c===1&&N<0&&(N+=t),[A,M,D,N]}function r(i,o){var s=1.3333333333333333*Math.tan(o/4),a=Math.cos(i),l=Math.sin(i),c=Math.cos(i+o),u=Math.sin(i+o);return[a,l,a-l*s,l+a*s,c+u*s,u-c*s,c,u]}return Gu=function(o,s,a,l,c,u,f,d,h){var m=Math.sin(h*t/360),p=Math.cos(h*t/360),g=p*(o-a)/2+m*(s-l)/2,y=-m*(o-a)/2+p*(s-l)/2;if(g===0&&y===0)return[];if(f===0||d===0)return[];f=Math.abs(f),d=Math.abs(d);var _=g*g/(f*f)+y*y/(d*d);_>1&&(f*=Math.sqrt(_),d*=Math.sqrt(_));var v=n(o,s,a,l,c,u,f,d,m,p),x=[],E=v[2],T=v[3],A=Math.max(Math.ceil(Math.abs(T)/(t/4)),1);T/=A;for(var M=0;M<A;M++)x.push(r(E,T)),E+=T;return x.map(function(C){for(var k=0;k<C.length;k+=2){var w=C[k+0],L=C[k+1];w*=f,L*=d;var D=p*w-m*L,N=m*w+p*L;C[k+0]=D+v[0],C[k+1]=N+v[1]}return C})},Gu}var ju,zy;function cC(){if(zy)return ju;zy=1;var t=1e-10,e=Math.PI/180;function n(r,i,o){if(!(this instanceof n))return new n(r,i,o);this.rx=r,this.ry=i,this.ax=o}return n.prototype.transform=function(r){var i=Math.cos(this.ax*e),o=Math.sin(this.ax*e),s=[this.rx*(r[0]*i+r[2]*o),this.rx*(r[1]*i+r[3]*o),this.ry*(-r[0]*o+r[2]*i),this.ry*(-r[1]*o+r[3]*i)],a=s[0]*s[0]+s[2]*s[2],l=s[1]*s[1]+s[3]*s[3],c=((s[0]-s[3])*(s[0]-s[3])+(s[2]+s[1])*(s[2]+s[1]))*((s[0]+s[3])*(s[0]+s[3])+(s[2]-s[1])*(s[2]-s[1])),u=(a+l)/2;if(c<t*u)return this.rx=this.ry=Math.sqrt(u),this.ax=0,this;var f=s[0]*s[1]+s[2]*s[3];c=Math.sqrt(c);var d=u+c/2,h=u-c/2;return this.ax=Math.abs(f)<t&&Math.abs(d-l)<t?90:Math.atan(Math.abs(f)>Math.abs(d-l)?(d-a)/f:f/(d-l))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(d),this.ry=Math.sqrt(h)):(this.ax+=90,this.rx=Math.sqrt(h),this.ry=Math.sqrt(d)),this},n.prototype.isDegenerate=function(){return this.rx<t*this.ry||this.ry<t*this.rx},ju=n,ju}var Hu,qy;function lC(){if(qy)return Hu;qy=1;var t=oC(),e=sC(),n=Yy(),r=aC(),i=cC();function o(s){if(!(this instanceof o))return new o(s);var a=t(s);this.segments=a.segments,this.err=a.err,this.__stack=[]}return o.from=function(s){if(typeof s=="string")return new o(s);if(s instanceof o){var a=new o("");return a.err=s.err,a.segments=s.segments.map(function(l){return l.slice()}),a.__stack=s.__stack.map(function(l){return n().matrix(l.toArray())}),a}throw new Error("SvgPath.from: invalid param type "+s)},o.prototype.__matrix=function(s){var a=this,l;s.queue.length&&this.iterate(function(c,u,f,d){var h,m,p,g;switch(c[0]){case"v":h=s.calc(0,c[1],!0),m=h[0]===0?["v",h[1]]:["l",h[0],h[1]];break;case"V":h=s.calc(f,c[1],!1),m=h[0]===s.calc(f,d,!1)[0]?["V",h[1]]:["L",h[0],h[1]];break;case"h":h=s.calc(c[1],0,!0),m=h[1]===0?["h",h[0]]:["l",h[0],h[1]];break;case"H":h=s.calc(c[1],d,!1),m=h[1]===s.calc(f,d,!1)[1]?["H",h[0]]:["L",h[0],h[1]];break;case"a":case"A":var y=s.toArray(),_=i(c[1],c[2],c[3]).transform(y);if(y[0]*y[3]-y[1]*y[2]<0&&(c[5]=c[5]?"0":"1"),h=s.calc(c[6],c[7],c[0]==="a"),c[0]==="A"&&c[6]===f&&c[7]===d||c[0]==="a"&&c[6]===0&&c[7]===0){m=[c[0]==="a"?"l":"L",h[0],h[1]];break}_.isDegenerate()?m=[c[0]==="a"?"l":"L",h[0],h[1]]:m=[c[0],_.rx,_.ry,_.ax,c[4],c[5],h[0],h[1]];break;case"m":g=u>0,h=s.calc(c[1],c[2],g),m=["m",h[0],h[1]];break;default:for(p=c[0],m=[p],g=p.toLowerCase()===p,l=1;l<c.length;l+=2)h=s.calc(c[l],c[l+1],g),m.push(h[0],h[1])}a.segments[u]=m},!0)},o.prototype.__evaluateStack=function(){var s,a;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(s=n(),a=this.__stack.length;--a>=0;)s.matrix(this.__stack[a].toArray());this.__matrix(s),this.__stack=[]}},o.prototype.toString=function(){var s="",a="",l=!1;this.__evaluateStack();for(var c=0,u=this.segments.length;c<u;c++){var f=this.segments[c],d=f[0];d!==a||d==="m"||d==="M"?(d==="m"&&a==="z"&&(s+=" "),s+=d,l=!1):l=!0;for(var h=1;h<f.length;h++){var m=f[h];h===1?l&&m>=0&&(s+=" "):m>=0&&(s+=" "),s+=m}a=d}return s},o.prototype.translate=function(s,a){return this.__stack.push(n().translate(s,a||0)),this},o.prototype.scale=function(s,a){return this.__stack.push(n().scale(s,!a&&a!==0?s:a)),this},o.prototype.rotate=function(s,a,l){return this.__stack.push(n().rotate(s,a||0,l||0)),this},o.prototype.skewX=function(s){return this.__stack.push(n().skewX(s)),this},o.prototype.skewY=function(s){return this.__stack.push(n().skewY(s)),this},o.prototype.matrix=function(s){return this.__stack.push(n().matrix(s)),this},o.prototype.transform=function(s){return s.trim()?(this.__stack.push(e(s)),this):this},o.prototype.round=function(s){var a=0,l=0,c=0,u=0,f;return s=s||0,this.__evaluateStack(),this.segments.forEach(function(d){var h=d[0].toLowerCase()===d[0];switch(d[0]){case"H":case"h":h&&(d[1]+=c),c=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"V":case"v":h&&(d[1]+=u),u=d[1]-d[1].toFixed(s),d[1]=+d[1].toFixed(s);return;case"Z":case"z":c=a,u=l;return;case"M":case"m":h&&(d[1]+=c,d[2]+=u),c=d[1]-d[1].toFixed(s),u=d[2]-d[2].toFixed(s),a=c,l=u,d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s);return;case"A":case"a":h&&(d[6]+=c,d[7]+=u),c=d[6]-d[6].toFixed(s),u=d[7]-d[7].toFixed(s),d[1]=+d[1].toFixed(s),d[2]=+d[2].toFixed(s),d[3]=+d[3].toFixed(s+2),d[6]=+d[6].toFixed(s),d[7]=+d[7].toFixed(s);return;default:f=d.length,h&&(d[f-2]+=c,d[f-1]+=u),c=d[f-2]-d[f-2].toFixed(s),u=d[f-1]-d[f-1].toFixed(s),d.forEach(function(m,p){p&&(d[p]=+d[p].toFixed(s))});return}}),this},o.prototype.iterate=function(s,a){var l=this.segments,c={},u=!1,f=0,d=0,h=0,m=0,p,g,y;if(a||this.__evaluateStack(),l.forEach(function(_,v){var x=s(_,v,f,d);Array.isArray(x)&&(c[v]=x,u=!0);var E=_[0]===_[0].toLowerCase();switch(_[0]){case"m":case"M":f=_[1]+(E?f:0),d=_[2]+(E?d:0),h=f,m=d;return;case"h":case"H":f=_[1]+(E?f:0);return;case"v":case"V":d=_[1]+(E?d:0);return;case"z":case"Z":f=h,d=m;return;default:f=_[_.length-2]+(E?f:0),d=_[_.length-1]+(E?d:0)}}),!u)return this;for(y=[],p=0;p<l.length;p++)if(typeof c[p]<"u")for(g=0;g<c[p].length;g++)y.push(c[p][g]);else y.push(l[p]);return this.segments=y,this},o.prototype.abs=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toUpperCase(),d;if(u!==f)switch(s[0]=f,u){case"v":s[1]+=c;return;case"a":s[6]+=l,s[7]+=c;return;default:for(d=1;d<s.length;d++)s[d]+=d%2?l:c}},!0),this},o.prototype.rel=function(){return this.iterate(function(s,a,l,c){var u=s[0],f=u.toLowerCase(),d;if(u!==f&&!(a===0&&u==="M"))switch(s[0]=f,u){case"V":s[1]-=c;return;case"A":s[6]-=l,s[7]-=c;return;default:for(d=1;d<s.length;d++)s[d]-=d%2?l:c}},!0),this},o.prototype.unarc=function(){return this.iterate(function(s,a,l,c){var u,f,d,h=[],m=s[0];return m!=="A"&&m!=="a"?null:(m==="a"?(f=l+s[6],d=c+s[7]):(f=s[6],d=s[7]),u=r(l,c,f,d,s[4],s[5],s[1],s[2],s[3]),u.length===0?[[s[0]==="a"?"l":"L",s[6],s[7]]]:(u.forEach(function(p){h.push(["C",p[2],p[3],p[4],p[5],p[6],p[7]])}),h))}),this},o.prototype.unshort=function(){var s=this.segments,a,l,c,u,f;return this.iterate(function(d,h,m,p){var g=d[0],y=g.toUpperCase(),_;h&&(y==="T"?(_=g==="t",c=s[h-1],c[0]==="Q"?(a=c[1]-m,l=c[2]-p):c[0]==="q"?(a=c[1]-c[3],l=c[2]-c[4]):(a=0,l=0),u=-a,f=-l,_||(u+=m,f+=p),s[h]=[_?"q":"Q",u,f,d[1],d[2]]):y==="S"&&(_=g==="s",c=s[h-1],c[0]==="C"?(a=c[3]-m,l=c[4]-p):c[0]==="c"?(a=c[3]-c[5],l=c[4]-c[6]):(a=0,l=0),u=-a,f=-l,_||(u+=m,f+=p),s[h]=[_?"c":"C",u,f,d[1],d[2],d[3],d[4]]))}),this},Hu=o,Hu}var Yu,Vy;function uC(){return Vy||(Vy=1,Yu=lC()),Yu}var dC=uC();const fC=lr(dC),Ky=2,$y=t=>{const e=t.getAttribute("viewBox");if(e){const i=e.trim().split(/[\s,]+/);if(i.length>=4)return Math.max(parseFloat(i[2])||512,parseFloat(i[3])||512)}const n=parseFloat(t.getAttribute("width")||"")||512,r=parseFloat(t.getAttribute("height")||"")||512;return Math.max(n,r)},Zy=t=>t.getAttribute("fill")==="none"||t.querySelector('[fill="none"]')!==null||t.querySelector("[stroke]")!==null,hC=({shouldApply:t,strokeWidth:e,resolution:n,renderWidth:r,renderHeight:i,originalSize:o,isOutline:s})=>{if(t&&e>0){const u=e*n;if(s){const d=Math.min(r,i)/o;return u/d}const f=Math.max(r,i);return u*(o/f)}const l=Math.max(r,i)/n/o,c=s?2:1.5;return Math.max(Ky*l,c*n)},pC=(t,e,n)=>{t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(n)),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.querySelectorAll("path, rect, circle, ellipse, polygon, polyline, line").forEach(r=>{r.setAttribute("stroke",e),r.setAttribute("stroke-width",String(n)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");const i=r.getAttribute("fill");(i==="none"||!i)&&r.setAttribute("fill","none")})},mC=(t,e,n,r,i,o)=>{const s=t.getElementsByTagName("*");for(let a=0;a<s.length;a++){const l=s[a];if(l.hasAttribute("stroke-width")){const c=parseFloat(l.getAttribute("stroke-width")||"")||Ky;l.setAttribute("stroke-width",String(Math.max(c*e,n*r*(i/o))))}}};function Jy(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.querySelector("svg");if(!r)return t;const{resolution:i,stroke:o,strokeWidth:s}=e,a=$y(r),l=Zy(r),c=e.width||a,u=e.height||a,f=c*i,d=u*i,h=!!o&&(s||0)>0,m=hC({shouldApply:h,strokeWidth:s||0,resolution:i,renderWidth:f,renderHeight:d,originalSize:a,isOutline:l});if(r.getAttribute("viewBox")||r.setAttribute("viewBox",`0 0 ${a} ${a}`),r.setAttribute("width",String(f)),r.setAttribute("height",String(d)),r.setAttribute("preserveAspectRatio",l?"xMidYMid meet":"none"),h)pC(r,o,m);else if(l){const p=Math.max(c,u);mC(r,p/a,2,i,a,Math.max(f,d))}return new XMLSerializer().serializeToString(n)}function Qy(t,e){const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.documentElement;if(r.tagName!=="svg")return t;if(!r.getAttribute("viewBox")){const i=parseFloat(r.getAttribute("width")||"")||e.width,o=parseFloat(r.getAttribute("height")||"")||e.height;r.setAttribute("viewBox",`0 0 ${i} ${o}`)}return r.setAttribute("width",String(e.width)),r.setAttribute("height",String(e.height)),e.fill&&r.setAttribute("fill",e.fill),e.stroke&&r.setAttribute("stroke",e.stroke),e.strokeWidth!=null&&r.setAttribute("stroke-width",String(e.strokeWidth)),new XMLSerializer().serializeToString(n)}const e_=t=>{const e=t.toLowerCase();return e.includes(".svg")||e.startsWith("data:image/svg")};function hi(t,e){const[n,r]=O.useState(t);return O.useEffect(()=>{if(Object.is(n,t))return;const i=setTimeout(()=>r(t),Math.max(0,e));return()=>clearTimeout(i)},[t,e]),n}const gC=({ref:t,...e})=>{const n=O.useRef(null),[r,i]=O.useState(null),{app:o}=st.useApplication(),{src:s,visible:a,mouseOverSpriteRef:l,transformation:{x:c,y:u,width:f,height:d,colorCorrection:h,effect:m,effects:p,neonColor:g,blendMode:y,border:_,roundedCorners:v,crop:x,fill:E,stroke:T,strokeWidth:A}}=e,M=lt({colorCorrection:h,effects:p??{name:m},neonColor:g,blendMode:y}),C=hi(f,120),k=hi(d,120);return O.useEffect(()=>{if(!s||!o?.renderer)return;let w=!1,L=null;return(async()=>{try{const N=Math.max(window.devicePixelRatio||2,2),F=Math.max((C||512)*N,512),H=Math.max((k||512)*N,512),V=await fetch(s);if(w||!V.ok)return;const $=await V.text();if(w)return;const re=new K.Graphics().svg(Qy($,{width:F,height:H,fill:E,stroke:T,strokeWidth:A}));try{L=o.renderer.generateTexture(re)}finally{re.destroy()}if(w){L.destroy(!0),L=null;return}i(L)}catch{}})(),()=>{if(w=!0,L){const N=L;L=null,i(F=>F===N?null:F);try{N.destroy(!0)}catch{}}}},[o,s,E,T,A,C,k]),O.useEffect(()=>()=>{l&&(l.current=!1)},[l]),R.jsx(Je,{...e,ref:t,children:R.jsx(Pt,{x:c,y:u,width:f,height:d,border:_,roundedCorners:v,crop:x,spriteRef:n,children:R.jsx("pixiSprite",{ref:n,texture:r??K.Texture.EMPTY,alpha:r&&a?1:0,x:c,y:u,anchor:.5,width:f,height:d,filters:M,eventMode:"none"})})})},t_=I.memo(gC,(t,e)=>rt(t,e,["isDragging"])),yC=({ref:t,...e})=>e.src&&!e.path&&!e.svg?R.jsx(t_,{...e,ref:t}):R.jsx(_C,{...e,ref:t}),_C=({ref:t,...e})=>{const[n,r]=I.useState(null),i=O.useRef(null),o=O.useRef(null),s=O.useRef(null),{path:a,svg:l,visible:c,disabled:u,transformation:{x:f,y:d,width:h,height:m,anchor:p,hexColor:g,fill:y,stroke:_="none",strokeWidth:v=0,colorCorrection:x={},effect:E},pointerdown:T,pointerup:A}=e,{app:M}=st.useApplication(),C=lt({colorCorrection:x,effects:{name:E}});return O.useEffect(()=>{if(!M?.renderer)return;let k;if(l)k=l;else if(a){const D=fC(a).scale(5).translate(0,0).toString();k=`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${m}">
1418
+ <path stroke="${_}" stroke-width="${v}" fill="${g||y}" d="${D}">
1419
1419
  </path>
1420
- </svg>`}else return;let A=null;const L=new W.Graphics().svg(P);try{A=C.renderer.generateTexture(L)}finally{L.destroy()}return r(A),()=>{const N=A;A=null,r(D=>D===N?null:D);try{N?.destroy(!0)}catch{}}},[C,a,l,b,x,g,y,h,p]),M.jsx($e,{...e,ref:t,children:M.jsx("pixiContainer",{ref:o,children:M.jsx("pixiContainer",{ref:s,children:n&&M.jsx("pixiSprite",{texture:n,width:h,height:p,anchor:m,ref:i,x:f,y:d,alpha:c?1:0,...!u&&c&&{eventMode:"static",onPointerDown:w,onPointerUp:O},filters:R})})})})},_y=I.memo(tR,et),vu=t=>{if(!(!t||t===W.Texture.EMPTY))try{t.destroy(!0)}catch{}};function by({src:t,width:e,height:n,stroke:r,strokeWidth:i,resolution:o=2,resizeDebounceMs:s=120}){const[a,l]=S.useState(null),[c,u]=S.useState(!0),f=S.useRef(null),d=ei(e,s),h=ei(n,s);return S.useEffect(()=>{let p=!1,m=null,g=null;const y=(b,x)=>{if(p){x&&vu(b);return}const v=f.current;f.current=x?b:null,l(b),u(!1),v&&v!==b&&vu(v)};if(!t){y(null,!1);return}return u(!0),gy(t)?(async()=>{try{const x=await fetch(t);if(p)return;if(!x.ok){y(null,!1);return}const v=py(await x.text(),{width:d,height:h,resolution:o,stroke:r,strokeWidth:i});if(p)return;const T=URL.createObjectURL(new Blob([v],{type:"image/svg+xml;charset=utf-8"}));m=new Image,m.crossOrigin="anonymous",m.onload=()=>{if(URL.revokeObjectURL(T),p)return;const w=Math.round((d||512)*o),O=Math.round((h||512)*o);try{const C=document.createElement("canvas");C.width=w,C.height=O;const R=C.getContext("2d",{alpha:!0});if(!R||!m){y(null,!1);return}R.clearRect(0,0,w,O),R.drawImage(m,0,0,w,O);const P=new W.CanvasSource({resource:C,scaleMode:"linear",resolution:o});y(new W.Texture({source:P}),!0)}catch{y(null,!1)}},m.onerror=()=>{URL.revokeObjectURL(T),y(null,!1)},m.src=T}catch{y(null,!1)}})():(g=ro(t),g.promise.then(b=>y(b,!1))),()=>{p=!0,g?.cancel(),m&&(m.onload=null,m.onerror=null)}},[t,d,h,r,i,o]),S.useEffect(()=>()=>{vu(f.current),f.current=null},[]),{texture:a,isLoading:c}}const rR=t=>{try{return new W.Color(t).toNumber()}catch{return 16777215}},iR=({ref:t,...e})=>{const n=S.useRef(null),{src:r,uniqueId:i,visible:o,mouseOverSpriteRef:s,transformation:{x:a,y:l,width:c,height:u,colorCorrection:f,effect:d,effects:h,neonColor:p,blendMode:m,border:g,roundedCorners:y,crop:b,color:x,fill:v,stroke:T,strokeColor:w,strokeWidth:O}}=e,C=lt({colorCorrection:f,effects:h??{name:d},neonColor:p,blendMode:m}),{texture:R}=by({src:r,width:c,height:u,stroke:T||w,strokeWidth:O}),P=S.useMemo(()=>rR(x||v||"black"),[x,v]),A=!!R&&R!==W.Texture.EMPTY;return S.useEffect(()=>()=>{s&&(s.current=!1)},[s]),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:g,roundedCorners:y,crop:b,spriteRef:n,children:M.jsx("pixiSprite",{label:`sprite-${i}`,ref:n,texture:A?R:W.Texture.EMPTY,alpha:A&&o?1:0,x:a,y:l,anchor:.5,width:c||(A?c:100),height:u||(A?u:100),tint:A?P:16777215,filters:C,eventMode:"none"},`sprite-${i}`)})})},oR=I.memo(iR,(t,e)=>et(t,e,["isDragging"]));function lo(){return lo=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lo.apply(this,arguments)}var yt,Tu,ti,xy,ni,vy,Ty=function(){return yt||typeof window<"u"&&(yt=window.gsap)&&yt.registerPlugin&&yt},Eu=function(e){return typeof e=="function"},uo=Math.atan2,Ey=Math.cos,Sy=Math.sin,Fn=Math.sqrt,fo=Math.PI,wy=fo*2,sR=fo*.3,aR=fo*.7,Su=1e20,ri=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,cR=/(^[#.][a-z]|[a-y][a-z])/i,lR=/[achlmqstvz]/i,yn=function(e){return console&&console.warn(e)},Ut=function(e){return Math.round(e*1e5)/1e5||0},Ay=function(e){var n=e.length,r=0,i=0,o;for(o=0;o<n;o++)r+=e[o++],i+=e[o];return[r/(n/2),i/(n/2)]},fr=function(e){var n=e.length,r=e[0],i=r,o=e[1],s=o,a,l,c;for(c=6;c<n;c+=6)a=e[c],l=e[c+1],a>r?r=a:a<i&&(i=a),l>o?o=l:l<s&&(s=l);return e.centerX=(r+i)/2,e.centerY=(o+s)/2,e.size=(r-i)*(o-s)},ii=function(e,n){n===void 0&&(n=3);for(var r=e.length,i=e[0][0],o=i,s=e[0][1],a=s,l=1/n,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C;--r>-1;)for(h=e[r],c=h.length,d=6;d<c;d+=6)for(y=h[d],b=h[d+1],x=h[d+2]-y,w=h[d+3]-b,v=h[d+4]-y,O=h[d+5]-b,T=h[d+6]-y,C=h[d+7]-b,p=n;--p>-1;)m=l*p,g=1-m,u=(m*m*T+3*g*(m*v+g*x))*m+y,f=(m*m*C+3*g*(m*O+g*w))*m+b,u>i?i=u:u<o&&(o=u),f>s?s=f:f<a&&(a=f);return e.centerX=(i+o)/2,e.centerY=(s+a)/2,e.left=o,e.width=i-o,e.top=a,e.height=s-a,e.size=(i-o)*(s-a)},Oy=function(e,n){return n.length-e.length},Cy=function(e,n){var r=e.size||fr(e),i=n.size||fr(n);return Math.abs(i-r)<(r+i)/20?n.centerX-e.centerX||n.centerY-e.centerY:i-r},Ry=function(e,n){var r=e.slice(0),i=e.length,o=i-2,s,a;for(n=n|0,s=0;s<i;s++)a=(s+n)%o,e[s++]=r[a],e[s]=r[a+1]},wu=function(e,n,r,i,o){var s=e.length,a=0,l=s-2,c,u,f,d;for(r*=6,u=0;u<s;u+=6)c=(u+r)%l,d=e[c]-(n[u]-i),f=e[c+1]-(n[u+1]-o),a+=Fn(f*f+d*d);return a},uR=function(e,n,r){var i=e.length,o=Ay(e),s=Ay(n),a=s[0]-o[0],l=s[1]-o[1],c=wu(e,n,0,a,l),u=0,f,d,h;for(h=6;h<i;h+=6)d=wu(e,n,h/6,a,l),d<c&&(c=d,u=h);if(r)for(f=e.slice(0),nr(f),h=6;h<i;h+=6)d=wu(f,n,h/6,a,l),d<c&&(c=d,u=-h);return u/6},fR=function(e,n,r){for(var i=e.length,o=Su,s=0,a=0,l,c,u,f,d,h;--i>-1;)for(l=e[i],h=l.length,d=0;d<h;d+=6)c=l[d]-n,u=l[d+1]-r,f=Fn(c*c+u*u),f<o&&(o=f,s=l[d],a=l[d+1]);return[s,a]},dR=function(e,n,r,i,o,s){var a=n.length,l=0,c=Math.min(e.size||fr(e),n[r].size||fr(n[r]))*i,u=Su,f=e.centerX+o,d=e.centerY+s,h,p,m,g,y;for(p=r;p<a&&(h=n[p].size||fr(n[p]),!(h<c));p++)m=n[p].centerX-f,g=n[p].centerY-d,y=Fn(m*m+g*g),y<u&&(l=p,u=y);return y=n[l],n.splice(l,1),y},hR=function(e,n,r){r===void 0&&(r=1);for(var i=e[n],o=e[n+1],s=e[n+2],a=e[n+3],l=e[n+4],c=e[n+5],u=e[n+6],f=e[n+7],d,h,p,m,g,y,b,x,v;r-- >0;)d=1-1/(r+2),h=i+(s-i)*d,p=s+(l-s)*d,m=o+(a-o)*d,g=a+(c-a)*d,y=h+(p-h)*d,b=m+(g-m)*d,x=l+(u-l)*d,v=c+(f-c)*d,p+=(x-p)*d,g+=(v-g)*d,e.splice(n+2,4,s=Ut(h),a=Ut(m),l=Ut(y),c=Ut(b),u=Ut(y+(p-y)*d),f=Ut(b+(g-b)*d),Ut(p),Ut(g),Ut(x),Ut(v))},pR=function(e){for(var n=e.length,r=-Su,i;n--;)e[n]>r&&(r=e[n],i=n);return i},ho=function(e,n){for(var r=[],i=[],o=e.length-2,s=0;s<o;s+=6)r.push(Math.pow(e[s]-e[s+6],2)+Math.pow(e[s+1]-e[s+7],2));for(;n--;)s=pR(r),i[s]=o=(i[s]||0)+1,r[s]*=o/(o+1);for(s=r.length;s--;)i[s]&&hR(e,s*6,i[s])},Au=function(e,n){return n||Zt(e),Math.max(4,Math.round(e.totalLength/4))},Iy=function(e){return e.slice(0).sort(Oy)},My=function(e){for(var n=e[0],r=e[1],i=2;i<e.length;i+=2)if(Math.abs(e[i]-n)>.01||Math.abs(e[i+1]-r)>.01)return!1;return!0},Ou=function(e,n){n=n||{};var r=n,i=r.redraw,o=r.points,s=r.maxSegments,a=s===void 0?999:s,l=0,c=e,u=Array.isArray(o)?o:0,f,d,h,p,m;if(i=i!==!1,i)Zt(e);else for(e.totalPoints=0,d=e.length;d--;)e.totalPoints+=e[d].length;for(u?(c=Iy(e),u=Iy(u),m=u[0].totalLength/Math.round(u[0].length/6)):((!o||o==="auto")&&(o=Au(e,i),i||(o-=Math.round(e.totalPoints/6))),o=Math.max(i?10:4,Math.min(999,o))),d=0;d<c.length;d++){if(h=c[d],f=Math.max(i?10:4,u?Math.round(u[d]?u[d].length/6:c[d].totalLength/m||0):Math.round((l/o+(i?h.totalLength/e.totalLength:h.length/e.totalPoints))*o)-l),!(d>=a||u&&(!u[d]||My(u[d]))))if(i){var g;p=qi(MS(h,f),n.curviness),h.length=0,(g=h).push.apply(g,p)}else ho(h,f);l+=f}return e},Cu=function(e,n,r,i,o){var s=n.length-e.length,a=s>0?n:e,l=s>0?e:n,c=0,u=i==="complexity"?Oy:Cy,f=i==="position"?0:typeof i=="number"?i:.8,d=l.length,h=typeof r=="object"&&r.push?r.slice(0):[r],p=h[0]==="reverse"||h[0]<0,m=r==="log",g,y,b,x,v,T,w;if(l[0]){if(a.length>1&&(e.sort(u),n.sort(u),a.size||ii(a),l.size||ii(l),T=a.centerX-l.centerX,w=a.centerY-l.centerY,u===Cy))for(d=0;d<l.length;d++)a.splice(d,0,dR(l[d],a,d,f,T,w));if(s)for(s<0&&(s=-s),a[0].length>l[0].length&&ho(l[0],(a[0].length-l[0].length)/6|0),d=l.length;c<s;)x=a[d].size||fr(a[d]),b=fR(l,a[d].centerX,a[d].centerY),x=b[0],v=b[1],l[d++]=[x,v,x,v,x,v,x,v],l.totalPoints+=8,c++;for(d=0;d<e.length;d++)g=n[d],y=e[d],s=g.length-y.length,s<0?ho(g,-s/6|0):s>0&&ho(y,s/6|0),p&&o!==!1&&!y.reversed&&nr(y),r=h[d]||h[d]===0?h[d]:"auto",r&&(y.closed||Math.abs(y[0]-y[y.length-2])<.5&&Math.abs(y[1]-y[y.length-1])<.5?r==="auto"||r==="log"?(h[d]=r=uR(y,g,!d||o===!1),r<0&&(p=!0,nr(y),r=-r),Ry(y,r*6)):r!=="reverse"&&(d&&r<0&&nr(y),Ry(y,(r<0?-r:r)*6)):!p&&(r==="auto"&&Math.abs(g[0]-y[0])+Math.abs(g[1]-y[1])+Math.abs(g[g.length-2]-y[y.length-2])+Math.abs(g[g.length-1]-y[y.length-1])>Math.abs(g[0]-y[y.length-2])+Math.abs(g[1]-y[y.length-1])+Math.abs(g[g.length-2]-y[0])+Math.abs(g[g.length-1]-y[1])||r%2)?(nr(y),h[d]=-1,p=!0):r==="auto"?h[d]=0:r==="reverse"&&(h[d]=-1),y.closed!==g.closed&&(y.closed=g.closed=!1));return m&&yn("shapeIndex:["+h.join(",")+"]"),e.shapeIndex=h,h}},Ly=function(e,n,r,i,o){var s=kt(e[0]),a=kt(e[1]);Cu(s,a,n||n===0?n:"auto",r,o)&&(e[0]=hn(s),e[1]=hn(a),(i==="log"||i===!0)&&yn('precompile:["'+e[0]+'","'+e[1]+'"]'))},mR=function(e,n){if(!n)return e;var r=e.match(ri)||[],i=r.length,o="",s,a,l;for(n==="reverse"?(a=i-1,s=-2):(a=((parseInt(n,10)||0)*2+1+i*100)%i,s=2),l=0;l<i;l+=2)o+=r[a-1]+","+r[a]+" ",a=(a+s)%i;return o},Py=function(e,n){var r=0,i=parseFloat(e[0]),o=parseFloat(e[1]),s=i+","+o+" ",a=.999999,l,c,u,f,d,h,p;for(u=e.length,l=n*.5/(u*.5-1),c=0;c<u-2;c+=2){if(r+=l,h=parseFloat(e[c+2]),p=parseFloat(e[c+3]),r>a)for(d=1/(Math.floor(r)+1),f=1;r>a;)s+=(i+(h-i)*d*f).toFixed(2)+","+(o+(p-o)*d*f).toFixed(2)+" ",r--,f++;s+=h+","+p+" ",i=h,o=p}return s},Ru=function(e){var n=e[0].match(ri)||[],r=e[1].match(ri)||[],i=r.length-n.length;i>0?e[0]=Py(n,i):e[1]=Py(r,-i)},gR=function(e){return isNaN(e)?Ru:function(n){Ru(n),n[1]=mR(n[1],parseInt(e,10))}},yR=function(e,n,r){var i=typeof e=="string",o,s;return(!i||cR.test(e)||(e.match(ri)||[]).length<3)&&(o=Tu(e)[0],o?(s=(o.nodeName+"").toUpperCase(),n&&s!=="PATH"&&(o=va(o,!1),s="PATH"),e=o.getAttribute(s==="PATH"?"d":"points")||"",o===r&&(e=o.getAttributeNS(null,"data-original")||e)):(yn("WARNING: invalid morph to: "+e),e=!1)),e},Ny=function(e){for(var n=e.length,r,i,o,s,a,l,c,u;--n>-1;)for(r=e[n],u=r.cpData=r.cpData||[],u.length=0,c=r.length-2,l=0;l<c;l+=6)i=r[l]-r[l+2],o=r[l+1]-r[l+3],s=r[l+6]-r[l+4],a=r[l+7]-r[l+5],u[l+2]=uo(o,i),u[l+3]=Fn(i*i+o*o),u[l+4]=uo(a,s),u[l+5]=Fn(s*s+a*a);return e},ky=function(e){var n=e.trim().split(" "),r=~e.indexOf("left")?0:~e.indexOf("right")?100:isNaN(parseFloat(n[0]))?50:parseFloat(n[0]),i=~e.indexOf("top")?0:~e.indexOf("bottom")?100:isNaN(parseFloat(n[1]))?50:parseFloat(n[1]);return{x:r/100,y:i/100}},Dy=function(e){return e!==e%fo?e+(e<0?wy:-wy):e},Fy="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",_R=function(e,n,r,i){var o=this._origin,s=this._eOrigin,a=e[r]-o.x,l=e[r+1]-o.y,c=Fn(a*a+l*l),u=uo(l,a),f,d;return a=n[r]-s.x,l=n[r+1]-s.y,f=uo(l,a)-u,d=Dy(f),!i&&ti&&Math.abs(d+ti.ca)<sR&&(i=ti),this._anchorPT=ti={_next:this._anchorPT,t:e,sa:u,ca:i&&d*i.ca<0&&Math.abs(d)>aR?f:d,sl:c,cl:Fn(a*a+l*l)-c,i:r}},By=function(e){yt=Ty(),ni=ni||yt&&yt.plugins.morphSVG,yt&&ni?(Tu=yt.utils.toArray,vy=yt.core.reverting||function(){},ni.prototype._tweenRotation=_R,xy=1):e&&yn("Please gsap.registerPlugin(MorphSVGPlugin)")},dr={version:"3.15.0",name:"morphSVG",rawVars:1,register:function(e,n){yt=e,ni=n,By()},init:function(e,n,r,i,o){if(xy||By(1),!n)return yn("invalid shape"),!1;Eu(n)&&(n=n.call(r,i,e,o));var s,a,l,c,u,f,d,h,p,m,g,y,b,x,v,T,w,O,C,R;if(typeof n=="string"||n.getBBox||n[0])n={shape:n};else if(typeof n=="object"){s={};for(a in n)s[a]=Eu(n[a])&&a!=="render"?n[a].call(r,i,e,o):n[a];n=s}var P=e.nodeType?window.getComputedStyle(e):{},A=P.fill+"",L=!(A==="none"||(A.match(ri)||[])[3]==="0"||P.fillRule==="evenodd"),N=n.smooth,D=(n.origin||"50 50").split(",");if(N===!0||N==="auto"?N={}:typeof N=="number"&&(N={points:N}),s=(e.nodeName+"").toUpperCase(),u=s==="POLYLINE"||s==="POLYGON",s!=="PATH"&&!u&&!n.prop)return yn("Cannot morph a <"+s+"> element. "+Fy),!1;if(a=s==="PATH"?"d":"points",!n.prop&&!Eu(e.setAttribute))return!1;if(c=yR(n.shape||n.d||n.points||"",a==="d",e),u&&lR.test(c))return yn("A <"+s+"> cannot accept path data. "+Fy),!1;if(f=n.shapeIndex||n.shapeIndex===0?n.shapeIndex:"auto",d=n.map||dr.defaultMap,this._prop=n.prop,this._render=n.render||dr.defaultRender,this._apply="updateTarget"in n?n.updateTarget:dr.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(n.precision)?2:+n.precision),this._tween=r,c){if(this._target=e,w=typeof n.precompile=="object",m=this._original=this._prop?e[this._prop]:e.getAttribute(a),!this._prop&&!e.getAttributeNS(null,"data-original")&&e.setAttributeNS(null,"data-original",m),a==="d"||this._prop){if(m=kt(w?n.precompile[0]:m),g=kt(w?n.precompile[1]:c),N){for(b=m.length;--b;)My(m[b])&&m.splice(b,1);Ou(m,lo({},N,{points:+N.points||Math.max(Au(m),Au(g)),maxSegments:g.length})),Ou(g,N.redraw===!1?N:lo({},N,{points:m}))}if(!w&&!Cu(m,g,f,d,L))return!1;for((n.precompile==="log"||n.precompile===!0)&&yn('precompile:["'+hn(m)+'","'+hn(g)+'"]'),C=(n.type||dr.defaultType)!=="linear",R=n.curveMode||C,Ny(m),Ny(g),C&&(m.size||ii(m),g.size||ii(g),O=ky(D[0]),this._origin=m.origin={x:m.left+O.x*m.width,y:m.top+O.y*m.height},D[1]&&(O=ky(D[1])),this._eOrigin={x:g.left+O.x*g.width,y:g.top+O.y*g.height}),this._rawPath=e._gsRawPath=m,b=m.length;--b>-1;){for(v=m[b],T=g[b],h=v.cpData,p=T.cpData,x=v.length,ti=0,y=0;y<x;y+=6)(T[y]!==v[y]||T[y+1]!==v[y+1])&&(C?l=this._tweenRotation(v,T,y):(l=this.add(v,y,v[y],T[y],0,0,0,0,0,1),l=this.add(v,y+1,v[y+1],T[y+1],0,0,0,0,0,1)||l));for(y=0;y<x;y+=2)R&&(h[y]!==p[y]||h[y+1]!==p[y+1])&&h[y+1]&&p[y+1]?this._controlPT={_next:this._controlPT,i:y,j:b,ai:y%6>3?y+2:y-2,sa:h[y],ca:Dy(p[y]-h[y]),sl:h[y+1],cl:p[y+1]-h[y+1]}:(T[y]!==v[y]&&(l=this.add(v,y,v[y],T[y],0,0,0,0,0,1)),T[y+1]!==v[y+1]&&(l=this.add(v,y+1,v[y+1],T[y+1],0,0,0,0,0,1)||l))}}else l=this.add(e,"setAttribute",e.getAttribute(a)+"",c+"",i,o,0,gR(f),a);C&&(this.add(this._origin,"x",this._origin.x,this._eOrigin.x,0,0,0,0,0,1),l=this.add(this._origin,"y",this._origin.y,this._eOrigin.y,0,0,0,0,0,1)),l&&(this._props.push("morphSVG"),l.end=N&&N.persist!==!1?hn(g):c,l.endProp=a)}return 1},render:function(e,n){for(var r=n._rawPath,i=n._controlPT,o=n._anchorPT,s=n._rnd,a=n._target,l=n._pt,c,u,f,d,h,p,m,g,y;l;)l.r(e,l.d),l=l._next;if(e===1&&n._apply)for(l=n._pt;l;)l.end&&(n._prop?a[n._prop]=l.end:a.setAttribute(l.endProp,l.end)),l=l._next;else if(r){for(;o;)h=o.sa+e*o.ca,d=o.sl+e*o.cl,o.t[o.i]=n._origin.x+Ey(h)*d,o.t[o.i+1]=n._origin.y+Sy(h)*d,o=o._next;for(;i;)f=r[i.j],p=i.i,h=i.sa+e*i.ca,g=Sy(h),y=Ey(h),d=i.sl+e*i.cl,f[p]=f[i.ai]-y*d,f[p+1]=f[i.ai+1]-g*d,i=i._next;if(!e&&vy()&&(r=kt(n._original)),a._gsRawPath=r,n._apply){for(c="",u=" ",m=0;m<r.length;m++){for(f=r[m],d=f.length,c+="M"+(f[0]*s|0)/s+u+(f[1]*s|0)/s+" C",p=2;p<d;p++)c+=(f[p]*s|0)/s+u;f.closed&&(c+="z")}n._prop?a[n._prop]=c:a.setAttribute("d",c)}}n._render&&r&&n._render.call(n._tween,r,a)},kill:function(e){this._pt=this._rawPath=0},getRawPath:Hr,stringToRawPath:kt,rawPathToString:hn,smoothRawPath:Ou,normalizeStrings:function(e,n,r){var i=r.shapeIndex,o=r.map,s=[e,n];return Ly(s,i,o),s},pathFilter:Ly,pointsFilter:Ru,getTotalSize:ii,equalizeSegmentQuantity:Cu,convertToPath:function(e,n){return Tu(e).map(function(r){return va(r,n!==!1)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};Ty()&&yt.registerPlugin(dr),E.gsap.registerPlugin(dr);const Uy=(t,e,n,r,i,o,s)=>`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${n}" viewBox="${r}">
1420
+ </svg>`}else return;let w=null;const L=new K.Graphics().svg(k);try{w=M.renderer.generateTexture(L)}finally{L.destroy()}return r(w),()=>{const D=w;w=null,r(N=>N===D?null:N);try{D?.destroy(!0)}catch{}}},[M,a,l,_,v,g,y,h,m]),R.jsx(Je,{...e,ref:t,children:R.jsx("pixiContainer",{ref:o,children:R.jsx("pixiContainer",{ref:s,children:n&&R.jsx("pixiSprite",{texture:n,width:h,height:m,anchor:p,ref:i,x:f,y:d,alpha:c?1:0,...!u&&c&&{eventMode:"static",onPointerDown:T,onPointerUp:A},filters:C})})})})},n_=I.memo(yC,rt),Wu=t=>{if(!(!t||t===K.Texture.EMPTY))try{t.destroy(!0)}catch{}};function r_({src:t,width:e,height:n,stroke:r,strokeWidth:i,resolution:o=2,resizeDebounceMs:s=120}){const[a,l]=O.useState(null),[c,u]=O.useState(!0),f=O.useRef(null),d=hi(e,s),h=hi(n,s);return O.useEffect(()=>{let m=!1,p=null,g=null;const y=(_,v)=>{if(m){v&&Wu(_);return}const x=f.current;f.current=v?_:null,l(_),u(!1),x&&x!==_&&Wu(x)};if(!t){y(null,!1);return}return u(!0),e_(t)?(async()=>{try{const v=await fetch(t);if(m)return;if(!v.ok){y(null,!1);return}const x=Jy(await v.text(),{width:d,height:h,resolution:o,stroke:r,strokeWidth:i});if(m)return;const E=URL.createObjectURL(new Blob([x],{type:"image/svg+xml;charset=utf-8"}));p=new Image,p.crossOrigin="anonymous",p.onload=()=>{if(URL.revokeObjectURL(E),m)return;const T=Math.round((d||512)*o),A=Math.round((h||512)*o);try{const M=document.createElement("canvas");M.width=T,M.height=A;const C=M.getContext("2d",{alpha:!0});if(!C||!p){y(null,!1);return}C.clearRect(0,0,T,A),C.drawImage(p,0,0,T,A);const k=new K.CanvasSource({resource:M,scaleMode:"linear",resolution:o});y(new K.Texture({source:k}),!0)}catch{y(null,!1)}},p.onerror=()=>{URL.revokeObjectURL(E),y(null,!1)},p.src=E}catch{y(null,!1)}})():(g=vo(t),g.promise.then(_=>y(_,!1))),()=>{m=!0,g?.cancel(),p&&(p.onload=null,p.onerror=null)}},[t,d,h,r,i,o]),O.useEffect(()=>()=>{Wu(f.current),f.current=null},[]),{texture:a,isLoading:c}}const bC=t=>{try{return new K.Color(t).toNumber()}catch{return 16777215}},vC=({ref:t,...e})=>{const n=O.useRef(null),{src:r,uniqueId:i,visible:o,mouseOverSpriteRef:s,transformation:{x:a,y:l,width:c,height:u,colorCorrection:f,effect:d,effects:h,neonColor:m,blendMode:p,border:g,roundedCorners:y,crop:_,color:v,fill:x,stroke:E,strokeColor:T,strokeWidth:A}}=e,M=lt({colorCorrection:f,effects:h??{name:d},neonColor:m,blendMode:p}),{texture:C}=r_({src:r,width:c,height:u,stroke:E||T,strokeWidth:A}),k=O.useMemo(()=>bC(v||x||"black"),[v,x]),w=!!C&&C!==K.Texture.EMPTY;return O.useEffect(()=>()=>{s&&(s.current=!1)},[s]),R.jsx(Je,{...e,ref:t,children:R.jsx(Pt,{x:a,y:l,width:c,height:u,border:g,roundedCorners:y,crop:_,spriteRef:n,children:R.jsx("pixiSprite",{label:`sprite-${i}`,ref:n,texture:w?C:K.Texture.EMPTY,alpha:w&&o?1:0,x:a,y:l,anchor:.5,width:c||(w?c:100),height:u||(w?u:100),tint:w?k:16777215,filters:M,eventMode:"none"},`sprite-${i}`)})})},xC=I.memo(vC,(t,e)=>rt(t,e,["isDragging"]));function Ao(){return Ao=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ao.apply(this,arguments)}var vt,Xu,pi,i_,mi,o_,s_=function(){return vt||typeof window<"u"&&(vt=window.gsap)&&vt.registerPlugin&&vt},zu=function(e){return typeof e=="function"},Oo=Math.atan2,a_=Math.cos,c_=Math.sin,qn=Math.sqrt,Mo=Math.PI,l_=Mo*2,TC=Mo*.3,EC=Mo*.7,qu=1e20,gi=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,SC=/(^[#.][a-z]|[a-y][a-z])/i,wC=/[achlmqstvz]/i,An=function(e){return console&&console.warn(e)},zt=function(e){return Math.round(e*1e5)/1e5||0},u_=function(e){var n=e.length,r=0,i=0,o;for(o=0;o<n;o++)r+=e[o++],i+=e[o];return[r/(n/2),i/(n/2)]},Tr=function(e){var n=e.length,r=e[0],i=r,o=e[1],s=o,a,l,c;for(c=6;c<n;c+=6)a=e[c],l=e[c+1],a>r?r=a:a<i&&(i=a),l>o?o=l:l<s&&(s=l);return e.centerX=(r+i)/2,e.centerY=(o+s)/2,e.size=(r-i)*(o-s)},yi=function(e,n){n===void 0&&(n=3);for(var r=e.length,i=e[0][0],o=i,s=e[0][1],a=s,l=1/n,c,u,f,d,h,m,p,g,y,_,v,x,E,T,A,M;--r>-1;)for(h=e[r],c=h.length,d=6;d<c;d+=6)for(y=h[d],_=h[d+1],v=h[d+2]-y,T=h[d+3]-_,x=h[d+4]-y,A=h[d+5]-_,E=h[d+6]-y,M=h[d+7]-_,m=n;--m>-1;)p=l*m,g=1-p,u=(p*p*E+3*g*(p*x+g*v))*p+y,f=(p*p*M+3*g*(p*A+g*T))*p+_,u>i?i=u:u<o&&(o=u),f>s?s=f:f<a&&(a=f);return e.centerX=(i+o)/2,e.centerY=(s+a)/2,e.left=o,e.width=i-o,e.top=a,e.height=s-a,e.size=(i-o)*(s-a)},d_=function(e,n){return n.length-e.length},f_=function(e,n){var r=e.size||Tr(e),i=n.size||Tr(n);return Math.abs(i-r)<(r+i)/20?n.centerX-e.centerX||n.centerY-e.centerY:i-r},h_=function(e,n){var r=e.slice(0),i=e.length,o=i-2,s,a;for(n=n|0,s=0;s<i;s++)a=(s+n)%o,e[s++]=r[a],e[s]=r[a+1]},Vu=function(e,n,r,i,o){var s=e.length,a=0,l=s-2,c,u,f,d;for(r*=6,u=0;u<s;u+=6)c=(u+r)%l,d=e[c]-(n[u]-i),f=e[c+1]-(n[u+1]-o),a+=qn(f*f+d*d);return a},AC=function(e,n,r){var i=e.length,o=u_(e),s=u_(n),a=s[0]-o[0],l=s[1]-o[1],c=Vu(e,n,0,a,l),u=0,f,d,h;for(h=6;h<i;h+=6)d=Vu(e,n,h/6,a,l),d<c&&(c=d,u=h);if(r)for(f=e.slice(0),hr(f),h=6;h<i;h+=6)d=Vu(f,n,h/6,a,l),d<c&&(c=d,u=-h);return u/6},OC=function(e,n,r){for(var i=e.length,o=qu,s=0,a=0,l,c,u,f,d,h;--i>-1;)for(l=e[i],h=l.length,d=0;d<h;d+=6)c=l[d]-n,u=l[d+1]-r,f=qn(c*c+u*u),f<o&&(o=f,s=l[d],a=l[d+1]);return[s,a]},MC=function(e,n,r,i,o,s){var a=n.length,l=0,c=Math.min(e.size||Tr(e),n[r].size||Tr(n[r]))*i,u=qu,f=e.centerX+o,d=e.centerY+s,h,m,p,g,y;for(m=r;m<a&&(h=n[m].size||Tr(n[m]),!(h<c));m++)p=n[m].centerX-f,g=n[m].centerY-d,y=qn(p*p+g*g),y<u&&(l=m,u=y);return y=n[l],n.splice(l,1),y},IC=function(e,n,r){r===void 0&&(r=1);for(var i=e[n],o=e[n+1],s=e[n+2],a=e[n+3],l=e[n+4],c=e[n+5],u=e[n+6],f=e[n+7],d,h,m,p,g,y,_,v,x;r-- >0;)d=1-1/(r+2),h=i+(s-i)*d,m=s+(l-s)*d,p=o+(a-o)*d,g=a+(c-a)*d,y=h+(m-h)*d,_=p+(g-p)*d,v=l+(u-l)*d,x=c+(f-c)*d,m+=(v-m)*d,g+=(x-g)*d,e.splice(n+2,4,s=zt(h),a=zt(p),l=zt(y),c=zt(_),u=zt(y+(m-y)*d),f=zt(_+(g-_)*d),zt(m),zt(g),zt(v),zt(x))},CC=function(e){for(var n=e.length,r=-qu,i;n--;)e[n]>r&&(r=e[n],i=n);return i},Io=function(e,n){for(var r=[],i=[],o=e.length-2,s=0;s<o;s+=6)r.push(Math.pow(e[s]-e[s+6],2)+Math.pow(e[s+1]-e[s+7],2));for(;n--;)s=CC(r),i[s]=o=(i[s]||0)+1,r[s]*=o/(o+1);for(s=r.length;s--;)i[s]&&IC(e,s*6,i[s])},Ku=function(e,n){return n||sn(e),Math.max(4,Math.round(e.totalLength/4))},p_=function(e){return e.slice(0).sort(d_)},m_=function(e){for(var n=e[0],r=e[1],i=2;i<e.length;i+=2)if(Math.abs(e[i]-n)>.01||Math.abs(e[i+1]-r)>.01)return!1;return!0},$u=function(e,n){n=n||{};var r=n,i=r.redraw,o=r.points,s=r.maxSegments,a=s===void 0?999:s,l=0,c=e,u=Array.isArray(o)?o:0,f,d,h,m,p;if(i=i!==!1,i)sn(e);else for(e.totalPoints=0,d=e.length;d--;)e.totalPoints+=e[d].length;for(u?(c=p_(e),u=p_(u),p=u[0].totalLength/Math.round(u[0].length/6)):((!o||o==="auto")&&(o=Ku(e,i),i||(o-=Math.round(e.totalPoints/6))),o=Math.max(i?10:4,Math.min(999,o))),d=0;d<c.length;d++){if(h=c[d],f=Math.max(i?10:4,u?Math.round(u[d]?u[d].length/6:c[d].totalLength/p||0):Math.round((l/o+(i?h.totalLength/e.totalLength:h.length/e.totalPoints))*o)-l),!(d>=a||u&&(!u[d]||m_(u[d]))))if(i){var g;m=lo(qw(h,f),n.curviness),h.length=0,(g=h).push.apply(g,m)}else Io(h,f);l+=f}return e},Zu=function(e,n,r,i,o){var s=n.length-e.length,a=s>0?n:e,l=s>0?e:n,c=0,u=i==="complexity"?d_:f_,f=i==="position"?0:typeof i=="number"?i:.8,d=l.length,h=typeof r=="object"&&r.push?r.slice(0):[r],m=h[0]==="reverse"||h[0]<0,p=r==="log",g,y,_,v,x,E,T;if(l[0]){if(a.length>1&&(e.sort(u),n.sort(u),a.size||yi(a),l.size||yi(l),E=a.centerX-l.centerX,T=a.centerY-l.centerY,u===f_))for(d=0;d<l.length;d++)a.splice(d,0,MC(l[d],a,d,f,E,T));if(s)for(s<0&&(s=-s),a[0].length>l[0].length&&Io(l[0],(a[0].length-l[0].length)/6|0),d=l.length;c<s;)v=a[d].size||Tr(a[d]),_=OC(l,a[d].centerX,a[d].centerY),v=_[0],x=_[1],l[d++]=[v,x,v,x,v,x,v,x],l.totalPoints+=8,c++;for(d=0;d<e.length;d++)g=n[d],y=e[d],s=g.length-y.length,s<0?Io(g,-s/6|0):s>0&&Io(y,s/6|0),m&&o!==!1&&!y.reversed&&hr(y),r=h[d]||h[d]===0?h[d]:"auto",r&&(y.closed||Math.abs(y[0]-y[y.length-2])<.5&&Math.abs(y[1]-y[y.length-1])<.5?r==="auto"||r==="log"?(h[d]=r=AC(y,g,!d||o===!1),r<0&&(m=!0,hr(y),r=-r),h_(y,r*6)):r!=="reverse"&&(d&&r<0&&hr(y),h_(y,(r<0?-r:r)*6)):!m&&(r==="auto"&&Math.abs(g[0]-y[0])+Math.abs(g[1]-y[1])+Math.abs(g[g.length-2]-y[y.length-2])+Math.abs(g[g.length-1]-y[y.length-1])>Math.abs(g[0]-y[y.length-2])+Math.abs(g[1]-y[y.length-1])+Math.abs(g[g.length-2]-y[0])+Math.abs(g[g.length-1]-y[1])||r%2)?(hr(y),h[d]=-1,m=!0):r==="auto"?h[d]=0:r==="reverse"&&(h[d]=-1),y.closed!==g.closed&&(y.closed=g.closed=!1));return p&&An("shapeIndex:["+h.join(",")+"]"),e.shapeIndex=h,h}},g_=function(e,n,r,i,o){var s=Ht(e[0]),a=Ht(e[1]);Zu(s,a,n||n===0?n:"auto",r,o)&&(e[0]=Tn(s),e[1]=Tn(a),(i==="log"||i===!0)&&An('precompile:["'+e[0]+'","'+e[1]+'"]'))},RC=function(e,n){if(!n)return e;var r=e.match(gi)||[],i=r.length,o="",s,a,l;for(n==="reverse"?(a=i-1,s=-2):(a=((parseInt(n,10)||0)*2+1+i*100)%i,s=2),l=0;l<i;l+=2)o+=r[a-1]+","+r[a]+" ",a=(a+s)%i;return o},y_=function(e,n){var r=0,i=parseFloat(e[0]),o=parseFloat(e[1]),s=i+","+o+" ",a=.999999,l,c,u,f,d,h,m;for(u=e.length,l=n*.5/(u*.5-1),c=0;c<u-2;c+=2){if(r+=l,h=parseFloat(e[c+2]),m=parseFloat(e[c+3]),r>a)for(d=1/(Math.floor(r)+1),f=1;r>a;)s+=(i+(h-i)*d*f).toFixed(2)+","+(o+(m-o)*d*f).toFixed(2)+" ",r--,f++;s+=h+","+m+" ",i=h,o=m}return s},Ju=function(e){var n=e[0].match(gi)||[],r=e[1].match(gi)||[],i=r.length-n.length;i>0?e[0]=y_(n,i):e[1]=y_(r,-i)},LC=function(e){return isNaN(e)?Ju:function(n){Ju(n),n[1]=RC(n[1],parseInt(e,10))}},kC=function(e,n,r){var i=typeof e=="string",o,s;return(!i||SC.test(e)||(e.match(gi)||[]).length<3)&&(o=Xu(e)[0],o?(s=(o.nodeName+"").toUpperCase(),n&&s!=="PATH"&&(o=Wa(o,!1),s="PATH"),e=o.getAttribute(s==="PATH"?"d":"points")||"",o===r&&(e=o.getAttributeNS(null,"data-original")||e)):(An("WARNING: invalid morph to: "+e),e=!1)),e},__=function(e){for(var n=e.length,r,i,o,s,a,l,c,u;--n>-1;)for(r=e[n],u=r.cpData=r.cpData||[],u.length=0,c=r.length-2,l=0;l<c;l+=6)i=r[l]-r[l+2],o=r[l+1]-r[l+3],s=r[l+6]-r[l+4],a=r[l+7]-r[l+5],u[l+2]=Oo(o,i),u[l+3]=qn(i*i+o*o),u[l+4]=Oo(a,s),u[l+5]=qn(s*s+a*a);return e},b_=function(e){var n=e.trim().split(" "),r=~e.indexOf("left")?0:~e.indexOf("right")?100:isNaN(parseFloat(n[0]))?50:parseFloat(n[0]),i=~e.indexOf("top")?0:~e.indexOf("bottom")?100:isNaN(parseFloat(n[1]))?50:parseFloat(n[1]);return{x:r/100,y:i/100}},v_=function(e){return e!==e%Mo?e+(e<0?l_:-l_):e},x_="Use MorphSVGPlugin.convertToPath() to convert to a path before morphing.",PC=function(e,n,r,i){var o=this._origin,s=this._eOrigin,a=e[r]-o.x,l=e[r+1]-o.y,c=qn(a*a+l*l),u=Oo(l,a),f,d;return a=n[r]-s.x,l=n[r+1]-s.y,f=Oo(l,a)-u,d=v_(f),!i&&pi&&Math.abs(d+pi.ca)<TC&&(i=pi),this._anchorPT=pi={_next:this._anchorPT,t:e,sa:u,ca:i&&d*i.ca<0&&Math.abs(d)>EC?f:d,sl:c,cl:qn(a*a+l*l)-c,i:r}},T_=function(e){vt=s_(),mi=mi||vt&&vt.plugins.morphSVG,vt&&mi?(Xu=vt.utils.toArray,o_=vt.core.reverting||function(){},mi.prototype._tweenRotation=PC,i_=1):e&&An("Please gsap.registerPlugin(MorphSVGPlugin)")},Er={version:"3.15.0",name:"morphSVG",rawVars:1,register:function(e,n){vt=e,mi=n,T_()},init:function(e,n,r,i,o){if(i_||T_(1),!n)return An("invalid shape"),!1;zu(n)&&(n=n.call(r,i,e,o));var s,a,l,c,u,f,d,h,m,p,g,y,_,v,x,E,T,A,M,C;if(typeof n=="string"||n.getBBox||n[0])n={shape:n};else if(typeof n=="object"){s={};for(a in n)s[a]=zu(n[a])&&a!=="render"?n[a].call(r,i,e,o):n[a];n=s}var k=e.nodeType?window.getComputedStyle(e):{},w=k.fill+"",L=!(w==="none"||(w.match(gi)||[])[3]==="0"||k.fillRule==="evenodd"),D=n.smooth,N=(n.origin||"50 50").split(",");if(D===!0||D==="auto"?D={}:typeof D=="number"&&(D={points:D}),s=(e.nodeName+"").toUpperCase(),u=s==="POLYLINE"||s==="POLYGON",s!=="PATH"&&!u&&!n.prop)return An("Cannot morph a <"+s+"> element. "+x_),!1;if(a=s==="PATH"?"d":"points",!n.prop&&!zu(e.setAttribute))return!1;if(c=kC(n.shape||n.d||n.points||"",a==="d",e),u&&wC.test(c))return An("A <"+s+"> cannot accept path data. "+x_),!1;if(f=n.shapeIndex||n.shapeIndex===0?n.shapeIndex:"auto",d=n.map||Er.defaultMap,this._prop=n.prop,this._render=n.render||Er.defaultRender,this._apply="updateTarget"in n?n.updateTarget:Er.defaultUpdateTarget,this._rnd=Math.pow(10,isNaN(n.precision)?2:+n.precision),this._tween=r,c){if(this._target=e,T=typeof n.precompile=="object",p=this._original=this._prop?e[this._prop]:e.getAttribute(a),!this._prop&&!e.getAttributeNS(null,"data-original")&&e.setAttributeNS(null,"data-original",p),a==="d"||this._prop){if(p=Ht(T?n.precompile[0]:p),g=Ht(T?n.precompile[1]:c),D){for(_=p.length;--_;)m_(p[_])&&p.splice(_,1);$u(p,Ao({},D,{points:+D.points||Math.max(Ku(p),Ku(g)),maxSegments:g.length})),$u(g,D.redraw===!1?D:Ao({},D,{points:p}))}if(!T&&!Zu(p,g,f,d,L))return!1;for((n.precompile==="log"||n.precompile===!0)&&An('precompile:["'+Tn(p)+'","'+Tn(g)+'"]'),M=(n.type||Er.defaultType)!=="linear",C=n.curveMode||M,__(p),__(g),M&&(p.size||yi(p),g.size||yi(g),A=b_(N[0]),this._origin=p.origin={x:p.left+A.x*p.width,y:p.top+A.y*p.height},N[1]&&(A=b_(N[1])),this._eOrigin={x:g.left+A.x*g.width,y:g.top+A.y*g.height}),this._rawPath=e._gsRawPath=p,_=p.length;--_>-1;){for(x=p[_],E=g[_],h=x.cpData,m=E.cpData,v=x.length,pi=0,y=0;y<v;y+=6)(E[y]!==x[y]||E[y+1]!==x[y+1])&&(M?l=this._tweenRotation(x,E,y):(l=this.add(x,y,x[y],E[y],0,0,0,0,0,1),l=this.add(x,y+1,x[y+1],E[y+1],0,0,0,0,0,1)||l));for(y=0;y<v;y+=2)C&&(h[y]!==m[y]||h[y+1]!==m[y+1])&&h[y+1]&&m[y+1]?this._controlPT={_next:this._controlPT,i:y,j:_,ai:y%6>3?y+2:y-2,sa:h[y],ca:v_(m[y]-h[y]),sl:h[y+1],cl:m[y+1]-h[y+1]}:(E[y]!==x[y]&&(l=this.add(x,y,x[y],E[y],0,0,0,0,0,1)),E[y+1]!==x[y+1]&&(l=this.add(x,y+1,x[y+1],E[y+1],0,0,0,0,0,1)||l))}}else l=this.add(e,"setAttribute",e.getAttribute(a)+"",c+"",i,o,0,LC(f),a);M&&(this.add(this._origin,"x",this._origin.x,this._eOrigin.x,0,0,0,0,0,1),l=this.add(this._origin,"y",this._origin.y,this._eOrigin.y,0,0,0,0,0,1)),l&&(this._props.push("morphSVG"),l.end=D&&D.persist!==!1?Tn(g):c,l.endProp=a)}return 1},render:function(e,n){for(var r=n._rawPath,i=n._controlPT,o=n._anchorPT,s=n._rnd,a=n._target,l=n._pt,c,u,f,d,h,m,p,g,y;l;)l.r(e,l.d),l=l._next;if(e===1&&n._apply)for(l=n._pt;l;)l.end&&(n._prop?a[n._prop]=l.end:a.setAttribute(l.endProp,l.end)),l=l._next;else if(r){for(;o;)h=o.sa+e*o.ca,d=o.sl+e*o.cl,o.t[o.i]=n._origin.x+a_(h)*d,o.t[o.i+1]=n._origin.y+c_(h)*d,o=o._next;for(;i;)f=r[i.j],m=i.i,h=i.sa+e*i.ca,g=c_(h),y=a_(h),d=i.sl+e*i.cl,f[m]=f[i.ai]-y*d,f[m+1]=f[i.ai+1]-g*d,i=i._next;if(!e&&o_()&&(r=Ht(n._original)),a._gsRawPath=r,n._apply){for(c="",u=" ",p=0;p<r.length;p++){for(f=r[p],d=f.length,c+="M"+(f[0]*s|0)/s+u+(f[1]*s|0)/s+" C",m=2;m<d;m++)c+=(f[m]*s|0)/s+u;f.closed&&(c+="z")}n._prop?a[n._prop]=c:a.setAttribute("d",c)}}n._render&&r&&n._render.call(n._tween,r,a)},kill:function(e){this._pt=this._rawPath=0},getRawPath:ti,stringToRawPath:Ht,rawPathToString:Tn,smoothRawPath:$u,normalizeStrings:function(e,n,r){var i=r.shapeIndex,o=r.map,s=[e,n];return g_(s,i,o),s},pathFilter:g_,pointsFilter:Ju,getTotalSize:yi,equalizeSegmentQuantity:Zu,convertToPath:function(e,n){return Xu(e).map(function(r){return Wa(r,n!==!1)})},defaultType:"linear",defaultUpdateTarget:!0,defaultMap:"size"};s_()&&vt.registerPlugin(Er),S.gsap.registerPlugin(Er);const E_=(t,e,n,r,i,o,s)=>`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${n}" viewBox="${r}">
1421
1421
  <path d="${t}" fill="${i}" stroke="${o}" stroke-width="${s}" />
1422
- </svg>`,bR=({ref:t,...e})=>{const{pathSequence:n,morphDuration:r=1.4,morphEase:i="expo.inOut",loopBackToStart:o=!0,viewBox:s="0 0 100 100",transformation:{x:a,y:l,width:c,height:u,anchor:f,fill:d="#f59e0b",stroke:h="none",strokeWidth:p=0},startAt:m,visible:g,onSpriteRefReady:y}=e,{app:b}=at.useApplication(),{tl:x}=S.useContext(Ye),v=S.useRef(null),T=S.useRef(null),w=S.useRef(null),O=S.useRef(null),[C,R]=S.useState(null);return S.useEffect(()=>{const P="http://www.w3.org/2000/svg",A=document.createElementNS(P,"svg");A.setAttribute("width","0"),A.setAttribute("height","0"),A.style.position="absolute",A.style.left="-9999px",A.style.pointerEvents="none";const L=document.createElementNS(P,"path");return L.setAttribute("d",n[0]),A.appendChild(L),document.body.appendChild(A),w.current=L,()=>{A.remove(),w.current=null}},[n]),S.useEffect(()=>{if(!b?.renderer)return;const P=Uy(n[0],c,u,s,d,h,p),A=new W.Graphics().svg(P),L=b.renderer.generateTexture(A);O.current?.destroy(!0),O.current=L,R(L),A.destroy()},[b,n,c,u,s,d,h,p]),S.useEffect(()=>{if(!x?.current||!b?.renderer||!w.current||n.length<2)return;const P=w.current,A=()=>{const D=P.getAttribute("d");if(!D||!v.current)return;const F=Uy(D,c,u,s,d,h,p),G=new W.Graphics().svg(F),z=b.renderer.generateTexture(G),K=O.current;O.current=z,v.current.texture=z,G.destroy(),K?.destroy(!0)},L=E.gsap.timeline({defaults:{duration:r,ease:i}});return(o?[...n.slice(1),n[0]]:n.slice(1)).forEach(D=>{L.to(P,{morphSVG:D,onUpdate:A})}),x.current.add(L,m),()=>{L.kill()}},[x,b,n,r,i,o,c,u,s,d,h,p,m]),S.useEffect(()=>()=>{O.current?.destroy(!0),O.current=null},[]),S.useEffect(()=>{v.current&&y&&y(e.uniqueId,T)},[C,y,e.uniqueId]),M.jsx($e,{...e,ref:t,children:M.jsx("pixiContainer",{ref:T,children:C&&M.jsx("pixiSprite",{ref:v,texture:C,width:c,height:u,anchor:f,x:a,y:l,alpha:g?1:0})})})},Gy=t=>{try{t.pause()}catch{}try{t.removeAttribute("src"),t.load()}catch{}},xR=()=>{if(typeof window>"u")return null;const t=window;return t.AudioContext??t.webkitAudioContext??null};function jy(){const t=new Map,e=new Map,n=new Map;let r=null;const i=new Set;let o=0;const s=()=>{o+=1,i.forEach(c=>c())},a=()=>r&&r.state!=="closed"?r:null,l=()=>{const c=a();if(c)return c;const u=xR();return u?(r=new u,r):null};return{get:c=>t.get(c),set(c,u,f){t.set(c,u),e.set(c,f),s()},srcFor:c=>e.get(c),has:c=>t.has(c),delete(c){const u=t.get(c);u&&Gy(u),t.delete(c),e.delete(c),s()},forEach:c=>t.forEach(c),get size(){return t.size},get version(){return o},subscribe(c){return i.add(c),()=>{i.delete(c)}},getContext:l,getContextIfExists:a,getOrCreateSourceNode(c){const u=n.get(c);if(u)return u;const f=t.get(c),d=l();if(!f||!d)return null;try{f.crossOrigin!=="anonymous"&&(f.crossOrigin="anonymous");const h=d.createMediaElementSource(f);return h.connect(d.destination),n.set(c,h),h}catch{return null}},getSourceNode:c=>n.get(c),setSourceNode(c,u){n.set(c,u)},hasSourceNode:c=>n.has(c),clear(){t.forEach(Gy),t.clear(),e.clear(),n.clear(),s(),r&&r.state!=="closed"&&r.close().catch(()=>{}),r=null}}}const hr=jy(),po=.15,Iu=.15,vR=.6,Hy=["voiceover","narration","dialogue"];function TR(t){return Math.pow(10,t/20)}function ER(t){return 20*Math.log10(Math.max(t,1e-6))}const pr=t=>t<0?0:t>1?1:t;function Yy(t,e,n,r){if(!r)return n;let i=n;const o=r.fadeIn;if(o?.enabled&&(o.duration??0)>0){const a=o.duration;if(t<=a){const l=(o.volume??0)/100,c=a>0?t/a:1;i=l+(n-l)*pr(c)}}const s=r.fadeOut;if(s?.enabled&&(s.duration??0)>0){const a=s.duration,l=e-a;if(t>=l){const c=(s.volume??0)/100,u=a>0?(t-l)/a:1;i=i+(c-i)*pr(u)}}return pr(i)}function Xy(t,e,n=Iu,r=po){if(!e||e.length===0)return 1;const i=pr(n),o=Math.max(0,r);let s=1;for(const a of e){if(a.endSec<=a.startSec)continue;const l=a.startSec-o,c=a.endSec+o;if(t<l||t>c)continue;let u;o>0&&t<a.startSec?u=1+(i-1)*((t-l)/o):t<=a.endSec?u=i:o>0?u=i+(1-i)*((t-a.endSec)/o):u=i,u<s&&(s=u)}return pr(s)}function Wy(t,e){if(e.muted||t<0||t>e.clipDuration)return 0;const n=Yy(t,e.clipDuration,e.baseVolume,e.fade),r=Xy(t,e.duckWindows,e.duckTo,e.duckFade);return pr(n*r)}function zy(t,e=0){if(!t||t.length===0)return[];const n=[...t].sort((o,s)=>o.tMs-s.tMs),r=[];let i=null;for(const o of n){const s=o.gainDb<0;s&&i===null?i=o.tMs:!s&&i!==null&&(r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e}),i=null)}if(i!==null){const o=n[n.length-1];r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e})}return r}function qy(t,e,n={}){if(!t?.duckDuring)return[];const r=n.mergeGapSec??po*2,i=t.start??0,s=(t.end??0)-i;if(s<=0)return[];const a=new Set(Hy),l=e.filter(u=>!(!u||u.uniqueId&&t.uniqueId&&u.uniqueId===t.uniqueId||t.duckDuring==="voiceover"&&!a.has(u.trackRole??"")||u.mute||u.muted||typeof u.volume=="number"&&u.volume<=0)).map(u=>({startSec:(u.start??0)-i,endSec:(u.end??0)-i})).map(u=>({startSec:Math.max(0,u.startSec),endSec:Math.min(s,u.endSec)})).filter(u=>u.endSec>u.startSec).sort((u,f)=>u.startSec-f.startSec);if(l.length===0)return[];const c=[l[0]];for(let u=1;u<l.length;u+=1){const f=c[c.length-1],d=l[u];d.startSec-f.endSec<=r?f.endSec=Math.max(f.endSec,d.endSec):c.push(d)}return c}function SR(t,e){const n=t.start??0,r=t.end??0,i=t.transformation?.musicDuckEnvelope,o=i?.length?zy(i,n):qy({uniqueId:t.uniqueId,start:n,end:r,trackRole:t.trackRole,duckTo:t.duckTo,duckDuring:t.duckDuring},e);return{baseVolume:typeof t.volume=="number"?t.volume:1,muted:!!(t.mute??t.muted),clipDuration:Math.max(0,r-n),fade:t.transformation?.audioFade,duckTo:t.duckTo??Iu,duckWindows:o,duckFade:po}}const Vy=.2,wR=.05,AR=t=>t<0?0:t>1?1:t,OR=(t,e)=>e>=t.start&&e<t.end;function Ky(t,e,n=NaN){const r=t.speed&&t.speed>0?t.speed:1;let i=t.frameStartAt+(e-t.start)*r;return Number.isFinite(n)&&n>0&&(i=Math.min(i,n-wR)),i<0?0:i}function Zy(t,e){const n=t.getVolume?t.getVolume(e):t.volume??1;return AR(Wy(e-t.start,{baseVolume:Number.isFinite(n)?n:1,muted:t.mute,clipDuration:t.end-t.start,fade:t.audioFade,duckWindows:t.duckWindows,duckTo:t.duckTo}))}function Mu(t,e,n,r){if(!OR(t,e)||!n.playing||n.reverse||n.seeking)return{kind:"pause"};const i=Ky(t,e,r.duration),o=t.speed&&t.speed>0?t.speed:1,s=Zy(t,e);return r.paused?{kind:"play",seekTo:i,volume:s,rate:o,start:!0}:{kind:"play",seekTo:Math.abs(r.currentTime-i)>Vy?i:null,volume:s,rate:o,start:!1}}const $y=t=>({paused:t.paused,currentTime:t.currentTime,duration:t.duration});function Lu(t,e,n){if(e.kind==="pause"){t.paused||t.pause();return}if(e.seekTo!==null&&(t.currentTime=e.seekTo),t.volume=e.volume,t.playbackRate!==e.rate&&(t.playbackRate=e.rate),e.start)try{const r=t.play();r&&typeof r.catch=="function"&&r.catch(i=>n?.(i))}catch(r){n?.(r)}}const Pu=({audioElements:t,registry:e=hr,clearOnUnmount:n=!0})=>{const r=S.useContext(Ye),{registerTimeUpdateListener:i,unregisterTimeUpdateListener:o}=r,s=S.useRef(t);s.current=t;const a=S.useRef(null),l=S.useRef(new Set);S.useEffect(()=>{const u=new Set(t.map(f=>f.uniqueId));for(const f of[...l.current])u.has(f)||(e.delete(f),l.current.delete(f));for(const{uniqueId:f,src:d,speed:h}of t){if(e.srcFor(f)===d&&e.has(f)){l.current.add(f);continue}e.has(f)&&e.delete(f),l.current.add(f);const p=new Audio;p.crossOrigin="anonymous",p.preload="auto",p.loop=!1,p.playbackRate=h&&h>0?h:1,p.volume=0,p.addEventListener("error",()=>{console.error("[AudioPlaybackManager] load error",f,p.error)}),p.src=d,e.set(f,p,d)}},[t,e]),S.useEffect(()=>{if(!i||!o)return;const u=f=>{const d=a.current;a.current=f;const h={playing:r.playStateRef?.current??!1,reverse:d!==null&&f<d-1e-6,seeking:r.isSeekingRef?.current??!1};for(const p of s.current){const m=e.get(p.uniqueId);if(!m||m.readyState===0)continue;const g=Mu(p,f,h,$y(m));if(g.kind==="play"){const y=e.getContextIfExists();y&&y.state==="suspended"&&y.resume().catch(()=>{})}Lu(m,g,()=>{})}};return i(u),()=>o(u)},[i,o,e,r]);const c=()=>e.forEach(u=>{u.paused||u.pause()});return Ze(ke.PAUSE,c),Ze(ke.SCRUBBER_CLICKED,c),Ze(ke.COMPLETE,()=>{e.forEach(u=>{try{u.pause(),u.currentTime=0}catch{}}),a.current=null}),Ze(ke.RESUME,()=>{a.current=null;const u=r.tl?.current?.time();if(typeof u=="number"){const f={playing:!0,reverse:!1,seeking:!1};for(const d of s.current){const h=e.get(d.uniqueId);!h||h.readyState===0||Lu(h,Mu(d,u,f,$y(h)))}}}),S.useEffect(()=>()=>{if(n){e.clear();return}for(const u of l.current)e.delete(u);l.current.clear()},[e,n]),null};Pu.displayName="AudioPlaybackManager";const Jy={[Nt.NONE]:{mode:2},[Nt.ROUNDBARS]:{mode:2,alphaBars:!1,ansiBands:!1,barSpace:.25,channelLayout:"single",colorMode:"bar-level",frequencyScale:"log",gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.6,lumiBars:!1,maxFreq:16e3,minFreq:30,mirror:0,radial:!1,reflexRatio:.3,reflexAlpha:1,roundBars:!0,showPeaks:!1,showScaleX:!1,showScaleY:!1,smoothing:.7,weightingFilter:"D"},[Nt.LED]:{mode:3,barSpace:.6,ledBars:!0,showScaleX:!1,showScaleY:!1},[Nt.RADIAL_SPECTRUM]:{mode:3,barSpace:.25,bgAlpha:.5,fillAlpha:.5,gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.8,lineWidth:1.5,maxDecibels:-30,maxFreq:16e3,radial:!0,showBgColor:!0,showPeaks:!0,spinSpeed:2,outlineBars:!0,showScaleX:!1,showScaleY:!1,reflexFit:!0},[Nt.LUMI_BARS]:{mode:3,barSpace:.6,lumiBars:!0,reflexRatio:.5,fillAlpha:.3,frequencyScale:"bark",gradientLeft:"steelblue",gradientRight:"orangered",showScaleX:!1,showScaleY:!1},[Nt.EQUALIZER]:{mode:2,gradient:"rainbow",lineWidth:1.5,fillAlpha:.5,showPeaks:!1,showScaleX:!1,showScaleY:!1}};function Qy(t){return S.useSyncExternalStore(t.subscribe,()=>t.version,()=>0)}const Nu={canvas:null,analyzer:null};function e_({uniqueId:t,waveform:e,width:n,height:r,registry:i=hr}){const o=e!==Nt.NONE,[s,a]=I.useState(Nu),l=Qy(i),c=I.useRef(e);c.current=e;const u=i.has(t);return I.useEffect(()=>{if(!o||!u){a(Nu);return}const f=i.getContext();if(!f)return;const d=i.getOrCreateSourceNode(t);if(!d)return;const h=document.createElement("div");h.style.display="none",h.id=`${t}-audioContainer`,document.body.appendChild(h);const p=new eE(h,{audioCtx:f,connectSpeakers:!1,height:r,width:n,...Jy[c.current]??{}});return p.connectInput(d),a({canvas:p.canvas,analyzer:p}),()=>{try{p.disconnectInput(d),p.destroy()}catch{}h.remove(),a(Nu)}},[o,u,l,t,n,r,i]),I.useEffect(()=>{if(!s.analyzer||!o)return;const f=Jy[e]??{};s.analyzer.setOptions(f)},[e,o,s.analyzer]),s}const CR=({ref:t,...e})=>{const{uniqueId:n,src:r,startAt:i,endAt:o,audioStartAt:s=0,mute:a,speed:l,visible:c=!1,volume:u=1,getVolume:f,audioFade:d,duckWindows:h,duckTo:p,managePlayback:m=!0,registry:g=hr,transformation:y,onAudioElementReady:b}=e,{width:x=300,height:v=300,x:T=100,y:w=100,waveform:O=Nt.NONE}=y||{},C=S.useRef(null),R=I.useMemo(()=>[{uniqueId:n,src:r,start:i,end:o,frameStartAt:s,volume:u,getVolume:f,mute:a||!c,speed:l,audioFade:d,duckWindows:h,duckTo:p}],[n,r,i,o,s,u,f,a,c,l,d,h,p]),P=Qy(g),A=g.get(n);S.useEffect(()=>{A&&b?.(n,A)},[A,n,P]);const L=e_({uniqueId:n,waveform:O,width:x,height:v,registry:g}),N=I.useMemo(()=>L.canvas?new W.Texture({source:new W.CanvasSource({resource:L.canvas})}):null,[L.canvas]);S.useEffect(()=>()=>{N?.destroy(!0)},[N]),S.useEffect(()=>{if(!N)return;const F=()=>{N.source.update?.()};return W.Ticker.shared.add(F),()=>{W.Ticker.shared.remove(F)}},[N]);const D=O!==Nt.NONE&&!!N;return M.jsxs(M.Fragment,{children:[m&&M.jsx(Pu,{audioElements:R,registry:g,clearOnUnmount:!1}),D&&M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,isGif:!0,children:M.jsx("pixiSprite",{texture:N,width:x,height:v,anchor:.5,x:T,y:w,ref:C,alpha:c?1:0})})]})},t_=I.memo(CR,et),n_=({src:t,start:e,end:n})=>{const r=S.useRef(null),[i,o]=S.useState({audio:null,isPlaying:!1,currentTime:0});S.useEffect(()=>{const f=new Audio(t);f.preload="auto",f.currentTime=e,r.current=f;const d=()=>o(g=>({...g,isPlaying:!0})),h=()=>o(g=>({...g,isPlaying:!1})),p=()=>o(g=>({...g,isPlaying:!1,currentTime:0})),m=()=>{f.currentTime>=n&&(f.pause(),f.currentTime=e)};return f.addEventListener("play",d),f.addEventListener("pause",h),f.addEventListener("ended",p),f.addEventListener("timeupdate",m),o(g=>({...g,audio:f})),()=>{f.pause(),f.removeEventListener("play",d),f.removeEventListener("pause",h),f.removeEventListener("ended",p),f.removeEventListener("timeupdate",m),f.src="",r.current=null}},[t,e,n]);const s=S.useCallback(()=>{const f=r.current;f&&f.play().catch(()=>{})},[]),a=S.useCallback(()=>{r.current?.pause()},[]),l=S.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,o(h=>({...h,currentTime:f})))},[]),c=S.useCallback(()=>{const f=r.current;f&&(f.paused?s():f.pause())},[s]),u=S.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,s(),o(h=>({...h,currentTime:f})))},[s]);return{...i,handlePause:a,handlePlay:s,togglePlay:c,handleSeek:l,playFromTime:u}},RR=n_;function r_(t,e,{loop:n=!0,speed:r=1}={}){const i=t.length;if(i<=1)return 0;const o=t[i-1].end;if(!(o>0))return 0;let s=e*1e3*(Number.isFinite(r)?r:1);if(Number.isNaN(s)||s<=0)return 0;if(s===1/0)return n?0:i-1;if(n)s%=o;else if(s>=o)return i-1;let a=0,l=i-1,c=0;for(;a<=l;){const u=a+l>>>1;t[u].start<=s?(c=u,a=u+1):l=u-1}return c}const IR=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),s=S.useRef(void 0),{src:a,uniqueId:l,startAt:c,endAt:u,loop:f=!0,animationSpeed:d=1,visible:h,disabled:p,transformation:{width:m=0,height:g=0,x:y,y:b,colorCorrection:x,effect:v,effects:T,neonColor:w,blendMode:O,border:C,roundedCorners:R,maskShape:P,crop:A,anchor:L=.5},pointerdown:N}=e,{tl:D}=S.useContext(Ye),F=lt({colorCorrection:x,effects:T??{name:v},neonColor:w,blendMode:O});S.useEffect(()=>{let z=!1;return r(null),W.Assets.load(a).then(K=>{z||r(K)}).catch(K=>{console.error("[PixiGifSprite] failed to load",a,K)}),()=>{z=!0}},[a]);const G=()=>{const z=o.current,K=s.current;!z||!K||!n||(z.currentFrame=r_(n.frames,K.time(),{loop:f,speed:d}))};return S.useEffect(()=>{if(!D?.current||!i.current)return;const z=i.current,K=E.context(()=>{s.current&&(s.current.kill(),D.current.remove(s.current)),s.current=E.timeline().set(z,{alpha:h?1:0}).to(z,{pixi:{},duration:Number(u)-Number(c),onUpdate:G}),D.current.add(s.current,c)});return()=>{s.current&&(D.current.remove(s.current),s.current.progress(0).kill()),K.revert()}},[c,u,l,D,h,f,n,d]),M.jsx($e,{...e,ref:t,isGif:!0,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:i,children:n&&M.jsx(Ot,{x:y,y:b,width:m,height:g,border:C,roundedCorners:R,maskShape:P,crop:A,spriteRef:o,children:M.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!1,autoUpdate:!1,loop:f,animationSpeed:d,width:m,height:g,anchor:L,x:y,y:b,alpha:h?1:0,filters:F,...!p&&h&&{eventMode:"static",onPointerDown:N}})})})})},i_=I.memo(IR,et),o_=({width:t=800,height:e=500,background:n="#1a1d24",camera:r,defaultLights:i=!0,children:o})=>M.jsx("div",{style:{position:"relative",width:t,height:e,background:n,overflow:"hidden"},children:M.jsxs(is.Canvas,{style:{width:"100%",height:"100%"},camera:{position:r?.position??[0,0,6],fov:r?.fov??60},dpr:[1,2],gl:{antialias:!0,alpha:!0},children:[i&&M.jsxs(M.Fragment,{children:[M.jsx("ambientLight",{intensity:.55}),M.jsx("directionalLight",{position:[5,6,5],intensity:1}),M.jsx("directionalLight",{position:[-5,-2,-3],intensity:.3})]}),o]})}),Gt={ambientIntensity:.6,directionalIntensity:1.2,fillIntensity:.8,spinSpeed:.5,playbackSpeed:1};function s_(t,e){const n=t.scale??1,r=t.spinSpeed??Gt.spinSpeed;return{position:[t.positionX??0,t.positionY??0,t.positionZ??0],rotation:[t.rotationX??Math.sin(e*.3)*.2,(t.rotationY??0)+e*r,t.rotationZ??0],scale:[n*(t.flipX??1),n*(t.flipY??1),n]}}function a_(t,e,n=Gt.playbackSpeed,r=!0){if(!(e>0))return 0;const i=Math.max(0,t*n);return r?i%e:Math.min(i,e)}function c_(t){return t.materialColor!=null||t.roughness!=null||t.metalness!=null||t.emissiveIntensity!=null}function l_(t,e){c_(e)&&t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;e.materialColor!=null&&s.color?.setStyle(e.materialColor),e.roughness!=null&&"roughness"in s&&(s.roughness=e.roughness),e.metalness!=null&&"metalness"in s&&(s.metalness=e.metalness),e.emissiveIntensity!=null&&"emissiveIntensity"in s&&(s.emissiveIntensity=e.emissiveIntensity)}})}function ku(t){return[t.materialColor,t.roughness,t.metalness,t.emissiveIntensity].join("|")}function Du(t,e,n=1.5){return t>0?t/(2*Math.tan(e*Math.PI/360))*n:3}function u_(t,e,n=1.5){const r=new V.Box3().setFromObject(e);if(r.isEmpty())return;const i=r.getCenter(new V.Vector3),o=r.getSize(new V.Vector3),s=Math.max(o.x,o.y,o.z);t.position.set(i.x,i.y,i.z+Du(s,t.fov,n)),t.lookAt(i)}function f_(t,e){if(!e||!Object.keys(e).length)return;const n=t.slice(0,t.lastIndexOf("/")+1),r=new Map;for(const[i,o]of Object.entries(e))r.set(`${n}${i}`,o);return i=>r.get(i)??i}function Fu(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i))o&&o.isTexture&&o.dispose();i.dispose()}})}const MR=({ref:t,...e})=>{const{src:n,resources:r,uniqueId:i,startAt:o,endAt:s,visible:a,disabled:l,threeD:c,pointerdown:u,transformation:{width:f=0,height:d=0,x:h,y:p,colorCorrection:m,effect:g,effects:y,neonColor:b,blendMode:x,border:v,roundedCorners:T,maskShape:w,crop:O,anchor:C=.5}}=e,R=f||400,P=d||400,[A,L]=S.useState(null),N=S.useRef(null),D=S.useRef(null),F=S.useRef(null),G=S.useRef(void 0),z=S.useRef(0),K=S.useRef(c??{});K.current=c??{};const{tl:se}=S.useContext(Ye),pe=lt({colorCorrection:m,effects:y??{name:g},neonColor:b,blendMode:x}),X=S.useCallback(he=>{const j=F.current;if(!j)return;z.current=he;const te=K.current;if(j.ambient.intensity=te.ambientIntensity??Gt.ambientIntensity,j.key.intensity=te.directionalIntensity??Gt.directionalIntensity,j.fill.intensity=te.fillIntensity??Gt.fillIntensity,j.model){const H=s_(te,he);j.model.position.set(...H.position),j.model.rotation.set(...H.rotation),j.model.scale.set(...H.scale);const ae=ku(te);ae!==j.overrideKey&&(l_(j.model,te),j.overrideKey=ae)}j.mixer&&j.mixer.setTime(a_(he,j.clipDuration,te.playbackSpeed??Gt.playbackSpeed)),j.renderer.render(j.scene,j.camera),j.texture.source.update()},[]);return S.useEffect(()=>{let he=!1;const j=document.createElement("canvas");j.width=R,j.height=P;const te=new V.WebGLRenderer({canvas:j,alpha:!0,antialias:!0,preserveDrawingBuffer:!0});te.setPixelRatio(1),te.setSize(R,P,!1),te.setClearColor(0,0),te.outputColorSpace=V.SRGBColorSpace;const H=new V.Scene,ae=new V.PerspectiveCamera(45,R/P,.1,1e3);ae.position.set(0,0,3);const Z=K.current,ce=new V.AmbientLight(16777215,Z.ambientIntensity??Gt.ambientIntensity),J=new V.DirectionalLight(16777215,Z.directionalIntensity??Gt.directionalIntensity);J.position.set(5,5,5);const ie=new V.DirectionalLight(16777215,Z.fillIntensity??Gt.fillIntensity);ie.position.set(-5,0,5),H.add(ce,J,ie);const xe=W.Texture.from(j),Y={renderer:te,scene:H,camera:ae,ambient:ce,key:J,fill:ie,model:null,mixer:null,clipDuration:0,overrideKey:"",texture:xe};F.current=Y;const De=$=>{H.add($),Y.model=$,u_(ae,$)},ye=$=>{const we=$==="cube"?new V.BoxGeometry(.8,.8,.8):new V.TorusKnotGeometry(.6,.25,100,16),me=new V.MeshStandardMaterial({color:new V.Color(Z.materialColor??"#0095dd"),metalness:Z.metalness??($==="knot"?.6:0),roughness:Z.roughness??.3,emissive:new V.Color(17544),emissiveIntensity:Z.emissiveIntensity??.2}),Ue=new V.Mesh(we,me);H.add(Ue),Y.model=Ue,Y.overrideKey=ku(Z)};if(n){const $=new V.LoadingManager,we=f_(n,r);we&&$.setURLModifier(we),new Vd.GLTFLoader($).load(n,me=>{if(he){Fu(me.scene);return}if(De(me.scene),me.animations?.length){const Ue=Math.max(0,Math.min(Z.clipIndex??0,me.animations.length-1)),ze=me.animations[Ue];Y.mixer=new V.AnimationMixer(me.scene),Y.mixer.clipAction(ze).play(),Y.clipDuration=ze.duration}X(z.current)},void 0,me=>{he||(console.error("[PixiThreeModelSprite] model load failed",n,me),ye("cube"),X(z.current))})}else ye("knot");return X(z.current),L(xe),()=>{he=!0,Y.mixer?.stopAllAction(),Y.model&&Fu(Y.model),te.dispose(),F.current=null,L(null),xe.destroy(!0)}},[R,P,n,r,X]),S.useEffect(()=>{X(z.current)},[c,X]),S.useEffect(()=>{if(!se?.current||!N.current)return;const he=N.current,j=E.context(()=>{G.current&&(G.current.kill(),se.current.remove(G.current)),G.current=E.timeline().set(he,{alpha:a?1:0}).to(he,{pixi:{},duration:Number(s)-Number(o),onUpdate:()=>{G.current&&X(G.current.time())}}),se.current.add(G.current,o)});return()=>{G.current&&(se.current.remove(G.current),G.current.progress(0).kill()),j.revert()}},[o,s,i,se,a,X]),M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:N,children:A&&M.jsx(Ot,{x:h,y:p,width:R,height:P,border:v,roundedCorners:T,maskShape:w,crop:O,spriteRef:D,children:M.jsx("pixiSprite",{ref:D,texture:A,width:R,height:P,anchor:C,x:h,y:p,alpha:a?1:0,filters:pe,...!l&&a&&{eventMode:"static",onPointerDown:u}})})})})},LR=I.memo(MR,et);let mo;function PR(){if(mo!==void 0)return mo;const t=Intl.Segmenter;return mo=t?new t(void 0,{granularity:"grapheme"}):null,mo}function d_(t){if(t==="")return[];const e=PR();if(e){const n=[];for(const r of e.segment(t))n.push(r.segment);return n}return Array.from(t)}const NR=/^\s$/;function h_(t){return t.length>0&&NR.test(t[0])}function kR(t,e){return e.tracking!=null?e.tracking:t.tracking??0}function DR({input:t,metrics:e}){const n=[];let r=0;const i=t.paragraphBreak==="crlf";for(let o=0;o<t.runs.length;o++){const s=t.runs[o],a=d_(s.text),l=kR(t,s),c=s.baselineShift??0;for(let u=0;u<a.length;u++){const f=a[u];if(f===`
1422
+ </svg>`,DC=({ref:t,...e})=>{const{pathSequence:n,morphDuration:r=1.4,morphEase:i="expo.inOut",loopBackToStart:o=!0,viewBox:s="0 0 100 100",transformation:{x:a,y:l,width:c,height:u,anchor:f,fill:d="#f59e0b",stroke:h="none",strokeWidth:m=0},startAt:p,visible:g,onSpriteRefReady:y}=e,{app:_}=st.useApplication(),{tl:v}=O.useContext(Ve),x=O.useRef(null),E=O.useRef(null),T=O.useRef(null),A=O.useRef(null),[M,C]=O.useState(null);return O.useEffect(()=>{const k="http://www.w3.org/2000/svg",w=document.createElementNS(k,"svg");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.position="absolute",w.style.left="-9999px",w.style.pointerEvents="none";const L=document.createElementNS(k,"path");return L.setAttribute("d",n[0]),w.appendChild(L),document.body.appendChild(w),T.current=L,()=>{w.remove(),T.current=null}},[n]),O.useEffect(()=>{if(!_?.renderer)return;const k=E_(n[0],c,u,s,d,h,m),w=new K.Graphics().svg(k),L=_.renderer.generateTexture(w);A.current?.destroy(!0),A.current=L,C(L),w.destroy()},[_,n,c,u,s,d,h,m]),O.useEffect(()=>{if(!v?.current||!_?.renderer||!T.current||n.length<2)return;const k=T.current,w=()=>{const N=k.getAttribute("d");if(!N||!x.current)return;const F=E_(N,c,u,s,d,h,m),H=new K.Graphics().svg(F),V=_.renderer.generateTexture(H),$=A.current;A.current=V,x.current.texture=V,H.destroy(),$?.destroy(!0)},L=S.gsap.timeline({defaults:{duration:r,ease:i}});return(o?[...n.slice(1),n[0]]:n.slice(1)).forEach(N=>{L.to(k,{morphSVG:N,onUpdate:w})}),v.current.add(L,p),()=>{L.kill()}},[v,_,n,r,i,o,c,u,s,d,h,m,p]),O.useEffect(()=>()=>{A.current?.destroy(!0),A.current=null},[]),O.useEffect(()=>{x.current&&y&&y(e.uniqueId,E)},[M,y,e.uniqueId]),R.jsx(Je,{...e,ref:t,children:R.jsx("pixiContainer",{ref:E,children:M&&R.jsx("pixiSprite",{ref:x,texture:M,width:c,height:u,anchor:f,x:a,y:l,alpha:g?1:0})})})},S_=t=>{try{t.pause()}catch{}try{t.removeAttribute("src"),t.load()}catch{}},NC=()=>{if(typeof window>"u")return null;const t=window;return t.AudioContext??t.webkitAudioContext??null};function w_(){const t=new Map,e=new Map,n=new Map;let r=null;const i=new Set;let o=0;const s=()=>{o+=1,i.forEach(c=>c())},a=()=>r&&r.state!=="closed"?r:null,l=()=>{const c=a();if(c)return c;const u=NC();return u?(r=new u,r):null};return{get:c=>t.get(c),set(c,u,f){t.set(c,u),e.set(c,f),s()},srcFor:c=>e.get(c),has:c=>t.has(c),delete(c){const u=t.get(c);u&&S_(u),t.delete(c),e.delete(c),s()},forEach:c=>t.forEach(c),get size(){return t.size},get version(){return o},subscribe(c){return i.add(c),()=>{i.delete(c)}},getContext:l,getContextIfExists:a,getOrCreateSourceNode(c){const u=n.get(c);if(u)return u;const f=t.get(c),d=l();if(!f||!d)return null;try{f.crossOrigin!=="anonymous"&&(f.crossOrigin="anonymous");const h=d.createMediaElementSource(f);return h.connect(d.destination),n.set(c,h),h}catch{return null}},getSourceNode:c=>n.get(c),setSourceNode(c,u){n.set(c,u)},hasSourceNode:c=>n.has(c),clear(){t.forEach(S_),t.clear(),e.clear(),n.clear(),s(),r&&r.state!=="closed"&&r.close().catch(()=>{}),r=null}}}const Sr=w_(),Co=.15,Qu=.15,FC=.6,A_=["voiceover","narration","dialogue"];function BC(t){return Math.pow(10,t/20)}function UC(t){return 20*Math.log10(Math.max(t,1e-6))}const wr=t=>t<0?0:t>1?1:t;function O_(t,e,n,r){if(!r)return n;let i=n;const o=r.fadeIn;if(o?.enabled&&(o.duration??0)>0){const a=o.duration;if(t<=a){const l=(o.volume??0)/100,c=a>0?t/a:1;i=l+(n-l)*wr(c)}}const s=r.fadeOut;if(s?.enabled&&(s.duration??0)>0){const a=s.duration,l=e-a;if(t>=l){const c=(s.volume??0)/100,u=a>0?(t-l)/a:1;i=i+(c-i)*wr(u)}}return wr(i)}function M_(t,e,n=Qu,r=Co){if(!e||e.length===0)return 1;const i=wr(n),o=Math.max(0,r);let s=1;for(const a of e){if(a.endSec<=a.startSec)continue;const l=a.startSec-o,c=a.endSec+o;if(t<l||t>c)continue;let u;o>0&&t<a.startSec?u=1+(i-1)*((t-l)/o):t<=a.endSec?u=i:o>0?u=i+(1-i)*((t-a.endSec)/o):u=i,u<s&&(s=u)}return wr(s)}function I_(t,e){if(e.muted||t<0||t>e.clipDuration)return 0;const n=O_(t,e.clipDuration,e.baseVolume,e.fade),r=M_(t,e.duckWindows,e.duckTo,e.duckFade);return wr(n*r)}function C_(t,e=0){if(!t||t.length===0)return[];const n=[...t].sort((o,s)=>o.tMs-s.tMs),r=[];let i=null;for(const o of n){const s=o.gainDb<0;s&&i===null?i=o.tMs:!s&&i!==null&&(r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e}),i=null)}if(i!==null){const o=n[n.length-1];r.push({startSec:i/1e3-e,endSec:o.tMs/1e3-e})}return r}function R_(t,e,n={}){if(!t?.duckDuring)return[];const r=n.mergeGapSec??Co*2,i=t.start??0,s=(t.end??0)-i;if(s<=0)return[];const a=new Set(A_),l=e.filter(u=>!(!u||u.uniqueId&&t.uniqueId&&u.uniqueId===t.uniqueId||t.duckDuring==="voiceover"&&!a.has(u.trackRole??"")||u.mute||u.muted||typeof u.volume=="number"&&u.volume<=0)).map(u=>({startSec:(u.start??0)-i,endSec:(u.end??0)-i})).map(u=>({startSec:Math.max(0,u.startSec),endSec:Math.min(s,u.endSec)})).filter(u=>u.endSec>u.startSec).sort((u,f)=>u.startSec-f.startSec);if(l.length===0)return[];const c=[l[0]];for(let u=1;u<l.length;u+=1){const f=c[c.length-1],d=l[u];d.startSec-f.endSec<=r?f.endSec=Math.max(f.endSec,d.endSec):c.push(d)}return c}function GC(t,e){const n=t.start??0,r=t.end??0,i=t.transformation?.musicDuckEnvelope,o=i?.length?C_(i,n):R_({uniqueId:t.uniqueId,start:n,end:r,trackRole:t.trackRole,duckTo:t.duckTo,duckDuring:t.duckDuring},e);return{baseVolume:typeof t.volume=="number"?t.volume:1,muted:!!(t.mute??t.muted),clipDuration:Math.max(0,r-n),fade:t.transformation?.audioFade,duckTo:t.duckTo??Qu,duckWindows:o,duckFade:Co}}const L_=.2,jC=.05,HC=t=>t<0?0:t>1?1:t,YC=(t,e)=>e>=t.start&&e<t.end;function k_(t,e,n=NaN){const r=t.speed&&t.speed>0?t.speed:1;let i=t.frameStartAt+(e-t.start)*r;return Number.isFinite(n)&&n>0&&(i=Math.min(i,n-jC)),i<0?0:i}function P_(t,e){const n=t.getVolume?t.getVolume(e):t.volume??1;return HC(I_(e-t.start,{baseVolume:Number.isFinite(n)?n:1,muted:t.mute,clipDuration:t.end-t.start,fade:t.audioFade,duckWindows:t.duckWindows,duckTo:t.duckTo}))}function ed(t,e,n,r){if(!YC(t,e)||!n.playing||n.reverse||n.seeking)return{kind:"pause"};const i=k_(t,e,r.duration),o=t.speed&&t.speed>0?t.speed:1,s=P_(t,e);return r.paused?{kind:"play",seekTo:i,volume:s,rate:o,start:!0}:{kind:"play",seekTo:Math.abs(r.currentTime-i)>L_?i:null,volume:s,rate:o,start:!1}}const D_=t=>({paused:t.paused,currentTime:t.currentTime,duration:t.duration});function td(t,e,n){if(e.kind==="pause"){t.paused||t.pause();return}if(e.seekTo!==null&&(t.currentTime=e.seekTo),t.volume=e.volume,t.playbackRate!==e.rate&&(t.playbackRate=e.rate),e.start)try{const r=t.play();r&&typeof r.catch=="function"&&r.catch(i=>n?.(i))}catch(r){n?.(r)}}const nd=({audioElements:t,registry:e=Sr,clearOnUnmount:n=!0})=>{const r=O.useContext(Ve),{registerTimeUpdateListener:i,unregisterTimeUpdateListener:o}=r,s=O.useRef(t);s.current=t;const a=O.useRef(null),l=O.useRef(new Set);O.useEffect(()=>{const u=new Set(t.map(f=>f.uniqueId));for(const f of[...l.current])u.has(f)||(e.delete(f),l.current.delete(f));for(const{uniqueId:f,src:d,speed:h}of t){if(e.srcFor(f)===d&&e.has(f)){l.current.add(f);continue}e.has(f)&&e.delete(f),l.current.add(f);const m=new Audio;m.crossOrigin="anonymous",m.preload="auto",m.loop=!1,m.playbackRate=h&&h>0?h:1,m.volume=0,m.addEventListener("error",()=>{console.error("[AudioPlaybackManager] load error",f,m.error)}),m.src=d,e.set(f,m,d)}},[t,e]),O.useEffect(()=>{if(!i||!o)return;const u=f=>{const d=a.current;a.current=f;const h={playing:r.playStateRef?.current??!1,reverse:d!==null&&f<d-1e-6,seeking:r.isSeekingRef?.current??!1};for(const m of s.current){const p=e.get(m.uniqueId);if(!p||p.readyState===0)continue;const g=ed(m,f,h,D_(p));if(g.kind==="play"){const y=e.getContextIfExists();y&&y.state==="suspended"&&y.resume().catch(()=>{})}td(p,g,()=>{})}};return i(u),()=>o(u)},[i,o,e,r]);const c=()=>e.forEach(u=>{u.paused||u.pause()});return tt(Ne.PAUSE,c),tt(Ne.SCRUBBER_CLICKED,c),tt(Ne.COMPLETE,()=>{e.forEach(u=>{try{u.pause(),u.currentTime=0}catch{}}),a.current=null}),tt(Ne.RESUME,()=>{a.current=null;const u=r.tl?.current?.time();if(typeof u=="number"){const f={playing:!0,reverse:!1,seeking:!1};for(const d of s.current){const h=e.get(d.uniqueId);!h||h.readyState===0||td(h,ed(d,u,f,D_(h)))}}}),O.useEffect(()=>()=>{if(n){e.clear();return}for(const u of l.current)e.delete(u);l.current.clear()},[e,n]),null};nd.displayName="AudioPlaybackManager";const N_={[jt.NONE]:{mode:2},[jt.ROUNDBARS]:{mode:2,alphaBars:!1,ansiBands:!1,barSpace:.25,channelLayout:"single",colorMode:"bar-level",frequencyScale:"log",gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.6,lumiBars:!1,maxFreq:16e3,minFreq:30,mirror:0,radial:!1,reflexRatio:.3,reflexAlpha:1,roundBars:!0,showPeaks:!1,showScaleX:!1,showScaleY:!1,smoothing:.7,weightingFilter:"D"},[jt.LED]:{mode:3,barSpace:.6,ledBars:!0,showScaleX:!1,showScaleY:!1},[jt.RADIAL_SPECTRUM]:{mode:3,barSpace:.25,bgAlpha:.5,fillAlpha:.5,gradient:"prism",ledBars:!1,linearAmplitude:!0,linearBoost:1.8,lineWidth:1.5,maxDecibels:-30,maxFreq:16e3,radial:!0,showBgColor:!0,showPeaks:!0,spinSpeed:2,outlineBars:!0,showScaleX:!1,showScaleY:!1,reflexFit:!0},[jt.LUMI_BARS]:{mode:3,barSpace:.6,lumiBars:!0,reflexRatio:.5,fillAlpha:.3,frequencyScale:"bark",gradientLeft:"steelblue",gradientRight:"orangered",showScaleX:!1,showScaleY:!1},[jt.EQUALIZER]:{mode:2,gradient:"rainbow",lineWidth:1.5,fillAlpha:.5,showPeaks:!1,showScaleX:!1,showScaleY:!1}};function F_(t){return O.useSyncExternalStore(t.subscribe,()=>t.version,()=>0)}const rd={canvas:null,analyzer:null};function B_({uniqueId:t,waveform:e,width:n,height:r,registry:i=Sr}){const o=e!==jt.NONE,[s,a]=I.useState(rd),l=F_(i),c=I.useRef(e);c.current=e;const u=i.has(t);return I.useEffect(()=>{if(!o||!u){a(rd);return}const f=i.getContext();if(!f)return;const d=i.getOrCreateSourceNode(t);if(!d)return;const h=document.createElement("div");h.style.display="none",h.id=`${t}-audioContainer`,document.body.appendChild(h);const m=new pS(h,{audioCtx:f,connectSpeakers:!1,height:r,width:n,...N_[c.current]??{}});return m.connectInput(d),a({canvas:m.canvas,analyzer:m}),()=>{try{m.disconnectInput(d),m.destroy()}catch{}h.remove(),a(rd)}},[o,u,l,t,n,r,i]),I.useEffect(()=>{if(!s.analyzer||!o)return;const f=N_[e]??{};s.analyzer.setOptions(f)},[e,o,s.analyzer]),s}const WC=({ref:t,...e})=>{const{uniqueId:n,src:r,startAt:i,endAt:o,audioStartAt:s=0,mute:a,speed:l,visible:c=!1,volume:u=1,getVolume:f,audioFade:d,duckWindows:h,duckTo:m,managePlayback:p=!0,registry:g=Sr,transformation:y,onAudioElementReady:_}=e,{width:v=300,height:x=300,x:E=100,y:T=100,waveform:A=jt.NONE}=y||{},M=O.useRef(null),C=I.useMemo(()=>[{uniqueId:n,src:r,start:i,end:o,frameStartAt:s,volume:u,getVolume:f,mute:a||!c,speed:l,audioFade:d,duckWindows:h,duckTo:m}],[n,r,i,o,s,u,f,a,c,l,d,h,m]),k=F_(g),w=g.get(n);O.useEffect(()=>{w&&_?.(n,w)},[w,n,k]);const L=B_({uniqueId:n,waveform:A,width:v,height:x,registry:g}),D=I.useMemo(()=>L.canvas?new K.Texture({source:new K.CanvasSource({resource:L.canvas})}):null,[L.canvas]);O.useEffect(()=>()=>{D?.destroy(!0)},[D]),O.useEffect(()=>{if(!D)return;const F=()=>{D.source.update?.()};return K.Ticker.shared.add(F),()=>{K.Ticker.shared.remove(F)}},[D]);const N=A!==jt.NONE&&!!D;return R.jsxs(R.Fragment,{children:[p&&R.jsx(nd,{audioElements:C,registry:g,clearOnUnmount:!1}),N&&R.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,isGif:!0,children:R.jsx("pixiSprite",{texture:D,width:v,height:x,anchor:.5,x:E,y:T,ref:M,alpha:c?1:0})})]})},U_=I.memo(WC,rt),G_=({src:t,start:e,end:n})=>{const r=O.useRef(null),[i,o]=O.useState({audio:null,isPlaying:!1,currentTime:0});O.useEffect(()=>{const f=new Audio(t);f.preload="auto",f.currentTime=e,r.current=f;const d=()=>o(g=>({...g,isPlaying:!0})),h=()=>o(g=>({...g,isPlaying:!1})),m=()=>o(g=>({...g,isPlaying:!1,currentTime:0})),p=()=>{f.currentTime>=n&&(f.pause(),f.currentTime=e)};return f.addEventListener("play",d),f.addEventListener("pause",h),f.addEventListener("ended",m),f.addEventListener("timeupdate",p),o(g=>({...g,audio:f})),()=>{f.pause(),f.removeEventListener("play",d),f.removeEventListener("pause",h),f.removeEventListener("ended",m),f.removeEventListener("timeupdate",p),f.src="",r.current=null}},[t,e,n]);const s=O.useCallback(()=>{const f=r.current;f&&f.play().catch(()=>{})},[]),a=O.useCallback(()=>{r.current?.pause()},[]),l=O.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,o(h=>({...h,currentTime:f})))},[]),c=O.useCallback(()=>{const f=r.current;f&&(f.paused?s():f.pause())},[s]),u=O.useCallback(f=>{const d=r.current;d&&(d.currentTime=f,s(),o(h=>({...h,currentTime:f})))},[s]);return{...i,handlePause:a,handlePlay:s,togglePlay:c,handleSeek:l,playFromTime:u}},XC=G_;function j_(t,e,{loop:n=!0,speed:r=1}={}){const i=t.length;if(i<=1)return 0;const o=t[i-1].end;if(!(o>0))return 0;let s=e*1e3*(Number.isFinite(r)?r:1);if(Number.isNaN(s)||s<=0)return 0;if(s===1/0)return n?0:i-1;if(n)s%=o;else if(s>=o)return i-1;let a=0,l=i-1,c=0;for(;a<=l;){const u=a+l>>>1;t[u].start<=s?(c=u,a=u+1):l=u-1}return c}const zC=({ref:t,...e})=>{const[n,r]=O.useState(null),i=O.useRef(null),o=O.useRef(null),s=O.useRef(void 0),{src:a,uniqueId:l,startAt:c,endAt:u,loop:f=!0,animationSpeed:d=1,visible:h,disabled:m,transformation:{width:p=0,height:g=0,x:y,y:_,colorCorrection:v,effect:x,effects:E,neonColor:T,blendMode:A,border:M,roundedCorners:C,maskShape:k,crop:w,anchor:L=.5},pointerdown:D}=e,{tl:N}=O.useContext(Ve),F=lt({colorCorrection:v,effects:E??{name:x},neonColor:T,blendMode:A});O.useEffect(()=>{let V=!1;return r(null),K.Assets.load(a).then($=>{V||r($)}).catch($=>{console.error("[PixiGifSprite] failed to load",a,$)}),()=>{V=!0}},[a]);const H=()=>{const V=o.current,$=s.current;!V||!$||!n||(V.currentFrame=j_(n.frames,$.time(),{loop:f,speed:d}))};return O.useEffect(()=>{if(!N?.current||!i.current)return;const V=i.current,$=S.context(()=>{s.current&&(s.current.kill(),N.current.remove(s.current)),s.current=S.timeline().set(V,{alpha:h?1:0}).to(V,{pixi:{},duration:Number(u)-Number(c),onUpdate:H}),N.current.add(s.current,c)});return()=>{s.current&&(N.current.remove(s.current),s.current.progress(0).kill()),$.revert()}},[c,u,l,N,h,f,n,d]),R.jsx(Je,{...e,ref:t,isGif:!0,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:R.jsx("pixiContainer",{ref:i,children:n&&R.jsx(Pt,{x:y,y:_,width:p,height:g,border:M,roundedCorners:C,maskShape:k,crop:w,spriteRef:o,children:R.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!1,autoUpdate:!1,loop:f,animationSpeed:d,width:p,height:g,anchor:L,x:y,y:_,alpha:h?1:0,filters:F,...!m&&h&&{eventMode:"static",onPointerDown:D}})})})})},H_=I.memo(zC,rt),Y_=({width:t=800,height:e=500,background:n="#1a1d24",camera:r,defaultLights:i=!0,children:o})=>R.jsx("div",{style:{position:"relative",width:t,height:e,background:n,overflow:"hidden"},children:R.jsxs(As.Canvas,{style:{width:"100%",height:"100%"},camera:{position:r?.position??[0,0,6],fov:r?.fov??60},dpr:[1,2],gl:{antialias:!0,alpha:!0},children:[i&&R.jsxs(R.Fragment,{children:[R.jsx("ambientLight",{intensity:.55}),R.jsx("directionalLight",{position:[5,6,5],intensity:1}),R.jsx("directionalLight",{position:[-5,-2,-3],intensity:.3})]}),o]})}),qt={ambientIntensity:.6,directionalIntensity:1.2,fillIntensity:.8,spinSpeed:.5,playbackSpeed:1};function W_(t,e){const n=t.scale??1,r=t.spinSpeed??qt.spinSpeed;return{position:[t.positionX??0,t.positionY??0,t.positionZ??0],rotation:[t.rotationX??Math.sin(e*.3)*.2,(t.rotationY??0)+e*r,t.rotationZ??0],scale:[n*(t.flipX??1),n*(t.flipY??1),n]}}function X_(t,e,n=qt.playbackSpeed,r=!0){if(!(e>0))return 0;const i=Math.max(0,t*n);return r?i%e:Math.min(i,e)}function z_(t){return t.materialColor!=null||t.roughness!=null||t.metalness!=null||t.emissiveIntensity!=null}function q_(t,e){z_(e)&&t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;e.materialColor!=null&&s.color?.setStyle(e.materialColor),e.roughness!=null&&"roughness"in s&&(s.roughness=e.roughness),e.metalness!=null&&"metalness"in s&&(s.metalness=e.metalness),e.emissiveIntensity!=null&&"emissiveIntensity"in s&&(s.emissiveIntensity=e.emissiveIntensity)}})}function id(t){return[t.materialColor,t.roughness,t.metalness,t.emissiveIntensity].join("|")}function od(t,e,n=1.5){return t>0?t/(2*Math.tan(e*Math.PI/360))*n:3}function V_(t,e,n=1.5){const r=new B.Box3().setFromObject(e);if(r.isEmpty())return;const i=r.getCenter(new B.Vector3),o=r.getSize(new B.Vector3),s=Math.max(o.x,o.y,o.z);t.position.set(i.x,i.y,i.z+od(s,t.fov,n)),t.lookAt(i)}function K_(t,e){if(!e||!Object.keys(e).length)return;const n=t.slice(0,t.lastIndexOf("/")+1),r=new Map;for(const[i,o]of Object.entries(e))r.set(`${n}${i}`,o);return i=>r.get(i)??i}function sd(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i))o&&o.isTexture&&o.dispose();i.dispose()}})}const qC=({ref:t,...e})=>{const{src:n,resources:r,uniqueId:i,startAt:o,endAt:s,visible:a,disabled:l,threeD:c,pointerdown:u,transformation:{width:f=0,height:d=0,x:h,y:m,colorCorrection:p,effect:g,effects:y,neonColor:_,blendMode:v,border:x,roundedCorners:E,maskShape:T,crop:A,anchor:M=.5}}=e,C=f||400,k=d||400,[w,L]=O.useState(null),D=O.useRef(null),N=O.useRef(null),F=O.useRef(null),H=O.useRef(void 0),V=O.useRef(0),$=O.useRef(c??{});$.current=c??{};const{tl:re}=O.useContext(Ve),he=lt({colorCorrection:p,effects:y??{name:g},neonColor:_,blendMode:v}),q=O.useCallback(fe=>{const Y=F.current;if(!Y)return;V.current=fe;const te=$.current;if(Y.ambient.intensity=te.ambientIntensity??qt.ambientIntensity,Y.key.intensity=te.directionalIntensity??qt.directionalIntensity,Y.fill.intensity=te.fillIntensity??qt.fillIntensity,Y.model){const z=W_(te,fe);Y.model.position.set(...z.position),Y.model.rotation.set(...z.rotation),Y.model.scale.set(...z.scale);const le=id(te);le!==Y.overrideKey&&(q_(Y.model,te),Y.overrideKey=le)}Y.mixer&&Y.mixer.setTime(X_(fe,Y.clipDuration,te.playbackSpeed??qt.playbackSpeed)),Y.renderer.render(Y.scene,Y.camera),Y.texture.source.update()},[]);return O.useEffect(()=>{let fe=!1;const Y=document.createElement("canvas");Y.width=C,Y.height=k;const te=new B.WebGLRenderer({canvas:Y,alpha:!0,antialias:!0,preserveDrawingBuffer:!0});te.setPixelRatio(1),te.setSize(C,k,!1),te.setClearColor(0,0),te.outputColorSpace=B.SRGBColorSpace;const z=new B.Scene,le=new B.PerspectiveCamera(45,C/k,.1,1e3);le.position.set(0,0,3);const Q=$.current,ce=new B.AmbientLight(16777215,Q.ambientIntensity??qt.ambientIntensity),ye=new B.DirectionalLight(16777215,Q.directionalIntensity??qt.directionalIntensity);ye.position.set(5,5,5);const U=new B.DirectionalLight(16777215,Q.fillIntensity??qt.fillIntensity);U.position.set(-5,0,5),z.add(ce,ye,U);const Z=K.Texture.from(Y),W={renderer:te,scene:z,camera:le,ambient:ce,key:ye,fill:U,model:null,mixer:null,clipDuration:0,overrideKey:"",texture:Z};F.current=W;const _e=ee=>{z.add(ee),W.model=ee,V_(le,ee)},be=ee=>{const Ee=ee==="cube"?new B.BoxGeometry(.8,.8,.8):new B.TorusKnotGeometry(.6,.25,100,16),de=new B.MeshStandardMaterial({color:new B.Color(Q.materialColor??"#0095dd"),metalness:Q.metalness??(ee==="knot"?.6:0),roughness:Q.roughness??.3,emissive:new B.Color(17544),emissiveIntensity:Q.emissiveIntensity??.2}),ke=new B.Mesh(Ee,de);z.add(ke),W.model=ke,W.overrideKey=id(Q)};if(n){const ee=new B.LoadingManager,Ee=K_(n,r);Ee&&ee.setURLModifier(Ee),new Os.GLTFLoader(ee).load(n,de=>{if(fe){sd(de.scene);return}if(_e(de.scene),de.animations?.length){const ke=Math.max(0,Math.min(Q.clipIndex??0,de.animations.length-1)),je=de.animations[ke];W.mixer=new B.AnimationMixer(de.scene),W.mixer.clipAction(je).play(),W.clipDuration=je.duration}q(V.current)},void 0,de=>{fe||(console.error("[PixiThreeModelSprite] model load failed",n,de),be("cube"),q(V.current))})}else be("knot");return q(V.current),L(Z),()=>{fe=!0,W.mixer?.stopAllAction(),W.model&&sd(W.model),te.dispose(),F.current=null,L(null),Z.destroy(!0)}},[C,k,n,r,q]),O.useEffect(()=>{q(V.current)},[c,q]),O.useEffect(()=>{if(!re?.current||!D.current)return;const fe=D.current,Y=S.context(()=>{H.current&&(H.current.kill(),re.current.remove(H.current)),H.current=S.timeline().set(fe,{alpha:a?1:0}).to(fe,{pixi:{},duration:Number(s)-Number(o),onUpdate:()=>{H.current&&q(H.current.time())}}),re.current.add(H.current,o)});return()=>{H.current&&(re.current.remove(H.current),H.current.progress(0).kill()),Y.revert()}},[o,s,i,re,a,q]),R.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:R.jsx("pixiContainer",{ref:D,children:w&&R.jsx(Pt,{x:h,y:m,width:C,height:k,border:x,roundedCorners:E,maskShape:T,crop:A,spriteRef:N,children:R.jsx("pixiSprite",{ref:N,texture:w,width:C,height:k,anchor:M,x:h,y:m,alpha:a?1:0,filters:he,...!l&&a&&{eventMode:"static",onPointerDown:u}})})})})},VC=I.memo(qC,rt);let Ro;function KC(){if(Ro!==void 0)return Ro;const t=Intl.Segmenter;return Ro=t?new t(void 0,{granularity:"grapheme"}):null,Ro}function $_(t){if(t==="")return[];const e=KC();if(e){const n=[];for(const r of e.segment(t))n.push(r.segment);return n}return Array.from(t)}const $C=/^\s$/;function Z_(t){return t.length>0&&$C.test(t[0])}function ZC(t,e){return e.tracking!=null?e.tracking:t.tracking??0}function JC({input:t,metrics:e}){const n=[];let r=0;const i=t.paragraphBreak==="crlf";for(let o=0;o<t.runs.length;o++){const s=t.runs[o],a=$_(s.text),l=ZC(t,s),c=s.baselineShift??0;for(let u=0;u<a.length;u++){const f=a[u];if(f===`
1423
1423
  `||i&&f==="\r"&&a[u+1]===`
1424
1424
  `){i&&f==="\r"&&u++,n.push({char:`
1425
- `,runIndex:o,charIndex:r++,advance:0,ascent:0,descent:0,isWhitespace:!0,isHardBreak:!0,baselineShift:c});continue}const d=e.measure(s,f),h=h_(f);n.push({char:f,runIndex:o,charIndex:r++,advance:d.advance+l,ascent:d.ascent,descent:d.descent,isWhitespace:h,isHardBreak:!1,baselineShift:c})}}return n}function FR(t,e,n){let r=0;for(let i=e;i<n;i++)r+=t[i].advance;return r}function BR(t,e,n){let r=0;for(let i=n-1;i>=e&&(t[i].isWhitespace&&!t[i].isHardBreak);i--)r++;return r}function Bu(t,e,n,r){const i=BR(t,e,n),o=n-i,s=FR(t,e,o);return{start:e,end:n,width:s,collapsedTrailing:i,endsWithHardBreak:r}}function UR({glyphs:t,maxWidth:e}){const n=[];if(t.length===0)return n;let r=0,i=0,o=0;for(;i<t.length;){const s=t[i];if(s.isHardBreak){n.push(Bu(t,r,i+1,!0)),r=i+1,o=0,i++;continue}if(e===void 0){o+=s.advance,i++;continue}if(s.isWhitespace){o+=s.advance,i++;continue}const a=i;let l=i,c=0;for(;l<t.length&&!t[l].isWhitespace&&!t[l].isHardBreak;)c+=t[l].advance,l++;a>r&&t.slice(r,a).some(f=>!f.isWhitespace)&&o+c>e&&(n.push(Bu(t,r,a,!1)),r=a,o=0);for(let f=a;f<l;f++)o+=t[f].advance;i=l}return r<t.length&&n.push(Bu(t,r,t.length,!1)),n}function GR(t,e,n){let r=0,i=0;for(let o=e;o<n;o++)t[o].ascent>r&&(r=t[o].ascent),t[o].descent>i&&(i=t[o].descent);return{ascent:r,descent:i}}function jR(t,e){return(t+e)*1.2}function HR({glyphs:t,lines:e,leading:n}){const r=[];let i=0;for(let o=0;o<e.length;o++){const s=e[o],{ascent:a,descent:l}=GR(t,s.start,s.end),c=n??jR(a,l);let u;o===0?(u=a,i=u+l):(u=i+(n!=null?n-l:a),n==null?i+=c:i=u+l),r.push({baselineY:u,ascent:a,descent:l})}return r}function YR(t,e){const n=e.end-e.collapsedTrailing;let r=0;for(let i=e.start;i<n;i++)t[i].isWhitespace&&!t[i].isHardBreak&&r++;return r}function p_(t,e,n,r){let i=n;for(let o=e.start;o<e.end;o++)r[o]={x:i,extraAdvance:0},i+=t[o].advance}function m_(t,e,n,r,i){const o=n-e.width,s=YR(t,e);if(o<=0||s===0)return Uu(t,e,r,n,i);const a=o/s;let l=0;for(let c=e.start;c<e.end;c++){i[c]={x:l,extraAdvance:0};const u=t[c];let f=u.advance;u.isWhitespace&&!u.isHardBreak&&c<e.end-e.collapsedTrailing&&(i[c].extraAdvance=a,f+=a),l+=f}}function Uu(t,e,n,r,i){const o=e.width;let s=0;r!=null&&(n==="center"||n==="justify-last-center"?s=(r-o)/2:(n==="right"||n==="justify-last-right")&&(s=r-o)),p_(t,e,s,i)}const g_={left:"left",center:"center",right:"right","justify-full":"left","justify-last-left":"left","justify-last-center":"center","justify-last-right":"right"};function XR({glyphs:t,lines:e,align:n,boxWidth:r}){const i=new Array(t.length);for(let o=0;o<e.length;o++){const s=e[o],l=o===e.length-1||s.endsWithHardBreak,c=n==="justify-full",u=n.startsWith("justify");if(r==null){p_(t,s,0,i);continue}if(!u){Uu(t,s,n,r,i);continue}if(c){m_(t,s,r,"left",i);continue}if(l){Uu(t,s,g_[n],r,i);continue}m_(t,s,r,g_[n],i)}return i}const WR=4096;function y_(t,e){return[t.font,t.weight??"",t.italic?1:0,t.size,e].join("|")}class __{map=new Map;get(e){return this.map.get(e)}set(e,n){if(this.map.size>=WR){const r=this.map.keys().next().value;r!==void 0&&this.map.delete(r)}this.map.set(e,n)}clear(){this.map.clear()}get size(){return this.map.size}}function zR(t){const e=[];return t.italic&&e.push("italic"),t.weight!=null&&e.push(String(t.weight)),e.push(`${t.size}px`),e.push(t.font.includes(" ")?`"${t.font}"`:t.font),e.join(" ")}let mr;function qR(){if(mr!==void 0)return mr;if(typeof document>"u")return mr=null,null;try{mr=document.createElement("canvas").getContext("2d")}catch{mr=null}return mr}function b_(t={}){const e=t.cache??new __;return{measure(n,r){const i=y_(n,r),o=e.get(i);if(o!==void 0)return o;const s=qR();let a=n.size*.5,l=n.size*.75,c=n.size*.25;if(s){s.font=zR(n);const f=s.measureText(r);a=f.width,typeof f.actualBoundingBoxAscent=="number"&&f.actualBoundingBoxAscent>0&&(l=f.actualBoundingBoxAscent),typeof f.actualBoundingBoxDescent=="number"&&f.actualBoundingBoxDescent>0&&(c=f.actualBoundingBoxDescent)}const u={advance:a,ascent:l,descent:c};return e.set(i,u),u}}}let go=null;function VR(){return go||(go=b_()),go}function KR(){go=null}function ZR(t,e){const n=new Array(t.length);let r=0,i=!1;for(const o of e){for(let s=o.start;s<o.end;s++)t[s].isWhitespace?(n[s]=r,i&&(i=!1,r++)):(i=!0,n[s]=r);i&&(i=!1,r++)}return n}function x_(t){const e=t.metrics??VR(),n=t.align??"left",r=t.box?.width,i=DR({input:t,metrics:e}),o=UR({glyphs:i,maxWidth:r}),s=HR({glyphs:i,lines:o,leading:t.leading}),a=XR({glyphs:i,lines:o,align:n,boxWidth:r}),l=ZR(i,o),c=[];let u=0;for(let m=0;m<o.length;m++){const g=o[m],y=s[m];for(let b=g.start;b<g.end;b++){const x=i[b];if(x.isHardBreak)continue;const v=a[b],T=c.length===0||c[c.length-1].lineIndex!==m;c.push({char:x.char,runIndex:x.runIndex,charIndex:x.charIndex,wordIndex:l[b],lineIndex:m,x:v.x,y:y.baselineY-x.baselineShift,advance:x.advance+v.extraAdvance,ascent:x.ascent,descent:x.descent,isWhitespace:x.isWhitespace,isLineStart:T,isLineEnd:!1})}c.length>0&&c[c.length-1].lineIndex===m&&(c[c.length-1].isLineEnd=!0)}const f=[];for(let m=0;m<o.length;m++){const g=s[m];let y=-1,b=-1;for(let w=0;w<c.length;w++)c[w].lineIndex===m&&(y===-1&&(y=w),b=w+1);if(y===-1){f.push({startGlyph:c.length,endGlyph:c.length,width:0,baselineY:g.baselineY,isLast:m===o.length-1});continue}const x=c[y],v=c[b-1],T=v.x+v.advance-x.x;T>u&&(u=T),f.push({startGlyph:y,endGlyph:b,width:T,baselineY:g.baselineY,isLast:m===o.length-1})}const d=f[f.length-1],h=s[s.length-1],p=d?d.baselineY+(h?.descent??0):0;return{glyphs:c,lines:f,bounds:{width:u,height:p}}}function $R(t){const{resolution:e,glyphs:n}=t,r=t.ascender??t.boundingBox?.yMax??e*.8,i=t.descender??t.boundingBox?.yMin??-e*.2;return{measure(o,s){const a=o.size,l=n[s],c=l?l.ha/e*a:a*.5,u=r/e*a,f=-i/e*a;return{advance:c,ascent:u,descent:f}}}}function oi(){const[t,e]=S.useReducer(n=>n+1,0);return Ze(ke.FONTS_LOADED,()=>{W.CanvasTextMetrics.clearMetrics(),KR(),e()},[]),t}const v_=t=>t.dropShadow?typeof t.dropShadow=="object"?{dropShadow:t.dropShadow}:{dropShadow:{color:t.dropShadowColor??"#000000",alpha:t.dropShadowAlpha??1,angle:t.dropShadowAngle??Math.PI/4,blur:t.dropShadowBlur??0,distance:t.dropShadowDistance??5}}:{},T_=t=>{if(t.stroke&&typeof t.stroke=="object")return{stroke:t.stroke};const e=t.strokeThickness??0;return t.stroke==null||e<=0?{}:{stroke:{color:t.stroke,width:e}}},E_=(t,e,n)=>{if(!t||t.length<2)return;const r=(n??0)===0,i=t.length;return new W.FillGradient({type:"linear",start:{x:0,y:0},end:{x:r?0:1,y:r?1:0},textureSpace:"local",colorStops:t.map((o,s)=>({offset:e?.[s]??s/Math.max(i-1,1),color:o}))})},JR=new Set(["normal","bold","bolder","lighter"]),Gu=t=>{if(t==null||t==="")return;const e=String(t).trim().toLowerCase();if(JR.has(e))return e;const n=Number(e);if(Number.isFinite(n)&&n>=100&&n<=900&&n%100===0)return String(n)},S_=t=>{const e=typeof t=="string"?Number(t):t;return typeof e=="number"&&Number.isFinite(e)&&e!==0?e:void 0},QR=5e7,ju=(t,e)=>t==null||t===""?e:t;function Hu(t){const{fontFamily:e="Arial",fontSize:n=16,fontWeight:r,fontStyle:i,fontVariant:o,fill:s="white",gradientColors:a,gradientStops:l,gradientType:c,stroke:u,strokeWidth:f,strokeThickness:d,dropShadow:h,dropShadowColor:p,dropShadowBlur:m=0,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b,blurEnabled:x=!1,blurRadius:v=0,align:T,padding:w,letterSpacing:O,leading:C,wordWrapWidth:R,tagStyles:P}=t,A={fontFamily:e,fontSize:n,wordWrap:!0,breakWords:!0,wordWrapWidth:R&&R>0?R:QR,leading:C||0},L=E_(a,l,c);L?A.fill=L:s==="transparent"?A.fill={color:0,alpha:0}:A.fill=ju(s,"white");const N=Gu(r);N&&(A.fontWeight=N),(i==="italic"||i==="oblique")&&(A.fontStyle=i),(o==="small-caps"||o===!0)&&(A.fontVariant="small-caps"),Object.assign(A,T_({stroke:u,strokeThickness:f??d??0})),x?A.dropShadow={color:ju(p,"black"),alpha:g??1,angle:0,blur:Number(v),distance:0}:Object.assign(A,v_({dropShadow:h,dropShadowColor:ju(p,"black"),dropShadowBlur:Number(m),dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b}));const D=S_(O);return D!==void 0&&(A.letterSpacing=D),(T==="left"||T==="center"||T==="right"||T==="justify")&&(A.align=T),typeof w=="number"&&Number.isFinite(w)&&w>=0&&(A.padding=w),P&&(A.tagStyles=P),A}function eI(t,e,n,r,i,o){const s=r+2*o,a=i+2*o;return{width:s,height:a,x:t+o*(2*n.x-1),y:e+o*(2*n.y-1)}}const tI=t=>typeof t=="number"?{x:t,y:t}:{x:t?.x??.5,y:t?.y??.5},w_="pixitext-hitarea",nI=t=>`${w_}-${t}`,A_="pixitext-text",rI=({ref:t,...e})=>{const r=S.useRef(0),i=S.useRef(null),o=S.useRef(16),s=S.useRef(null),a=S.useRef(null),{app:l}=at.useApplication(),{visible:c,text:u,disabled:f,transformation:d,pointerdown:h,onDobuleClick:p,uniqueId:m,startAt:g,endAt:y,onTextRefReady:b}=e;I.useEffect(()=>{b&&b(m,i)},[b,m]);const{x,y:v,width:T,height:w,anchor:O=.5,backgroundColor:C="transparent",backgroundFit:R="box",backgroundPadding:P=0,backgroundRadius:A=0,colorCorrection:L,blendMode:N,neonColor:D}=d,F=oi(),G=lt({colorCorrection:L,effects:d.effects??{name:d.effect},neonColor:D,blendMode:N});I.useEffect(()=>{o.current=Number(d.fontSize??16)},[d.fontSize]);const z=I.useMemo(()=>{if(!C||C==="transparent")return null;try{return new W.Color(C).toNumber()}catch{return null}},[C]),K=JSON.stringify([d.tagStyles,d.gradientColors,d.gradientStops]),se=I.useMemo(()=>new W.TextStyle(Hu({...d,blurRadius:d.blurRadius})),[F,K,d.fontFamily,d.fontSize,d.fontWeight,d.fontStyle,d.fontVariant,d.fill,d.stroke,d.strokeWidth,d.strokeThickness,d.dropShadow,d.dropShadowColor,d.dropShadowBlur,d.dropShadowAlpha,d.dropShadowAngle,d.dropShadowDistance,d.blurEnabled,d.blurRadius,d.align,d.padding,d.letterSpacing,d.leading,d.wordWrapWidth]);I.useEffect(()=>{s.current={...d}},[d]),I.useImperativeHandle(t,()=>({setWordWrap:(ae,Z={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae;const ce=1/Z.x,J=1/Z.y;i.current.scale.set(ce,J)}},setFontSizeAndTransform:(ae,Z,ce={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae,i.current.style.fontSize=Z;const J=1/ce.x,ie=1/ce.y;i.current.scale.set(J,ie)}},resetScale:()=>{i.current&&i.current.scale.set(1,1)}}),[m,g,y]);const pe=I.useCallback((ae,Z={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae;const ce=1/Z.x,J=1/Z.y;i.current.scale.set(ce,J)}},[i.current]),X=I.useCallback((ae,Z,ce={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=ae,i.current.style.fontSize=Z;const J=1/ce.x,ie=1/ce.y;i.current.scale.set(J,ie)}},[i.current,s.current]),he=tI(O),j=I.useMemo(()=>{if(z===null)return null;if(R==="hug"){const ae=W.CanvasTextMetrics.measureText(u??"",se);return eI(x,v,he,ae.width,ae.height,P)}return{x,y:v,width:T||100,height:w||100}},[z,R,P,u,se,x,v,T,w,O]);I.useEffect(()=>{const ae=a.current;if(!ae||z===null||!j||!l?.renderer)return;const Z=new W.Graphics,ce=Math.max(1,Math.round(j.width)),J=Math.max(1,Math.round(j.height));A>0?Z.roundRect(0,0,ce,J,A):Z.rect(0,0,ce,J),Z.fill({color:z});let ie=null;try{ie=l.renderer.generateTexture(Z)}finally{Z.destroy()}return ae.texture=ie,()=>{a.current===ae&&(ae.texture=W.Texture.EMPTY);try{ie?.destroy(!0)}catch{}}},[l,z,j,A]);const te=()=>{const ae=new Date().getTime();ae-r.current<300&&p?p():h&&h(),r.current=ae},H=()=>{!f&&p&&p()};return M.jsxs($e,{...e,ref:t,isText:!0,onDoubleClick:H,handleDragWordWrap:pe,handleDragFontSize:X,children:[M.jsx("pixiSprite",{texture:W.Texture.EMPTY,x:j?.x??x,y:j?.y??v,width:j?.width??(T||100),height:j?.height??(w||100),anchor:O,alpha:c&&z!==null?1:0,ref:a}),M.jsx("pixiText",{label:A_,style:se,x,y:v,anchor:O,text:u,alpha:c?1:0,...c&&!f&&{eventMode:"static",cursor:"pointer",onPointerDown:te},ref:i,filters:G})]})},O_=I.memo(rI,et);E.registerPlugin(wn);const iI=t=>`aep-bez-${t[0]},${t[1]},${t[2]},${t[3]}`,C_=new Set;function Bn(t){if(!t)return"none";const e=iI(t);if(!C_.has(e)){const[n,r,i,o]=t;wn.create(e,`${n},${r},${i},${o}`),C_.add(e)}return e}const oI={position:t=>{const[e,n]=t;return{x:e,y:n}},scale:t=>{const[e,n]=t;return{scaleX:e,scaleY:n}},rotation:t=>({rotation:t}),opacity:t=>({alpha:t}),skew:t=>({skewX:t}),skewAxis:t=>({skewY:t})};function sI(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function R_(t,e,n,r){const i=oI[t];if(!i||!sI(e))return[];const o=e;if(o.length===0)return[];const s=l=>(l-r)/n,a=[];a.push({at:s(o[0].t),op:"set",vars:{pixi:i(o[0].v)},props:Object.keys(i(o[0].v))});for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){a.push({at:s(u.t),op:"set",vars:{pixi:i(u.v)},props:Object.keys(i(u.v))});continue}const h=Bn(c.easeOut);a.push({at:f,op:"to",vars:{pixi:i(u.v),duration:d,ease:h},props:Object.keys(i(u.v))})}return a}function I_(t,e,n){const r=E.timeline({paused:!0}),i=[],o=t.transform,s=["position","scale","rotation","opacity","skew","skewAxis"];for(const a of s){const l=o[a];if(l===void 0)continue;const c=R_(a,l,n,t.inPoint);for(const u of c)u.op==="to"?r.to(e,u.vars,u.at):r.set(e,u.vars,u.at),i.push(u)}return{timeline:r,segments:i}}const Yu=I.createContext(null),si=({value:t,children:e})=>M.jsx(Yu.Provider,{value:t,children:e});function _t(){const t=I.useContext(Yu);if(!t)throw new Error("useAepLayerContext must be used inside <AepLayerProvider>");return t}function Jt(){return I.useContext(Yu)}const M_=I.createContext(0),L_=({depth:t,children:e})=>M.jsx(M_.Provider,{value:t,children:e});function P_(){return I.useContext(M_)}const yo=8;function ai(t,e){if(!e)return t;const n={...t};for(const[r,i]of Object.entries(e)){const o=t[r];if("type"in i&&i.type){n[r]=i;continue}if(o){n[r]={...o,...i};continue}n[r]={type:"image",src:i.src}}return n}function aI(t,e,n,r=null){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(null);I.useEffect(()=>{const a=i?.current,l=e.current;if(!a||!l||!cI(t))return;const c=o?o.framesToSeconds(t.inPoint):t.inPoint/n,{timeline:u}=I_(t,l,n);s.current=u,a.add(u,c);const f=a.time();return a.time(f===0?1e-6:0,!0),a.time(f,!1),()=>{s.current&&(a.remove(s.current),s.current.kill(),s.current=null)}},[t,n,e,r])}function gr(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function cI(t){const e=t.transform;return gr(e.position)||gr(e.scale)||gr(e.rotation)||gr(e.opacity)||gr(e.skew)||gr(e.skewAxis)}function N_(t){const{tl:e}=I.useContext(Ye),[n,r]=I.useState(0);return I.useEffect(()=>{if(!e?.current)return;let o=0,s=-1;const a=()=>{if(e.current){const l=Math.round(e.current.time()*t);l!==s&&(s=l,r(l))}o=requestAnimationFrame(a)};return o=requestAnimationFrame(a),()=>cancelAnimationFrame(o)},[t,e]),n}var Ce;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(const s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var k_;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(k_||(k_={}));const oe=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_n=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return Number.isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},U=Ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Qt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof Qt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Qt.create=t=>new Qt(t);const Xu=(t,e)=>{let n;switch(t.code){case U.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ce.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ce.joinValues(t.keys,", ")}`;break;case U.invalid_union:n="Invalid input";break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ce.joinValues(t.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${Ce.joinValues(t.options)}, received '${t.received}'`;break;case U.invalid_arguments:n="Invalid function arguments";break;case U.invalid_return_type:n="Invalid function return type";break;case U.invalid_date:n="Invalid date";break;case U.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ce.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case U.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case U.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case U.custom:n="Invalid input";break;case U.invalid_intersection_types:n="Intersection results could not be merged";break;case U.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case U.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ce.assertNever(t)}return{message:n}};let lI=Xu;function uI(){return lI}const fI=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}};function Q(t,e){const n=uI(),r=fI({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xu?void 0:Xu].filter(i=>!!i)});t.common.issues.push(r)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return _e;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return ft.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return _e;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}}const _e=Object.freeze({status:"aborted"}),ci=t=>({status:"dirty",value:t}),bt=t=>({status:"valid",value:t}),D_=t=>t.status==="aborted",F_=t=>t.status==="dirty",yr=t=>t.status==="valid",_o=t=>typeof Promise<"u"&&t instanceof Promise;var fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(fe||(fe={}));class jt{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const B_=(t,e)=>{if(yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Qt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}class Ae{get description(){return this._def.description}_getType(e){return _n(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:_n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(_o(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return B_(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return yr(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>yr(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_n(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(_o(i)?i:Promise.resolve(i));return B_(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=e(i),a=()=>o.addIssue({code:U.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new jn({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nn.create(this,this._def)}nullable(){return Hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ht.create(this)}promise(){return wo.create(this,this._def)}or(e){return xo.create([this,e],this._def)}and(e){return vo.create(this,e,this._def)}transform(e){return new jn({...Ee(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ao({...Ee(this._def),innerType:this,defaultValue:n,typeName:be.ZodDefault})}brand(){return new q_({typeName:be.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Oo({...Ee(this._def),innerType:this,catchValue:n,typeName:be.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Qu.create(this,e)}readonly(){return Co.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dI=/^c[^\s-]{8,}$/i,hI=/^[0-9a-z]+$/,pI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gI=/^[a-z0-9_-]{21}$/i,yI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_I=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wu;const vI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,EI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",OI=new RegExp(`^${U_}$`);function G_(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function CI(t){return new RegExp(`^${G_(t)}$`)}function RI(t){let e=`${U_}T${G_(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function II(t,e){return!!((e==="v4"||!e)&&vI.test(t)||(e==="v6"||!e)&&EI.test(t))}function MI(t,e){if(!yI.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function LI(t,e){return!!((e==="v4"||!e)&&TI.test(t)||(e==="v6"||!e)&&SI.test(t))}class en extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.string,received:o.parsedType}),_e}const r=new ft;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?Q(i,{code:U.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Q(i,{code:U.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")bI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"email",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Wu||(Wu=new RegExp(xI,"u")),Wu.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"emoji",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")mI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"uuid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")gI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"nanoid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")dI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cuid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")hI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cuid2",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")pI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"ulid",code:U.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Q(i,{validation:"url",code:U.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"regex",code:U.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?RI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?OI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?CI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{code:U.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?_I.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"duration",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?II(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"ip",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?MI(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"jwt",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?LI(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"cidr",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?wI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"base64",code:U.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?AI.test(e.data)||(i=this._getOrReturnCtx(e,i),Q(i,{validation:"base64url",code:U.invalid_string,message:o.message}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:U.invalid_string,...fe.errToObj(r)})}_addCheck(e){return new en({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...fe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...fe.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...fe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...fe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...fe.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new en({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new en({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}en.create=t=>new en({checks:[],typeName:be.ZodString,coerce:t?.coerce??!1,...Ee(t)});function PI(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}class _r extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.number,received:o.parsedType}),_e}let r;const i=new ft;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Q(r,{code:U.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?PI(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_finite,message:o.message}),i.dirty()):Ce.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,r,i){return new _r({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:fe.toString(i)}]})}_addCheck(e){return new _r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ce.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}_r.create=t=>new _r({checks:[],typeName:be.ZodNumber,coerce:t?.coerce||!1,...Ee(t)});class li extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==oe.bigint)return this._getInvalidInput(e);let r;const i=new ft;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Q(r,{code:U.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ce.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Q(n,{code:U.invalid_type,expected:oe.bigint,received:n.parsedType}),_e}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,r,i){return new li({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:fe.toString(i)}]})}_addCheck(e){return new li({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}li.create=t=>new li({checks:[],typeName:be.ZodBigInt,coerce:t?.coerce??!1,...Ee(t)});class zu extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.boolean,received:r.parsedType}),_e}return bt(e.data)}}zu.create=t=>new zu({typeName:be.ZodBoolean,coerce:t?.coerce||!1,...Ee(t)});class bo extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_type,expected:oe.date,received:o.parsedType}),_e}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Q(o,{code:U.invalid_date}),_e}const r=new ft;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),Q(i,{code:U.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bo({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}bo.create=t=>new bo({checks:[],coerce:t?.coerce||!1,typeName:be.ZodDate,...Ee(t)});class j_ extends Ae{_parse(e){if(this._getType(e)!==oe.symbol){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.symbol,received:r.parsedType}),_e}return bt(e.data)}}j_.create=t=>new j_({typeName:be.ZodSymbol,...Ee(t)});class qu extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.undefined,received:r.parsedType}),_e}return bt(e.data)}}qu.create=t=>new qu({typeName:be.ZodUndefined,...Ee(t)});class Vu extends Ae{_parse(e){if(this._getType(e)!==oe.null){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.null,received:r.parsedType}),_e}return bt(e.data)}}Vu.create=t=>new Vu({typeName:be.ZodNull,...Ee(t)});class H_ extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return bt(e.data)}}H_.create=t=>new H_({typeName:be.ZodAny,...Ee(t)});class Ku extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return bt(e.data)}}Ku.create=t=>new Ku({typeName:be.ZodUnknown,...Ee(t)});class bn extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return Q(n,{code:U.invalid_type,expected:oe.never,received:n.parsedType}),_e}}bn.create=t=>new bn({typeName:be.ZodNever,...Ee(t)});class Y_ extends Ae{_parse(e){if(this._getType(e)!==oe.undefined){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.void,received:r.parsedType}),_e}return bt(e.data)}}Y_.create=t=>new Y_({typeName:be.ZodVoid,...Ee(t)});class Ht extends Ae{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==oe.array)return Q(n,{code:U.invalid_type,expected:oe.array,received:n.parsedType}),_e;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Q(n,{code:s?U.too_big:U.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Q(n,{code:U.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Q(n,{code:U.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new jt(n,s,n.path,a)))).then(s=>ft.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new jt(n,s,n.path,a)));return ft.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Ht({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new Ht({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new Ht({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}Ht.create=(t,e)=>new Ht({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Ee(e)});function br(t){if(t instanceof tt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=nn.create(br(r))}return new tt({...t._def,shape:()=>e})}else return t instanceof Ht?new Ht({...t._def,type:br(t.element)}):t instanceof nn?nn.create(br(t.unwrap())):t instanceof Hn?Hn.create(br(t.unwrap())):t instanceof Un?Un.create(t.items.map(e=>br(e))):t}class tt extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ce.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==oe.object){const c=this._getOrReturnCtx(e);return Q(c,{code:U.invalid_type,expected:oe.object,received:c.parsedType}),_e}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof bn&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new jt(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof bn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Q(i,{code:U.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new jt(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,d=await u.value;c.push({key:f,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>ft.mergeObjectSync(r,c)):ft.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new tt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:fe.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(e){return new tt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new tt({...this._def,catchall:e})}pick(e){const n={};for(const r of Ce.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new tt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ce.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new tt({...this._def,shape:()=>n})}deepPartial(){return br(this)}partial(e){const n={};for(const r of Ce.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new tt({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ce.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof nn;)o=o._def.innerType;n[r]=o}return new tt({...this._def,shape:()=>n})}keyof(){return W_(Ce.objectKeys(this.shape))}}tt.create=(t,e)=>new tt({shape:()=>t,unknownKeys:"strip",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)}),tt.strictCreate=(t,e)=>new tt({shape:()=>t,unknownKeys:"strict",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)}),tt.lazycreate=(t,e)=>new tt({shape:t,unknownKeys:"strip",catchall:bn.create(),typeName:be.ZodObject,...Ee(e)});class xo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Qt(a.ctx.common.issues));return Q(n,{code:U.invalid_union,unionErrors:s}),_e}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new Qt(l));return Q(n,{code:U.invalid_union,unionErrors:a}),_e}}get options(){return this._def.options}}xo.create=(t,e)=>new xo({options:t,typeName:be.ZodUnion,...Ee(e)});const tn=t=>t instanceof Eo?tn(t.schema):t instanceof jn?tn(t.innerType()):t instanceof So?[t.value]:t instanceof Gn?t.options:t instanceof Ju?Ce.objectValues(t.enum):t instanceof Ao?tn(t._def.innerType):t instanceof qu?[void 0]:t instanceof Vu?[null]:t instanceof nn?[void 0,...tn(t.unwrap())]:t instanceof Hn?[null,...tn(t.unwrap())]:t instanceof q_||t instanceof Co?tn(t.unwrap()):t instanceof Oo?tn(t._def.innerType):[];class Zu extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return Q(n,{code:U.invalid_type,expected:oe.object,received:n.parsedType}),_e;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Q(n,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const s=tn(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Zu({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ee(r)})}}function $u(t,e){const n=_n(t),r=_n(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&r===oe.object){const i=Ce.objectKeys(e),o=Ce.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of o){const l=$u(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===oe.array&&r===oe.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const s=t[o],a=e[o],l=$u(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class vo extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(D_(o)||D_(s))return _e;const a=$u(o.value,s.value);return a.valid?((F_(o)||F_(s))&&n.dirty(),{status:n.value,value:a.data}):(Q(r,{code:U.invalid_intersection_types}),_e)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vo.create=(t,e,n)=>new vo({left:t,right:e,typeName:be.ZodIntersection,...Ee(n)});class Un extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.array)return Q(r,{code:U.invalid_type,expected:oe.array,received:r.parsedType}),_e;if(r.data.length<this._def.items.length)return Q(r,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&r.data.length>this._def.items.length&&(Q(r,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new jt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ft.mergeArray(n,s)):ft.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Un({...this._def,rest:e})}}Un.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Un({items:t,typeName:be.ZodTuple,rest:null,...Ee(e)})};class To extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return Q(r,{code:U.invalid_type,expected:oe.object,received:r.parsedType}),_e;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new jt(r,a,r.path,a)),value:s._parse(new jt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ft.mergeObjectAsync(n,i):ft.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ae?new To({keyType:e,valueType:n,typeName:be.ZodRecord,...Ee(r)}):new To({keyType:en.create(),valueType:e,typeName:be.ZodRecord,...Ee(n)})}}class X_ extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.map)return Q(r,{code:U.invalid_type,expected:oe.map,received:r.parsedType}),_e;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new jt(r,a,r.path,[c,"key"])),value:o._parse(new jt(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}X_.create=(t,e,n)=>new X_({valueType:e,keyType:t,typeName:be.ZodMap,...Ee(n)});class ui extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.set)return Q(r,{code:U.invalid_type,expected:oe.set,received:r.parsedType}),_e;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Q(r,{code:U.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Q(r,{code:U.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return _e;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new jt(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new ui({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new ui({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ui.create=(t,e)=>new ui({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...Ee(e)});class Eo extends Ae{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Eo.create=(t,e)=>new Eo({getter:t,typeName:be.ZodLazy,...Ee(e)});class So extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Q(n,{received:n.data,code:U.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}So.create=(t,e)=>new So({value:t,typeName:be.ZodLiteral,...Ee(e)});function W_(t,e){return new Gn({values:t,typeName:be.ZodEnum,...Ee(e)})}class Gn extends Ae{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Q(n,{expected:Ce.joinValues(r),received:n.parsedType,code:U.invalid_type}),_e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Q(n,{received:n.data,code:U.invalid_enum_value,options:r}),_e}return bt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Gn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Gn.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Gn.create=W_;class Ju extends Ae{_parse(e){const n=Ce.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Ce.objectValues(n);return Q(r,{expected:Ce.joinValues(i),received:r.parsedType,code:U.invalid_type}),_e}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Ce.objectValues(n);return Q(r,{received:r.data,code:U.invalid_enum_value,options:i}),_e}return bt(e.data)}get enum(){return this._def.values}}Ju.create=(t,e)=>new Ju({values:t,typeName:be.ZodNativeEnum,...Ee(e)});class wo extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return Q(n,{code:U.invalid_type,expected:oe.promise,received:n.parsedType}),_e;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return bt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wo.create=(t,e)=>new wo({type:t,typeName:be.ZodPromise,...Ee(e)});class jn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{Q(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return _e;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?_e:l.status==="dirty"||n.value==="dirty"?ci(l.value):l});{if(n.value==="aborted")return _e;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?_e:a.status==="dirty"||n.value==="dirty"?ci(a.value):a}}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!yr(s))return _e;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>yr(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):_e);Ce.assertNever(i)}}jn.create=(t,e,n)=>new jn({schema:t,typeName:be.ZodEffects,effect:e,...Ee(n)}),jn.createWithPreprocess=(t,e,n)=>new jn({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...Ee(n)});class nn extends Ae{_parse(e){return this._getType(e)===oe.undefined?bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nn.create=(t,e)=>new nn({innerType:t,typeName:be.ZodOptional,...Ee(e)});class Hn extends Ae{_parse(e){return this._getType(e)===oe.null?bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Hn.create=(t,e)=>new Hn({innerType:t,typeName:be.ZodNullable,...Ee(e)});class Ao extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ao.create=(t,e)=>new Ao({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Oo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return _o(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oo.create=(t,e)=>new Oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class z_ extends Ae{_parse(e){if(this._getType(e)!==oe.nan){const r=this._getOrReturnCtx(e);return Q(r,{code:U.invalid_type,expected:oe.nan,received:r.parsedType}),_e}return{status:"valid",value:e.data}}}z_.create=t=>new z_({typeName:be.ZodNaN,...Ee(t)});class q_ extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Qu extends Ae{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?_e:o.status==="dirty"?(n.dirty(),ci(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_e:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Qu({in:e,out:n,typeName:be.ZodPipeline})}}class Co extends Ae{_parse(e){const n=this._def.innerType._parse(e),r=i=>(yr(i)&&(i.value=Object.freeze(i.value)),i);return _o(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Co.create=(t,e)=>new Co({innerType:t,typeName:be.ZodReadonly,...Ee(e)});var be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));const le=en.create,k=_r.create,Je=zu.create,NI=Ku.create;bn.create;const Qe=Ht.create,de=tt.create,pt=xo.create,ef=Zu.create;vo.create;const We=Un.create,rn=To.create,V_=Eo.create,nt=So.create,rt=Gn.create;wo.create,nn.create,Hn.create;const K_=rt(["image","video","audio","lottie","gif","svg","font","composition","model"]),Z_=de({type:K_,src:le(),width:k().optional(),height:k().optional(),duration:k().optional()}).strict(),$_=rn(le(),Z_),tf=We([k(),k(),k(),k()]).describe("cubic-bezier(x1,y1,x2,y2)"),nf=t=>de({t:k().finite(),v:t,easeIn:tf.optional(),easeOut:tf.optional(),hold:Je().optional()}).strict(),q=t=>pt([t,Qe(nf(t)).min(1)]),rf=We([k(),k()]),Ro=de({position:q(rf),anchor:q(rf),scale:q(rf),rotation:q(k()),opacity:q(k().min(0).max(1)),skew:q(k()).optional(),skewAxis:q(k()).optional()}).strict(),J_=rt(["drop-shadow","gaussian-blur","directional-blur","glow","levels","curves","hue-saturation","tint","fill","tritone","fast-box-blur","color-balance","brightness-contrast"]),Q_=de({name:J_,enabled:Je().optional(),params:rn(le(),pt([le(),Je(),q(k()),q(le()),q(We([k(),k()])),q(We([k(),k(),k(),k()]))]))}).strict(),eb=rt(["cameraLensBlur","bloom","chromaticAberration","vignette","noise"]),of=de({name:eb,enabled:Je().optional(),params:rn(le(),pt([le(),Je(),q(k()),q(le()),q(We([k(),k()]))]))}).strict(),sf=We([k(),k()]),fi=de({vertices:Qe(sf),inTangents:Qe(sf),outTangents:Qe(sf),closed:Je()}).strict(),tb=rt(["add","subtract","intersect","lighten","darken","difference","alpha"]),nb=de({id:le().min(1),mode:tb,inverted:Je().optional(),opacity:q(k().min(0).max(1)).optional(),expansion:q(k()).optional(),path:pt([fi,Qe(nf(fi)).min(1)])}).strict(),af=We([k(),k(),k()]),kI=We([k(),k()]),Io=de({position:q(af),anchor:q(af),scale:q(kI),rotation:q(af),opacity:q(k().min(0).max(1))}).strict(),rb=de({kind:nt("camera"),id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),hidden:Je().optional(),transform:Ro,transform3D:Io,fov:q(k().positive()),focusDistance:q(k().positive()).optional(),aperture:q(k().min(0)).optional(),blurLevel:q(k().min(0)).optional(),zoom:q(k().positive()).optional(),disableCameraDoF:Je().optional()}).strict(),DI=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),ib=de({kind:nt("light"),id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),hidden:Je().optional(),transform:Ro,transform3D:Io,lightType:rt(["ambient","point","spot","parallel"]),intensity:q(k().min(0)),color:q(DI),falloff:q(k().min(0)).optional(),coneAngle:q(k().min(0).max(180)).optional(),coneFeather:q(k().min(0).max(100)).optional(),castsShadows:Je().optional()}).strict(),ob=rt(["square","ramp-up","ramp-down","triangle","round","smooth"]),sb=rt(["chars","words","lines"]),ab=de({start:q(k()),end:q(k()),offset:q(k()).optional(),basedOn:sb.optional(),shape:ob.optional(),smoothness:q(k()).optional(),easeHigh:q(k()).optional(),easeLow:q(k()).optional()}).strict(),cb=de({range:ab,amount:q(k()).optional(),positionOffset:q(We([k(),k()])).optional(),scaleOffset:q(We([k(),k()])).optional(),rotationOffset:q(k()).optional(),opacityOffset:q(k()).optional(),fillOffset:le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional()}).strict(),FI=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),lb=de({from:k().int().min(0),to:k().int().min(1),font:le().optional(),size:q(k().min(0)).optional(),fill:q(FI).optional(),weight:pt([k(),le()]).optional(),italic:Je().optional(),tracking:q(k()).optional(),baselineShift:q(k()).optional()}).strict().refine(t=>t.to>t.from,{message:"to must exceed from",path:["to"]}),ub=["left","center","right","justify-full","justify-last-left","justify-last-center","justify-last-right"],fb=rt(ub);function cf(t){if(t==null||typeof t!="object")return t;const e=t,n=e.layers;if(!Array.isArray(n))return t;const r={...e,layers:[...n]};for(let i=0;i<n.length;i++){const o=n[i];if(!o||typeof o!="object"||o.kind!=="text")continue;const s=o.style;if(s&&s.align==="justify"){const a={...s,align:"justify-last-left"};r.layers[i]={...o,style:a}}}return r}class db extends Error{constructor(e){super(`text runs overlap: ${e.map(([n,r,i,o])=>`[${n},${r}) ∩ [${i},${o})`).join(", ")}`),this.ranges=e,this.name="TextRunsOverlapError"}ranges}function hb(t,e){const n=[];if(e<=0)return{runs:[],warnings:n};const r=[...t].sort((l,c)=>l.from-c.from),i=[];for(let l=1;l<r.length;l++){const c=r[l-1],u=r[l];u.from<c.to&&i.push([c.from,c.to,u.from,u.to])}if(i.length>0)throw new db(i);const o=[];for(const l of r)l.from>=e||l.to<=0||(l.to>e?(n.push(`run [${l.from},${l.to}) clipped to source length ${e}`),o.push({...l,to:e})):o.push(l));const s=[];let a=0;for(const l of o)l.from>a&&s.push({from:a,to:l.from}),s.push(l),a=l.to;return a<e&&s.push({from:a,to:e}),{runs:s,warnings:n}}const lf=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),pb=de({themeKey:le().min(1),default:lf}).strict(),mb=pt([lf,pb]),uf=q(mb),gb=rn(le(),lf);function ff(t,e){return typeof t=="string"?t:e?.[t.themeKey]??t.default}function Yn(t,e){if(t!==void 0)return typeof t=="string"?t:Array.isArray(t)?t.map(n=>({t:n.t,v:ff(n.v,e),easeIn:n.easeIn,easeOut:n.easeOut,hold:n.hold})):ff(t,e)}const BI=pt([k(),Je(),Qe(k())]),yb=de({id:le().min(1),kind:rt(["element","scene"]),name:le().min(1),from:pt([le().min(1),Qe(le().min(1)).min(1)]),to:pt([le().min(1),Qe(le().min(1)).min(1)]),startFrame:k().finite().min(0),durationFrames:k().finite().positive(),ease:pt([We([k(),k(),k(),k()]),le()]).optional(),params:rn(le(),BI).optional(),region:de({x:k().finite(),y:k().finite(),width:k().positive(),height:k().positive()}).strict().optional(),includeShared:Je().optional()}).strict().superRefine((t,e)=>{t.kind==="element"&&(Array.isArray(t.from)||Array.isArray(t.to))&&e.addIssue({code:U.custom,message:"element transitions require one from and one to layer id",path:[Array.isArray(t.from)?"from":"to"]})}),df=t=>Array.isArray(t)?t:[t],di=le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),UI=rt(["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","add"]),GI=de({kind:nt("rect"),size:q(We([k(),k()])),position:q(We([k(),k()])).optional(),roundness:q(k()).optional()}).strict(),jI=de({kind:nt("ellipse"),size:q(We([k(),k()])),position:q(We([k(),k()])).optional()}).strict(),HI=de({kind:nt("polystar"),starType:rt(["star","polygon"]),points:q(k()),innerRadius:q(k()).optional(),outerRadius:q(k()),innerRoundness:q(k()).optional(),outerRoundness:q(k()).optional(),rotation:q(k()).optional(),position:q(We([k(),k()])).optional()}).strict(),YI=de({kind:nt("bezier"),path:pt([fi,Qe(de({t:k(),v:fi,easeIn:We([k(),k(),k(),k()]).optional(),easeOut:We([k(),k(),k(),k()]).optional(),hold:Je().optional()}).strict()).min(1)])}).strict(),_b=ef("kind",[GI,jI,HI,YI]),bb=de({color:q(di),width:q(k().min(0)),dashes:Qe(k()).optional(),lineCap:rt(["butt","round","square"]).optional(),lineJoin:rt(["miter","round","bevel"]).optional()}).strict(),XI=de({start:q(k().min(0).max(1)),end:q(k().min(0).max(1)),offset:q(k()).optional()}).strict(),xb=de({font:le(),size:q(k().min(0)),fill:uf.optional(),stroke:bb.optional(),weight:pt([k(),le()]).optional(),italic:Je().optional(),letterSpacing:q(k()).optional(),lineHeight:q(k()).optional(),tracking:q(k()).optional(),leading:q(k()).optional(),boxWidth:k().positive().optional(),align:fb.optional(),runs:Qe(lb).optional(),tagStyles:rn(le(),de({fill:di.optional(),weight:pt([k(),le()]).optional(),italic:Je().optional()}).strict()).optional()}).strict(),WI=de({sourceId:le().min(1),mode:rt(["alpha","alpha-inverted","luma","luma-inverted"])}).strict(),Ct={id:le().min(1),name:le().optional(),inPoint:k().finite(),outPoint:k().finite(),startTime:k().finite().optional(),parent:le().optional(),blendMode:UI.optional(),hidden:Je().optional(),transform:Ro,masks:Qe(nb).optional(),effects:Qe(Q_).optional(),trackMatte:WI.optional(),is3D:Je().optional(),transform3D:Io.optional()},on=le().min(1),zI=de({...Ct,kind:nt("image"),assetId:on}).strict(),qI=de({...Ct,kind:nt("video"),assetId:on,timeRemap:q(k()).optional(),muted:Je().optional()}).strict(),VI=de({...Ct,kind:nt("audio"),assetId:on,level:q(k().min(0)).optional(),pan:q(k().min(-1).max(1)).optional()}).strict(),KI=de({...Ct,kind:nt("gif"),assetId:on}).strict(),ZI=de({...Ct,kind:nt("lottie"),assetId:on,speed:k().optional()}).strict(),$I=de({...Ct,kind:nt("svg"),assetId:on}).strict(),JI=de({...Ct,kind:nt("text"),source:q(le()),style:xb,animators:Qe(cb).optional(),splitMode:rt(["single","chars","words","lines"]).optional(),extrusion:V_(()=>vb).optional()}).strict(),vb=de({depth:q(k().min(0)),bevelEnabled:Je().optional(),bevelThickness:q(k().min(0)).optional(),bevelSize:q(k().min(0)).optional(),bevelSegments:k().int().min(0).optional(),curveSegments:k().int().min(1).optional(),sideMaterial:de({color:di.optional(),metalness:k().min(0).max(1).optional(),roughness:k().min(0).max(1).optional()}).strict().optional()}).strict(),QI=de({...Ct,kind:nt("shape"),path:_b,fill:uf.optional(),stroke:bb.optional(),trimPath:XI.optional(),extrusion:vb.optional()}).strict(),eM=de({...Ct,kind:nt("null")}).strict(),tM=de({...Ct,kind:nt("precomp"),compId:le().min(1),width:k().positive(),height:k().positive()}).strict(),nM=de({width:k().positive(),height:k().positive(),depth:k().positive().optional()}).strict(),rM=de({type:nt("primitive"),shape:rt(["can","bottle","box","jar","tube","pouch"]),proportions:nM.optional()}).strict(),iM=de({type:nt("extrude"),contour:Qe(We([k(),k()])).min(3).max(2e3),depth:q(k().min(0)),bevel:k().min(0).optional()}).strict(),oM=de({type:nt("gltf"),assetId:on}).strict(),sM=ef("type",[rM,iM,oM]),aM=de({label:on.optional(),front:on.optional(),side:di.optional()}).strict(),cM=de({roughness:q(k().min(0).max(1)).optional(),metalness:q(k().min(0).max(1)).optional(),clearcoat:k().min(0).max(1).optional()}).strict(),lM=de({rotation:q(We([k(),k(),k()])).optional(),position:q(We([k(),k(),k()])).optional(),scale:q(k().positive()).optional()}).strict(),uM=de({azimuth:q(k()).optional(),elevation:q(k()).optional(),intensity:q(k().min(0)).optional(),color:di.optional()}).strict(),fM=de({preset:rt(["studio","window","golden","night"]).optional(),key:uM.optional(),fill:de({intensity:q(k().min(0)).optional()}).strict().optional(),rim:de({intensity:q(k().min(0)).optional()}).strict().optional(),environment:rt(["room","none"]).optional()}).strict(),dM=de({opacity:q(k().min(0).max(1)),softness:k().min(0).max(1).optional(),offsetY:k().optional()}).strict(),hM=de({width:k().int().min(16).max(4096),height:k().int().min(16).max(4096)}).strict(),pM=de({center:We([k(),k(),k()]).optional(),size:We([k().positive(),k().positive(),k().positive()])}).strict(),mM=de({...Ct,kind:nt("model3d"),viewport:hM,source:sM,textures:aM.optional(),material:cM.optional(),view:lM.optional(),lighting:fM.optional(),shadow:dM.optional(),bounds:pM.optional(),camera:de({fov:k().min(10).max(90).optional(),fit:k().min(.5).max(3).optional()}).strict().optional()}).strict(),Tb=ef("kind",[zI,qI,VI,KI,ZI,$I,JI,QI,eM,tM,mM,rb,ib]).superRefine((t,e)=>{t.kind==="camera"||t.kind==="light"||t.is3D===!0&&!t.transform3D&&e.addIssue({code:U.custom,message:"is3D: true requires a `transform3D` field",path:["transform3D"]})}),gM="1.10.0",hf=1,Eb="1.4.0",pf="1.10.0";function Sb(t,e){const n=t.split(".").map(i=>Number.parseInt(i,10)),r=e.split(".").map(i=>Number.parseInt(i,10));for(let i=0;i<3;i++){const o=n[i]??0,s=r[i]??0;if(o>s)return!0;if(o<s)return!1}return!0}const yM=le().regex(/^\d+\.\d+\.\d+$/,"expected semver string like '1.0.0'").refine(t=>Number.parseInt(t.split(".")[0]??"",10)===hf,`unsupported schema major; this build expects major ${hf}`),_M=de({family:le(),src:le().optional(),weight:pt([k(),le()]).optional(),style:rt(["normal","italic","oblique"]).optional()}).strict(),bM=de({src:le().optional(),msdf:de({json:le(),png:le()}).strict().optional()}).strict().refine(t=>t.src!=null||t.msdf!=null,{message:"fonts3D entry must declare at least one of `src` or `msdf`"}),Mo=de({version:yM,id:le().min(1),name:le().optional(),width:k().positive(),height:k().positive(),fps:k().positive(),durationInFrames:k().positive(),bgColor:le().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional(),layers:Qe(Tb),assets:$_,fonts:Qe(_M).optional(),fonts3D:rn(le(),bM).optional(),precomps:rn(le(),V_(()=>Mo)).optional(),postFx:Qe(of).optional(),theme:gb.optional(),transitions:Qe(yb).optional(),meta:rn(le(),NI()).optional()}).strict().superRefine((t,e)=>{const n=new Set;for(const u of t.layers)n.has(u.id)&&e.addIssue({code:U.custom,message:`duplicate layer id: ${u.id}`,path:["layers"]}),n.add(u.id);const r=new Set(t.layers.map(u=>u.id));for(let u=0;u<t.layers.length;u++){const f=t.layers[u].parent;f&&!r.has(f)&&e.addIssue({code:U.custom,message:`parent '${f}' is not a layer in this composition`,path:["layers",u,"parent"]})}const i=new Map(t.layers.map(u=>[u.id,u]));for(let u=0;u<t.layers.length;u++){const f=t.layers[u],d=new Set;let h=f;for(;h?.parent;){if(d.has(h.id)){e.addIssue({code:U.custom,message:`cyclic parent chain detected at layer '${f.id}'`,path:["layers",u,"parent"]});break}d.add(h.id),h=i.get(h.parent)}}for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(f.kind!=="precomp")continue;const d=t.assets[f.compId],h=t.precomps?.[f.compId];if(!d&&!h){e.addIssue({code:U.custom,message:`precomp layer '${f.id}' references unknown compId '${f.compId}'`,path:["layers",u,"compId"]});continue}d&&d.type!=="composition"&&e.addIssue({code:U.custom,message:`asset '${f.compId}' is not a composition (got '${d.type}')`,path:["layers",u,"compId"]})}const o=new Set(["image","video","audio","gif","lottie","svg"]);for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(!o.has(f.kind))continue;const d=f.assetId;t.assets[d]||e.addIssue({code:U.custom,message:`layer '${f.id}' references unknown assetId '${d}'`,path:["layers",u,"assetId"]})}for(let u=0;u<t.layers.length;u++){const d=t.layers[u].trackMatte;d&&!r.has(d.sourceId)&&e.addIssue({code:U.custom,message:`trackMatte source '${d.sourceId}' is not a layer in this composition`,path:["layers",u,"trackMatte","sourceId"]})}t.layers.some(u=>u.kind==="model3d")&&!Sb(t.version,Eb)&&e.addIssue({code:U.custom,message:`model3d layers require schema >= ${Eb} (got ${t.version})`,path:["version"]});const a=t.transitions??[];t.transitions!==void 0&&!Sb(t.version,pf)&&e.addIssue({code:U.custom,message:`transitions require schema >= ${pf} (got ${t.version})`,path:["version"]});const l=new Set,c=new Map;for(let u=0;u<a.length;u+=1){const f=a[u];l.has(f.id)&&e.addIssue({code:U.custom,message:`duplicate transition id: ${f.id}`,path:["transitions",u,"id"]}),l.add(f.id);const d=df(f.from),h=df(f.to),p=new Set(d),m=[...new Set([...d,...h])];for(const g of h)p.has(g)&&e.addIssue({code:U.custom,message:`transition '${f.id}' uses layer '${g}' as both from and to`,path:["transitions",u]});for(const g of m){const y=i.get(g);if(!y){e.addIssue({code:U.custom,message:`transition '${f.id}' references unknown layer '${g}'`,path:["transitions",u]});continue}(y.kind==="camera"||y.kind==="light"||y.kind==="audio"||"is3D"in y&&y.is3D===!0)&&e.addIssue({code:U.custom,message:`transition '${f.id}' endpoint '${g}' must be a 2D visual layer`,path:["transitions",u]});const b=c.get(g)??[],x=f.startFrame,v=x+f.durationFrames;for(const T of b)x<T.end&&T.start<v&&e.addIssue({code:U.custom,message:`transition '${f.id}' overlaps '${T.id}' on layer '${g}'`,path:["transitions",u]});b.push({start:x,end:v,id:f.id}),c.set(g,b)}f.startFrame+f.durationFrames>t.durationInFrames&&e.addIssue({code:U.custom,message:`transition '${f.id}' extends past composition duration`,path:["transitions",u,"durationFrames"]})}for(let u=0;u<t.layers.length;u++){const f=t.layers[u];if(f.kind==="model3d"){f.source.type==="gltf"&&(t.assets[f.source.assetId]||e.addIssue({code:U.custom,message:`model3d layer '${f.id}' references unknown assetId '${f.source.assetId}'`,path:["layers",u,"source","assetId"]}));for(const d of["label","front"]){const h=f.textures?.[d];h&&(t.assets[h]||e.addIssue({code:U.custom,message:`model3d layer '${f.id}' references unknown texture assetId '${h}'`,path:["layers",u,"textures",d]}))}}}});function Lo(t){return Mo.parse(cf(t))}function xM(t){const e=Mo.safeParse(cf(t));return e.success?{success:!0,data:e.data}:{success:!1,error:e.error}}function vM(t){return t?t.startsWith("http://")||t.startsWith("https://"):!1}const TM={NONE:"none",FADE:"fade",DISSOLVE:"dissolve",WIPE:"wipe",WIPE_LEFT:"wipeLeft",WIPE_RIGHT:"wipeRight",WIPE_UP:"wipeUp",WIPE_DOWN:"wipeDown",DIRECTIONAL:"directional",DIRECTIONAL_EASING:"directional-easing",DIRECTIONAL_SCALED:"directionalScaled",DIRECTIONAL_WARP:"directionalwarp",DIRECTIONAL_WIPE:"directionalwipe",LEFT_RIGHT:"leftRight",TOP_BOTTOM:"topBottom",CROSS_ZOOM:"crossZoom",SIMPLE_ZOOM:"simpleZoom",SIMPLE_ZOOM_OUT:"simpleZoomOut",ZOOM_IN_CIRCLES:"zoomInCircles",ZOOM_LEFT_WIPE:"zoomLeftWipe",ZOOM_RIGHT_WIPE:"zoomRigthWipe",SCALE_IN:"scale-in",CIRCLE:"circle",CIRCLE_OPEN:"circleopen",CIRCLE_CROP:"circleCrop",RECTANGLE:"rectangle",RECTANGLE_CROP:"rectangleCrop",HEART:"heart",HEXAGONALIZE:"hexagonalize",POLKA_DOTS_CURTAIN:"polkaDotsCurtain",RANDOM_SQUARES:"randomsquares",SQUARES_WIRE:"squareswire",ANGULAR:"angular",CUBE:"cube",ROTATE_SCALE_FADE:"rotate_scale_fade",ROTATE_SCALE_VANISH:"rotateScaleVanish",ROTATE_TRANSITION:"rotateTransition",BOOK_FLIP:"bookFlip",PAGE_CURL:"pageCurl",INVERTED_PAGE_CURL:"invertedPageCurl",BOW_TIE_HORIZONTAL:"bowTieHorizontal",BOW_TIE_VERTICAL:"bowTieVertical",BOW_TIE_WITH_PARAMETER:"bowTieWithParameter",HORIZONTAL_OPEN:"horizontalOpen",HORIZONTAL_CLOSE:"horizontalClose",VERTICAL_OPEN:"verticalOpen",VERTICAL_CLOSE:"verticalClose",LINEAR_BLUR:"linearBlur",DREAMY:"dreamy",DREAMY_ZOOM:"dreamyZoom",SWIRL:"swirl",RIPPLE:"ripple",WIND:"wind",WATER_DROP:"waterDrop",DISPLACEMENT:"displacement",SQUEEZE:"squeeze",GLITCH_DISPLACE:"glitchDisplace",GLITCH_MEMORIES:"glitchMemories",TV_STATIC:"tvStatic",STATIC_FADE:"staticFade",STATIC_WIPE:"static_wipe",PARAMETRIC_GLITCH:"parametric_glitch",BURN:"burn",FILM_BURN:"filmBurn",UNDULATING_BURN_OUT:"undulatingBurnOut",DOOM_SCREEN_TRANSITION:"doomScreenTransition",OVEREXPOSURE:"overexposure",FADE_COLOR:"fadecolor",FADE_GRAYSCALE:"fadegrayscale",COLOR_PHASE:"colorphase",COLOUR_DISTANCE:"colourDistance",MULTIPLY_BLEND:"multiply_blend",GRID_FLIP:"gridFlip",MOSAIC:"mosaic",MOSAIC_TRANSITION:"mosaic_transition",PIXELIZE:"pixelize",CROSSHATCH:"crosshatch",WINDOW_BLINDS:"windowblinds",WINDOW_SLICE:"windowslice",MORPH:"morph",SWAP:"swap",CROSSWARP:"crosswarp",POLAR_FUNCTION:"polar_function",COORD_FROM_IN:"coord-from-in",KALEIDOSCOPE:"kaleidoscope",POWER_KALEIDO:"powerKaleido",PINWHEEL:"pinwheel",FLYEYE:"flyeye",STEREO_VIEWER:"stereoViewer",PERLIN:"perlin",RANDOM_NOISEX:"randomNoisex",TANGENT_MOTION_BLUR:"tangentMotionBlur",LUMA:"luma",LUMINANCE_MELT:"luminance_melt",BOUNCE:"bounce",BUTTERFLY_WAVE_SCRAWLER:"butterflyWaveScrawler",CRAZY_PARAMETRIC_FUN:"crazyParametricFun",CANNABIS_LEAF:"cannabisleaf",RADIAL:"radial",ROLLS:"rolls",SLIDES:"slides",DOORWAY:"doorway",EDGE_TRANSITION:"edgeTransition",X_AXIS_TRANSLATION:"x_axis_translation",SIMPLE_FLIP:"simpleFlip",HSV_FADE:"hsvfade",FOLD:"fold",BLOCK_DISSOLVE:"blockDissolve",ADVANCED_MOSAIC:"advancedMosaic",DEFOCUS_BLUR:"defocusBlur",PUZZLE_RIGHT:"puzzleRight",TILES_WAVE:"tilesWave",STAR_WIPE:"starWipe",CHESSBOARD:"chessboard",BURN_EFFECT:"burn0",FRAGMENT:"fragment",ZOOM_IN_OUT:"zoomInOut"},EM={fade:"fade",dissolve:"fade",wipe:"wipeLeft",wipeLeft:"wipeLeft",wipeRight:"wipeRight",wipeUp:"wipeUp",wipeDown:"wipeDown",directional:"Directional","directional-easing":"Directional",directionalScaled:"Directional",directionalwarp:"directionalwarp",directionalwipe:"directionalwipe",leftRight:"Directional",topBottom:"Directional",crossZoom:"CrossZoom",simpleZoom:"SimpleZoom",simpleZoomOut:"SimpleZoomOut",zoomInCircles:"ZoomInCircles",zoomLeftWipe:"ZoomLeftWipe",zoomRigthWipe:"ZoomRigthWipe",zoomInOut:"zoomInOut","scale-in":"scale-in",simpleFlip:"SimpleFlip",hsvfade:"HSVfade",fold:"Fold",blockDissolve:"BlockDissolve",advancedMosaic:"AdvancedMosaic",defocusBlur:"DefocusBlur",puzzleRight:"PuzzleRight",tilesWave:"TilesWave",starWipe:"StarWipe",chessboard:"chessboard",burn0:"burn0",fragment:"fragment",circle:"circle",circleopen:"circleopen",circleCrop:"CircleCrop",heart:"heart",hexagonalize:"hexagonalize",randomsquares:"randomsquares",squareswire:"squareswire",bowTieHorizontal:"BowTieHorizontal",bowTieVertical:"BowTieVertical",bowTieWithParameter:"BowTieVertical",BowTieHorizontal:"BowTieHorizontal",BowTieVertical:"BowTieVertical",linearBlur:"LinearBlur",dreamy:"dreamy",swirl:"Swirl",mosaic:"Mosaic",Mosaic:"Mosaic",windowslice:"windowslice",WindowSlice:"windowslice",windowblinds:"windowblinds",WindowBlinds:"windowblinds",stereoviewer:"StereoViewer",StereoViewer:"StereoViewer",doorway:"doorway",Doorway:"doorway"},wb=new Set,Ab=t=>t.toLowerCase().replace(/[^a-z0-9]/g,""),Po=t=>{if(!t)return null;const e=EM[t];if(e){const i=os.find(o=>o.name.toLowerCase()===e.toLowerCase());if(i)return i}const n=t.toLowerCase(),r=Ab(t);return os.find(i=>i.name.toLowerCase()===n||Ab(i.name)===r)??null},Ob=t=>Po(t)!==null,Cb=()=>os.map(t=>t.name),SM=Po,wM=Cb,AM=t=>{wb.has(t)||(wb.add(t),console.warn(`[reacthub-pixitweenjs] Unknown GL transition "${t}"; using crossfade fallback.`))},OM=`in vec2 aPosition;
1425
+ `,runIndex:o,charIndex:r++,advance:0,ascent:0,descent:0,isWhitespace:!0,isHardBreak:!0,baselineShift:c});continue}const d=e.measure(s,f),h=Z_(f);n.push({char:f,runIndex:o,charIndex:r++,advance:d.advance+l,ascent:d.ascent,descent:d.descent,isWhitespace:h,isHardBreak:!1,baselineShift:c})}}return n}function QC(t,e,n){let r=0;for(let i=e;i<n;i++)r+=t[i].advance;return r}function eR(t,e,n){let r=0;for(let i=n-1;i>=e&&(t[i].isWhitespace&&!t[i].isHardBreak);i--)r++;return r}function ad(t,e,n,r){const i=eR(t,e,n),o=n-i,s=QC(t,e,o);return{start:e,end:n,width:s,collapsedTrailing:i,endsWithHardBreak:r}}function tR({glyphs:t,maxWidth:e}){const n=[];if(t.length===0)return n;let r=0,i=0,o=0;for(;i<t.length;){const s=t[i];if(s.isHardBreak){n.push(ad(t,r,i+1,!0)),r=i+1,o=0,i++;continue}if(e===void 0){o+=s.advance,i++;continue}if(s.isWhitespace){o+=s.advance,i++;continue}const a=i;let l=i,c=0;for(;l<t.length&&!t[l].isWhitespace&&!t[l].isHardBreak;)c+=t[l].advance,l++;a>r&&t.slice(r,a).some(f=>!f.isWhitespace)&&o+c>e&&(n.push(ad(t,r,a,!1)),r=a,o=0);for(let f=a;f<l;f++)o+=t[f].advance;i=l}return r<t.length&&n.push(ad(t,r,t.length,!1)),n}function nR(t,e,n){let r=0,i=0;for(let o=e;o<n;o++)t[o].ascent>r&&(r=t[o].ascent),t[o].descent>i&&(i=t[o].descent);return{ascent:r,descent:i}}function rR(t,e){return(t+e)*1.2}function iR({glyphs:t,lines:e,leading:n}){const r=[];let i=0;for(let o=0;o<e.length;o++){const s=e[o],{ascent:a,descent:l}=nR(t,s.start,s.end),c=n??rR(a,l);let u;o===0?(u=a,i=u+l):(u=i+(n!=null?n-l:a),n==null?i+=c:i=u+l),r.push({baselineY:u,ascent:a,descent:l})}return r}function oR(t,e){const n=e.end-e.collapsedTrailing;let r=0;for(let i=e.start;i<n;i++)t[i].isWhitespace&&!t[i].isHardBreak&&r++;return r}function J_(t,e,n,r){let i=n;for(let o=e.start;o<e.end;o++)r[o]={x:i,extraAdvance:0},i+=t[o].advance}function Q_(t,e,n,r,i){const o=n-e.width,s=oR(t,e);if(o<=0||s===0)return cd(t,e,r,n,i);const a=o/s;let l=0;for(let c=e.start;c<e.end;c++){i[c]={x:l,extraAdvance:0};const u=t[c];let f=u.advance;u.isWhitespace&&!u.isHardBreak&&c<e.end-e.collapsedTrailing&&(i[c].extraAdvance=a,f+=a),l+=f}}function cd(t,e,n,r,i){const o=e.width;let s=0;r!=null&&(n==="center"||n==="justify-last-center"?s=(r-o)/2:(n==="right"||n==="justify-last-right")&&(s=r-o)),J_(t,e,s,i)}const eb={left:"left",center:"center",right:"right","justify-full":"left","justify-last-left":"left","justify-last-center":"center","justify-last-right":"right"};function sR({glyphs:t,lines:e,align:n,boxWidth:r}){const i=new Array(t.length);for(let o=0;o<e.length;o++){const s=e[o],l=o===e.length-1||s.endsWithHardBreak,c=n==="justify-full",u=n.startsWith("justify");if(r==null){J_(t,s,0,i);continue}if(!u){cd(t,s,n,r,i);continue}if(c){Q_(t,s,r,"left",i);continue}if(l){cd(t,s,eb[n],r,i);continue}Q_(t,s,r,eb[n],i)}return i}const aR=4096;function tb(t,e){return[t.font,t.weight??"",t.italic?1:0,t.size,e].join("|")}class nb{map=new Map;get(e){return this.map.get(e)}set(e,n){if(this.map.size>=aR){const r=this.map.keys().next().value;r!==void 0&&this.map.delete(r)}this.map.set(e,n)}clear(){this.map.clear()}get size(){return this.map.size}}function cR(t){const e=[];return t.italic&&e.push("italic"),t.weight!=null&&e.push(String(t.weight)),e.push(`${t.size}px`),e.push(t.font.includes(" ")?`"${t.font}"`:t.font),e.join(" ")}let Ar;function lR(){if(Ar!==void 0)return Ar;if(typeof document>"u")return Ar=null,null;try{Ar=document.createElement("canvas").getContext("2d")}catch{Ar=null}return Ar}function rb(t={}){const e=t.cache??new nb;return{measure(n,r){const i=tb(n,r),o=e.get(i);if(o!==void 0)return o;const s=lR();let a=n.size*.5,l=n.size*.75,c=n.size*.25;if(s){s.font=cR(n);const f=s.measureText(r);a=f.width,typeof f.actualBoundingBoxAscent=="number"&&f.actualBoundingBoxAscent>0&&(l=f.actualBoundingBoxAscent),typeof f.actualBoundingBoxDescent=="number"&&f.actualBoundingBoxDescent>0&&(c=f.actualBoundingBoxDescent)}const u={advance:a,ascent:l,descent:c};return e.set(i,u),u}}}let Lo=null;function uR(){return Lo||(Lo=rb()),Lo}function dR(){Lo=null}function fR(t,e){const n=new Array(t.length);let r=0,i=!1;for(const o of e){for(let s=o.start;s<o.end;s++)t[s].isWhitespace?(n[s]=r,i&&(i=!1,r++)):(i=!0,n[s]=r);i&&(i=!1,r++)}return n}function ib(t){const e=t.metrics??uR(),n=t.align??"left",r=t.box?.width,i=JC({input:t,metrics:e}),o=tR({glyphs:i,maxWidth:r}),s=iR({glyphs:i,lines:o,leading:t.leading}),a=sR({glyphs:i,lines:o,align:n,boxWidth:r}),l=fR(i,o),c=[];let u=0;for(let p=0;p<o.length;p++){const g=o[p],y=s[p];for(let _=g.start;_<g.end;_++){const v=i[_];if(v.isHardBreak)continue;const x=a[_],E=c.length===0||c[c.length-1].lineIndex!==p;c.push({char:v.char,runIndex:v.runIndex,charIndex:v.charIndex,wordIndex:l[_],lineIndex:p,x:x.x,y:y.baselineY-v.baselineShift,advance:v.advance+x.extraAdvance,ascent:v.ascent,descent:v.descent,isWhitespace:v.isWhitespace,isLineStart:E,isLineEnd:!1})}c.length>0&&c[c.length-1].lineIndex===p&&(c[c.length-1].isLineEnd=!0)}const f=[];for(let p=0;p<o.length;p++){const g=s[p];let y=-1,_=-1;for(let T=0;T<c.length;T++)c[T].lineIndex===p&&(y===-1&&(y=T),_=T+1);if(y===-1){f.push({startGlyph:c.length,endGlyph:c.length,width:0,baselineY:g.baselineY,isLast:p===o.length-1});continue}const v=c[y],x=c[_-1],E=x.x+x.advance-v.x;E>u&&(u=E),f.push({startGlyph:y,endGlyph:_,width:E,baselineY:g.baselineY,isLast:p===o.length-1})}const d=f[f.length-1],h=s[s.length-1],m=d?d.baselineY+(h?.descent??0):0;return{glyphs:c,lines:f,bounds:{width:u,height:m}}}function hR(t){const{resolution:e,glyphs:n}=t,r=t.ascender??t.boundingBox?.yMax??e*.8,i=t.descender??t.boundingBox?.yMin??-e*.2;return{measure(o,s){const a=o.size,l=n[s],c=l?l.ha/e*a:a*.5,u=r/e*a,f=-i/e*a;return{advance:c,ascent:u,descent:f}}}}function _i(){const[t,e]=O.useReducer(n=>n+1,0);return tt(Ne.FONTS_LOADED,()=>{K.CanvasTextMetrics.clearMetrics(),dR(),e()},[]),t}const ob=t=>t.dropShadow?typeof t.dropShadow=="object"?{dropShadow:t.dropShadow}:{dropShadow:{color:t.dropShadowColor??"#000000",alpha:t.dropShadowAlpha??1,angle:t.dropShadowAngle??Math.PI/4,blur:t.dropShadowBlur??0,distance:t.dropShadowDistance??5}}:{},sb=t=>{if(t.stroke&&typeof t.stroke=="object")return{stroke:t.stroke};const e=t.strokeThickness??0;return t.stroke==null||e<=0?{}:{stroke:{color:t.stroke,width:e}}},ab=(t,e,n)=>{if(!t||t.length<2)return;const r=(n??0)===0,i=t.length;return new K.FillGradient({type:"linear",start:{x:0,y:0},end:{x:r?0:1,y:r?1:0},textureSpace:"local",colorStops:t.map((o,s)=>({offset:e?.[s]??s/Math.max(i-1,1),color:o}))})},pR=new Set(["normal","bold","bolder","lighter"]),ld=t=>{if(t==null||t==="")return;const e=String(t).trim().toLowerCase();if(pR.has(e))return e;const n=Number(e);if(Number.isFinite(n)&&n>=100&&n<=900&&n%100===0)return String(n)},cb=t=>{const e=typeof t=="string"?Number(t):t;return typeof e=="number"&&Number.isFinite(e)&&e!==0?e:void 0},mR=5e7,ud=(t,e)=>t==null||t===""?e:t;function dd(t){const{fontFamily:e="Arial",fontSize:n=16,fontWeight:r,fontStyle:i,fontVariant:o,fill:s="white",gradientColors:a,gradientStops:l,gradientType:c,stroke:u,strokeWidth:f,strokeThickness:d,dropShadow:h,dropShadowColor:m,dropShadowBlur:p=0,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:_,blurEnabled:v=!1,blurRadius:x=0,align:E,padding:T,letterSpacing:A,leading:M,wordWrapWidth:C,tagStyles:k}=t,w={fontFamily:e,fontSize:n,wordWrap:!0,breakWords:!0,wordWrapWidth:C&&C>0?C:mR,leading:M||0},L=ab(a,l,c);L?w.fill=L:s==="transparent"?w.fill={color:0,alpha:0}:w.fill=ud(s,"white");const D=ld(r);D&&(w.fontWeight=D),(i==="italic"||i==="oblique")&&(w.fontStyle=i),(o==="small-caps"||o===!0)&&(w.fontVariant="small-caps"),Object.assign(w,sb({stroke:u,strokeThickness:f??d??0})),v?w.dropShadow={color:ud(m,"black"),alpha:g??1,angle:0,blur:Number(x),distance:0}:Object.assign(w,ob({dropShadow:h,dropShadowColor:ud(m,"black"),dropShadowBlur:Number(p),dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:_}));const N=cb(A);return N!==void 0&&(w.letterSpacing=N),(E==="left"||E==="center"||E==="right"||E==="justify")&&(w.align=E),typeof T=="number"&&Number.isFinite(T)&&T>=0&&(w.padding=T),k&&(w.tagStyles=k),w}function gR(t,e,n,r,i,o){const s=r+2*o,a=i+2*o;return{width:s,height:a,x:t+o*(2*n.x-1),y:e+o*(2*n.y-1)}}const yR=t=>typeof t=="number"?{x:t,y:t}:{x:t?.x??.5,y:t?.y??.5},lb="pixitext-hitarea",_R=t=>`${lb}-${t}`,ub="pixitext-text",bR=({ref:t,...e})=>{const r=O.useRef(0),i=O.useRef(null),o=O.useRef(16),s=O.useRef(null),a=O.useRef(null),{app:l}=st.useApplication(),{visible:c,text:u,disabled:f,transformation:d,pointerdown:h,onDobuleClick:m,uniqueId:p,startAt:g,endAt:y,onTextRefReady:_}=e;I.useEffect(()=>{_&&_(p,i)},[_,p]);const{x:v,y:x,width:E,height:T,anchor:A=.5,backgroundColor:M="transparent",backgroundFit:C="box",backgroundPadding:k=0,backgroundRadius:w=0,colorCorrection:L,blendMode:D,neonColor:N}=d,F=_i(),H=lt({colorCorrection:L,effects:d.effects??{name:d.effect},neonColor:N,blendMode:D});I.useEffect(()=>{o.current=Number(d.fontSize??16)},[d.fontSize]);const V=I.useMemo(()=>{if(!M||M==="transparent")return null;try{return new K.Color(M).toNumber()}catch{return null}},[M]),$=JSON.stringify([d.tagStyles,d.gradientColors,d.gradientStops]),re=I.useMemo(()=>new K.TextStyle(dd({...d,blurRadius:d.blurRadius})),[F,$,d.fontFamily,d.fontSize,d.fontWeight,d.fontStyle,d.fontVariant,d.fill,d.stroke,d.strokeWidth,d.strokeThickness,d.dropShadow,d.dropShadowColor,d.dropShadowBlur,d.dropShadowAlpha,d.dropShadowAngle,d.dropShadowDistance,d.blurEnabled,d.blurRadius,d.align,d.padding,d.letterSpacing,d.leading,d.wordWrapWidth]);I.useEffect(()=>{s.current={...d}},[d]),I.useImperativeHandle(t,()=>({setWordWrap:(le,Q={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=le;const ce=1/Q.x,ye=1/Q.y;i.current.scale.set(ce,ye)}},setFontSizeAndTransform:(le,Q,ce={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=le,i.current.style.fontSize=Q;const ye=1/ce.x,U=1/ce.y;i.current.scale.set(ye,U)}},resetScale:()=>{i.current&&i.current.scale.set(1,1)}}),[p,g,y]);const he=I.useCallback((le,Q={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=le;const ce=1/Q.x,ye=1/Q.y;i.current.scale.set(ce,ye)}},[i.current]),q=I.useCallback((le,Q,ce={x:1,y:1})=>{if(i.current){i.current.style.wordWrapWidth=le,i.current.style.fontSize=Q;const ye=1/ce.x,U=1/ce.y;i.current.scale.set(ye,U)}},[i.current,s.current]),fe=yR(A),Y=I.useMemo(()=>{if(V===null)return null;if(C==="hug"){const le=K.CanvasTextMetrics.measureText(u??"",re);return gR(v,x,fe,le.width,le.height,k)}return{x:v,y:x,width:E||100,height:T||100}},[V,C,k,u,re,v,x,E,T,A]);I.useEffect(()=>{const le=a.current;if(!le||V===null||!Y||!l?.renderer)return;const Q=new K.Graphics,ce=Math.max(1,Math.round(Y.width)),ye=Math.max(1,Math.round(Y.height));w>0?Q.roundRect(0,0,ce,ye,w):Q.rect(0,0,ce,ye),Q.fill({color:V});let U=null;try{U=l.renderer.generateTexture(Q)}finally{Q.destroy()}return le.texture=U,()=>{a.current===le&&(le.texture=K.Texture.EMPTY);try{U?.destroy(!0)}catch{}}},[l,V,Y,w]);const te=()=>{const le=new Date().getTime();le-r.current<300&&m?m():h&&h(),r.current=le},z=()=>{!f&&m&&m()};return R.jsxs(Je,{...e,ref:t,isText:!0,onDoubleClick:z,handleDragWordWrap:he,handleDragFontSize:q,children:[R.jsx("pixiSprite",{texture:K.Texture.EMPTY,x:Y?.x??v,y:Y?.y??x,width:Y?.width??(E||100),height:Y?.height??(T||100),anchor:A,alpha:c&&V!==null?1:0,ref:a}),R.jsx("pixiText",{label:ub,style:re,x:v,y:x,anchor:A,text:u,alpha:c?1:0,...c&&!f&&{eventMode:"static",cursor:"pointer",onPointerDown:te},ref:i,filters:H})]})},db=I.memo(bR,rt);S.registerPlugin(Dn);const vR=t=>`aep-bez-${t[0]},${t[1]},${t[2]},${t[3]}`,fb=new Set;function Vn(t){if(!t)return"none";const e=vR(t);if(!fb.has(e)){const[n,r,i,o]=t;Dn.create(e,`${n},${r},${i},${o}`),fb.add(e)}return e}var Ce;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(const s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ce||(Ce={}));var hb;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(hb||(hb={}));const ue=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),On=t=>{switch(typeof t){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(t)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(t)?ue.array:t===null?ue.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ue.promise:typeof Map<"u"&&t instanceof Map?ue.map:typeof Set<"u"&&t instanceof Set?ue.set:typeof Date<"u"&&t instanceof Date?ue.date:ue.object;default:return ue.unknown}},j=Ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class cn extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof cn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}cn.create=t=>new cn(t);const fd=(t,e)=>{let n;switch(t.code){case j.invalid_type:t.received===ue.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case j.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ce.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ce.joinValues(t.keys,", ")}`;break;case j.invalid_union:n="Invalid input";break;case j.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ce.joinValues(t.options)}`;break;case j.invalid_enum_value:n=`Invalid enum value. Expected ${Ce.joinValues(t.options)}, received '${t.received}'`;break;case j.invalid_arguments:n="Invalid function arguments";break;case j.invalid_return_type:n="Invalid function return type";break;case j.invalid_date:n="Invalid date";break;case j.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ce.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case j.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case j.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case j.custom:n="Invalid input";break;case j.invalid_intersection_types:n="Intersection results could not be merged";break;case j.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case j.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ce.assertNever(t)}return{message:n}};let xR=fd;function TR(){return xR}const ER=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}};function ne(t,e){const n=TR(),r=ER({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===fd?void 0:fd].filter(i=>!!i)});t.common.issues.push(r)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return ft.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return xe;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}}const xe=Object.freeze({status:"aborted"}),bi=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),pb=t=>t.status==="aborted",mb=t=>t.status==="dirty",Or=t=>t.status==="valid",ko=t=>typeof Promise<"u"&&t instanceof Promise;var me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(me||(me={}));class Vt{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gb=(t,e)=>{if(Or(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new cn(t.common.issues);return this._error=n,this._error}}};function we(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}class Oe{get description(){return this._def.description}_getType(e){return On(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:On(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:On(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ko(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:On(e)},i=this._parseSync({data:e,path:r.path,parent:r});return gb(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:On(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return Or(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Or(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:On(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(ko(i)?i:Promise.resolve(i));return gb(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=e(i),a=()=>o.addIssue({code:j.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Zn({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return dn.create(this,this._def)}nullable(){return Jn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return Go.create(this,this._def)}or(e){return Do.create([this,e],this._def)}and(e){return No.create(this,e,this._def)}transform(e){return new Zn({...we(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new jo({...we(this._def),innerType:this,defaultValue:n,typeName:Te.ZodDefault})}brand(){return new wb({typeName:Te.ZodBranded,type:this,...we(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ho({...we(this._def),innerType:this,catchValue:n,typeName:Te.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return xd.create(this,e)}readonly(){return Yo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SR=/^c[^\s-]{8,}$/i,wR=/^[0-9a-z]+$/,AR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,OR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,MR=/^[a-z0-9_-]{21}$/i,IR=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,CR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let hd;const kR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,PR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,DR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,NR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,FR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BR=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yb="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",UR=new RegExp(`^${yb}$`);function _b(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function GR(t){return new RegExp(`^${_b(t)}$`)}function jR(t){let e=`${yb}T${_b(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function HR(t,e){return!!((e==="v4"||!e)&&kR.test(t)||(e==="v6"||!e)&&DR.test(t))}function YR(t,e){if(!IR.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function WR(t,e){return!!((e==="v4"||!e)&&PR.test(t)||(e==="v6"||!e)&&NR.test(t))}class ln extends Oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ue.string){const o=this._getOrReturnCtx(e);return ne(o,{code:j.invalid_type,expected:ue.string,received:o.parsedType}),xe}const r=new ft;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),ne(i,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),ne(i,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?ne(i,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&ne(i,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")RR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"email",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")hd||(hd=new RegExp(LR,"u")),hd.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"emoji",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")OR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"uuid",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")MR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"nanoid",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")SR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"cuid",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")wR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"cuid2",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")AR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"ulid",code:j.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ne(i,{validation:"url",code:j.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"regex",code:j.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),ne(i,{code:j.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),ne(i,{code:j.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),ne(i,{code:j.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?jR(o).test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:j.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?UR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:j.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?GR(o).test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:j.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?CR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"duration",code:j.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?HR(e.data,o.version)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"ip",code:j.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?YR(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"jwt",code:j.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?WR(e.data,o.version)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"cidr",code:j.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?FR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"base64",code:j.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?BR.test(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{validation:"base64url",code:j.invalid_string,message:o.message}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:j.invalid_string,...me.errToObj(r)})}_addCheck(e){return new ln({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...me.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...me.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...me.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...me.errToObj(n)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ln.create=t=>new ln({checks:[],typeName:Te.ZodString,coerce:t?.coerce??!1,...we(t)});function XR(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}class Mr extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ue.number){const o=this._getOrReturnCtx(e);return ne(o,{code:j.invalid_type,expected:ue.number,received:o.parsedType}),xe}let r;const i=new ft;for(const o of this._def.checks)o.kind==="int"?Ce.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ne(r,{code:j.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:j.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:j.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?XR(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ne(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ne(r,{code:j.not_finite,message:o.message}),i.dirty()):Ce.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,r,i){return new Mr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(e){return new Mr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ce.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Mr.create=t=>new Mr({checks:[],typeName:Te.ZodNumber,coerce:t?.coerce||!1,...we(t)});class vi extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ue.bigint)return this._getInvalidInput(e);let r;const i=new ft;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:j.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:j.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ne(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ce.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ne(n,{code:j.invalid_type,expected:ue.bigint,received:n.parsedType}),xe}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,r,i){return new vi({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(e){return new vi({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}vi.create=t=>new vi({checks:[],typeName:Te.ZodBigInt,coerce:t?.coerce??!1,...we(t)});class pd extends Oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ue.boolean){const r=this._getOrReturnCtx(e);return ne(r,{code:j.invalid_type,expected:ue.boolean,received:r.parsedType}),xe}return xt(e.data)}}pd.create=t=>new pd({typeName:Te.ZodBoolean,coerce:t?.coerce||!1,...we(t)});class Po extends Oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ue.date){const o=this._getOrReturnCtx(e);return ne(o,{code:j.invalid_type,expected:ue.date,received:o.parsedType}),xe}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return ne(o,{code:j.invalid_date}),xe}const r=new ft;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),ne(i,{code:j.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),ne(i,{code:j.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ce.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Po({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Po.create=t=>new Po({checks:[],coerce:t?.coerce||!1,typeName:Te.ZodDate,...we(t)});class bb extends Oe{_parse(e){if(this._getType(e)!==ue.symbol){const r=this._getOrReturnCtx(e);return ne(r,{code:j.invalid_type,expected:ue.symbol,received:r.parsedType}),xe}return xt(e.data)}}bb.create=t=>new bb({typeName:Te.ZodSymbol,...we(t)});class md extends Oe{_parse(e){if(this._getType(e)!==ue.undefined){const r=this._getOrReturnCtx(e);return ne(r,{code:j.invalid_type,expected:ue.undefined,received:r.parsedType}),xe}return xt(e.data)}}md.create=t=>new md({typeName:Te.ZodUndefined,...we(t)});class gd extends Oe{_parse(e){if(this._getType(e)!==ue.null){const r=this._getOrReturnCtx(e);return ne(r,{code:j.invalid_type,expected:ue.null,received:r.parsedType}),xe}return xt(e.data)}}gd.create=t=>new gd({typeName:Te.ZodNull,...we(t)});class vb extends Oe{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}vb.create=t=>new vb({typeName:Te.ZodAny,...we(t)});class yd extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}}yd.create=t=>new yd({typeName:Te.ZodUnknown,...we(t)});class Mn extends Oe{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:j.invalid_type,expected:ue.never,received:n.parsedType}),xe}}Mn.create=t=>new Mn({typeName:Te.ZodNever,...we(t)});class xb extends Oe{_parse(e){if(this._getType(e)!==ue.undefined){const r=this._getOrReturnCtx(e);return ne(r,{code:j.invalid_type,expected:ue.void,received:r.parsedType}),xe}return xt(e.data)}}xb.create=t=>new xb({typeName:Te.ZodVoid,...we(t)});class Kt extends Oe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ue.array)return ne(n,{code:j.invalid_type,expected:ue.array,received:n.parsedType}),xe;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(ne(n,{code:s?j.too_big:j.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ne(n,{code:j.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ne(n,{code:j.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Vt(n,s,n.path,a)))).then(s=>ft.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Vt(n,s,n.path,a)));return ft.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Kt({...this._def,minLength:{value:e,message:me.toString(n)}})}max(e,n){return new Kt({...this._def,maxLength:{value:e,message:me.toString(n)}})}length(e,n){return new Kt({...this._def,exactLength:{value:e,message:me.toString(n)}})}nonempty(e){return this.min(1,e)}}Kt.create=(t,e)=>new Kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...we(e)});function Ir(t){if(t instanceof it){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=dn.create(Ir(r))}return new it({...t._def,shape:()=>e})}else return t instanceof Kt?new Kt({...t._def,type:Ir(t.element)}):t instanceof dn?dn.create(Ir(t.unwrap())):t instanceof Jn?Jn.create(Ir(t.unwrap())):t instanceof Kn?Kn.create(t.items.map(e=>Ir(e))):t}class it extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ce.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ue.object){const c=this._getOrReturnCtx(e);return ne(c,{code:j.invalid_type,expected:ue.object,received:c.parsedType}),xe}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Mn&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Vt(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Mn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(ne(i,{code:j.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Vt(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,d=await u.value;c.push({key:f,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>ft.mergeObjectSync(r,c)):ft.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new it({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:me.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new it({...this._def,unknownKeys:"strip"})}passthrough(){return new it({...this._def,unknownKeys:"passthrough"})}extend(e){return new it({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new it({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Te.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new it({...this._def,catchall:e})}pick(e){const n={};for(const r of Ce.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new it({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ce.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new it({...this._def,shape:()=>n})}deepPartial(){return Ir(this)}partial(e){const n={};for(const r of Ce.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new it({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ce.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof dn;)o=o._def.innerType;n[r]=o}return new it({...this._def,shape:()=>n})}keyof(){return Eb(Ce.objectKeys(this.shape))}}it.create=(t,e)=>new it({shape:()=>t,unknownKeys:"strip",catchall:Mn.create(),typeName:Te.ZodObject,...we(e)}),it.strictCreate=(t,e)=>new it({shape:()=>t,unknownKeys:"strict",catchall:Mn.create(),typeName:Te.ZodObject,...we(e)}),it.lazycreate=(t,e)=>new it({shape:t,unknownKeys:"strip",catchall:Mn.create(),typeName:Te.ZodObject,...we(e)});class Do extends Oe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new cn(a.ctx.common.issues));return ne(n,{code:j.invalid_union,unionErrors:s}),xe}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new cn(l));return ne(n,{code:j.invalid_union,unionErrors:a}),xe}}get options(){return this._def.options}}Do.create=(t,e)=>new Do({options:t,typeName:Te.ZodUnion,...we(e)});const un=t=>t instanceof Bo?un(t.schema):t instanceof Zn?un(t.innerType()):t instanceof Uo?[t.value]:t instanceof $n?t.options:t instanceof vd?Ce.objectValues(t.enum):t instanceof jo?un(t._def.innerType):t instanceof md?[void 0]:t instanceof gd?[null]:t instanceof dn?[void 0,...un(t.unwrap())]:t instanceof Jn?[null,...un(t.unwrap())]:t instanceof wb||t instanceof Yo?un(t.unwrap()):t instanceof Ho?un(t._def.innerType):[];class _d extends Oe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ue.object)return ne(n,{code:j.invalid_type,expected:ue.object,received:n.parsedType}),xe;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const s=un(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new _d({typeName:Te.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...we(r)})}}function bd(t,e){const n=On(t),r=On(e);if(t===e)return{valid:!0,data:t};if(n===ue.object&&r===ue.object){const i=Ce.objectKeys(e),o=Ce.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of o){const l=bd(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===ue.array&&r===ue.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const s=t[o],a=e[o],l=bd(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ue.date&&r===ue.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class No extends Oe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(pb(o)||pb(s))return xe;const a=bd(o.value,s.value);return a.valid?((mb(o)||mb(s))&&n.dirty(),{status:n.value,value:a.data}):(ne(r,{code:j.invalid_intersection_types}),xe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}No.create=(t,e,n)=>new No({left:t,right:e,typeName:Te.ZodIntersection,...we(n)});class Kn extends Oe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.array)return ne(r,{code:j.invalid_type,expected:ue.array,received:r.parsedType}),xe;if(r.data.length<this._def.items.length)return ne(r,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&r.data.length>this._def.items.length&&(ne(r,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Vt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ft.mergeArray(n,s)):ft.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Kn({...this._def,rest:e})}}Kn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kn({items:t,typeName:Te.ZodTuple,rest:null,...we(e)})};class Fo extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.object)return ne(r,{code:j.invalid_type,expected:ue.object,received:r.parsedType}),xe;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Vt(r,a,r.path,a)),value:s._parse(new Vt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ft.mergeObjectAsync(n,i):ft.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Oe?new Fo({keyType:e,valueType:n,typeName:Te.ZodRecord,...we(r)}):new Fo({keyType:ln.create(),valueType:e,typeName:Te.ZodRecord,...we(n)})}}class Tb extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.map)return ne(r,{code:j.invalid_type,expected:ue.map,received:r.parsedType}),xe;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Vt(r,a,r.path,[c,"key"])),value:o._parse(new Vt(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return xe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return xe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}Tb.create=(t,e,n)=>new Tb({valueType:e,keyType:t,typeName:Te.ZodMap,...we(n)});class xi extends Oe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ue.set)return ne(r,{code:j.invalid_type,expected:ue.set,received:r.parsedType}),xe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ne(r,{code:j.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ne(r,{code:j.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return xe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new Vt(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new xi({...this._def,minSize:{value:e,message:me.toString(n)}})}max(e,n){return new xi({...this._def,maxSize:{value:e,message:me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}xi.create=(t,e)=>new xi({valueType:t,minSize:null,maxSize:null,typeName:Te.ZodSet,...we(e)});class Bo extends Oe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Bo.create=(t,e)=>new Bo({getter:t,typeName:Te.ZodLazy,...we(e)});class Uo extends Oe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:j.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Uo.create=(t,e)=>new Uo({value:t,typeName:Te.ZodLiteral,...we(e)});function Eb(t,e){return new $n({values:t,typeName:Te.ZodEnum,...we(e)})}class $n extends Oe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ne(n,{expected:Ce.joinValues(r),received:n.parsedType,code:j.invalid_type}),xe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ne(n,{received:n.data,code:j.invalid_enum_value,options:r}),xe}return xt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return $n.create(e,{...this._def,...n})}exclude(e,n=this._def){return $n.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}$n.create=Eb;class vd extends Oe{_parse(e){const n=Ce.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ue.string&&r.parsedType!==ue.number){const i=Ce.objectValues(n);return ne(r,{expected:Ce.joinValues(i),received:r.parsedType,code:j.invalid_type}),xe}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Ce.objectValues(n);return ne(r,{received:r.data,code:j.invalid_enum_value,options:i}),xe}return xt(e.data)}get enum(){return this._def.values}}vd.create=(t,e)=>new vd({values:t,typeName:Te.ZodNativeEnum,...we(e)});class Go extends Oe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ue.promise&&n.common.async===!1)return ne(n,{code:j.invalid_type,expected:ue.promise,received:n.parsedType}),xe;const r=n.parsedType===ue.promise?n.data:Promise.resolve(n.data);return xt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Go.create=(t,e)=>new Go({type:t,typeName:Te.ZodPromise,...we(e)});class Zn extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{ne(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return xe;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?xe:l.status==="dirty"||n.value==="dirty"?bi(l.value):l});{if(n.value==="aborted")return xe;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?xe:a.status==="dirty"||n.value==="dirty"?bi(a.value):a}}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?xe:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?xe:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Or(s))return xe;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Or(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):xe);Ce.assertNever(i)}}Zn.create=(t,e,n)=>new Zn({schema:t,typeName:Te.ZodEffects,effect:e,...we(n)}),Zn.createWithPreprocess=(t,e,n)=>new Zn({schema:e,effect:{type:"preprocess",transform:t},typeName:Te.ZodEffects,...we(n)});class dn extends Oe{_parse(e){return this._getType(e)===ue.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dn.create=(t,e)=>new dn({innerType:t,typeName:Te.ZodOptional,...we(e)});class Jn extends Oe{_parse(e){return this._getType(e)===ue.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Jn.create=(t,e)=>new Jn({innerType:t,typeName:Te.ZodNullable,...we(e)});class jo extends Oe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ue.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}jo.create=(t,e)=>new jo({innerType:t,typeName:Te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});class Ho extends Oe{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ko(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new cn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new cn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ho.create=(t,e)=>new Ho({innerType:t,typeName:Te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});class Sb extends Oe{_parse(e){if(this._getType(e)!==ue.nan){const r=this._getOrReturnCtx(e);return ne(r,{code:j.invalid_type,expected:ue.nan,received:r.parsedType}),xe}return{status:"valid",value:e.data}}}Sb.create=t=>new Sb({typeName:Te.ZodNaN,...we(t)});class wb extends Oe{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class xd extends Oe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?xe:o.status==="dirty"?(n.dirty(),bi(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new xd({in:e,out:n,typeName:Te.ZodPipeline})}}class Yo extends Oe{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Or(i)&&(i.value=Object.freeze(i.value)),i);return ko(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Yo.create=(t,e)=>new Yo({innerType:t,typeName:Te.ZodReadonly,...we(e)});var Te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Te||(Te={}));const ae=ln.create,P=Mr.create,Fe=pd.create,zR=yd.create;Mn.create;const $e=Kt.create,J=it.create,ht=Do.create,Td=_d.create;No.create;const Ge=Kn.create,fn=Fo.create,Ab=Bo.create,Ze=Uo.create,Ye=$n.create;Go.create,dn.create,Jn.create;const Ob=Ye(["image","video","audio","lottie","gif","svg","font","composition","model"]),Mb=J({type:Ob,src:ae(),width:P().optional(),height:P().optional(),duration:P().optional()}).strict(),Ib=fn(ae(),Mb),Ed=Ge([P(),P(),P(),P()]).describe("cubic-bezier(x1,y1,x2,y2)"),Sd=t=>J({t:P().finite(),v:t,easeIn:Ed.optional(),easeOut:Ed.optional(),hold:Fe().optional()}).strict(),X=t=>ht([t,$e(Sd(t)).min(1)]),wd=Ge([P(),P()]),Wo=J({position:X(wd),anchor:X(wd),scale:X(wd),rotation:X(P()),opacity:X(P().min(0).max(1)),skew:X(P()).optional(),skewAxis:X(P()).optional()}).strict(),Cb=Ye(["drop-shadow","gaussian-blur","directional-blur","glow","levels","curves","hue-saturation","tint","fill","tritone","fast-box-blur","color-balance","brightness-contrast"]),Rb=J({name:Cb,enabled:Fe().optional(),params:fn(ae(),ht([ae(),Fe(),X(P()),X(ae()),X(Ge([P(),P()])),X(Ge([P(),P(),P(),P()]))]))}).strict(),Lb=Ye(["cameraLensBlur","bloom","chromaticAberration","vignette","noise"]),Ad=J({name:Lb,enabled:Fe().optional(),params:fn(ae(),ht([ae(),Fe(),X(P()),X(ae()),X(Ge([P(),P()]))]))}).strict(),Od=Ge([P(),P()]),Ti=J({vertices:$e(Od),inTangents:$e(Od),outTangents:$e(Od),closed:Fe()}).strict(),kb=Ye(["add","subtract","intersect","lighten","darken","difference","alpha"]),Pb=J({id:ae().min(1),mode:kb,inverted:Fe().optional(),opacity:X(P().min(0).max(1)).optional(),expansion:X(P()).optional(),path:ht([Ti,$e(Sd(Ti)).min(1)])}).strict(),Md=Ge([P(),P(),P()]),qR=Ge([P(),P()]),Xo=J({position:X(Md),anchor:X(Md),scale:X(qR),rotation:X(Md),opacity:X(P().min(0).max(1))}).strict(),Db=J({kind:Ze("camera"),id:ae().min(1),name:ae().optional(),inPoint:P().finite(),outPoint:P().finite(),startTime:P().finite().optional(),parent:ae().optional(),hidden:Fe().optional(),transform:Wo,transform3D:Xo,fov:X(P().positive()),focusDistance:X(P().positive()).optional(),aperture:X(P().min(0)).optional(),blurLevel:X(P().min(0)).optional(),zoom:X(P().positive()).optional(),disableCameraDoF:Fe().optional()}).strict(),VR=ae().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),Nb=J({kind:Ze("light"),id:ae().min(1),name:ae().optional(),inPoint:P().finite(),outPoint:P().finite(),startTime:P().finite().optional(),parent:ae().optional(),hidden:Fe().optional(),transform:Wo,transform3D:Xo,lightType:Ye(["ambient","point","spot","parallel"]),intensity:X(P().min(0)),color:X(VR),falloff:X(P().min(0)).optional(),coneAngle:X(P().min(0).max(180)).optional(),coneFeather:X(P().min(0).max(100)).optional(),castsShadows:Fe().optional()}).strict(),Fb=Ye(["square","ramp-up","ramp-down","triangle","round","smooth"]),Bb=Ye(["chars","words","lines"]),Ub=J({start:X(P()),end:X(P()),offset:X(P()).optional(),basedOn:Bb.optional(),shape:Fb.optional(),smoothness:X(P()).optional(),easeHigh:X(P()).optional(),easeLow:X(P()).optional()}).strict(),Gb=J({range:Ub,amount:X(P()).optional(),positionOffset:X(Ge([P(),P()])).optional(),scaleOffset:X(Ge([P(),P()])).optional(),rotationOffset:X(P()).optional(),opacityOffset:X(P()).optional(),fillOffset:ae().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional()}).strict(),KR=ae().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),jb=J({from:P().int().min(0),to:P().int().min(1),font:ae().optional(),size:X(P().min(0)).optional(),fill:X(KR).optional(),weight:ht([P(),ae()]).optional(),italic:Fe().optional(),tracking:X(P()).optional(),baselineShift:X(P()).optional()}).strict().refine(t=>t.to>t.from,{message:"to must exceed from",path:["to"]}),Hb=["left","center","right","justify-full","justify-last-left","justify-last-center","justify-last-right"],Yb=Ye(Hb);function Id(t){if(t==null||typeof t!="object")return t;const e=t,n=e.layers;if(!Array.isArray(n))return t;const r={...e,layers:[...n]};for(let i=0;i<n.length;i++){const o=n[i];if(!o||typeof o!="object"||o.kind!=="text")continue;const s=o.style;if(s&&s.align==="justify"){const a={...s,align:"justify-last-left"};r.layers[i]={...o,style:a}}}return r}class Wb extends Error{constructor(e){super(`text runs overlap: ${e.map(([n,r,i,o])=>`[${n},${r}) ∩ [${i},${o})`).join(", ")}`),this.ranges=e,this.name="TextRunsOverlapError"}ranges}function Xb(t,e){const n=[];if(e<=0)return{runs:[],warnings:n};const r=[...t].sort((l,c)=>l.from-c.from),i=[];for(let l=1;l<r.length;l++){const c=r[l-1],u=r[l];u.from<c.to&&i.push([c.from,c.to,u.from,u.to])}if(i.length>0)throw new Wb(i);const o=[];for(const l of r)l.from>=e||l.to<=0||(l.to>e?(n.push(`run [${l.from},${l.to}) clipped to source length ${e}`),o.push({...l,to:e})):o.push(l));const s=[];let a=0;for(const l of o)l.from>a&&s.push({from:a,to:l.from}),s.push(l),a=l.to;return a<e&&s.push({from:a,to:e}),{runs:s,warnings:n}}const Cd=ae().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),zb=J({themeKey:ae().min(1),default:Cd}).strict(),qb=ht([Cd,zb]),Rd=X(qb),Vb=fn(ae(),Cd);function Ld(t,e){return typeof t=="string"?t:e?.[t.themeKey]??t.default}function Qn(t,e){if(t!==void 0)return typeof t=="string"?t:Array.isArray(t)?t.map(n=>({t:n.t,v:Ld(n.v,e),easeIn:n.easeIn,easeOut:n.easeOut,hold:n.hold})):Ld(t,e)}const $R=ht([P(),Fe(),$e(P())]),Kb=J({id:ae().min(1),kind:Ye(["element","scene"]),name:ae().min(1),from:ht([ae().min(1),$e(ae().min(1)).min(1)]),to:ht([ae().min(1),$e(ae().min(1)).min(1)]),startFrame:P().finite().min(0),durationFrames:P().finite().positive(),ease:ht([Ge([P(),P(),P(),P()]),ae()]).optional(),params:fn(ae(),$R).optional(),region:J({x:P().finite(),y:P().finite(),width:P().positive(),height:P().positive()}).strict().optional(),includeShared:Fe().optional()}).strict().superRefine((t,e)=>{t.kind==="element"&&(Array.isArray(t.from)||Array.isArray(t.to))&&e.addIssue({code:j.custom,message:"element transitions require one from and one to layer id",path:[Array.isArray(t.from)?"from":"to"]})}),Ei=t=>Array.isArray(t)?t:[t],Dt={actors:3,props:6,products:1,spots:2,clipsPerActor:24},kd=6,ZR=["actor3d","prop3d"];function Tt(t){return t.kind==="actor3d"||t.kind==="prop3d"}function $b(t,e){const n=[];for(const r of t)Tt(r)&&r.stage===e&&n.push(r);return n}function Zb(t,e){const[n,r,i]=t.camera.position,[o,s,a]=t.camera.target;Math.hypot(n-o,r-s,i-a)<=.001&&e.addIssue({code:j.custom,message:"stage3d camera position and target must differ",path:["camera","target"]})}function Jb(t,e){const n=t.clips??[];for(let r=1;r<n.length;r++){const i=n[r-1],o=n[r],s=["clips",r,"startFrame"];if(o.startFrame<=i.startFrame){e.addIssue({code:j.custom,message:`actor '${t.id}' clips must be sorted by startFrame`,path:s});continue}const a=o.fadeFrames??kd;o.startFrame-i.startFrame<a&&e.addIssue({code:j.custom,message:`actor '${t.id}' clips at frames ${i.startFrame} and ${o.startFrame} are closer than the ${a}-frame fade`,path:s})}}const Nt=ae().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,"expected #RRGGBB or #RRGGBBAA"),JR=Ye(["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","add"]),QR=J({kind:Ze("rect"),size:X(Ge([P(),P()])),position:X(Ge([P(),P()])).optional(),roundness:X(P()).optional()}).strict(),eL=J({kind:Ze("ellipse"),size:X(Ge([P(),P()])),position:X(Ge([P(),P()])).optional()}).strict(),tL=J({kind:Ze("polystar"),starType:Ye(["star","polygon"]),points:X(P()),innerRadius:X(P()).optional(),outerRadius:X(P()),innerRoundness:X(P()).optional(),outerRoundness:X(P()).optional(),rotation:X(P()).optional(),position:X(Ge([P(),P()])).optional()}).strict(),nL=J({kind:Ze("bezier"),path:ht([Ti,$e(J({t:P(),v:Ti,easeIn:Ge([P(),P(),P(),P()]).optional(),easeOut:Ge([P(),P(),P(),P()]).optional(),hold:Fe().optional()}).strict()).min(1)])}).strict(),Qb=Td("kind",[QR,eL,tL,nL]),ev=J({color:X(Nt),width:X(P().min(0)),dashes:$e(P()).optional(),lineCap:Ye(["butt","round","square"]).optional(),lineJoin:Ye(["miter","round","bevel"]).optional()}).strict(),rL=J({start:X(P().min(0).max(1)),end:X(P().min(0).max(1)),offset:X(P()).optional()}).strict(),tv=J({font:ae(),size:X(P().min(0)),fill:Rd.optional(),stroke:ev.optional(),weight:ht([P(),ae()]).optional(),italic:Fe().optional(),letterSpacing:X(P()).optional(),lineHeight:X(P()).optional(),tracking:X(P()).optional(),leading:X(P()).optional(),boxWidth:P().positive().optional(),align:Yb.optional(),runs:$e(jb).optional(),tagStyles:fn(ae(),J({fill:Nt.optional(),weight:ht([P(),ae()]).optional(),italic:Fe().optional()}).strict()).optional()}).strict(),iL=J({sourceId:ae().min(1),mode:Ye(["alpha","alpha-inverted","luma","luma-inverted"])}).strict(),Et={id:ae().min(1),name:ae().optional(),inPoint:P().finite(),outPoint:P().finite(),startTime:P().finite().optional(),parent:ae().optional(),blendMode:JR.optional(),hidden:Fe().optional(),transform:Wo,masks:$e(Pb).optional(),effects:$e(Rb).optional(),trackMatte:iL.optional(),is3D:Fe().optional(),transform3D:Xo.optional()},St=ae().min(1),oL=J({...Et,kind:Ze("image"),assetId:St}).strict(),sL=J({...Et,kind:Ze("video"),assetId:St,timeRemap:X(P()).optional(),muted:Fe().optional()}).strict(),aL=J({...Et,kind:Ze("audio"),assetId:St,level:X(P().min(0)).optional(),pan:X(P().min(-1).max(1)).optional()}).strict(),cL=J({...Et,kind:Ze("gif"),assetId:St}).strict(),lL=J({...Et,kind:Ze("lottie"),assetId:St,speed:P().optional()}).strict(),uL=J({...Et,kind:Ze("svg"),assetId:St}).strict(),dL=J({...Et,kind:Ze("text"),source:X(ae()),style:tv,animators:$e(Gb).optional(),splitMode:Ye(["single","chars","words","lines"]).optional(),extrusion:Ab(()=>nv).optional()}).strict(),nv=J({depth:X(P().min(0)),bevelEnabled:Fe().optional(),bevelThickness:X(P().min(0)).optional(),bevelSize:X(P().min(0)).optional(),bevelSegments:P().int().min(0).optional(),curveSegments:P().int().min(1).optional(),sideMaterial:J({color:Nt.optional(),metalness:P().min(0).max(1).optional(),roughness:P().min(0).max(1).optional()}).strict().optional()}).strict(),fL=J({...Et,kind:Ze("shape"),path:Qb,fill:Rd.optional(),stroke:ev.optional(),trimPath:rL.optional(),extrusion:nv.optional()}).strict(),hL=J({...Et,kind:Ze("null")}).strict(),pL=J({...Et,kind:Ze("precomp"),compId:ae().min(1),width:P().positive(),height:P().positive()}).strict(),mL=J({width:P().positive(),height:P().positive(),depth:P().positive().optional()}).strict(),gL=J({type:Ze("primitive"),shape:Ye(["can","bottle","box","jar","tube","pouch"]),proportions:mL.optional()}).strict(),yL=J({type:Ze("extrude"),contour:$e(Ge([P(),P()])).min(3).max(2e3),depth:X(P().min(0)),bevel:P().min(0).optional()}).strict(),_L=J({clip:ht([ae().min(1),P().int().min(0)]).optional(),loop:Fe().optional(),speed:P().positive().optional(),offset:P().min(0).optional()}).strict(),bL=J({type:Ze("gltf"),assetId:St,animation:_L.optional()}).strict(),Pd=Td("type",[gL,yL,bL]),Dd=J({label:St.optional(),front:St.optional(),side:Nt.optional()}).strict(),vL=J({roughness:X(P().min(0).max(1)).optional(),metalness:X(P().min(0).max(1)).optional(),clearcoat:P().min(0).max(1).optional(),style:Ye(["standard","toon"]).optional(),toonSteps:P().int().min(2).max(8).optional(),outline:J({color:Nt.optional(),width:P().positive()}).strict().optional()}).strict(),xL=J({rotation:X(Ge([P(),P(),P()])).optional(),position:X(Ge([P(),P(),P()])).optional(),scale:X(P().positive()).optional()}).strict(),Nd=J({azimuth:X(P()).optional(),elevation:X(P()).optional(),intensity:X(P().min(0)).optional(),color:Nt.optional()}).strict(),TL=J({preset:Ye(["studio","window","golden","night"]).optional(),key:Nd.optional(),fill:J({intensity:X(P().min(0)).optional()}).strict().optional(),rim:J({intensity:X(P().min(0)).optional()}).strict().optional(),environment:Ye(["room","none"]).optional()}).strict(),EL=J({opacity:X(P().min(0).max(1)),softness:P().min(0).max(1).optional(),offsetY:P().optional()}).strict(),Fd=J({width:P().int().min(16).max(4096),height:P().int().min(16).max(4096)}).strict(),SL=J({center:Ge([P(),P(),P()]).optional(),size:Ge([P().positive(),P().positive(),P().positive()])}).strict(),wL=J({...Et,kind:Ze("model3d"),viewport:Fd,source:Pd,textures:Dd.optional(),material:vL.optional(),view:xL.optional(),lighting:TL.optional(),shadow:EL.optional(),bounds:SL.optional(),camera:J({fov:P().min(10).max(90).optional(),fit:P().min(.5).max(3).optional()}).strict().optional()}).strict(),rv="stage3d camera is locked: position/target must be a static [x, y, z] (no keyframes)",Bd=P({errorMap:()=>({message:rv})}),iv=Ge([Bd,Bd,Bd],{errorMap:()=>({message:rv})}),Cr=Ge([P(),P(),P()]),AL=J({position:iv,target:iv,fov:P().min(10).max(90).optional(),focus:J({distance:X(P().positive()),aperture:P().min(0).max(1)}).strict().optional()}).strict(),OL=J({backdrop:St.optional(),ground:Nt.optional(),groundSize:Ge([P().positive(),P().positive()]).optional(),wall:J({distance:P().positive().optional(),height:P().positive().optional(),curve:P().min(0).optional()}).strict().optional(),fog:J({color:Nt,near:P().min(0),far:P().positive()}).strict().optional()}).strict(),ML=J({id:ae().min(1),position:X(Cr),target:X(Cr),intensity:X(P().min(0)),angle:X(P().min(1).max(89)).optional(),penumbra:P().min(0).max(1).optional(),color:Nt.optional(),castShadow:Fe().optional()}).strict(),IL=J({preset:Ye(["studio","window","golden","night"]).optional(),key:Nd.optional(),fill:J({intensity:X(P().min(0)).optional()}).strict().optional(),rim:J({intensity:X(P().min(0)).optional()}).strict().optional(),ambient:X(P().min(0)).optional(),environment:Ye(["room","none"]).optional(),spots:$e(ML).max(Dt.spots,`stage3d allows at most ${Dt.spots} spot lights`).optional()}).strict(),CL=J({opacity:X(P().min(0).max(1)).optional(),softness:P().min(0).max(1).optional()}).strict(),ov=J({clipAssetId:St.optional(),name:ae().min(1).optional(),startFrame:P().int().min(0),speed:P().positive().optional(),loop:Fe().optional(),offset:P().min(0).optional(),fadeFrames:P().int().min(0).max(60).optional()}).strict().refine(t=>t.clipAssetId!==void 0||t.name!==void 0,{message:"stage clip needs clipAssetId or name"}),RL=J({shading:Ye(["toon","pbr"]).optional(),toonSteps:P().int().min(2).max(8).optional(),outline:J({color:Nt.optional(),width:P().positive()}).strict().optional(),exposure:P().positive().optional()}).strict(),LL=J({...Et,kind:Ze("stage3d"),viewport:Fd,camera:AL,set:OL.optional(),lights:IL.optional(),shadow:CL.optional(),style:RL.optional()}).strict(),sv={id:ae().min(1),name:ae().optional(),inPoint:P().finite(),outPoint:P().finite(),startTime:P().finite().optional(),hidden:Fe().optional(),stage:ae().min(1)},kL=J({...sv,kind:Ze("actor3d"),assetId:St,height:P().positive().optional(),marks:X(Cr),clips:$e(ov).max(Dt.clipsPerActor,`actor3d allows at most ${Dt.clipsPerActor} clips`).optional(),rootMotion:Ye(["strip","keep"]).optional(),castShadow:Fe().optional()}).strict(),PL=J({actor:ae().min(1),bone:ae().min(1)}).strict(),DL=J({...sv,kind:Ze("prop3d"),role:Ye(["prop","product"]).optional(),source:Pd,textures:Dd.optional(),size:P().positive().optional(),position:X(Cr).optional(),rotation:X(Cr).optional(),scale:X(Cr).optional(),attach:PL.optional(),castShadow:Fe().optional()}).strict(),av=Td("kind",[oL,sL,aL,cL,lL,uL,dL,fL,hL,pL,wL,LL,kL,DL,Db,Nb]).superRefine((t,e)=>{t.kind==="camera"||t.kind==="light"||(t.kind==="stage3d"&&Zb(t,e),t.kind==="actor3d"&&Jb(t,e),!(t.kind==="actor3d"||t.kind==="prop3d")&&t.is3D===!0&&!t.transform3D&&e.addIssue({code:j.custom,message:"is3D: true requires a `transform3D` field",path:["transform3D"]}))}),NL="1.11.0",Ud=1,cv="1.4.0",Gd="1.10.0",jd="1.11.0";function Hd(t,e){const n=t.split(".").map(i=>Number.parseInt(i,10)),r=e.split(".").map(i=>Number.parseInt(i,10));for(let i=0;i<3;i++){const o=n[i]??0,s=r[i]??0;if(o>s)return!0;if(o<s)return!1}return!0}const FL=ae().regex(/^\d+\.\d+\.\d+$/,"expected semver string like '1.0.0'").refine(t=>Number.parseInt(t.split(".")[0]??"",10)===Ud,`unsupported schema major; this build expects major ${Ud}`),BL=J({family:ae(),src:ae().optional(),weight:ht([P(),ae()]).optional(),style:Ye(["normal","italic","oblique"]).optional()}).strict(),UL=J({src:ae().optional(),msdf:J({json:ae(),png:ae()}).strict().optional()}).strict().refine(t=>t.src!=null||t.msdf!=null,{message:"fonts3D entry must declare at least one of `src` or `msdf`"}),zo=J({version:FL,id:ae().min(1),name:ae().optional(),width:P().positive(),height:P().positive(),fps:P().positive(),durationInFrames:P().positive(),bgColor:ae().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).optional(),layers:$e(av),assets:Ib,fonts:$e(BL).optional(),fonts3D:fn(ae(),UL).optional(),precomps:fn(ae(),Ab(()=>zo)).optional(),postFx:$e(Ad).optional(),theme:Vb.optional(),transitions:$e(Kb).optional(),meta:fn(ae(),zR()).optional()}).strict().superRefine((t,e)=>{const n=new Set;for(const _ of t.layers)n.has(_.id)&&e.addIssue({code:j.custom,message:`duplicate layer id: ${_.id}`,path:["layers"]}),n.add(_.id);const r=new Set(t.layers.map(_=>_.id));for(let _=0;_<t.layers.length;_++){const v=t.layers[_],x=Tt(v)?void 0:v.parent;x&&!r.has(x)&&e.addIssue({code:j.custom,message:`parent '${x}' is not a layer in this composition`,path:["layers",_,"parent"]})}const i=new Map(t.layers.map(_=>[_.id,_]));for(let _=0;_<t.layers.length;_++){const v=t.layers[_],x=new Set;let E=v;for(;E&&"parent"in E&&E.parent;){if(x.has(E.id)){e.addIssue({code:j.custom,message:`cyclic parent chain detected at layer '${v.id}'`,path:["layers",_,"parent"]});break}x.add(E.id),E=i.get(E.parent)}}for(let _=0;_<t.layers.length;_++){const v=t.layers[_];if(v.kind!=="precomp")continue;const x=t.assets[v.compId],E=t.precomps?.[v.compId];if(!x&&!E){e.addIssue({code:j.custom,message:`precomp layer '${v.id}' references unknown compId '${v.compId}'`,path:["layers",_,"compId"]});continue}x&&x.type!=="composition"&&e.addIssue({code:j.custom,message:`asset '${v.compId}' is not a composition (got '${x.type}')`,path:["layers",_,"compId"]})}const o=new Set(["image","video","audio","gif","lottie","svg"]);for(let _=0;_<t.layers.length;_++){const v=t.layers[_];if(!o.has(v.kind))continue;const x=v.assetId;t.assets[x]||e.addIssue({code:j.custom,message:`layer '${v.id}' references unknown assetId '${x}'`,path:["layers",_,"assetId"]})}for(let _=0;_<t.layers.length;_++){const x=t.layers[_].trackMatte;x&&!r.has(x.sourceId)&&e.addIssue({code:j.custom,message:`trackMatte source '${x.sourceId}' is not a layer in this composition`,path:["layers",_,"trackMatte","sourceId"]})}t.layers.some(_=>_.kind==="model3d")&&!Hd(t.version,cv)&&e.addIssue({code:j.custom,message:`model3d layers require schema >= ${cv} (got ${t.version})`,path:["version"]});const a=t.transitions??[];t.transitions!==void 0&&!Hd(t.version,Gd)&&e.addIssue({code:j.custom,message:`transitions require schema >= ${Gd} (got ${t.version})`,path:["version"]});const l=new Set,c=new Map;for(let _=0;_<a.length;_+=1){const v=a[_];l.has(v.id)&&e.addIssue({code:j.custom,message:`duplicate transition id: ${v.id}`,path:["transitions",_,"id"]}),l.add(v.id);const x=Ei(v.from),E=Ei(v.to),T=new Set(x),A=[...new Set([...x,...E])];for(const M of E)T.has(M)&&e.addIssue({code:j.custom,message:`transition '${v.id}' uses layer '${M}' as both from and to`,path:["transitions",_]});for(const M of A){const C=i.get(M);if(!C){e.addIssue({code:j.custom,message:`transition '${v.id}' references unknown layer '${M}'`,path:["transitions",_]});continue}(C.kind==="camera"||C.kind==="light"||C.kind==="audio"||"is3D"in C&&C.is3D===!0)&&e.addIssue({code:j.custom,message:`transition '${v.id}' endpoint '${M}' must be a 2D visual layer`,path:["transitions",_]});const k=c.get(M)??[],w=v.startFrame,L=w+v.durationFrames;for(const D of k)w<D.end&&D.start<L&&e.addIssue({code:j.custom,message:`transition '${v.id}' overlaps '${D.id}' on layer '${M}'`,path:["transitions",_]});k.push({start:w,end:L,id:v.id}),c.set(M,k)}v.startFrame+v.durationFrames>t.durationInFrames&&e.addIssue({code:j.custom,message:`transition '${v.id}' extends past composition duration`,path:["transitions",_,"durationFrames"]})}for(let _=0;_<t.layers.length;_++){const v=t.layers[_];if(v.kind==="model3d"){v.source.type==="gltf"&&(t.assets[v.source.assetId]||e.addIssue({code:j.custom,message:`model3d layer '${v.id}' references unknown assetId '${v.source.assetId}'`,path:["layers",_,"source","assetId"]}));for(const x of["label","front"]){const E=v.textures?.[x];E&&(t.assets[E]||e.addIssue({code:j.custom,message:`model3d layer '${v.id}' references unknown texture assetId '${E}'`,path:["layers",_,"textures",x]}))}}}const u=new Map;for(const _ of t.layers)_.kind==="stage3d"&&u.set(_.id,_);const f=new Set(["stage3d","actor3d","prop3d"]),d=new Set,h=new Map,m=(_,v)=>e.addIssue({code:j.custom,message:_,path:v}),p=(_,v,x,E)=>{!x||t.assets[x]||m(`${v} layer '${_}' references unknown assetId '${x}'`,E)},g=new Map;for(const _ of t.layers)Tt(_)&&g.set(_.id,_);for(let _=0;_<t.layers.length;_++){const v=t.layers[_];if(f.has(v.kind)&&!d.has(v.kind)&&(Hd(t.version,jd)||(d.add(v.kind),m(`${v.kind} layers require schema >= ${jd} (got ${t.version})`,["version"]))),v.kind==="stage3d"){p(v.id,"stage3d",v.set?.backdrop,["layers",_,"set","backdrop"]);continue}if(Tt(v)){if(!u.has(v.stage))m(`${v.kind} '${v.id}' stage '${v.stage}' is not a stage3d layer in this composition`,["layers",_,"stage"]);else{const x=h.get(v.stage)??{actors:0,props:0,products:0};h.set(v.stage,x),v.kind==="actor3d"?(x.actors+=1,x.actors===Dt.actors+1&&m(`stage3d '${v.stage}' allows at most ${Dt.actors} actors (has more)`,["layers",_])):v.role==="product"?(x.products+=1,x.products===Dt.products+1&&m(`stage3d '${v.stage}' allows at most ${Dt.products} product (has more)`,["layers",_])):(x.props+=1,x.props===Dt.props+1&&m(`stage3d '${v.stage}' allows at most ${Dt.props} props (has more)`,["layers",_]))}if(v.kind==="actor3d")p(v.id,"actor3d",v.assetId,["layers",_,"assetId"]),v.clips?.forEach((x,E)=>p(v.id,"actor3d",x.clipAssetId,["layers",_,"clips",E,"clipAssetId"]));else if(v.source.type==="gltf"&&p(v.id,"prop3d",v.source.assetId,["layers",_,"source","assetId"]),p(v.id,"prop3d",v.textures?.label,["layers",_,"textures","label"]),p(v.id,"prop3d",v.textures?.front,["layers",_,"textures","front"]),v.attach){const x=g.get(v.attach.actor);(!x||x.kind!=="actor3d"||x.stage!==v.stage)&&m(`prop3d '${v.id}' attach.actor '${v.attach.actor}' is not an actor3d in stage '${v.stage}'`,["layers",_,"attach","actor"])}}}const y=(_,v)=>{const x=g.get(_);x&&m(`'${_}' is a ${x.kind} member of stage '${x.stage}'; reference the stage3d layer instead`,v)};for(let _=0;_<t.layers.length;_++){const v=t.layers[_];Tt(v)||(v.parent&&y(v.parent,["layers",_,"parent"]),"trackMatte"in v&&v.trackMatte&&y(v.trackMatte.sourceId,["layers",_,"trackMatte","sourceId"]))}a.forEach((_,v)=>{for(const x of[...Ei(_.from),...Ei(_.to)])y(x,["transitions",v])})});function qo(t){return zo.parse(Id(t))}function GL(t){const e=zo.safeParse(Id(t));return e.success?{success:!0,data:e.data}:{success:!1,error:e.error}}const jL={position:t=>{const[e,n]=t;return{x:e,y:n}},scale:t=>{const[e,n]=t;return{scaleX:e,scaleY:n}},rotation:t=>({rotation:t}),opacity:t=>({alpha:t}),skew:t=>({skewX:t}),skewAxis:t=>({skewY:t})};function HL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function lv(t,e,n,r){const i=jL[t];if(!i||!HL(e))return[];const o=e;if(o.length===0)return[];const s=l=>(l-r)/n,a=[];a.push({at:s(o[0].t),op:"set",vars:{pixi:i(o[0].v)},props:Object.keys(i(o[0].v))});for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){a.push({at:s(u.t),op:"set",vars:{pixi:i(u.v)},props:Object.keys(i(u.v))});continue}const h=Vn(c.easeOut);a.push({at:f,op:"to",vars:{pixi:i(u.v),duration:d,ease:h},props:Object.keys(i(u.v))})}return a}function uv(t,e,n){const r=S.timeline({paused:!0}),i=[];if(Tt(t))return{timeline:r,segments:i};const o=t.transform,s=["position","scale","rotation","opacity","skew","skewAxis"];for(const a of s){const l=o[a];if(l===void 0)continue;const c=lv(a,l,n,t.inPoint);for(const u of c)u.op==="to"?r.to(e,u.vars,u.at):r.set(e,u.vars,u.at),i.push(u)}return{timeline:r,segments:i}}const Yd=I.createContext(null),Si=({value:t,children:e})=>R.jsx(Yd.Provider,{value:t,children:e});function pt(){const t=I.useContext(Yd);if(!t)throw new Error("useAepLayerContext must be used inside <AepLayerProvider>");return t}function hn(){return I.useContext(Yd)}const dv=I.createContext(0),fv=({depth:t,children:e})=>R.jsx(dv.Provider,{value:t,children:e});function hv(){return I.useContext(dv)}const Vo=8;function wi(t,e){if(!e)return t;const n={...t};for(const[r,i]of Object.entries(e)){const o=t[r];if("type"in i&&i.type){n[r]=i;continue}if(o){n[r]={...o,...i};continue}n[r]={type:"image",src:i.src}}return n}function YL(t,e,n,r=null){const{tl:i}=I.useContext(Ve),o=hn(),s=I.useRef(null);I.useEffect(()=>{const a=i?.current,l=e.current;if(!a||!l||!WL(t))return;const c=o?o.framesToSeconds(t.inPoint):t.inPoint/n,{timeline:u}=uv(t,l,n);s.current=u,a.add(u,c);const f=a.time();return a.time(f===0?1e-6:0,!0),a.time(f,!1),()=>{s.current&&(a.remove(s.current),s.current.kill(),s.current=null)}},[t,n,e,r])}function Rr(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function WL(t){if(Tt(t))return!1;const e=t.transform;return Rr(e.position)||Rr(e.scale)||Rr(e.rotation)||Rr(e.opacity)||Rr(e.skew)||Rr(e.skewAxis)}function pv(t){const{tl:e}=I.useContext(Ve),[n,r]=I.useState(0);return I.useEffect(()=>{if(!e?.current)return;let o=0,s=-1;const a=()=>{if(e.current){const l=Math.round(e.current.time()*t);l!==s&&(s=l,r(l))}o=requestAnimationFrame(a)};return o=requestAnimationFrame(a),()=>cancelAnimationFrame(o)},[t,e]),n}function XL(t){return t?t.startsWith("http://")||t.startsWith("https://"):!1}const zL={NONE:"none",FADE:"fade",DISSOLVE:"dissolve",WIPE:"wipe",WIPE_LEFT:"wipeLeft",WIPE_RIGHT:"wipeRight",WIPE_UP:"wipeUp",WIPE_DOWN:"wipeDown",DIRECTIONAL:"directional",DIRECTIONAL_EASING:"directional-easing",DIRECTIONAL_SCALED:"directionalScaled",DIRECTIONAL_WARP:"directionalwarp",DIRECTIONAL_WIPE:"directionalwipe",LEFT_RIGHT:"leftRight",TOP_BOTTOM:"topBottom",CROSS_ZOOM:"crossZoom",SIMPLE_ZOOM:"simpleZoom",SIMPLE_ZOOM_OUT:"simpleZoomOut",ZOOM_IN_CIRCLES:"zoomInCircles",ZOOM_LEFT_WIPE:"zoomLeftWipe",ZOOM_RIGHT_WIPE:"zoomRigthWipe",SCALE_IN:"scale-in",CIRCLE:"circle",CIRCLE_OPEN:"circleopen",CIRCLE_CROP:"circleCrop",RECTANGLE:"rectangle",RECTANGLE_CROP:"rectangleCrop",HEART:"heart",HEXAGONALIZE:"hexagonalize",POLKA_DOTS_CURTAIN:"polkaDotsCurtain",RANDOM_SQUARES:"randomsquares",SQUARES_WIRE:"squareswire",ANGULAR:"angular",CUBE:"cube",ROTATE_SCALE_FADE:"rotate_scale_fade",ROTATE_SCALE_VANISH:"rotateScaleVanish",ROTATE_TRANSITION:"rotateTransition",BOOK_FLIP:"bookFlip",PAGE_CURL:"pageCurl",INVERTED_PAGE_CURL:"invertedPageCurl",BOW_TIE_HORIZONTAL:"bowTieHorizontal",BOW_TIE_VERTICAL:"bowTieVertical",BOW_TIE_WITH_PARAMETER:"bowTieWithParameter",HORIZONTAL_OPEN:"horizontalOpen",HORIZONTAL_CLOSE:"horizontalClose",VERTICAL_OPEN:"verticalOpen",VERTICAL_CLOSE:"verticalClose",LINEAR_BLUR:"linearBlur",DREAMY:"dreamy",DREAMY_ZOOM:"dreamyZoom",SWIRL:"swirl",RIPPLE:"ripple",WIND:"wind",WATER_DROP:"waterDrop",DISPLACEMENT:"displacement",SQUEEZE:"squeeze",GLITCH_DISPLACE:"glitchDisplace",GLITCH_MEMORIES:"glitchMemories",TV_STATIC:"tvStatic",STATIC_FADE:"staticFade",STATIC_WIPE:"static_wipe",PARAMETRIC_GLITCH:"parametric_glitch",BURN:"burn",FILM_BURN:"filmBurn",UNDULATING_BURN_OUT:"undulatingBurnOut",DOOM_SCREEN_TRANSITION:"doomScreenTransition",OVEREXPOSURE:"overexposure",FADE_COLOR:"fadecolor",FADE_GRAYSCALE:"fadegrayscale",COLOR_PHASE:"colorphase",COLOUR_DISTANCE:"colourDistance",MULTIPLY_BLEND:"multiply_blend",GRID_FLIP:"gridFlip",MOSAIC:"mosaic",MOSAIC_TRANSITION:"mosaic_transition",PIXELIZE:"pixelize",CROSSHATCH:"crosshatch",WINDOW_BLINDS:"windowblinds",WINDOW_SLICE:"windowslice",MORPH:"morph",SWAP:"swap",CROSSWARP:"crosswarp",POLAR_FUNCTION:"polar_function",COORD_FROM_IN:"coord-from-in",KALEIDOSCOPE:"kaleidoscope",POWER_KALEIDO:"powerKaleido",PINWHEEL:"pinwheel",FLYEYE:"flyeye",STEREO_VIEWER:"stereoViewer",PERLIN:"perlin",RANDOM_NOISEX:"randomNoisex",TANGENT_MOTION_BLUR:"tangentMotionBlur",LUMA:"luma",LUMINANCE_MELT:"luminance_melt",BOUNCE:"bounce",BUTTERFLY_WAVE_SCRAWLER:"butterflyWaveScrawler",CRAZY_PARAMETRIC_FUN:"crazyParametricFun",CANNABIS_LEAF:"cannabisleaf",RADIAL:"radial",ROLLS:"rolls",SLIDES:"slides",DOORWAY:"doorway",EDGE_TRANSITION:"edgeTransition",X_AXIS_TRANSLATION:"x_axis_translation",SIMPLE_FLIP:"simpleFlip",HSV_FADE:"hsvfade",FOLD:"fold",BLOCK_DISSOLVE:"blockDissolve",ADVANCED_MOSAIC:"advancedMosaic",DEFOCUS_BLUR:"defocusBlur",PUZZLE_RIGHT:"puzzleRight",TILES_WAVE:"tilesWave",STAR_WIPE:"starWipe",CHESSBOARD:"chessboard",BURN_EFFECT:"burn0",FRAGMENT:"fragment",ZOOM_IN_OUT:"zoomInOut"},qL={fade:"fade",dissolve:"fade",wipe:"wipeLeft",wipeLeft:"wipeLeft",wipeRight:"wipeRight",wipeUp:"wipeUp",wipeDown:"wipeDown",directional:"Directional","directional-easing":"Directional",directionalScaled:"Directional",directionalwarp:"directionalwarp",directionalwipe:"directionalwipe",leftRight:"Directional",topBottom:"Directional",crossZoom:"CrossZoom",simpleZoom:"SimpleZoom",simpleZoomOut:"SimpleZoomOut",zoomInCircles:"ZoomInCircles",zoomLeftWipe:"ZoomLeftWipe",zoomRigthWipe:"ZoomRigthWipe",zoomInOut:"zoomInOut","scale-in":"scale-in",simpleFlip:"SimpleFlip",hsvfade:"HSVfade",fold:"Fold",blockDissolve:"BlockDissolve",advancedMosaic:"AdvancedMosaic",defocusBlur:"DefocusBlur",puzzleRight:"PuzzleRight",tilesWave:"TilesWave",starWipe:"StarWipe",chessboard:"chessboard",burn0:"burn0",fragment:"fragment",circle:"circle",circleopen:"circleopen",circleCrop:"CircleCrop",heart:"heart",hexagonalize:"hexagonalize",randomsquares:"randomsquares",squareswire:"squareswire",bowTieHorizontal:"BowTieHorizontal",bowTieVertical:"BowTieVertical",bowTieWithParameter:"BowTieVertical",BowTieHorizontal:"BowTieHorizontal",BowTieVertical:"BowTieVertical",linearBlur:"LinearBlur",dreamy:"dreamy",swirl:"Swirl",mosaic:"Mosaic",Mosaic:"Mosaic",windowslice:"windowslice",WindowSlice:"windowslice",windowblinds:"windowblinds",WindowBlinds:"windowblinds",stereoviewer:"StereoViewer",StereoViewer:"StereoViewer",doorway:"doorway",Doorway:"doorway"},mv=new Set,gv=t=>t.toLowerCase().replace(/[^a-z0-9]/g,""),Ko=t=>{if(!t)return null;const e=qL[t];if(e){const i=Ms.find(o=>o.name.toLowerCase()===e.toLowerCase());if(i)return i}const n=t.toLowerCase(),r=gv(t);return Ms.find(i=>i.name.toLowerCase()===n||gv(i.name)===r)??null},yv=t=>Ko(t)!==null,_v=()=>Ms.map(t=>t.name),VL=Ko,KL=_v,$L=t=>{mv.has(t)||(mv.add(t),console.warn(`[reacthub-pixitweenjs] Unknown GL transition "${t}"; using crossfade fallback.`))},ZL=`in vec2 aPosition;
1426
1426
  in vec2 aUV;
1427
1427
  out vec2 vTextureCoord;
1428
1428
 
@@ -1435,7 +1435,7 @@ void main(void) {
1435
1435
  gl_Position = vec4((mvp * vec3(aPosition, 1.0)).xy, 0.0, 1.0);
1436
1436
  vTextureCoord = aUV;
1437
1437
  }
1438
- `,CM=`precision highp float;
1438
+ `,JL=`precision highp float;
1439
1439
  in vec2 vTextureCoord;
1440
1440
  out vec4 finalColor;
1441
1441
  uniform sampler2D uFromTexture;
@@ -1444,7 +1444,7 @@ uniform float progress;
1444
1444
  void main(void) {
1445
1445
  finalColor = mix(texture(uFromTexture, vTextureCoord), texture(uToTexture, vTextureCoord), progress);
1446
1446
  }
1447
- `,RM=t=>{const e=/uniform\s+\w+\s+(\w+)\s*;/g,n=new Set;let r;for(;(r=e.exec(t))!==null;)n.add(r[1]);return n},IM=t=>{const e=/uniform\s+(\w+)\s+(\w+)\s*;/g,n=new Map;let r;for(;(r=e.exec(t))!==null;)n.set(r[2],r[1]);return n},MM=(t,e)=>{const n=()=>Array.isArray(e)?new Float32Array(e):null,r=()=>Array.isArray(e)?new Int32Array(e.map(i=>Math.round(i))):null;switch(t){case"float":return{value:Number(e)||0,type:"f32"};case"int":return{value:Math.round(Number(e))||0,type:"i32"};case"bool":return{value:e?1:0,type:"i32"};case"vec2":case"vec3":case"vec4":{const i=n();return i?{value:i,type:`vec${t.slice(-1)}<f32>`}:null}case"ivec2":case"ivec3":case"ivec4":{const i=r();return i?{value:i,type:`vec${t.slice(-1)}<i32>`}:null}default:return null}},LM=(t,e)=>typeof e=="boolean"?`uniform bool ${t};`:Array.isArray(e)&&e.length>=2&&e.length<=4?`uniform vec${e.length} ${t};`:`uniform float ${t};`,PM=t=>t.replace(/\bin\s+(?=(?:lowp\s+|mediump\s+|highp\s+)?(?:float|int|uint|bool|vec[234]|mat[234]|sampler\w*)\b)/g,""),NM=t=>t.replace(/(\b[A-Za-z_]\w*\s*\()([^)]*)(\))/g,(e,n,r,i)=>`${n}${PM(r)}${i}`),kM=(t,e)=>{const n=NM(t),r=RM(n);return`precision highp float;
1447
+ `,QL=t=>{const e=/uniform\s+\w+\s+(\w+)\s*;/g,n=new Set;let r;for(;(r=e.exec(t))!==null;)n.add(r[1]);return n},ek=t=>{const e=/uniform\s+(\w+)\s+(\w+)\s*;/g,n=new Map;let r;for(;(r=e.exec(t))!==null;)n.set(r[2],r[1]);return n},tk=(t,e)=>{const n=()=>Array.isArray(e)?new Float32Array(e):null,r=()=>Array.isArray(e)?new Int32Array(e.map(i=>Math.round(i))):null;switch(t){case"float":return{value:Number(e)||0,type:"f32"};case"int":return{value:Math.round(Number(e))||0,type:"i32"};case"bool":return{value:e?1:0,type:"i32"};case"vec2":case"vec3":case"vec4":{const i=n();return i?{value:i,type:`vec${t.slice(-1)}<f32>`}:null}case"ivec2":case"ivec3":case"ivec4":{const i=r();return i?{value:i,type:`vec${t.slice(-1)}<i32>`}:null}default:return null}},nk=(t,e)=>typeof e=="boolean"?`uniform bool ${t};`:Array.isArray(e)&&e.length>=2&&e.length<=4?`uniform vec${e.length} ${t};`:`uniform float ${t};`,rk=t=>t.replace(/\bin\s+(?=(?:lowp\s+|mediump\s+|highp\s+)?(?:float|int|uint|bool|vec[234]|mat[234]|sampler\w*)\b)/g,""),ik=t=>t.replace(/(\b[A-Za-z_]\w*\s*\()([^)]*)(\))/g,(e,n,r,i)=>`${n}${rk(r)}${i}`),ok=(t,e)=>{const n=ik(t),r=QL(n);return`precision highp float;
1448
1448
 
1449
1449
  in vec2 vTextureCoord;
1450
1450
  out vec4 finalColor;
@@ -1453,7 +1453,7 @@ uniform sampler2D uFromTexture;
1453
1453
  uniform sampler2D uToTexture;
1454
1454
  uniform float progress;
1455
1455
  uniform float ratio;
1456
- ${Object.keys(e).filter(o=>!r.has(o)&&o!=="progress"&&o!=="ratio").map(o=>LM(o,e[o])).join(`
1456
+ ${Object.keys(e).filter(o=>!r.has(o)&&o!=="progress"&&o!=="ratio").map(o=>nk(o,e[o])).join(`
1457
1457
  `)}
1458
1458
 
1459
1459
  // Pixi compiles this as GLSL ES 1.00 and injects \`#define texture texture2D\`.
@@ -1465,7 +1465,7 @@ ${n}
1465
1465
  void main(void) {
1466
1466
  finalColor = transition(vTextureCoord);
1467
1467
  }
1468
- `},DM=t=>typeof t=="boolean"?{value:t?1:0,type:"i32"}:Array.isArray(t)&&t.length>=2&&t.length<=4?{value:new Float32Array(t),type:`vec${t.length}<f32>`}:{value:Number(t)||0,type:"f32"},Rb=t=>!!(t&&!t.destroyed),FM=t=>DM(t),Ib=(t,e={})=>{const{width:n=1920,height:r=1080,params:i={}}=e,o=Po(t);o||AM(t);const s={...o?.defaultParams??{},...i},a=o?kM(o.glsl,s):CM,l=o?IM(o.glsl):new Map,c={progress:{value:0,type:"f32"},ratio:{value:n/r,type:"f32"}};for(const[m,g]of Object.entries(s)){if(m==="progress"||m==="ratio")continue;const y=l.get(m);c[m]=y&&MM(y,g)||FM(g)}const u=B.Shader.from({gl:{vertex:OM,fragment:a,name:`gl-transition-${o?.name??"fallback"}`},resources:{glTransitionUniforms:c,uFromTexture:B.Texture.WHITE.source,uToTexture:B.Texture.WHITE.source}}),f=u.resources,d=f.glTransitionUniforms.uniforms;let h=!1;const p=()=>{f.uFromTexture=B.Texture.WHITE.source,f.uToTexture=B.Texture.WHITE.source};return{shader:u,resolvedName:o?.name??null,setProgress:m=>{h||(d.progress=Math.max(0,Math.min(1,m)))},setTextures:(m,g)=>{if(h)return;const y=m?.source,b=g?.source;Rb(y)&&f.uFromTexture!==y&&(f.uFromTexture=y),Rb(b)&&f.uToTexture!==b&&(f.uToTexture=b)},clearTextures:p,destroy:()=>{h||(h=!0,p(),u.destroy())}}},BM=t=>t?.type===B.RendererType.WEBGL,mf=1920*1080,UM=(t,e=mf)=>{const n=t.width*t.height;return!(n>e)||e<=0?1:Math.sqrt(e/n)},GM=t=>t instanceof B.Sprite&&t.texture===B.Texture.WHITE,jM=t=>{const e=[],n=i=>{if(!GM(i)){e.push({container:i,alpha:i.alpha,visible:i.visible}),i.alpha=1,i.visible=!0;for(const o of i.children)n(o)}};n(t);let r=!1;return()=>{if(!r){r=!0;for(const i of e)i.container.alpha=i.alpha,i.container.visible=i.visible}}},Mb=(t,e,n,r,i=0,o=0)=>{if(!e.current){const c=new B.Container;c.sortableChildren=!0,e.current=c}const s=e.current;s.position.set(i,o);const a=[],l=[];for(const{container:c}of n){const u=c.parent;a.push({container:c,parent:u,index:u?u.getChildIndex(c):-1,zIndex:c.zIndex})}try{for(let c=0;c<n.length;c+=1){const{container:u,zIndex:f}=n[c];u.zIndex=f,s.addChild(u),l.push(jM(u))}s.sortChildren(),t.render({container:s,target:r,clear:!0})}finally{for(let c=l.length-1;c>=0;c-=1)l[c]();a.sort((c,u)=>c.index-u.index);for(const c of a)if(c.container.zIndex=c.zIndex,c.parent){const u=Math.max(0,Math.min(c.index,c.parent.children.length));c.parent.addChildAt(c.container,u)}else s.removeChild(c.container)}},HM=()=>new B.Geometry({attributes:{aPosition:[-.5,-.5,.5,-.5,.5,.5,-.5,.5],aUV:[0,0,1,0,1,1,0,1]},indexBuffer:[0,1,2,0,2,3]}),Lb=t=>{const e=t.getBounds();return{x:e.x,y:e.y,width:e.width,height:e.height}},Pb=t=>{const e=t.filter(s=>!!s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.width)&&Number.isFinite(s.height)&&s.width>=0&&s.height>=0);if(e.length===0)return null;const n=Math.min(...e.map(s=>s.x)),r=Math.min(...e.map(s=>s.y)),i=Math.max(...e.map(s=>s.x+s.width)),o=Math.max(...e.map(s=>s.y+s.height));return{x:n,y:r,width:i-n,height:o-r}},gf=new WeakMap;function YM(t){const e=t.source;if(typeof e=="string")return Array.from(e).length;if(Array.isArray(e)&&e.length>0){let n=0;for(const r of e){const i=Array.from(r.v).length;i>n&&(n=i)}return n}return 0}function yf(t){const e=gf.get(t);if(e)return e.runs;const n=t.style.runs??[],r=YM(t),i=n.length===0&&r>0?{runs:[{from:0,to:r}],warnings:[]}:hb(n,r);return gf.set(t,i),i.runs}function XM(t){return yf(t),gf.get(t)??{runs:[],warnings:[]}}const Nb="msdf-atlas/1",kb=new Map;function Db(t,e){if(t.version!==Nb)throw new Error(`Unsupported MSDF atlas version "${t.version}"; expected "${Nb}".`);const n=new Map;for(const i of t.glyphs)n.set(i.char,{char:i.char,codepoint:i.codepoint,uv:i.uv,planeBounds:i.planeBounds,advance:i.advance});const r=new Map;for(const[i,o]of Object.entries(t.kerning))r.set(i,o);return{texture:e,glyphs:n,kerning:r,em:t.font.em,ascent:t.font.ascent,descent:t.font.descent,lineHeight:t.font.lineHeight,distanceRange:t.atlas.distanceRange,atlasSize:{width:t.atlas.width,height:t.atlas.height},version:t.version}}function Fb(t){const{width:e,height:n}=t.atlasSize;for(const r of t.glyphs.values())r.uv=[r.uv[0]/e,r.uv[1]/n,r.uv[2]/e,r.uv[3]/n]}function WM(t){return new Promise((e,n)=>{new V.TextureLoader().load(t,r=>{r.minFilter=V.LinearFilter,r.magFilter=V.LinearFilter,r.generateMipmaps=!1,r.flipY=!1,r.needsUpdate=!0,e(r)},void 0,r=>n(r))})}function zM(t){return t.replace(/\.json($|\?)/,".png$1")}async function qM(t,e){const[n,r]=await Promise.all([fetch(t).then(o=>{if(!o.ok)throw new Error(`Failed to load MSDF atlas JSON from ${t}: ${o.status}`);return o.json()}),WM(e)]),i=Db(n,r);return Fb(i),i}function Bb(t,e={}){const n=kb.get(t);if(n)return n;const r=e.pngUrl??zM(t),i=qM(t,r);return kb.set(t,i),i}function VM(t,e){const n=Db(t,e);return Fb(n),n}const Ub=`
1468
+ `},sk=t=>typeof t=="boolean"?{value:t?1:0,type:"i32"}:Array.isArray(t)&&t.length>=2&&t.length<=4?{value:new Float32Array(t),type:`vec${t.length}<f32>`}:{value:Number(t)||0,type:"f32"},bv=t=>!!(t&&!t.destroyed),ak=t=>sk(t),vv=(t,e={})=>{const{width:n=1920,height:r=1080,params:i={}}=e,o=Ko(t);o||$L(t);const s={...o?.defaultParams??{},...i},a=o?ok(o.glsl,s):JL,l=o?ek(o.glsl):new Map,c={progress:{value:0,type:"f32"},ratio:{value:n/r,type:"f32"}};for(const[p,g]of Object.entries(s)){if(p==="progress"||p==="ratio")continue;const y=l.get(p);c[p]=y&&tk(y,g)||ak(g)}const u=G.Shader.from({gl:{vertex:ZL,fragment:a,name:`gl-transition-${o?.name??"fallback"}`},resources:{glTransitionUniforms:c,uFromTexture:G.Texture.WHITE.source,uToTexture:G.Texture.WHITE.source}}),f=u.resources,d=f.glTransitionUniforms.uniforms;let h=!1;const m=()=>{f.uFromTexture=G.Texture.WHITE.source,f.uToTexture=G.Texture.WHITE.source};return{shader:u,resolvedName:o?.name??null,setProgress:p=>{h||(d.progress=Math.max(0,Math.min(1,p)))},setTextures:(p,g)=>{if(h)return;const y=p?.source,_=g?.source;bv(y)&&f.uFromTexture!==y&&(f.uFromTexture=y),bv(_)&&f.uToTexture!==_&&(f.uToTexture=_)},clearTextures:m,destroy:()=>{h||(h=!0,m(),u.destroy())}}},ck=t=>t?.type===G.RendererType.WEBGL,Wd=1920*1080,lk=(t,e=Wd)=>{const n=t.width*t.height;return!(n>e)||e<=0?1:Math.sqrt(e/n)},uk=t=>t instanceof G.Sprite&&t.texture===G.Texture.WHITE,dk=t=>{const e=[],n=i=>{if(!uk(i)){e.push({container:i,alpha:i.alpha,visible:i.visible}),i.alpha=1,i.visible=!0;for(const o of i.children)n(o)}};n(t);let r=!1;return()=>{if(!r){r=!0;for(const i of e)i.container.alpha=i.alpha,i.container.visible=i.visible}}},xv=(t,e,n,r,i=0,o=0)=>{if(!e.current){const c=new G.Container;c.sortableChildren=!0,e.current=c}const s=e.current;s.position.set(i,o);const a=[],l=[];for(const{container:c}of n){const u=c.parent;a.push({container:c,parent:u,index:u?u.getChildIndex(c):-1,zIndex:c.zIndex})}try{for(let c=0;c<n.length;c+=1){const{container:u,zIndex:f}=n[c];u.zIndex=f,s.addChild(u),l.push(dk(u))}s.sortChildren(),t.render({container:s,target:r,clear:!0})}finally{for(let c=l.length-1;c>=0;c-=1)l[c]();a.sort((c,u)=>c.index-u.index);for(const c of a)if(c.container.zIndex=c.zIndex,c.parent){const u=Math.max(0,Math.min(c.index,c.parent.children.length));c.parent.addChildAt(c.container,u)}else s.removeChild(c.container)}},fk=()=>new G.Geometry({attributes:{aPosition:[-.5,-.5,.5,-.5,.5,.5,-.5,.5],aUV:[0,0,1,0,1,1,0,1]},indexBuffer:[0,1,2,0,2,3]}),Tv=t=>{const e=t.getBounds();return{x:e.x,y:e.y,width:e.width,height:e.height}},Ev=t=>{const e=t.filter(s=>!!s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.width)&&Number.isFinite(s.height)&&s.width>=0&&s.height>=0);if(e.length===0)return null;const n=Math.min(...e.map(s=>s.x)),r=Math.min(...e.map(s=>s.y)),i=Math.max(...e.map(s=>s.x+s.width)),o=Math.max(...e.map(s=>s.y+s.height));return{x:n,y:r,width:i-n,height:o-r}},Xd=new WeakMap;function hk(t){const e=t.source;if(typeof e=="string")return Array.from(e).length;if(Array.isArray(e)&&e.length>0){let n=0;for(const r of e){const i=Array.from(r.v).length;i>n&&(n=i)}return n}return 0}function zd(t){const e=Xd.get(t);if(e)return e.runs;const n=t.style.runs??[],r=hk(t),i=n.length===0&&r>0?{runs:[{from:0,to:r}],warnings:[]}:Xb(n,r);return Xd.set(t,i),i.runs}function pk(t){return zd(t),Xd.get(t)??{runs:[],warnings:[]}}const Sv="msdf-atlas/1",wv=new Map;function Av(t,e){if(t.version!==Sv)throw new Error(`Unsupported MSDF atlas version "${t.version}"; expected "${Sv}".`);const n=new Map;for(const i of t.glyphs)n.set(i.char,{char:i.char,codepoint:i.codepoint,uv:i.uv,planeBounds:i.planeBounds,advance:i.advance});const r=new Map;for(const[i,o]of Object.entries(t.kerning))r.set(i,o);return{texture:e,glyphs:n,kerning:r,em:t.font.em,ascent:t.font.ascent,descent:t.font.descent,lineHeight:t.font.lineHeight,distanceRange:t.atlas.distanceRange,atlasSize:{width:t.atlas.width,height:t.atlas.height},version:t.version}}function Ov(t){const{width:e,height:n}=t.atlasSize;for(const r of t.glyphs.values())r.uv=[r.uv[0]/e,r.uv[1]/n,r.uv[2]/e,r.uv[3]/n]}function mk(t){return new Promise((e,n)=>{new B.TextureLoader().load(t,r=>{r.minFilter=B.LinearFilter,r.magFilter=B.LinearFilter,r.generateMipmaps=!1,r.flipY=!1,r.needsUpdate=!0,e(r)},void 0,r=>n(r))})}function gk(t){return t.replace(/\.json($|\?)/,".png$1")}async function yk(t,e){const[n,r]=await Promise.all([fetch(t).then(o=>{if(!o.ok)throw new Error(`Failed to load MSDF atlas JSON from ${t}: ${o.status}`);return o.json()}),mk(e)]),i=Av(n,r);return Ov(i),i}function Mv(t,e={}){const n=wv.get(t);if(n)return n;const r=e.pngUrl??gk(t),i=yk(t,r);return wv.set(t,i),i}function _k(t,e){const n=Av(t,e);return Ov(n),n}const Iv=`
1469
1469
  attribute vec4 aUvRect;
1470
1470
  attribute vec4 aColor;
1471
1471
  varying vec2 vUv;
@@ -1483,7 +1483,7 @@ void main() {
1483
1483
  // Without this multiplication every instance collapses to local origin.
1484
1484
  gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0);
1485
1485
  }
1486
- `,Gb=`
1486
+ `,Cv=`
1487
1487
  precision highp float;
1488
1488
  uniform sampler2D uAtlas;
1489
1489
  uniform float uDistanceRange;
@@ -1503,14 +1503,14 @@ void main() {
1503
1503
  if (opacity < 0.001) discard;
1504
1504
  gl_FragColor = vec4(vColor.rgb, vColor.a * opacity);
1505
1505
  }
1506
- `,jb=new V.Quaternion,Hb=new V.Euler,Yb=new V.Vector3,Xb=new V.Vector3;function Wb(t,e,n,r,i){const o=n.bounds.width/2,s=n.bounds.height/2,[a,l,c,u]=e.planeBounds,f=(a+c)/2*r,d=(l+u)/2*r,h=(c-a)*r,p=(u-l)*r;return Xb.set(n.x+f+i.position[0]-o,-(n.y-d)+i.position[1]+s,0),Hb.set(0,0,-i.rotation*Math.PI/180),jb.setFromEuler(Hb),Yb.set(h*(1+i.scale[0]),p*(1+i.scale[1]),1),t.compose(Xb,jb,Yb),t}function KM(t,e,n){const r=e*4;t[r]=n[0],t[r+1]=n[1],t[r+2]=n[2],t[r+3]=n[3]}function zb(t,e){const n=t.replace(/^#/,"");if(n.length!==6&&n.length!==8)return[1,1,1,e??1];const r=parseInt(n.slice(0,2),16)/255,i=parseInt(n.slice(2,4),16)/255,o=parseInt(n.slice(4,6),16)/255,s=n.length===8?parseInt(n.slice(6,8),16)/255:1;return[r,i,o,e??s]}const qb=.28,Vb=0,Kb=1.2,Zb=(t,e)=>t>1?t:e*qb,_f=(t,e)=>{const n=typeof t=="string"?Number(t):t;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:e*Vb},No=t=>t==="pop"||t==="punch"?1.08:t==="glow"?1.05:1,xr=(t,e)=>e==="uppercase"?t.toUpperCase():e==="lowercase"?t.toLowerCase():t,$b=(t,e,n=4)=>{if(!t.length||e<0)return[];if(t.length<=n)return t;const r=Math.max(0,e-n+1);return t.slice(r,e+1)},xn=(t,e)=>{if(e<=0)return 1;const n=Math.max(0,Math.min(1,t/e));return 1-Math.pow(1-n,3)};function Jb(t,e){const{fontSize:n,maxLineWidth:r}=e,i=Zb(e.spaceWidth,n)+_f(e.wordSpacing,n),o=Math.max(1,e.activeScale??1),s=[],a=[];let l=0,c=0,u=0,f=0;for(let d=0;d<t.length;d++){const h=t[d].width*o;u=Math.max(u,t[d].height),l>0&&l+h>r&&(a.push({start:f,end:d,width:l-i,height:u}),l=0,c+=u*Kb,u=t[d].height,f=d),s.push({x:l,y:c,width:h,height:t[d].height}),l+=h+i}t.length&&a.push({start:f,end:t.length,width:l-i,height:u});for(const d of a){const h=(r-d.width)/2;for(let p=d.start;p<d.end;p++)s[p].x+=h,s[p].height=d.height}return{positions:s,lines:a,totalWidth:r,totalHeight:c+u}}const Qb=t=>{const e=typeof t=="string"?t:"";return e==="none"?"none":e==="social-neon"||e.startsWith("glow-")||e==="retro-terminal"?"glow":e==="social-glass"||e==="business-clean"||e==="business-boxed"?"boxed":e==="retro-vhs"?"vhs":e==="capcut-highlight"?"wordbox":e==="capcut-pop"?"punch":e==="capcut-word"?"slam":e==="capcut-glow-pop"?"glowpop":e==="capcut-spring-pop"?"springpop":"pop"},ZM=t=>t==="slam"||t==="glowpop"||t==="springpop",ex=(t,e,n)=>n==="slam"?t.reduce((r,i,o)=>e>=i.start?o:r,-1):t.findIndex(r=>e>=r.start&&e<r.end),tx=100,nx=100,rx=350,ix=.12,bf=.6,ox=.3,sx=.8,ax=2,cx=.55,xf=1.5,vf=1.35,lx=t=>{const n=Math.max(0,Math.min(1,t))-1;return 1+(1.70158+1)*n*n*n+1.70158*n*n},ux=(t,e,n)=>{const r=xn(t,tx),i=xn(e,nx),o=Math.min(r,i);return{alpha:bf+(1-bf)*o,blur:(1-r+(1-i))*n*ix,scale:.92+.08*o,emojiScale:(.6+.4*lx(t/rx))*(.6+.4*i)}},fx=5,dx=.12,hx=.2,px=150,mx=.1,Tf=.75,gx=.22,yx=.7,_x=(t,e)=>{const n=Math.max(0,t)/1e3,r=2*Math.PI*fx,i=-hx*e*Math.exp(-dx*r*n)*Math.cos(r*n),o=1-xn(t,px);return{alpha:Tf+(1-Tf)*(1-o),dy:i,blur:o*e*mx,scaleY:1+.12*o}},bx=150,xx=.072,Ef=.029,vx="#5AA9FF",Tx="#FFA14A",Ex=.75,Sx=(t,e)=>{const n=1-xn(t,bx);return e*(Ef+(xx-Ef)*n)},Sf=(t,e)=>t==="punch"?.8+.28*xn(e,160):t==="slam"?.55+.45*xn(e,220):1,wx="https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@v2.047/png/128",Ax=t=>{const e=Array.from(t).map(n=>n.codePointAt(0)??0).filter(n=>n!==65039&&n>0);return e.length?`emoji_u${e.map(n=>n.toString(16)).join("_")}.png`:null},wf=t=>{if(t.emojiSrc)return t.emojiSrc;if(!t.emoji)return null;const e=Ax(t.emoji);return e?`${wx}/${e}`:null},Ox=/^#[0-9a-fA-F]{6}$/,Cx=de({text:le().min(1),start:k().finite().nonnegative(),end:k().finite().nonnegative(),emoji:le().min(1).optional(),emojiSrc:le().min(1).optional(),color:le().regex(Ox,"expected #RRGGBB").optional(),confidence:k().min(0).max(1).optional()}).refine(t=>t.end>=t.start,{message:"word end must be >= start",path:["end"]}),Rx=de({id:le().min(1),start:k().finite().nonnegative(),end:k().finite().nonnegative(),text:le(),words:Qe(Cx).optional()}).refine(t=>t.end>=t.start,{message:"segment end must be >= start",path:["end"]}),Ix=Qe(Rx);function $M(t){return Ix.parse(t)}const JM=t=>t.text??t.word??"",Af=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),hi=t=>{if(typeof t=="number")return Number.isFinite(t)?t:void 0;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)?e:void 0}},vr=t=>typeof t=="string"&&t.trim()!==""?t:void 0;function QM(t){if(!Af(t))return null;const e=(vr(t.text)??vr(t.word))?.trim(),n=hi(t.start??t.startTime),r=hi(t.end??t.endTime);if(!e||n===void 0||r===void 0)return null;const i=Math.max(0,n),o=Math.max(0,r);if(o<i)return null;const s={text:e,start:i,end:o},a=vr(t.emoji);a&&(s.emoji=a);const l=vr(t.emojiSrc);l&&(s.emojiSrc=l),typeof t.color=="string"&&Ox.test(t.color)&&(s.color=t.color);const c=hi(t.confidence);return c!==void 0&&c>=0&&c<=1&&(s.confidence=c),s}function eL(t,e){if(!Af(t))return null;const n=Array.isArray(t.words)?t.words.map(QM).filter(l=>l!==null).sort((l,c)=>l.start-c.start):[];let r=hi(t.start??t.startTime),i=hi(t.end??t.endTime);if(r===void 0&&n.length&&(r=n[0].start),i===void 0&&n.length&&(i=n.reduce((l,c)=>Math.max(l,c.end),0)),r===void 0||i===void 0||(r=Math.max(0,r),i=Math.max(0,i),i<r))return null;const o=vr(t.text)?.trim()??n.map(l=>l.text).join(" ").trim();if(!o&&!n.length)return null;const a={id:(vr(t.id)??(typeof t.id=="number"?String(t.id):""))||`caption_${e}`,start:r,end:i,text:o};return n.length&&(a.words=n),a}function tL(t){return(Array.isArray(t)?t:Af(t)&&Array.isArray(t.segments)?t.segments:[]).map((n,r)=>eL(n,r)).filter(n=>n!==null).sort((n,r)=>n.start-r.start)}const Mx=.35,Lx=1e-6;function nL(t,e={}){const n=e.segmentGapSec??Mx,r=e.maxWords&&e.maxWords>0?Math.floor(e.maxWords):1/0,i=e.maxDurationSec&&e.maxDurationSec>0?e.maxDurationSec:1/0,o=e.idPrefix??"caption",s=[...t].sort((u,f)=>u.start-f.start),a=[];let l=[];const c=()=>{l.length&&(a.push({id:`${o}_${a.length}`,start:l[0].start,end:l.reduce((u,f)=>Math.max(u,f.end),l[0].end),text:l.map(u=>u.text).join(" "),words:l}),l=[])};for(const u of s){if(l.length){const f=l.reduce((p,m)=>Math.max(p,m.end),0),d=u.start-f,h=u.end-l[0].start;(d>=n-Lx||l.length>=r||h>i+Lx)&&c()}l.push(u)}return c(),a}const rL=/^(?:(\d+):)?(\d{1,2}):(\d{2})[.,](\d{1,3})$/,Px=/^\s*(\S+)\s+-->\s+(\S+)/,Nx=/<((?:\d+:)?\d{1,2}:\d{2}[.,]\d{1,3})>/g;function ko(t){const e=rL.exec(t.trim());if(!e)return null;const n=e[1]?Number(e[1]):0,r=Number(e[2]),i=Number(e[3]),o=Number(e[4].padEnd(3,"0"));return r>59||i>59?null:n*3600+r*60+i+o/1e3}const iL={"&amp;":"&","&lt;":"<","&gt;":">","&nbsp;":" ","&quot;":'"',"&#39;":"'"};function kx(t){return t.replace(/<[^>]*>/g,"").replace(/&(?:amp|lt|gt|nbsp|quot|#39);/g,e=>iL[e]??e).replace(/\s+/g," ").trim()}function Of(t,e,n){const r=t.split(/\s+/).filter(Boolean);if(!r.length)return[];const i=Math.max(0,e),o=Math.max(i,n),s=r.reduce((u,f)=>u+f.length,0),a=o-i,l=[];let c=i;return r.forEach((u,f)=>{const h=f===r.length-1?o:c+a*u.length/s;l.push({text:u,start:c,end:h}),c=h}),l}function oL(t,e,n){const r=t.replace(/\r?\n/g," "),i=[];let o=0,s=e,a;for(Nx.lastIndex=0;a=Nx.exec(r);)i.push({start:s,raw:r.slice(o,a.index)}),s=ko(a[1])??s,o=a.index+a[0].length;if(!i.length)return null;i.push({start:s,raw:r.slice(o)});const l=[];return i.forEach((c,u)=>{const f=kx(c.raw);if(!f)return;const d=i[u+1],h=d?d.start:n;l.push(...Of(f,c.start,h))}),l.length?l:null}function Dx(t,e,n){const i=t.replace(/^\uFEFF/,"").replace(/\r\n?/g,`
1506
+ `,Rv=new B.Quaternion,Lv=new B.Euler,kv=new B.Vector3,Pv=new B.Vector3;function Dv(t,e,n,r,i){const o=n.bounds.width/2,s=n.bounds.height/2,[a,l,c,u]=e.planeBounds,f=(a+c)/2*r,d=(l+u)/2*r,h=(c-a)*r,m=(u-l)*r;return Pv.set(n.x+f+i.position[0]-o,-(n.y-d)+i.position[1]+s,0),Lv.set(0,0,-i.rotation*Math.PI/180),Rv.setFromEuler(Lv),kv.set(h*(1+i.scale[0]),m*(1+i.scale[1]),1),t.compose(Pv,Rv,kv),t}function bk(t,e,n){const r=e*4;t[r]=n[0],t[r+1]=n[1],t[r+2]=n[2],t[r+3]=n[3]}function Nv(t,e){const n=t.replace(/^#/,"");if(n.length!==6&&n.length!==8)return[1,1,1,e??1];const r=parseInt(n.slice(0,2),16)/255,i=parseInt(n.slice(2,4),16)/255,o=parseInt(n.slice(4,6),16)/255,s=n.length===8?parseInt(n.slice(6,8),16)/255:1;return[r,i,o,e??s]}const Fv=.28,Bv=0,Uv=1.2,Gv=(t,e)=>t>1?t:e*Fv,qd=(t,e)=>{const n=typeof t=="string"?Number(t):t;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:e*Bv},$o=t=>t==="pop"||t==="punch"?1.08:t==="glow"?1.05:1,Lr=(t,e)=>e==="uppercase"?t.toUpperCase():e==="lowercase"?t.toLowerCase():t,jv=(t,e,n=4)=>{if(!t.length||e<0)return[];if(t.length<=n)return t;const r=Math.max(0,e-n+1);return t.slice(r,e+1)},In=(t,e)=>{if(e<=0)return 1;const n=Math.max(0,Math.min(1,t/e));return 1-Math.pow(1-n,3)};function Hv(t,e){const{fontSize:n,maxLineWidth:r}=e,i=Gv(e.spaceWidth,n)+qd(e.wordSpacing,n),o=Math.max(1,e.activeScale??1),s=[],a=[];let l=0,c=0,u=0,f=0;for(let d=0;d<t.length;d++){const h=t[d].width*o;u=Math.max(u,t[d].height),l>0&&l+h>r&&(a.push({start:f,end:d,width:l-i,height:u}),l=0,c+=u*Uv,u=t[d].height,f=d),s.push({x:l,y:c,width:h,height:t[d].height}),l+=h+i}t.length&&a.push({start:f,end:t.length,width:l-i,height:u});for(const d of a){const h=(r-d.width)/2;for(let m=d.start;m<d.end;m++)s[m].x+=h,s[m].height=d.height}return{positions:s,lines:a,totalWidth:r,totalHeight:c+u}}const Yv=t=>{const e=typeof t=="string"?t:"";return e==="none"?"none":e==="social-neon"||e.startsWith("glow-")||e==="retro-terminal"?"glow":e==="social-glass"||e==="business-clean"||e==="business-boxed"?"boxed":e==="retro-vhs"?"vhs":e==="capcut-highlight"?"wordbox":e==="capcut-pop"?"punch":e==="capcut-word"?"slam":e==="capcut-glow-pop"?"glowpop":e==="capcut-spring-pop"?"springpop":"pop"},vk=t=>t==="slam"||t==="glowpop"||t==="springpop",Wv=(t,e,n)=>n==="slam"?t.reduce((r,i,o)=>e>=i.start?o:r,-1):t.findIndex(r=>e>=r.start&&e<r.end),Xv=100,zv=100,qv=350,Vv=.12,Vd=.6,Kv=.3,$v=.8,Zv=2,Jv=.55,Kd=1.5,$d=1.35,Qv=t=>{const n=Math.max(0,Math.min(1,t))-1;return 1+(1.70158+1)*n*n*n+1.70158*n*n},ex=(t,e,n)=>{const r=In(t,Xv),i=In(e,zv),o=Math.min(r,i);return{alpha:Vd+(1-Vd)*o,blur:(1-r+(1-i))*n*Vv,scale:.92+.08*o,emojiScale:(.6+.4*Qv(t/qv))*(.6+.4*i)}},tx=5,nx=.12,rx=.2,ix=150,ox=.1,Zd=.75,sx=.22,ax=.7,cx=(t,e)=>{const n=Math.max(0,t)/1e3,r=2*Math.PI*tx,i=-rx*e*Math.exp(-nx*r*n)*Math.cos(r*n),o=1-In(t,ix);return{alpha:Zd+(1-Zd)*(1-o),dy:i,blur:o*e*ox,scaleY:1+.12*o}},lx=150,ux=.072,Jd=.029,dx="#5AA9FF",fx="#FFA14A",hx=.75,px=(t,e)=>{const n=1-In(t,lx);return e*(Jd+(ux-Jd)*n)},Qd=(t,e)=>t==="punch"?.8+.28*In(e,160):t==="slam"?.55+.45*In(e,220):1,mx="https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@v2.047/png/128",gx=t=>{const e=Array.from(t).map(n=>n.codePointAt(0)??0).filter(n=>n!==65039&&n>0);return e.length?`emoji_u${e.map(n=>n.toString(16)).join("_")}.png`:null},ef=t=>{if(t.emojiSrc)return t.emojiSrc;if(!t.emoji)return null;const e=gx(t.emoji);return e?`${mx}/${e}`:null},yx=/^#[0-9a-fA-F]{6}$/,_x=J({text:ae().min(1),start:P().finite().nonnegative(),end:P().finite().nonnegative(),emoji:ae().min(1).optional(),emojiSrc:ae().min(1).optional(),color:ae().regex(yx,"expected #RRGGBB").optional(),confidence:P().min(0).max(1).optional()}).refine(t=>t.end>=t.start,{message:"word end must be >= start",path:["end"]}),bx=J({id:ae().min(1),start:P().finite().nonnegative(),end:P().finite().nonnegative(),text:ae(),words:$e(_x).optional()}).refine(t=>t.end>=t.start,{message:"segment end must be >= start",path:["end"]}),vx=$e(bx);function xk(t){return vx.parse(t)}const Tk=t=>t.text??t.word??"",tf=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Ai=t=>{if(typeof t=="number")return Number.isFinite(t)?t:void 0;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)?e:void 0}},kr=t=>typeof t=="string"&&t.trim()!==""?t:void 0;function Ek(t){if(!tf(t))return null;const e=(kr(t.text)??kr(t.word))?.trim(),n=Ai(t.start??t.startTime),r=Ai(t.end??t.endTime);if(!e||n===void 0||r===void 0)return null;const i=Math.max(0,n),o=Math.max(0,r);if(o<i)return null;const s={text:e,start:i,end:o},a=kr(t.emoji);a&&(s.emoji=a);const l=kr(t.emojiSrc);l&&(s.emojiSrc=l),typeof t.color=="string"&&yx.test(t.color)&&(s.color=t.color);const c=Ai(t.confidence);return c!==void 0&&c>=0&&c<=1&&(s.confidence=c),s}function Sk(t,e){if(!tf(t))return null;const n=Array.isArray(t.words)?t.words.map(Ek).filter(l=>l!==null).sort((l,c)=>l.start-c.start):[];let r=Ai(t.start??t.startTime),i=Ai(t.end??t.endTime);if(r===void 0&&n.length&&(r=n[0].start),i===void 0&&n.length&&(i=n.reduce((l,c)=>Math.max(l,c.end),0)),r===void 0||i===void 0||(r=Math.max(0,r),i=Math.max(0,i),i<r))return null;const o=kr(t.text)?.trim()??n.map(l=>l.text).join(" ").trim();if(!o&&!n.length)return null;const a={id:(kr(t.id)??(typeof t.id=="number"?String(t.id):""))||`caption_${e}`,start:r,end:i,text:o};return n.length&&(a.words=n),a}function wk(t){return(Array.isArray(t)?t:tf(t)&&Array.isArray(t.segments)?t.segments:[]).map((n,r)=>Sk(n,r)).filter(n=>n!==null).sort((n,r)=>n.start-r.start)}const xx=.35,Tx=1e-6;function Ak(t,e={}){const n=e.segmentGapSec??xx,r=e.maxWords&&e.maxWords>0?Math.floor(e.maxWords):1/0,i=e.maxDurationSec&&e.maxDurationSec>0?e.maxDurationSec:1/0,o=e.idPrefix??"caption",s=[...t].sort((u,f)=>u.start-f.start),a=[];let l=[];const c=()=>{l.length&&(a.push({id:`${o}_${a.length}`,start:l[0].start,end:l.reduce((u,f)=>Math.max(u,f.end),l[0].end),text:l.map(u=>u.text).join(" "),words:l}),l=[])};for(const u of s){if(l.length){const f=l.reduce((m,p)=>Math.max(m,p.end),0),d=u.start-f,h=u.end-l[0].start;(d>=n-Tx||l.length>=r||h>i+Tx)&&c()}l.push(u)}return c(),a}const Ok=/^(?:(\d+):)?(\d{1,2}):(\d{2})[.,](\d{1,3})$/,Ex=/^\s*(\S+)\s+-->\s+(\S+)/,Sx=/<((?:\d+:)?\d{1,2}:\d{2}[.,]\d{1,3})>/g;function Zo(t){const e=Ok.exec(t.trim());if(!e)return null;const n=e[1]?Number(e[1]):0,r=Number(e[2]),i=Number(e[3]),o=Number(e[4].padEnd(3,"0"));return r>59||i>59?null:n*3600+r*60+i+o/1e3}const Mk={"&amp;":"&","&lt;":"<","&gt;":">","&nbsp;":" ","&quot;":'"',"&#39;":"'"};function wx(t){return t.replace(/<[^>]*>/g,"").replace(/&(?:amp|lt|gt|nbsp|quot|#39);/g,e=>Mk[e]??e).replace(/\s+/g," ").trim()}function nf(t,e,n){const r=t.split(/\s+/).filter(Boolean);if(!r.length)return[];const i=Math.max(0,e),o=Math.max(i,n),s=r.reduce((u,f)=>u+f.length,0),a=o-i,l=[];let c=i;return r.forEach((u,f)=>{const h=f===r.length-1?o:c+a*u.length/s;l.push({text:u,start:c,end:h}),c=h}),l}function Ik(t,e,n){const r=t.replace(/\r?\n/g," "),i=[];let o=0,s=e,a;for(Sx.lastIndex=0;a=Sx.exec(r);)i.push({start:s,raw:r.slice(o,a.index)}),s=Zo(a[1])??s,o=a.index+a[0].length;if(!i.length)return null;i.push({start:s,raw:r.slice(o)});const l=[];return i.forEach((c,u)=>{const f=wx(c.raw);if(!f)return;const d=i[u+1],h=d?d.start:n;l.push(...nf(f,c.start,h))}),l.length?l:null}function Ax(t,e,n){const i=t.replace(/^\uFEFF/,"").replace(/\r\n?/g,`
1507
1507
  `).trim().split(/\n{2,}/),o=n.idPrefix??"caption",s=[];for(const a of i){const l=a.split(`
1508
- `),c=l[0]?.trim()??"";if(e&&/^(WEBVTT|NOTE|STYLE|REGION)\b/.test(c))continue;const u=l.findIndex(b=>Px.test(b));if(u===-1)continue;const f=Px.exec(l[u]);if(!f)continue;const d=ko(f[1]),h=ko(f[2]);if(d===null||h===null||h<d)continue;const p=l.slice(u+1).join(`
1509
- `);let m=e?oL(p,d,h):null;const g=m?m.map(b=>b.text).join(" "):kx(p);if(!g)continue;!m&&n.estimateWords&&(m=Of(g,d,h));const y={id:`${o}_${s.length}`,start:d,end:h,text:g};m&&m.length&&(y.words=m),s.push(y)}return s}function Fx(t,e={}){return Dx(t,!1,e)}function Bx(t,e={}){return Dx(t,!0,e)}function Ux(t){const e=t.replace(/^\uFEFF/,"").trim();if(e.startsWith("WEBVTT"))return"vtt";if(/^\d+\s*\n\s*(?:\d+:)?\d{1,2}:\d{2}[,.]\d{1,3}\s+-->/.test(e))return"srt";const n=/(\S+)\s+-->\s+(\S+)/.exec(e);return n?/\d,\d{1,3}$/.test(n[1])?"srt":"vtt":"unknown"}function sL(t,e={}){const n=Ux(t);if(n==="unknown")throw new Error("parseSubtitles: unrecognised subtitle format");return n==="vtt"?Bx(t,e):Fx(t,e)}const Cf=.5,aL=t=>t.reduce((e,n)=>Math.max(e,n.end),0);function Gx(t,e){const n=e.end-e.start;return!Number.isFinite(n)||n<=0?!1:aL(t)<=n+Cf}function cL(t,e){return e?Gx(t,e)?e.start:e.start-(e.sourceStart??0):0}function lL(t,e){return e===0?t.map(n=>({...n})):t.map(n=>({...n,start:n.start+e,end:n.end+e,...n.words&&{words:n.words.map(r=>({...r,start:r.start+e,end:r.end+e}))}}))}function uL(t,e,n){const r=[];for(const i of t){if(i.end<=e||i.start>=n)continue;const o={...i,start:Math.max(i.start,e),end:Math.min(i.end,n)};if(i.words){const s=i.words.filter(a=>a.end>e&&a.start<n).map(a=>({...a,start:Math.max(a.start,e),end:Math.min(a.end,n)}));s.length?o.words=s:delete o.words}r.push(o)}return r}const Rf={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function If(t,e,n){const r=t.find(s=>e>=s.start&&e<=s.end);if(!r)return Rf;if(!r.words?.length||n==="none")return{...Rf,segment:r};const i=ex(r.words,e,n);if(i<0)return{...Rf,segment:r};const o=r.words[i];return{segment:r,wordIndex:i,word:o,elapsedMs:Math.max(0,(e-o.start)*1e3),remainingMs:Math.max(0,(o.end-e)*1e3)}}function jx(t,e=0,n){if(!t.length)return!1;const r=typeof n=="number"&&n>e?n-e:null;return r==null?e>0:t.reduce((o,s)=>Math.max(o,Number(s.end)||0),0)<=r+Cf}const Mf=(t,e,n=0)=>e?t-(Number(n)||0):t,Lf=.5,vn=(t,e,n)=>({styleKind:t,alpha:e,scale:n,dy:0,blurX:0,blurY:0});function Hx(t,e,n,r,i){const o=e?"active":"inactive";switch(t){case"wordbox":return vn("base",1,1);case"punch":return vn(o,1,e?Sf("punch",n):1);case"slam":return vn("base",1,e?Sf("slam",n):1);case"glowpop":{const s=ux(n,r,i);return{...vn("base",s.alpha,s.scale),blurX:s.blur,glowPop:s}}case"springpop":{const s=_x(n,i);return{styleKind:"base",alpha:s.alpha,scale:{x:1,y:s.scaleY},dy:s.dy,blurX:0,blurY:s.blur,springPop:s,split:Sx(n,i)}}case"glow":return vn(o,e?1:.5,e?No("glow"):1);case"boxed":return vn(o,e?1:.7,1);case"vhs":return vn(o,e?1:.6,1);default:return vn(o,e?1:.55,e?No("pop"):1)}}const Yx=t=>t==="wordbox"||t==="punch"||t==="slam"||t==="glowpop"||t==="springpop";function Xx(t,e,n){const r=e;if(t==="wordbox"||t==="punch"){const i=$b(r,n),o=n>=0?Math.max(0,n-i.length+1):0;return{words:i,offset:o}}if(t==="slam"||t==="glowpop"||t==="springpop"){const i=n>=0?r[n]:void 0;return{words:i?[i]:[],offset:n}}return{words:r,offset:0}}const Pf=t=>Math.max(0,Math.min(255,Math.round(t))),Wx=(t,e,n)=>Pf(t)<<16|Pf(e)<<8|Pf(n);function zx(t){if(!t)return null;const e=t.trim().toLowerCase();if(e==="transparent")return{color:0,alpha:0};const n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(e);if(n){let i=n[1];i.length<=4&&(i=[...i].map(c=>c+c).join(""));const o=parseInt(i.slice(0,2),16),s=parseInt(i.slice(2,4),16),a=parseInt(i.slice(4,6),16),l=i.length===8?parseInt(i.slice(6,8),16)/255:1;return{color:Wx(o,s,a),alpha:l}}const r=/^rgba?\(\s*([^)]+)\)$/.exec(e);if(r){const i=r[1].split(/[\s,/]+/).filter(Boolean);if(i.length<3)return null;const o=u=>u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u),[s,a,l]=[o(i[0]),o(i[1]),o(i[2])];if([s,a,l].some(u=>!Number.isFinite(u)))return null;let c=1;return i[3]!==void 0&&(c=i[3].endsWith("%")?parseFloat(i[3])/100:parseFloat(i[3]),!Number.isFinite(c))?null:{color:Wx(s,a,l),alpha:Math.max(0,Math.min(1,c))}}return null}const pi=12,qx={color:0,alpha:.75},Vx=t=>t==="social-glass"?12:t==="business-boxed"?4:6;function Kx(t,e,n,r){const i=zx(n),o=i&&i.alpha>0?i:qx;return{x:-t/2-pi,y:-e/2-pi,width:t+pi*2,height:e+pi*2,radius:Vx(r),color:o.color,alpha:o.alpha}}const Zx=120;function $x(t,e,n,r,i){const o=xn(r,Zx),s=t.width*o,a=t.height*o,l=-e/2+t.x+(t.width-s)/2,c=-n/2+t.y+(t.height-a)/2;return{x:l-i*.16,y:c-i*.12,width:s+i*.32,height:a+i*.24,radius:i*.16}}const Jx=.001;function Qx(t){const e=lr(typeof t=="object"?t?.name??"NONE":t??"NONE")||"NONE";if(e==="NONE"||$r.has(e)||typeof E>"u"||!E.effects?.[e])return null;const n=(typeof t=="object"?t?.duration:void 0)??Dt.DEFAULT_DURATION_MS;return Math.max(n/1e3,0)}function fL(t){return!Array.isArray(t)||t.length===0?t:t.map(e=>{if(e==null||typeof e.start!="number")return e;let n=null;for(const s of t)s===e||s==null||typeof s.end!="number"||s.end<=e.start+Jx&&(n==null||s.end>(n.end??-1/0))&&(n=s);if(n==null||Math.abs((n.end??0)-e.start)>Jx||Qx(n.transformation?.animationOut)==null)return e;const r=Qx(e.transformation?.animationIn);if(r==null||r<=0)return e;const i=Math.max((e.end??e.start)-e.start,0),o=Math.min(Dt.ENTRANCE_OVERLAP_SEC,r,i);return o<=0?e:{...e,transformation:{...e.transformation,entranceOverlapSec:o}}})}let Rt={pending:new Set,ready:new Set};const Nf=new Set,Do=t=>{Rt=t,Nf.forEach(e=>e())},dL=5e3,mi=new Map;function Fo(t){const e=mi.get(t);e&&(clearTimeout(e),mi.delete(t))}function hL(t){Fo(t),mi.set(t,setTimeout(()=>{mi.delete(t),Rt.pending.has(t)&&(console.warn(`[videoReadiness] timed out waiting for ${t} — releasing play gate`),Bo(t))},dL))}function ev(t){if(!t)return;const e=new Set(Rt.pending),n=new Set(Rt.ready);n.delete(t),e.add(t),Do({pending:e,ready:n}),hL(t)}function Bo(t){if(!t||(Fo(t),!Rt.pending.has(t)&&Rt.ready.has(t)))return;const e=new Set(Rt.pending);e.delete(t),Do({pending:e,ready:new Set([...Rt.ready,t])})}function tv(t){if(!t)return;Fo(t);const e=new Set(Rt.pending),n=new Set(Rt.ready);e.delete(t),n.delete(t),Do({pending:e,ready:n})}function pL(){for(const t of[...mi.keys()])Fo(t);Do({pending:new Set,ready:new Set})}const mL=t=>(Nf.add(t),()=>Nf.delete(t)),gL=()=>Rt.pending.size===0;function yL(){return S.useSyncExternalStore(mL,gL,()=>!0)}const nv=Ja(),rv=nv.acquire,iv=nv.release,kf=t=>(t??"").split(":")[0].trim().toLowerCase(),gi=t=>{const e=(t??"").trim();return e?e.includes(":")?e.replace(/\s*([:,])\s*/g,"$1"):`${e}:400,700`:"Inter:400,700"},yi=t=>(gi(t).split(":")[1]??"").split(",").map(n=>n.trim()).filter(Boolean),ov=(t,e)=>{const n=kf(t),r=yi(t),i=new Set(e.filter(o=>kf(o)===n).flatMap(yi));return r.every(o=>i.has(o))},sv=t=>(t??"").split(":")[0].trim(),av=t=>`https://fonts.googleapis.com/css2?${t.map(n=>{const r=sv(gi(n)).replace(/ /g,"+"),i=yi(n).map(Number).filter(o=>Number.isFinite(o)).sort((o,s)=>o-s);return`family=${r}:wght@${[...new Set(i)].join(";")}`}).join("&")}&display=swap`,cv={SANS_SERIF:["Roboto","Open Sans","Lato","Montserrat","Poppins","Inter","Raleway","Nunito","Ubuntu","Work Sans","Outfit","DM Sans","Plus Jakarta Sans","Manrope","Space Grotesk"],SERIF:["Playfair Display","Merriweather","Lora","PT Serif","Crimson Text","Libre Baskerville","Cormorant","EB Garamond","Spectral"],DISPLAY:["Bebas Neue","Anton","Righteous","Abril Fatface","Fredoka One","Pacifico","Bungee","Alfa Slab One","Passion One"],MONOSPACE:["Roboto Mono","Fira Code","JetBrains Mono","Source Code Pro","IBM Plex Mono","Space Mono"],HANDWRITING:["Dancing Script","Pacifico","Indie Flower","Caveat","Permanent Marker","Satisfy"]},_L=Object.values(cv).flat(),bL=["Poppins:400,500,600,700","Inter:400,500,600,700","Roboto:400,500,700","Montserrat:400,500,600,700,800,900","Playfair Display:400,700","Bebas Neue:400","Roboto Mono:400"],lv=5e3;let Uo=[];const Df=new Map,xL=()=>Uo,vL=t=>{Uo=[...new Set([...Uo,...t.map(gi)])]},TL=()=>typeof document<"u",EL=t=>new Promise(e=>{if(document.querySelector(`link[data-reacthub-font="${t}"]`)){e();return}const r=document.createElement("link");r.rel="stylesheet",r.href=t,r.dataset.reacthubFont=t,r.onload=()=>e(),r.onerror=()=>e(),document.head.appendChild(r)}),SL=async t=>{const e=document.fonts;if(!e?.load)return;const n=t.flatMap(r=>{const i=sv(r);return yi(r).map(o=>e.load(`${o} 16px "${i}"`))});await Promise.all(n)};async function wL(t,e={}){const r=[...new Set(t.filter(Boolean).map(gi))].filter(h=>!ov(h,Uo));if(r.length===0||!TL())return{families:[]};const i=r.join("|"),o=Df.get(i);if(o)return await o,{families:r};const s=e.timeoutMs??lv;let a=!1;const c=(async()=>{await EL(av(r)),await SL(r)})(),u=new Promise(h=>setTimeout(()=>{a=!0,h()},s)),f=Promise.race([c,u]);Df.set(i,f);try{await f}finally{Df.delete(i)}vL(r);const d=a?{families:r,inactive:!0}:{families:r};return e.emit!==!1&&Ln(ke.FONTS_LOADED,d),d}const uv=2e3,AL=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF]/g,OL=t=>{let e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r>=0&&r<=8||r===11||r===12||r>=14&&r<=31||r>=127&&r<=159||(e+=t[n])}return e},CL=(t,e=uv)=>{if(t==null)return"";let n=String(t);try{n=n.normalize("NFC")}catch{}return n=OL(n.replace(AL,"")),n=n.replace(/\r\n/g,`
1508
+ `),c=l[0]?.trim()??"";if(e&&/^(WEBVTT|NOTE|STYLE|REGION)\b/.test(c))continue;const u=l.findIndex(_=>Ex.test(_));if(u===-1)continue;const f=Ex.exec(l[u]);if(!f)continue;const d=Zo(f[1]),h=Zo(f[2]);if(d===null||h===null||h<d)continue;const m=l.slice(u+1).join(`
1509
+ `);let p=e?Ik(m,d,h):null;const g=p?p.map(_=>_.text).join(" "):wx(m);if(!g)continue;!p&&n.estimateWords&&(p=nf(g,d,h));const y={id:`${o}_${s.length}`,start:d,end:h,text:g};p&&p.length&&(y.words=p),s.push(y)}return s}function Ox(t,e={}){return Ax(t,!1,e)}function Mx(t,e={}){return Ax(t,!0,e)}function Ix(t){const e=t.replace(/^\uFEFF/,"").trim();if(e.startsWith("WEBVTT"))return"vtt";if(/^\d+\s*\n\s*(?:\d+:)?\d{1,2}:\d{2}[,.]\d{1,3}\s+-->/.test(e))return"srt";const n=/(\S+)\s+-->\s+(\S+)/.exec(e);return n?/\d,\d{1,3}$/.test(n[1])?"srt":"vtt":"unknown"}function Ck(t,e={}){const n=Ix(t);if(n==="unknown")throw new Error("parseSubtitles: unrecognised subtitle format");return n==="vtt"?Mx(t,e):Ox(t,e)}const rf=.5,Rk=t=>t.reduce((e,n)=>Math.max(e,n.end),0);function Cx(t,e){const n=e.end-e.start;return!Number.isFinite(n)||n<=0?!1:Rk(t)<=n+rf}function Lk(t,e){return e?Cx(t,e)?e.start:e.start-(e.sourceStart??0):0}function kk(t,e){return e===0?t.map(n=>({...n})):t.map(n=>({...n,start:n.start+e,end:n.end+e,...n.words&&{words:n.words.map(r=>({...r,start:r.start+e,end:r.end+e}))}}))}function Pk(t,e,n){const r=[];for(const i of t){if(i.end<=e||i.start>=n)continue;const o={...i,start:Math.max(i.start,e),end:Math.min(i.end,n)};if(i.words){const s=i.words.filter(a=>a.end>e&&a.start<n).map(a=>({...a,start:Math.max(a.start,e),end:Math.min(a.end,n)}));s.length?o.words=s:delete o.words}r.push(o)}return r}const of={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function sf(t,e,n){const r=t.find(s=>e>=s.start&&e<=s.end);if(!r)return of;if(!r.words?.length||n==="none")return{...of,segment:r};const i=Wv(r.words,e,n);if(i<0)return{...of,segment:r};const o=r.words[i];return{segment:r,wordIndex:i,word:o,elapsedMs:Math.max(0,(e-o.start)*1e3),remainingMs:Math.max(0,(o.end-e)*1e3)}}function Rx(t,e=0,n){if(!t.length)return!1;const r=typeof n=="number"&&n>e?n-e:null;return r==null?e>0:t.reduce((o,s)=>Math.max(o,Number(s.end)||0),0)<=r+rf}const af=(t,e,n=0)=>e?t-(Number(n)||0):t,cf=.5,Cn=(t,e,n)=>({styleKind:t,alpha:e,scale:n,dy:0,blurX:0,blurY:0});function Lx(t,e,n,r,i){const o=e?"active":"inactive";switch(t){case"wordbox":return Cn("base",1,1);case"punch":return Cn(o,1,e?Qd("punch",n):1);case"slam":return Cn("base",1,e?Qd("slam",n):1);case"glowpop":{const s=ex(n,r,i);return{...Cn("base",s.alpha,s.scale),blurX:s.blur,glowPop:s}}case"springpop":{const s=cx(n,i);return{styleKind:"base",alpha:s.alpha,scale:{x:1,y:s.scaleY},dy:s.dy,blurX:0,blurY:s.blur,springPop:s,split:px(n,i)}}case"glow":return Cn(o,e?1:.5,e?$o("glow"):1);case"boxed":return Cn(o,e?1:.7,1);case"vhs":return Cn(o,e?1:.6,1);default:return Cn(o,e?1:.55,e?$o("pop"):1)}}const kx=t=>t==="wordbox"||t==="punch"||t==="slam"||t==="glowpop"||t==="springpop";function Px(t,e,n){const r=e;if(t==="wordbox"||t==="punch"){const i=jv(r,n),o=n>=0?Math.max(0,n-i.length+1):0;return{words:i,offset:o}}if(t==="slam"||t==="glowpop"||t==="springpop"){const i=n>=0?r[n]:void 0;return{words:i?[i]:[],offset:n}}return{words:r,offset:0}}const lf=t=>Math.max(0,Math.min(255,Math.round(t))),Dx=(t,e,n)=>lf(t)<<16|lf(e)<<8|lf(n);function Nx(t){if(!t)return null;const e=t.trim().toLowerCase();if(e==="transparent")return{color:0,alpha:0};const n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(e);if(n){let i=n[1];i.length<=4&&(i=[...i].map(c=>c+c).join(""));const o=parseInt(i.slice(0,2),16),s=parseInt(i.slice(2,4),16),a=parseInt(i.slice(4,6),16),l=i.length===8?parseInt(i.slice(6,8),16)/255:1;return{color:Dx(o,s,a),alpha:l}}const r=/^rgba?\(\s*([^)]+)\)$/.exec(e);if(r){const i=r[1].split(/[\s,/]+/).filter(Boolean);if(i.length<3)return null;const o=u=>u.endsWith("%")?parseFloat(u)/100*255:parseFloat(u),[s,a,l]=[o(i[0]),o(i[1]),o(i[2])];if([s,a,l].some(u=>!Number.isFinite(u)))return null;let c=1;return i[3]!==void 0&&(c=i[3].endsWith("%")?parseFloat(i[3])/100:parseFloat(i[3]),!Number.isFinite(c))?null:{color:Dx(s,a,l),alpha:Math.max(0,Math.min(1,c))}}return null}const Oi=12,Fx={color:0,alpha:.75},Bx=t=>t==="social-glass"?12:t==="business-boxed"?4:6;function Ux(t,e,n,r){const i=Nx(n),o=i&&i.alpha>0?i:Fx;return{x:-t/2-Oi,y:-e/2-Oi,width:t+Oi*2,height:e+Oi*2,radius:Bx(r),color:o.color,alpha:o.alpha}}const Gx=120;function jx(t,e,n,r,i){const o=In(r,Gx),s=t.width*o,a=t.height*o,l=-e/2+t.x+(t.width-s)/2,c=-n/2+t.y+(t.height-a)/2;return{x:l-i*.16,y:c-i*.12,width:s+i*.32,height:a+i*.24,radius:i*.16}}const Hx=.001;function Yx(t){const e=vr(typeof t=="object"?t?.name??"NONE":t??"NONE")||"NONE";if(e==="NONE"||ui.has(e)||typeof S>"u"||!S.effects?.[e])return null;const n=(typeof t=="object"?t?.duration:void 0)??Yt.DEFAULT_DURATION_MS;return Math.max(n/1e3,0)}function Dk(t){return!Array.isArray(t)||t.length===0?t:t.map(e=>{if(e==null||typeof e.start!="number")return e;let n=null;for(const s of t)s===e||s==null||typeof s.end!="number"||s.end<=e.start+Hx&&(n==null||s.end>(n.end??-1/0))&&(n=s);if(n==null||Math.abs((n.end??0)-e.start)>Hx||Yx(n.transformation?.animationOut)==null)return e;const r=Yx(e.transformation?.animationIn);if(r==null||r<=0)return e;const i=Math.max((e.end??e.start)-e.start,0),o=Math.min(Yt.ENTRANCE_OVERLAP_SEC,r,i);return o<=0?e:{...e,transformation:{...e.transformation,entranceOverlapSec:o}}})}let Ft={pending:new Set,ready:new Set};const uf=new Set,Jo=t=>{Ft=t,uf.forEach(e=>e())},Nk=5e3,Mi=new Map;function Qo(t){const e=Mi.get(t);e&&(clearTimeout(e),Mi.delete(t))}function Fk(t){Qo(t),Mi.set(t,setTimeout(()=>{Mi.delete(t),Ft.pending.has(t)&&(console.warn(`[videoReadiness] timed out waiting for ${t} — releasing play gate`),es(t))},Nk))}function Wx(t){if(!t)return;const e=new Set(Ft.pending),n=new Set(Ft.ready);n.delete(t),e.add(t),Jo({pending:e,ready:n}),Fk(t)}function es(t){if(!t||(Qo(t),!Ft.pending.has(t)&&Ft.ready.has(t)))return;const e=new Set(Ft.pending);e.delete(t),Jo({pending:e,ready:new Set([...Ft.ready,t])})}function Xx(t){if(!t)return;Qo(t);const e=new Set(Ft.pending),n=new Set(Ft.ready);e.delete(t),n.delete(t),Jo({pending:e,ready:n})}function Bk(){for(const t of[...Mi.keys()])Qo(t);Jo({pending:new Set,ready:new Set})}const Uk=t=>(uf.add(t),()=>uf.delete(t)),Gk=()=>Ft.pending.size===0;function jk(){return O.useSyncExternalStore(Uk,Gk,()=>!0)}const zx=xc(),qx=zx.acquire,Vx=zx.release,df=t=>(t??"").split(":")[0].trim().toLowerCase(),Ii=t=>{const e=(t??"").trim();return e?e.includes(":")?e.replace(/\s*([:,])\s*/g,"$1"):`${e}:400,700`:"Inter:400,700"},Ci=t=>(Ii(t).split(":")[1]??"").split(",").map(n=>n.trim()).filter(Boolean),Kx=(t,e)=>{const n=df(t),r=Ci(t),i=new Set(e.filter(o=>df(o)===n).flatMap(Ci));return r.every(o=>i.has(o))},$x=t=>(t??"").split(":")[0].trim(),Zx=t=>`https://fonts.googleapis.com/css2?${t.map(n=>{const r=$x(Ii(n)).replace(/ /g,"+"),i=Ci(n).map(Number).filter(o=>Number.isFinite(o)).sort((o,s)=>o-s);return`family=${r}:wght@${[...new Set(i)].join(";")}`}).join("&")}&display=swap`,Jx={SANS_SERIF:["Roboto","Open Sans","Lato","Montserrat","Poppins","Inter","Raleway","Nunito","Ubuntu","Work Sans","Outfit","DM Sans","Plus Jakarta Sans","Manrope","Space Grotesk"],SERIF:["Playfair Display","Merriweather","Lora","PT Serif","Crimson Text","Libre Baskerville","Cormorant","EB Garamond","Spectral"],DISPLAY:["Bebas Neue","Anton","Righteous","Abril Fatface","Fredoka One","Pacifico","Bungee","Alfa Slab One","Passion One"],MONOSPACE:["Roboto Mono","Fira Code","JetBrains Mono","Source Code Pro","IBM Plex Mono","Space Mono"],HANDWRITING:["Dancing Script","Pacifico","Indie Flower","Caveat","Permanent Marker","Satisfy"]},Hk=Object.values(Jx).flat(),Yk=["Poppins:400,500,600,700","Inter:400,500,600,700","Roboto:400,500,700","Montserrat:400,500,600,700,800,900","Playfair Display:400,700","Bebas Neue:400","Roboto Mono:400"],Qx=5e3;let ts=[];const ff=new Map,Wk=()=>ts,Xk=t=>{ts=[...new Set([...ts,...t.map(Ii)])]},zk=()=>typeof document<"u",qk=t=>new Promise(e=>{if(document.querySelector(`link[data-reacthub-font="${t}"]`)){e();return}const r=document.createElement("link");r.rel="stylesheet",r.href=t,r.dataset.reacthubFont=t,r.onload=()=>e(),r.onerror=()=>e(),document.head.appendChild(r)}),Vk=async t=>{const e=document.fonts;if(!e?.load)return;const n=t.flatMap(r=>{const i=$x(r);return Ci(r).map(o=>e.load(`${o} 16px "${i}"`))});await Promise.all(n)};async function Kk(t,e={}){const r=[...new Set(t.filter(Boolean).map(Ii))].filter(h=>!Kx(h,ts));if(r.length===0||!zk())return{families:[]};const i=r.join("|"),o=ff.get(i);if(o)return await o,{families:r};const s=e.timeoutMs??Qx;let a=!1;const c=(async()=>{await qk(Zx(r)),await Vk(r)})(),u=new Promise(h=>setTimeout(()=>{a=!0,h()},s)),f=Promise.race([c,u]);ff.set(i,f);try{await f}finally{ff.delete(i)}Xk(r);const d=a?{families:r,inactive:!0}:{families:r};return e.emit!==!1&&Hn(Ne.FONTS_LOADED,d),d}const e1=2e3,$k=/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF]/g,Zk=t=>{let e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r>=0&&r<=8||r===11||r===12||r>=14&&r<=31||r>=127&&r<=159||(e+=t[n])}return e},Jk=(t,e=e1)=>{if(t==null)return"";let n=String(t);try{n=n.normalize("NFC")}catch{}return n=Zk(n.replace($k,"")),n=n.replace(/\r\n/g,`
1510
1510
  `).replace(/\r/g,`
1511
1511
  `).replace(/[^\S\n]+/g," ").replace(/\n{3,}/g,`
1512
1512
 
1513
- `).trim(),n.length>e&&(n=n.slice(0,e).trimEnd()),n};function Ff(t,e,n){if(n<=0)return Xn(t);if(n>=1)return Xn(e);const r=Math.min(t.vertices.length,e.vertices.length,t.inTangents.length,e.inTangents.length,t.outTangents.length,e.outTangents.length),i=new Array(r),o=new Array(r),s=new Array(r);for(let a=0;a<r;a++)i[a]=Bf(t.vertices[a],e.vertices[a],n),o[a]=Bf(t.inTangents[a],e.inTangents[a],n),s[a]=Bf(t.outTangents[a],e.outTangents[a],n);return{vertices:i,inTangents:o,outTangents:s,closed:n<.5?t.closed:e.closed}}function Bf(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Xn(t){return{vertices:t.vertices.map(e=>[e[0],e[1]]),inTangents:t.inTangents.map(e=>[e[0],e[1]]),outTangents:t.outTangents.map(e=>[e[0],e[1]]),closed:t.closed}}function Wn(t){let e=t.replace(/^#/,"");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const n=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,i=parseInt(e.substring(4,6),16)/255,o=e.length===8?parseInt(e.substring(6,8),16)/255:1;return{r:n,g:r,b:i,a:o}}function _i(t){const e=r=>Math.max(0,Math.min(255,Math.round(r*255))).toString(16).padStart(2,"0"),n=`#${e(t.r)}${e(t.g)}${e(t.b)}`;return t.a<1?`${n}${e(t.a)}`:n}function RL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&typeof e.v=="string"}function fv(t,e,n){const r=E.timeline({paused:!0}),i={r:0,g:0,b:0,a:1};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!RL(t))return Object.assign(i,Wn(t)),{timeline:r,hasAnimation:!1,target:i};const o=t,s=a=>(a-n)/e;Object.assign(i,Wn(o[0].v)),r.set(i,Wn(o[0].v),s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u,d=Wn(c.v);if(l.hold){r.set(i,d,s(c.t));continue}r.to(i,{r:d.r,g:d.g,b:d.b,a:d.a,duration:f,ease:Bn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function IL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function dv(t,e){if(e<=0)return 0;if(e>=1)return 1;const[n,r,i,o]=t;let s=e;for(let l=0;l<8;l++){const c=1-s,u=3*c*c*s*n+3*c*s*s*i+s*s*s,f=3*c*c*n+6*c*s*(i-n)+3*s*s*(1-i);if(Math.abs(f)<1e-9)break;s-=(u-e)/f,s<0&&(s=0),s>1&&(s=1)}const a=1-s;return 3*a*a*s*r+3*a*s*s*o+s*s*s}function Tr(t,e,n,r){if(t===void 0)return e;if(!IL(t))return t;const i=t;if(i.length===0)return e;if(n<=i[0].t)return i[0].v;if(n>=i[i.length-1].t)return i[i.length-1].v;for(let o=0;o<i.length-1;o++){const s=i[o],a=i[o+1];if(n>=s.t&&n<=a.t){if(s.hold)return s.v;const l=a.t-s.t,c=l>0?(n-s.t)/l:0,u=s.easeOut?dv(s.easeOut,c):c;return r(s.v,a.v,u)}}return i[i.length-1].v}const hv=(t,e,n)=>t+(e-t)*n,pv=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n],ML=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ge(t,e,n){return Tr(t,e,n,hv)}function sn(t,e,n){return Tr(t,e,n,pv)}function Go(t,e,n){return Tr(t,e,n,ML)}const mv=(t,e,n)=>{const r=Wn(t),i=Wn(e);return _i({r:r.r+(i.r-r.r)*n,g:r.g+(i.g-r.g)*n,b:r.b+(i.b-r.b)*n,a:r.a+(i.a-r.a)*n})};function xt(t,e,n){return Tr(t,e,n,mv)}function Uf(t,e,n){return Tr(t,e,n,Ff)}function LL(t,e){const n=t.source;if(typeof n=="string")return n;if(!Array.isArray(n)||n.length===0)return"";let r=n[0].v;for(const i of n)if(i.t<=e)r=i.v;else break;return r}function PL(t,e,n,r,i,o){return{text:t,font:e.font??n.style.font,size:e.size!=null?ge(e.size,i,r):i,weight:e.weight??n.style.weight,italic:e.italic??n.style.italic,fill:e.fill!=null?xt(e.fill,o,r):o,tracking:e.tracking!=null?ge(e.tracking,0,r):void 0,baselineShift:e.baselineShift!=null?ge(e.baselineShift,0,r):void 0}}function jo(t,e,n={}){const r=oi(),i=yf(t),o=LL(t,e),s=ge(t.style.size,24,e),a=t.style.fill?xt(Yn(t.style.fill,n.theme),"#ffffff",e):"#ffffff",l=t.style.tracking?ge(t.style.tracking,0,e):t.style.letterSpacing?ge(t.style.letterSpacing,0,e):void 0,c=t.style.leading?ge(t.style.leading,0,e):t.style.lineHeight?ge(t.style.lineHeight,0,e):void 0,u=t.style.align??"left",f=n.boxWidth,d=n.metrics,h=I.useMemo(()=>{const m=Array.from(o),g=[];for(const y of i){const b=m.slice(y.from,y.to).join("");g.push(PL(b,y,t,e,s,a))}return{runs:g,align:u,tracking:l,leading:c,box:f!=null?{width:f}:void 0,metrics:d}},[t,i,o,s,a,u,l,c,f,d,e]),p=I.useMemo(()=>JSON.stringify({runs:h.runs,align:h.align,tracking:h.tracking,leading:h.leading,box:h.box,fontEpoch:r}),[h,r]);return I.useMemo(()=>x_(h),[p])}const gv=new Map,yv=new Map;function _v(t){if(!t)return;const e=gv.get(t);if(e)return e;let n=yv.get(t);throw n||(n=fetch(t).then(r=>{if(!r.ok)throw new Error(`useTypefaceMetrics: ${t} returned ${r.status}`);return r.json()}).then(r=>{const i=$R(r);return gv.set(t,i),i}),yv.set(t,n)),n}function Fe(t,e,n){const r=t[e];return r==null?n:Array.isArray(r)&&r.length>0&&typeof r[0]=="object"?r[0].v??n:r}function bv(t){return Math.max(0,Fe(t,"blurriness",0))}const Gf={name:"gaussian-blur",build(t){return new W.BlurFilter({strength:bv(t)})},apply(t,e){t.strength=bv(e)}};function xv(t){const e=Fe(t,"distance",4),n=Fe(t,"direction",135),r=Fe(t,"softness",4),i=Fe(t,"opacity",.5),o=NL(Fe(t,"color","#000000")),s=(n-90)*Math.PI/180;return{offset:{x:e*Math.cos(s),y:e*Math.sin(s)},blur:r,color:o,alpha:i}}function NL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():0}const jf={name:"drop-shadow",build(t){return new Zn.DropShadowFilter(xv(t))},apply(t,e){const n=t,r=xv(e);n.offset=r.offset,n.blur=r.blur,n.color=r.color,n.alpha=r.alpha}};function vv(t){const e=Fe(t,"radius",10),n=Fe(t,"intensity",4),r=Fe(t,"inner-intensity",0),i=Fe(t,"opacity",1),o=kL(Fe(t,"color","#ffffff"));return{distance:e,outerStrength:n,innerStrength:r,color:o,alpha:i}}function kL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():16777215}const Hf={name:"glow",build(t){return new Zn.GlowFilter(vv(t))},apply(t,e){const n=t,r=vv(e);n.distance=r.distance,n.outerStrength=r.outerStrength,n.innerStrength=r.innerStrength,n.color=r.color,n.alpha=r.alpha}};function Tv(t){return{hue:Fe(t,"master-hue",0),saturation:Fe(t,"master-saturation",0)/100,lightness:Fe(t,"master-lightness",0)/100,colorize:!!Fe(t,"colorize",!1),alpha:1}}const Yf={name:"hue-saturation",build(t){return new Zn.HslAdjustmentFilter(Tv(t))},apply(t,e){const n=t,r=Tv(e);n.hue=r.hue,n.saturation=r.saturation,n.lightness=r.lightness,n.colorize=r.colorize}};function DL(t){const e=Fe(t,"input-black",0)/255,n=Fe(t,"input-white",255)/255,r=Fe(t,"output-black",0)/255,i=Fe(t,"output-white",255)/255,o=Math.max(1e-6,n-e),a=(i-r)/o;return{brightness:r-e*a,contrast:a}}const Xf={name:"levels",build(t){const e=new W.ColorMatrixFilter;return Ev(e,t),e},apply(t,e){Ev(t,e)}};function Ev(t,e){const{brightness:n,contrast:r}=DL(e);t.reset(),t.brightness(n,!1),t.contrast(r,!0)}function FL(t){return typeof t=="number"?t:typeof t=="string"?new W.Color(t).toNumber():16777215}function Sv(t,e){const n=FL(Fe(e,"white-tint","#ffffff")),r=Math.max(0,Math.min(1,Fe(e,"amount-to-tint",100)/100));t.reset(),t.tint(n,!0),r<1&&(t.alpha=r)}const Wf={name:"tint",build(t){const e=new W.ColorMatrixFilter;return Sv(e,t),e},apply(t,e){Sv(t,e)}};function wv(t){const e=Fe(t,"brightness",0),n=Fe(t,"contrast",0);return{brightness:1+e/100,contrast:1+n/100}}const zf={name:"brightness-contrast",build(t){return new Zn.AdjustmentFilter(wv(t))},apply(t,e){const n=t,r=wv(e);n.brightness=r.brightness,n.contrast=r.contrast}};function Av(t){return Math.max(0,Fe(t,"blur-radius",0))}const qf={name:"fast-box-blur",build(t){return new Zn.KawaseBlurFilter({strength:Av(t),quality:3})},apply(t,e){t.strength=Av(e)}},Vf=new Map([[Gf.name,Gf],[jf.name,jf],[Hf.name,Hf],[Yf.name,Yf],[Xf.name,Xf],[Wf.name,Wf],[zf.name,zf],[qf.name,qf]]),Ov=new Set;function Kf(t){const e=Vf.get(t);return!e&&!Ov.has(t)&&(Ov.add(t),console.warn(`AEP: no handler for effect '${t}' — pass-through (no filter).`)),e}function BL(t){Vf.set(t.name,t)}function UL(){return Array.from(Vf.keys())}function Cv(t){return I.useMemo(()=>{if(!("effects"in t)||!t.effects?.length)return[];const e=[];for(const n of t.effects){if(n.enabled===!1)continue;const r=Kf(n.name);r&&e.push(r.build(n.params))}return e},[t])}function Rv(t,e){const r=_t().currentFrame;return I.useEffect(()=>{if(!("effects"in t)||!t.effects?.length)return;const i=t.effects;let o=0;for(const s of i){if(s.enabled===!1)continue;const a=e[o];if(o++,!a)continue;const l=Kf(s.name);if(!l)continue;const c={};for(const[u,f]of Object.entries(s.params))c[u]=jL(f,r);l.apply(a,c)}},[t,e,r]),null}function GL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function jL(t,e){if(!GL(t))return t;const n=t[0].v;return typeof n=="number"?ge(t,0,e):typeof n=="string"?xt(t,"#000000",e):Array.isArray(n)&&n.length===2&&typeof n[0]=="number"?sn(t,[0,0],e):n}function HL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e}function Zf(t,e,n,r,i){const o=E.timeline({paused:!0});if(t===void 0)return{timeline:o,hasAnimation:!1};if(!HL(t))return r[i]=t,o.set(r,{[i]:t},0),{timeline:o,hasAnimation:!1};const s=t,a=l=>(l-n)/e;o.set(r,{[i]:s[0].v},a(s[0].t));for(let l=0;l<s.length-1;l++){const c=s[l],u=s[l+1],f=a(c.t),d=a(u.t)-f;if(c.hold){o.set(r,{[i]:u.v},a(u.t));continue}o.to(r,{[i]:u.v,duration:d,ease:Bn(c.easeOut)},f)}return{timeline:o,hasAnimation:!0}}function YL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const l={v:0},{timeline:c,hasAnimation:u}=Zf(t,e,n,l,"v");if(!u){s.current(l.v);return}c.eventCallback("onUpdate",()=>{s.current(l.v)}),s.current(l.v);const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(c,f);const h=a.time()-f;c.seek(Math.max(0,Math.min(c.duration(),h)),!1)});return()=>{a.remove(c),c.kill(),d.revert()}},[t,e,n,o])}function XL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=fv(t,e,n);if(!c){s.current(_i(u));return}l.eventCallback("onUpdate",()=>{s.current(_i(u))}),s.current(_i(u));const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function WL(t){if(!t||!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e&&typeof e.v?.vertices<"u"}function Iv(t,e,n,r){const i=E.timeline({paused:!0});if(!t)return{timeline:i,hasAnimation:!1,initial:{vertices:[],inTangents:[],outTangents:[],closed:!1}};if(!WL(t)){const l=Xn(t);return{timeline:i,hasAnimation:!1,initial:l}}const o=t,s=l=>(l-n)/e,a=Xn(o[0].v);i.call(()=>r(Xn(o[0].v)),[],s(o[0].t));for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){i.call(()=>r(Xn(u.v)),[],s(u.t));continue}const h={t:0};i.to(h,{t:1,duration:d,ease:Bn(c.easeOut),onUpdate:()=>{r(Ff(c.v,u.v,h.t))}},f)}return{timeline:i,hasAnimation:!0,initial:a}}function zL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,initial:u}=Iv(t,e,n,h=>s.current(h));if(s.current(u),!c)return;const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function qL(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&Array.isArray(e.v)}function Mv(t,e,n){const r=E.timeline({paused:!0}),i={x:0,y:0};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!qL(t)){const[a,l]=t;return i.x=a,i.y=l,{timeline:r,hasAnimation:!1,target:i}}const o=t,s=a=>(a-n)/e;i.x=o[0].v[0],i.y=o[0].v[1],r.set(i,{x:o[0].v[0],y:o[0].v[1]},s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u;if(l.hold){r.set(i,{x:c.v[0],y:c.v[1]},s(c.t));continue}r.to(i,{x:c.v[0],y:c.v[1],duration:f,ease:Bn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function VL(t,e,n,r){const{tl:i}=I.useContext(Ye),o=Jt(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=Mv(t,e,n);if(!c){s.current(u.x,u.y);return}l.eventCallback("onUpdate",()=>{s.current(u.x,u.y)}),s.current(u.x,u.y);const f=o?o.framesToSeconds(n):n/e,d=E.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function KL(t,e,n,r){return Zf(t,e,n,r,"level")}const Lv=I.createContext(void 0),$f=({value:t,children:e})=>M.jsx(Lv.Provider,{value:t,children:e});function zn(){return I.useContext(Lv)}function Jf(t,e){if(!(!t&&!e))return{...t??{},...e??{}}}const Pv=I.createContext(void 0),Nv=({value:t,children:e})=>M.jsx(Pv.Provider,{value:t,children:e});function bi(t){return I.useContext(Pv)?.[t]}function ZL(t,e,n){return n?.[t]??e}function It(t,e){return t===void 0?e:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:t}function Qf(t,e){switch(t){case"square":return e>=0&&e<=1?1:0;case"ramp-up":return an(e);case"ramp-down":return an(1-e);case"triangle":return an(1-Math.abs(2*e-1));case"round":return Math.sin(Math.PI*an(e));case"smooth":{const n=an(e);return n*n*(3-2*n)}}}const an=t=>t<0?0:t>1?1:t;function ed(t,e,n){if(n===0)return[];const r=an(It(t.start,0)),i=an(It(t.end,1)),o=It(t.offset,0),s=t.shape??"ramp-up",a=Math.min(r,i),c=Math.max(r,i)-a,u=new Array(n);for(let f=0;f<n;f++){const d=(f+.5)/n+o;let h;c<=0?h=d===a?1:0:h=(d-a)/c;const m=h>=0&&h<=1?Qf(s,h):0;u[f]=m*e}return u}function $L(t,e,n){if(n.length===0)return[];const r=t.basedOn??"chars";if(r==="chars")return ed(t,e,n.length);const i=g=>r==="words"?g.wordIndex:g.lineIndex,o=new Map;for(const g of n){const y=i(g);o.has(y)||o.set(y,o.size)}const s=o.size;if(s===0)return new Array(n.length).fill(0);const a=an(It(t.start,0)),l=an(It(t.end,1)),c=It(t.offset,0),u=t.shape??"ramp-up",f=Math.min(a,l),h=Math.max(a,l)-f,p=new Array(s);for(let g=0;g<s;g++){const y=(g+.5)/s+c;let b;h<=0?b=y===f?1:0:b=(y-f)/h;const x=b>=0&&b<=1;p[g]=(x?Qf(u,b):0)*e}const m=new Array(n.length);for(let g=0;g<n.length;g++){const y=o.get(i(n[g]))??0;m[g]=p[y]}return m}function Ho(t,e,n){const r=typeof e=="number"?e:e.length,i=Array.from({length:r},()=>({position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null}));if(r===0)return i;for(let o=0;o<t.length;o++){const s=t[o],a=n&&n[o]!==void 0?n[o]:It(s.amount,1),l=typeof e=="number"?ed(s.range,a,r):$L(s.range,a,e),c=It(s.positionOffset,[0,0]),u=It(s.scaleOffset,[0,0]),f=It(s.rotationOffset,0),d=It(s.opacityOffset,0);for(let h=0;h<r;h++){const p=l[h];p!==0&&(i[h].position[0]+=c[0]*p,i[h].position[1]+=c[1]*p,i[h].scale[0]+=u[0]*p,i[h].scale[1]+=u[1]*p,i[h].rotation+=f*p,i[h].opacity+=d*p,s.fillOffset&&(i[h].fillMix={color:s.fillOffset,amount:p}))}}return i}function kv(t,e,n,r="#ffffff"){const i=t.style.fill,o=i==null?void 0:xt(Yn(i,e),r,n),s=t.style.runs,a=s==null||s.length===0?[]:s.map(l=>l.fill===void 0?void 0:xt(l.fill,r,n));return{layerHex:o,runHexes:a}}const JL=500;class QL{constructor(e=64){this.capacity=e}capacity;map=new Map;hits=0;misses=0;get(e,n){const r=this.map.get(e);if(r)return this.hits++,this.map.delete(e),this.map.set(e,r),r;this.misses++;const i=n();if(this.map.size>=this.capacity){const o=this.map.keys().next().value;o!==void 0&&this.map.delete(o)}return this.map.set(e,i),i}get hitRate(){const e=this.hits+this.misses;return e===0?0:this.hits/e}}function eP(t,e,n=""){return[t.runIndex,t.ascent|0,e,n].join("|")}function tP(t,e,n){if(n<=0)return t;if(n>=1)return e;const r=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16),s=parseInt(e.slice(1,3),16),a=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16),c=Math.round(r+(s-r)*n),u=Math.round(i+(a-i)*n),f=Math.round(o+(l-o)*n);return`#${c.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`}const td=I.memo(({layer:t,animators:e,x:n,y:r,maxGlyphs:i=JL})=>{const s=Jt()?.currentFrame??0,a=zn(),l=oi(),c=bi(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=jo(u,s,{boxWidth:t.style.boxWidth,theme:a}),d=e??t.animators??[],h=I.useMemo(()=>d.map(v=>ge(v.amount,1,s)),[d,s]),p=I.useMemo(()=>Ho(d,f.glyphs,h),[d,f.glyphs.length,h]);I.useEffect(()=>{f.glyphs.length>i&&console.warn(`PixiTextSplit: ${f.glyphs.length} glyphs exceeds ${i} cap. Animator perf will degrade.`)},[f.glyphs.length,i]);const m=I.useRef(null);m.current===null&&(m.current=new QL);const g=m.current,{layerHex:y,runHexes:b}=I.useMemo(()=>kv(t,a,s),[t,a,s]),x=f.glyphs.slice(0,i).map((v,T)=>{const w=p[T]??p[0]??{position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null};if(v.isWhitespace)return null;const C=b[v.runIndex]??y??"#ffffff",R=w.fillMix?tP(C,w.fillMix.color,w.fillMix.amount):C,A=t.style.runs?.[v.runIndex],L=A?.font??t.style.font,N=A?.size!=null?typeof A.size=="number"?A.size:A.size[0]?.v??24:typeof t.style.size=="number"?t.style.size:t.style.size[0]?.v??24,D=Gu(A?.weight??t.style.weight),F=A?.italic??t.style.italic,G=`${L}|${N}|${D??""}|${F?1:0}|${l}`,z=g.get(eP(v,R,G),()=>new W.TextStyle({fontFamily:L,fontSize:N,fill:R,fontWeight:D,fontStyle:F?"italic":"normal"})),K=1+w.opacity,se=Math.max(0,Math.min(1,K));return M.jsx("pixiText",{text:v.char,style:z,x:v.x+w.position[0],y:v.y+w.position[1],scale:{x:1+w.scale[0],y:1+w.scale[1]},rotation:w.rotation*Math.PI/180,alpha:se},v.charIndex)});return M.jsx("pixiContainer",{x:n,y:r,children:x})});td.displayName="PixiTextSplit";const xi={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function Dv({containerRef:t,segments:e,mode:n,disabled:r=!1,itemStartSec:i=0,itemEndSec:o,currentTime:s}){const{playerTimeRef:a}=S.useContext(Ye),l=typeof s=="number"&&Number.isFinite(s),[c,u]=S.useState(xi),f=S.useRef(xi),d=S.useMemo(()=>jx(e,i,o),[e,i,o]),h=S.useMemo(()=>l&&!r&&e.length?If(e,Mf(s,d,i),n):xi,[l,r,e,s,d,i,n]);return S.useEffect(()=>{const p=t.current;if(l||!p)return;if(f.current=xi,r||!e.length){u(xi),p.onRender=void 0;return}const m=Yx(n);return p.onRender=()=>{const g=a?.current??0,y=If(e,Mf(g,d,i),n),b=f.current;y.segment===b.segment&&y.wordIndex===b.wordIndex&&(!m||y.elapsedMs===b.elapsedMs&&y.remainingMs===b.remainingMs)||(f.current=y,u(y))},()=>{p.onRender=void 0}},[t,l,r,e,n,d,i,a]),l?h:c}const Fv=()=>new W.BlurFilter({strengthX:0,strengthY:0,quality:2}),nd=t=>()=>{try{t.destroy()}catch{}};function Bv(t,e,n){const r=oi(),{fontFamily:i,fontWeight:o,fontSize:s,fill:a,align:l,wordWrapWidth:c,padding:u,stroke:f,strokeWidth:d,dropShadow:h,dropShadowColor:p,dropShadowBlur:m,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b,highlightColor:x}=t,v=S.useMemo(()=>new W.TextStyle(Hu({fontFamily:i,fontSize:s,fontWeight:o,fill:a,align:l,padding:u||10,wordWrapWidth:c||500,stroke:f,strokeWidth:f!=null&&d>0?d:0,dropShadow:h,dropShadowColor:p,dropShadowBlur:m,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:b})),[r,i,s,o,a,l,c,u,f,d,h,p,m,g,y,b]),T=S.useMemo(()=>{const L=v.clone();switch(e){case"glow":L.fill=x||a||"#00FFFF",L.dropShadow={color:x||"#00FFFF",alpha:.9,angle:0,blur:12,distance:0};break;case"vhs":L.fill="#FFFFFF",L.dropShadow=void 0;break;case"boxed":L.fill=x||a||"#FFD700",L.dropShadow=void 0;break;default:L.fill=x||a||"#FFD700"}return L},[v,a,x,e]),w=S.useMemo(()=>{const L=v.clone();return L.fill=a||"#FFFFFF",L.dropShadow=e==="glow"?{color:a||"#FFFFFF",alpha:.3,angle:0,blur:3,distance:0}:void 0,L},[v,a,e]),O=S.useMemo(()=>{const L={};if(e!=="springpop")return L;for(const N of n)for(const D of N.words??[]){const F=D.color;if(F&&!L[F]){const G=v.clone();G.fill=F,L[F]=G}}return L},[n,e,v]),C=S.useMemo(()=>{if(e!=="vhs")return null;const L=N=>{const D=v.clone();return D.fill=N,D.dropShadow=void 0,D.stroke=void 0,D};return{cyan:L("#00FFFF"),magenta:L("#FF00FF")}},[v,e]),R=S.useMemo(Fv,[]),P=S.useMemo(Fv,[]),A=S.useMemo(()=>{const L=s*(e==="springpop"?gx:ox),N=new W.BlurFilter({strength:L,quality:4});return N.padding=L*6,N},[s,e]);return S.useEffect(()=>nd(R),[R]),S.useEffect(()=>nd(P),[P]),S.useEffect(()=>nd(A),[A]),{base:v,active:T,inactive:w,colour:O,vhs:C,glowPopBlur:R,springPopBlur:P,bloomBlur:A}}function Uv(t,e){const n=S.useMemo(()=>{if(!e)return[];const o=t.flatMap(s=>(s.words??[]).map(a=>wf(a)));return[...new Set(o.filter(s=>!!s))]},[t,e]),[r,i]=S.useState({});return S.useEffect(()=>{let o=!1;for(const s of n)W.Assets.load(s).then(a=>{o||i(l=>l[s]?l:{...l,[s]:a})}).catch(a=>{console.warn("[PixiCaptionsTrack] emoji load failed",s,a)});return()=>{o=!0}},[n]),r}const nP=Array.from({length:ax},(t,e)=>`bloom-${e}`),Gv=(t,e)=>xr(t.text??"",e),jv=t=>{const{segments:e,uniqueId:n,transformation:r={},style:i,visible:o=!0,disabled:s=!1,startAt:a=0,endAt:l,currentTime:c,onContainerRefReady:u,onClick:f,mouseOverSpriteRef:d}=t,{x:h=0,y:p=0,fontFamily:m="Arial",fontWeight:g="bold",fontSize:y=48,fill:b="#FFFFFF",stroke:x="#000000",strokeWidth:v=2,dropShadow:T=!0,dropShadowColor:w="#000000",dropShadowBlur:O=4,dropShadowAlpha:C=.8,dropShadowAngle:R=Math.PI/4,dropShadowDistance:P=3,wordWrapWidth:A=1536,align:L="center",padding:N=10,highlightColor:D="#FFD700",wordSpacing:F,captionStyleId:G=null,captionBgColor:z="transparent",textTransform:K="none",captionActiveWordBg:se="#FFE45E"}=r,pe=G??i??"default",X=S.useMemo(()=>Qb(pe),[pe]),he=S.useRef(null),j=Dv({containerRef:he,segments:e,mode:X,disabled:s,itemStartSec:a,itemEndSec:l,currentTime:c}),{segment:te,wordIndex:H,elapsedMs:ae,remainingMs:Z}=j,ce=Bv({fontFamily:m,fontWeight:g,fontSize:y,fill:b,align:L,wordWrapWidth:A,padding:N,stroke:x,strokeWidth:v,dropShadow:T,dropShadowColor:w,dropShadowBlur:O,dropShadowAlpha:C,dropShadowAngle:R,dropShadowDistance:P,highlightColor:D},X,e),J=Uv(e,X==="glowpop");S.useEffect(()=>{he.current&&u&&u(n,he)},[n,u]);const{words:ie,offset:xe}=S.useMemo(()=>Xx(X,te?.words??[],H),[X,te?.words,H]),Y=S.useMemo(()=>{if(!ie.length||X==="none")return null;const Me=W.CanvasTextMetrics.measureText(" ",ce.base,void 0,!1),Re=ie.map(Se=>{const Ge=W.CanvasTextMetrics.measureText(Gv(Se,K),ce.base);return{width:Ge.width,height:Ge.height}});return Jb(Re,{spaceWidth:Me.width,fontSize:y,maxLineWidth:A||1536,wordSpacing:_f(F,y),activeScale:No(X)})},[ie,ce.base,A,X,y,F,K]),De=te?.text??"",ye=o&&!!te&&!!De,$=X!=="none"&&!!te?.words?.length&&!!Y,we=S.useMemo(()=>{if(Y)return{width:Y.totalWidth+40,height:Y.totalHeight+20};if(!De)return{width:200,height:60};try{const Me=W.CanvasTextMetrics.measureText(xr(De,K),ce.base);return{width:Me.width+40,height:Me.height+20}}catch{return{width:200,height:60}}},[Y,De,ce.base,K]),me=S.useCallback(Me=>{Me.clear(),ye&&Me.rect(-we.width/2,-we.height/2,we.width,we.height).fill({color:16777215,alpha:.001})},[we,ye]),Ue=S.useCallback(Me=>{if(Me.clear(),!ye||X!=="boxed")return;const Re=Y?Y.totalWidth:we.width-40,Se=Y?Y.totalHeight:we.height-20,Ge=Kx(Re,Se,z,pe);Me.roundRect(Ge.x,Ge.y,Ge.width,Ge.height,Ge.radius).fill({color:Ge.color,alpha:Ge.alpha})},[ye,X,Y,we,z,pe]),ze=S.useCallback(Me=>{if(Me.clear(),!ye||X!=="wordbox"||!Y||H<xe)return;const Re=Y.positions[H-xe];if(!Re)return;const Se=$x(Re,Y.totalWidth,Y.totalHeight,ae,y);Me.roundRect(Se.x,Se.y,Se.width,Se.height,Se.radius).fill({color:se,alpha:1})},[ye,X,Y,H,xe,ae,y,se]),ht=S.useCallback(Me=>f?.(n,Me),[f,n]),zt=S.useCallback(()=>{d&&(d.current=!0)},[d]),ve=S.useCallback(()=>{d&&(d.current=!1)},[d]);S.useEffect(()=>()=>{d&&(d.current=!1)},[d]);const Ie=Y?-Y.totalWidth/2:0,ct=Y?-Y.totalHeight/2:0,ut=(Me,Re)=>X==="springpop"&&Re.color&&ce.colour[Re.color]?ce.colour[Re.color]:Me==="active"?ce.active:Me==="inactive"?ce.inactive:ce.base;return M.jsxs("pixiContainer",{ref:he,label:n,x:h,y:p,children:[M.jsx("pixiGraphics",{draw:me,eventMode:ye?"static":"none",cursor:"pointer",onPointerTap:ht,onPointerOver:zt,onPointerOut:ve}),M.jsx("pixiGraphics",{draw:Ue,eventMode:"none"}),M.jsx("pixiGraphics",{draw:ze,eventMode:"none"}),ye&&$&&Y&&te&&ie.map((Me,Re)=>{const Se=Y.positions[Re];if(!Se)return null;const Ge=Re+xe===H,je=Hx(X,Ge,ae,Z,y),qe=Ie+Se.x+Se.width/2,it=ct+Se.y+Se.height/2+je.dy,Le=ut(je.styleKind,Me),ot=Gv(Me,K),Mt=je.blurX>Lf?(ce.glowPopBlur.strengthX=je.blurX,[ce.glowPopBlur]):je.blurY>Lf?(ce.springPopBlur.strengthY=je.blurY,[ce.springPopBlur]):void 0,Lt=X==="glowpop"?wf(Me):null,Ri=Lt?J[Lt]:void 0,Ii=je.glowPop;return M.jsxs(I.Fragment,{children:[X==="vhs"&&Ge&&ce.vhs&&M.jsxs(M.Fragment,{children:[M.jsx("pixiText",{text:ot,style:ce.vhs.cyan,x:qe+2,y:it,anchor:.5,alpha:.7,eventMode:"none"}),M.jsx("pixiText",{text:ot,style:ce.vhs.magenta,x:qe-2,y:it,anchor:.5,alpha:.7,eventMode:"none"})]}),(X==="glowpop"||X==="springpop")&&nP.map(rs=>M.jsx("pixiText",{text:ot,style:X==="springpop"?Le:ce.base,x:qe,y:it,anchor:.5,alpha:je.alpha*(X==="springpop"?yx:sx),scale:je.scale,filters:[ce.bloomBlur],eventMode:"none"},rs)),X==="springpop"&&je.split!==void 0&&[[vx,-.5],[Tx,.5]].map(([rs,rD])=>M.jsx("pixiText",{text:ot,style:Le,tint:rs,x:qe,y:it+rD*je.split,anchor:.5,alpha:je.alpha*Ex,scale:je.scale,filters:Mt,eventMode:"none"},rs)),M.jsx("pixiText",{text:ot,style:Le,x:qe,y:it,anchor:.5,alpha:je.alpha,scale:je.scale,filters:Mt,eventMode:"none"}),Ri&&Ii&&M.jsxs(M.Fragment,{children:[M.jsx("pixiSprite",{texture:Ri,x:qe,y:it-y*vf,anchor:.5,alpha:Ii.alpha*cx,scale:Ii.emojiScale*y*xf*1.1/(Ri.width||1),filters:[ce.bloomBlur],eventMode:"none"}),M.jsx("pixiSprite",{texture:Ri,x:qe,y:it-y*vf,anchor:.5,alpha:Ii.alpha,scale:Ii.emojiScale*y*xf/(Ri.width||1),eventMode:"none"})]})]},`${te.id}-word-${Re}`)}),ye&&!$&&M.jsxs(M.Fragment,{children:[X==="vhs"&&ce.vhs&&M.jsxs(M.Fragment,{children:[M.jsx("pixiText",{text:xr(De,K),style:ce.vhs.cyan,x:2,y:0,anchor:.5,alpha:.7,eventMode:"none"}),M.jsx("pixiText",{text:xr(De,K),style:ce.vhs.magenta,x:-2,y:0,anchor:.5,alpha:.7,eventMode:"none"})]}),M.jsx("pixiText",{text:xr(De,K),style:X!=="none"?ce.active:ce.base,x:0,y:0,anchor:.5,eventMode:"none"})]})]})};jv.displayName="PixiCaptionsTrack";const rP=I.memo(jv,(t,e)=>et(t,e));var rd,Hv;function iP(){if(Hv)return rd;Hv=1;var t=St(),e=function(){return t.Date.now()};return rd=e,rd}var id,Yv;function oP(){if(Yv)return id;Yv=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return id=e,id}var od,Xv;function sP(){if(Xv)return od;Xv=1;var t=oP(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return od=n,od}var sd,Wv;function aP(){if(Wv)return sd;Wv=1;var t=sP(),e=Pn(),n=co(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var f=o.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):i.test(c)?r:+c}return sd=l,sd}var ad,zv;function cP(){if(zv)return ad;zv=1;var t=Pn(),e=iP(),n=aP(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,c){var u,f,d,h,p,m,g=0,y=!1,b=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,t(c)&&(y=!!c.leading,b="maxWait"in c,d=b?i(n(c.maxWait)||0,l):d,x="trailing"in c?!!c.trailing:x);function v(N){var D=u,F=f;return u=f=void 0,g=N,h=a.apply(F,D),h}function T(N){return g=N,p=setTimeout(C,l),y?v(N):h}function w(N){var D=N-m,F=N-g,G=l-D;return b?o(G,d-F):G}function O(N){var D=N-m,F=N-g;return m===void 0||D>=l||D<0||b&&F>=d}function C(){var N=e();if(O(N))return R(N);p=setTimeout(C,w(N))}function R(N){return p=void 0,x&&u?v(N):(u=f=void 0,h)}function P(){p!==void 0&&clearTimeout(p),g=0,u=m=f=p=void 0}function A(){return p===void 0?h:R(e())}function L(){var N=e(),D=O(N);if(u=arguments,f=this,m=N,D){if(p===void 0)return T(m);if(b)return clearTimeout(p),p=setTimeout(C,l),v(m)}return p===void 0&&(p=setTimeout(C,l)),h}return L.cancel=P,L.flush=A,L}return ad=s,ad}var lP=cP();const cd=Jn(lP),Yo=(t,e,n,r)=>{const i=S.useCallback(cd(t,r),[t,r]),o=S.useCallback(cd(e,r),[e,r]),s=S.useCallback(cd(n,r),[n,r]),a=S.useCallback(()=>{i()},[i]),l=S.useCallback(()=>{o()},[o]),c=S.useCallback(()=>{s()},[s]);return{onPointerOver:a,onPointerDown:l,onPointerOut:c}},uP=new Set(["mp4","m4v","webm","ogg","ogv"]);function fP(t){const e=t.split("?")[0].split("#")[0],n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()}function qv({src:t,uniqueId:e,frameStartAt:n,fps:r=0,isRemotion:i=!1}){const[o,s]=S.useState(!1),[a,l]=S.useState(null),[c,u]=S.useState(null),[f,d]=S.useState(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(!1),g=S.useRef(!1),y=S.useMemo(()=>t||"",[t]),b=S.useRef(n);return b.current=n,S.useEffect(()=>{if(m.current=!1,l(null),s(!1),u(null),d(null),!y){s(!0);return}const x=b.current===0?.001:b.current;let v=!1;const T=5e3;let w=null;const O=()=>{w&&(clearTimeout(w),w=null)},C=(P,A)=>{const L=()=>{if(!m.current)try{P.update?.()}catch{}};A.addEventListener("seeked",L,{once:!0}),A.addEventListener("loadeddata",L,{once:!0}),L(),A.readyState>=HTMLMediaElement.HAVE_METADATA&&A.play().then(()=>{if(!m.current){try{A.pause(),A.currentTime=x}catch{}L()}}).catch(()=>{L()})},R=(P,A)=>{P.autoUpdate=!1,A.muted=!0,A.loop=!1,A.playsInline=!0,A.id=e;try{A.pause()}catch{}try{A.currentTime=x}catch{}p.current=A,d(A),C(P,A)};if(uP.has(fP(y))){g.current=!1,rv(y),v=!0;let P=!1;w=setTimeout(()=>{m.current||(P=!0,console.warn("[useVideoTexture] Assets.load timed out",y),l(new Error(`Video load timed out: ${y}`)))},T),W.Assets.load({src:y,data:{autoPlay:!1,autoUpdate:!1,muted:!0,loop:!1,playsinline:!0,crossorigin:"anonymous"}}).then(A=>{if(O(),m.current||P||!A)return;const L=A.source,N=L.resource;N&&R(L,N),h.current=A,u(A),s(!0)}).catch(A=>{O(),!(m.current||P)&&(console.error("[useVideoTexture] Assets.load failed",y,A),l(A))})}else{g.current=!0;let P=!1;w=setTimeout(()=>{m.current||(P=!0,console.warn("[useVideoTexture] direct video load timed out",y),l(new Error(`Video load timed out: ${y}`)))},T);const A=document.createElement("video");A.crossOrigin="anonymous",A.preload="auto",A.src=y;const L=()=>{if(m.current||P)return;O(),D();let F;try{F=new W.VideoSource({resource:A,autoPlay:!1,autoLoad:!1,crossorigin:"anonymous",alphaMode:"no-premultiply-alpha"})}catch(z){l(z);return}const G=new W.Texture({source:F});h.current=G,u(G),R(F,A),s(!0)},N=()=>{m.current||P||(O(),D(),console.error("[useVideoTexture] direct video load failed",y,A.error),l(new Error(A.error?.message||`Browser could not decode video: ${y}`)))},D=()=>{A.removeEventListener("loadeddata",L),A.removeEventListener("error",N)};A.addEventListener("loadeddata",L,{once:!0}),A.addEventListener("error",N,{once:!0}),A.load()}return()=>{if(m.current=!0,O(),p.current){try{p.current.pause()}catch{}p.current=null}if(v&&iv(y),h.current){try{g.current&&h.current.destroy(!0)}catch{}h.current=null}u(null),d(null)}},[y,e]),{texture:c,videoElement:f,isLoaded:o,error:a}}function Vv({getVideo:t,ready:e,muted:n,playbackRate:r}){const i=S.useRef({isPlaying:!1,progress:0,isMuted:!1,isWaiting:!1,isStalled:!1});return S.useEffect(()=>{const o=t();if(!o)return;const s=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},a=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},l=()=>{i.current.isWaiting=!0,i.current.isStalled=!1},c=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},u=()=>{i.current.isWaiting=!1,i.current.isStalled=!0};return o.addEventListener("loadedmetadata",s),o.addEventListener("ended",a),o.addEventListener("loadstart",l),o.addEventListener("canplaythrough",c),o.addEventListener("stalled",u),()=>{o.removeEventListener("loadedmetadata",s),o.removeEventListener("ended",a),o.removeEventListener("loadstart",l),o.removeEventListener("canplaythrough",c),o.removeEventListener("stalled",u)}},[t,e]),S.useEffect(()=>{const o=t();o&&(o.muted=n,i.current.isMuted=n)},[t,n,e]),S.useEffect(()=>{const o=t();o&&(o.playbackRate=r||1)},[t,r,e]),i}function Kv({textureRef:t,stateRef:e,ready:n,start:r,end:i,frameStartAt:o,uniqueId:s}){const a=S.useRef(null),{tl:l}=S.useContext(Ye),c=S.useCallback(()=>t.current?.source?.resource,[t]),u=S.useCallback(()=>t.current?.source,[t]);return Ze(ke.RESUME,()=>{e.current.isPlaying=!0;const f=c();f&&a.current?.isActive()&&f.play().catch(()=>{})},[c,e]),Ze(ke.PAUSE,()=>{e.current.isPlaying=!1;try{c()?.pause()}catch{}},[c,e]),S.useEffect(()=>{if(!l?.current||!n||!t.current)return;a.current&&(a.current.kill(),a.current=null);const f=()=>{const g=c();if(g){try{g.currentTime=Number(o),u()?.update?.()}catch{}e.current.progress=0,(e.current.isPlaying||l?.current?.isActive())&&g.play().catch(()=>{})}},d=()=>{const g=c(),y=u(),b=a.current;if(!g||!y||!b)return;e.current.progress=b.progress();let x=o+b.time();const v=g.duration;Number.isFinite(v)&&v>0&&(x=Math.min(x,v-.05)),x<0&&(x=0);try{const T=g.paused?.01:.25;Math.abs(g.currentTime-x)>T&&(g.currentTime=x),y.update?.()}catch{}},h=()=>{const g=c();if(g)try{g.pause()}catch{}e.current.isPlaying=!1,a.current&&(e.current.progress=a.current.progress())},p=Number(i)-Number(r);if(p<=0||!l.current)return;const m=E.context(()=>{a.current=E.to({progress:0},{duration:p,onStart:f,onUpdate:d,onComplete:h}),l.current.add(a.current,r);const g=Math.max(l.current.time(),.01);l.current.time(g,!1)});return()=>{a.current&&(a.current.kill(),E.killTweensOf(a.current),a.current=null),m.revert()}},[l,n,r,i,o,s,t,e]),a}const dP=({ref:t,...e})=>{const{uniqueId:n,mute:r=!1,volume:i=1,speed:o=1,src:s,startAt:a,endAt:l,frameStartAt:c,visible:u,disabled:f,transformation:{x:d,y:h,width:p,height:m,colorCorrection:g={},blendMode:y,border:b,roundedCorners:x,maskShape:v,effect:T,anchor:w=.5},pointerdown:O=()=>{},pointerout:C=()=>{},pointerover:R=()=>{},fps:P=0}=e,{isRemotion:A}=S.useContext(Ye),L=S.useRef(null),N=S.useRef(null),{onPointerDown:D,onPointerOut:F,onPointerOver:G}=Yo(R,O,C,1),z=lt({colorCorrection:g,effects:{name:T}}),K=s||"",{texture:se,videoElement:pe,isLoaded:X,error:he}=qv({src:K,uniqueId:n,frameStartAt:c,fps:P,isRemotion:A});S.useEffect(()=>{N.current=se},[se]);const j=S.useCallback(()=>pe??void 0,[pe]),te=Vv({getVideo:j,ready:X,muted:r,playbackRate:o}),H=Math.max(0,Math.min(1,Number(i)||0));S.useEffect(()=>{const Z=j();Z&&(Z.volume=H)},[j,H,X]),Kv({textureRef:N,stateRef:te,ready:X,start:a,end:l,frameStartAt:c,uniqueId:n}),S.useEffect(()=>{if(n){if(!K){Bo(n);return}return ev(n),(X||he)&&Bo(n),()=>tv(n)}},[n,K,X,he]);const ae=S.useCallback(()=>{const Z=j();Z&&(Z.pause(),te.current.isPlaying=!1)},[j,te]);return Ze(ke.PAUSE,ae,[ae]),Ze(ke.SCRUBBER_CLICKED,ae,[ae]),Ze(ke.REVERSE_MODE_END,ae,[ae]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:D,pointerover:G,pointerout:F,children:X&&se&&M.jsx(Ot,{x:d,y:h,width:p,height:m,border:b,roundedCorners:x,maskShape:v,spriteRef:L,children:M.jsx("pixiSprite",{label:`sprite-${n}`,texture:se,width:p,height:m,anchor:w,x:d,y:h,ref:L,alpha:u?1:0,...y!=null&&{blendMode:y},...!f&&u&&{interactive:!0,pointerdown:O},filters:z})})})},ld=I.memo(dP,et);ld.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const hP=({ref:t,...e})=>{const[n,r]=I.useState(),i=S.useRef(null),o=S.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h,blendMode:p},pointerdown:m=()=>{},pointerout:g=()=>{},pointerover:y=()=>{},canvasImageRef:b}=e,x=b&&b?.getCanvas(),{onPointerDown:v,onPointerOut:T,onPointerOver:w}=Yo(y,m,g,1),O=lt({colorCorrection:d,effects:{name:h},blendMode:p});return at.useTick(()=>{if(i.current&&i.current.texture){const C=i.current.texture.source;C&&typeof C.update=="function"&&C.update()}}),I.useEffect(()=>{if(!ya(x)){const C=Array.isArray(x)?x[0]:x,R=W.Texture.from(C);r(R)}},[x]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:v,pointerover:w,pointerout:T,children:M.jsx("pixiContainer",{ref:o,children:n&&M.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:m},filters:O})})})},pP=({isPlaying:t,forwardRef:e,...n})=>{const r=I.useRef(null);return I.useImperativeHandle(e,()=>r.current,[r]),I.useEffect(()=>{if(r.current===null)return;const i=r.current;i[t?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[t]),M.jsx("pixiAnimatedSprite",{ref:r,...n})},mP=I.memo(pP,et),Zv=S.createContext(null),ud=()=>S.useContext(Zv),$v=({children:t,startAt:e=0,endAt:n=0,uniqueId:r,hideOnExit:i,hideOnEntry:o,hideStart:s,hideEnd:a,zIndex:l=0,entranceOverlapSec:c=0,transitionIn:u,transitionOut:f,onSequenceContainerReady:d})=>{const h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),[y,b]=S.useState("static"),x=ud(),{tl:v,totalDuration:T=0,playerTimeRef:w,registerTimeUpdateListener:O,unregisterTimeUpdateListener:C}=S.useContext(Ye);S.useLayoutEffect(()=>{if(!v?.current||!h.current)return;const D=v.current,F=h.current,G=Number.isFinite(e)?Number(e):0,z=Number.isFinite(n)?Number(n):G,K=Number.isFinite(c)&&c>0?Math.min(c,Math.max(z-G,0)):0,se=Math.max(G-K,0),pe=Number.isFinite(T)?Number(T):0,X=pe>0?Math.max(se,Math.min(z,pe)):Math.max(se,z),he=Math.max(X-se,0),j=(i||o)&&s!==void 0&&a!==void 0;let te=null,H=null,ae=!1;j&&(te=Math.max(se,Math.min(X,s)),H=Math.max(se,Math.min(X,a)),ae=te<H),g.current&&(g.current.kill(),D.remove(g.current),g.current=null);const Z=typeof w?.current=="number"?w.current:0,ce=Z>=se-.001&&Z<=X+.001?1:0;if(g.current=E.timeline(),g.current.set(F,{alpha:ce}),ae){const ie=te-se,xe=H-se;if(xe<=0)g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:he,ease:"none"});else{ie>0?(g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:ie,ease:"none"})):g.current.set(F,{alpha:0},0),g.current.to(F,{alpha:0,duration:xe-ie,ease:"none"});const Y=he-xe;Y>0?(g.current.set(F,{alpha:1},xe),g.current.to(F,{alpha:1,duration:Y,ease:"none"})):g.current.set(F,{alpha:1},xe)}}else g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:he,ease:"none"});g.current.set(F,{alpha:0}),D.add(g.current,se);const J=D.time();return D.time(J,!1),()=>{g.current&&(D.remove(g.current),g.current.progress(0).kill(),g.current=null),F&&(F.alpha=0)}},[e,n,T,r,i,o,s,a,c,v,w]),S.useEffect(()=>{if(!O||!C)return;const D=Number.isFinite(e)?Number(e):0,F=Number.isFinite(n)?Number(n):D,G=K=>{const pe=K>=D-1&&K<=F+1?"static":"none";b(X=>X===pe?X:(h.current&&(h.current.eventMode=pe),pe))};O(G);const z=w?.current;return typeof z=="number"&&G(z),()=>C(G)},[e,n,r,w,O,C]),S.useEffect(()=>{if(!(!d||!h.current))return d(h.current),()=>d(null)},[d]);const R=x?.registerSequence;S.useEffect(()=>{if(!(!r||!h.current||!R))return R({id:r,startAt:e,endAt:n,zIndex:l,container:h.current,transitionIn:u,transitionOut:f},r),()=>R(null,r)},[r,e,n,l,u,f,R]);const P=Number.isFinite(c)&&c>0?c:0,A=typeof w?.current=="number"?w.current:0,L=A>=e-P-.001&&A<=n+.001?1:0;return M.jsx("pixiContainer",{ref:h,alpha:L,eventMode:"static",zIndex:l,children:M.jsx("pixiContainer",{ref:m,children:M.jsx("pixiContainer",{ref:p,alpha:1,children:t})})})},gP=t=>{const{startAt:e,endAt:n}=t,{setTotalDuration:r}=S.useContext(Ye);return I.useEffect(()=>{r&&r(Number(n)+.2)},[e,n]),t.children};let Jv=!1;const yP=()=>{Jv||(Jv=!0,console.warn("[reacthub-pixitweenjs] GL transitions need the WebGL renderer; skipping transition."))},_P=90,fd=({transitionPair:t,width:e,height:n,clock:r,resolveEndpoints:i,getLayerSets:o,hideEndpointsInWindow:s=!1,getRegion:a,fullCanvas:l=!1,maxRegionPixels:c=mf})=>{const{app:u}=at.useApplication(),f=S.useRef(null),d=S.useRef(null),h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),y=S.useRef(null),b=S.useRef(null),x=S.useRef(null),v=S.useRef(null),[T,w]=S.useState(!1),O=t?.config,C=O?.name||O?.type,R=r?.start??t?.timing.start??0,P=r?.end??t?.timing.end??R,A=r?.duration??t?.timing.duration??P-R,L=JSON.stringify(O?.params??{}),N=S.useMemo(()=>{if(!C)return null;const F=Ib(C,{width:e,height:n,params:O?.params??{}});return F.setProgress(0),F},[C,L,e,n]);S.useEffect(()=>{p.current=N},[N]);const D=()=>{const F=x.current;if(F){for(const G of F)G.container.visible=G.visible;x.current=null}};return S.useEffect(()=>{if(!N||!t)return;let F=!1,G;const z=()=>{const K=f.current;if(F||!K||!u?.renderer)return!1;if(!BM(u.renderer))return yP(),!0;const se=h.current;se&&(se.parent?.removeChild(se),se.destroy({children:!0}),h.current=null),m.current&&m.current!==N&&(m.current.clearTextures(),m.current.destroy()),d.current||(d.current=HM());const pe=new B.Mesh({geometry:d.current,shader:N.shader});return pe.width=e,pe.height=n,pe.position.set(e/2,n/2),pe.visible=!1,K.addChild(pe),h.current=pe,m.current=N,(!y.current||!b.current)&&(y.current?.destroy(!0),b.current?.destroy(!0),y.current=B.RenderTexture.create({width:e,height:n}),b.current=B.RenderTexture.create({width:e,height:n})),w(!0),!0};return z()||(G=setTimeout(()=>{G=void 0,z()},150)),()=>{F=!0,G!==void 0&&clearTimeout(G)}},[N,t,u,e,n]),S.useEffect(()=>()=>{D(),v.current=null,p.current?.clearTextures(),m.current?.clearTextures(),y.current?.destroy(!0),b.current?.destroy(!0),y.current=null,b.current=null;const F=h.current;F&&(F.parent?.removeChild(F),F.destroy({children:!0}),h.current=null);const G=m.current;G&&(G.destroy(),m.current=null),p.current&&p.current!==G&&p.current.destroy(),p.current=null,d.current?.destroy(),d.current=null,g.current?.destroy({children:!0}),g.current=null},[t?.pairId]),S.useEffect(()=>{if(!T||!r)return;const F=X=>{const he=p.current,j=h.current,te=u?.renderer;if(!he||!j||!te)return;const H=i();if(!(X>=R&&X<P)||!H.from||!H.to||!y.current||!b.current){j.visible=!1,D(),v.current=null;return}const{fromLayers:Z,toLayers:ce}=o(X,H);if(!v.current){const Y=l?null:a?.(H)??Pb([Lb(H.from),Lb(H.to)]);v.current=Y&&Y.width>1&&Y.height>1?{x:Y.x,y:Y.y,width:Math.ceil(Y.width),height:Math.ceil(Y.height)}:{x:0,y:0,width:e,height:n}}const J=v.current,ie=UM(J,c);for(const Y of[y.current,b.current])(Y.width!==J.width||Y.height!==J.height||Y.source.resolution!==ie)&&Y.source.resize(J.width,J.height,ie);Mb(te,g,Z,y.current,-J.x,-J.y),Mb(te,g,ce,b.current,-J.x,-J.y),j.width=J.width,j.height=J.height,j.position.set(J.x+J.width/2,J.y+J.height/2),he.setTextures(y.current,b.current);const xe=Math.max(0,Math.min(1,(X-R)/A));he.setProgress(r.ease?r.ease(xe):xe),j.visible=!0,s&&!x.current&&(x.current=[H.from,H.to].map(Y=>({container:Y,visible:Y.visible})),H.from.visible=!1,H.to.visible=!1)};let G=null,z=0;const K=X=>{G=X,z=_P,F(X)},se=()=>{G===null||z<=0||(z-=1,F(G))};u?.ticker?.add(se);const pe=r.subscribe(K);return()=>{u?.ticker?.remove(se),pe()}},[T,r,R,P,A,i,o,a,s,l,c,u,e,n]),f},Qv=t=>!!t&&Number.isFinite(t.duration)&&t.duration>0&&!!t.name,e1=t=>{const e=[...t].sort((i,o)=>i.startAt-o.startAt||i.endAt-o.endAt||i.id.localeCompare(o.id)),n=[];for(const i of e){const o=e.filter(a=>a.id!==i.id&&a.endAt<=i.startAt).sort((a,l)=>l.endAt-a.endAt||l.startAt-a.startAt)[0],s=e.filter(a=>a.id!==i.id&&a.startAt>=i.endAt).sort((a,l)=>a.startAt-l.startAt||a.endAt-l.endAt)[0];if(Qv(i.transitionIn)&&(o||i.transitionIn.from)){const a=i.transitionIn;n.push({id:`${i.id}:transition-in`,from:a.from??o.id,to:a.to??i.id,name:a.name,startAt:i.startAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}if(Qv(i.transitionOut)&&(s||i.transitionOut.to)){const a=i.transitionOut;n.push({id:`${i.id}:transition-out`,from:a.from??i.id,to:a.to??s.id,name:a.name,startAt:i.endAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}}const r=new Map;for(const i of n){const o=[i.from,i.to,i.startAt,i.duration,i.name].join(":");r.has(o)||r.set(o,i)}return[...r.values()]},bP=({children:t})=>{const[e]=S.useState(()=>new Map),[n]=S.useState(()=>new Map),[r,i]=S.useState(0),o=S.useCallback((l,c)=>{const u=n.get(c);u&&u.container!==l?.container&&e.delete(c),l?(n.set(c,l),e.set(c,l.container)):n.delete(c),i(f=>f+1)},[e,n]),s=S.useMemo(()=>({containers:e,sequences:n,revision:r,registerSequence:o}),[e,n,r,o]),a=S.useMemo(()=>e1(n.values()),[n,r]);return M.jsxs(Zv.Provider,{value:s,children:[t,a.map(l=>M.jsx(Xo,{name:l.name,startAt:l.startAt,duration:l.duration,ease:l.ease,params:l.params,from:l.from,to:l.to,zIndex:l.zIndex},l.id))]})},xP=(t,e,n="none")=>{const r=S.useContext(Ye),{playerTimeRef:i,registerTimeUpdateListener:o,unregisterTimeUpdateListener:s}=r,a=S.useCallback(l=>{const c=f=>l(f);o?.(c);const u=i?.current;return typeof u=="number"&&c(u),()=>s?.(c)},[i,o,s]);return S.useMemo(()=>({subscribe:a,start:t,end:t+e,duration:e,ease:E.parseEase(n)??E.parseEase("none")}),[a,t,e,n])},t1=(t,e)=>typeof t=="string"?e.get(t)??null:typeof t=="function"?t():t&&"current"in t?t.current:t,vP=(t,e)=>{const r=ud()?.containers;return S.useCallback(()=>{const i=r??new Map;return{from:t1(t,i),to:t1(e,i)}},[t,e,r])},TP=[],EP=({name:t,startAt:e,duration:n,ease:r="none",params:i,from:o,to:s,region:a,width:l=1920,height:c=1080,scope:u,zIndex:f=1,fromGroup:d,toGroup:h,sharedLayers:p=TP})=>{const g=ud()?.containers,y=xP(e,n,r),b=vP(o,s),x=S.useMemo(()=>({pairId:`${u}:${typeof o=="string"?o:"from"}:${typeof s=="string"?s:"to"}:${e}:${t}`,config:{type:t,name:t,duration:n,ease:r,params:i??{}},timing:{start:e,end:e+n,duration:n}}),[u,o,s,e,t,n,r,i]),v=S.useCallback((O,C)=>{const R=d??(typeof o=="string"?[o]:[]),P=h??(typeof s=="string"?[s]:[]),A=L=>[...new Set(L)].flatMap((D,F)=>{const G=g?.get(D);return G?[{container:G,zIndex:F}]:[]});if(u==="scene"){const L=A(R),N=A(P),D=A(p);return{fromLayers:[...L,...D],toLayers:[...N,...D]}}return{fromLayers:C.from?[{container:C.from,zIndex:0}]:[],toLayers:C.to?[{container:C.to,zIndex:0}]:[]}},[g,u,o,s,d,h,p]),T=S.useCallback(()=>a??null,[a]),w=fd({transitionPair:x,width:l,height:c,clock:y,resolveEndpoints:b,getLayerSets:v,hideEndpointsInWindow:u==="element",getRegion:a?T:void 0,fullCanvas:u==="scene"});return M.jsx("pixiContainer",{ref:w,zIndex:f,sortableChildren:!0})},dd=S.memo(EP);dd.displayName="TransitionMeshLayer";const SP=t=>M.jsx(dd,{...t,scope:"element"}),Xo=S.memo(SP);Xo.displayName="PixiElementTransition";const wP=t=>M.jsx(dd,{...t,scope:"scene"}),hd=S.memo(wP);hd.displayName="PixiSceneTransition";const AP=t=>t.scope==="element"?M.jsx(Xo,{...t}):M.jsx(hd,{...t}),n1=S.memo(AP);n1.displayName="PixiGlTransition";const OP=({ref:t,...e})=>{const[n,r]=I.useState(),i=S.useRef(null),o=S.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h},pointerdown:p=()=>{},pointerout:m=()=>{},pointerover:g=()=>{},canvasImageRef:y}=e,b=y&&y?.getCanvas(),{app:x}=at.useApplication(),{onPointerDown:v,onPointerOut:T,onPointerOver:w}=Yo(g,p,m,1),O=lt({colorCorrection:d,effects:{name:h}});return at.useTick(()=>{if(i.current&&i.current.texture){const C=i.current.texture.source;C&&typeof C.update=="function"&&C.update(),o.current&&x&&x.renderer.render(o.current)}}),I.useEffect(()=>{if(!ya(b)){const C=Array.isArray(b)?b[0]:b,R=W.Texture.from(C);r(R)}},[b]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:v,pointerover:w,pointerout:T,children:M.jsx("pixiContainer",{ref:o,children:n&&M.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:p},filters:O})})})},CP=I.memo(OP,et),RP=({ref:t,...e})=>{const n=S.useRef(null),r=S.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c,height:u,colorCorrection:f={},effect:d,border:h,roundedCorners:p,maskShape:m}=o,g=lt({colorCorrection:f,effects:{name:d}});return at.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const b=W.Texture.from(y);r.current=b,n.current&&(n.current.texture=b)}}n.current?.texture&&n.current.texture.source?.update?.()}),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:h,roundedCorners:p,maskShape:m,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r.current||W.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},IP=I.memo(RP,et),MP=({ref:t,...e})=>{const n=S.useRef(null),r=S.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c=100,height:u=100,colorCorrection:f={},effect:d,border:h,roundedCorners:p,maskShape:m}=o,g=lt({colorCorrection:f,effects:{name:d}});return at.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const b=W.Texture.from(y);r.current=b,n.current&&(n.current.texture=b)}}n.current?.texture&&n.current.texture.source?.update?.()}),M.jsx($e,{...e,ref:t,children:M.jsx(Ot,{x:a,y:l,width:c,height:u,border:h,roundedCorners:p,maskShape:m,spriteRef:n,children:M.jsx("pixiSprite",{ref:n,texture:r.current||W.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},LP=I.memo(MP,et),PP=({ref:t,...e})=>{const[n,r]=S.useState(null),i=S.useRef(null),o=S.useRef(null),{src:s,visible:a=!0,transformation:l,loop:c=!0,remotionFrame:u,fps:f=30}=e,{x:d,y:h,width:p=0,height:m=0,colorCorrection:g={},effect:y,border:b,roundedCorners:x,maskShape:v}=l,T=lt({colorCorrection:g,effects:{name:y}});S.useEffect(()=>{let O=!1;return W.Assets.load(s).then(C=>{O||r(C)}).catch(C=>{console.error("[PixiRemotionGifSprite] load failed",s,C)}),()=>{O=!0}},[s]),S.useEffect(()=>{const O=o.current;if(!O||u==null)return;const C=O.totalFrames;if(!C)return;const R=u/f,P=O.duration??0;if(P>0){const A=R*1e3%(c?P:P+1),L=Math.min(1,A/P);O.currentFrame=Math.min(C-1,Math.floor(L*C))}else{const A=Math.floor(R*f)%(c?C:C+1);O.currentFrame=Math.min(C-1,A)}},[u,f,c]);const w=u!=null;return M.jsx($e,{...e,ref:t,isGif:!0,children:M.jsx("pixiContainer",{ref:i,children:n&&M.jsx(Ot,{x:d,y:h,width:p,height:m,border:b,roundedCorners:x,maskShape:v,spriteRef:o,children:M.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!w,autoUpdate:!w,loop:c,width:p,height:m,anchor:.5,x:d,y:h,alpha:a?1:0,filters:T})})})})},NP=I.memo(PP,et),kP={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0},DP=({ref:t,...e})=>{const[n,r]=I.useState(0),[i,o]=I.useState(!1),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(void 0),u=S.useRef(void 0),f=S.useRef(kP),d=I.useRef(void 0),h=S.useRef(document.body),{uniqueId:p,src:m,startAt:g,endAt:y,frameStartAt:b,frameEndAt:x,visible:v,disabled:T,loop:w=!1,transformation:{x:O,y:C,width:R,height:P,colorCorrection:A={},effect:L,anchor:N=.5},pointerdown:D=()=>{},pointerout:F=()=>{},pointerover:G=()=>{}}=e,{tl:z}=S.useContext(Ye);Ze(ke.PAUSE,()=>{c.current&&c.current.pause()});const{onPointerDown:K,onPointerOut:se,onPointerOver:pe}=Yo(G,D,F,1),X=lt({colorCorrection:A,effects:{name:L}});I.useLayoutEffect(()=>{l.current=document.createElement("canvas"),l.current.setAttribute("id","lottieContainersvg"),l.current.setAttribute("id",`${p}lottieContainer`),l.current.setAttribute("width",`${R}`),l.current.setAttribute("height",`${P}`);const j=h.current;return j.appendChild(l.current),()=>{l.current&&j.removeChild(l.current)}},[]),I.useEffect(()=>{async function j(){c.current&&c.current.destroy(),l.current.removeAttribute("style"),c.current=tE.loadAnimation({container:l.current||document.getElementById("lottieroot"),renderer:"canvas",loop:!1,autoplay:!1,path:m,rendererSettings:{context:l.current.getContext("2d"),clearCanvas:!0,progressiveLoad:!1,preserveAspectRatio:"xMaxYMax meet"}}),c.current.addEventListener("data_ready",()=>{if(l.current&&l.current.setAttribute("style","display:none"),c.current&&c.current.renderer.canvasContext){const te=c.current.totalFrames;f.current.totalFrames=te;const H=c.current.getDuration();f.current.totalDuration=H;const ae=c.current.renderer.canvasContext.canvas,Z=W.Texture.from(ae);d.current=Z,o(!0),r(H)}}),c.current.addEventListener("loaded_images",()=>{}),c.current.addEventListener("complete",()=>{}),c.current.addEventListener("loopComplete",()=>{}),c.current.addEventListener("enterFrame",()=>{}),c.current.addEventListener("config_ready",()=>{console.log("config_ready",c.current)}),c.current.addEventListener("error",te=>{console.log("error",te)})}return j(),()=>{c.current&&(c.current.removeEventListener("complete"),c.current.removeEventListener("config_ready"),c.current.removeEventListener("enterFrame"),c.current.removeEventListener("loaded_images"),c.current.removeEventListener("loopComplete"),c.current.removeEventListener("data_ready"),c.current.removeEventListener("error"),c.current.destroy())}},[m,p]),I.useEffect(()=>(d.current&&d.current.source?.update?.(),()=>{}),[i]);const he=j=>{if(c.current&&s.current&&u.current){const H=j(u.current.time())/u.current.duration()*f.current.totalFrames,ae=f.current.totalFrames;let Z=H;Z=Math.round(Math.floor(Z)),Z>=ae?(c.current.goToAndStop(0,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!1):(c.current.goToAndStop(Z,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!0)}};return I.useEffect(()=>{let j=E.context(()=>{});if(a.current&&z.current&&n>0){const te=Number(y)-Number(g);u.current&&(u.current.kill(),z.current.remove(u.current)),j=E.context(()=>{const H=E.utils.wrap(g,n);u.current=E.timeline({}).to(a.current,{duration:Number(te),onUpdate:he,onUpdateParams:[H,b,x]},b),z.current.add(u.current,g)})}return()=>{u.current&&(u.current.kill(),E.killTweensOf(u.current)),j.revert()}},[g,y,b,x,p,n,w]),M.jsx($e,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:K,pointerover:pe,pointerout:se,children:M.jsx("pixiContainer",{ref:a,children:d.current&&M.jsx("pixiSprite",{texture:d.current,width:R,height:P,anchor:N,x:O,y:C,ref:s,alpha:v?1:0,...!T&&v&&{interactive:!0,pointerdown:D},filters:X})})})},pd=I.memo(DP,et);pd.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiLottieSprite"};class Wo{currentID;dirtyID;_x;_y;_width;_height;_hull;constructor(e=0,n=0,r=0,i=0){this._x=Number(e),this._y=Number(n),this._width=Number(r),this._height=Number(i),this._hull=[new B.Point,new B.Point,new B.Point,new B.Point],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(e){this._x=e,this.dirtyID++}get y(){return this._y}set y(e){this._y=e,this.dirtyID++}get width(){return this._width}set width(e){this._width=e,this.dirtyID++}get height(){return this._height}set height(e){this._height=e,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[e,n,r,i]=this._hull;e.set(this._x,this._y),n.set(this._x+this._width,this._y),r.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new Wo(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}equals(e){return e?e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height:!1}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}}const r1=new B.Point;class zo{innerBounds;currentID;dirtyID;_rotation;_center;_hull;_matrix;constructor(e=0,n=0,r=0,i=0,o=0){e instanceof Wo&&(o=n||0,n=e.y,r=e.width,i=e.height,e=e.x),this.innerBounds=new Wo(e,n,r,i),this._rotation=o,this._center=new B.ObservablePoint({_onUpdate:()=>this.updateCenter()},0,0),this._hull=[new B.Point,new B.Point,new B.Point,new B.Point],this._matrix=new B.Matrix,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(e){this.center.copyFrom(e)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(e){return e?this.innerBounds.equals(e.innerBounds)&&this.rotation===e.rotation:!1}contains(e,n){typeof e=="number"&&(e=r1.set(e,n));const r=this._matrix.applyInverse(e,r1);return this.innerBounds.contains(r.x,r.y)}copyFrom(e){return this.innerBounds.copyFrom(e.innerBounds),this.rotation=e.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const e=this.innerBounds,n=this._rotation,r=this._center,[i,o,s,a]=this._hull,l=this._matrix;r._x=e.x+e.width/2,r._y=e.y+e.height/2,l.identity().translate(-r.x,-r.y).rotate(n).translate(r.x,r.y),l.apply(e.topLeft,i),l.apply(e.topRight,o),l.apply(e.bottomRight,s),l.apply(e.bottomLeft,a),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const e=this.center,n=this.innerBounds;n.x=e.x-n.width/2,n.y=e.y-n.height/2}}class i1{_history;_decayRatio;_currentIndex;_average=0;constructor(e,n){this._history=new Array(e),this._decayRatio=n,this._currentIndex=0;for(let r=0;r<e;r++)this._history[r]=0}next(e){const{_history:n,_decayRatio:r}=this,i=n.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,n[this._currentIndex]=e;let o=0,s=0;for(let a=this._currentIndex+1;a<i;a++)o=(o+n[a])*r,s=(s+1)*r;for(let a=0;a<=this._currentIndex;a++)o=(o+n[a])*r,s=(s+1)*r;return this._average=o/s,this._average}absDev(){let e=0;for(let n=0,r=this._history.length;n<r;n++)e+=Math.abs(this._history[n]-this._average);return e/this._history.length}}class o1{_freeList;_freeCount;_reserveCount;_borrowRate;_returnRate;_flowRate;_borrowRateAverage;_marginAverage;_capacityRatio;_decayRatio;_borrowRateAverageProvider;_marginAverageProvider;constructor(e={}){this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=e.reserve||0,this._capacityRatio=e.capacityRatio||1.2,this._decayRatio=e.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new i1(128,this._decayRatio),this._marginAverageProvider=new i1(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(e){this._freeList.length=Math.ceil(e)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(e){let n,r;Array.isArray(e)?(n=e,r=e.length):(r=e,n=new Array(r)),this._borrowRate+=r,this._flowRate+=r;let i=0;if(this._freeCount>0){const o=this._freeList,s=Math.min(this._freeCount,r);let a=this._freeCount;for(let l=0;l<s;l++)n[i]=o[a-1],++i,--a;this._freeCount=a}for(;i<r;)n[i]=this.create(),++i;return n}release(e){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=e,++this._freeCount}releaseArray(e){this._returnRate+=e.length,this._flowRate-=e.length,this._freeCount+e.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+e.length));for(let n=0,r=e.length;n<r;n++)this._freeList[this._freeCount]=e[n],++this._freeCount}reserve(e){if(this._reserveCount=e,this._freeCount<e){const n=this._freeCount-e;for(let r=0;r<n;r++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(e){if(this._freeCount>e){this.capacity>e*this._capacityRatio&&(this.capacity=e*this._capacityRatio);const r=Math.min(this._freeCount,this.capacity);for(let i=e;i<r;i++)this._freeList[i]=null}}startGC(e=B.Ticker.shared){e.add(this._gcTick,null,B.UPDATE_PRIORITY.UTILITY)}stopGC(e=B.Ticker.shared){e.remove(this._gcTick)}_gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const e=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const n=this._freeCount,r=this._freeList.length;if(n<128&&this._borrowRateAverage<128&&r<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+e){const o=i+e;this.capacity=Math.min(this._freeList.length,Math.ceil(o)),this._freeCount=this._freeList.length}}}const s1=new Map;class a1{static build(e){let n=s1.get(e);return n||(n=new class extends o1{create(){return new e}},s1.set(e,n),n)}static buildFunctional(e){return new class extends o1{create=e}}}const c1={color:16777215,outlineColor:6514417,outlineThickness:2.5,radius:7,shape:"circle",glowColor:6514417,glowIntensity:.15};function l1(t,e,n){const r=Math.max(1,n/28),i=Math.round(24*r);return`data:image/svg+xml;base64,${btoa(`
1513
+ `).trim(),n.length>e&&(n=n.slice(0,e).trimEnd()),n};function hf(t,e,n){if(n<=0)return er(t);if(n>=1)return er(e);const r=Math.min(t.vertices.length,e.vertices.length,t.inTangents.length,e.inTangents.length,t.outTangents.length,e.outTangents.length),i=new Array(r),o=new Array(r),s=new Array(r);for(let a=0;a<r;a++)i[a]=pf(t.vertices[a],e.vertices[a],n),o[a]=pf(t.inTangents[a],e.inTangents[a],n),s[a]=pf(t.outTangents[a],e.outTangents[a],n);return{vertices:i,inTangents:o,outTangents:s,closed:n<.5?t.closed:e.closed}}function pf(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function er(t){return{vertices:t.vertices.map(e=>[e[0],e[1]]),inTangents:t.inTangents.map(e=>[e[0],e[1]]),outTangents:t.outTangents.map(e=>[e[0],e[1]]),closed:t.closed}}function tr(t){let e=t.replace(/^#/,"");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const n=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,i=parseInt(e.substring(4,6),16)/255,o=e.length===8?parseInt(e.substring(6,8),16)/255:1;return{r:n,g:r,b:i,a:o}}function Ri(t){const e=r=>Math.max(0,Math.min(255,Math.round(r*255))).toString(16).padStart(2,"0"),n=`#${e(t.r)}${e(t.g)}${e(t.b)}`;return t.a<1?`${n}${e(t.a)}`:n}function Qk(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&typeof e.v=="string"}function t1(t,e,n){const r=S.timeline({paused:!0}),i={r:0,g:0,b:0,a:1};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!Qk(t))return Object.assign(i,tr(t)),{timeline:r,hasAnimation:!1,target:i};const o=t,s=a=>(a-n)/e;Object.assign(i,tr(o[0].v)),r.set(i,tr(o[0].v),s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u,d=tr(c.v);if(l.hold){r.set(i,d,s(c.t));continue}r.to(i,{r:d.r,g:d.g,b:d.b,a:d.a,duration:f,ease:Vn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function eP(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function n1(t,e){if(e<=0)return 0;if(e>=1)return 1;const[n,r,i,o]=t;let s=e;for(let l=0;l<8;l++){const c=1-s,u=3*c*c*s*n+3*c*s*s*i+s*s*s,f=3*c*c*n+6*c*s*(i-n)+3*s*s*(1-i);if(Math.abs(f)<1e-9)break;s-=(u-e)/f,s<0&&(s=0),s>1&&(s=1)}const a=1-s;return 3*a*a*s*r+3*a*s*s*o+s*s*s}function Pr(t,e,n,r){if(t===void 0)return e;if(!eP(t))return t;const i=t;if(i.length===0)return e;if(n<=i[0].t)return i[0].v;if(n>=i[i.length-1].t)return i[i.length-1].v;for(let o=0;o<i.length-1;o++){const s=i[o],a=i[o+1];if(n>=s.t&&n<=a.t){if(s.hold)return s.v;const l=a.t-s.t,c=l>0?(n-s.t)/l:0,u=s.easeOut?n1(s.easeOut,c):c;return r(s.v,a.v,u)}}return i[i.length-1].v}const r1=(t,e,n)=>t+(e-t)*n,i1=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n],tP=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function ge(t,e,n){return Pr(t,e,n,r1)}function pn(t,e,n){return Pr(t,e,n,i1)}function wt(t,e,n){return Pr(t,e,n,tP)}const o1=(t,e,n)=>{const r=tr(t),i=tr(e);return Ri({r:r.r+(i.r-r.r)*n,g:r.g+(i.g-r.g)*n,b:r.b+(i.b-r.b)*n,a:r.a+(i.a-r.a)*n})};function At(t,e,n){return Pr(t,e,n,o1)}function mf(t,e,n){return Pr(t,e,n,hf)}function nP(t,e){const n=t.source;if(typeof n=="string")return n;if(!Array.isArray(n)||n.length===0)return"";let r=n[0].v;for(const i of n)if(i.t<=e)r=i.v;else break;return r}function rP(t,e,n,r,i,o){return{text:t,font:e.font??n.style.font,size:e.size!=null?ge(e.size,i,r):i,weight:e.weight??n.style.weight,italic:e.italic??n.style.italic,fill:e.fill!=null?At(e.fill,o,r):o,tracking:e.tracking!=null?ge(e.tracking,0,r):void 0,baselineShift:e.baselineShift!=null?ge(e.baselineShift,0,r):void 0}}function ns(t,e,n={}){const r=_i(),i=zd(t),o=nP(t,e),s=ge(t.style.size,24,e),a=t.style.fill?At(Qn(t.style.fill,n.theme),"#ffffff",e):"#ffffff",l=t.style.tracking?ge(t.style.tracking,0,e):t.style.letterSpacing?ge(t.style.letterSpacing,0,e):void 0,c=t.style.leading?ge(t.style.leading,0,e):t.style.lineHeight?ge(t.style.lineHeight,0,e):void 0,u=t.style.align??"left",f=n.boxWidth,d=n.metrics,h=I.useMemo(()=>{const p=Array.from(o),g=[];for(const y of i){const _=p.slice(y.from,y.to).join("");g.push(rP(_,y,t,e,s,a))}return{runs:g,align:u,tracking:l,leading:c,box:f!=null?{width:f}:void 0,metrics:d}},[t,i,o,s,a,u,l,c,f,d,e]),m=I.useMemo(()=>JSON.stringify({runs:h.runs,align:h.align,tracking:h.tracking,leading:h.leading,box:h.box,fontEpoch:r}),[h,r]);return I.useMemo(()=>ib(h),[m])}const s1=new Map,a1=new Map;function c1(t){if(!t)return;const e=s1.get(t);if(e)return e;let n=a1.get(t);throw n||(n=fetch(t).then(r=>{if(!r.ok)throw new Error(`useTypefaceMetrics: ${t} returned ${r.status}`);return r.json()}).then(r=>{const i=hR(r);return s1.set(t,i),i}),a1.set(t,n)),n}function We(t,e,n){const r=t[e];return r==null?n:Array.isArray(r)&&r.length>0&&typeof r[0]=="object"?r[0].v??n:r}function l1(t){return Math.max(0,We(t,"blurriness",0))}const gf={name:"gaussian-blur",build(t){return new K.BlurFilter({strength:l1(t)})},apply(t,e){t.strength=l1(e)}};function u1(t){const e=We(t,"distance",4),n=We(t,"direction",135),r=We(t,"softness",4),i=We(t,"opacity",.5),o=iP(We(t,"color","#000000")),s=(n-90)*Math.PI/180;return{offset:{x:e*Math.cos(s),y:e*Math.sin(s)},blur:r,color:o,alpha:i}}function iP(t){return typeof t=="number"?t:typeof t=="string"?new K.Color(t).toNumber():0}const yf={name:"drop-shadow",build(t){return new ar.DropShadowFilter(u1(t))},apply(t,e){const n=t,r=u1(e);n.offset=r.offset,n.blur=r.blur,n.color=r.color,n.alpha=r.alpha}};function d1(t){const e=We(t,"radius",10),n=We(t,"intensity",4),r=We(t,"inner-intensity",0),i=We(t,"opacity",1),o=oP(We(t,"color","#ffffff"));return{distance:e,outerStrength:n,innerStrength:r,color:o,alpha:i}}function oP(t){return typeof t=="number"?t:typeof t=="string"?new K.Color(t).toNumber():16777215}const _f={name:"glow",build(t){return new ar.GlowFilter(d1(t))},apply(t,e){const n=t,r=d1(e);n.distance=r.distance,n.outerStrength=r.outerStrength,n.innerStrength=r.innerStrength,n.color=r.color,n.alpha=r.alpha}};function f1(t){return{hue:We(t,"master-hue",0),saturation:We(t,"master-saturation",0)/100,lightness:We(t,"master-lightness",0)/100,colorize:!!We(t,"colorize",!1),alpha:1}}const bf={name:"hue-saturation",build(t){return new ar.HslAdjustmentFilter(f1(t))},apply(t,e){const n=t,r=f1(e);n.hue=r.hue,n.saturation=r.saturation,n.lightness=r.lightness,n.colorize=r.colorize}};function sP(t){const e=We(t,"input-black",0)/255,n=We(t,"input-white",255)/255,r=We(t,"output-black",0)/255,i=We(t,"output-white",255)/255,o=Math.max(1e-6,n-e),a=(i-r)/o;return{brightness:r-e*a,contrast:a}}const vf={name:"levels",build(t){const e=new K.ColorMatrixFilter;return h1(e,t),e},apply(t,e){h1(t,e)}};function h1(t,e){const{brightness:n,contrast:r}=sP(e);t.reset(),t.brightness(n,!1),t.contrast(r,!0)}function aP(t){return typeof t=="number"?t:typeof t=="string"?new K.Color(t).toNumber():16777215}function p1(t,e){const n=aP(We(e,"white-tint","#ffffff")),r=Math.max(0,Math.min(1,We(e,"amount-to-tint",100)/100));t.reset(),t.tint(n,!0),r<1&&(t.alpha=r)}const xf={name:"tint",build(t){const e=new K.ColorMatrixFilter;return p1(e,t),e},apply(t,e){p1(t,e)}};function m1(t){const e=We(t,"brightness",0),n=We(t,"contrast",0);return{brightness:1+e/100,contrast:1+n/100}}const Tf={name:"brightness-contrast",build(t){return new ar.AdjustmentFilter(m1(t))},apply(t,e){const n=t,r=m1(e);n.brightness=r.brightness,n.contrast=r.contrast}};function g1(t){return Math.max(0,We(t,"blur-radius",0))}const Ef={name:"fast-box-blur",build(t){return new ar.KawaseBlurFilter({strength:g1(t),quality:3})},apply(t,e){t.strength=g1(e)}},Sf=new Map([[gf.name,gf],[yf.name,yf],[_f.name,_f],[bf.name,bf],[vf.name,vf],[xf.name,xf],[Tf.name,Tf],[Ef.name,Ef]]),y1=new Set;function wf(t){const e=Sf.get(t);return!e&&!y1.has(t)&&(y1.add(t),console.warn(`AEP: no handler for effect '${t}' — pass-through (no filter).`)),e}function cP(t){Sf.set(t.name,t)}function lP(){return Array.from(Sf.keys())}function _1(t){return I.useMemo(()=>{if(!("effects"in t)||!t.effects?.length)return[];const e=[];for(const n of t.effects){if(n.enabled===!1)continue;const r=wf(n.name);r&&e.push(r.build(n.params))}return e},[t])}function b1(t,e){const r=pt().currentFrame;return I.useEffect(()=>{if(!("effects"in t)||!t.effects?.length)return;const i=t.effects;let o=0;for(const s of i){if(s.enabled===!1)continue;const a=e[o];if(o++,!a)continue;const l=wf(s.name);if(!l)continue;const c={};for(const[u,f]of Object.entries(s.params))c[u]=dP(f,r);l.apply(a,c)}},[t,e,r]),null}function uP(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e}function dP(t,e){if(!uP(t))return t;const n=t[0].v;return typeof n=="number"?ge(t,0,e):typeof n=="string"?At(t,"#000000",e):Array.isArray(n)&&n.length===2&&typeof n[0]=="number"?pn(t,[0,0],e):n}function fP(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e}function Af(t,e,n,r,i){const o=S.timeline({paused:!0});if(t===void 0)return{timeline:o,hasAnimation:!1};if(!fP(t))return r[i]=t,o.set(r,{[i]:t},0),{timeline:o,hasAnimation:!1};const s=t,a=l=>(l-n)/e;o.set(r,{[i]:s[0].v},a(s[0].t));for(let l=0;l<s.length-1;l++){const c=s[l],u=s[l+1],f=a(c.t),d=a(u.t)-f;if(c.hold){o.set(r,{[i]:u.v},a(u.t));continue}o.to(r,{[i]:u.v,duration:d,ease:Vn(c.easeOut)},f)}return{timeline:o,hasAnimation:!0}}function hP(t,e,n,r){const{tl:i}=I.useContext(Ve),o=hn(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const l={v:0},{timeline:c,hasAnimation:u}=Af(t,e,n,l,"v");if(!u){s.current(l.v);return}c.eventCallback("onUpdate",()=>{s.current(l.v)}),s.current(l.v);const f=o?o.framesToSeconds(n):n/e,d=S.context(()=>{a.add(c,f);const h=a.time()-f;c.seek(Math.max(0,Math.min(c.duration(),h)),!1)});return()=>{a.remove(c),c.kill(),d.revert()}},[t,e,n,o])}function pP(t,e,n,r){const{tl:i}=I.useContext(Ve),o=hn(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=t1(t,e,n);if(!c){s.current(Ri(u));return}l.eventCallback("onUpdate",()=>{s.current(Ri(u))}),s.current(Ri(u));const f=o?o.framesToSeconds(n):n/e,d=S.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function mP(t){if(!t||!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&"v"in e&&typeof e.v?.vertices<"u"}function v1(t,e,n,r){const i=S.timeline({paused:!0});if(!t)return{timeline:i,hasAnimation:!1,initial:{vertices:[],inTangents:[],outTangents:[],closed:!1}};if(!mP(t)){const l=er(t);return{timeline:i,hasAnimation:!1,initial:l}}const o=t,s=l=>(l-n)/e,a=er(o[0].v);i.call(()=>r(er(o[0].v)),[],s(o[0].t));for(let l=0;l<o.length-1;l++){const c=o[l],u=o[l+1],f=s(c.t),d=s(u.t)-f;if(c.hold){i.call(()=>r(er(u.v)),[],s(u.t));continue}const h={t:0};i.to(h,{t:1,duration:d,ease:Vn(c.easeOut),onUpdate:()=>{r(hf(c.v,u.v,h.t))}},f)}return{timeline:i,hasAnimation:!0,initial:a}}function gP(t,e,n,r){const{tl:i}=I.useContext(Ve),o=hn(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,initial:u}=v1(t,e,n,h=>s.current(h));if(s.current(u),!c)return;const f=o?o.framesToSeconds(n):n/e,d=S.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function yP(t){if(!Array.isArray(t)||t.length===0)return!1;const e=t[0];return typeof e=="object"&&e!==null&&"t"in e&&Array.isArray(e.v)}function x1(t,e,n){const r=S.timeline({paused:!0}),i={x:0,y:0};if(t===void 0)return{timeline:r,hasAnimation:!1,target:i};if(!yP(t)){const[a,l]=t;return i.x=a,i.y=l,{timeline:r,hasAnimation:!1,target:i}}const o=t,s=a=>(a-n)/e;i.x=o[0].v[0],i.y=o[0].v[1],r.set(i,{x:o[0].v[0],y:o[0].v[1]},s(o[0].t));for(let a=0;a<o.length-1;a++){const l=o[a],c=o[a+1],u=s(l.t),f=s(c.t)-u;if(l.hold){r.set(i,{x:c.v[0],y:c.v[1]},s(c.t));continue}r.to(i,{x:c.v[0],y:c.v[1],duration:f,ease:Vn(l.easeOut)},u)}return{timeline:r,hasAnimation:!0,target:i}}function _P(t,e,n,r){const{tl:i}=I.useContext(Ve),o=hn(),s=I.useRef(r);I.useEffect(()=>{s.current=r},[r]),I.useEffect(()=>{const a=i?.current;if(!a)return;const{timeline:l,hasAnimation:c,target:u}=x1(t,e,n);if(!c){s.current(u.x,u.y);return}l.eventCallback("onUpdate",()=>{s.current(u.x,u.y)}),s.current(u.x,u.y);const f=o?o.framesToSeconds(n):n/e,d=S.context(()=>{a.add(l,f);const h=a.time()-f;l.seek(Math.max(0,Math.min(l.duration(),h)),!1)});return()=>{a.remove(l),l.kill(),d.revert()}},[t,e,n,o])}function bP(t,e,n,r){return Af(t,e,n,r,"level")}const T1=I.createContext(void 0),Of=({value:t,children:e})=>R.jsx(T1.Provider,{value:t,children:e});function nr(){return I.useContext(T1)}function Mf(t,e){if(!(!t&&!e))return{...t??{},...e??{}}}const E1=I.createContext(void 0),S1=({value:t,children:e})=>R.jsx(E1.Provider,{value:t,children:e});function Li(t){return I.useContext(E1)?.[t]}function vP(t,e,n){return n?.[t]??e}function Bt(t,e){return t===void 0?e:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:t}function If(t,e){switch(t){case"square":return e>=0&&e<=1?1:0;case"ramp-up":return mn(e);case"ramp-down":return mn(1-e);case"triangle":return mn(1-Math.abs(2*e-1));case"round":return Math.sin(Math.PI*mn(e));case"smooth":{const n=mn(e);return n*n*(3-2*n)}}}const mn=t=>t<0?0:t>1?1:t;function Cf(t,e,n){if(n===0)return[];const r=mn(Bt(t.start,0)),i=mn(Bt(t.end,1)),o=Bt(t.offset,0),s=t.shape??"ramp-up",a=Math.min(r,i),c=Math.max(r,i)-a,u=new Array(n);for(let f=0;f<n;f++){const d=(f+.5)/n+o;let h;c<=0?h=d===a?1:0:h=(d-a)/c;const p=h>=0&&h<=1?If(s,h):0;u[f]=p*e}return u}function xP(t,e,n){if(n.length===0)return[];const r=t.basedOn??"chars";if(r==="chars")return Cf(t,e,n.length);const i=g=>r==="words"?g.wordIndex:g.lineIndex,o=new Map;for(const g of n){const y=i(g);o.has(y)||o.set(y,o.size)}const s=o.size;if(s===0)return new Array(n.length).fill(0);const a=mn(Bt(t.start,0)),l=mn(Bt(t.end,1)),c=Bt(t.offset,0),u=t.shape??"ramp-up",f=Math.min(a,l),h=Math.max(a,l)-f,m=new Array(s);for(let g=0;g<s;g++){const y=(g+.5)/s+c;let _;h<=0?_=y===f?1:0:_=(y-f)/h;const v=_>=0&&_<=1;m[g]=(v?If(u,_):0)*e}const p=new Array(n.length);for(let g=0;g<n.length;g++){const y=o.get(i(n[g]))??0;p[g]=m[y]}return p}function rs(t,e,n){const r=typeof e=="number"?e:e.length,i=Array.from({length:r},()=>({position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null}));if(r===0)return i;for(let o=0;o<t.length;o++){const s=t[o],a=n&&n[o]!==void 0?n[o]:Bt(s.amount,1),l=typeof e=="number"?Cf(s.range,a,r):xP(s.range,a,e),c=Bt(s.positionOffset,[0,0]),u=Bt(s.scaleOffset,[0,0]),f=Bt(s.rotationOffset,0),d=Bt(s.opacityOffset,0);for(let h=0;h<r;h++){const m=l[h];m!==0&&(i[h].position[0]+=c[0]*m,i[h].position[1]+=c[1]*m,i[h].scale[0]+=u[0]*m,i[h].scale[1]+=u[1]*m,i[h].rotation+=f*m,i[h].opacity+=d*m,s.fillOffset&&(i[h].fillMix={color:s.fillOffset,amount:m}))}}return i}function w1(t,e,n,r="#ffffff"){const i=t.style.fill,o=i==null?void 0:At(Qn(i,e),r,n),s=t.style.runs,a=s==null||s.length===0?[]:s.map(l=>l.fill===void 0?void 0:At(l.fill,r,n));return{layerHex:o,runHexes:a}}const TP=500;class EP{constructor(e=64){this.capacity=e}capacity;map=new Map;hits=0;misses=0;get(e,n){const r=this.map.get(e);if(r)return this.hits++,this.map.delete(e),this.map.set(e,r),r;this.misses++;const i=n();if(this.map.size>=this.capacity){const o=this.map.keys().next().value;o!==void 0&&this.map.delete(o)}return this.map.set(e,i),i}get hitRate(){const e=this.hits+this.misses;return e===0?0:this.hits/e}}function SP(t,e,n=""){return[t.runIndex,t.ascent|0,e,n].join("|")}function wP(t,e,n){if(n<=0)return t;if(n>=1)return e;const r=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16),s=parseInt(e.slice(1,3),16),a=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16),c=Math.round(r+(s-r)*n),u=Math.round(i+(a-i)*n),f=Math.round(o+(l-o)*n);return`#${c.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`}const Rf=I.memo(({layer:t,animators:e,x:n,y:r,maxGlyphs:i=TP})=>{const s=hn()?.currentFrame??0,a=nr(),l=_i(),c=Li(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=ns(u,s,{boxWidth:t.style.boxWidth,theme:a}),d=e??t.animators??[],h=I.useMemo(()=>d.map(x=>ge(x.amount,1,s)),[d,s]),m=I.useMemo(()=>rs(d,f.glyphs,h),[d,f.glyphs.length,h]);I.useEffect(()=>{f.glyphs.length>i&&console.warn(`PixiTextSplit: ${f.glyphs.length} glyphs exceeds ${i} cap. Animator perf will degrade.`)},[f.glyphs.length,i]);const p=I.useRef(null);p.current===null&&(p.current=new EP);const g=p.current,{layerHex:y,runHexes:_}=I.useMemo(()=>w1(t,a,s),[t,a,s]),v=f.glyphs.slice(0,i).map((x,E)=>{const T=m[E]??m[0]??{position:[0,0],scale:[0,0],rotation:0,opacity:0,fillMix:null};if(x.isWhitespace)return null;const M=_[x.runIndex]??y??"#ffffff",C=T.fillMix?wP(M,T.fillMix.color,T.fillMix.amount):M,w=t.style.runs?.[x.runIndex],L=w?.font??t.style.font,D=w?.size!=null?typeof w.size=="number"?w.size:w.size[0]?.v??24:typeof t.style.size=="number"?t.style.size:t.style.size[0]?.v??24,N=ld(w?.weight??t.style.weight),F=w?.italic??t.style.italic,H=`${L}|${D}|${N??""}|${F?1:0}|${l}`,V=g.get(SP(x,C,H),()=>new K.TextStyle({fontFamily:L,fontSize:D,fill:C,fontWeight:N,fontStyle:F?"italic":"normal"})),$=1+T.opacity,re=Math.max(0,Math.min(1,$));return R.jsx("pixiText",{text:x.char,style:V,x:x.x+T.position[0],y:x.y+T.position[1],scale:{x:1+T.scale[0],y:1+T.scale[1]},rotation:T.rotation*Math.PI/180,alpha:re},x.charIndex)});return R.jsx("pixiContainer",{x:n,y:r,children:v})});Rf.displayName="PixiTextSplit";const ki={segment:null,wordIndex:-1,word:null,elapsedMs:0,remainingMs:0};function A1({containerRef:t,segments:e,mode:n,disabled:r=!1,itemStartSec:i=0,itemEndSec:o,currentTime:s}){const{playerTimeRef:a}=O.useContext(Ve),l=typeof s=="number"&&Number.isFinite(s),[c,u]=O.useState(ki),f=O.useRef(ki),d=O.useMemo(()=>Rx(e,i,o),[e,i,o]),h=O.useMemo(()=>l&&!r&&e.length?sf(e,af(s,d,i),n):ki,[l,r,e,s,d,i,n]);return O.useEffect(()=>{const m=t.current;if(l||!m)return;if(f.current=ki,r||!e.length){u(ki),m.onRender=void 0;return}const p=kx(n);return m.onRender=()=>{const g=a?.current??0,y=sf(e,af(g,d,i),n),_=f.current;y.segment===_.segment&&y.wordIndex===_.wordIndex&&(!p||y.elapsedMs===_.elapsedMs&&y.remainingMs===_.remainingMs)||(f.current=y,u(y))},()=>{m.onRender=void 0}},[t,l,r,e,n,d,i,a]),l?h:c}const O1=()=>new K.BlurFilter({strengthX:0,strengthY:0,quality:2}),Lf=t=>()=>{try{t.destroy()}catch{}};function M1(t,e,n){const r=_i(),{fontFamily:i,fontWeight:o,fontSize:s,fill:a,align:l,wordWrapWidth:c,padding:u,stroke:f,strokeWidth:d,dropShadow:h,dropShadowColor:m,dropShadowBlur:p,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:_,highlightColor:v}=t,x=O.useMemo(()=>new K.TextStyle(dd({fontFamily:i,fontSize:s,fontWeight:o,fill:a,align:l,padding:u||10,wordWrapWidth:c||500,stroke:f,strokeWidth:f!=null&&d>0?d:0,dropShadow:h,dropShadowColor:m,dropShadowBlur:p,dropShadowAlpha:g,dropShadowAngle:y,dropShadowDistance:_})),[r,i,s,o,a,l,c,u,f,d,h,m,p,g,y,_]),E=O.useMemo(()=>{const L=x.clone();switch(e){case"glow":L.fill=v||a||"#00FFFF",L.dropShadow={color:v||"#00FFFF",alpha:.9,angle:0,blur:12,distance:0};break;case"vhs":L.fill="#FFFFFF",L.dropShadow=void 0;break;case"boxed":L.fill=v||a||"#FFD700",L.dropShadow=void 0;break;default:L.fill=v||a||"#FFD700"}return L},[x,a,v,e]),T=O.useMemo(()=>{const L=x.clone();return L.fill=a||"#FFFFFF",L.dropShadow=e==="glow"?{color:a||"#FFFFFF",alpha:.3,angle:0,blur:3,distance:0}:void 0,L},[x,a,e]),A=O.useMemo(()=>{const L={};if(e!=="springpop")return L;for(const D of n)for(const N of D.words??[]){const F=N.color;if(F&&!L[F]){const H=x.clone();H.fill=F,L[F]=H}}return L},[n,e,x]),M=O.useMemo(()=>{if(e!=="vhs")return null;const L=D=>{const N=x.clone();return N.fill=D,N.dropShadow=void 0,N.stroke=void 0,N};return{cyan:L("#00FFFF"),magenta:L("#FF00FF")}},[x,e]),C=O.useMemo(O1,[]),k=O.useMemo(O1,[]),w=O.useMemo(()=>{const L=s*(e==="springpop"?sx:Kv),D=new K.BlurFilter({strength:L,quality:4});return D.padding=L*6,D},[s,e]);return O.useEffect(()=>Lf(C),[C]),O.useEffect(()=>Lf(k),[k]),O.useEffect(()=>Lf(w),[w]),{base:x,active:E,inactive:T,colour:A,vhs:M,glowPopBlur:C,springPopBlur:k,bloomBlur:w}}function I1(t,e){const n=O.useMemo(()=>{if(!e)return[];const o=t.flatMap(s=>(s.words??[]).map(a=>ef(a)));return[...new Set(o.filter(s=>!!s))]},[t,e]),[r,i]=O.useState({});return O.useEffect(()=>{let o=!1;for(const s of n)K.Assets.load(s).then(a=>{o||i(l=>l[s]?l:{...l,[s]:a})}).catch(a=>{console.warn("[PixiCaptionsTrack] emoji load failed",s,a)});return()=>{o=!0}},[n]),r}const AP=Array.from({length:Zv},(t,e)=>`bloom-${e}`),C1=(t,e)=>Lr(t.text??"",e),R1=t=>{const{segments:e,uniqueId:n,transformation:r={},style:i,visible:o=!0,disabled:s=!1,startAt:a=0,endAt:l,currentTime:c,onContainerRefReady:u,onClick:f,mouseOverSpriteRef:d}=t,{x:h=0,y:m=0,fontFamily:p="Arial",fontWeight:g="bold",fontSize:y=48,fill:_="#FFFFFF",stroke:v="#000000",strokeWidth:x=2,dropShadow:E=!0,dropShadowColor:T="#000000",dropShadowBlur:A=4,dropShadowAlpha:M=.8,dropShadowAngle:C=Math.PI/4,dropShadowDistance:k=3,wordWrapWidth:w=1536,align:L="center",padding:D=10,highlightColor:N="#FFD700",wordSpacing:F,captionStyleId:H=null,captionBgColor:V="transparent",textTransform:$="none",captionActiveWordBg:re="#FFE45E"}=r,he=H??i??"default",q=O.useMemo(()=>Yv(he),[he]),fe=O.useRef(null),Y=A1({containerRef:fe,segments:e,mode:q,disabled:s,itemStartSec:a,itemEndSec:l,currentTime:c}),{segment:te,wordIndex:z,elapsedMs:le,remainingMs:Q}=Y,ce=M1({fontFamily:p,fontWeight:g,fontSize:y,fill:_,align:L,wordWrapWidth:w,padding:D,stroke:v,strokeWidth:x,dropShadow:E,dropShadowColor:T,dropShadowBlur:A,dropShadowAlpha:M,dropShadowAngle:C,dropShadowDistance:k,highlightColor:N},q,e),ye=I1(e,q==="glowpop");O.useEffect(()=>{fe.current&&u&&u(n,fe)},[n,u]);const{words:U,offset:Z}=O.useMemo(()=>Px(q,te?.words??[],z),[q,te?.words,z]),W=O.useMemo(()=>{if(!U.length||q==="none")return null;const Me=K.CanvasTextMetrics.measureText(" ",ce.base,void 0,!1),Le=U.map(Ae=>{const Be=K.CanvasTextMetrics.measureText(C1(Ae,$),ce.base);return{width:Be.width,height:Be.height}});return Hv(Le,{spaceWidth:Me.width,fontSize:y,maxLineWidth:w||1536,wordSpacing:qd(F,y),activeScale:$o(q)})},[U,ce.base,w,q,y,F,$]),_e=te?.text??"",be=o&&!!te&&!!_e,ee=q!=="none"&&!!te?.words?.length&&!!W,Ee=O.useMemo(()=>{if(W)return{width:W.totalWidth+40,height:W.totalHeight+20};if(!_e)return{width:200,height:60};try{const Me=K.CanvasTextMetrics.measureText(Lr(_e,$),ce.base);return{width:Me.width+40,height:Me.height+20}}catch{return{width:200,height:60}}},[W,_e,ce.base,$]),de=O.useCallback(Me=>{Me.clear(),be&&Me.rect(-Ee.width/2,-Ee.height/2,Ee.width,Ee.height).fill({color:16777215,alpha:.001})},[Ee,be]),ke=O.useCallback(Me=>{if(Me.clear(),!be||q!=="boxed")return;const Le=W?W.totalWidth:Ee.width-40,Ae=W?W.totalHeight:Ee.height-20,Be=Ux(Le,Ae,V,he);Me.roundRect(Be.x,Be.y,Be.width,Be.height,Be.radius).fill({color:Be.color,alpha:Be.alpha})},[be,q,W,Ee,V,he]),je=O.useCallback(Me=>{if(Me.clear(),!be||q!=="wordbox"||!W||z<Z)return;const Le=W.positions[z-Z];if(!Le)return;const Ae=jx(Le,W.totalWidth,W.totalHeight,le,y);Me.roundRect(Ae.x,Ae.y,Ae.width,Ae.height,Ae.radius).fill({color:re,alpha:1})},[be,q,W,z,Z,le,y,re]),ut=O.useCallback(Me=>f?.(n,Me),[f,n]),dt=O.useCallback(()=>{d&&(d.current=!0)},[d]),ot=O.useCallback(()=>{d&&(d.current=!1)},[d]);O.useEffect(()=>()=>{d&&(d.current=!1)},[d]);const ve=W?-W.totalWidth/2:0,nt=W?-W.totalHeight/2:0,ct=(Me,Le)=>q==="springpop"&&Le.color&&ce.colour[Le.color]?ce.colour[Le.color]:Me==="active"?ce.active:Me==="inactive"?ce.inactive:ce.base;return R.jsxs("pixiContainer",{ref:fe,label:n,x:h,y:m,children:[R.jsx("pixiGraphics",{draw:de,eventMode:be?"static":"none",cursor:"pointer",onPointerTap:ut,onPointerOver:dt,onPointerOut:ot}),R.jsx("pixiGraphics",{draw:ke,eventMode:"none"}),R.jsx("pixiGraphics",{draw:je,eventMode:"none"}),be&&ee&&W&&te&&U.map((Me,Le)=>{const Ae=W.positions[Le];if(!Ae)return null;const Be=Le+Z===z,He=Lx(q,Be,le,Q,y),gt=ve+Ae.x+Ae.width/2,ze=nt+Ae.y+Ae.height/2+He.dy,Re=ct(He.styleKind,Me),Ue=C1(Me,$),en=He.blurX>cf?(ce.glowPopBlur.strengthX=He.blurX,[ce.glowPopBlur]):He.blurY>cf?(ce.springPopBlur.strengthY=He.blurY,[ce.springPopBlur]):void 0,yt=q==="glowpop"?ef(Me):null,Ct=yt?ye[yt]:void 0,Ut=He.glowPop;return R.jsxs(I.Fragment,{children:[q==="vhs"&&Be&&ce.vhs&&R.jsxs(R.Fragment,{children:[R.jsx("pixiText",{text:Ue,style:ce.vhs.cyan,x:gt+2,y:ze,anchor:.5,alpha:.7,eventMode:"none"}),R.jsx("pixiText",{text:Ue,style:ce.vhs.magenta,x:gt-2,y:ze,anchor:.5,alpha:.7,eventMode:"none"})]}),(q==="glowpop"||q==="springpop")&&AP.map(tn=>R.jsx("pixiText",{text:Ue,style:q==="springpop"?Re:ce.base,x:gt,y:ze,anchor:.5,alpha:He.alpha*(q==="springpop"?ax:$v),scale:He.scale,filters:[ce.bloomBlur],eventMode:"none"},tn)),q==="springpop"&&He.split!==void 0&&[[dx,-.5],[fx,.5]].map(([tn,i3])=>R.jsx("pixiText",{text:Ue,style:Re,tint:tn,x:gt,y:ze+i3*He.split,anchor:.5,alpha:He.alpha*hx,scale:He.scale,filters:en,eventMode:"none"},tn)),R.jsx("pixiText",{text:Ue,style:Re,x:gt,y:ze,anchor:.5,alpha:He.alpha,scale:He.scale,filters:en,eventMode:"none"}),Ct&&Ut&&R.jsxs(R.Fragment,{children:[R.jsx("pixiSprite",{texture:Ct,x:gt,y:ze-y*$d,anchor:.5,alpha:Ut.alpha*Jv,scale:Ut.emojiScale*y*Kd*1.1/(Ct.width||1),filters:[ce.bloomBlur],eventMode:"none"}),R.jsx("pixiSprite",{texture:Ct,x:gt,y:ze-y*$d,anchor:.5,alpha:Ut.alpha,scale:Ut.emojiScale*y*Kd/(Ct.width||1),eventMode:"none"})]})]},`${te.id}-word-${Le}`)}),be&&!ee&&R.jsxs(R.Fragment,{children:[q==="vhs"&&ce.vhs&&R.jsxs(R.Fragment,{children:[R.jsx("pixiText",{text:Lr(_e,$),style:ce.vhs.cyan,x:2,y:0,anchor:.5,alpha:.7,eventMode:"none"}),R.jsx("pixiText",{text:Lr(_e,$),style:ce.vhs.magenta,x:-2,y:0,anchor:.5,alpha:.7,eventMode:"none"})]}),R.jsx("pixiText",{text:Lr(_e,$),style:q!=="none"?ce.active:ce.base,x:0,y:0,anchor:.5,eventMode:"none"})]})]})};R1.displayName="PixiCaptionsTrack";const OP=I.memo(R1,(t,e)=>rt(t,e));var kf,L1;function MP(){if(L1)return kf;L1=1;var t=Rt(),e=function(){return t.Date.now()};return kf=e,kf}var Pf,k1;function IP(){if(k1)return Pf;k1=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return Pf=e,Pf}var Df,P1;function CP(){if(P1)return Df;P1=1;var t=IP(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return Df=n,Df}var Nf,D1;function RP(){if(D1)return Nf;D1=1;var t=CP(),e=Yn(),n=wo(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var f=o.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):i.test(c)?r:+c}return Nf=l,Nf}var Ff,N1;function LP(){if(N1)return Ff;N1=1;var t=Yn(),e=MP(),n=RP(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,c){var u,f,d,h,m,p,g=0,y=!1,_=!1,v=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,t(c)&&(y=!!c.leading,_="maxWait"in c,d=_?i(n(c.maxWait)||0,l):d,v="trailing"in c?!!c.trailing:v);function x(D){var N=u,F=f;return u=f=void 0,g=D,h=a.apply(F,N),h}function E(D){return g=D,m=setTimeout(M,l),y?x(D):h}function T(D){var N=D-p,F=D-g,H=l-N;return _?o(H,d-F):H}function A(D){var N=D-p,F=D-g;return p===void 0||N>=l||N<0||_&&F>=d}function M(){var D=e();if(A(D))return C(D);m=setTimeout(M,T(D))}function C(D){return m=void 0,v&&u?x(D):(u=f=void 0,h)}function k(){m!==void 0&&clearTimeout(m),g=0,u=p=f=m=void 0}function w(){return m===void 0?h:C(e())}function L(){var D=e(),N=A(D);if(u=arguments,f=this,p=D,N){if(m===void 0)return E(p);if(_)return clearTimeout(m),m=setTimeout(M,l),x(p)}return m===void 0&&(m=setTimeout(M,l)),h}return L.cancel=k,L.flush=w,L}return Ff=s,Ff}var kP=LP();const Bf=lr(kP),is=(t,e,n,r)=>{const i=O.useCallback(Bf(t,r),[t,r]),o=O.useCallback(Bf(e,r),[e,r]),s=O.useCallback(Bf(n,r),[n,r]),a=O.useCallback(()=>{i()},[i]),l=O.useCallback(()=>{o()},[o]),c=O.useCallback(()=>{s()},[s]);return{onPointerOver:a,onPointerDown:l,onPointerOut:c}},PP=new Set(["mp4","m4v","webm","ogg","ogv"]);function DP(t){const e=t.split("?")[0].split("#")[0],n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()}function F1({src:t,uniqueId:e,frameStartAt:n,fps:r=0,isRemotion:i=!1}){const[o,s]=O.useState(!1),[a,l]=O.useState(null),[c,u]=O.useState(null),[f,d]=O.useState(null),h=O.useRef(null),m=O.useRef(null),p=O.useRef(!1),g=O.useRef(!1),y=O.useMemo(()=>t||"",[t]),_=O.useRef(n);return _.current=n,O.useEffect(()=>{if(p.current=!1,l(null),s(!1),u(null),d(null),!y){s(!0);return}const v=_.current===0?.001:_.current;let x=!1;const E=5e3;let T=null;const A=()=>{T&&(clearTimeout(T),T=null)},M=(k,w)=>{const L=()=>{if(!p.current)try{k.update?.()}catch{}};w.addEventListener("seeked",L,{once:!0}),w.addEventListener("loadeddata",L,{once:!0}),L(),w.readyState>=HTMLMediaElement.HAVE_METADATA&&w.play().then(()=>{if(!p.current){try{w.pause(),w.currentTime=v}catch{}L()}}).catch(()=>{L()})},C=(k,w)=>{k.autoUpdate=!1,w.muted=!0,w.loop=!1,w.playsInline=!0,w.id=e;try{w.pause()}catch{}try{w.currentTime=v}catch{}m.current=w,d(w),M(k,w)};if(PP.has(DP(y))){g.current=!1,qx(y),x=!0;let k=!1;T=setTimeout(()=>{p.current||(k=!0,console.warn("[useVideoTexture] Assets.load timed out",y),l(new Error(`Video load timed out: ${y}`)))},E),K.Assets.load({src:y,data:{autoPlay:!1,autoUpdate:!1,muted:!0,loop:!1,playsinline:!0,crossorigin:"anonymous"}}).then(w=>{if(A(),p.current||k||!w)return;const L=w.source,D=L.resource;D&&C(L,D),h.current=w,u(w),s(!0)}).catch(w=>{A(),!(p.current||k)&&(console.error("[useVideoTexture] Assets.load failed",y,w),l(w))})}else{g.current=!0;let k=!1;T=setTimeout(()=>{p.current||(k=!0,console.warn("[useVideoTexture] direct video load timed out",y),l(new Error(`Video load timed out: ${y}`)))},E);const w=document.createElement("video");w.crossOrigin="anonymous",w.preload="auto",w.src=y;const L=()=>{if(p.current||k)return;A(),N();let F;try{F=new K.VideoSource({resource:w,autoPlay:!1,autoLoad:!1,crossorigin:"anonymous",alphaMode:"no-premultiply-alpha"})}catch(V){l(V);return}const H=new K.Texture({source:F});h.current=H,u(H),C(F,w),s(!0)},D=()=>{p.current||k||(A(),N(),console.error("[useVideoTexture] direct video load failed",y,w.error),l(new Error(w.error?.message||`Browser could not decode video: ${y}`)))},N=()=>{w.removeEventListener("loadeddata",L),w.removeEventListener("error",D)};w.addEventListener("loadeddata",L,{once:!0}),w.addEventListener("error",D,{once:!0}),w.load()}return()=>{if(p.current=!0,A(),m.current){try{m.current.pause()}catch{}m.current=null}if(x&&Vx(y),h.current){try{g.current&&h.current.destroy(!0)}catch{}h.current=null}u(null),d(null)}},[y,e]),{texture:c,videoElement:f,isLoaded:o,error:a}}function B1({getVideo:t,ready:e,muted:n,playbackRate:r}){const i=O.useRef({isPlaying:!1,progress:0,isMuted:!1,isWaiting:!1,isStalled:!1});return O.useEffect(()=>{const o=t();if(!o)return;const s=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},a=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},l=()=>{i.current.isWaiting=!0,i.current.isStalled=!1},c=()=>{i.current.isWaiting=!1,i.current.isStalled=!1},u=()=>{i.current.isWaiting=!1,i.current.isStalled=!0};return o.addEventListener("loadedmetadata",s),o.addEventListener("ended",a),o.addEventListener("loadstart",l),o.addEventListener("canplaythrough",c),o.addEventListener("stalled",u),()=>{o.removeEventListener("loadedmetadata",s),o.removeEventListener("ended",a),o.removeEventListener("loadstart",l),o.removeEventListener("canplaythrough",c),o.removeEventListener("stalled",u)}},[t,e]),O.useEffect(()=>{const o=t();o&&(o.muted=n,i.current.isMuted=n)},[t,n,e]),O.useEffect(()=>{const o=t();o&&(o.playbackRate=r||1)},[t,r,e]),i}function U1({textureRef:t,stateRef:e,ready:n,start:r,end:i,frameStartAt:o,uniqueId:s}){const a=O.useRef(null),{tl:l}=O.useContext(Ve),c=O.useCallback(()=>t.current?.source?.resource,[t]),u=O.useCallback(()=>t.current?.source,[t]);return tt(Ne.RESUME,()=>{e.current.isPlaying=!0;const f=c();f&&a.current?.isActive()&&f.play().catch(()=>{})},[c,e]),tt(Ne.PAUSE,()=>{e.current.isPlaying=!1;try{c()?.pause()}catch{}},[c,e]),O.useEffect(()=>{if(!l?.current||!n||!t.current)return;a.current&&(a.current.kill(),a.current=null);const f=()=>{const g=c();if(g){try{g.currentTime=Number(o),u()?.update?.()}catch{}e.current.progress=0,(e.current.isPlaying||l?.current?.isActive())&&g.play().catch(()=>{})}},d=()=>{const g=c(),y=u(),_=a.current;if(!g||!y||!_)return;e.current.progress=_.progress();let v=o+_.time();const x=g.duration;Number.isFinite(x)&&x>0&&(v=Math.min(v,x-.05)),v<0&&(v=0);try{const E=g.paused?.01:.25;Math.abs(g.currentTime-v)>E&&(g.currentTime=v),y.update?.()}catch{}},h=()=>{const g=c();if(g)try{g.pause()}catch{}e.current.isPlaying=!1,a.current&&(e.current.progress=a.current.progress())},m=Number(i)-Number(r);if(m<=0||!l.current)return;const p=S.context(()=>{a.current=S.to({progress:0},{duration:m,onStart:f,onUpdate:d,onComplete:h}),l.current.add(a.current,r);const g=Math.max(l.current.time(),.01);l.current.time(g,!1)});return()=>{a.current&&(a.current.kill(),S.killTweensOf(a.current),a.current=null),p.revert()}},[l,n,r,i,o,s,t,e]),a}const NP=({ref:t,...e})=>{const{uniqueId:n,mute:r=!1,volume:i=1,speed:o=1,src:s,startAt:a,endAt:l,frameStartAt:c,visible:u,disabled:f,transformation:{x:d,y:h,width:m,height:p,colorCorrection:g={},blendMode:y,border:_,roundedCorners:v,maskShape:x,effect:E,anchor:T=.5},pointerdown:A=()=>{},pointerout:M=()=>{},pointerover:C=()=>{},fps:k=0}=e,{isRemotion:w}=O.useContext(Ve),L=O.useRef(null),D=O.useRef(null),{onPointerDown:N,onPointerOut:F,onPointerOver:H}=is(C,A,M,1),V=lt({colorCorrection:g,effects:{name:E}}),$=s||"",{texture:re,videoElement:he,isLoaded:q,error:fe}=F1({src:$,uniqueId:n,frameStartAt:c,fps:k,isRemotion:w});O.useEffect(()=>{D.current=re},[re]);const Y=O.useCallback(()=>he??void 0,[he]),te=B1({getVideo:Y,ready:q,muted:r,playbackRate:o}),z=Math.max(0,Math.min(1,Number(i)||0));O.useEffect(()=>{const Q=Y();Q&&(Q.volume=z)},[Y,z,q]),U1({textureRef:D,stateRef:te,ready:q,start:a,end:l,frameStartAt:c,uniqueId:n}),O.useEffect(()=>{if(n){if(!$){es(n);return}return Wx(n),(q||fe)&&es(n),()=>Xx(n)}},[n,$,q,fe]);const le=O.useCallback(()=>{const Q=Y();Q&&(Q.pause(),te.current.isPlaying=!1)},[Y,te]);return tt(Ne.PAUSE,le,[le]),tt(Ne.SCRUBBER_CLICKED,le,[le]),tt(Ne.REVERSE_MODE_END,le,[le]),R.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:N,pointerover:H,pointerout:F,children:q&&re&&R.jsx(Pt,{x:d,y:h,width:m,height:p,border:_,roundedCorners:v,maskShape:x,spriteRef:L,children:R.jsx("pixiSprite",{label:`sprite-${n}`,texture:re,width:m,height:p,anchor:T,x:d,y:h,ref:L,alpha:u?1:0,...y!=null&&{blendMode:y},...!f&&u&&{interactive:!0,pointerdown:A},filters:V})})})},Uf=I.memo(NP,rt);Uf.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiVideoSprite"};const FP=({ref:t,...e})=>{const[n,r]=I.useState(),i=O.useRef(null),o=O.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h,blendMode:m},pointerdown:p=()=>{},pointerout:g=()=>{},pointerover:y=()=>{},canvasImageRef:_}=e,v=_&&_?.getCanvas(),{onPointerDown:x,onPointerOut:E,onPointerOver:T}=is(y,p,g,1),A=lt({colorCorrection:d,effects:{name:h},blendMode:m});return st.useTick(()=>{if(i.current&&i.current.texture){const M=i.current.texture.source;M&&typeof M.update=="function"&&M.update()}}),I.useEffect(()=>{if(!Ga(v)){const M=Array.isArray(v)?v[0]:v,C=K.Texture.from(M);r(C)}},[v]),R.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:x,pointerover:T,pointerout:E,children:R.jsx("pixiContainer",{ref:o,children:n&&R.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:p},filters:A})})})},BP=({isPlaying:t,forwardRef:e,...n})=>{const r=I.useRef(null);return I.useImperativeHandle(e,()=>r.current,[r]),I.useEffect(()=>{if(r.current===null)return;const i=r.current;i[t?"gotoAndPlay":"gotoAndStop"](i.currentFrame)},[t]),R.jsx("pixiAnimatedSprite",{ref:r,...n})},UP=I.memo(BP,rt),G1=O.createContext(null),Gf=()=>O.useContext(G1),j1=({children:t,startAt:e=0,endAt:n=0,uniqueId:r,hideOnExit:i,hideOnEntry:o,hideStart:s,hideEnd:a,zIndex:l=0,entranceOverlapSec:c=0,transitionIn:u,transitionOut:f,onSequenceContainerReady:d})=>{const h=O.useRef(null),m=O.useRef(null),p=O.useRef(null),g=O.useRef(null),[y,_]=O.useState("static"),v=Gf(),{tl:x,totalDuration:E=0,playerTimeRef:T,registerTimeUpdateListener:A,unregisterTimeUpdateListener:M}=O.useContext(Ve);O.useLayoutEffect(()=>{if(!x?.current||!h.current)return;const N=x.current,F=h.current,H=Number.isFinite(e)?Number(e):0,V=Number.isFinite(n)?Number(n):H,$=Number.isFinite(c)&&c>0?Math.min(c,Math.max(V-H,0)):0,re=Math.max(H-$,0),he=Number.isFinite(E)?Number(E):0,q=he>0?Math.max(re,Math.min(V,he)):Math.max(re,V),fe=Math.max(q-re,0),Y=(i||o)&&s!==void 0&&a!==void 0;let te=null,z=null,le=!1;Y&&(te=Math.max(re,Math.min(q,s)),z=Math.max(re,Math.min(q,a)),le=te<z),g.current&&(g.current.kill(),N.remove(g.current),g.current=null);const Q=typeof T?.current=="number"?T.current:0,ce=Q>=re-.001&&Q<=q+.001?1:0;if(g.current=S.timeline(),g.current.set(F,{alpha:ce}),le){const U=te-re,Z=z-re;if(Z<=0)g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:fe,ease:"none"});else{U>0?(g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:U,ease:"none"})):g.current.set(F,{alpha:0},0),g.current.to(F,{alpha:0,duration:Z-U,ease:"none"});const W=fe-Z;W>0?(g.current.set(F,{alpha:1},Z),g.current.to(F,{alpha:1,duration:W,ease:"none"})):g.current.set(F,{alpha:1},Z)}}else g.current.set(F,{alpha:1},0),g.current.to(F,{alpha:1,duration:fe,ease:"none"});g.current.set(F,{alpha:0}),N.add(g.current,re);const ye=N.time();return N.time(ye,!1),()=>{g.current&&(N.remove(g.current),g.current.progress(0).kill(),g.current=null),F&&(F.alpha=0)}},[e,n,E,r,i,o,s,a,c,x,T]),O.useEffect(()=>{if(!A||!M)return;const N=Number.isFinite(e)?Number(e):0,F=Number.isFinite(n)?Number(n):N,H=$=>{const he=$>=N-1&&$<=F+1?"static":"none";_(q=>q===he?q:(h.current&&(h.current.eventMode=he),he))};A(H);const V=T?.current;return typeof V=="number"&&H(V),()=>M(H)},[e,n,r,T,A,M]),O.useEffect(()=>{if(!(!d||!h.current))return d(h.current),()=>d(null)},[d]);const C=v?.registerSequence;O.useEffect(()=>{if(!(!r||!h.current||!C))return C({id:r,startAt:e,endAt:n,zIndex:l,container:h.current,transitionIn:u,transitionOut:f},r),()=>C(null,r)},[r,e,n,l,u,f,C]);const k=Number.isFinite(c)&&c>0?c:0,w=typeof T?.current=="number"?T.current:0,L=w>=e-k-.001&&w<=n+.001?1:0;return R.jsx("pixiContainer",{ref:h,alpha:L,eventMode:"static",zIndex:l,children:R.jsx("pixiContainer",{ref:p,children:R.jsx("pixiContainer",{ref:m,alpha:1,children:t})})})},GP=t=>{const{startAt:e,endAt:n}=t,{setTotalDuration:r}=O.useContext(Ve);return I.useEffect(()=>{r&&r(Number(n)+.2)},[e,n]),t.children};let H1=!1;const jP=()=>{H1||(H1=!0,console.warn("[reacthub-pixitweenjs] GL transitions need the WebGL renderer; skipping transition."))},HP=90,jf=({transitionPair:t,width:e,height:n,clock:r,resolveEndpoints:i,getLayerSets:o,hideEndpointsInWindow:s=!1,getRegion:a,fullCanvas:l=!1,maxRegionPixels:c=Wd})=>{const{app:u}=st.useApplication(),f=O.useRef(null),d=O.useRef(null),h=O.useRef(null),m=O.useRef(null),p=O.useRef(null),g=O.useRef(null),y=O.useRef(null),_=O.useRef(null),v=O.useRef(null),x=O.useRef(null),[E,T]=O.useState(!1),A=t?.config,M=A?.name||A?.type,C=r?.start??t?.timing.start??0,k=r?.end??t?.timing.end??C,w=r?.duration??t?.timing.duration??k-C,L=JSON.stringify(A?.params??{}),D=O.useMemo(()=>{if(!M)return null;const F=vv(M,{width:e,height:n,params:A?.params??{}});return F.setProgress(0),F},[M,L,e,n]);O.useEffect(()=>{m.current=D},[D]);const N=()=>{const F=v.current;if(F){for(const H of F)H.container.visible=H.visible;v.current=null}};return O.useEffect(()=>{if(!D||!t)return;let F=!1,H;const V=()=>{const $=f.current;if(F||!$||!u?.renderer)return!1;if(!ck(u.renderer))return jP(),!0;const re=h.current;re&&(re.parent?.removeChild(re),re.destroy({children:!0}),h.current=null),p.current&&p.current!==D&&(p.current.clearTextures(),p.current.destroy()),d.current||(d.current=fk());const he=new G.Mesh({geometry:d.current,shader:D.shader});return he.width=e,he.height=n,he.position.set(e/2,n/2),he.visible=!1,$.addChild(he),h.current=he,p.current=D,(!y.current||!_.current)&&(y.current?.destroy(!0),_.current?.destroy(!0),y.current=G.RenderTexture.create({width:e,height:n}),_.current=G.RenderTexture.create({width:e,height:n})),T(!0),!0};return V()||(H=setTimeout(()=>{H=void 0,V()},150)),()=>{F=!0,H!==void 0&&clearTimeout(H)}},[D,t,u,e,n]),O.useEffect(()=>()=>{N(),x.current=null,m.current?.clearTextures(),p.current?.clearTextures(),y.current?.destroy(!0),_.current?.destroy(!0),y.current=null,_.current=null;const F=h.current;F&&(F.parent?.removeChild(F),F.destroy({children:!0}),h.current=null);const H=p.current;H&&(H.destroy(),p.current=null),m.current&&m.current!==H&&m.current.destroy(),m.current=null,d.current?.destroy(),d.current=null,g.current?.destroy({children:!0}),g.current=null},[t?.pairId]),O.useEffect(()=>{if(!E||!r)return;const F=q=>{const fe=m.current,Y=h.current,te=u?.renderer;if(!fe||!Y||!te)return;const z=i();if(!(q>=C&&q<k)||!z.from||!z.to||!y.current||!_.current){Y.visible=!1,N(),x.current=null;return}const{fromLayers:Q,toLayers:ce}=o(q,z);if(!x.current){const W=l?null:a?.(z)??Ev([Tv(z.from),Tv(z.to)]);x.current=W&&W.width>1&&W.height>1?{x:W.x,y:W.y,width:Math.ceil(W.width),height:Math.ceil(W.height)}:{x:0,y:0,width:e,height:n}}const ye=x.current,U=lk(ye,c);for(const W of[y.current,_.current])(W.width!==ye.width||W.height!==ye.height||W.source.resolution!==U)&&W.source.resize(ye.width,ye.height,U);xv(te,g,Q,y.current,-ye.x,-ye.y),xv(te,g,ce,_.current,-ye.x,-ye.y),Y.width=ye.width,Y.height=ye.height,Y.position.set(ye.x+ye.width/2,ye.y+ye.height/2),fe.setTextures(y.current,_.current);const Z=Math.max(0,Math.min(1,(q-C)/w));fe.setProgress(r.ease?r.ease(Z):Z),Y.visible=!0,s&&!v.current&&(v.current=[z.from,z.to].map(W=>({container:W,visible:W.visible})),z.from.visible=!1,z.to.visible=!1)};let H=null,V=0;const $=q=>{H=q,V=HP,F(q)},re=()=>{H===null||V<=0||(V-=1,F(H))};u?.ticker?.add(re);const he=r.subscribe($);return()=>{u?.ticker?.remove(re),he()}},[E,r,C,k,w,i,o,a,s,l,c,u,e,n]),f},Y1=t=>!!t&&Number.isFinite(t.duration)&&t.duration>0&&!!t.name,W1=t=>{const e=[...t].sort((i,o)=>i.startAt-o.startAt||i.endAt-o.endAt||i.id.localeCompare(o.id)),n=[];for(const i of e){const o=e.filter(a=>a.id!==i.id&&a.endAt<=i.startAt).sort((a,l)=>l.endAt-a.endAt||l.startAt-a.startAt)[0],s=e.filter(a=>a.id!==i.id&&a.startAt>=i.endAt).sort((a,l)=>a.startAt-l.startAt||a.endAt-l.endAt)[0];if(Y1(i.transitionIn)&&(o||i.transitionIn.from)){const a=i.transitionIn;n.push({id:`${i.id}:transition-in`,from:a.from??o.id,to:a.to??i.id,name:a.name,startAt:i.startAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}if(Y1(i.transitionOut)&&(s||i.transitionOut.to)){const a=i.transitionOut;n.push({id:`${i.id}:transition-out`,from:a.from??i.id,to:a.to??s.id,name:a.name,startAt:i.endAt-a.duration,duration:a.duration,ease:a.ease,params:a.params,zIndex:i.zIndex+1})}}const r=new Map;for(const i of n){const o=[i.from,i.to,i.startAt,i.duration,i.name].join(":");r.has(o)||r.set(o,i)}return[...r.values()]},YP=({children:t})=>{const[e]=O.useState(()=>new Map),[n]=O.useState(()=>new Map),[r,i]=O.useState(0),o=O.useCallback((l,c)=>{const u=n.get(c);u&&u.container!==l?.container&&e.delete(c),l?(n.set(c,l),e.set(c,l.container)):n.delete(c),i(f=>f+1)},[e,n]),s=O.useMemo(()=>({containers:e,sequences:n,revision:r,registerSequence:o}),[e,n,r,o]),a=O.useMemo(()=>W1(n.values()),[n,r]);return R.jsxs(G1.Provider,{value:s,children:[t,a.map(l=>R.jsx(os,{name:l.name,startAt:l.startAt,duration:l.duration,ease:l.ease,params:l.params,from:l.from,to:l.to,zIndex:l.zIndex},l.id))]})},WP=(t,e,n="none")=>{const r=O.useContext(Ve),{playerTimeRef:i,registerTimeUpdateListener:o,unregisterTimeUpdateListener:s}=r,a=O.useCallback(l=>{const c=f=>l(f);o?.(c);const u=i?.current;return typeof u=="number"&&c(u),()=>s?.(c)},[i,o,s]);return O.useMemo(()=>({subscribe:a,start:t,end:t+e,duration:e,ease:S.parseEase(n)??S.parseEase("none")}),[a,t,e,n])},X1=(t,e)=>typeof t=="string"?e.get(t)??null:typeof t=="function"?t():t&&"current"in t?t.current:t,XP=(t,e)=>{const r=Gf()?.containers;return O.useCallback(()=>{const i=r??new Map;return{from:X1(t,i),to:X1(e,i)}},[t,e,r])},zP=[],qP=({name:t,startAt:e,duration:n,ease:r="none",params:i,from:o,to:s,region:a,width:l=1920,height:c=1080,scope:u,zIndex:f=1,fromGroup:d,toGroup:h,sharedLayers:m=zP})=>{const g=Gf()?.containers,y=WP(e,n,r),_=XP(o,s),v=O.useMemo(()=>({pairId:`${u}:${typeof o=="string"?o:"from"}:${typeof s=="string"?s:"to"}:${e}:${t}`,config:{type:t,name:t,duration:n,ease:r,params:i??{}},timing:{start:e,end:e+n,duration:n}}),[u,o,s,e,t,n,r,i]),x=O.useCallback((A,M)=>{const C=d??(typeof o=="string"?[o]:[]),k=h??(typeof s=="string"?[s]:[]),w=L=>[...new Set(L)].flatMap((N,F)=>{const H=g?.get(N);return H?[{container:H,zIndex:F}]:[]});if(u==="scene"){const L=w(C),D=w(k),N=w(m);return{fromLayers:[...L,...N],toLayers:[...D,...N]}}return{fromLayers:M.from?[{container:M.from,zIndex:0}]:[],toLayers:M.to?[{container:M.to,zIndex:0}]:[]}},[g,u,o,s,d,h,m]),E=O.useCallback(()=>a??null,[a]),T=jf({transitionPair:v,width:l,height:c,clock:y,resolveEndpoints:_,getLayerSets:x,hideEndpointsInWindow:u==="element",getRegion:a?E:void 0,fullCanvas:u==="scene"});return R.jsx("pixiContainer",{ref:T,zIndex:f,sortableChildren:!0})},Hf=O.memo(qP);Hf.displayName="TransitionMeshLayer";const VP=t=>R.jsx(Hf,{...t,scope:"element"}),os=O.memo(VP);os.displayName="PixiElementTransition";const KP=t=>R.jsx(Hf,{...t,scope:"scene"}),Yf=O.memo(KP);Yf.displayName="PixiSceneTransition";const $P=t=>t.scope==="element"?R.jsx(os,{...t}):R.jsx(Yf,{...t}),z1=O.memo($P);z1.displayName="PixiGlTransition";const ZP=({ref:t,...e})=>{const[n,r]=I.useState(),i=O.useRef(null),o=O.useRef(null),{visible:s,disabled:a,transformation:{x:l,y:c,width:u,height:f,colorCorrection:d={},effect:h},pointerdown:m=()=>{},pointerout:p=()=>{},pointerover:g=()=>{},canvasImageRef:y}=e,_=y&&y?.getCanvas(),{app:v}=st.useApplication(),{onPointerDown:x,onPointerOut:E,onPointerOver:T}=is(g,m,p,1),A=lt({colorCorrection:d,effects:{name:h}});return st.useTick(()=>{if(i.current&&i.current.texture){const M=i.current.texture.source;M&&typeof M.update=="function"&&M.update(),o.current&&v&&v.renderer.render(o.current)}}),I.useEffect(()=>{if(!Ga(_)){const M=Array.isArray(_)?_[0]:_,C=K.Texture.from(M);r(C)}},[_]),R.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:x,pointerover:T,pointerout:E,children:R.jsx("pixiContainer",{ref:o,children:n&&R.jsx("pixiSprite",{texture:n,width:u,height:f,anchor:.5,x:l,y:c,ref:i,alpha:s?1:0,...!a&&s&&{interactive:!0,pointerdown:m},filters:A})})})},JP=I.memo(ZP,rt),QP=({ref:t,...e})=>{const n=O.useRef(null),r=O.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c,height:u,colorCorrection:f={},effect:d,border:h,roundedCorners:m,maskShape:p}=o,g=lt({colorCorrection:f,effects:{name:d}});return st.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const _=K.Texture.from(y);r.current=_,n.current&&(n.current.texture=_)}}n.current?.texture&&n.current.texture.source?.update?.()}),R.jsx(Je,{...e,ref:t,children:R.jsx(Pt,{x:a,y:l,width:c,height:u,border:h,roundedCorners:m,maskShape:p,spriteRef:n,children:R.jsx("pixiSprite",{ref:n,texture:r.current||K.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},eD=I.memo(QP,rt),tD=({ref:t,...e})=>{const n=O.useRef(null),r=O.useRef(null),{visible:i=!0,transformation:o,canvasImageRef:s}=e,{x:a,y:l,width:c=100,height:u=100,colorCorrection:f={},effect:d,border:h,roundedCorners:m,maskShape:p}=o,g=lt({colorCorrection:f,effects:{name:d}});return st.useTick(()=>{if(!r.current&&s?.getCanvas){const y=s.getCanvas();if(y){const _=K.Texture.from(y);r.current=_,n.current&&(n.current.texture=_)}}n.current?.texture&&n.current.texture.source?.update?.()}),R.jsx(Je,{...e,ref:t,children:R.jsx(Pt,{x:a,y:l,width:c,height:u,border:h,roundedCorners:m,maskShape:p,spriteRef:n,children:R.jsx("pixiSprite",{ref:n,texture:r.current||K.Texture.EMPTY,width:c,height:u,anchor:.5,x:a,y:l,alpha:i?1:0,filters:g})})})},nD=I.memo(tD,rt),rD=({ref:t,...e})=>{const[n,r]=O.useState(null),i=O.useRef(null),o=O.useRef(null),{src:s,visible:a=!0,transformation:l,loop:c=!0,remotionFrame:u,fps:f=30}=e,{x:d,y:h,width:m=0,height:p=0,colorCorrection:g={},effect:y,border:_,roundedCorners:v,maskShape:x}=l,E=lt({colorCorrection:g,effects:{name:y}});O.useEffect(()=>{let A=!1;return K.Assets.load(s).then(M=>{A||r(M)}).catch(M=>{console.error("[PixiRemotionGifSprite] load failed",s,M)}),()=>{A=!0}},[s]),O.useEffect(()=>{const A=o.current;if(!A||u==null)return;const M=A.totalFrames;if(!M)return;const C=u/f,k=A.duration??0;if(k>0){const w=C*1e3%(c?k:k+1),L=Math.min(1,w/k);A.currentFrame=Math.min(M-1,Math.floor(L*M))}else{const w=Math.floor(C*f)%(c?M:M+1);A.currentFrame=Math.min(M-1,w)}},[u,f,c]);const T=u!=null;return R.jsx(Je,{...e,ref:t,isGif:!0,children:R.jsx("pixiContainer",{ref:i,children:n&&R.jsx(Pt,{x:d,y:h,width:m,height:p,border:_,roundedCorners:v,maskShape:x,spriteRef:o,children:R.jsx("pixiGifSprite",{ref:o,source:n,autoPlay:!T,autoUpdate:!T,loop:c,width:m,height:p,anchor:.5,x:d,y:h,alpha:a?1:0,filters:E})})})})},iD=I.memo(rD,rt),oD={isPlaying:!1,progress:0,speed:1,isMuted:!1,isWaiting:!1,loaded:!1,size:{width:50,height:50},isDragging:!1,totalFrames:0,totalDuration:0},sD=({ref:t,...e})=>{const[n,r]=I.useState(0),[i,o]=I.useState(!1),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(void 0),u=O.useRef(void 0),f=O.useRef(oD),d=I.useRef(void 0),h=O.useRef(document.body),{uniqueId:m,src:p,startAt:g,endAt:y,frameStartAt:_,frameEndAt:v,visible:x,disabled:E,loop:T=!1,transformation:{x:A,y:M,width:C,height:k,colorCorrection:w={},effect:L,anchor:D=.5},pointerdown:N=()=>{},pointerout:F=()=>{},pointerover:H=()=>{}}=e,{tl:V}=O.useContext(Ve);tt(Ne.PAUSE,()=>{c.current&&c.current.pause()});const{onPointerDown:$,onPointerOut:re,onPointerOver:he}=is(H,N,F,1),q=lt({colorCorrection:w,effects:{name:L}});I.useLayoutEffect(()=>{l.current=document.createElement("canvas"),l.current.setAttribute("id","lottieContainersvg"),l.current.setAttribute("id",`${m}lottieContainer`),l.current.setAttribute("width",`${C}`),l.current.setAttribute("height",`${k}`);const Y=h.current;return Y.appendChild(l.current),()=>{l.current&&Y.removeChild(l.current)}},[]),I.useEffect(()=>{async function Y(){c.current&&c.current.destroy(),l.current.removeAttribute("style"),c.current=mS.loadAnimation({container:l.current||document.getElementById("lottieroot"),renderer:"canvas",loop:!1,autoplay:!1,path:p,rendererSettings:{context:l.current.getContext("2d"),clearCanvas:!0,progressiveLoad:!1,preserveAspectRatio:"xMaxYMax meet"}}),c.current.addEventListener("data_ready",()=>{if(l.current&&l.current.setAttribute("style","display:none"),c.current&&c.current.renderer.canvasContext){const te=c.current.totalFrames;f.current.totalFrames=te;const z=c.current.getDuration();f.current.totalDuration=z;const le=c.current.renderer.canvasContext.canvas,Q=K.Texture.from(le);d.current=Q,o(!0),r(z)}}),c.current.addEventListener("loaded_images",()=>{}),c.current.addEventListener("complete",()=>{}),c.current.addEventListener("loopComplete",()=>{}),c.current.addEventListener("enterFrame",()=>{}),c.current.addEventListener("config_ready",()=>{console.log("config_ready",c.current)}),c.current.addEventListener("error",te=>{console.log("error",te)})}return Y(),()=>{c.current&&(c.current.removeEventListener("complete"),c.current.removeEventListener("config_ready"),c.current.removeEventListener("enterFrame"),c.current.removeEventListener("loaded_images"),c.current.removeEventListener("loopComplete"),c.current.removeEventListener("data_ready"),c.current.removeEventListener("error"),c.current.destroy())}},[p,m]),I.useEffect(()=>(d.current&&d.current.source?.update?.(),()=>{}),[i]);const fe=Y=>{if(c.current&&s.current&&u.current){const z=Y(u.current.time())/u.current.duration()*f.current.totalFrames,le=f.current.totalFrames;let Q=z;Q=Math.round(Math.floor(Q)),Q>=le?(c.current.goToAndStop(0,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!1):(c.current.goToAndStop(Q,!0),d.current&&d.current.source?.update?.(),f.current.isPlaying=!0)}};return I.useEffect(()=>{let Y=S.context(()=>{});if(a.current&&V.current&&n>0){const te=Number(y)-Number(g);u.current&&(u.current.kill(),V.current.remove(u.current)),Y=S.context(()=>{const z=S.utils.wrap(g,n);u.current=S.timeline({}).to(a.current,{duration:Number(te),onUpdate:fe,onUpdateParams:[z,_,v]},_),V.current.add(u.current,g)})}return()=>{u.current&&(u.current.kill(),S.killTweensOf(u.current)),Y.revert()}},[g,y,_,v,m,n,T]),R.jsx(Je,{...e,ref:t,ignoreTlForVideo:!0,pointerdown:$,pointerover:he,pointerout:re,children:R.jsx("pixiContainer",{ref:a,children:d.current&&R.jsx("pixiSprite",{texture:d.current,width:C,height:k,anchor:D,x:A,y:M,ref:s,alpha:x?1:0,...!E&&x&&{interactive:!0,pointerdown:N},filters:q})})})},Wf=I.memo(sD,rt);Wf.whyDidYouRender={logOnDifferentValues:!0,customName:"PixiLottieSprite"};class ss{currentID;dirtyID;_x;_y;_width;_height;_hull;constructor(e=0,n=0,r=0,i=0){this._x=Number(e),this._y=Number(n),this._width=Number(r),this._height=Number(i),this._hull=[new G.Point,new G.Point,new G.Point,new G.Point],this.currentID=-1,this.dirtyID=0}get x(){return this._x}set x(e){this._x=e,this.dirtyID++}get y(){return this._y}set y(e){this._y=e,this.dirtyID++}get width(){return this._width}set width(e){this._width=e,this.dirtyID++}get height(){return this._height}set height(e){this._height=e,this.dirtyID++}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}isDirty(){return this.currentID!==this.dirtyID}update(){const[e,n,r,i]=this._hull;e.set(this._x,this._y),n.set(this._x+this._width,this._y),r.set(this._x+this._width,this._y+this._height),i.set(this._x,this._y+this._height)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}clone(){return new ss(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}equals(e){return e?e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height:!1}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(r-n,0),this.y=i,this.height=Math.max(o-i,0),this}ceil(e=1,n=.001){const r=Math.ceil((this.x+this.width-n)*e)/e,i=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=r-this.x,this.height=i-this.y,this}enlarge(e){const n=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),o=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=r-n,this.y=i,this.height=o-i,this}}const q1=new G.Point;class as{innerBounds;currentID;dirtyID;_rotation;_center;_hull;_matrix;constructor(e=0,n=0,r=0,i=0,o=0){e instanceof ss&&(o=n||0,n=e.y,r=e.width,i=e.height,e=e.x),this.innerBounds=new ss(e,n,r,i),this._rotation=o,this._center=new G.ObservablePoint({_onUpdate:()=>this.updateCenter()},0,0),this._hull=[new G.Point,new G.Point,new G.Point,new G.Point],this._matrix=new G.Matrix,this.currentID=-1,this.dirtyID=0}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this.dirtyID++}get center(){return this.isDirty()&&this.update(),this._center}set center(e){this.center.copyFrom(e)}get hull(){return this.isDirty()&&this.update(),this._hull}get topLeft(){return this.isDirty()&&this.update(),this._hull[0]}get topRight(){return this.isDirty()&&this.update(),this._hull[1]}get bottomRight(){return this.isDirty()&&this.update(),this._hull[2]}get bottomLeft(){return this.isDirty()&&this.update(),this._hull[3]}equals(e){return e?this.innerBounds.equals(e.innerBounds)&&this.rotation===e.rotation:!1}contains(e,n){typeof e=="number"&&(e=q1.set(e,n));const r=this._matrix.applyInverse(e,q1);return this.innerBounds.contains(r.x,r.y)}copyFrom(e){return this.innerBounds.copyFrom(e.innerBounds),this.rotation=e.rotation,this.dirtyID++,this}isDirty(){return this.currentID!==this.dirtyID+this.innerBounds.dirtyID}update(){const e=this.innerBounds,n=this._rotation,r=this._center,[i,o,s,a]=this._hull,l=this._matrix;r._x=e.x+e.width/2,r._y=e.y+e.height/2,l.identity().translate(-r.x,-r.y).rotate(n).translate(r.x,r.y),l.apply(e.topLeft,i),l.apply(e.topRight,o),l.apply(e.bottomRight,s),l.apply(e.bottomLeft,a),this.currentID=this.dirtyID+this.innerBounds.dirtyID}updateCenter(){const e=this.center,n=this.innerBounds;n.x=e.x-n.width/2,n.y=e.y-n.height/2}}class V1{_history;_decayRatio;_currentIndex;_average=0;constructor(e,n){this._history=new Array(e),this._decayRatio=n,this._currentIndex=0;for(let r=0;r<e;r++)this._history[r]=0}next(e){const{_history:n,_decayRatio:r}=this,i=n.length;this._currentIndex=this._currentIndex<i-1?this._currentIndex+1:0,n[this._currentIndex]=e;let o=0,s=0;for(let a=this._currentIndex+1;a<i;a++)o=(o+n[a])*r,s=(s+1)*r;for(let a=0;a<=this._currentIndex;a++)o=(o+n[a])*r,s=(s+1)*r;return this._average=o/s,this._average}absDev(){let e=0;for(let n=0,r=this._history.length;n<r;n++)e+=Math.abs(this._history[n]-this._average);return e/this._history.length}}class K1{_freeList;_freeCount;_reserveCount;_borrowRate;_returnRate;_flowRate;_borrowRateAverage;_marginAverage;_capacityRatio;_decayRatio;_borrowRateAverageProvider;_marginAverageProvider;constructor(e={}){this._freeList=[],this._freeCount=0,this._borrowRate=0,this._returnRate=0,this._flowRate=0,this._borrowRateAverage=0,this._reserveCount=e.reserve||0,this._capacityRatio=e.capacityRatio||1.2,this._decayRatio=e.decayRatio||.67,this._marginAverage=0,this._borrowRateAverageProvider=new V1(128,this._decayRatio),this._marginAverageProvider=new V1(128,this._decayRatio)}get capacity(){return this._freeList.length}set capacity(e){this._freeList.length=Math.ceil(e)}allocate(){return++this._borrowRate,++this._flowRate,this._freeCount>0?this._freeList[--this._freeCount]:this.create()}allocateArray(e){let n,r;Array.isArray(e)?(n=e,r=e.length):(r=e,n=new Array(r)),this._borrowRate+=r,this._flowRate+=r;let i=0;if(this._freeCount>0){const o=this._freeList,s=Math.min(this._freeCount,r);let a=this._freeCount;for(let l=0;l<s;l++)n[i]=o[a-1],++i,--a;this._freeCount=a}for(;i<r;)n[i]=this.create(),++i;return n}release(e){++this._returnRate,--this._flowRate,this._freeCount===this.capacity&&(this.capacity*=this._capacityRatio),this._freeList[this._freeCount]=e,++this._freeCount}releaseArray(e){this._returnRate+=e.length,this._flowRate-=e.length,this._freeCount+e.length>this.capacity&&(this.capacity=Math.max(this.capacity*this._capacityRatio,this._freeCount+e.length));for(let n=0,r=e.length;n<r;n++)this._freeList[this._freeCount]=e[n],++this._freeCount}reserve(e){if(this._reserveCount=e,this._freeCount<e){const n=this._freeCount-e;for(let r=0;r<n;r++)this._freeList[this._freeCount]=this.create(),++this._freeCount}}limit(e){if(this._freeCount>e){this.capacity>e*this._capacityRatio&&(this.capacity=e*this._capacityRatio);const r=Math.min(this._freeCount,this.capacity);for(let i=e;i<r;i++)this._freeList[i]=null}}startGC(e=G.Ticker.shared){e.add(this._gcTick,null,G.UPDATE_PRIORITY.UTILITY)}stopGC(e=G.Ticker.shared){e.remove(this._gcTick)}_gcTick=()=>{this._borrowRateAverage=this._borrowRateAverageProvider.next(this._borrowRate),this._marginAverage=this._marginAverageProvider.next(this._freeCount-this._borrowRate);const e=this._borrowRateAverageProvider.absDev();this._flowRate=0,this._borrowRate=0,this._returnRate=0;const n=this._freeCount,r=this._freeList.length;if(n<128&&this._borrowRateAverage<128&&r<128)return;const i=Math.max(this._borrowRateAverage*(this._capacityRatio-1),this._reserveCount);if(this._freeCount>i+e){const o=i+e;this.capacity=Math.min(this._freeList.length,Math.ceil(o)),this._freeCount=this._freeList.length}}}const $1=new Map;class Z1{static build(e){let n=$1.get(e);return n||(n=new class extends K1{create(){return new e}},$1.set(e,n),n)}static buildFunctional(e){return new class extends K1{create=e}}}const J1={color:16777215,outlineColor:6514417,outlineThickness:2.5,radius:7,shape:"circle",glowColor:6514417,glowIntensity:.15};function Q1(t,e,n){const r=Math.max(1,n/28),i=Math.round(24*r);return`data:image/svg+xml;base64,${btoa(`
1514
1514
  <svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 24 24" fill="none">
1515
1515
  <circle cx="12" cy="12" r="10" fill="${t}"/>
1516
1516
  <path fill-rule="evenodd" clip-rule="evenodd"
@@ -1520,4 +1520,7 @@ void main() {
1520
1520
  d="M18.3617 10.4693C18.0689 10.1769 17.5946 10.1769 17.3018 10.4693L16.1335 11.636C15.9188 11.8504 15.8545 12.1731 15.9705 12.4534C16.0865 12.7338 16.3601 12.9167 16.6635 12.9167H17.0267C16.6636 15.3678 14.5479 17.25 11.9905 17.25C10.3464 17.25 8.88484 16.4729 7.9529 15.2638C7.70002 14.9358 7.22908 14.8748 6.90101 15.1277C6.57295 15.3806 6.512 15.8515 6.76487 16.1796C7.96886 17.7416 9.86205 18.75 11.9905 18.75C15.376 18.75 18.1667 16.2001 18.5395 12.9167H19C19.3035 12.9167 19.577 12.7338 19.693 12.4534C19.8091 12.1731 19.7447 11.8504 19.53 11.636L18.3617 10.4693Z"
1521
1521
  fill="${e}"/>
1522
1522
  </svg>
1523
- `.trim())}`}class Yt extends B.Graphics{constructor(e,n,r={},i,o,s){super(),this.transformer=e;const a=Object.assign({},c1,r);this._handle=n,this._style=a,this.onHandleDelta=i,this.onHandleCommit=o,this._dirty=!0,this.eventMode="static",this.cursor=s||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new B.Point,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp,this.draw()}transformer;onHandleDelta;onHandleCommit;_handle;_style;_dirty;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_rotatorSprite=null;_rotatorKey=null;static _rotatorTextureCache=new Map;static async loadTextures(e=[{bgColor:"#6366f1",arrowColor:"#ffffff",size:28}]){await Promise.all(e.map(({bgColor:n="#6366f1",arrowColor:r="#ffffff",size:i=28})=>{const o=`${n}:${r}:${i}`;if(Yt._rotatorTextureCache.has(o)){const l=Yt._rotatorTextureCache.get(o);return l instanceof Promise?l:Promise.resolve(l)}const s=l1(n,r,i),a=B.Assets.load(s).then(l=>(Yt._rotatorTextureCache.set(o,l),l));return Yt._rotatorTextureCache.set(o,a),a}))}get handle(){return this._handle}set handle(e){this._handle=e,this._dirty=!0,this.draw()}get style(){return this._style}set style(e){this._style=Object.assign({},c1,e),this._dirty=!0,this.draw()}draw(){const e=this._handle,n=this._style;this.clear();const r=e==="middleLeft"||e==="middleRight",i=e==="topCenter"||e==="bottomCenter",o=e==="rotator";n.glowColor&&n.glowIntensity&&n.glowIntensity>0&&!o&&this.drawGlowEffect(n,r||i),o?this.drawRotatorHandle(n):r||i?this.drawPillHandle(e,n):this.drawCornerHandle(n),this._dirty=!1}drawGlowEffect(e,n){const i=e.radius||7,o=i/7;if(n){const s=10*o,a=20*o,l=5*o,c=2*o;for(let u=0;u<3;u++){const f=(e.glowIntensity||.15)*(1-u/3)*.3,d=u*c;this.roundRect(-s/2-d,-a/2-d,s+d*2,a+d*2,l+d).fill({color:e.glowColor||6514417,alpha:f})}}else{const s=i*1.5;for(let a=0;a<3;a++){const l=(e.glowIntensity||.15)*(1-a/3)*.3,c=i+(s-i)*(a/3);this.circle(0,0,c).fill({color:e.glowColor||6514417,alpha:l})}}}drawCornerHandle(e){const n=e.radius||7;this.circle(0,0,n).fill({color:16777215}).stroke({width:e.outlineThickness||2.5,color:e.outlineColor||6514417})}drawPillHandle(e,n){const i=(n.radius||7)/7,o=e==="topCenter"||e==="bottomCenter",s=(o?20:10)*i,a=(o?10:20)*i,l=5*i;this.roundRect(-s/2,-a/2,s,a,l).fill({color:n.color||16777215}).stroke({width:n.outlineThickness||2.5,color:n.outlineColor||6514417})}drawRotatorHandle(e){const n=e.outlineColor??6514417,r=e.rotatorIconColor??16777215,i="#"+n.toString(16).padStart(6,"0"),o="#"+r.toString(16).padStart(6,"0"),a=(e.radius||7)/7,l=Math.round(28*a),c=`${i}:${o}:${l}`,u=Yt._rotatorTextureCache.get(c);if(this._rotatorSprite&&this._rotatorKey!==c&&(this.removeChild(this._rotatorSprite),this._rotatorSprite.destroy(),this._rotatorSprite=null,this._rotatorKey=null),u instanceof B.Texture){if(!this._rotatorSprite){const b=new B.Sprite(u);b.anchor.set(.5,.5);const x=u.width||l,v=u.height||l;b.scale.set(l/x,l/v),this.addChild(b),this._rotatorSprite=b,this._rotatorKey=c}return}if(u)u.then(()=>{this._dirty=!0,this.draw()});else{const b=l1(i,o,l),x=B.Assets.load(b).then(v=>(Yt._rotatorTextureCache.set(c,v),this._dirty=!0,this.draw(),v));Yt._rotatorTextureCache.set(c,x)}const f=Math.round(10*a),d=f*.55,h=Math.max(1.5,1.8*a);this.circle(0,0,f).fill({color:n});const p=-Math.PI*.85,m=-Math.PI*.15;this.arc(0,0,d,p,m,!1).stroke({width:h,color:r});const g=Math.PI*.15,y=Math.PI*.85;this.arc(0,0,d,g,y,!1).stroke({width:h,color:r})}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(e){this._pointerDown&&(this._pointerDragging?this.onDrag(e):this.onDragStart(e),e.stopPropagation())}onPointerUp(e){this._pointerDragging&&this.onDragEnd(e),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(e){this._pointerPosition.copyFrom(e.global),this._pointerDragging=!0}onDrag(e){const n=e.global;this.onHandleDelta&&this.onHandleDelta(n),this._pointerPosition.copyFrom(n)}onDragEnd(e){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function qo(t,e,n,r){const{x:i,y:o}=n,{x:s,y:a}=r;if(Math.abs(s-i)<.01)return Math.abs(t-i);if(Math.abs(a-o)<.01)return Math.abs(e-o);const l=(a-o)/(s-i);return Math.abs((l*t-e+(a-l*s))/Math.sqrt(l*l+1))}const u1=a1.build(B.Point),FP=[new B.Point,new B.Point,new B.Point,new B.Point],BP=new B.Matrix,Er=new B.Point,UP=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],GP=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],jP=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],HP=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],md=new Array(12),YP=[UP,GP,jP,HP];class XP extends B.Graphics{transformer;boxScalingHandles;constructor(e){super(),this.transformer=e,this.boxScalingHandles=[this.addChild(new B.Graphics),this.addChild(new B.Graphics),this.addChild(new B.Graphics),this.addChild(new B.Graphics)],this.boxScalingHandles.forEach(n=>{n.eventMode="static"}),this.boxScalingHandles[0].cursor=vi.topCenter,this.boxScalingHandles[1].cursor=vi.middleRight,this.boxScalingHandles[2].cursor=vi.bottomCenter,this.boxScalingHandles[3].cursor=vi.middleLeft}hitHandleType(e,n,r){const{boxRotationEnabled:i,boxRotationTolerance:o,boxScalingEnabled:s,boxScalingTolerance:a}=this.transformer,[l,c,u,f]=e.hull,{x:d,y:h}=n.applyInverse(r,Er);if(s){const p=qo(d,h,l,c)*n.d,m=qo(d,h,l,f)*n.a,g=qo(d,h,c,u)*n.a,y=qo(d,h,f,u)*n.d,b=Math.min(p,m,g,y);if(b<a)switch(b){case p:return"topCenter";case m:return"middleLeft";case g:return"middleRight";case y:return"bottomCenter"}}if(i&&!e.contains(d,h)){const p=Math.sqrt((l.x-d)**2+(l.y-h)**2),m=Math.sqrt((c.x-d)**2+(c.y-h)**2),g=Math.sqrt((f.x-d)**2+(f.y-h)**2),y=Math.sqrt((u.x-d)**2+(u.y-h)**2),b=Math.min(p,m,g,y);if(b<o*1.45)switch(b){case p:return"boxRotateTopLeft";case m:return"boxRotateTopRight";case g:return"boxRotateBottomLeft";case y:return"boxRotateBottomRight"}}return null}drawBounds(e){const n=FP;for(let r=0;r<4;r++)this.transformer.projectToLocal(e.hull[r],n[r]);this.poly(n)}drawBoxScalingTolerance(e,n=this.transformer.boxScalingTolerance){e.innerBounds.pad(-n);const r=u1.allocateArray(4);r.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(2.5*n);const i=u1.allocateArray(4);i.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let o=0;o<4;o++){const s=r[o],a=r[(o+1)%4],l=i[o],c=i[(o+1)%4];this.boxScalingHandles[o].clear().poly([s,l,c,a]).fill({color:16777215,alpha:1e-4})}}drawBoxRotationTolerance(){const{boxRotateTopLeft:e,boxRotateTopRight:n,boxRotateBottomLeft:r,boxRotateBottomRight:i}=this.transformer.handleAnchors,o=this.transformer.boxRotationTolerance*2,s=BP.identity().scale(o,o).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=YP[a];let c;switch(a){case 0:c=e;break;case 1:c=n;break;case 2:c=r;break;case 3:c=i;break}for(let u=0;u<l.length;u+=2){const f=l[u],d=l[u+1];Er.set(f,d),s.apply(Er,Er),md[u]=Er.x+c.x,md[u+1]=Er.y+c.y}this.poly(md.slice())}}projectToLocal(e,n){return this.transformer.projectToLocal(e,n)}}const f1=new B.Matrix;function d1(t){const e=f1.identity();return e.c=Math.tan(t),e}function h1(t){const e=f1.identity();return e.b=Math.tan(t),e}function p1(t,e,n,r=t.pivot){const i=e.a,o=e.b,s=e.c,a=e.d,l=-Math.atan2(-s,a),c=Math.atan2(o,i);return n=n??c,t.pivot.set(r.x,r.y),t.rotation=n,t.skew.x=n+l,t.skew.y=-n+c,t.scale.x=Math.sqrt(i*i+o*o),t.scale.y=Math.sqrt(s*s+a*a),t.position.x=e.tx+(r.x*e.a+r.y*e.c),t.position.y=e.ty+(r.x*e.b+r.y*e.d),t}const Vo=new B.Matrix,WP=new B.Matrix,Xt=new B.Transform;function zP(t,e,n){t.updateLocalTransform();const r=t.worldTransform,i=t.parent?WP.copyFrom(t.parent.worldTransform):B.Matrix.IDENTITY;Vo.copyFrom(r),Vo.prepend(e),Vo.prepend(i.clone().invert()),p1(Xt,Vo),t.position.set(Xt.position.x,Xt.position.y),t.scale.set(Xt.scale.x,Xt.scale.y),t.pivot.set(Xt.pivot.x,Xt.pivot.y),t.rotation=Xt.rotation,t.skew.set(Xt.skew.x,Xt.skew.y)}const gd=new B.Transform,qP=[new B.Point,new B.Point,new B.Point,new B.Point],Sr=new B.Matrix,cn=new B.Point,Ko=new zo,m1=[new B.Point,new B.Point,new B.Point,new B.Point],g1=new B.Point,y1=new B.Matrix,Zo=a1.build(B.Point),vi={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},$o=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],_1={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},VP=[...$o,"rotator","skewHorizontal","skewVertical"],KP=4,ZP=16,$P=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],JP=Math.PI/90,QP=[Math.PI/4,-Math.PI/4],eN=Math.PI/90,Tn={color:6514417,thickness:2};let tN=class fn extends B.Container{_group;get group(){return this._group}set group(e){this._group=e?[...e]:[],this._focusedElementIndex=this._group.length>0?0:-1,this.updateElementIndexMap(),this.lazyDirty=!0}boundingBoxes;boxRotationEnabled;boxRotationTolerance;boxScalingEnabled;boxScalingTolerance;centeredScaling;cursors;individualBorderColor;individualBorderThickness;individualBorderAlpha;individualBorderStyle;individualBorderDashPattern;nestedSelectionEnabled;focusedElementBorderColor;focusedElementBorderThickness;focusedElementBorderStyle;focusedElementBorderDashPattern;showNonFocusedBorders;lazyMode=!1;lazyDirty=!1;lockAspectRatio;projectionTransform;rotationSnaps;rotationSnapTolerance;skewRadius;skewSnaps;skewSnapTolerance;stage;translateEnabled;transientGroupTilt;groupBounds;handles;handleAnchors;wireframe;_enabledHandles=void 0;_rotateEnabled;_scaleEnabled;_skewEnabled;_skewX;_skewY;_transformHandle=null;_transformType;_handleStyle;_wireframeStyle;_colorTheme;_rotatorAnchorConfig;_focusedElementIndex;_elementIndexMap;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_transformStarted;_clickThreshold;_clickStartPosition;_elementClickCandidate;constructor(e={}){super(),this.eventMode="static",this.cursors=Object.assign({default:"move"},e.cursors),this.cursor=this.cursors.default,this.boundingBoxes=e.boundingBoxes||"all",this._group=e.group||[],this.boxRotationTolerance=e.boxRotationTolerance||ZP,this.boxScalingTolerance=e.boxScalingTolerance||KP,this.centeredScaling=!!e.centeredScaling,this.projectionTransform=new B.Matrix,this.lockAspectRatio=e.lockAspectRatio===!0,this.rotationSnaps=e.rotationSnaps||$P,this.rotationSnapTolerance=e.rotationSnapTolerance!==void 0?e.rotationSnapTolerance:JP,this.skewRadius=e.skewRadius||64,this.skewSnaps=e.skewSnaps||QP,this.skewSnapTolerance=e.skewSnapTolerance!==void 0?e.skewSnapTolerance:eN,this.boxRotationEnabled=e.boxRotationEnabled===!0,this.boxScalingEnabled=e.boxScalingEnabled===!0,this._rotateEnabled=e.rotateEnabled!==!1,this._scaleEnabled=e.scaleEnabled!==!1,this._skewEnabled=e.skewEnabled===!0,this.translateEnabled=e.translateEnabled!==!1,this.transientGroupTilt=e.transientGroupTilt!==void 0?e.transientGroupTilt:!0,this.wireframe=this.addChild(new XP(this)),this.wireframe.cursor="none",this.stage=e.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e.colorTheme},this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e.rotatorAnchor},this.individualBorderColor=e.individualBorderColor!==void 0?e.individualBorderColor:54527,this.individualBorderThickness=e.individualBorderThickness,this.individualBorderAlpha=e.individualBorderAlpha!==void 0?e.individualBorderAlpha:1,this.individualBorderStyle=e.individualBorderStyle||"solid",this.individualBorderDashPattern=e.individualBorderDashPattern||[8,4],this.nestedSelectionEnabled=e.nestedSelectionEnabled!==void 0?e.nestedSelectionEnabled:!0,this.focusedElementBorderColor=e.focusedElementBorderColor!==void 0?e.focusedElementBorderColor:9133302,this.focusedElementBorderThickness=e.focusedElementBorderThickness,this.focusedElementBorderStyle=e.focusedElementBorderStyle||"dashed",this.focusedElementBorderDashPattern=e.focusedElementBorderDashPattern||[8,4],this.showNonFocusedBorders=e.showNonFocusedBorders!==void 0?e.showNonFocusedBorders:!1,this._focusedElementIndex=this._group.length>0?0:-1,this._elementIndexMap=new WeakMap,this.updateElementIndexMap(),this._wireframeStyle=Object.assign({},Tn,{color:this._colorTheme.primary},e.wireframeStyle||{});const n=e.handleConstructor||Yt,r={outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity,...e.handleStyle};this._handleStyle=r;const i="#"+(r.outlineColor??6514417).toString(16).padStart(6,"0"),o="#"+(r.rotatorIconColor??16777215).toString(16).padStart(6,"0"),s=Math.round(28*((r.radius??7)/7));Yt.loadTextures([{bgColor:i,arrowColor:o,size:s}]).catch(()=>{});const a={rotator:this.addChild(new n(this,"rotator",r,u=>{this.rotateGroup("rotator",u)},this.commitGroup))},l=$o.reduce((u,f)=>{const d=new n(this,f,r,()=>{},this.commitGroup,vi[f]);return d.onHandleDelta=h=>{this.scaleGroup(d.handle,h)},d.visible=this._scaleEnabled,u[f]=d,this.addChild(u[f]),u},{}),c={skewHorizontal:this.addChild(new n(this,"skewHorizontal",r,u=>{this.skewGroup("skewHorizontal",u)},this.commitGroup,"pointer")),skewVertical:this.addChild(new n(this,"skewVertical",r,u=>{this.skewGroup("skewVertical",u)},this.commitGroup,"pointer"))};this.handles=Object.assign({},l,a,c),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new B.Point,boxRotateTopLeft:new B.Point,boxRotateTopRight:new B.Point,boxRotateBottomLeft:new B.Point,boxRotateBottomRight:new B.Point,topLeft:new B.Point,topCenter:new B.Point,topRight:new B.Point,middleLeft:new B.Point,middleCenter:new B.Point,middleRight:new B.Point,bottomLeft:new B.Point,bottomCenter:new B.Point,bottomRight:new B.Point,skewHorizontal:new B.Point,skewVertical:new B.Point},this.groupBounds=new zo,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new B.Point,this._pointerMoveTarget=null,this._transformStarted=!1,this._clickThreshold=e.clickThreshold||5,this._clickStartPosition=new B.Point,this._elementClickCandidate=-1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.on("pointerdown",this.onPointerDown),this.on("pointerup",this.onPointerUp),this.on("pointerupoutside",this.onPointerUp),this.onRender=()=>{this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw()}}get enabledHandles(){return this._enabledHandles}get clickThreshold(){return this._clickThreshold}set clickThreshold(e){this._clickThreshold=e}set enabledHandles(e){const n=!!e&&e.length>0;!(this._enabledHandles&&this._enabledHandles.length>0)&&!n||(this._enabledHandles=n?e:void 0,VP.forEach(i=>{const o=this.handles[i];o&&(o.visible=!1)}),n?e.forEach(i=>{const o=this.handles[i];o&&(o.visible=!0)}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,$o.forEach(i=>{i!=="middleCenter"&&(this.handles[i].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(e){const n=this.handles;for(const r in n){const i=n[r];i&&(i.style=e)}this._handleStyle=e}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(e){if(this._rotateEnabled!==e){if(this._rotateEnabled=e,this._enabledHandles)return;this.handles.rotator.visible=e}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(e){if(this._scaleEnabled!==e){if(this._scaleEnabled=e,this._enabledHandles)return;$o.forEach(n=>{n!=="middleCenter"&&(this.handles[n].visible=e)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(e){if(this._skewEnabled!==e){if(this._skewEnabled=e,this._enabledHandles)return;this.handles.skewHorizontal.visible=e,this.handles.skewVertical.visible=e}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(e){this._wireframeStyle=Object.assign({},Tn,e)}get colorTheme(){return this._colorTheme}set colorTheme(e){this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e},this._handleStyle={...this._handleStyle,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity},this._wireframeStyle={...this._wireframeStyle,color:this._colorTheme.primary},this.redrawAllHandles()}get rotatorAnchor(){return this._rotatorAnchorConfig}set rotatorAnchor(e){this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e}}get focusedElement(){return this._focusedElementIndex>=0&&this._focusedElementIndex<this._group.length?this._group[this._focusedElementIndex]:null}set focusedElementIndex(e){if(e>=-1&&e<this._group.length){const n=this._focusedElementIndex;this._focusedElementIndex=e,this.lazyDirty=!0,n!==e&&(e>=0&&e<this._group.length?this.emit("elementfocused",this._group[e],e):this.emit("elementfocuscleared"))}}get focusedElementIndex(){return this._focusedElementIndex}focusElement(e){const n=this._elementIndexMap.get(e);n!==void 0&&(this._focusedElementIndex=n,this.lazyDirty=!0,this.emit("elementfocused",e,n))}clearElementFocus(){this._focusedElementIndex=-1,this.lazyDirty=!0,this.emit("elementfocuscleared")}focusNextElement(){this._group.length!==0&&(this._focusedElementIndex=(this._focusedElementIndex+1)%this._group.length,this.lazyDirty=!0,this.emit("elementfocused",this.focusedElement,this._focusedElementIndex))}updateElementIndexMap(){this._elementIndexMap=new WeakMap,this._group.forEach((e,n)=>{this._elementIndexMap.set(e,n),this.setupElementInteraction(e,n)})}setupElementInteraction(e,n){"eventMode"in e&&(e.eventMode="none"),"interactive"in e&&(e.interactive=!1),"interactiveChildren"in e&&(e.interactiveChildren=!0)}redrawAllHandles(){Object.values(this.handles).forEach(e=>{e&&(e.style={...e.style,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity})})}drawRotatorAnchorDot(e,n,r,i,o,s){const a=this._rotatorAnchorConfig;if(!a.enabled)return;const l=r-e,c=i-n,u=Math.sqrt(l*l+c*c),f=l/u,d=c/u,p=(this._handleStyle.radius||7)/7,m=a.startPosition||.45,g=Math.min(.8,m+(p-1)*.1),y=u*(a.segmentLength||.005),b=u*g,x=a.color||s,v=a.thickness||o,T=e+f*b,w=n+d*b,O=T+f*y,C=w+d*y;switch(a.style){case"dashed":this.drawDashedLine(T,w,O,C,v,x);break;case"dotted":this.drawDottedLine(T,w,O,C,v,x);break;default:this.wireframe.moveTo(T,w).lineTo(O,C).stroke({width:v,color:x});break}}drawDashedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dashPattern||[8,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),p=u/d,m=f/d;for(let g=0;g<h;g++){const y=e+p*g*(l+c),b=n+m*g*(l+c),x=y+p*l,v=b+m*l;this.wireframe.moveTo(y,b).lineTo(x,v).stroke({width:o,color:s})}}drawDottedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dotPattern||[2,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),p=u/d,m=f/d;for(let g=0;g<h;g++){const y=e+p*g*(l+c),b=n+m*g*(l+c);this.wireframe.circle(y,b,l).fill({color:s})}}drawDashedBounds(e,n,r,i,o,s=1){const{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=e;this.drawDashedLineSegment(a.x,a.y,l.x,l.y,n,r,i,o,s),this.drawDashedLineSegment(l.x,l.y,u.x,u.y,n,r,i,o,s),this.drawDashedLineSegment(u.x,u.y,c.x,c.y,n,r,i,o,s),this.drawDashedLineSegment(c.x,c.y,a.x,a.y,n,r,i,o,s)}drawDottedBounds(e,n,r,i,o=1){const{topLeft:s,topRight:a,bottomLeft:l,bottomRight:c}=e;this.drawDottedLineSegment(s.x,s.y,a.x,a.y,n,r,i,o),this.drawDottedLineSegment(a.x,a.y,c.x,c.y,n,r,i,o),this.drawDottedLineSegment(c.x,c.y,l.x,l.y,n,r,i,o),this.drawDottedLineSegment(l.x,l.y,s.x,s.y,n,r,i,o)}drawDashedLineSegment(e,n,r,i,o,s,a,l,c=1){const u=r-e,f=i-n,d=Math.sqrt(u*u+f*f);if(d===0)return;const h=u/d,p=f/d,m=Math.floor(d/(o+s));for(let y=0;y<m;y++){const b=e+h*y*(o+s),x=n+p*y*(o+s),v=Math.min(r,b+h*o),T=Math.min(i,x+p*o);this.wireframe.moveTo(b,x).lineTo(v,T).stroke({width:l,color:a,alpha:c})}const g=d-m*(o+s);if(g>0){const y=e+h*m*(o+s),b=n+p*m*(o+s),x=Math.min(o,g),v=y+h*x,T=b+p*x;this.wireframe.moveTo(y,b).lineTo(v,T).stroke({width:l,color:a,alpha:c})}}drawDottedLineSegment(e,n,r,i,o,s,a,l=1){const c=r-e,u=i-n,f=Math.sqrt(c*c+u*u);if(f===0)return;const d=c/f,h=u/f,p=o*2+s,m=Math.max(1,Math.floor(f/p)+1),g=m>1?f/(m-1):0;for(let y=0;y<m;y++){const b=g*y,x=e+d*b,v=n+h*b;this.wireframe.circle(x,v,o).fill({color:a,alpha:l})}}getGroupBounds(e=!1){return e&&this.updateGroupBounds(),this.groupBounds}translateGroup=e=>{this._transformHandle=null,this._transformType="translate";const n=Sr.identity().translate(e.x,e.y);this.emitTransformStart(),this.prependTransform(n)};rotateGroup=(e,n)=>{this._transformHandle=e,this._transformType="rotate";const r=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[e],cn);this.projectionTransform.applyInverse(i,i),n=this.projectionTransform.applyInverse(n,g1);const o=r.center,s=Math.atan2(i.y-o.y,i.x-o.x);let l=Math.atan2(n.y-o.y,n.x-o.x)-s,c=this.groupBounds.rotation+l;c=this.snapAngle(c,this.rotationSnapTolerance,this.rotationSnaps),l=c-this.groupBounds.rotation;const u=Sr.identity().translate(-o.x,-o.y).rotate(l).translate(o.x,o.y);this.emitTransformStart(),this.prependTransform(u,!0),this.updateGroupBounds(c),this._skewX+=l,this._skewY+=l};scaleGroup=(e,n)=>{this._transformHandle=e,this._transformType="scale";const r=_1[e].x,i=_1[e].y,o=this.handles,s=this.groupBounds,a=s.rotation,l=s.innerBounds,c=this.worldTransform.apply(this.handleAnchors[e],cn);this.projectionTransform.applyInverse(c,c),n=this.projectionTransform.applyInverse(n,g1);const u=n.x-c.x,f=n.y-c.y,d=(s.topRight.x-s.topLeft.x)/l.width,h=(s.topRight.y-s.topLeft.y)/l.width,p=(s.bottomLeft.x-s.topLeft.x)/l.height,m=(s.bottomLeft.y-s.topLeft.y)/l.height,g=u*d+f*h,y=u*p+f*m;let b=1,x=1;r!==0&&(b=1+g*r/l.width),i!==0&&(x=1+y*i/l.height);const v=this.lockAspectRatio&&(e==="topLeft"||e==="topRight"||e==="bottomLeft"||e==="bottomRight"),T=.01;if(b<T&&(b=T),x<T&&(x=T),v){const C=Math.abs(b),R=Math.abs(x),P=.001;if(C>R+P)x=b;else if(R>C+P)b=x;else{const A=(b+x)/2;b=A,x=A}}let w;this.centeredScaling?w=s.center:r===1&&i===1?w=s.topLeft:r===-1&&i===1?w=s.topRight:r===1&&i===-1?w=s.bottomLeft:r===-1&&i===-1?w=s.bottomRight:i===1?w=new B.Point((s.topLeft.x+s.topRight.x)/2,(s.topLeft.y+s.topRight.y)/2):i===-1?w=new B.Point((s.bottomLeft.x+s.bottomRight.x)/2,(s.bottomLeft.y+s.bottomRight.y)/2):r===1?w=new B.Point((s.topLeft.x+s.bottomLeft.x)/2,(s.topLeft.y+s.bottomLeft.y)/2):r===-1?w=new B.Point((s.topRight.x+s.bottomRight.x)/2,(s.topRight.y+s.bottomRight.y)/2):w=s.center;const O=Sr.identity().translate(-w.x,-w.y).rotate(-a).scale(b,x).rotate(a).translate(w.x,w.y);if(this.emitTransformStart(),(x<0||b<0)&&!(x<0&&b<0))switch(e){case"topLeft":case"bottomLeft":this.swapHandles(o.topLeft,o.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(o.topCenter,o.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(o.topRight,o.bottomRight);break}this.prependTransform(O)};skewGroup=(e,n)=>{this._transformHandle=e,this._transformType="skew";const r=this.groupBounds,i=cn.copyFrom(n);this.projectionTransform.applyInverse(i,i);const o=r.center,s=Sr.identity().translate(-o.x,-o.y);let a=this.groupBounds.rotation;if(e==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-o.y,i.x-o.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),s.prepend(h1(-l)),s.prepend(h1(this._skewX))}else{const l=this._skewY,c=Math.atan2(i.y-o.y,i.x-o.x)-Math.PI/2;this._skewY=c,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),s.prepend(d1(l)),s.prepend(d1(-this._skewY)),a-=this._skewY-l}s.translate(o.x,o.y),this.emitTransformStart(),this.prependTransform(s,!0),this.updateGroupBounds(a)};commitGroup=()=>{const e=this._transformHandle,n=this._transformType;this._transformHandle=null,this._transformType="none",this._transformStarted=!1,this.transientGroupTilt!==!1&&this._group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit",this.buildCommitPayload(e,n))};buildCommitPayload(e,n){const r=this.groupBounds,i=r.innerBounds;return{groupBounds:{x:i.x,y:i.y,width:i.width,height:i.height,rotation:r.rotation,centerX:r.center.x,centerY:r.center.y},elements:this._group.map(o=>({x:o.position.x,y:o.position.y,width:o.width??0,height:o.height??0,rotation:o.rotation,scaleX:o.scale.x,scaleY:o.scale.y,skewX:o.skew.x,skewY:o.skew.y,pivotX:o.pivot.x,pivotY:o.pivot.y})),handle:e,transformType:n}}draw(){const e=this._group,n=this._wireframeStyle.color??Tn.color,r=this._wireframeStyle.thickness??Tn.thickness;if(this.wireframe.clear(),e.length>1&&this.boundingBoxes==="all"){const a=this.individualBorderThickness||r,l=this.focusedElementBorderThickness||r;for(let c=0,u=e.length;c<u;c++){const f=this.nestedSelectionEnabled&&this._focusedElementIndex===c;if(!this.nestedSelectionEnabled||f||this.showNonFocusedBorders&&this._focusedElementIndex===-1){const h=fn.calculateOrientedBounds(e[c],Ko);if(f){const[p,m]=this.focusedElementBorderDashPattern;this.focusedElementBorderStyle==="dashed"?this.drawDashedBounds(h,p,m,this.focusedElementBorderColor,l,1):this.focusedElementBorderStyle==="dotted"?this.drawDottedBounds(h,p,m,this.focusedElementBorderColor,1):(this.wireframe.drawBounds(h),this.wireframe.stroke({width:l,color:this.focusedElementBorderColor,alpha:1}))}else{const[p,m]=this.individualBorderDashPattern;if(this.individualBorderStyle==="dashed")this.drawDashedBounds(h,p,m,this.individualBorderColor,a,this.individualBorderAlpha);else if(this.individualBorderStyle==="dotted")this.drawDottedBounds(h,p,m,this.individualBorderColor,this.individualBorderAlpha);else{const g=h.innerBounds;this.wireframe.rect(g.x,g.y,g.width,g.height).stroke({width:a,color:this.individualBorderColor,alpha:this.individualBorderAlpha})}}}}}const s=e.length!==1?fn.calculateGroupOrientedBounds(e,this.groupBounds.rotation,Ko,!0):fn.calculateOrientedBounds(e[0],Ko);this.wireframe.drawBounds(s),this.translateEnabled&&this.wireframe.fill({color:16777215,alpha:1e-4}),this.boundingBoxes!=="none"&&this.wireframe.stroke({width:r,color:n}),this.drawHandles(s),this.groupBounds.copyFrom(s),this.boxRotationEnabled&&(this.wireframe.drawBoxRotationTolerance(),this.wireframe.fill({color:16777215,alpha:1e-4})),this.boxScalingEnabled&&this.wireframe.drawBoxScalingTolerance(s),this.lazyDirty=!1}drawHandles(e){const n=this.handles,r=this.handleAnchors,{topLeft:i,topRight:o,bottomLeft:s,bottomRight:a,center:l}=e,[c,u,f,d]=m1,h=cn;if(this.projectToLocal(i,c),this.projectToLocal(o,u),this.projectToLocal(s,f),this.projectToLocal(a,d),this.projectToLocal(l,h),r.topLeft.copyFrom(c),r.topCenter.set((c.x+u.x)/2,(c.y+u.y)/2),r.topRight.copyFrom(u),r.middleLeft.set((c.x+f.x)/2,(c.y+f.y)/2),r.middleCenter.set((c.x+d.x)/2,(c.y+d.y)/2),r.middleRight.set((u.x+d.x)/2,(u.y+d.y)/2),r.bottomLeft.copyFrom(f),r.bottomCenter.set((f.x+d.x)/2,(f.y+d.y)/2),r.bottomRight.copyFrom(d),this.boxRotationEnabled&&(r.boxRotateTopLeft.copyFrom(r.topLeft),r.boxRotateTopRight.copyFrom(r.topRight),r.boxRotateBottomLeft.copyFrom(r.bottomLeft),r.boxRotateBottomRight.copyFrom(r.bottomRight)),this._rotateEnabled){const p=(c.x+u.x)/2,m=(c.y+u.y)/2;let g=-(c.y-u.y),y=c.x-u.x;const b=this._handleStyle.radius||7,x=32,v=b/7,T=x*v,w=Math.sqrt(g*g+y*y);g*=T/w,y*=T/w;const O=n.rotator;O.position.x=p+g,O.position.y=m+y;const C=this._wireframeStyle.color??Tn.color,R=this._wireframeStyle.thickness??Tn.thickness;this.drawRotatorAnchorDot(p,m,O.position.x,O.position.y,R,C),this.handleAnchors.rotator.copyFrom(O.position)}if(this._skewEnabled){const p=h.x,m=h.y;this.worldTransform.apply(h,h),r.skewHorizontal.set(h.x+Math.cos(this._skewX)*this.skewRadius,h.y+Math.sin(this._skewX)*this.skewRadius),r.skewVertical.set(h.x+-Math.sin(this._skewY)*this.skewRadius,h.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(r.skewHorizontal,r.skewHorizontal),this.worldTransform.applyInverse(r.skewVertical,r.skewVertical),h.set(p,m);const g=this._wireframeStyle.color??Tn.color,y=this._wireframeStyle.thickness??Tn.thickness,b=n.skewHorizontal,x=n.skewVertical;this.wireframe.circle(h.x,h.y,y*2).fill({color:g}),this.wireframe.moveTo(h.x,h.y).lineTo(b.x,b.y).moveTo(h.x,h.y).lineTo(x.x,x.y).stroke({width:y,color:g})}for(const p in n){let m=this.groupBounds.rotation;p==="skewHorizontal"?m=this._skewX:p==="skewVertical"&&(m=this._skewY);const g=n[p];g&&(g.rotation=m,g.position.copyFrom(r[p]),g.getBounds())}}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,this._clickStartPosition.copyFrom(e.global),this._pointerPosition.copyFrom(e.global),this._transformStarted=!1;const n=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,e.global);if(n)this._transformHandle=n,this._elementClickCandidate=-1;else if(this.nestedSelectionEnabled&&this._group.length>1){const r=e.global;this.projectionTransform.applyInverse(r,cn),this._elementClickCandidate=-1;const i=[];for(let o=0;o<this._group.length;o++)fn.calculateOrientedBounds(this._group[o],Ko).contains(cn.x,cn.y)&&i.push(o);if(i.length>0){let o=i[0];for(let s=1;s<i.length;s++){const a=this._group[o],l=this._group[i[s]];fn.isAboveInDisplayOrder(l,a)&&(o=i[s])}this._elementClickCandidate=o}}e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}static isAboveInDisplayOrder(e,n){if(e===n)return!1;const r=[],i=[];let o=e;for(;o;)r.push(o),o=o.parent;for(o=n;o;)i.push(o),o=o.parent;r.reverse(),i.reverse();const s=Math.min(r.length,i.length);for(let a=0;a<s;a++)if(r[a]!==i[a]){const l=r[a-1];if(!l||!l.children)return!1;const c=l.children.indexOf(r[a]),u=l.children.indexOf(i[a]);return c>u}return r.length>i.length}onPointerMove(e){const n=this._pointerPosition,r=Zo.allocate().copyFrom(e.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,r);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const o=Math.sqrt(Math.pow(r.x-this._clickStartPosition.x,2)+Math.pow(r.y-this._clickStartPosition.y,2));if(!this._pointerDragging&&o>this._clickThreshold&&(this._pointerDragging=!0,this._elementClickCandidate=-1),this._pointerDragging){switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,r);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,r);break;default:if(this.translateEnabled){const[s,a,l]=m1;s.set(0,0),a.set(r.x-n.x,r.y-n.y),this.projectionTransform.applyInverse(s,s),this.projectionTransform.applyInverse(a,a),l.set(a.x-s.x,a.y-s.y),this.translateGroup(l)}}this.emitTransformStart(),e.stopPropagation()}this._pointerPosition.x=r.x,this._pointerPosition.y=r.y}Zo.release(r)}emitTransformStart(){this._transformStarted||(this._transformStarted=!0,this.emit("transformstart",{handle:this._transformHandle,transformType:this._transformType}))}onPointerUp(e){if(!this._pointerDragging&&this.nestedSelectionEnabled&&this._group.length>1&&this._elementClickCandidate>=0){const r=this._elementClickCandidate;this._focusedElementIndex===r?this.lazyDirty=!0:(this._focusedElementIndex=r,this.lazyDirty=!0,this.emit("elementfocused",this._group[r],r))}this._pointerDragging=!1,this._pointerDown=!1,this._elementClickCandidate=-1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._transformStarted=!1,this.commitGroup(),e.stopPropagation()}prependTransform(e,n=!1){const r=this._group;for(let i=0,o=r.length;i<o;i++)zP(r[i],e);y1.copyFrom(e),n||this.updateGroupBounds(),this.emit("transformchange",y1)}updateGroupBounds(e=this.groupBounds.rotation){fn.calculateGroupOrientedBounds(this._group,e,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(e,n,r){if(e=e%(Math.PI*2),!r||r.length===1||!n)return e;for(let i=0,o=r.length;i<o;i++)if(Math.abs(e-r[i])<=n)return r[i];return e}swapHandles(e,n){const r=e.handle,i=n.handle,o=e.cursor,s=n.cursor,a=e.x,l=n.x,c=e.y,u=n.y;e.handle=i,n.handle=r,e.position.set(l,u),n.position.set(a,c),e.cursor=s,n.cursor=o,this.handles[r]=n,this.handles[i]=e,this._transformHandle===r?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=r)}setCursorFromHoveredHandle(e){if(e&&e.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(e)switch(e){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(e,n){return n||(n=new B.Point),this.projectionTransform.apply(e,n),this.worldTransform.applyInverse(n,n),n}static calculateTransformedCorners(e,n=e.worldTransform,r,i=0){const o=e.getLocalBounds();return e.getBounds(),r=r||[new B.Point,new B.Point,new B.Point,new B.Point],r[i].set(o.x,o.y),r[i+1].set(o.x+o.width,o.y),r[i+2].set(o.x+o.width,o.y+o.height),r[i+3].set(o.x,o.y+o.height),n.apply(r[i],r[i]),n.apply(r[i+1],r[i+1]),n.apply(r[i+2],r[i+2]),n.apply(r[i+3],r[i+3]),r}static calculateOrientedBounds(e,n){e.updateLocalTransform(),p1(gd,e.worldTransform);const r=gd.rotation,i=fn.calculateTransformedCorners(e,e.worldTransform,qP),o=(i[0].x+i[1].x+i[2].x+i[3].x)/4,s=(i[0].y+i[1].y+i[2].y+i[3].y)/4,a=Sr.identity().translate(-o,-s).rotate(-gd.rotation).translate(o,s);return a.apply(i[0],i[0]),a.apply(i[1],i[1]),a.apply(i[2],i[2]),a.apply(i[3],i[3]),n=n||new zo,n.rotation=r,n.innerBounds.x=Math.min(i[0].x,i[1].x,i[2].x,i[3].x),n.innerBounds.y=Math.min(i[0].y,i[1].y,i[2].y,i[3].y),n.innerBounds.width=Math.max(i[0].x,i[1].x,i[2].x,i[3].x)-n.innerBounds.x,n.innerBounds.height=Math.max(i[0].y,i[1].y,i[2].y,i[3].y)-n.innerBounds.y,n}static calculateGroupOrientedBounds(e,n,r,i=!1){const o=e.length,s=Zo.allocateArray(o*4);for(let d=0;d<o;d++){const h=e[d];i||h.updateLocalTransform(),fn.calculateTransformedCorners(h,h.worldTransform,s,d*4)}const a=Sr.identity().rotate(-n);let l=Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let d=0,h=s.length;d<h;d++){const p=s[d];a.apply(p,p);const m=p.x,g=p.y;l=m<l?m:l,c=g<c?g:c,u=m>u?m:u,f=g>f?g:f}return Zo.releaseArray(s),r=r||new zo,r.innerBounds.x=l,r.innerBounds.y=c,r.innerBounds.width=u-l,r.innerBounds.height=f-c,r.rotation=n,a.applyInverse(r.center,cn),r.center.copyFrom(cn),r}};function nN(t,e,n,r){for(const i in e){const o=n[i],s=r[i],a=e[i];o!==s&&(o&&t.off(a,o),s&&t.on(a,s))}}const En={},rN=B.Matrix.IDENTITY,iN={transformstart:"transformstart",transformchange:"transformchange",transformcommit:"transformcommit",elementfocused:"elementfocused",elementfocuscleared:"elementfocuscleared"};function b1(t,e,n){if(nN(t,iN,e,n),n.cursors&&Object.assign(t.cursors,n.cursors),t.group=n.group||[],t.boundingBoxes=n.boundingBoxes||"all",t.boxScalingEnabled=n.boxScalingEnabled===!0,t.boxScalingTolerance=n.boxScalingTolerance!==void 0?n.boxScalingTolerance:t.boxScalingTolerance,t.boxRotationEnabled=n.boxRotationEnabled===!0,t.boxRotationTolerance=n.boxRotationTolerance!==void 0?n.boxRotationTolerance:t.boxRotationTolerance,t.centeredScaling=n.centeredScaling??!1,t.enabledHandles=n.enabledHandles,t.lockAspectRatio=n.lockAspectRatio??!1,t.projectionTransform.copyFrom(n.projectionTransform||rN),t.skewRadius=n.skewRadius||t.skewRadius,t.rotateEnabled=n.rotateEnabled!==!1,t.scaleEnabled=n.scaleEnabled!==!1,t.skewEnabled=n.skewEnabled===!0,t.translateEnabled=n.translateEnabled!==!1,t.transientGroupTilt=n.transientGroupTilt??!0,e.clickThreshold!==n.clickThreshold&&n.clickThreshold!==void 0&&(t.clickThreshold=n.clickThreshold),e.handleConstructor!==n.handleConstructor&&e.handleConstructor!==void 0)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");e.rotationSnaps!==n.rotationSnaps&&(t.rotationSnaps=n.rotationSnaps??t.rotationSnaps),e.rotationSnapTolerance!==n.rotationSnapTolerance&&(t.rotationSnapTolerance=n.rotationSnapTolerance??t.rotationSnapTolerance),e.skewSnaps!==n.skewSnaps&&(t.skewSnaps=n.skewSnaps??t.skewSnaps),e.skewSnapTolerance!==n.skewSnapTolerance&&(t.skewSnapTolerance=n.skewSnapTolerance??t.skewSnapTolerance);const r=e.colorTheme||En,i=n.colorTheme||En;(r.primary!==i.primary||r.secondary!==i.secondary||r.background!==i.background||r.glow!==i.glow||r.glowIntensity!==i.glowIntensity)&&(t.colorTheme=i);const o=e.handleStyle||En,s=n.handleStyle||En;(o.color!==s.color||o.outlineColor!==s.outlineColor||o.outlineThickness!==s.outlineThickness||o.radius!==s.radius||o.shape!==s.shape||o.rotatorIconColor!==s.rotatorIconColor)&&(t.handleStyle=s);const a=e.wireframeStyle||En,l=n.wireframeStyle||En;(a.color!==l.color||a.thickness!==l.thickness)&&(t.wireframeStyle=l);const c=e.rotatorAnchor||En,u=n.rotatorAnchor||En;if((c.enabled!==u.enabled||c.startPosition!==u.startPosition||c.segmentLength!==u.segmentLength||c.thickness!==u.thickness||c.color!==u.color||c.style!==u.style||JSON.stringify(c.dashPattern)!==JSON.stringify(u.dashPattern)||JSON.stringify(c.dotPattern)!==JSON.stringify(u.dotPattern))&&(t.rotatorAnchor=u),e.nestedSelectionEnabled!==n.nestedSelectionEnabled&&(t.nestedSelectionEnabled=n.nestedSelectionEnabled!==void 0?n.nestedSelectionEnabled:!0),e.focusedElementBorderColor!==n.focusedElementBorderColor&&(t.focusedElementBorderColor=n.focusedElementBorderColor!==void 0?n.focusedElementBorderColor:9133302),e.focusedElementBorderThickness!==n.focusedElementBorderThickness&&(t.focusedElementBorderThickness=n.focusedElementBorderThickness),e.focusedElementBorderStyle!==n.focusedElementBorderStyle&&(t.focusedElementBorderStyle=n.focusedElementBorderStyle||"dashed"),e.focusedElementBorderDashPattern!==n.focusedElementBorderDashPattern&&(t.focusedElementBorderDashPattern=n.focusedElementBorderDashPattern||[8,4]),e.showNonFocusedBorders!==n.showNonFocusedBorders&&(t.showNonFocusedBorders=n.showNonFocusedBorders!==void 0?n.showNonFocusedBorders:!1),e.individualBorderColor!==n.individualBorderColor&&(t.individualBorderColor=n.individualBorderColor!==void 0?n.individualBorderColor:54527),e.individualBorderThickness!==n.individualBorderThickness&&(t.individualBorderThickness=n.individualBorderThickness),e.individualBorderAlpha!==n.individualBorderAlpha&&(t.individualBorderAlpha=n.individualBorderAlpha!==void 0?n.individualBorderAlpha:1),e.individualBorderStyle!==n.individualBorderStyle&&(t.individualBorderStyle=n.individualBorderStyle||"solid"),e.individualBorderDashPattern!==n.individualBorderDashPattern&&(t.individualBorderDashPattern=n.individualBorderDashPattern||[8,4]),n.focusedElementIndex!==void 0&&(t.focusedElementIndex=n.focusedElementIndex),e.onFocusChange!==n.onFocusChange){const f="__transformerFocusListeners",d=t[f];if(d&&(t.off("elementfocused",d.focused),t.off("elementfocuscleared",d.cleared)),n.onFocusChange){const h=(m,g)=>n.onFocusChange(g,m),p=()=>n.onFocusChange(-1,null);t.on("elementfocused",h),t.on("elementfocuscleared",p),t[f]={focused:h,cleared:p}}else t[f]=void 0}}const oN=S.forwardRef(function(e,n){const r=S.useRef(null),i=S.useRef(null),o=S.useRef({});return S.useEffect(()=>{const s=r.current;if(!s)return;const a=new tN({...e,stage:s});return s.addChild(a),i.current=a,b1(a,{},e),o.current=e,typeof n=="function"?n(a):n&&(n.current=a),()=>{s.removeChild(a),a.destroy({children:!0}),i.current=null,typeof n=="function"?n(null):n&&(n.current=null)}},[]),S.useEffect(()=>{const s=i.current;s&&(b1(s,o.current,e),o.current=e)}),I.createElement("pixiContainer",{ref:r})}),sN=300,aN=({selectedElementIds:t=[],containerRefsMap:e,mouseOverTransformerRef:n,isMultiSelect:r,rotateEnabled:i=!0,scaleEnabled:o=!0,translateEnabled:s=!0,skewEnabled:a=!1,boxScalingEnabled:l=!0,boxRotationEnabled:c=!0,showNonFocusedBorders:u,focusedElementIndex:f,individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:p,onDoubleClickElement:m,onTransformChange:g,onTransformCommit:y})=>{const b=S.useMemo(()=>{const P=[];for(const A of t){const L=e[A]?.current;L&&P.push(L)}return P},[t,e]),x=S.useRef(null),v=S.useRef(0),T=S.useRef(null),w=t[0],O=S.useCallback(P=>{n?.current&&(n.current.isDragging=!0,n.current.dragType=P.transformType)},[n]),C=S.useCallback(()=>{w&&g?.(w)},[w,g]),R=S.useCallback(P=>{if(n?.current&&(n.current.isDragging=!1,n.current.dragType=null),!w)return;const A=P.elements[0],L=A?{...A,groupBounds:P.groupBounds,handle:P.handle,transformType:P.transformType,elements:P.elements}:P;y?.(w,L)},[w,n,y]);return S.useEffect(()=>{const P=t.map(L=>({id:L,c:e[L]?.current})).filter(L=>!!L.c);if(!m||P.length===0)return;const A=[];for(const{id:L,c:N}of P){const D=N.eventMode;N.eventMode="static";const F=G=>{const z=performance.now();T.current===L&&z-v.current<sN?(m(L),v.current=0,T.current=null):(v.current=z,T.current=L)};N.on("pointerdown",F),A.push({c:N,fn:F}),N.__prevEventMode=D}return()=>{for(const{c:L,fn:N}of A){L.off("pointerdown",N);const D=L.__prevEventMode;D!==void 0&&(L.eventMode=D)}}},[t,e,m]),b.length===0?null:M.jsx(oN,{ref:x,group:b,rotateEnabled:i,scaleEnabled:o,translateEnabled:s,skewEnabled:a,boxScalingEnabled:l,boxRotationEnabled:c,boundingBoxes:r?"all":"groupOnly",nestedSelectionEnabled:!!r,showNonFocusedBorders:u??!!r,focusedElementIndex:f??(r?-1:void 0),individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:p,transformstart:O,transformchange:C,transformcommit:R})},x1=(t,e,n,r,i)=>{const o=1-i;return o*o*o*t+3*o*o*i*e+3*o*i*i*n+i*i*i*r};function v1(t,e=24){const{vertices:n,outTangents:r,inTangents:i,closed:o}=t;if(n.length===0)return[];const s=[],a=o?n.length:n.length-1;for(let l=0;l<a;l++){const c=n[l],u=n[(l+1)%n.length],f=r[l],d=i[(l+1)%n.length],h=[c[0]+f[0],c[1]+f[1]],p=[u[0]+d[0],u[1]+d[1]];for(let m=0;m<e;m++){const g=m/e;s.push([x1(c[0],h[0],p[0],u[0],g),x1(c[1],h[1],p[1],u[1],g)])}}return o||s.push(n[n.length-1]),s}function yd(t,e=96){switch(t.kind){case"rect":{const[n,r]=Ti(t.size),[i,o]=t.position?Ti(t.position):[0,0],s=i-n/2,a=o-r/2;return[[s,a],[s+n,a],[s+n,a+r],[s,a+r],[s,a]]}case"ellipse":{const[n,r]=Ti(t.size),[i,o]=t.position?Ti(t.position):[0,0],s=[],a=n/2,l=r/2;for(let c=0;c<=e;c++){const u=c/e*Math.PI*2;s.push([i+Math.cos(u)*a,o+Math.sin(u)*l])}return s}case"polystar":return cN(t,e);case"bezier":return v1(uN(t.path))}}function cN(t,e){const n=Math.max(3,Math.floor(Jo(t.points))),r=Jo(t.outerRadius),i=t.innerRadius!==void 0?Jo(t.innerRadius):r,o=t.rotation!==void 0?Jo(t.rotation):0,[s,a]=t.position?Ti(t.position):[0,0],l=t.starType==="star",c=l?n*2:n,u=o*Math.PI/180,f=[];for(let d=0;d<=c;d++){const p=!l||d%2===0?r:i,m=d/c*Math.PI*2-Math.PI/2+u;f.push([s+Math.cos(m)*p,a+Math.sin(m)*p])}return f.length>e?lN(f,e):f}function lN(t,e){if(t.length<=2||e<=2)return t.slice();const n=[];let r=0;for(let a=0;a<t.length-1;a++){const l=t[a+1][0]-t[a][0],c=t[a+1][1]-t[a][1],u=Math.hypot(l,c);n.push(u),r+=u}if(r===0)return[t[0],t[t.length-1]];const i=[];let o=0,s=0;for(let a=0;a<e;a++){const l=a/(e-1)*r;for(;o<n.length-1&&s+n[o]<l;)s+=n[o],o++;const c=n[o]||1,u=(l-s)/c;i.push([t[o][0]+(t[o+1][0]-t[o][0])*u,t[o][1]+(t[o+1][1]-t[o][1])*u])}return i}function T1(t,e,n,r=0){if(t.length<2)return t;const i=d=>{const h=d%1;return h<0?h+1:h},o=i(e+r),s=i(n+r);if(o===s)return[];const a=[];let l=0;for(let d=0;d<t.length-1;d++){const h=Math.hypot(t[d+1][0]-t[d][0],t[d+1][1]-t[d][1]);a.push(h),l+=h}if(l===0)return[];const c=d=>{let h=d*l;for(let p=0;p<a.length;p++){if(h<=a[p])return{idx:p,t:a[p]===0?0:h/a[p]};h-=a[p]}return{idx:a.length-1,t:1}},u=(d,h,p)=>[d[0]+(h[0]-d[0])*p,d[1]+(h[1]-d[1])*p],f=(d,h)=>{const p=c(d),m=c(h),g=[u(t[p.idx],t[p.idx+1],p.t)];for(let y=p.idx+1;y<=m.idx;y++)g.push(t[y]);return g.push(u(t[m.idx],t[m.idx+1],m.t)),g};return o<s?f(o,s):[...f(o,1),...f(0,s)]}function Ti(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function Jo(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function uN(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const E1=t=>new W.Color(t).toNumber(),S1=t=>t.length===9?parseInt(t.slice(7,9),16)/255:1;function w1(t,e){const{path:n,fill:r,stroke:i,trim:o}=e;if(o){hN(t,n,o,r,i);return}fN(t,n),O1(t,r,i)}function fN(t,e){switch(e.kind){case"rect":{const[n,r]=Qo(e.size),[i,o]=e.position?Qo(e.position):[0,0],s=e.roundness?pN(e.roundness):0,a=i-n/2,l=o-r/2;s>0?t.roundRect(a,l,n,r,s):t.rect(a,l,n,r);return}case"ellipse":{const[n,r]=Qo(e.size),[i,o]=e.position?Qo(e.position):[0,0];t.ellipse(i,o,n/2,r/2);return}case"polystar":{const n=yd(e);A1(t,n,!0);return}case"bezier":dN(t,mN(e.path));return}}function dN(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function A1(t,e,n){if(!(e.length<2)){t.moveTo(e[0][0],e[0][1]);for(let r=1;r<e.length;r++)t.lineTo(e[r][0],e[r][1]);n&&t.closePath()}}function hN(t,e,n,r,i){const o=yd(e),s=T1(o,C1(n.start),C1(n.end),n.offset??0);A1(t,s,n.start===0&&n.end===1),O1(t,r,i)}function O1(t,e,n){e&&t.fill({color:E1(e),alpha:S1(e)}),n&&t.stroke({color:E1(n.color),width:n.width,alpha:S1(n.color),cap:n.cap??"butt",join:n.join??"miter"})}const C1=t=>Math.max(0,Math.min(1,t));function Qo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function pN(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function mN(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const gN={vertices:[],inTangents:[],outTangents:[],closed:!1},yN=({ref:t,...e})=>{const n=I.useRef(null),r=I.useRef(null),{path:i,fill:o,stroke:s,trimPath:a,transformation:l,visible:c}=e,{x:u,y:f}=l,h=Jt()?.currentFrame??0,p=zn(),m=I.useMemo(()=>({fill:o!==void 0?xt(Yn(o,p),"#000000",h):void 0,stroke:s&&{color:xt(s.color,"#000000",h),width:ge(s.width,1,h),cap:s.cap,join:s.join},trim:a&&{start:ge(a.start,0,h),end:ge(a.end,1,h),offset:a.offset!==void 0?ge(a.offset,0,h):void 0}}),[o,s,a,h,p]),g=I.useMemo(()=>i.kind!=="bezier"?i:{kind:"bezier",path:Uf(i.path,gN,h)},[i,h]),y=I.useCallback(b=>{b.clear(),w1(b,{path:g,fill:m.fill,stroke:m.stroke,trim:m.trim})},[g,m]);return M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:r,x:u,y:f,children:M.jsx("pixiGraphics",{ref:n,draw:y,alpha:c?1:0})})})},R1=I.memo(yN,et),_N=({ref:t,...e})=>{const n=I.useRef(null),{transformation:r}=e;return M.jsx($e,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{ref:n,x:r.x,y:r.y})})},I1=I.memo(_N,et),M1=(t,e,n,r)=>n+(t-e)*r,L1=I.memo(({uniqueId:t,src:e,startAt:n,endAt:r,inPointFrames:i,level:o,pan:s,muted:a,visible:l=!0,trimStart:c=0,speed:u=1,transformation:f,onContainerRefReady:d})=>{const h=_t(),{tl:p,registerTimeUpdateListener:m,unregisterTimeUpdateListener:g}=I.useContext(Ye),y=h.framesToSeconds(i),b=h.fps,[x,v]=I.useState(null),T=I.useRef(null),w=I.useRef(s);w.current=s;const O=I.useCallback((P,A)=>{v(A)},[]),C=I.useCallback(P=>Math.max(0,Math.min(1,ge(o,1,M1(P,y,i,b)))),[o,y,i,b]),R=I.useCallback(P=>{const A=T.current;if(!A)return;const L=ge(w.current,0,M1(P,y,i,b));A.pan.value=Math.max(-1,Math.min(1,L))},[y,i,b]);return I.useEffect(()=>{if(s===void 0||!x)return;const P=hr.getContext(),A=hr.getOrCreateSourceNode(t);if(!P||!A||typeof P.createStereoPanner!="function")return;const L=P.createStereoPanner();try{A.disconnect(P.destination)}catch{}return A.connect(L).connect(P.destination),T.current=L,()=>{T.current=null;try{A.disconnect(L),L.disconnect(),A.connect(P.destination)}catch{}}},[x,s!==void 0,t]),I.useEffect(()=>{if(!(s===void 0||!m||!g))return m(R),()=>g(R)},[s!==void 0,R,m,g]),I.useEffect(()=>{s!==void 0&&R(p?.current?.time()??y)},[x,s,R,y,p]),M.jsx(t_,{uniqueId:t,src:e,startAt:n,endAt:r,audioStartAt:c,mute:!!a,speed:u,visible:l,getVolume:C,transformation:f,onAudioElementReady:O,onContainerRefReady:d})});L1.displayName="AepAudioLayer";function P1(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}function N1(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function k1(t,e){if(e.length!==0){for(const n of e)if(n.mode==="subtract"){const r=bN(P1(n.path));N1(t,r)}else N1(t,P1(n.path));t.fill({color:16777215,alpha:1})}}function bN(t){const e=t.vertices.length;return{vertices:t.vertices.slice().reverse(),outTangents:Array.from({length:e},(n,r)=>t.inTangents[e-1-r]),inTangents:Array.from({length:e},(n,r)=>t.outTangents[e-1-r]),closed:t.closed}}const xN={vertices:[],inTangents:[],outTangents:[],closed:!1},D1=({masks:t,children:e})=>{const n=I.useRef(null),r=I.useRef(null),o=Jt()?.currentFrame??0;I.useEffect(()=>{const l=n.current,c=r.current;if(!(!l||!c))return l.mask=c,()=>{l.mask=null}},[]);const s=I.useMemo(()=>t.map(l=>({...l,path:Uf(l.path,xN,o)})),[t,o]),a=I.useCallback(l=>{l.clear(),k1(l,s)},[s]);return M.jsxs("pixiContainer",{ref:n,children:[e,M.jsx("pixiGraphics",{ref:r,draw:a})]})},F1=({source:t,matted:e,mode:n,width:r,height:i})=>{const{app:o}=at.useApplication(),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(null);I.useEffect(()=>{if(o?.renderer)return c.current&&(c.current.width!==r||c.current.height!==i)&&(c.current.destroy(!0),c.current=null),c.current||(c.current=W.RenderTexture.create({width:Math.max(1,Math.round(r)),height:Math.max(1,Math.round(i))})),()=>{c.current?.destroy(!0),c.current=null}},[o,r,i]),I.useEffect(()=>{const h=o?.renderer;if(!h)return;const p=()=>{const m=c.current,g=s.current;!m||!g||(h.render({container:g,target:m}),l.current&&(l.current.texture=m))};return o.ticker.add(p),()=>{o.ticker.remove(p)}},[o]),I.useEffect(()=>{const h=a.current,p=l.current;if(!(!h||!p))return h.mask=p,()=>{h.mask=null}},[]);const u=n==="alpha-inverted"||n==="luma-inverted",f=n==="luma"||n==="luma-inverted",d=I.useMemo(()=>{if(!f)return;const h=new W.ColorMatrixFilter;return h.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,.2126,.7152,.0722,0,0],[h]},[f]);return M.jsxs("pixiContainer",{children:[M.jsx("pixiContainer",{ref:s,renderable:!0,alpha:0,children:t}),M.jsx("pixiContainer",{ref:a,children:e}),M.jsx("pixiSprite",{ref:l,width:r,height:i,alpha:1,filters:d,renderable:!1})]})};function _d(t,e){if(!e)throw new Error(`AEP: unknown assetId '${t}' (no entry in comp.assets)`);return{url:e.src,mime:vN(e.type)}}function vN(t){switch(t){case"image":return"image/*";case"video":return"video/*";case"audio":return"audio/*";case"lottie":return"application/json";case"svg":return"image/svg+xml";case"model":return"model/gltf-binary";default:return}}const B1=I.createContext(null),U1=({resolver:t,children:e})=>M.jsx(B1.Provider,{value:t,children:e});function G1(){return I.useContext(B1)??_d}const j1=new WeakMap;function TN(t){let e=j1.get(t);return e||(e=new Map,j1.set(t,e)),e}function Ei(t){const e=G1(),n=_t(),[r,i]=I.useState(()=>t?{url:"",state:"loading"}:{url:"",state:"idle"});return I.useEffect(()=>{if(!t){i({url:"",state:"idle"});return}const o=n.assets[t],s=TN(n.assets);let a=!1;const l=async()=>{const c=s.get(t);if(c)return c;const u=Promise.resolve(e(t,o));s.set(t,u);try{return await u}catch(f){throw s.delete(t),f}};return i({url:"",state:"loading"}),l().then(c=>{a||i({url:c.url,mime:c.mime,state:"ready"})}).catch(c=>{a||(console.error(`AEP asset resolver failed for '${t}':`,c),i({url:"",state:"error",error:c}))}),()=>{a=!0}},[t,e,n.assets]),r}function H1(t,e){const n=[],r=new Set;let i=t;for(;i;){if(r.has(i.id))throw new Error(`cyclic parent chain detected at layer '${t.id}' via '${i.id}'`);r.add(i.id),n.push(i),i=i.parent?e.get(i.parent):void 0}return n}function EN(t,e){const n=Math.cos(t.rotation*Math.PI/180),r=Math.sin(t.rotation*Math.PI/180),i=e.x*t.scaleX,o=e.y*t.scaleY;return{x:t.x+(n*i-r*o),y:t.y+(r*i+n*o),scaleX:t.scaleX*e.scaleX,scaleY:t.scaleY*e.scaleY,rotation:t.rotation+e.rotation,alpha:t.alpha*e.alpha}}function Y1(t,e){const{layersById:n,currentFrame:r}=_t();return I.useMemo(()=>{const i=H1(t,n);let o={x:0,y:0,scaleX:1,scaleY:1,rotation:0,alpha:1};for(let u=i.length-1;u>=0;u--){const f=i[u].transform,[d,h]=sn(f.position,[0,0],r),[p,m]=sn(f.scale,[1,1],r);o=EN(o,{x:d,y:h,scaleX:p,scaleY:m,rotation:ge(f.rotation,0,r),alpha:ge(f.opacity,1,r)})}const[s,a]=sn(t.transform.anchor,[0,0],r),l=e.width>0?s/e.width:.5,c=e.height>0?a/e.height:.5;return{x:o.x,y:o.y,width:e.width,height:e.height,scale:[o.scaleX,o.scaleY],rotation:o.rotation,alpha:o.alpha,anchor:{x:l,y:c}}},[t,n,e.width,e.height,r])}function X1(t){return!!(t.splitMode&&t.splitMode!=="single"||t.animators&&t.animators.length>0||(t.style.runs?.length??0)>0||typeof t.style.align=="string"&&t.style.align.startsWith("justify")||Array.isArray(t.style.fill))}const es=()=>{},bd=I.createContext({ready:!0,readyCount:0,total:0,register:()=>es,markReady:es,reset:es,reportError:es});function W1(){return I.useContext(bd).ready}function z1(){return I.useContext(bd)}const q1=({children:t,onLayerError:e})=>{const[n,r]=I.useState(()=>new Map),[i,o]=I.useState(!1);I.useEffect(()=>{o(!0)},[]);const s=I.useRef(e);s.current=e;const a=I.useCallback(m=>(r(g=>{if(g.has(m))return g;const y=new Map(g);return y.set(m,!1),y}),()=>{r(g=>{if(!g.has(m))return g;const y=new Map(g);return y.delete(m),y})}),[]),l=I.useCallback(m=>{r(g=>{if(g.get(m)===!0||!g.has(m))return g;const y=new Map(g);return y.set(m,!0),y})},[]),c=I.useCallback(m=>{r(g=>{if(g.get(m)===!1||!g.has(m))return g;const y=new Map(g);return y.set(m,!1),y})},[]),u=I.useCallback((m,g)=>{console.error(`[model3d] layer '${m}' failed:`,g),s.current?.(m,g)},[]),f=n.size;let d=0;for(const m of n.values())m&&(d+=1);const h=i&&d===f,p=I.useMemo(()=>({ready:h,readyCount:d,total:f,register:a,markReady:l,reset:c,reportError:u}),[h,d,f,a,l,c,u]);return M.jsx(bd.Provider,{value:p,children:t})},SN={can:[[0,0],[.5,0],[.5,.04],[.5,.9],[.48,.95],[.4,.99],[.4,1],[0,1]],bottle:[[0,0],[.3,0],[.4,.05],[.42,.2],[.4,.55],[.34,.68],[.18,.78],[.14,.86],[.14,.96],[.18,1],[0,1]],jar:[[0,0],[.46,0],[.5,.04],[.5,.82],[.46,.9],[.4,.94],[.4,1],[0,1]],tube:[[0,0],[.34,0],[.34,.08],[.34,.88],[.3,.94],[.3,1],[0,1]],pouch:[[0,0],[.22,0],[.38,.05],[.46,.2],[.44,.6],[.38,.82],[.24,.94],[.18,1],[0,1]]};function xd(t,e={}){const n=e.width??1,r=e.height??1;if(t==="box"){const l=e.depth??n;return new V.BoxGeometry(n,r,l)}const i=SN[t],o=i.map(([l,c])=>new V.Vector2(Math.max(0,l*n),(c-.5)*r)),s=new V.LatheGeometry(o,64),a=s.getAttribute("uv");for(let l=0;l<a.count;l++)a.setY(l,i[l%i.length][1]);return a.needsUpdate=!0,s}function vd(t,e,n=0){const r=t.map(b=>b[0]),i=t.map(b=>b[1]),o=Math.min(...r),s=Math.max(...r),a=Math.min(...i),l=Math.max(...i),c=(o+s)/2,u=(a+l)/2,f=Math.max(s-o,1e-6),d=Math.max(l-a,1e-6),h=new V.Shape;t.forEach(([b,x],v)=>{const T=b-c,w=u-x;v===0?h.moveTo(T,w):h.lineTo(T,w)}),h.closePath();const p=Math.max(e,1e-6),m=Math.max(0,n),g={generateTopUV(b,x,v,T,w){const O=C=>new V.Vector2((x[C*3]+f/2)/f,(x[C*3+1]+d/2)/d);return[O(v),O(T),O(w)]},generateSideWallUV(b,x,v,T,w,O){const C=R=>{const P=x[R*3],A=x[R*3+1],L=x[R*3+2];return new V.Vector2((P+f/2)/f,(A+d/2)/d+L/p)};return[C(v),C(T),C(w),C(O)]}},y=new V.ExtrudeGeometry(h,{depth:p,bevelEnabled:m>0,bevelThickness:m,bevelSize:m,bevelSegments:m>0?2:0,curveSegments:16,UVGenerator:g});return y.translate(0,0,-p/2),y.computeVertexNormals(),{geometry:y,width:f,height:d}}function wN(t,e){if(t.type==="primitive")return{geometry:xd(t.shape,t.proportions),materialGroups:t.shape==="box"?"box":"single"};if(t.type==="extrude")return{geometry:vd(t.contour,e,t.bevel).geometry,materialGroups:"extrude"};throw new Error("buildSourceGeometry does not handle gltf sources")}const Td={studio:{preset:"studio",keyAzimuth:-35,keyElevation:38,keyIntensity:3.2,keyColor:"#fff7ec",fillIntensity:1.1,rimIntensity:1.6,ambientIntensity:.22,environmentIntensity:.75,environment:"room"},window:{preset:"window",keyAzimuth:-70,keyElevation:55,keyIntensity:2.4,keyColor:"#eef4ff",fillIntensity:1.5,rimIntensity:.6,ambientIntensity:.35,environmentIntensity:.85,environment:"room"},golden:{preset:"golden",keyAzimuth:-58,keyElevation:14,keyIntensity:3.6,keyColor:"#ffd29a",fillIntensity:.8,rimIntensity:1.2,ambientIntensity:.18,environmentIntensity:.55,environment:"room"},night:{preset:"night",keyAzimuth:28,keyElevation:30,keyIntensity:.85,keyColor:"#9fb6ff",fillIntensity:.35,rimIntensity:2.8,ambientIntensity:.12,environmentIntensity:.45,environment:"room"}},Ed="studio";function Sd(t=Ed,e={},n){const r=Td[t];return{...r,keyAzimuth:e.keyAzimuth??r.keyAzimuth,keyElevation:e.keyElevation??r.keyElevation,keyIntensity:e.keyIntensity??r.keyIntensity,keyColor:e.keyColor??r.keyColor,fillIntensity:e.fillIntensity??r.fillIntensity,rimIntensity:e.rimIntensity??r.rimIntensity,environment:n??r.environment}}function V1(t,e){const n=t*Math.PI/180,r=e*Math.PI/180,i=Math.cos(r);return[Math.sin(n)*i,Math.sin(r),Math.cos(n)*i]}const wd=12;function AN(t){const e=new V.AmbientLight(16777215,t.ambientIntensity),n=new V.DirectionalLight(new V.Color(t.keyColor),t.keyIntensity);n.castShadow=!0,n.shadow.mapSize.set(1024,1024),n.shadow.bias=-5e-4;const r=new V.DirectionalLight(16777215,t.fillIntensity),i=new V.DirectionalLight(16777215,t.rimIntensity),o=new V.Group;o.add(e,n,n.target,r,i);const s={group:o,ambient:e,key:n,fill:r,rim:i};return K1(s,t),s}function K1(t,e){t.ambient.intensity=e.ambientIntensity,t.key.intensity=e.keyIntensity,t.key.color.set(e.keyColor),Ad(t.key,e.keyAzimuth,e.keyElevation),Ad(t.fill,e.keyAzimuth+140,Math.max(5,e.keyElevation-20)),Ad(t.rim,e.keyAzimuth+180,Math.max(10,e.keyElevation+5))}function Ad(t,e,n){const[r,i,o]=V1(e,n);t.position.set(r*wd,i*wd,o*wd),t.target.position.set(0,0,0),t.target.updateMatrixWorld()}function Z1(t){t.group.removeFromParent(),t.key.dispose(),t.fill.dispose(),t.rim.dispose(),t.ambient.dispose()}const $1=new WeakMap;function ON(t){const e=$1.get(t);if(e)return e;const n=new V.PMREMGenerator(t),r=new nE.RoomEnvironment,i=n.fromScene(r,.04);return r.traverse(o=>{const s=o;if(!s.isMesh)return;s.geometry?.dispose();const a=Array.isArray(s.material)?s.material:[s.material];for(const l of a)l?.dispose()}),n.dispose(),$1.set(t,i.texture),i.texture}function CN(t,e,n){t.environment=e.environment==="room"?ON(n):null,t.environmentIntensity=e.environmentIntensity}const vt={rotation:[0,0,0],position:[0,0,0],scale:1,roughness:.35,metalness:.05,clearcoat:0,shadowOpacity:.35,shadowSoftness:.6,shadowOffsetY:0,fov:35,fit:1.35};function Od(t,e){const n=t.lighting?.preset??Ed,r=Td[n],i=t.source.type==="extrude"?ge(t.source.depth,100,e):1,o=t.shadow;return{rotation:Go(t.view?.rotation,vt.rotation,e),position:Go(t.view?.position,vt.position,e),scale:ge(t.view?.scale,vt.scale,e),extrudeDepth:Math.max(i,1e-6),roughness:ge(t.material?.roughness,vt.roughness,e),metalness:ge(t.material?.metalness,vt.metalness,e),clearcoat:t.material?.clearcoat??vt.clearcoat,preset:n,keyAzimuth:ge(t.lighting?.key?.azimuth,r.keyAzimuth,e),keyElevation:ge(t.lighting?.key?.elevation,r.keyElevation,e),keyIntensity:ge(t.lighting?.key?.intensity,r.keyIntensity,e),keyColor:t.lighting?.key?.color??r.keyColor,fillIntensity:ge(t.lighting?.fill?.intensity,r.fillIntensity,e),rimIntensity:ge(t.lighting?.rim?.intensity,r.rimIntensity,e),environment:t.lighting?.environment??r.environment,shadowOpacity:o?ge(o.opacity,vt.shadowOpacity,e):0,shadowSoftness:o?.softness??vt.shadowSoftness,shadowOffsetY:o?.offsetY??vt.shadowOffsetY,fov:t.camera?.fov??vt.fov,fit:t.camera?.fit??vt.fit}}function J1(t){return JSON.stringify(t)}function RN(){const t=new V.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});return t.setPixelRatio(1),t.outputColorSpace=V.SRGBColorSpace,t.toneMapping=V.ACESFilmicToneMapping,t.toneMappingExposure=1,t.shadowMap.enabled=!0,t.shadowMap.type=V.PCFShadowMap,t.setClearColor(0,0),t}class Q1{renderer;gl;width=0;height=0;constructor(e){this.gl=e??RN(),this.renderer=this.gl}render({canvas:e,scene:n,camera:r,width:i,height:o}){const{gl:s}=this;(i!==this.width||o!==this.height)&&(s.setSize(i,o,!1),this.width=i,this.height=o),s.setViewport(0,0,i,o),s.render(n,r);const a=e.getContext("2d");if(!a)throw new Error("model3d: 2D canvas context unavailable");a.clearRect(0,0,i,o),a.drawImage(s.domElement,0,0,i,o)}dispose(){this.gl.dispose(),this.gl.forceContextLoss()}}function eT(t,e=2e3){const n=new Map;return{acquire(r){let i=n.get(r);return i||(i={value:t(),users:0,timer:null},n.set(r,i)),i.timer&&(clearTimeout(i.timer),i.timer=null),i.users+=1,i.value},release(r){const i=n.get(r);i&&(i.users=Math.max(0,i.users-1),!(i.users>0||i.timer)&&(i.timer=setTimeout(()=>{if(!(i.users>0)){n.delete(r);try{i.value.dispose()}catch{}}},e)))},size:()=>n.size}}const tT={},nT=eT(()=>new Q1);function Cd(t){return nT.acquire(t??tT)}function rT(t){nT.release(t??tT)}function IN(t){return Cd(t)}function iT(t,e,n,r){const i=Du(e,n,r);return{position:[t[0],t[1],t[2]+i],target:[t[0],t[1],t[2]]}}function oT(t,e,n){return n>0?Math.max(0,t-e)/n:0}function sT(t,e,n){return t>=e&&t<n}function MN(t,e){return e?{center:e.center?[e.center[0],e.center[1],e.center[2]]:t.center,maxDim:Math.max(e.size[0],e.size[1],e.size[2],1e-4)}:t}const LN=({ref:t,layer:e,...n})=>{const r=_t(),i=r.currentFrame,o=I.useRef(i);o.current=i;const{register:s,markReady:a,reset:l,reportError:c}=z1(),{app:u}=at.useApplication(),[f,d]=I.useState(null),[h,p]=I.useState(null),[m,g]=I.useState(null),[y,b]=I.useState(0),[x,v]=I.useState(!1),T=I.useRef(null),w=I.useRef(null),O=I.useRef("");I.useEffect(()=>{let J=!1;try{d(Cd(u)),J=!0}catch(ie){c(e.id,ie)}return()=>{J&&(d(null),rT(u))}},[u,e.id,c]),I.useEffect(()=>s(e.id),[s,e.id]);const C=e.viewport.width,R=e.viewport.height;I.useEffect(()=>{const J=document.createElement("canvas");J.width=C,J.height=R;const ie=W.Texture.from(J);return w.current=ie,p(J),g(ie),()=>{w.current=null,g(null),p(null),ie.destroy(!0)}},[C,R]);const P=e.source.type==="gltf"?e.source.assetId:void 0,A=e.textures?.label,L=e.textures?.front,N=Ei(P),D=Ei(A),F=Ei(L),G=(!P||N.state==="ready")&&(!A||D.state==="ready")&&(!L||F.state==="ready"),z=(P&&N.state==="error"?N.error:void 0)??(A&&D.state==="error"?D.error:void 0)??(L&&F.state==="error"?F.error:void 0),K=I.useMemo(()=>JSON.stringify(e.source),[e.source]),se=I.useMemo(()=>JSON.stringify(e.textures??{}),[e.textures]),pe=e.material?.clearcoat??0;I.useEffect(()=>{if(!h||!f||!G)return;if(z){const ve=String(z);O.current!==ve&&(O.current=ve,c(e.id,z));return}let J=!1;l(e.id),Z.current=!1,v(!1);const ie=Od(e,o.current),xe=Sd(ie.preset,{keyAzimuth:ie.keyAzimuth,keyElevation:ie.keyElevation,keyIntensity:ie.keyIntensity,keyColor:ie.keyColor,fillIntensity:ie.fillIntensity,rimIntensity:ie.rimIntensity},ie.environment),Y=new V.Scene,De=new V.PerspectiveCamera(ie.fov,C/R,.1,1e3),ye=new V.Group;Y.add(ye);const $=AN(xe);Y.add($.group),CN(Y,xe,f.renderer);const we=NN();Y.add(we);const me=[],Ue=()=>{T.current=null,Y.clear(),Z1($),we&&(we.geometry.dispose(),we.material.dispose());for(const ve of me)ve.dispose()},ze=ve=>{if(J)return;J=!0;const Ie=String(ve);O.current!==Ie&&(O.current=Ie,c(e.id,ve)),Ue()},ht=(ve,Ie,ct,ut)=>{if(J){Id(ve);return}ye.add(ve),kN(ve,$);const Me=new V.Box3().setFromObject(ve),Re=new V.Vector3,Se=new V.Vector3;Me.getSize(Re),Me.getCenter(Se);const Ge=MN({center:[Se.x,Se.y,Se.z],maxDim:Math.max(Re.x,Re.y,Re.z,1e-4)},e.bounds);Se.set(...Ge.center);const je=Ge.maxDim,qe={scene:Y,camera:De,root:ye,content:ve,materials:Ie,lighting:$,shadow:we,mixer:ct,clipDuration:ut,isExtrude:e.source.type==="extrude",baseExtrudeDepth:Math.max(ie.extrudeDepth,1e-6),maxDim:je,center:Se,boundsOverride:e.bounds??null};T.current=qe,v(ct!=null),b(it=>it+1)};return(async()=>{const ve=D.url?await aT(D.url):null;if(ve&&(me.push(ve),J))return;const Ie=F.url?await aT(F.url):null;if(Ie&&(me.push(Ie),J))return;if(e.source.type==="gltf"){const qe=await new Vd.GLTFLoader().loadAsync(N.url);if(J){Id(qe.scene);return}const it=PN(qe.scene),Le=e.material?.clearcoat??0;for(const Lt of it)"clearcoat"in Lt&&(Lt.clearcoat=Le,Le>0&&(Lt.needsUpdate=!0));let ot=null,Mt=0;if(qe.animations.length>0){const Lt=qe.animations[0];ot=new V.AnimationMixer(qe.scene),ot.clipAction(Lt).play(),Mt=Lt.duration}ht(qe.scene,it,ot,Mt);return}const ct=e.textures?.side??"#d8d8d8",ut=e.material?.clearcoat??0;if(e.source.type==="primitive"){const qe=xd(e.source.shape,e.source.proportions),it=e.source.shape==="box";let Le;if(it){const Mt=Si(ct,null,ut),Lt=Si(ct,Ie??ve,ut);Le=[Mt,Mt,Mt,Mt,Lt,Mt]}else Le=[Si(ct,ve??Ie,ut,!0)];const ot=new V.Mesh(qe,Le.length===1?Le[0]:Le);ht(ot,Le,null,0);return}const{geometry:Me}=vd(e.source.contour,ie.extrudeDepth,e.source.bevel),Re=Si(ct,Ie,ut),Se=Si(ct,null,ut),Ge=[Re,Se],je=new V.Mesh(Me,Ge);ht(je,Ge,null,0)})().catch(ze),()=>{J=!0;const ve=T.current;if(ve){ve.mixer?.stopAllAction(),Id(ve.content),ve.scene.clear(),Z1(ve.lighting),ve.shadow&&(ve.shadow.geometry.dispose(),ve.shadow.material.dispose());for(const Ie of me)Ie.dispose();T.current=null}else Ue();b(0)}},[h,f,G,z,K,se,pe,C,R,D.url,F.url,N.url,e.id,l,c]);const X=I.useMemo(()=>Od(e,i),[e,i]),he=J1(X),j=x?i:0,te=sT(i,e.inPoint,e.outPoint),H=I.useRef(X);H.current=X;const ae=I.useRef(i);ae.current=i;const Z=I.useRef(!1);I.useEffect(()=>{const J=T.current,ie=h,xe=w.current;if(!J||!ie||!xe||!f||!te&&Z.current)return;const Y=H.current,De=ae.current;DN(J,Y),FN(J,Y),BN(J,Y);const ye=Sd(Y.preset,{keyAzimuth:Y.keyAzimuth,keyElevation:Y.keyElevation,keyIntensity:Y.keyIntensity,keyColor:Y.keyColor,fillIntensity:Y.fillIntensity,rimIntensity:Y.rimIntensity},Y.environment);K1(J.lighting,ye),UN(J,Y,ye),J.mixer&&J.clipDuration>0&&J.mixer.setTime(oT(De,e.inPoint,r.fps));try{f.render({canvas:ie,scene:J.scene,camera:J.camera,width:C,height:R}),xe.source.update(),Z.current=!0,a(e.id)}catch($){const we=String($);O.current!==we&&(O.current=we,c(e.id,$))}},[he,j,te,y,f,h,r.fps,e.id,e.inPoint,C,R,a,c]);const{transformation:ce}=n;return M.jsx($e,{...n,ref:t,children:M.jsx("pixiContainer",{children:m&&M.jsx("pixiSprite",{texture:m,width:C,height:R,anchor:ce.anchor,x:ce.x,y:ce.y,alpha:n.visible?1:0})})})},Rd=I.memo(LN);Rd.displayName="Pixi3DModelLayer";function Si(t,e,n,r=!1){e&&e.wrapS!==V.RepeatWrapping&&(e.wrapS=V.RepeatWrapping,e.wrapT=V.ClampToEdgeWrapping,e.colorSpace=V.SRGBColorSpace,r&&(e.offset.x=.5),e.needsUpdate=!0);const i=new V.MeshPhysicalMaterial({color:new V.Color(e?"#ffffff":t),map:e,roughness:.35,metalness:.05,clearcoat:n,clearcoatRoughness:.2});return i.shadowSide=V.FrontSide,i}async function aT(t){const e=await new V.TextureLoader().loadAsync(t);return e.colorSpace=V.SRGBColorSpace,e.anisotropy=4,e}function PN(t){const e=new Set;return t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;s?.isMeshStandardMaterial&&e.add(s)}}),[...e]}function NN(){const t=new V.PlaneGeometry(1,1),e=new V.ShadowMaterial({opacity:0,transparent:!0}),n=new V.Mesh(t,e);return n.rotation.x=-Math.PI/2,n.position.y=-.5,n.receiveShadow=!0,n.castShadow=!1,n}function kN(t,e){t.traverse(i=>{const o=i;o.isMesh&&(o.castShadow=!0,o.receiveShadow=!0)});const n=6,r=e.key.shadow.camera;r.left=-n,r.right=n,r.top=n,r.bottom=-n,r.near=.1,r.far=60,r.updateProjectionMatrix()}function DN(t,e){const n=Math.PI/180;t.root.position.set(...e.position),t.root.rotation.set(e.rotation[0]*n,e.rotation[1]*n,e.rotation[2]*n),t.root.scale.setScalar(e.scale),t.isExtrude&&(t.content.scale.z=e.extrudeDepth/t.baseExtrudeDepth)}function FN(t,e){for(const n of t.materials)n.roughness=e.roughness,n.metalness=e.metalness}function BN(t,e){const{position:n,target:r}=iT([t.center.x,t.center.y,t.center.z],t.maxDim,e.fov,e.fit);t.camera.fov=e.fov,t.camera.position.set(...n),t.camera.lookAt(...r),t.camera.updateProjectionMatrix()}const cT=new V.Box3,lT=new V.Vector3,uT=new V.Vector3;function UN(t,e,n){const r=t.shadow;if(!r)return;const i=r.material;if(i.opacity=e.shadowOpacity,r.visible=e.shadowOpacity>0&&n.keyIntensity>0,!r.visible)return;t.root.updateMatrixWorld(!0);const o=t.boundsOverride,s=o?cT.setFromCenterAndSize(uT.set(...o.center??[t.center.x,t.center.y,t.center.z]),lT.set(...o.size)).applyMatrix4(t.root.matrixWorld):cT.setFromObject(t.content);if(s.isEmpty())return;const a=s.getSize(lT),l=s.getCenter(uT),c=Math.max(a.x,a.z,.001)*2.6;r.scale.set(c,c,1),r.position.set(l.x,s.min.y-e.shadowOffsetY,l.z),t.lighting.key.shadow.radius=2+e.shadowSoftness*10}function Id(t){t.traverse(e=>{const n=e;if(!n.isMesh)return;n.geometry?.dispose();const r=Array.isArray(n.material)?n.material:[n.material];for(const i of r)if(i){for(const o of Object.values(i)){const s=o;s&&s.isTexture&&s.dispose()}i.dispose()}})}const fT=I.createContext(null),ts=({children:t,overrides:e,prefix:n=""})=>{const[r]=I.useState(()=>new Map),[i,o]=I.useState(0),s=I.useCallback((l,c)=>{c?r.set(l,c):r.delete(l),o(u=>u+1)},[r]),a=I.useMemo(()=>({containers:r,revision:i,registerContainer:s,overrides:e,prefix:n}),[r,i,s,e,n]);return M.jsx(fT.Provider,{value:a,children:t})},wr=()=>I.useContext(fT);function wi(t){return Array.isArray(t)?t[0].v:t}const Ar=I.memo(({layer:t})=>t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0?null:M.jsx(GN,{layer:t}));Ar.displayName="AepLayerRouter";const GN=({layer:t})=>{const e=_t(),n=wr(),r=zn(),i=bi(t.id),o=e.framesToSeconds(t.inPoint),s=e.framesToSeconds(t.outPoint),a="assetId"in t?t.assetId:void 0,l=a?e.assets[a]:void 0,c=Ei(a),u=t.kind==="model3d"?{width:t.viewport.width,height:t.viewport.height}:{width:l?.width??e.width,height:l?.height??e.height},f=Y1(t,u),d={x:f.x,y:f.y,width:f.width,height:f.height,anchor:f.anchor,rotation:f.rotation,alpha:f.alpha,scale:f.scale},h=I.useCallback((T,w)=>{},[]),p=I.useCallback(T=>n?.registerContainer(`${n.prefix}${t.id}`,T),[n?.registerContainer,n?.prefix,t.id]),m=Cv(t),g=Rv(t,m),y={uniqueId:t.id,startAt:o,endAt:s,visible:t.hidden!==!0,onContainerRefReady:h};function b(){switch(t.kind){case"image":return M.jsx(hu,{...y,src:c.url,transformation:d});case"video":{const T="muted"in t?!!t.muted:!1;return M.jsx(ld,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,mute:T,locked:!1})}case"audio":return M.jsx(L1,{uniqueId:t.id,src:c.url,startAt:o,endAt:s,inPointFrames:t.inPoint,level:t.level,pan:t.pan,muted:!1,visible:t.hidden!==!0,transformation:d,onContainerRefReady:h});case"gif":return M.jsx(i_,{...y,src:c.url,transformation:d});case"lottie":return M.jsx(pd,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,locked:!1,loop:!0});case"svg":return M.jsx(_y,{...y,src:c.url,transformation:d});case"text":{const T=i??wi(t.source),w=wi(t.style.size),O=t.style.fill?wi(t.style.fill):void 0,C=O==null?"#ffffff":typeof O=="string"?O:r?.[O.themeKey]??O.default;return X1(t)?M.jsx("pixiContainer",{alpha:f.alpha,children:M.jsx(td,{layer:t,animators:t.animators??[],x:f.x,y:f.y})}):M.jsx(O_,{...y,text:T,transformation:{...d,fill:C,fontFamily:t.style.font,fontSize:w,fontColor:C,fontWeight:t.style.weight!=null?String(t.style.weight):void 0,fontStyle:t.style.italic?"italic":void 0,lineHeight:t.style.lineHeight?wi(t.style.lineHeight):void 0,letterSpacing:t.style.letterSpacing?wi(t.style.letterSpacing):void 0}})}case"shape":return M.jsx(R1,{...y,path:t.path,fill:t.fill,stroke:t.stroke,trimPath:t.trimPath,transformation:d,fps:e.fps,inPointFrames:t.inPoint});case"null":return M.jsx(I1,{...y,transformation:d});case"precomp":return M.jsx(pT,{...y,compId:t.compId,layerInPointFrames:t.inPoint,precompWidth:t.width,precompHeight:t.height,transformation:d});case"model3d":return M.jsx(Rd,{...y,layer:t,transformation:d});default:return null}}const x=b();if(x===null||a&&c.state==="error")return null;let v=x;if(m.length>0&&(v=M.jsxs("pixiContainer",{filters:m,children:[g,v]})),"masks"in t&&t.masks&&t.masks.length>0&&(v=M.jsx(D1,{masks:t.masks,fps:e.fps,inPointFrames:t.inPoint,children:v})),"trackMatte"in t&&t.trackMatte){const T=e.layersById.get(t.trackMatte.sourceId);T&&(v=M.jsx(F1,{mode:t.trackMatte.mode,width:e.width,height:e.height,source:M.jsx(Ar,{layer:T}),matted:v}))}return M.jsx($v,{uniqueId:`${n?.prefix??"aep:"}${t.id}`,startAt:o,endAt:s,onSequenceContainerReady:p,children:v})},dT=(t,e,n)=>{const{currentFrame:r}=_t(),i=I.useRef(r),o=I.useRef(new Set);i.current=r;const s=I.useCallback(a=>(o.current.add(a),a(i.current),()=>o.current.delete(a)),[]);return I.useLayoutEffect(()=>{for(const a of o.current)a(r)},[r]),I.useMemo(()=>({start:t,end:t+e,duration:e,ease:n,subscribe:s}),[t,e,n,s])},hT=t=>{const e=Array.isArray(t)?Bn(t):t??"none";return E.parseEase(e)??E.parseEase("none")},jN={},Md=I.memo(({transition:t,overrides:e})=>{const n=_t(),r=wr(),i=e?.[t.id],o=i?.name??t.name,s=i?.params??t.params??jN,a=i?.durationFrames??t.durationFrames,l=I.useMemo(()=>Array.isArray(t.from)?t.from:[t.from],[t.from]),c=I.useMemo(()=>Array.isArray(t.to)?t.to:[t.to],[t.to]),u=l[0]??"",f=c[0]??"",d=I.useMemo(()=>hT(t.ease),[t.ease]),h=dT(t.startFrame,a,d),p=r?.prefix??"",m=I.useCallback(()=>({from:r?.containers.get(`${p}${u}`)??null,to:r?.containers.get(`${p}${f}`)??null}),[r?.containers,r?.revision,p,u,f]),g=I.useMemo(()=>({pairId:`aep:${t.id}`,config:{type:o,name:o,duration:a,ease:"none",params:s},timing:{start:t.startFrame,end:t.startFrame+a,duration:a}}),[t.id,u,f,o,a,s,t.startFrame]),y=I.useCallback(O=>{const C=n.layersById,R=L=>[...new Set(L)].flatMap(N=>{const D=r?.containers.get(`${p}${N}`),F=[...C.keys()].indexOf(N);return D?[{container:D,zIndex:F}]:[]});let P=R(l),A=R(c);if(t.kind==="scene"&&t.includeShared){const L=new Set([...l,...c]),N=[...C.keys()].filter(D=>!L.has(D));P=[...P,...R(N)],A=[...A,...R(N)]}return{fromLayers:P,toLayers:A}},[n.layersById,r?.containers,r?.revision,p,l,c,t.kind,t.includeShared]),b=t.region,x=I.useCallback(()=>{if(b)return b;const O=r?.containers.get(`${p}${u}`),C=r?.containers.get(`${p}${f}`),R=P=>{if(!P)return null;const A=P.getLocalBounds();return{x:A.x,y:A.y,width:A.width,height:A.height}};return Pb([R(O),R(C)])},[b,r?.containers,p,u,f]),v=Math.max(1,Math.round(n.width)),T=Math.max(1,Math.round(n.height)),w=fd({transitionPair:g,width:v,height:T,clock:h,resolveEndpoints:m,getLayerSets:y,hideEndpointsInWindow:t.kind==="element",getRegion:x,fullCanvas:t.kind==="scene"});return M.jsx("pixiContainer",{ref:w,zIndex:Number.MAX_SAFE_INTEGER,sortableChildren:!0})});Md.displayName="AepTransitionMesh";const Ai=I.memo(({transition:t,overrides:e})=>{const n=wr(),r=e??n?.overrides;return r?.[t.id]?.disabled?null:M.jsx(Md,{transition:t,overrides:r})});Ai.displayName="AepTransitionLayer";const HN=({ref:t,...e})=>{const n=_t(),r=wr(),i=P_();if(i+1>yo)throw new Error(`AEP precomp recursion depth exceeded (max ${yo})`);const o=n.precomps[e.compId],s=n.framesToSeconds(e.layerInPointFrames),a=I.useMemo(()=>{if(!o)return null;const d=new Map(o.layers.map(m=>[m.id,m])),h=o.fps||n.fps,p=Math.max(0,(n.currentFrame/n.fps-s)*h);return{fps:h,durationInFrames:o.durationInFrames,width:o.width||e.precompWidth,height:o.height||e.precompHeight,assets:ai(n.assets,o.assets),layersById:d,precomps:{...n.precomps,...o.precomps??{}},framesToSeconds:m=>s+m/h,currentFrame:p}},[o,n,s,e.precompWidth,e.precompHeight]);if(!o||!a)return console.warn(`PixiPreComp: compId '${e.compId}' not found in precomps map`),null;const l=e.transformation.anchor,c=typeof l=="number"?l:l.x,u=typeof l=="number"?l:l.y,f={x:c*e.precompWidth,y:u*e.precompHeight};return M.jsx($e,{...e,pivotOffset:f,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:M.jsx("pixiContainer",{x:e.transformation.x,y:e.transformation.y,children:M.jsx(L_,{depth:i+1,children:M.jsx(ts,{overrides:r?.overrides,prefix:`${r?.prefix??""}${e.uniqueId??e.compId}/${e.compId}:`,children:M.jsxs(si,{value:a,children:[o.layers.map(d=>M.jsx(Ar,{layer:d},d.id)),o.transitions?.map(d=>M.jsx(Ai,{transition:d,overrides:r?.overrides},d.id))]})})})})})},pT=I.memo(HN,et);function mT(t,e=yo,n=0){if(n>e)throw new Error(`AEP precomp recursion depth exceeded (max ${e})`);const r=t.precomps??{};for(const i of Object.values(r))mT(i,e,n+1)}function YN(t){const e=new Set;for(const n of t)"trackMatte"in n&&n.trackMatte&&e.add(n.trackMatte.sourceId);return e}const gT=I.createContext(null),XN=({children:t})=>{const e=I.useMemo(()=>({entries:new Map,subscribers:new Set}),[]);return M.jsx(gT.Provider,{value:e,children:t})};function Ld(){return I.useContext(gT)}function yT(t){for(const e of t.subscribers)e()}function WN(t,e,n,r){if(!t)return null;let i=t.entries.get(e);return i?(i.width=n,i.height=r):(i={canvas:null,texture:null,width:n,height:r,rev:0},t.entries.set(e,i)),i}function zN(t,e){if(!t)return;const n=t.entries.get(e);n&&(n.texture&&n.texture.dispose(),t.entries.delete(e),yT(t))}function qN(t,e,n,r){if(!t)return;const i=t.entries.get(e);if(!i||!n?.renderer?.extract)return;const o=n.renderer.extract.canvas(r);i.canvas=o,i.texture?(i.texture.image=o,i.texture.needsUpdate=!0):(i.texture=new V.CanvasTexture(o),i.texture.flipY=!0,i.texture.minFilter=V.LinearFilter,i.texture.magFilter=V.LinearFilter),i.rev+=1,yT(t)}function _T(t){const e=Ld(),[,n]=I.useReducer(r=>r+1,0);return I.useEffect(()=>{if(e)return e.subscribers.add(n),()=>{e.subscribers.delete(n)}},[e]),e?.entries.get(t)??null}const Pd=new Map,VN=4;function KN(t,e){return`${Math.round(t)}x${Math.round(e)}`}let ZN=(t,e)=>W.RenderTexture.create({width:t,height:e});function $N(t,e){const n=KN(t,e),r=Pd.get(n)??[],i=r.find(s=>!s.inUse);if(i)return i.inUse=!0,i.texture;const o=ZN(t,e);if(r.push({texture:o,inUse:!0}),r.length>VN){const s=r.findIndex(a=>!a.inUse);if(s>=0){const[a]=r.splice(s,1);try{a.texture.destroy(!0)}catch{}}}return Pd.set(n,r),o}function JN(t){for(const e of Pd.values())for(const n of e)if(n.texture===t){n.inUse=!1;return}}function bT(t,e){const n=I.useMemo(()=>$N(t,e),[t,e]);return I.useEffect(()=>()=>JN(n),[n]),n}const Nd=({layer:t})=>{const e=_t(),n=wr(),{app:r}=at.useApplication(),i=Ld(),o=e.precomps[t.compId],s=I.useRef(null),a=bT(o?.width??t.width,o?.height??t.height),l=I.useMemo(()=>{if(!o)return null;const c=new Map(o.layers.map(h=>[h.id,h])),u=o.fps||e.fps,f=e.framesToSeconds(t.inPoint),d=Math.max(0,(e.currentFrame/e.fps-f)*u);return{fps:u,durationInFrames:o.durationInFrames,width:o.width||t.width,height:o.height||t.height,assets:ai(e.assets,o.assets),layersById:c,precomps:o.precomps??{},framesToSeconds:h=>f+h/u,currentFrame:d}},[o,e,t.inPoint,t.width,t.height]);return I.useEffect(()=>(WN(i,t.id,o?.width??t.width,o?.height??t.height),()=>{zN(i,t.id)}),[i,t.id,o?.width,o?.height,t.width,t.height]),at.useTick(()=>{!r||!s.current||!a||(r.renderer.render({container:s.current,target:a}),qN(i,t.id,r,a))}),!o||!l?null:M.jsx("pixiContainer",{ref:s,renderable:!1,children:M.jsx(ts,{overrides:n?.overrides,prefix:`${n?.prefix??""}${t.id}/${t.compId}:`,children:M.jsxs(si,{value:l,children:[o.layers.map(c=>M.jsx(Ar,{layer:c},c.id)),o.transitions?.map(c=>M.jsx(Ai,{transition:c,overrides:n?.overrides},c.id))]})})})};Nd.displayName="AepPrecompRenderer";function QN({onReady:t}){const e=W1(),n=I.useRef(!1);return I.useEffect(()=>{!e||n.current||(n.current=!0,t?.())},[e,t]),null}function ek(t,e){const[n,r]=I.useState(()=>{if(typeof t!="string")try{return Lo(t)}catch(i){return e?.(i),null}return null});return I.useEffect(()=>{if(typeof t!="string")return;let i=!1;return fetch(t).then(o=>o.json()).then(o=>{if(!i)try{r(Lo(o))}catch(s){e?.(s)}}).catch(o=>{i||e?.(o)}),()=>{i=!0}},[t,e]),n}const xT=I.memo(({src:t,assetMap:e,assetResolver:n,currentFrame:r,onReady:i,onError:o,theme:s,textOverrides:a,transitionOverrides:l,onRenderReady:c,onLayerError:u})=>{const f=ek(t,o),d=I.useMemo(()=>Jf(f?.theme,s),[f?.theme,s]);I.useEffect(()=>{f&&i?.(f)},[f,i]);const h=N_(f?.fps??30),p=r??h,m=I.useMemo(()=>{if(!f)return null;const R=new Map(f.layers.map(P=>[P.id,P]));return{fps:f.fps,durationInFrames:f.durationInFrames,width:f.width,height:f.height,assets:ai(f.assets,e),layersById:R,precomps:f.precomps??{},framesToSeconds:P=>P/f.fps,currentFrame:p}},[f,e,p]),{app:g}=at.useApplication();if(!f||!m)return null;const y=g?.screen?.width??f.width,b=g?.screen?.height??f.height,x=Math.min(y/f.width,b/f.height),v=(y-f.width*x)/2,T=(b-f.height*x)/2,w=n??_d,O=YN(f.layers),C=f.layers.filter(R=>R.kind==="precomp"&&"is3D"in R&&R.is3D===!0);return M.jsxs(q1,{onLayerError:u,children:[M.jsx(QN,{onReady:c}),M.jsx(U1,{resolver:w,children:M.jsx($f,{value:d,children:M.jsx(Nv,{value:a,children:M.jsx(si,{value:m,children:M.jsxs(ts,{overrides:l,prefix:"",children:[M.jsxs("pixiContainer",{x:v,y:T,scale:x,sortableChildren:!0,children:[f.layers.filter(R=>!O.has(R.id)).map(R=>M.jsx(Ar,{layer:R},R.id)),f.transitions?.map(R=>M.jsx(Ai,{transition:R,overrides:l},R.id))]}),C.map(R=>M.jsx(Nd,{layer:R},`rt-${R.id}`))]})})})})})]},f.id)});xT.displayName="AepComposition";const vT={x:0,y:0,z:0,rx:0,ry:0,rz:0,sx:1,sy:1,sz:1,alpha:1};function TT(t,e){const n=b=>b*Math.PI/180,r=Math.cos(n(e.rx)),i=Math.sin(n(e.rx)),o=Math.cos(n(e.ry)),s=Math.sin(n(e.ry)),a=Math.cos(n(e.rz)),l=Math.sin(n(e.rz));let c=t.x,u=t.y,f=t.z;const d=a*c-l*u,h=l*c+a*u;c=d,u=h;const p=o*c+s*f,m=-s*c+o*f;c=p,f=m;const g=r*u-i*f,y=i*u+r*f;return u=g,f=y,{x:c,y:u,z:f}}function ET(t,e){const n={x:e.x*t.sx,y:e.y*t.sy,z:e.z*t.sz},r=TT(n,t);return{x:t.x+r.x,y:t.y+r.y,z:t.z+r.z,rx:t.rx+e.rx,ry:t.ry+e.ry,rz:t.rz+e.rz,sx:t.sx*e.sx,sy:t.sy*e.sy,sz:t.sz*e.sz,alpha:t.alpha*e.alpha}}function Oi(t){const{layersById:e,currentFrame:n}=_t();return I.useMemo(()=>{const r=H1(t,e);let i={...vT};for(let o=r.length-1;o>=0;o--){const s=r[o],a=tk(s,n);i=ET(i,a)}return{position:[i.x,i.y,i.z],rotationEuler:[i.rx,i.ry,i.rz],scale:[i.sx,i.sy,i.sz],alpha:i.alpha}},[t,e,n])}function tk(t,e){return t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0&&t.transform3D?ST(t.transform3D,e):nk(t.transform,e)}function ST(t,e){const[n,r,i]=Go(t.position,[0,0,0],e),[o,s,a]=Go(t.rotation,[0,0,0],e),[l,c]=sn(t.scale,[1,1],e),u=ge(t.opacity,1,e);return{x:n,y:r,z:i,rx:o,ry:s,rz:a,sx:l,sy:c,sz:1,alpha:u}}function nk(t,e){const[n,r]=sn(t.position,[0,0],e),[i,o]=sn(t.scale,[1,1],e);return{x:n,y:r,z:0,rx:0,ry:0,rz:ge(t.rotation,0,e),sx:i,sy:o,sz:1,alpha:ge(t.opacity,1,e)}}const kd=({passes:t,currentFrame:e})=>{if(!t||t.length===0)return null;const n=t.filter(r=>r.enabled!==!1).map((r,i)=>ik(r,e,i)).filter(Boolean);return n.length===0?null:M.jsx($n.EffectComposer,{children:n})};kd.displayName="Aep3DPostFx";function ln(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:ge(i,n,r)}function rk(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:Array.isArray(i)&&i.length===2&&typeof i[0]=="number"?[i[0],i[1]]:sn(i,n,r)}function ik(t,e,n){const r=t.params;switch(t.name){case"bloom":return M.jsx($n.Bloom,{intensity:ln(r,"intensity",1,e),luminanceThreshold:ln(r,"luminanceThreshold",.9,e),radius:ln(r,"radius",.6,e)},n);case"chromaticAberration":{const[i,o]=rk(r,"offset",[.002,.002],e);return M.jsx($n.ChromaticAberration,{offset:new qd.Vector2(i,o),modulationOffset:0,radialModulation:!1},n)}case"vignette":return M.jsx($n.Vignette,{darkness:ln(r,"darkness",.5,e),offset:ln(r,"offset",.5,e)},n);case"noise":return M.jsx($n.Noise,{opacity:ln(r,"intensity",.15,e),premultiply:r.premultiply===!0},n);case"cameraLensBlur":return M.jsx($n.DepthOfField,{focusDistance:ln(r,"focusDistance",.02,e),focalLength:ln(r,"focalLength",.05,e),bokehScale:ln(r,"bokehScale",2,e)},n);default:return null}}function wT(t){const e=new V.Shape;switch(t.kind){case"rect":{const n=Or(t.size,[100,100]),[r,i]=n,o=r/2,s=i/2;return e.moveTo(-o,-s),e.lineTo(o,-s),e.lineTo(o,s),e.lineTo(-o,s),e.closePath(),e}case"ellipse":{const n=Or(t.size,[100,100]),[r,i]=n;return e.absellipse(0,0,r/2,i/2,0,Math.PI*2,!1,0),e}case"polystar":{const n=Or(t.points,5),r=Or(t.outerRadius??50,50),i=Or(t.innerRadius??20,20),o=t.starType==="star",s=o?n*2:n;for(let a=0;a<s;a++){const l=-Math.PI/2+a/s*Math.PI*2,c=o?a%2===0?r:i:r,u=c*Math.cos(l),f=c*Math.sin(l);a===0?e.moveTo(u,f):e.lineTo(u,f)}return e.closePath(),e}case"bezier":{const n=Or(t.path,ok());return sk(n,e),e}default:return e}}function ok(){return{vertices:[],inTangents:[],outTangents:[],closed:!1}}function sk(t,e){const n=t.vertices,r=t.inTangents,i=t.outTangents;if(n.length){e.moveTo(n[0][0],n[0][1]);for(let o=1;o<n.length;o++){const s=n[o-1],a=n[o],l=i[o-1]??[0,0],c=r[o]??[0,0];e.bezierCurveTo(s[0]+l[0],s[1]+l[1],a[0]+c[0],a[1]+c[1],a[0],a[1])}if(t.closed&&n.length>2){const o=n[n.length-1],s=n[0],a=i[n.length-1]??[0,0],l=r[0]??[0,0];e.bezierCurveTo(o[0]+a[0],o[1]+a[1],s[0]+l[0],s[1]+l[1],s[0],s[1]),e.closePath()}}}function Or(t,e){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]?t[0].v:t??e}function AT(t){return JSON.stringify(t)}const Dd=({path:t,fill:e="#88ccff",extrusion:n,currentFrame:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=Fd(ge(n.depth,1,r),.01),c=n.bevelThickness?Fd(ge(n.bevelThickness,0,r),.01):0,u=n.bevelSize?Fd(ge(n.bevelSize,0,r),.01):0,f=zn(),d=Yn(e,f),h=xt(d,"#88ccff",r),p=I.useMemo(()=>{const m=wT(t),g={depth:l,bevelEnabled:n.bevelEnabled!==!1&&(c>0||u>0),bevelThickness:c,bevelSize:u,bevelSegments:n.bevelSegments??2,curveSegments:n.curveSegments??12};return new V.ExtrudeGeometry(m,g)},[AT(t),l,c,u,n.bevelEnabled,n.bevelSegments,n.curveSegments]);return I.useEffect(()=>()=>{p.dispose()},[p]),M.jsxs("mesh",{position:i,rotation:o,scale:s,children:[M.jsx("primitive",{object:p,attach:"geometry"}),M.jsx("meshStandardMaterial",{color:h,transparent:a<1,opacity:a,metalness:n.sideMaterial?.metalness??.1,roughness:n.sideMaterial?.roughness??.6})]})};Dd.displayName="Aep3DShapeMesh";function Fd(t,e){return Math.round(t/e)*e}const ak={get:()=>{}},OT=I.createContext(ak),CT=({value:t,children:e})=>M.jsx(OT.Provider,{value:t,children:e});function RT(t){const e=I.useContext(OT);if(t)return e.get(t)}class IT{map=new Map;set(e,n){this.map.set(e,n)}get(e){return this.map.get(e)}has(e){return this.map.has(e)}}function ck(t){if(t<=64)return 64;let e=64;for(;e<t;)e<<=1;return e}const Cr=new V.Matrix4;function lk(t){return new V.ShaderMaterial({vertexShader:Ub,fragmentShader:Gb,uniforms:{uAtlas:{value:t.texture},uDistanceRange:{value:t.distanceRange}},transparent:!0,depthWrite:!1})}const uk=new V.PlaneGeometry(1,1),Bd=({layer:t,atlas:e,currentFrame:n,position:r,rotation:i,scale:o,opacity:s})=>{const a=zn(),l=bi(t.id),c=I.useMemo(()=>l===void 0?t:{...t,source:l},[t,l]),u=jo(c,n,{theme:a}),f=ge(t.style.size,24,n),d=t.style.fill?xt(Yn(t.style.fill,a),"#ffffff",n):"#ffffff",h=t.animators??[],p=I.useMemo(()=>h.map(w=>ge(w.amount,1,n)),[h,n]),m=I.useMemo(()=>Ho(h,u.glyphs,p),[h,u.glyphs.length,p]),g=I.useMemo(()=>u.glyphs.filter(w=>!w.isWhitespace),[u.glyphs]),y=ck(g.length),b=I.useMemo(()=>lk(e),[e]),x=I.useRef(null),v=I.useRef(null),T=I.useRef(null);return I.useEffect(()=>{const w=x.current;if(!w)return;const O=new Float32Array(y*4),C=new Float32Array(y*4),R=new V.InstancedBufferAttribute(O,4),P=new V.InstancedBufferAttribute(C,4);return R.setUsage(V.DynamicDrawUsage),P.setUsage(V.DynamicDrawUsage),w.geometry.setAttribute("aUvRect",R),w.geometry.setAttribute("aColor",P),v.current=R,T.current=P,()=>{w.geometry.deleteAttribute("aUvRect"),w.geometry.deleteAttribute("aColor"),v.current=null,T.current=null}},[y]),is.useFrame(()=>{const w=x.current,O=v.current,C=T.current;if(!w||!O||!C)return;let R=0;for(let L=0;L<m.length;L++){const N=m[L]?.opacity??0;N>R&&(R=N)}if(s+R<=.01)return;const P=u.bounds.width/2,A=u.bounds.height/2;for(let L=0;L<g.length;L++){const N=g[L],D=e.glyphs.get(N.char);if(!D){Cr.makeScale(0,0,0),w.setMatrixAt(L,Cr);continue}const F=m[N.charIndex]??{position:[0,0],scale:[0,0],rotation:0,opacity:0};Wb(Cr,D,{x:N.x,y:N.y,bounds:{width:P*2,height:A*2}},f,F),w.setMatrixAt(L,Cr);const G=L*4;O.array[G]=D.uv[0],O.array[G+1]=D.uv[1],O.array[G+2]=D.uv[2],O.array[G+3]=D.uv[3];const z=t.style.runs?.[N.runIndex]?.fill,K=(typeof z=="string"?z:void 0)??d,se=Math.max(0,Math.min(1,s+F.opacity)),pe=zb(K,se),X=L*4;C.array[X]=pe[0],C.array[X+1]=pe[1],C.array[X+2]=pe[2],C.array[X+3]=pe[3]}for(let L=g.length;L<y;L++)Cr.makeScale(0,0,0),w.setMatrixAt(L,Cr);w.instanceMatrix.needsUpdate=!0,O.needsUpdate=!0,C.needsUpdate=!0}),M.jsx("group",{position:r,rotation:i,scale:o,children:M.jsx("instancedMesh",{ref:x,args:[uk,b,y],frustumCulled:!1})})};Bd.displayName="AepMsdfTextMesh";const Ud=({layer:t,extrusion:e,currentFrame:n,fontUrl:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=zn(),c=bi(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=RT(t.style.font),d=e?.depth!=null&&ge(e.depth,0,n)>0,h=e?.depth?ge(e.depth,1,n):1,p=e?.bevelThickness?ge(e.bevelThickness,0,n):0,m=e?.bevelSize?ge(e.bevelSize,0,n):0,g=_v(r),y=jo(u,n,{boxWidth:t.style.boxWidth,metrics:g,theme:l});if(f&&!d)return M.jsx(Bd,{layer:u,atlas:f,currentFrame:n,position:i,rotation:o,scale:s,opacity:a});const b=ge(t.style.size,24,n),x=t.style.fill?xt(Yn(t.style.fill,l),"#ffffff",n):"#ffffff",v={font:r,size:b,height:h,bevelEnabled:p>0||m>0,bevelThickness:p,bevelSize:m,curveSegments:e?.curveSegments??12},T=t.animators??[],w=(t.style.runs?.length??0)>0;if(!(T.length>0||w||t.splitMode!=null&&t.splitMode!=="single"))return M.jsx("group",{position:i,rotation:o,scale:s,children:M.jsxs(Kd.Text3D,{...v,children:[y.glyphs.map(L=>L.char).join(""),M.jsx("meshStandardMaterial",{color:x,transparent:a<1,opacity:a})]})});const C=T.map(L=>ge(L.amount,1,n)),R=Ho(T,y.glyphs,C),P=y.bounds.width/2,A=y.bounds.height/2;return M.jsx("group",{position:i,rotation:o,scale:s,children:y.glyphs.map((L,N)=>{if(L.isWhitespace)return null;const D=R[N],F=t.style.runs?.[L.runIndex]?.fill,G=(typeof F=="string"?F:void 0)??x,z=L.x-P+D.position[0],K=-(L.y-A)+D.position[1],se=1+D.scale[0],pe=1+D.scale[1],X=-D.rotation*Math.PI/180,he=Math.max(0,Math.min(1,a+D.opacity)),j=t.style.runs?.[L.runIndex],te=j?.size!=null?typeof j.size=="number"?j.size:ge(j.size,b,n):b;return M.jsx("group",{position:[z,K,0],scale:[se,pe,1],rotation:[0,0,X],children:M.jsxs(Kd.Text3D,{...v,size:te,children:[L.char,M.jsx("meshStandardMaterial",{color:G,transparent:he<1,opacity:he})]})},L.charIndex)})})};Ud.displayName="Aep3DTextMesh";const fk=t=>[t[0],-t[1],-t[2]],dk=t=>{const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]},Gd=({layer:t,zOrder:e})=>{const n=Oi(t),r=_T(t.id),[i,o,s]=fk(n.position),a=s+e*.001,[l,c,u]=dk(n.rotationEuler),[f,d]=[n.scale[0],n.scale[1]],h=r?.width??t.width,p=r?.height??t.height;return M.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[M.jsx("planeGeometry",{args:[h,p]}),M.jsx("meshBasicMaterial",{map:r?.texture??null,color:r?.texture?"#ffffff":"#1a2030",transparent:!0,opacity:n.alpha})]})};Gd.displayName="Aep3DPrecompPlane";function hk(t){const e=I.useRef(null);e.current===null&&(e.current=new IT);const n=e.current,[r,i]=I.useState(0);return I.useEffect(()=>{if(!t?.fonts3D)return;let o=!1;for(const[s,a]of Object.entries(t.fonts3D))a.msdf&&(n.has(s)||Bb(a.msdf.json,{pngUrl:a.msdf.png}).then(l=>{o||(n.set(s,l),i(c=>c+1))}).catch(l=>{o||console.warn(`[useMsdfAtlasRegistry] failed to load atlas for "${s}":`,l)}));return()=>{o=!0}},[t,n]),{registry:n,ready:r}}function MT(t,e){const n=[...t??[]];if(!e||e.disableCameraDoF)return n;const r=n.some(o=>o.name==="cameraLensBlur"),i=e.focusDistance!==void 0||e.aperture!==void 0||e.blurLevel!==void 0;return!r&&i&&n.unshift({name:"cameraLensBlur",params:{focusDistance:e.focusDistance??.02,focalLength:e.aperture??.05,bokehScale:e.blurLevel??2}}),n}const LT=({comp:t,currentFrame:e,width:n,height:r,background:i="transparent",disabled:o,theme:s})=>{const a=I.useMemo(()=>Jf(t.theme,s),[t.theme,s]),{cameras:l,lights:c,threeDLayers:u,hasAny:f}=I.useMemo(()=>pk(t.layers),[t.layers]),d=l[0],h=I.useMemo(()=>MT(t.postFx,d),[t.postFx,d]),p=I.useMemo(()=>{const y=new Map(t.layers.map(b=>[b.id,b]));return{fps:t.fps,durationInFrames:t.durationInFrames,width:t.width,height:t.height,assets:ai(t.assets,void 0),layersById:y,precomps:t.precomps??{},framesToSeconds:b=>b/t.fps,currentFrame:e}},[t,e]),{registry:m,ready:g}=hk(t);return o||!f?null:M.jsx(o_,{width:n,height:r,background:i,defaultLights:c.length===0,children:M.jsx(CT,{value:m,children:M.jsx($f,{value:a,children:M.jsxs(si,{value:p,children:[d&&M.jsx(mk,{camera:d,currentFrame:e}),c.map(y=>M.jsx(gk,{light:y,currentFrame:e},y.id)),u.map((y,b)=>M.jsx(yk,{layer:y,currentFrame:e,zOrder:b},y.id)),M.jsx(kd,{passes:h,currentFrame:e})]})})},`msdf-${g}`)})};LT.displayName="Aep3DScene";function pk(t){const e=[],n=[],r=[];for(const i of t)i.kind==="camera"?e.push(i):i.kind==="light"?n.push(i):"is3D"in i&&i.is3D===!0&&r.push(i);return{cameras:e,lights:n,threeDLayers:r,hasAny:e.length+n.length+r.length>0}}function jd(t){return[t[0],-t[1],-t[2]]}function PT(t){const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]}const mk=({camera:t,currentFrame:e})=>{const{camera:n}=is.useThree(),r=Oi(t);return I.useEffect(()=>{if(!(n instanceof V.PerspectiveCamera))return;const[i,o,s]=jd(r.position);n.position.set(i,o,s);const[a,l,c]=PT(r.rotationEuler);n.rotation.set(a,l,c),n.fov=ge(t.fov,50,e),n.updateProjectionMatrix()}),null},gk=({light:t,currentFrame:e})=>{const n=Oi(t),[r,i,o]=jd(n.position),s=ge(t.intensity,1,e),a=xt(t.color,"#ffffff",e),l=new V.Color(a);switch(t.lightType){case"ambient":return M.jsx("ambientLight",{color:l,intensity:s});case"point":return M.jsx("pointLight",{color:l,intensity:s,position:[r,i,o]});case"spot":{const c=t.coneAngle?ge(t.coneAngle,90,e):90,u=t.coneFeather?ge(t.coneFeather,50,e):50;return M.jsx("spotLight",{color:l,intensity:s,position:[r,i,o],angle:c/2*(Math.PI/180),penumbra:u/100})}default:return M.jsx("directionalLight",{color:l,intensity:s,position:[r,i,o]})}},yk=({layer:t,currentFrame:e,zOrder:n})=>{const r=Oi(t),[i,o,s]=jd(r.position),a=s+n*.001,[l,c,u]=PT(r.rotationEuler),[f,d]=[r.scale[0],r.scale[1]],h=r.alpha;if(t.kind==="precomp")return M.jsx(Gd,{layer:t,zOrder:n});if(t.kind==="shape"&&"extrusion"in t&&t.extrusion)return M.jsx(Dd,{path:t.path,fill:t.fill??"#88ccff",extrusion:t.extrusion,currentFrame:e,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h});if(t.kind==="text"){const m=t.style.font,y=typeof m=="string"&&(m.endsWith(".json")||m.includes("/"))?m:"/fonts/helvetiker_regular.typeface.json",b="extrusion"in t&&t.extrusion?t.extrusion:void 0;return M.jsx(Ud,{layer:t,extrusion:b,currentFrame:e,fontUrl:y,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h})}const p=_k(t);return M.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[M.jsx("planeGeometry",{args:[1,1]}),M.jsx("meshStandardMaterial",{color:p,transparent:!0,opacity:h})]})};function _k(t){return t.kind==="shape"&&typeof t.fill=="string"?t.fill:"#88ccff"}function bk(){const t=document.createElement("canvas");t.width=1,t.height=1;const e=new V.CanvasTexture(t);return e.flipY=!1,e.minFilter=V.LinearFilter,e.magFilter=V.LinearFilter,{texture:e,refresh:(i,o)=>{if(!i?.renderer?.extract)return;const s=i.renderer.extract.canvas(o);e.image=s,e.needsUpdate=!0},dispose:()=>{e.dispose()}}}var NT=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(NT||{});const xk=[{label:"Freeform",ratio:null},{label:"1 : 1",ratio:1},{label:"16 : 9",ratio:16/9},{label:"9 : 16",ratio:9/16},{label:"4 : 3",ratio:4/3},{label:"3 : 2",ratio:3/2},{label:"2 : 3",ratio:2/3}],vk=20,ns=t=>Array.isArray(t)?t[0]:t;function kT(t,e){if(!(!t||!e))return[ns(t.x),ns(t.y),ns(e.x),ns(e.y)]}function Be(t,e){if(!t)return;if(t.a===0)return e(t.k);const n=t.k;if(n?.length)return n.map((r,i)=>{const o=n[i+1],s=o?kT(r.o,o.i):void 0;return{t:r.t,v:e(r.s),easeOut:s,hold:r.h===1?!0:void 0}})}const Wt=t=>Array.isArray(t)?t[0]:t,un=t=>{const e=Array.isArray(t)?t:[t,t];return[e[0],e[1]]},DT=t=>{const[e,n]=un(t);return[e/100,n/100]},FT=t=>(Array.isArray(t)?t[0]:t)/100;function BT(t){return{vertices:(t.v??[]).map(e=>[e[0],e[1]]),inTangents:(t.i??[]).map(e=>[e[0],e[1]]),outTangents:(t.o??[]).map(e=>[e[0],e[1]]),closed:t.c===!0}}function Tk(t){if(!t)return;if(t.a===0)return BT(t.k);const e=t.k;if(e?.length)return e.map((n,r)=>{const i=e[r+1],o=i?kT(n.o,i.i):void 0,s=Array.isArray(n.s)?n.s[0]:n.s;return{t:n.t,v:BT(s??{}),easeOut:o,hold:n.h===1?!0:void 0}})}const UT=[0,0],Ek=[1,1];function qn(t){const e=Be(t?.p,un)??UT,n=Be(t?.a,un)??UT,r=Be(t?.s,DT)??Ek,i=Be(t?.r,Wt)??0,o=Be(t?.o,FT)??1,s={position:e,anchor:n,scale:r,rotation:i,opacity:o},a=Be(t?.sk,Wt);a!==void 0&&(s.skew=a);const l=Be(t?.sa,Wt);return l!==void 0&&(s.skewAxis=l),s}function Sn(t){const e=o=>Math.max(0,Math.min(255,Math.round(o*255))).toString(16).padStart(2,"0"),n=e(t[0]??0),r=e(t[1]??0),i=e(t[2]??0);return t.length===4&&t[3]!==void 0&&t[3]<1?`#${n}${r}${i}${e(t[3])}`:`#${n}${r}${i}`}function Ci(t,e){return t?Be(t,Wt)??e:e}function Hd(t,e=[0,0,0]){return t?Be(t,r=>Array.isArray(r)?[r[0]??0,r[1]??0,r[2]??0]:e)??e:e}function Sk(t,e="#ffffff"){return t?Be(t,r=>{if(!Array.isArray(r))return e;const[i,o,s]=r;return Sn([i??1,o??1,s??1])})??e:e}function wk(t,e,n,r){if(!Array.isArray(t)&&typeof e=="number"&&typeof n=="number"&&typeof r=="number"){const[o,s,a]=t;return[o+e,s+n,a+r]}return t}function Ak(t){return t.ty===13}function Ok(t){return t.ty===14}function GT(){return{position:[0,0],anchor:[0,0],scale:[1,1],rotation:0,opacity:1}}function Yd(t){const e=Hd(t?.or),n=Ci(t?.rx,0),r=Ci(t?.ry,0),i=Ci(t?.rz??t?.r,0),o=Be(t?.s??{a:0,k:[100,100,100]},a=>{const l=Array.isArray(a)?a:[100,100,100];return[(l[0]??100)/100,(l[1]??100)/100]})??[1,1],s=Be(t?.o??{a:0,k:100},a=>(Array.isArray(a)?a[0]:a)/100)??1;return{position:Hd(t?.p),anchor:Hd(t?.a),scale:o,rotation:wk(e,n,r,i),opacity:s}}function jT(t,e){return{id:e,name:t.nm,inPoint:t.ip,outPoint:t.op,...typeof t.st=="number"&&{startTime:t.st},...typeof t.parent=="number"&&{parent:`layer_${t.parent}`},...t.hd===1&&{hidden:!0}}}function Ck(t,e){const n=t.pe?Be(t.pe,r=>{const i=Array.isArray(r)?r[0]:r;return typeof i=="number"?i:50})??50:50;return{kind:"camera",...jT(t,e),transform:GT(),transform3D:Yd(t.ks),fov:n}}function Rk(t){switch(t){case 1:return"parallel";case 2:return"spot";case 3:return"point";default:return"ambient"}}function Ik(t,e){const n=Rk(t.lt),r={kind:"light",...jT(t,e),transform:GT(),transform3D:Yd(t.ks),lightType:n,intensity:Be(t.in??{a:0,k:100},i=>{const o=Array.isArray(i)?i[0]:i;return typeof o=="number"?o/100:1})??1,color:Sk(t.cl)};return n==="spot"&&(t.ca&&(r.coneAngle=Ci(t.ca,90)),t.cf&&(r.coneFeather=Ci(t.cf,50))),r}function HT(t){if(!t||typeof t!="object")return;const e=t.__aepPostFx;if(!Array.isArray(e))return;const n=[];for(const r of e){const i=of.safeParse(r);i.success?n.push(i.data):console.warn("bodymovin: dropping invalid __aepPostFx entry",i.error.issues[0]?.message)}return n.length>0?n:void 0}function YT(t){if(!t||typeof t!="object")return;const e=t.__aepExtrusion;if(!(!e||typeof e!="object"))return e}function Mk(t){if(!t||typeof t!="object")return;const e=t.runs;if(!Array.isArray(e)||e.length===0)return;const n=[];for(const r of e){if(typeof r.from!="number"||typeof r.to!="number"||r.to<=r.from)continue;const i={from:r.from,to:r.to};typeof r.font=="string"&&(i.font=r.font),typeof r.size=="number"&&(i.size=r.size),Array.isArray(r.fc)&&r.fc.length===3&&(i.fill=Sn(r.fc)),(typeof r.weight=="number"||typeof r.weight=="string")&&(i.weight=r.weight),typeof r.italic=="boolean"&&(i.italic=r.italic),typeof r.tr=="number"&&typeof r.size=="number"?i.tracking=r.tr/1e3*r.size:typeof r.tr=="number"&&(i.tracking=r.tr/1e3),typeof r.bs=="number"&&(i.baselineShift=r.bs),n.push(i)}return n.length>0?n:void 0}function Vn(t){return typeof t.ind=="number"?`layer_${t.ind}`:(t.nm??"layer").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"layer"}function Rr(t){return{id:Vn(t),name:t.nm,inPoint:t.ip,outPoint:t.op,startTime:t.st,parent:typeof t.parent=="number"?`layer_${t.parent}`:void 0,hidden:t.hd===1?!0:void 0}}function XT(t){const e=[];for(const n of t)n.ty==="gr"&&n.it?e.push(...XT(n.it)):e.push(n);return e}function Lk(t){switch(t.ty){case"rc":{const e=Be(t.s,un)??[0,0],n=Be(t.p,un),r=Be(t.r,Wt);return{kind:"rect",size:e,...n!==void 0&&{position:n},...r!==void 0&&{roundness:r}}}case"el":{const e=Be(t.s,un)??[0,0],n=Be(t.p,un);return{kind:"ellipse",size:e,...n!==void 0&&{position:n}}}case"sr":{const e=Be(t.pt,Wt)??5,n=Be(t.or,Wt)??0,r=Be(t.ir,Wt),i=Be(t.r,Wt),o=Be(t.p,un);return{kind:"polystar",starType:t.sy===2?"polygon":"star",points:e,outerRadius:n,...r!==void 0&&{innerRadius:r},...i!==void 0&&{rotation:i},...o!==void 0&&{position:o}}}case"sh":{const e=Tk(t.ks);return e===void 0?null:{kind:"bezier",path:e}}default:return null}}function Pk(t){if(t?.c)return t.c.a===0?Sn(t.c.k):Sn(t.c.k[0].s)}function Nk(t,e,n){const r=Pk(t);if(r===void 0)return;const i=t?.c?.x;if(!i||!n)return r;const o=n(e,i);return o?{themeKey:o,default:r}:r}function kk(t,e){const n=XT(t.shapes),r=n.map(Lk).filter(l=>l!==null);if(r.length===0)return[];const i=Nk(n.find(l=>l.ty==="fl"),t.nm??"",e.resolveColorControl),o=Vn(t),s=Rr(t),a=qn(t.ks);return r.map((l,c)=>({kind:"shape",...s,id:c===0?s.id:`${o}_path_${c}`,...t.nm&&c>0&&{name:`${t.nm} / path ${c+1}`},transform:a,path:l,...i!==void 0&&{fill:i}}))}function Dk(t){return{kind:"shape",...Rr(t),transform:qn(t.ks),path:{kind:"rect",size:[t.sw,t.sh]},fill:t.sc}}function Fk(t){return{kind:"null",...Rr(t),transform:qn(t.ks)}}function Bk(t){return{kind:"image",...Rr(t),assetId:t.refId,transform:qn(t.ks)}}function Uk(t){return{kind:"precomp",...Rr(t),compId:t.refId,width:t.w,height:t.h,transform:qn(t.ks)}}function Gk(t){const e=t.t?.d?.k?.[0]?.s;if(!e)return null;const n=Mk(e),r={font:e.f,size:e.s,align:e.j===1?"right":e.j===2?"center":"left",...e.fc&&{fill:Sn(e.fc)},...e.lh!==void 0&&{lineHeight:e.lh},...e.tr!==void 0&&{letterSpacing:e.tr/1e3},...e.sc&&e.sw!==void 0&&{stroke:{color:Sn(e.sc),width:e.sw}},...n!==void 0&&{runs:n}};return{kind:"text",...Rr(t),transform:qn(t.ks),source:e.t,style:r}}function jk(t){switch(t.ty){case 0:return Uk(t);case 1:return Dk(t);case 2:return Bk(t);case 3:return Fk(t);case 5:return Gk(t);default:return null}}function WT(t,e={}){if(Ak(t))return[Ck(t,Vn(t))];if(Ok(t))return[Ik(t,Vn(t))];let n;if(t.ty===4)n=kk(t,e);else{const r=jk(t);n=r?[r]:[]}return n.length===0?[]:n.map(r=>{if(r.kind==="camera"||r.kind==="light")return r;let i=r;if(t.ddd===1&&(i=Yk(i,t)),e.matteSourceId&&t.tt!=null){const o=Hk(t.tt);o&&(i.trackMatte={sourceId:e.matteSourceId,mode:o})}if(i.kind==="shape"||i.kind==="text"){const o=YT(t);o&&(i.extrusion=o)}return i})}function Hk(t){switch(t){case 1:return"alpha";case 2:return"alpha-inverted";case 3:return"luma";case 4:return"luma-inverted";default:return null}}function Yk(t,e){if(t.kind==="camera"||t.kind==="light")return t;const n=e.ks;return n?{...t,is3D:!0,transform3D:Yd(n)}:t}const st={precomp:0,solid:1,image:2,null:3,shape:4,text:5,audio:6,video:9,camera:13,light:14},Xk=new Set([st.precomp,st.solid,st.image,st.null,st.shape,st.text,st.audio,st.video]),Wk=new Set([20,21,22,23,24,25,26,27,28,29,31,32,33,34]);function Tt(t){if(!t||typeof t!="object")return[];const e=t.layers;return Array.isArray(e)?e:[]}function dt(t){if(!t||typeof t!="object")return;const e=t.nm;return typeof e=="string"?e:void 0}function Xd(t,e,n=""){if(!t||typeof t!="object")return;if(Array.isArray(t)){t.forEach((i,o)=>Xd(i,e,`${n}[${o}]`));return}const r=t;("k"in r||"x"in r)&&e(r,n);for(const i of Object.keys(r))Xd(r[i],e,n?`${n}.${i}`:i)}const zk=[{id:"unsupported-layer-kind",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"unsupported-layer-kind"))return;const i=n.ty;if(typeof i!="number"){e.push({severity:"error",message:`Layer ${r} has no numeric \`ty\` — not a valid Bodymovin layer.`,layerIndex:r,layerName:dt(n)});return}i===st.camera||i===st.light||Xk.has(i)||e.push({severity:"error",message:`Layer ${r} uses unsupported Bodymovin \`ty: ${i}\`. Drop the layer or pre-render it as a video asset.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"expression",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{!n||typeof n!="object"||Et(n,"expression")||Xd(n,(i,o)=>{typeof i.x=="string"&&i.x.length>0&&e.push({severity:"error",message:`Layer ${r} property ${o} carries an expression. Run the expression baker (aep-17) before export.`,layerIndex:r,layerName:dt(n),path:o})})}),e}},{id:"3d-layer",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"3d-layer"))return;n.ddd===1&&e.push({severity:"info",message:`Layer ${r} is 3D-toggled (ddd: 1). Will render via the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)})}),e}},{id:"camera-or-light",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"camera-or-light"))return;const i=n.ty;i===st.camera?e.push({severity:"info",message:`Layer ${r} is a camera (ty: 13). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)}):i===st.light&&e.push({severity:"info",message:`Layer ${r} is a light (ty: 14). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:dt(n)})}),e}},{id:"layer-style",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"layer-style"))return;const i=n.sy;Array.isArray(i)&&i.length>0&&e.push({severity:"warn",message:`Layer ${r} uses ${i.length} layer style(s). Layer styles are not parsed; re-author using shape strokes / effect filters.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"time-remap",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"time-remap"))return;const i=n.tm,o=n.sr;i!=null&&e.push({severity:"warn",message:`Layer ${r} uses time remap. Pre-bake to a flat keyframe timeline before export.`,layerIndex:r,layerName:dt(n),path:"tm"}),typeof o=="number"&&o!==1&&e.push({severity:"warn",message:`Layer ${r} has time stretch sr=${o}. Bake the stretch into keyframes or pre-render the source.`,layerIndex:r,layerName:dt(n),path:"sr"})}),e}},{id:"unsupported-effect",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"unsupported-effect"))return;const i=n.ef;Array.isArray(i)&&i.forEach((o,s)=>{if(!o||typeof o!="object")return;const a=o.ty;typeof a=="number"&&(Wk.has(a)||e.push({severity:"warn",message:`Layer ${r} effect[${s}] uses unsupported effect ty=${a}. Pre-render to footage or substitute with a supported effect.`,layerIndex:r,layerName:dt(n),path:`ef[${s}]`}))})}),e}},{id:"adjustment-layer",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"adjustment-layer"))return;const i=n.ao,o=n.ty;i===1&&o===st.solid&&e.push({severity:"warn",message:`Layer ${r} is an adjustment layer. The engine does not compose effects across sibling layers — apply effects per-layer instead.`,layerIndex:r,layerName:dt(n)})}),e}},{id:"shape-operator",check:t=>{const e=[],n=new Set(["mm","rp","op","pb","tw","zz","rd"]);function r(i,o,s,a){if(!i)return;if(Array.isArray(i)){i.forEach((u,f)=>r(u,o,s,`${a}[${f}]`));return}if(typeof i!="object")return;const l=i,c=l.ty;typeof c=="string"&&n.has(c)&&e.push({severity:"warn",message:`Layer ${o} shape operator '${c}' (${a}) is not supported. Pre-bake the path to a single bezier before export.`,layerIndex:o,layerName:dt(s),path:a}),Array.isArray(l.it)&&r(l.it,o,s,`${a}.it`),Array.isArray(l.shapes)&&r(l.shapes,o,s,`${a}.shapes`)}return Tt(t).forEach((i,o)=>{if(!i||typeof i!="object"||Et(i,"shape-operator")||i.ty!==st.shape)return;const a=i.shapes;Array.isArray(a)&&r(a,o,i,"shapes")}),e}},{id:"text-runs-incomplete-coverage",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"text-runs-incomplete-coverage")||n.ty!==st.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=c.t;if(typeof f!="string")return;const d=f.length;if(d===0)return;const h=new Uint8Array(d);for(const m of u){if(!m||typeof m!="object")continue;const g=m.from,y=m.to;if(typeof g!="number"||typeof y!="number")continue;const b=Math.max(0,Math.floor(g)),x=Math.min(d,Math.floor(y));for(let v=b;v<x;v++)h[v]=1}let p=0;for(let m=0;m<d;m++)h[m]||p++;p>0&&e.push({severity:"warn",message:`Layer ${r} text \`runs\` cover ${d-p}/${d} chars; ${p} gap(s) filled with layer-level style at parse. Re-export with full per-letter coverage or remove \`runs\` to silence.`,layerIndex:r,layerName:dt(n),path:"t.d.k[0].s.runs"})}),e}},{id:"text-overlapping-runs",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"text-overlapping-runs")||n.ty!==st.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=u.filter(d=>!!d&&typeof d=="object"&&typeof d.from=="number"&&typeof d.to=="number").slice().sort((d,h)=>d.from-h.from);for(let d=1;d<f.length;d++){const h=f[d-1],p=f[d];p.from<h.to&&e.push({severity:"error",message:`Layer ${r} text \`runs\` overlap: [${h.from},${h.to}) ∩ [${p.from},${p.to}). Each character may be claimed by at most one run.`,layerIndex:r,layerName:dt(n),path:"t.d.k[0].s.runs"})}}),e}},{id:"extrusion-without-is3d",check:t=>{const e=[];return Tt(t).forEach((n,r)=>{if(!n||typeof n!="object"||Et(n,"extrusion-without-is3d"))return;const i=n;(i.__aepExtrusion!==void 0||i.__aep_extrusion!==void 0)&&(i.ty!==st.shape&&i.ty!==st.text||i.ddd!==1&&e.push({severity:"warn",message:`Layer ${r} has \`extrusion\` set but is not 3D (\`ddd:0\`). Extrusion only renders in the Three sub-scene; toggle 3D in AE or remove the extrusion extension.`,layerIndex:r,layerName:dt(n),path:"__aepExtrusion"}))}),e}}];class zT extends Error{constructor(e){super(`Bodymovin lint found ${e.findings.filter(n=>n.severity==="error").length} error(s). First: ${e.findings.find(n=>n.severity==="error")?.message}`),this.report=e,this.name="LottieLintError"}report}function qT(t,e={}){const n=new Set(e.disabledRules??[]),r=zk.filter(s=>!n.has(s.id)),i=qk(t,r),o=Vk(i);return{findings:o,hasErrors:o.some(s=>s.severity==="error"),hasWarnings:o.some(s=>s.severity==="warn")}}function qk(t,e){const n=[];for(const r of e)try{const i=r.check(t);for(const o of i)n.push({...o,ruleId:r.id})}catch{}return n}function Vk(t){const e=new Set,n=[];for(const i of t){const o=`${i.ruleId}::${i.layerIndex??-1}::${i.path??""}`;e.has(o)||(e.add(o),n.push(i))}const r={error:0,warn:1,info:2};return n.sort((i,o)=>{const s=r[i.severity]-r[o.severity];return s!==0?s:(i.layerIndex??-1)-(o.layerIndex??-1)}),n}function Et(t,e){if(!t||typeof t!="object")return!1;const n=t.__aepLintSuppress;return Array.isArray(n)?n.includes(e):!1}const Kk="ADBE Color Control";function Zk(t,e){const n={},r=new Set,i=new Map;for(const o of t){if(!Array.isArray(o.ef))continue;const s=o.ef.filter(c=>c.mn===Kk);if(s.length===0)continue;r.add(e(o));const a=o.nm??"",l=new Map;for(const c of s){const u=c.nm;if(!u)continue;l.set(u,u);const d=c.ef?.find(h=>h.ty===2)?.v?.k;Array.isArray(d)&&d.length>=3&&(n[u]=Sn(d))}l.size>0&&i.set(a,l)}return{theme:n,sourceLayerIds:r,resolveToken(o,s){return i.get(o)?.get(s)}}}const $k=[/comp\([^)]+\)\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"](?:Color|"Color"|'Color')['"]\s*\)/,/thisComp\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/],Jk=/(?:^|[^.\w])effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/;function Qk(t){for(const n of $k){const r=n.exec(t);if(r)return{layerName:r[1],effectName:r[2]}}const e=Jk.exec(t);return e?{layerName:"",effectName:e[1]}:null}function eD(t,e={}){const n=t;if(!n||typeof n.fr!="number"||!Array.isArray(n.layers))throw new Error("bodymovinToAep: input does not look like a Bodymovin JSON document");const r=e.lint??"strict";if(r!=="off"){const h=qT(t,{disabledRules:e.disabledRules});if(r==="strict"&&h.hasErrors)throw new zT(h);if(r==="warn"||r==="strict"&&h.hasWarnings)for(const p of h.findings)console.warn(`[bodymovin lint:${p.severity}] ${p.ruleId} — ${p.message}`)}const i=Zk(n.layers,Vn),o=(h,p)=>{const m=Qk(p);if(!m)return;const g=m.layerName===""?h:m.layerName;return i.resolveToken(g,m.effectName)},{layers:s,assets:a,precomps:l}=VT(n.layers,o,i.sourceLayerIds),{mergedAssets:c,mergedPrecomps:u}=tD(a,l,n.assets??[]),f=HT(t),d=Object.keys(i.theme).length?i.theme:void 0;return Lo({version:"1.0.0",id:n.nm??"lottie-import",name:n.nm,width:n.w,height:n.h,fps:n.fr,durationInFrames:n.op,layers:s,assets:c,...Object.keys(u).length>0&&{precomps:u},...f&&{postFx:f},...d&&{theme:d}})}function VT(t,e,n){const r=t.map(o=>Vn(o)),i=[];for(let o=0;o<t.length;o++){const s=t[o];if(n?.has(r[o]))continue;const a=t[o-1],l=s.tt!=null&&s.tt>0&&a?.td===1?r[o-1]:void 0,c=WT(s,{matteSourceId:l,resolveColorControl:e});if(c.length===0){console.warn(`bodymovinToAep: dropping unsupported layer ty=${s.ty}`+(s.nm?` (${s.nm})`:""));continue}i.push(...c)}return{layers:i,assets:{},precomps:{}}}function tD(t,e,n){const r={...t},i={...e};for(const o of n)if("layers"in o&&Array.isArray(o.layers)){const s=VT(o.layers);r[o.id]={type:"composition",src:""},i[o.id]={version:"1.0.0",id:o.id,width:0,height:0,fps:0,durationInFrames:1,layers:s.layers,assets:s.assets}}else{const s=o,a=(s.u??"")+(s.p??"");r[o.id]={type:"image",src:a,...s.w!==void 0&&{width:s.w},...s.h!==void 0&&{height:s.h}}}return{mergedAssets:r,mergedPrecomps:i}}const KT=(t,e)=>t.flatMap((n,r)=>Ob(n.name)?[]:[{ruleId:"transition-unknown-name",severity:"warn",message:`Transition '${n.id}' uses unknown shader '${n.name}'; it will render as a crossfade.`,path:`${e}transitions.${r}.name`}]),nD=t=>{const e=[...KT(t.transitions??[],""),...Object.entries(t.precomps??{}).flatMap(([n,r])=>KT(r.transitions??[],`precomps.${n}.`))];return{findings:e,hasErrors:!1,hasWarnings:e.length>0}};_.AEP_MAX_PRECOMP_DEPTH=yo,_.AEP_SCHEMA_MAJOR=hf,_.AEP_SCHEMA_VERSION=gM,_.AEP_TEXT_ALIGN_VALUES=ub,_.ALL_GOOGLE_FONTS=_L,_.ANIMATION=Em,_.ANIMATIONS_WITHOUT_ALPHA=ja,_.ANIMATION_CONFIGS=Te,_.ANIMATION_TIMING=Dt,_.ASPECT_RATIOS=xk,_.AbstractContainer=$e,_.Aep3DPostFx=kd,_.Aep3DPrecompPlane=Gd,_.Aep3DScene=LT,_.Aep3DShapeMesh=Dd,_.Aep3DTextMesh=Ud,_.AepAssetResolverProvider=U1,_.AepComposition=xT,_.AepLayerProvider=si,_.AepLayerRouter=Ar,_.AepMaskContainer=D1,_.AepMsdfTextMesh=Bd,_.AepPrecompRenderProvider=XN,_.AepPrecompRenderer=Nd,_.AepReadinessProvider=q1,_.AepRecursionDepthProvider=L_,_.AepTextOverrideProvider=Nv,_.AepThemeProvider=$f,_.AepTransitionLayer=Ai,_.AepTransitionMesh=Md,_.AepTransitionProvider=ts,_.Animations=to,_.AudioPlaybackManager=Pu,_.BOXED_PADDING=pi,_.BlendModes=NT,_.BorderMaskContainer=Ot,_.CANVAS_DEFAULTS=Zr,_.CANVAS_TEXT_MAX_LENGTH=uv,_.CLIP_LOCAL_TOLERANCE_SEC=Cf,_.DEFAULT_BOXED_COLOR=qx,_.DEFAULT_DUCK_FADE_SEC=po,_.DEFAULT_DUCK_TO=Iu,_.DEFAULT_LIGHTING_PRESET=Ed,_.DEFAULT_MAX_REGION_PIXELS=mf,_.DEFAULT_SEGMENT_GAP_SEC=Mx,_.DEFAULT_WORD_SPACING_EM=Vb,_.DRIFT_TOLERANCE_SEC=Vy,_.EMOJI_CDN_BASE=wx,_.Events=ke,_.FALLBACK_SPACE_EM=qb,_.FONT_LOAD_TIMEOUT_MS=lv,_.GLOW_POP_BLOOM_ALPHA=sx,_.GLOW_POP_BLOOM_BLUR_EM=ox,_.GLOW_POP_BLOOM_PASSES=ax,_.GLOW_POP_BLUR_EM=ix,_.GLOW_POP_EMOJI_BLOOM_ALPHA=cx,_.GLOW_POP_EMOJI_MS=rx,_.GLOW_POP_EMOJI_OFFSET_EM=vf,_.GLOW_POP_EMOJI_SIZE_EM=xf,_.GLOW_POP_ENTER_MS=tx,_.GLOW_POP_EXIT_MS=nx,_.GLOW_POP_STREAK_ALPHA=bf,_.GOOGLE_FONTS=cv,_.GlTransitionRegistryProvider=bP,_.GsapPixieContext=Ye,_.GsapPixieContextProvider=$E,_.IDENTITY_TRANSFORM_3D=vT,_.LIGHTING_PRESETS=Td,_.LINE_PITCH=Kb,_.LOOP_ANIMATIONS=vm,_.LottieLintError=zT,_.MIN_CROP_SIZE=vk,_.MIN_VISIBLE_BLUR=Lf,_.MODEL3D_DEFAULTS=vt,_.MSDF_FRAGMENT_SHADER=Gb,_.MSDF_VERTEX_SHADER=Ub,_.MUSIC_BED_DEFAULT_VOLUME=vR,_.MaskTypes=Bt,_.MetricsCache=__,_.MsdfAtlasProvider=CT,_.MsdfAtlasRegistry=IT,_.OverlayTilingSpriteTypes=Np,_.OverlayTypes=Gr,_.PIXITEXT_HITAREA_PREFIX=w_,_.PIXITEXT_TEXT_LABEL=A_,_.PRELOAD_FONTS=bL,_.Pixi3DModelLayer=Rd,_.PixiAnimatedSprite=mP,_.PixiAudioSprite=t_,_.PixiCaptionsTrack=rP,_.PixiElementTransition=Xo,_.PixiGifSprite=i_,_.PixiGlTransition=n1,_.PixiImageSprite=hu,_.PixiLottieSprite=pd,_.PixiMorphSvgSprite=bR,_.PixiNullObject=I1,_.PixiOverlayTilingSprite=kp,_.PixiPreComp=pT,_.PixiRemotionGifSprite=NP,_.PixiRemotionImageSprite=IP,_.PixiRemotionSprite=CP,_.PixiRemotionVideoCanvaSprite=LP,_.PixiSceneTransition=hd,_.PixiSequence=$v,_.PixiSequenceWrapper=gP,_.PixiShapeLayer=R1,_.PixiSvgImageSprite=oR,_.PixiSvgPathSprite=_y,_.PixiSvgRawSprite=yy,_.PixiTextSplit=td,_.PixiTextSprite=O_,_.PixiThreeModelSprite=LR,_.PixiThreeSprite=o_,_.PixiTrackMatte=F1,_.PixiUnifiedTransformer=aN,_.PixiVideoCanvasSyncSprite=hP,_.PixiVideoSprite=ld,_.SPECIAL_ANIMATIONS=$r,_.SPRING_POP_AMPLITUDE_EM=hx,_.SPRING_POP_BLOOM_ALPHA=yx,_.SPRING_POP_BLOOM_BLUR_EM=gx,_.SPRING_POP_BLUR_ALPHA=Tf,_.SPRING_POP_BLUR_EM=mx,_.SPRING_POP_BLUR_MS=px,_.SPRING_POP_DAMPING=dx,_.SPRING_POP_FREQUENCY_HZ=fx,_.SPRING_POP_SPLIT_ALPHA=Ex,_.SPRING_POP_SPLIT_BOTTOM=Tx,_.SPRING_POP_SPLIT_EM=xx,_.SPRING_POP_SPLIT_MS=bx,_.SPRING_POP_SPLIT_SETTLED_EM=Ef,_.SPRING_POP_SPLIT_TOP=vx,_.SPRITE_REF_PROP_NAMES=ny,_.THREE_DEFAULTS=Gt,_.TRANSITIONS_MIN_VERSION=pf,_.TextRunsOverlapError=db,_.ThreeOffscreenRenderer=Q1,_.Transitions=TM,_.VOICE_TRACK_ROLES=Hy,_.WORDBOX_GROW_MS=Zx,_._listEffectHandlers=UL,_.acquireOffscreenRenderer=Cd,_.acquireVideoAsset=rv,_.activeScaleFor=No,_.activeWordIndexAt=ex,_.activeWordScaleFor=Sf,_.activeWordWindow=$b,_.aepAnimatableOf=q,_.aepAssetKindSchema=K_,_.aepAssetMapSchema=$_,_.aepAssetSchema=Z_,_.aepBezierPathSchema=fi,_.aepCameraLayerSchema=rb,_.aepCompositionSchema=Mo,_.aepEaseHandleSchema=tf,_.aepEffectNameSchema=J_,_.aepEffectSchema=Q_,_.aepKeyframeOf=nf,_.aepLayerSchema=Tb,_.aepLightLayerSchema=ib,_.aepMaskModeSchema=tb,_.aepMaskSchema=nb,_.aepPostFxNameSchema=eb,_.aepPostFxSchema=of,_.aepRangeBasedOnSchema=sb,_.aepRangeShapeSchema=ob,_.aepShapePathSchema=_b,_.aepTextAlignSchema=fb,_.aepTextAnimatorSchema=cb,_.aepTextRangeSelectorSchema=ab,_.aepTextStyleRunSchema=lb,_.aepTextStyleSchema=xb,_.aepThemableColorSchema=uf,_.aepThemableColorValueSchema=mb,_.aepThemeMapSchema=gb,_.aepThemeRefSchema=pb,_.aepTransform3DSchema=Io,_.aepTransformSchema=Ro,_.aepTransitionSchema=yb,_.animationAffectsAlpha=dw,_.applyAudioDecision=Lu,_.applyEntranceOverlaps=fL,_.applyMaterialOverrides=l_,_.areSpritePropsEqual=et,_.asNumber=Wt,_.asOpacity=FT,_.asScale=DT,_.asVec2=un,_.audioRegistry=hr,_.bodymovinToAep=eD,_.boxedBackgroundSpec=Kx,_.boxedRadiusFor=Vx,_.brightnessContrastHandler=zf,_.buildAudioLevelTimeline=KL,_.buildBezierPathTimeline=Iv,_.buildColorValueTimeline=fv,_.buildExtrudeGeometry=vd,_.buildGainSpec=SR,_.buildLayerTimeline=I_,_.buildPrimitiveGeometry=xd,_.buildRasterSvg=py,_.buildResourceUrlModifier=f_,_.buildScalarValueTimeline=Zf,_.buildSourceGeometry=wN,_.buildTextStyleOptions=Hu,_.buildV8FillGradient=E_,_.buildVec2ValueTimeline=Mv,_.camelToUpperSnake=lr,_.captionModeFor=Qb,_.captionSegmentSchema=Rx,_.captionSegmentsSchema=Ix,_.captionTimeAt=Mf,_.captionWordSchema=Cx,_.captionWordText=JM,_.clipFileTime=Ky,_.clipSegmentsToRange=uL,_.clipTimeAt=a_,_.clipTimeSeconds=oT,_.clipVolumeAt=Zy,_.clonePath=Xn,_.coerceLegacyTextAlign=cf,_.composeAnimators=Ho,_.composeTransform3D=ET,_.computeInstanceMatrix=Wb,_.computeModelPose=s_,_.convertLayer=WT,_.convertProperty=Be,_.convertTransform=qn,_.createAssetRefCounter=Ja,_.createAudioRegistry=jy,_.createCanvasMetricsProvider=b_,_.createGLTransitionShader=Ib,_.createPixiSelector=rO,_.createRendererPool=eT,_.cubicBezierEase=dv,_.dbToLinear=TR,_.decideAudioSync=Mu,_.defaultAssetResolver=_d,_.deriveDuckWindows=qy,_.detectOutlineIcon=hy,_.detectSubtitleFormat=Ux,_.directionFromAzimuthElevation=V1,_.displayedWordsFor=Xx,_.disposeObject=Fu,_.drawAepMaskComposite=k1,_.drawMaskShape=$a,_.drawShape=w1,_.dropShadowHandler=jf,_.duckGainAt=Xy,_.duckWindowsFromEnvelope=zy,_.easeCaptionProgress=xn,_.easeNameFor=Bn,_.easeOutBack=lx,_.emitCustomEvent=Ln,_.estimateWordTimings=Of,_.fadeGainAt=Yy,_.fastBoxBlurHandler=qf,_.findAllByPattern=Za,_.findByName=Ka,_.fitCameraToObject=u_,_.fitDistance=Du,_.flattenThemableColor=Yn,_.fontFamilyKey=kf,_.fontWeightsOf=yi,_.formatGoogleFamily=gi,_.frameCamera=iT,_.fromMultiplierColorCorrection=QA,_.gainAt=Wy,_.gaussianBlurHandler=Gf,_.getAepTransitionEase=hT,_.getAvailableTransitions=Cb,_.getEffectFilter=Pm,_.getEffectHandler=Kf,_.getElementName=Va,_.getLoadedFonts=xL,_.getOffscreenRenderer=IN,_.getPixiTextHitAreaName=nI,_.getTransitionInfo=SM,_.getTransitionShader=Po,_.getUniqueIdFromName=tO,_.gifFrameAt=r_,_.glowHandler=Hf,_.glowPopMotion=ux,_.googleFontsHref=av,_.groupWordsIntoSegments=nL,_.hasMaterialOverrides=c_,_.hexToRgba=zb,_.hueSaturationHandler=Yf,_.hydrateMsdfAtlas=VM,_.interpolateBezierPath=Ff,_.isClipLocal=Gx,_.isExternalUrl=vM,_.isFontSpecCovered=ov,_.isFrameInRange=sT,_.isLoopAnimation=Tm,_.isSingleWordMode=ZM,_.isSpecialAnimation=hw,_.isSvgSource=gy,_.isTimeBasedMode=Yx,_.isValidAnimation=pw,_.isWhitespaceChar=h_,_.layerIdFor=Vn,_.layoutCaptionWords=Jb,_.layoutText=x_,_.lerpColor=mv,_.lerpNumber=hv,_.lerpVec2=pv,_.levelsHandler=Xf,_.linearToDb=ER,_.lintAepTransitions=nD,_.lintBodymovinJson=qT,_.listGlTransitionNames=wM,_.loadGoogleFonts=wL,_.loadMsdfAtlas=Bb,_.loadSpriteTexture=cO,_.loadSpriteTextureSync=ro,_.lottieColorToHex=Sn,_.mapV7DropShadow=v_,_.mapV7Stroke=T_,_.markVideoReady=Bo,_.materialOverrideKey=ku,_.mergeAssetMaps=ai,_.mergeTheme=Jf,_.metricsCacheKey=y_,_.model3DStateKey=J1,_.newCustomEventEmitter=ZE,_.normalizeAnimation=Ha,_.normalizeCaptionSegments=tL,_.normalizeFontWeight=Gu,_.normalizeLetterSpacing=S_,_.normalizeLoopAnimation=wm,_.normalizeTextRuns=hb,_.notoEmojiFileName=Ax,_.overlays=_a,_.parseAepComposition=Lo,_.parseAepCompositionSafe=xM,_.parseCaptionColor=zx,_.parseCaptionSegments=$M,_.parseHexColor=Wn,_.parseSRT=Fx,_.parseSubtitles=sL,_.parseTimestamp=ko,_.parseVTT=Bx,_.pathHash=AT,_.pathToThreeShape=wT,_.planPropSegments=R_,_.projectSegments=lL,_.rangeShapeValue=Qf,_.readExtrusionExtension=YT,_.readOriginalSize=dy,_.readPostFxExtension=HT,_.registerEffectHandler=BL,_.registerVideo=ev,_.releaseOffscreenRenderer=rT,_.releaseVideoAsset=iv,_.resetVideoReadiness=pL,_.resolveBlendModeString=Xa,_.resolveBlendStrategy=yw,_.resolveCaptionOffset=cL,_.resolveEmojiSrc=wf,_.resolveLightingConfig=Sd,_.resolvePostFxList=MT,_.resolveSequenceTransitions=e1,_.resolveSpaceWidth=Zb,_.resolveTextRuns=yf,_.resolveTextRunsWithWarnings=XM,_.resolveTextSource=ZL,_.resolveTextSplitFills=kv,_.resolveThemedColorValue=ff,_.resolveWordSpacing=_f,_.rewriteSvg=my,_.rgbaToHex=_i,_.rotateVec3Euler=TT,_.sampleAnimatable=Tr,_.sampleAnimatedBezier=Uf,_.sampleBezierPath=v1,_.sampleCaptionAt=If,_.sampleColor=xt,_.sampleModel3DState=Od,_.samplePath=yd,_.sampleScalar=ge,_.sampleVec2=sn,_.sanitizeCanvasText=CL,_.sanitizeImageSrc=Qa,_.selectorPerChar=ed,_.shouldSplitText=X1,_.splitGraphemes=d_,_.springPopMotion=_x,_.springPopSplit=Sx,_.staticParam=Fe,_.threeTextureFromPixi=bk,_.tintHandler=Wf,_.transformCaptionText=xr,_.transitionExists=Ob,_.transitionLayerIds=df,_.trimPolyline=T1,_.unregisterVideo=tv,_.useAepAssetResolver=G1,_.useAepBezierPathAnimator=zL,_.useAepColorAnimator=XL,_.useAepCompositionReady=W1,_.useAepCurrentFrame=N_,_.useAepEffectKeyframes=Rv,_.useAepEffects=Cv,_.useAepKeyframes=aI,_.useAepLayerContext=_t,_.useAepLayerContextOptional=Jt,_.useAepLayerTransform=Y1,_.useAepLayerTransform3D=Oi,_.useAepPrecompStore=Ld,_.useAepReadiness=z1,_.useAepRecursionDepth=P_,_.useAepTextLayout=jo,_.useAepTextOverride=bi,_.useAepTheme=zn,_.useAepTransitionClock=dT,_.useAepTransitionRegistry=wr,_.useAepValueAnimator=YL,_.useAepVec2Animator=VL,_.useAllVideosReady=yL,_.useAudioElementPlayer=n_,_.useAudioVisualizer=e_,_.useBlendFilter=Rm,_.useCaptionPlayhead=Dv,_.useCaptionStyles=Bv,_.useCustomEventListener=Ze,_.useDebouncedValue=ei,_.useEffects=XA,_.useEmojiTextures=Uv,_.useFontEpoch=oi,_.useGLTransitionMesh=fd,_.useGsapEffect=xm,_.useHowlerAudioPlayer=RR,_.useMsdfAtlas=RT,_.usePixiAnimation=Am,_.usePixiRenderTexture=bT,_.usePrecompTexture=_T,_.useResolveAsset=Ei,_.useSpriteFilters=lt,_.useSvgTexture=by,_.useTypefaceMetrics=_v,_.useVideoLifecycle=Vv,_.useVideoTexture=qv,_.useVideoTimelineSync=Kv,_.usesClipLocalTime=jx,_.validatePrecompDepth=mT,_.withEffectsHook=za,_.withFiltersHook=Mm,_.wordVisualFor=Hx,_.wordboxPillSpec=$x,_.writeInstanceColor=KM,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
1523
+ `.trim())}`}class $t extends G.Graphics{constructor(e,n,r={},i,o,s){super(),this.transformer=e;const a=Object.assign({},J1,r);this._handle=n,this._style=a,this.onHandleDelta=i,this.onHandleCommit=o,this._dirty=!0,this.eventMode="static",this.cursor=s||"move",this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new G.Point,this._pointerMoveTarget=null,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onpointerdown=this.onPointerDown,this.onpointermove=this.onPointerMove,this.onpointerup=this.onPointerUp,this.onpointerupoutside=this.onPointerUp,this.draw()}transformer;onHandleDelta;onHandleCommit;_handle;_style;_dirty;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_rotatorSprite=null;_rotatorKey=null;static _rotatorTextureCache=new Map;static async loadTextures(e=[{bgColor:"#6366f1",arrowColor:"#ffffff",size:28}]){await Promise.all(e.map(({bgColor:n="#6366f1",arrowColor:r="#ffffff",size:i=28})=>{const o=`${n}:${r}:${i}`;if($t._rotatorTextureCache.has(o)){const l=$t._rotatorTextureCache.get(o);return l instanceof Promise?l:Promise.resolve(l)}const s=Q1(n,r,i),a=G.Assets.load(s).then(l=>($t._rotatorTextureCache.set(o,l),l));return $t._rotatorTextureCache.set(o,a),a}))}get handle(){return this._handle}set handle(e){this._handle=e,this._dirty=!0,this.draw()}get style(){return this._style}set style(e){this._style=Object.assign({},J1,e),this._dirty=!0,this.draw()}draw(){const e=this._handle,n=this._style;this.clear();const r=e==="middleLeft"||e==="middleRight",i=e==="topCenter"||e==="bottomCenter",o=e==="rotator";n.glowColor&&n.glowIntensity&&n.glowIntensity>0&&!o&&this.drawGlowEffect(n,r||i),o?this.drawRotatorHandle(n):r||i?this.drawPillHandle(e,n):this.drawCornerHandle(n),this._dirty=!1}drawGlowEffect(e,n){const i=e.radius||7,o=i/7;if(n){const s=10*o,a=20*o,l=5*o,c=2*o;for(let u=0;u<3;u++){const f=(e.glowIntensity||.15)*(1-u/3)*.3,d=u*c;this.roundRect(-s/2-d,-a/2-d,s+d*2,a+d*2,l+d).fill({color:e.glowColor||6514417,alpha:f})}}else{const s=i*1.5;for(let a=0;a<3;a++){const l=(e.glowIntensity||.15)*(1-a/3)*.3,c=i+(s-i)*(a/3);this.circle(0,0,c).fill({color:e.glowColor||6514417,alpha:l})}}}drawCornerHandle(e){const n=e.radius||7;this.circle(0,0,n).fill({color:16777215}).stroke({width:e.outlineThickness||2.5,color:e.outlineColor||6514417})}drawPillHandle(e,n){const i=(n.radius||7)/7,o=e==="topCenter"||e==="bottomCenter",s=(o?20:10)*i,a=(o?10:20)*i,l=5*i;this.roundRect(-s/2,-a/2,s,a,l).fill({color:n.color||16777215}).stroke({width:n.outlineThickness||2.5,color:n.outlineColor||6514417})}drawRotatorHandle(e){const n=e.outlineColor??6514417,r=e.rotatorIconColor??16777215,i="#"+n.toString(16).padStart(6,"0"),o="#"+r.toString(16).padStart(6,"0"),a=(e.radius||7)/7,l=Math.round(28*a),c=`${i}:${o}:${l}`,u=$t._rotatorTextureCache.get(c);if(this._rotatorSprite&&this._rotatorKey!==c&&(this.removeChild(this._rotatorSprite),this._rotatorSprite.destroy(),this._rotatorSprite=null,this._rotatorKey=null),u instanceof G.Texture){if(!this._rotatorSprite){const _=new G.Sprite(u);_.anchor.set(.5,.5);const v=u.width||l,x=u.height||l;_.scale.set(l/v,l/x),this.addChild(_),this._rotatorSprite=_,this._rotatorKey=c}return}if(u)u.then(()=>{this._dirty=!0,this.draw()});else{const _=Q1(i,o,l),v=G.Assets.load(_).then(x=>($t._rotatorTextureCache.set(c,x),this._dirty=!0,this.draw(),x));$t._rotatorTextureCache.set(c,v)}const f=Math.round(10*a),d=f*.55,h=Math.max(1.5,1.8*a);this.circle(0,0,f).fill({color:n});const m=-Math.PI*.85,p=-Math.PI*.15;this.arc(0,0,d,m,p,!1).stroke({width:h,color:r});const g=Math.PI*.15,y=Math.PI*.85;this.arc(0,0,d,g,y,!1).stroke({width:h,color:r})}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.transformer.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}onPointerMove(e){this._pointerDown&&(this._pointerDragging?this.onDrag(e):this.onDragStart(e),e.stopPropagation())}onPointerUp(e){this._pointerDragging&&this.onDragEnd(e),this._pointerDown=!1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null)}onDragStart(e){this._pointerPosition.copyFrom(e.global),this._pointerDragging=!0}onDrag(e){const n=e.global;this.onHandleDelta&&this.onHandleDelta(n),this._pointerPosition.copyFrom(n)}onDragEnd(e){this._pointerDragging=!1,this.onHandleCommit&&this.onHandleCommit()}}function cs(t,e,n,r){const{x:i,y:o}=n,{x:s,y:a}=r;if(Math.abs(s-i)<.01)return Math.abs(t-i);if(Math.abs(a-o)<.01)return Math.abs(e-o);const l=(a-o)/(s-i);return Math.abs((l*t-e+(a-l*s))/Math.sqrt(l*l+1))}const eT=Z1.build(G.Point),aD=[new G.Point,new G.Point,new G.Point,new G.Point],cD=new G.Matrix,Dr=new G.Point,lD=[0,0,0,1,-1,1,-1,-1,1,-1,1,0],uD=[0,0,-1,0,-1,-1,1,-1,1,1,0,1],dD=[0,0,1,0,1,1,-1,1,-1,-1,0,-1],fD=[0,0,0,-1,1,-1,1,1,-1,1,-1,0],Xf=new Array(12),hD=[lD,uD,dD,fD];class pD extends G.Graphics{transformer;boxScalingHandles;constructor(e){super(),this.transformer=e,this.boxScalingHandles=[this.addChild(new G.Graphics),this.addChild(new G.Graphics),this.addChild(new G.Graphics),this.addChild(new G.Graphics)],this.boxScalingHandles.forEach(n=>{n.eventMode="static"}),this.boxScalingHandles[0].cursor=Pi.topCenter,this.boxScalingHandles[1].cursor=Pi.middleRight,this.boxScalingHandles[2].cursor=Pi.bottomCenter,this.boxScalingHandles[3].cursor=Pi.middleLeft}hitHandleType(e,n,r){const{boxRotationEnabled:i,boxRotationTolerance:o,boxScalingEnabled:s,boxScalingTolerance:a}=this.transformer,[l,c,u,f]=e.hull,{x:d,y:h}=n.applyInverse(r,Dr);if(s){const m=cs(d,h,l,c)*n.d,p=cs(d,h,l,f)*n.a,g=cs(d,h,c,u)*n.a,y=cs(d,h,f,u)*n.d,_=Math.min(m,p,g,y);if(_<a)switch(_){case m:return"topCenter";case p:return"middleLeft";case g:return"middleRight";case y:return"bottomCenter"}}if(i&&!e.contains(d,h)){const m=Math.sqrt((l.x-d)**2+(l.y-h)**2),p=Math.sqrt((c.x-d)**2+(c.y-h)**2),g=Math.sqrt((f.x-d)**2+(f.y-h)**2),y=Math.sqrt((u.x-d)**2+(u.y-h)**2),_=Math.min(m,p,g,y);if(_<o*1.45)switch(_){case m:return"boxRotateTopLeft";case p:return"boxRotateTopRight";case g:return"boxRotateBottomLeft";case y:return"boxRotateBottomRight"}}return null}drawBounds(e){const n=aD;for(let r=0;r<4;r++)this.transformer.projectToLocal(e.hull[r],n[r]);this.poly(n)}drawBoxScalingTolerance(e,n=this.transformer.boxScalingTolerance){e.innerBounds.pad(-n);const r=eT.allocateArray(4);r.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(2.5*n);const i=eT.allocateArray(4);i.forEach((o,s)=>{this.projectToLocal(e.hull[s],o)}),e.innerBounds.pad(-1.5*this.transformer.boxScalingTolerance);for(let o=0;o<4;o++){const s=r[o],a=r[(o+1)%4],l=i[o],c=i[(o+1)%4];this.boxScalingHandles[o].clear().poly([s,l,c,a]).fill({color:16777215,alpha:1e-4})}}drawBoxRotationTolerance(){const{boxRotateTopLeft:e,boxRotateTopRight:n,boxRotateBottomLeft:r,boxRotateBottomRight:i}=this.transformer.handleAnchors,o=this.transformer.boxRotationTolerance*2,s=cD.identity().scale(o,o).rotate(this.transformer.getGroupBounds().rotation);for(let a=0;a<4;a++){const l=hD[a];let c;switch(a){case 0:c=e;break;case 1:c=n;break;case 2:c=r;break;case 3:c=i;break}for(let u=0;u<l.length;u+=2){const f=l[u],d=l[u+1];Dr.set(f,d),s.apply(Dr,Dr),Xf[u]=Dr.x+c.x,Xf[u+1]=Dr.y+c.y}this.poly(Xf.slice())}}projectToLocal(e,n){return this.transformer.projectToLocal(e,n)}}const tT=new G.Matrix;function nT(t){const e=tT.identity();return e.c=Math.tan(t),e}function rT(t){const e=tT.identity();return e.b=Math.tan(t),e}function iT(t,e,n,r=t.pivot){const i=e.a,o=e.b,s=e.c,a=e.d,l=-Math.atan2(-s,a),c=Math.atan2(o,i);return n=n??c,t.pivot.set(r.x,r.y),t.rotation=n,t.skew.x=n+l,t.skew.y=-n+c,t.scale.x=Math.sqrt(i*i+o*o),t.scale.y=Math.sqrt(s*s+a*a),t.position.x=e.tx+(r.x*e.a+r.y*e.c),t.position.y=e.ty+(r.x*e.b+r.y*e.d),t}const ls=new G.Matrix,mD=new G.Matrix,Zt=new G.Transform;function gD(t,e,n){t.updateLocalTransform();const r=t.worldTransform,i=t.parent?mD.copyFrom(t.parent.worldTransform):G.Matrix.IDENTITY;ls.copyFrom(r),ls.prepend(e),ls.prepend(i.clone().invert()),iT(Zt,ls),t.position.set(Zt.position.x,Zt.position.y),t.scale.set(Zt.scale.x,Zt.scale.y),t.pivot.set(Zt.pivot.x,Zt.pivot.y),t.rotation=Zt.rotation,t.skew.set(Zt.skew.x,Zt.skew.y)}const zf=new G.Transform,yD=[new G.Point,new G.Point,new G.Point,new G.Point],Nr=new G.Matrix,gn=new G.Point,us=new as,oT=[new G.Point,new G.Point,new G.Point,new G.Point],sT=new G.Point,aT=new G.Matrix,ds=Z1.build(G.Point),Pi={topLeft:"nw-resize",topCenter:"n-resize",topRight:"ne-resize",middleLeft:"w-resize",middleRight:"e-resize",bottomLeft:"sw-resize",bottomCenter:"s-resize",bottomRight:"se-resize"},fs=["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight"],cT={topLeft:{x:-1,y:-1},topCenter:{x:0,y:-1},topRight:{x:1,y:-1},middleLeft:{x:-1,y:0},middleCenter:{x:0,y:0},middleRight:{x:1,y:0},bottomLeft:{x:-1,y:1},bottomCenter:{x:0,y:1},bottomRight:{x:1,y:1}},_D=[...fs,"rotator","skewHorizontal","skewVertical"],bD=4,vD=16,xD=[Math.PI/4,Math.PI/2,Math.PI*3/4,Math.PI,0,-Math.PI/4,-Math.PI/2,-Math.PI*3/4,-Math.PI],TD=Math.PI/90,ED=[Math.PI/4,-Math.PI/4],SD=Math.PI/90,Rn={color:6514417,thickness:2};let wD=class vn extends G.Container{_group;get group(){return this._group}set group(e){this._group=e?[...e]:[],this._focusedElementIndex=this._group.length>0?0:-1,this.updateElementIndexMap(),this.lazyDirty=!0}boundingBoxes;boxRotationEnabled;boxRotationTolerance;boxScalingEnabled;boxScalingTolerance;centeredScaling;cursors;individualBorderColor;individualBorderThickness;individualBorderAlpha;individualBorderStyle;individualBorderDashPattern;nestedSelectionEnabled;focusedElementBorderColor;focusedElementBorderThickness;focusedElementBorderStyle;focusedElementBorderDashPattern;showNonFocusedBorders;lazyMode=!1;lazyDirty=!1;lockAspectRatio;projectionTransform;rotationSnaps;rotationSnapTolerance;skewRadius;skewSnaps;skewSnapTolerance;stage;translateEnabled;transientGroupTilt;groupBounds;handles;handleAnchors;wireframe;_enabledHandles=void 0;_rotateEnabled;_scaleEnabled;_skewEnabled;_skewX;_skewY;_transformHandle=null;_transformType;_handleStyle;_wireframeStyle;_colorTheme;_rotatorAnchorConfig;_focusedElementIndex;_elementIndexMap;_pointerDown;_pointerDragging;_pointerPosition;_pointerMoveTarget;_transformStarted;_clickThreshold;_clickStartPosition;_elementClickCandidate;constructor(e={}){super(),this.eventMode="static",this.cursors=Object.assign({default:"move"},e.cursors),this.cursor=this.cursors.default,this.boundingBoxes=e.boundingBoxes||"all",this._group=e.group||[],this.boxRotationTolerance=e.boxRotationTolerance||vD,this.boxScalingTolerance=e.boxScalingTolerance||bD,this.centeredScaling=!!e.centeredScaling,this.projectionTransform=new G.Matrix,this.lockAspectRatio=e.lockAspectRatio===!0,this.rotationSnaps=e.rotationSnaps||xD,this.rotationSnapTolerance=e.rotationSnapTolerance!==void 0?e.rotationSnapTolerance:TD,this.skewRadius=e.skewRadius||64,this.skewSnaps=e.skewSnaps||ED,this.skewSnapTolerance=e.skewSnapTolerance!==void 0?e.skewSnapTolerance:SD,this.boxRotationEnabled=e.boxRotationEnabled===!0,this.boxScalingEnabled=e.boxScalingEnabled===!0,this._rotateEnabled=e.rotateEnabled!==!1,this._scaleEnabled=e.scaleEnabled!==!1,this._skewEnabled=e.skewEnabled===!0,this.translateEnabled=e.translateEnabled!==!1,this.transientGroupTilt=e.transientGroupTilt!==void 0?e.transientGroupTilt:!0,this.wireframe=this.addChild(new pD(this)),this.wireframe.cursor="none",this.stage=e.stage||null,this._skewX=0,this._skewY=0,this._transformType="none",this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e.colorTheme},this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e.rotatorAnchor},this.individualBorderColor=e.individualBorderColor!==void 0?e.individualBorderColor:54527,this.individualBorderThickness=e.individualBorderThickness,this.individualBorderAlpha=e.individualBorderAlpha!==void 0?e.individualBorderAlpha:1,this.individualBorderStyle=e.individualBorderStyle||"solid",this.individualBorderDashPattern=e.individualBorderDashPattern||[8,4],this.nestedSelectionEnabled=e.nestedSelectionEnabled!==void 0?e.nestedSelectionEnabled:!0,this.focusedElementBorderColor=e.focusedElementBorderColor!==void 0?e.focusedElementBorderColor:9133302,this.focusedElementBorderThickness=e.focusedElementBorderThickness,this.focusedElementBorderStyle=e.focusedElementBorderStyle||"dashed",this.focusedElementBorderDashPattern=e.focusedElementBorderDashPattern||[8,4],this.showNonFocusedBorders=e.showNonFocusedBorders!==void 0?e.showNonFocusedBorders:!1,this._focusedElementIndex=this._group.length>0?0:-1,this._elementIndexMap=new WeakMap,this.updateElementIndexMap(),this._wireframeStyle=Object.assign({},Rn,{color:this._colorTheme.primary},e.wireframeStyle||{});const n=e.handleConstructor||$t,r={outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity,...e.handleStyle};this._handleStyle=r;const i="#"+(r.outlineColor??6514417).toString(16).padStart(6,"0"),o="#"+(r.rotatorIconColor??16777215).toString(16).padStart(6,"0"),s=Math.round(28*((r.radius??7)/7));$t.loadTextures([{bgColor:i,arrowColor:o,size:s}]).catch(()=>{});const a={rotator:this.addChild(new n(this,"rotator",r,u=>{this.rotateGroup("rotator",u)},this.commitGroup))},l=fs.reduce((u,f)=>{const d=new n(this,f,r,()=>{},this.commitGroup,Pi[f]);return d.onHandleDelta=h=>{this.scaleGroup(d.handle,h)},d.visible=this._scaleEnabled,u[f]=d,this.addChild(u[f]),u},{}),c={skewHorizontal:this.addChild(new n(this,"skewHorizontal",r,u=>{this.skewGroup("skewHorizontal",u)},this.commitGroup,"pointer")),skewVertical:this.addChild(new n(this,"skewVertical",r,u=>{this.skewGroup("skewVertical",u)},this.commitGroup,"pointer"))};this.handles=Object.assign({},l,a,c),this.handles.middleCenter.visible=!1,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,this.handleAnchors={rotator:new G.Point,boxRotateTopLeft:new G.Point,boxRotateTopRight:new G.Point,boxRotateBottomLeft:new G.Point,boxRotateBottomRight:new G.Point,topLeft:new G.Point,topCenter:new G.Point,topRight:new G.Point,middleLeft:new G.Point,middleCenter:new G.Point,middleRight:new G.Point,bottomLeft:new G.Point,bottomCenter:new G.Point,bottomRight:new G.Point,skewHorizontal:new G.Point,skewVertical:new G.Point},this.groupBounds=new as,this.updateGroupBounds(),this._pointerDown=!1,this._pointerDragging=!1,this._pointerPosition=new G.Point,this._pointerMoveTarget=null,this._transformStarted=!1,this._clickThreshold=e.clickThreshold||5,this._clickStartPosition=new G.Point,this._elementClickCandidate=-1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.on("pointerdown",this.onPointerDown),this.on("pointerup",this.onPointerUp),this.on("pointerupoutside",this.onPointerUp),this.onRender=()=>{this.renderable&&this.visible&&(!this.lazyMode||this.lazyDirty)&&this.draw()}}get enabledHandles(){return this._enabledHandles}get clickThreshold(){return this._clickThreshold}set clickThreshold(e){this._clickThreshold=e}set enabledHandles(e){const n=!!e&&e.length>0;!(this._enabledHandles&&this._enabledHandles.length>0)&&!n||(this._enabledHandles=n?e:void 0,_D.forEach(i=>{const o=this.handles[i];o&&(o.visible=!1)}),n?e.forEach(i=>{const o=this.handles[i];o&&(o.visible=!0)}):(this.handles.rotator.visible=this._rotateEnabled,this.handles.skewHorizontal.visible=this._skewEnabled,this.handles.skewVertical.visible=this._skewEnabled,fs.forEach(i=>{i!=="middleCenter"&&(this.handles[i].visible=this._scaleEnabled)})))}get handleStyle(){return this._handleStyle}set handleStyle(e){const n=this.handles;for(const r in n){const i=n[r];i&&(i.style=e)}this._handleStyle=e}get rotateEnabled(){return this._rotateEnabled}set rotateEnabled(e){if(this._rotateEnabled!==e){if(this._rotateEnabled=e,this._enabledHandles)return;this.handles.rotator.visible=e}}get scaleEnabled(){return this._scaleEnabled}set scaleEnabled(e){if(this._scaleEnabled!==e){if(this._scaleEnabled=e,this._enabledHandles)return;fs.forEach(n=>{n!=="middleCenter"&&(this.handles[n].visible=e)})}}get skewEnabled(){return this._skewEnabled}set skewEnabled(e){if(this._skewEnabled!==e){if(this._skewEnabled=e,this._enabledHandles)return;this.handles.skewHorizontal.visible=e,this.handles.skewVertical.visible=e}}get transformType(){return this._transformType}get wireframeStyle(){return this._wireframeStyle}set wireframeStyle(e){this._wireframeStyle=Object.assign({},Rn,e)}get colorTheme(){return this._colorTheme}set colorTheme(e){this._colorTheme={primary:6514417,secondary:5195493,background:16777215,glow:6514417,glowIntensity:.15,...e},this._handleStyle={...this._handleStyle,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity},this._wireframeStyle={...this._wireframeStyle,color:this._colorTheme.primary},this.redrawAllHandles()}get rotatorAnchor(){return this._rotatorAnchorConfig}set rotatorAnchor(e){this._rotatorAnchorConfig={enabled:!0,startPosition:.45,segmentLength:.005,thickness:void 0,color:void 0,style:"solid",dashPattern:[8,4],dotPattern:[2,4],...e}}get focusedElement(){return this._focusedElementIndex>=0&&this._focusedElementIndex<this._group.length?this._group[this._focusedElementIndex]:null}set focusedElementIndex(e){if(e>=-1&&e<this._group.length){const n=this._focusedElementIndex;this._focusedElementIndex=e,this.lazyDirty=!0,n!==e&&(e>=0&&e<this._group.length?this.emit("elementfocused",this._group[e],e):this.emit("elementfocuscleared"))}}get focusedElementIndex(){return this._focusedElementIndex}focusElement(e){const n=this._elementIndexMap.get(e);n!==void 0&&(this._focusedElementIndex=n,this.lazyDirty=!0,this.emit("elementfocused",e,n))}clearElementFocus(){this._focusedElementIndex=-1,this.lazyDirty=!0,this.emit("elementfocuscleared")}focusNextElement(){this._group.length!==0&&(this._focusedElementIndex=(this._focusedElementIndex+1)%this._group.length,this.lazyDirty=!0,this.emit("elementfocused",this.focusedElement,this._focusedElementIndex))}updateElementIndexMap(){this._elementIndexMap=new WeakMap,this._group.forEach((e,n)=>{this._elementIndexMap.set(e,n),this.setupElementInteraction(e,n)})}setupElementInteraction(e,n){"eventMode"in e&&(e.eventMode="none"),"interactive"in e&&(e.interactive=!1),"interactiveChildren"in e&&(e.interactiveChildren=!0)}redrawAllHandles(){Object.values(this.handles).forEach(e=>{e&&(e.style={...e.style,outlineColor:this._colorTheme.primary,glowColor:this._colorTheme.glow,glowIntensity:this._colorTheme.glowIntensity})})}drawRotatorAnchorDot(e,n,r,i,o,s){const a=this._rotatorAnchorConfig;if(!a.enabled)return;const l=r-e,c=i-n,u=Math.sqrt(l*l+c*c),f=l/u,d=c/u,m=(this._handleStyle.radius||7)/7,p=a.startPosition||.45,g=Math.min(.8,p+(m-1)*.1),y=u*(a.segmentLength||.005),_=u*g,v=a.color||s,x=a.thickness||o,E=e+f*_,T=n+d*_,A=E+f*y,M=T+d*y;switch(a.style){case"dashed":this.drawDashedLine(E,T,A,M,x,v);break;case"dotted":this.drawDottedLine(E,T,A,M,x,v);break;default:this.wireframe.moveTo(E,T).lineTo(A,M).stroke({width:x,color:v});break}}drawDashedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dashPattern||[8,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),m=u/d,p=f/d;for(let g=0;g<h;g++){const y=e+m*g*(l+c),_=n+p*g*(l+c),v=y+m*l,x=_+p*l;this.wireframe.moveTo(y,_).lineTo(v,x).stroke({width:o,color:s})}}drawDottedLine(e,n,r,i,o,s){const a=this._rotatorAnchorConfig,[l,c]=a.dotPattern||[2,4],u=r-e,f=i-n,d=Math.sqrt(u*u+f*f),h=Math.floor(d/(l+c)),m=u/d,p=f/d;for(let g=0;g<h;g++){const y=e+m*g*(l+c),_=n+p*g*(l+c);this.wireframe.circle(y,_,l).fill({color:s})}}drawDashedBounds(e,n,r,i,o,s=1){const{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=e;this.drawDashedLineSegment(a.x,a.y,l.x,l.y,n,r,i,o,s),this.drawDashedLineSegment(l.x,l.y,u.x,u.y,n,r,i,o,s),this.drawDashedLineSegment(u.x,u.y,c.x,c.y,n,r,i,o,s),this.drawDashedLineSegment(c.x,c.y,a.x,a.y,n,r,i,o,s)}drawDottedBounds(e,n,r,i,o=1){const{topLeft:s,topRight:a,bottomLeft:l,bottomRight:c}=e;this.drawDottedLineSegment(s.x,s.y,a.x,a.y,n,r,i,o),this.drawDottedLineSegment(a.x,a.y,c.x,c.y,n,r,i,o),this.drawDottedLineSegment(c.x,c.y,l.x,l.y,n,r,i,o),this.drawDottedLineSegment(l.x,l.y,s.x,s.y,n,r,i,o)}drawDashedLineSegment(e,n,r,i,o,s,a,l,c=1){const u=r-e,f=i-n,d=Math.sqrt(u*u+f*f);if(d===0)return;const h=u/d,m=f/d,p=Math.floor(d/(o+s));for(let y=0;y<p;y++){const _=e+h*y*(o+s),v=n+m*y*(o+s),x=Math.min(r,_+h*o),E=Math.min(i,v+m*o);this.wireframe.moveTo(_,v).lineTo(x,E).stroke({width:l,color:a,alpha:c})}const g=d-p*(o+s);if(g>0){const y=e+h*p*(o+s),_=n+m*p*(o+s),v=Math.min(o,g),x=y+h*v,E=_+m*v;this.wireframe.moveTo(y,_).lineTo(x,E).stroke({width:l,color:a,alpha:c})}}drawDottedLineSegment(e,n,r,i,o,s,a,l=1){const c=r-e,u=i-n,f=Math.sqrt(c*c+u*u);if(f===0)return;const d=c/f,h=u/f,m=o*2+s,p=Math.max(1,Math.floor(f/m)+1),g=p>1?f/(p-1):0;for(let y=0;y<p;y++){const _=g*y,v=e+d*_,x=n+h*_;this.wireframe.circle(v,x,o).fill({color:a,alpha:l})}}getGroupBounds(e=!1){return e&&this.updateGroupBounds(),this.groupBounds}translateGroup=e=>{this._transformHandle=null,this._transformType="translate";const n=Nr.identity().translate(e.x,e.y);this.emitTransformStart(),this.prependTransform(n)};rotateGroup=(e,n)=>{this._transformHandle=e,this._transformType="rotate";const r=this.groupBounds,i=this.worldTransform.apply(this.handleAnchors[e],gn);this.projectionTransform.applyInverse(i,i),n=this.projectionTransform.applyInverse(n,sT);const o=r.center,s=Math.atan2(i.y-o.y,i.x-o.x);let l=Math.atan2(n.y-o.y,n.x-o.x)-s,c=this.groupBounds.rotation+l;c=this.snapAngle(c,this.rotationSnapTolerance,this.rotationSnaps),l=c-this.groupBounds.rotation;const u=Nr.identity().translate(-o.x,-o.y).rotate(l).translate(o.x,o.y);this.emitTransformStart(),this.prependTransform(u,!0),this.updateGroupBounds(c),this._skewX+=l,this._skewY+=l};scaleGroup=(e,n)=>{this._transformHandle=e,this._transformType="scale";const r=cT[e].x,i=cT[e].y,o=this.handles,s=this.groupBounds,a=s.rotation,l=s.innerBounds,c=this.worldTransform.apply(this.handleAnchors[e],gn);this.projectionTransform.applyInverse(c,c),n=this.projectionTransform.applyInverse(n,sT);const u=n.x-c.x,f=n.y-c.y,d=(s.topRight.x-s.topLeft.x)/l.width,h=(s.topRight.y-s.topLeft.y)/l.width,m=(s.bottomLeft.x-s.topLeft.x)/l.height,p=(s.bottomLeft.y-s.topLeft.y)/l.height,g=u*d+f*h,y=u*m+f*p;let _=1,v=1;r!==0&&(_=1+g*r/l.width),i!==0&&(v=1+y*i/l.height);const x=this.lockAspectRatio&&(e==="topLeft"||e==="topRight"||e==="bottomLeft"||e==="bottomRight"),E=.01;if(_<E&&(_=E),v<E&&(v=E),x){const M=Math.abs(_),C=Math.abs(v),k=.001;if(M>C+k)v=_;else if(C>M+k)_=v;else{const w=(_+v)/2;_=w,v=w}}let T;this.centeredScaling?T=s.center:r===1&&i===1?T=s.topLeft:r===-1&&i===1?T=s.topRight:r===1&&i===-1?T=s.bottomLeft:r===-1&&i===-1?T=s.bottomRight:i===1?T=new G.Point((s.topLeft.x+s.topRight.x)/2,(s.topLeft.y+s.topRight.y)/2):i===-1?T=new G.Point((s.bottomLeft.x+s.bottomRight.x)/2,(s.bottomLeft.y+s.bottomRight.y)/2):r===1?T=new G.Point((s.topLeft.x+s.bottomLeft.x)/2,(s.topLeft.y+s.bottomLeft.y)/2):r===-1?T=new G.Point((s.topRight.x+s.bottomRight.x)/2,(s.topRight.y+s.bottomRight.y)/2):T=s.center;const A=Nr.identity().translate(-T.x,-T.y).rotate(-a).scale(_,v).rotate(a).translate(T.x,T.y);if(this.emitTransformStart(),(v<0||_<0)&&!(v<0&&_<0))switch(e){case"topLeft":case"bottomLeft":this.swapHandles(o.topLeft,o.bottomLeft);break;case"topCenter":case"bottomCenter":this.swapHandles(o.topCenter,o.bottomCenter);break;case"topRight":case"bottomRight":this.swapHandles(o.topRight,o.bottomRight);break}this.prependTransform(A)};skewGroup=(e,n)=>{this._transformHandle=e,this._transformType="skew";const r=this.groupBounds,i=gn.copyFrom(n);this.projectionTransform.applyInverse(i,i);const o=r.center,s=Nr.identity().translate(-o.x,-o.y);let a=this.groupBounds.rotation;if(e==="skewHorizontal"){const l=this._skewX;this._skewX=Math.atan2(i.y-o.y,i.x-o.x),this._skewX=this.snapAngle(this._skewX,this.skewSnapTolerance,this.skewSnaps),s.prepend(rT(-l)),s.prepend(rT(this._skewX))}else{const l=this._skewY,c=Math.atan2(i.y-o.y,i.x-o.x)-Math.PI/2;this._skewY=c,this._skewY=this.snapAngle(this._skewY,this.skewSnapTolerance,this.skewSnaps),s.prepend(nT(l)),s.prepend(nT(-this._skewY)),a-=this._skewY-l}s.translate(o.x,o.y),this.emitTransformStart(),this.prependTransform(s,!0),this.updateGroupBounds(a)};commitGroup=()=>{const e=this._transformHandle,n=this._transformType;this._transformHandle=null,this._transformType="none",this._transformStarted=!1,this.transientGroupTilt!==!1&&this._group.length>1&&this.updateGroupBounds(0),this.emit("transformcommit",this.buildCommitPayload(e,n))};buildCommitPayload(e,n){const r=this.groupBounds,i=r.innerBounds;return{groupBounds:{x:i.x,y:i.y,width:i.width,height:i.height,rotation:r.rotation,centerX:r.center.x,centerY:r.center.y},elements:this._group.map(o=>({x:o.position.x,y:o.position.y,width:o.width??0,height:o.height??0,rotation:o.rotation,scaleX:o.scale.x,scaleY:o.scale.y,skewX:o.skew.x,skewY:o.skew.y,pivotX:o.pivot.x,pivotY:o.pivot.y})),handle:e,transformType:n}}draw(){const e=this._group,n=this._wireframeStyle.color??Rn.color,r=this._wireframeStyle.thickness??Rn.thickness;if(this.wireframe.clear(),e.length>1&&this.boundingBoxes==="all"){const a=this.individualBorderThickness||r,l=this.focusedElementBorderThickness||r;for(let c=0,u=e.length;c<u;c++){const f=this.nestedSelectionEnabled&&this._focusedElementIndex===c;if(!this.nestedSelectionEnabled||f||this.showNonFocusedBorders&&this._focusedElementIndex===-1){const h=vn.calculateOrientedBounds(e[c],us);if(f){const[m,p]=this.focusedElementBorderDashPattern;this.focusedElementBorderStyle==="dashed"?this.drawDashedBounds(h,m,p,this.focusedElementBorderColor,l,1):this.focusedElementBorderStyle==="dotted"?this.drawDottedBounds(h,m,p,this.focusedElementBorderColor,1):(this.wireframe.drawBounds(h),this.wireframe.stroke({width:l,color:this.focusedElementBorderColor,alpha:1}))}else{const[m,p]=this.individualBorderDashPattern;if(this.individualBorderStyle==="dashed")this.drawDashedBounds(h,m,p,this.individualBorderColor,a,this.individualBorderAlpha);else if(this.individualBorderStyle==="dotted")this.drawDottedBounds(h,m,p,this.individualBorderColor,this.individualBorderAlpha);else{const g=h.innerBounds;this.wireframe.rect(g.x,g.y,g.width,g.height).stroke({width:a,color:this.individualBorderColor,alpha:this.individualBorderAlpha})}}}}}const s=e.length!==1?vn.calculateGroupOrientedBounds(e,this.groupBounds.rotation,us,!0):vn.calculateOrientedBounds(e[0],us);this.wireframe.drawBounds(s),this.translateEnabled&&this.wireframe.fill({color:16777215,alpha:1e-4}),this.boundingBoxes!=="none"&&this.wireframe.stroke({width:r,color:n}),this.drawHandles(s),this.groupBounds.copyFrom(s),this.boxRotationEnabled&&(this.wireframe.drawBoxRotationTolerance(),this.wireframe.fill({color:16777215,alpha:1e-4})),this.boxScalingEnabled&&this.wireframe.drawBoxScalingTolerance(s),this.lazyDirty=!1}drawHandles(e){const n=this.handles,r=this.handleAnchors,{topLeft:i,topRight:o,bottomLeft:s,bottomRight:a,center:l}=e,[c,u,f,d]=oT,h=gn;if(this.projectToLocal(i,c),this.projectToLocal(o,u),this.projectToLocal(s,f),this.projectToLocal(a,d),this.projectToLocal(l,h),r.topLeft.copyFrom(c),r.topCenter.set((c.x+u.x)/2,(c.y+u.y)/2),r.topRight.copyFrom(u),r.middleLeft.set((c.x+f.x)/2,(c.y+f.y)/2),r.middleCenter.set((c.x+d.x)/2,(c.y+d.y)/2),r.middleRight.set((u.x+d.x)/2,(u.y+d.y)/2),r.bottomLeft.copyFrom(f),r.bottomCenter.set((f.x+d.x)/2,(f.y+d.y)/2),r.bottomRight.copyFrom(d),this.boxRotationEnabled&&(r.boxRotateTopLeft.copyFrom(r.topLeft),r.boxRotateTopRight.copyFrom(r.topRight),r.boxRotateBottomLeft.copyFrom(r.bottomLeft),r.boxRotateBottomRight.copyFrom(r.bottomRight)),this._rotateEnabled){const m=(c.x+u.x)/2,p=(c.y+u.y)/2;let g=-(c.y-u.y),y=c.x-u.x;const _=this._handleStyle.radius||7,v=32,x=_/7,E=v*x,T=Math.sqrt(g*g+y*y);g*=E/T,y*=E/T;const A=n.rotator;A.position.x=m+g,A.position.y=p+y;const M=this._wireframeStyle.color??Rn.color,C=this._wireframeStyle.thickness??Rn.thickness;this.drawRotatorAnchorDot(m,p,A.position.x,A.position.y,C,M),this.handleAnchors.rotator.copyFrom(A.position)}if(this._skewEnabled){const m=h.x,p=h.y;this.worldTransform.apply(h,h),r.skewHorizontal.set(h.x+Math.cos(this._skewX)*this.skewRadius,h.y+Math.sin(this._skewX)*this.skewRadius),r.skewVertical.set(h.x+-Math.sin(this._skewY)*this.skewRadius,h.y+Math.cos(this._skewY)*this.skewRadius),this.worldTransform.applyInverse(r.skewHorizontal,r.skewHorizontal),this.worldTransform.applyInverse(r.skewVertical,r.skewVertical),h.set(m,p);const g=this._wireframeStyle.color??Rn.color,y=this._wireframeStyle.thickness??Rn.thickness,_=n.skewHorizontal,v=n.skewVertical;this.wireframe.circle(h.x,h.y,y*2).fill({color:g}),this.wireframe.moveTo(h.x,h.y).lineTo(_.x,_.y).moveTo(h.x,h.y).lineTo(v.x,v.y).stroke({width:y,color:g})}for(const m in n){let p=this.groupBounds.rotation;m==="skewHorizontal"?p=this._skewX:m==="skewVertical"&&(p=this._skewY);const g=n[m];g&&(g.rotation=p,g.position.copyFrom(r[m]),g.getBounds())}}onPointerDown(e){this._pointerDown=!0,this._pointerDragging=!1,this._clickStartPosition.copyFrom(e.global),this._pointerPosition.copyFrom(e.global),this._transformStarted=!1;const n=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,e.global);if(n)this._transformHandle=n,this._elementClickCandidate=-1;else if(this.nestedSelectionEnabled&&this._group.length>1){const r=e.global;this.projectionTransform.applyInverse(r,gn),this._elementClickCandidate=-1;const i=[];for(let o=0;o<this._group.length;o++)vn.calculateOrientedBounds(this._group[o],us).contains(gn.x,gn.y)&&i.push(o);if(i.length>0){let o=i[0];for(let s=1;s<i.length;s++){const a=this._group[o],l=this._group[i[s]];vn.isAboveInDisplayOrder(l,a)&&(o=i[s])}this._elementClickCandidate=o}}e.stopPropagation(),this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._pointerMoveTarget=this.stage||this,this._pointerMoveTarget.addEventListener("globalpointermove",this.onPointerMove)}static isAboveInDisplayOrder(e,n){if(e===n)return!1;const r=[],i=[];let o=e;for(;o;)r.push(o),o=o.parent;for(o=n;o;)i.push(o),o=o.parent;r.reverse(),i.reverse();const s=Math.min(r.length,i.length);for(let a=0;a<s;a++)if(r[a]!==i[a]){const l=r[a-1];if(!l||!l.children)return!1;const c=l.children.indexOf(r[a]),u=l.children.indexOf(i[a]);return c>u}return r.length>i.length}onPointerMove(e){const n=this._pointerPosition,r=ds.allocate().copyFrom(e.global),i=this.wireframe.hitHandleType(this.groupBounds,this.projectionTransform,r);if(!this._pointerDown)this.setCursorFromHoveredHandle(i);else{const o=Math.sqrt(Math.pow(r.x-this._clickStartPosition.x,2)+Math.pow(r.y-this._clickStartPosition.y,2));if(!this._pointerDragging&&o>this._clickThreshold&&(this._pointerDragging=!0,this._elementClickCandidate=-1),this._pointerDragging){switch(this._transformHandle){case"boxRotateTopLeft":case"boxRotateTopRight":case"boxRotateBottomLeft":case"boxRotateBottomRight":this.rotateGroup(this._transformHandle,r);break;case"topCenter":case"middleLeft":case"middleRight":case"bottomCenter":this.scaleGroup(this._transformHandle,r);break;default:if(this.translateEnabled){const[s,a,l]=oT;s.set(0,0),a.set(r.x-n.x,r.y-n.y),this.projectionTransform.applyInverse(s,s),this.projectionTransform.applyInverse(a,a),l.set(a.x-s.x,a.y-s.y),this.translateGroup(l)}}this.emitTransformStart(),e.stopPropagation()}this._pointerPosition.x=r.x,this._pointerPosition.y=r.y}ds.release(r)}emitTransformStart(){this._transformStarted||(this._transformStarted=!0,this.emit("transformstart",{handle:this._transformHandle,transformType:this._transformType}))}onPointerUp(e){if(!this._pointerDragging&&this.nestedSelectionEnabled&&this._group.length>1&&this._elementClickCandidate>=0){const r=this._elementClickCandidate;this._focusedElementIndex===r?this.lazyDirty=!0:(this._focusedElementIndex=r,this.lazyDirty=!0,this.emit("elementfocused",this._group[r],r))}this._pointerDragging=!1,this._pointerDown=!1,this._elementClickCandidate=-1,this._pointerMoveTarget&&(this._pointerMoveTarget.removeEventListener("globalpointermove",this.onPointerMove),this._pointerMoveTarget=null),this._transformStarted=!1,this.commitGroup(),e.stopPropagation()}prependTransform(e,n=!1){const r=this._group;for(let i=0,o=r.length;i<o;i++)gD(r[i],e);aT.copyFrom(e),n||this.updateGroupBounds(),this.emit("transformchange",aT)}updateGroupBounds(e=this.groupBounds.rotation){vn.calculateGroupOrientedBounds(this._group,e,this.groupBounds),this.drawHandles(this.groupBounds),this.lazyDirty=!0}snapAngle(e,n,r){if(e=e%(Math.PI*2),!r||r.length===1||!n)return e;for(let i=0,o=r.length;i<o;i++)if(Math.abs(e-r[i])<=n)return r[i];return e}swapHandles(e,n){const r=e.handle,i=n.handle,o=e.cursor,s=n.cursor,a=e.x,l=n.x,c=e.y,u=n.y;e.handle=i,n.handle=r,e.position.set(l,u),n.position.set(a,c),e.cursor=s,n.cursor=o,this.handles[r]=n,this.handles[i]=e,this._transformHandle===r?this._transformHandle=i:this._transformHandle===i&&(this._transformHandle=r)}setCursorFromHoveredHandle(e){if(e&&e.startsWith("boxRotate"))this.cursor=this.cursors.boxRotate||this.cursors.default;else if(e)switch(e){case"topCenter":this.cursor=this.cursors.boxScaleTop||this.cursors.default;break;case"middleLeft":this.cursor=this.cursors.boxScaleLeft||this.cursors.default;break;case"middleRight":this.cursor=this.cursors.boxScaleRight||this.cursors.default;break;case"bottomCenter":this.cursor=this.cursors.boxScaleBottom||this.cursors.default;break}else this.cursor=this.cursors.translate||this.cursors.default}projectToLocal(e,n){return n||(n=new G.Point),this.projectionTransform.apply(e,n),this.worldTransform.applyInverse(n,n),n}static calculateTransformedCorners(e,n=e.worldTransform,r,i=0){const o=e.getLocalBounds();return e.getBounds(),r=r||[new G.Point,new G.Point,new G.Point,new G.Point],r[i].set(o.x,o.y),r[i+1].set(o.x+o.width,o.y),r[i+2].set(o.x+o.width,o.y+o.height),r[i+3].set(o.x,o.y+o.height),n.apply(r[i],r[i]),n.apply(r[i+1],r[i+1]),n.apply(r[i+2],r[i+2]),n.apply(r[i+3],r[i+3]),r}static calculateOrientedBounds(e,n){e.updateLocalTransform(),iT(zf,e.worldTransform);const r=zf.rotation,i=vn.calculateTransformedCorners(e,e.worldTransform,yD),o=(i[0].x+i[1].x+i[2].x+i[3].x)/4,s=(i[0].y+i[1].y+i[2].y+i[3].y)/4,a=Nr.identity().translate(-o,-s).rotate(-zf.rotation).translate(o,s);return a.apply(i[0],i[0]),a.apply(i[1],i[1]),a.apply(i[2],i[2]),a.apply(i[3],i[3]),n=n||new as,n.rotation=r,n.innerBounds.x=Math.min(i[0].x,i[1].x,i[2].x,i[3].x),n.innerBounds.y=Math.min(i[0].y,i[1].y,i[2].y,i[3].y),n.innerBounds.width=Math.max(i[0].x,i[1].x,i[2].x,i[3].x)-n.innerBounds.x,n.innerBounds.height=Math.max(i[0].y,i[1].y,i[2].y,i[3].y)-n.innerBounds.y,n}static calculateGroupOrientedBounds(e,n,r,i=!1){const o=e.length,s=ds.allocateArray(o*4);for(let d=0;d<o;d++){const h=e[d];i||h.updateLocalTransform(),vn.calculateTransformedCorners(h,h.worldTransform,s,d*4)}const a=Nr.identity().rotate(-n);let l=Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let d=0,h=s.length;d<h;d++){const m=s[d];a.apply(m,m);const p=m.x,g=m.y;l=p<l?p:l,c=g<c?g:c,u=p>u?p:u,f=g>f?g:f}return ds.releaseArray(s),r=r||new as,r.innerBounds.x=l,r.innerBounds.y=c,r.innerBounds.width=u-l,r.innerBounds.height=f-c,r.rotation=n,a.applyInverse(r.center,gn),r.center.copyFrom(gn),r}};function AD(t,e,n,r){for(const i in e){const o=n[i],s=r[i],a=e[i];o!==s&&(o&&t.off(a,o),s&&t.on(a,s))}}const Ln={},OD=G.Matrix.IDENTITY,MD={transformstart:"transformstart",transformchange:"transformchange",transformcommit:"transformcommit",elementfocused:"elementfocused",elementfocuscleared:"elementfocuscleared"};function lT(t,e,n){if(AD(t,MD,e,n),n.cursors&&Object.assign(t.cursors,n.cursors),t.group=n.group||[],t.boundingBoxes=n.boundingBoxes||"all",t.boxScalingEnabled=n.boxScalingEnabled===!0,t.boxScalingTolerance=n.boxScalingTolerance!==void 0?n.boxScalingTolerance:t.boxScalingTolerance,t.boxRotationEnabled=n.boxRotationEnabled===!0,t.boxRotationTolerance=n.boxRotationTolerance!==void 0?n.boxRotationTolerance:t.boxRotationTolerance,t.centeredScaling=n.centeredScaling??!1,t.enabledHandles=n.enabledHandles,t.lockAspectRatio=n.lockAspectRatio??!1,t.projectionTransform.copyFrom(n.projectionTransform||OD),t.skewRadius=n.skewRadius||t.skewRadius,t.rotateEnabled=n.rotateEnabled!==!1,t.scaleEnabled=n.scaleEnabled!==!1,t.skewEnabled=n.skewEnabled===!0,t.translateEnabled=n.translateEnabled!==!1,t.transientGroupTilt=n.transientGroupTilt??!0,e.clickThreshold!==n.clickThreshold&&n.clickThreshold!==void 0&&(t.clickThreshold=n.clickThreshold),e.handleConstructor!==n.handleConstructor&&e.handleConstructor!==void 0)throw new Error("Transformer does not support changing the TransformerHandleConstructor!");e.rotationSnaps!==n.rotationSnaps&&(t.rotationSnaps=n.rotationSnaps??t.rotationSnaps),e.rotationSnapTolerance!==n.rotationSnapTolerance&&(t.rotationSnapTolerance=n.rotationSnapTolerance??t.rotationSnapTolerance),e.skewSnaps!==n.skewSnaps&&(t.skewSnaps=n.skewSnaps??t.skewSnaps),e.skewSnapTolerance!==n.skewSnapTolerance&&(t.skewSnapTolerance=n.skewSnapTolerance??t.skewSnapTolerance);const r=e.colorTheme||Ln,i=n.colorTheme||Ln;(r.primary!==i.primary||r.secondary!==i.secondary||r.background!==i.background||r.glow!==i.glow||r.glowIntensity!==i.glowIntensity)&&(t.colorTheme=i);const o=e.handleStyle||Ln,s=n.handleStyle||Ln;(o.color!==s.color||o.outlineColor!==s.outlineColor||o.outlineThickness!==s.outlineThickness||o.radius!==s.radius||o.shape!==s.shape||o.rotatorIconColor!==s.rotatorIconColor)&&(t.handleStyle=s);const a=e.wireframeStyle||Ln,l=n.wireframeStyle||Ln;(a.color!==l.color||a.thickness!==l.thickness)&&(t.wireframeStyle=l);const c=e.rotatorAnchor||Ln,u=n.rotatorAnchor||Ln;if((c.enabled!==u.enabled||c.startPosition!==u.startPosition||c.segmentLength!==u.segmentLength||c.thickness!==u.thickness||c.color!==u.color||c.style!==u.style||JSON.stringify(c.dashPattern)!==JSON.stringify(u.dashPattern)||JSON.stringify(c.dotPattern)!==JSON.stringify(u.dotPattern))&&(t.rotatorAnchor=u),e.nestedSelectionEnabled!==n.nestedSelectionEnabled&&(t.nestedSelectionEnabled=n.nestedSelectionEnabled!==void 0?n.nestedSelectionEnabled:!0),e.focusedElementBorderColor!==n.focusedElementBorderColor&&(t.focusedElementBorderColor=n.focusedElementBorderColor!==void 0?n.focusedElementBorderColor:9133302),e.focusedElementBorderThickness!==n.focusedElementBorderThickness&&(t.focusedElementBorderThickness=n.focusedElementBorderThickness),e.focusedElementBorderStyle!==n.focusedElementBorderStyle&&(t.focusedElementBorderStyle=n.focusedElementBorderStyle||"dashed"),e.focusedElementBorderDashPattern!==n.focusedElementBorderDashPattern&&(t.focusedElementBorderDashPattern=n.focusedElementBorderDashPattern||[8,4]),e.showNonFocusedBorders!==n.showNonFocusedBorders&&(t.showNonFocusedBorders=n.showNonFocusedBorders!==void 0?n.showNonFocusedBorders:!1),e.individualBorderColor!==n.individualBorderColor&&(t.individualBorderColor=n.individualBorderColor!==void 0?n.individualBorderColor:54527),e.individualBorderThickness!==n.individualBorderThickness&&(t.individualBorderThickness=n.individualBorderThickness),e.individualBorderAlpha!==n.individualBorderAlpha&&(t.individualBorderAlpha=n.individualBorderAlpha!==void 0?n.individualBorderAlpha:1),e.individualBorderStyle!==n.individualBorderStyle&&(t.individualBorderStyle=n.individualBorderStyle||"solid"),e.individualBorderDashPattern!==n.individualBorderDashPattern&&(t.individualBorderDashPattern=n.individualBorderDashPattern||[8,4]),n.focusedElementIndex!==void 0&&(t.focusedElementIndex=n.focusedElementIndex),e.onFocusChange!==n.onFocusChange){const f="__transformerFocusListeners",d=t[f];if(d&&(t.off("elementfocused",d.focused),t.off("elementfocuscleared",d.cleared)),n.onFocusChange){const h=(p,g)=>n.onFocusChange(g,p),m=()=>n.onFocusChange(-1,null);t.on("elementfocused",h),t.on("elementfocuscleared",m),t[f]={focused:h,cleared:m}}else t[f]=void 0}}const ID=O.forwardRef(function(e,n){const r=O.useRef(null),i=O.useRef(null),o=O.useRef({});return O.useEffect(()=>{const s=r.current;if(!s)return;const a=new wD({...e,stage:s});return s.addChild(a),i.current=a,lT(a,{},e),o.current=e,typeof n=="function"?n(a):n&&(n.current=a),()=>{s.removeChild(a),a.destroy({children:!0}),i.current=null,typeof n=="function"?n(null):n&&(n.current=null)}},[]),O.useEffect(()=>{const s=i.current;s&&(lT(s,o.current,e),o.current=e)}),I.createElement("pixiContainer",{ref:r})}),CD=300,RD=({selectedElementIds:t=[],containerRefsMap:e,mouseOverTransformerRef:n,isMultiSelect:r,rotateEnabled:i=!0,scaleEnabled:o=!0,translateEnabled:s=!0,skewEnabled:a=!1,boxScalingEnabled:l=!0,boxRotationEnabled:c=!0,showNonFocusedBorders:u,focusedElementIndex:f,individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:m,onDoubleClickElement:p,onTransformChange:g,onTransformCommit:y})=>{const _=O.useMemo(()=>{const k=[];for(const w of t){const L=e[w]?.current;L&&k.push(L)}return k},[t,e]),v=O.useRef(null),x=O.useRef(0),E=O.useRef(null),T=t[0],A=O.useCallback(k=>{n?.current&&(n.current.isDragging=!0,n.current.dragType=k.transformType)},[n]),M=O.useCallback(()=>{T&&g?.(T)},[T,g]),C=O.useCallback(k=>{if(n?.current&&(n.current.isDragging=!1,n.current.dragType=null),!T)return;const w=k.elements[0],L=w?{...w,groupBounds:k.groupBounds,handle:k.handle,transformType:k.transformType,elements:k.elements}:k;y?.(T,L)},[T,n,y]);return O.useEffect(()=>{const k=t.map(L=>({id:L,c:e[L]?.current})).filter(L=>!!L.c);if(!p||k.length===0)return;const w=[];for(const{id:L,c:D}of k){const N=D.eventMode;D.eventMode="static";const F=H=>{const V=performance.now();E.current===L&&V-x.current<CD?(p(L),x.current=0,E.current=null):(x.current=V,E.current=L)};D.on("pointerdown",F),w.push({c:D,fn:F}),D.__prevEventMode=N}return()=>{for(const{c:L,fn:D}of w){L.off("pointerdown",D);const N=L.__prevEventMode;N!==void 0&&(L.eventMode=N)}}},[t,e,p]),_.length===0?null:R.jsx(ID,{ref:v,group:_,rotateEnabled:i,scaleEnabled:o,translateEnabled:s,skewEnabled:a,boxScalingEnabled:l,boxRotationEnabled:c,boundingBoxes:r?"all":"groupOnly",nestedSelectionEnabled:!!r,showNonFocusedBorders:u??!!r,focusedElementIndex:f??(r?-1:void 0),individualBorderColor:d,individualBorderThickness:h,individualBorderAlpha:m,transformstart:A,transformchange:M,transformcommit:C})},uT=(t,e,n,r,i)=>{const o=1-i;return o*o*o*t+3*o*o*i*e+3*o*i*i*n+i*i*i*r};function dT(t,e=24){const{vertices:n,outTangents:r,inTangents:i,closed:o}=t;if(n.length===0)return[];const s=[],a=o?n.length:n.length-1;for(let l=0;l<a;l++){const c=n[l],u=n[(l+1)%n.length],f=r[l],d=i[(l+1)%n.length],h=[c[0]+f[0],c[1]+f[1]],m=[u[0]+d[0],u[1]+d[1]];for(let p=0;p<e;p++){const g=p/e;s.push([uT(c[0],h[0],m[0],u[0],g),uT(c[1],h[1],m[1],u[1],g)])}}return o||s.push(n[n.length-1]),s}function qf(t,e=96){switch(t.kind){case"rect":{const[n,r]=Di(t.size),[i,o]=t.position?Di(t.position):[0,0],s=i-n/2,a=o-r/2;return[[s,a],[s+n,a],[s+n,a+r],[s,a+r],[s,a]]}case"ellipse":{const[n,r]=Di(t.size),[i,o]=t.position?Di(t.position):[0,0],s=[],a=n/2,l=r/2;for(let c=0;c<=e;c++){const u=c/e*Math.PI*2;s.push([i+Math.cos(u)*a,o+Math.sin(u)*l])}return s}case"polystar":return LD(t,e);case"bezier":return dT(PD(t.path))}}function LD(t,e){const n=Math.max(3,Math.floor(hs(t.points))),r=hs(t.outerRadius),i=t.innerRadius!==void 0?hs(t.innerRadius):r,o=t.rotation!==void 0?hs(t.rotation):0,[s,a]=t.position?Di(t.position):[0,0],l=t.starType==="star",c=l?n*2:n,u=o*Math.PI/180,f=[];for(let d=0;d<=c;d++){const m=!l||d%2===0?r:i,p=d/c*Math.PI*2-Math.PI/2+u;f.push([s+Math.cos(p)*m,a+Math.sin(p)*m])}return f.length>e?kD(f,e):f}function kD(t,e){if(t.length<=2||e<=2)return t.slice();const n=[];let r=0;for(let a=0;a<t.length-1;a++){const l=t[a+1][0]-t[a][0],c=t[a+1][1]-t[a][1],u=Math.hypot(l,c);n.push(u),r+=u}if(r===0)return[t[0],t[t.length-1]];const i=[];let o=0,s=0;for(let a=0;a<e;a++){const l=a/(e-1)*r;for(;o<n.length-1&&s+n[o]<l;)s+=n[o],o++;const c=n[o]||1,u=(l-s)/c;i.push([t[o][0]+(t[o+1][0]-t[o][0])*u,t[o][1]+(t[o+1][1]-t[o][1])*u])}return i}function fT(t,e,n,r=0){if(t.length<2)return t;const i=d=>{const h=d%1;return h<0?h+1:h},o=i(e+r),s=i(n+r);if(o===s)return[];const a=[];let l=0;for(let d=0;d<t.length-1;d++){const h=Math.hypot(t[d+1][0]-t[d][0],t[d+1][1]-t[d][1]);a.push(h),l+=h}if(l===0)return[];const c=d=>{let h=d*l;for(let m=0;m<a.length;m++){if(h<=a[m])return{idx:m,t:a[m]===0?0:h/a[m]};h-=a[m]}return{idx:a.length-1,t:1}},u=(d,h,m)=>[d[0]+(h[0]-d[0])*m,d[1]+(h[1]-d[1])*m],f=(d,h)=>{const m=c(d),p=c(h),g=[u(t[m.idx],t[m.idx+1],m.t)];for(let y=m.idx+1;y<=p.idx;y++)g.push(t[y]);return g.push(u(t[p.idx],t[p.idx+1],p.t)),g};return o<s?f(o,s):[...f(o,1),...f(0,s)]}function Di(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function hs(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function PD(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const hT=t=>new K.Color(t).toNumber(),pT=t=>t.length===9?parseInt(t.slice(7,9),16)/255:1;function mT(t,e){const{path:n,fill:r,stroke:i,trim:o}=e;if(o){FD(t,n,o,r,i);return}DD(t,n),yT(t,r,i)}function DD(t,e){switch(e.kind){case"rect":{const[n,r]=ps(e.size),[i,o]=e.position?ps(e.position):[0,0],s=e.roundness?BD(e.roundness):0,a=i-n/2,l=o-r/2;s>0?t.roundRect(a,l,n,r,s):t.rect(a,l,n,r);return}case"ellipse":{const[n,r]=ps(e.size),[i,o]=e.position?ps(e.position):[0,0];t.ellipse(i,o,n/2,r/2);return}case"polystar":{const n=qf(e);gT(t,n,!0);return}case"bezier":ND(t,UD(e.path));return}}function ND(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function gT(t,e,n){if(!(e.length<2)){t.moveTo(e[0][0],e[0][1]);for(let r=1;r<e.length;r++)t.lineTo(e[r][0],e[r][1]);n&&t.closePath()}}function FD(t,e,n,r,i){const o=qf(e),s=fT(o,_T(n.start),_T(n.end),n.offset??0);gT(t,s,n.start===0&&n.end===1),yT(t,r,i)}function yT(t,e,n){e&&t.fill({color:hT(e),alpha:pT(e)}),n&&t.stroke({color:hT(n.color),width:n.width,alpha:pT(n.color),cap:n.cap??"butt",join:n.join??"miter"})}const _T=t=>Math.max(0,Math.min(1,t));function ps(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"?t:Array.isArray(t)&&t.length>0&&typeof t[0]=="object"?t[0].v:[0,0]}function BD(t){return typeof t=="number"?t:Array.isArray(t)&&t.length>0?t[0].v:0}function UD(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}const GD={vertices:[],inTangents:[],outTangents:[],closed:!1},jD=({ref:t,...e})=>{const n=I.useRef(null),r=I.useRef(null),{path:i,fill:o,stroke:s,trimPath:a,transformation:l,visible:c}=e,{x:u,y:f}=l,h=hn()?.currentFrame??0,m=nr(),p=I.useMemo(()=>({fill:o!==void 0?At(Qn(o,m),"#000000",h):void 0,stroke:s&&{color:At(s.color,"#000000",h),width:ge(s.width,1,h),cap:s.cap,join:s.join},trim:a&&{start:ge(a.start,0,h),end:ge(a.end,1,h),offset:a.offset!==void 0?ge(a.offset,0,h):void 0}}),[o,s,a,h,m]),g=I.useMemo(()=>i.kind!=="bezier"?i:{kind:"bezier",path:mf(i.path,GD,h)},[i,h]),y=I.useCallback(_=>{_.clear(),mT(_,{path:g,fill:p.fill,stroke:p.stroke,trim:p.trim})},[g,p]);return R.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:R.jsx("pixiContainer",{ref:r,x:u,y:f,children:R.jsx("pixiGraphics",{ref:n,draw:y,alpha:c?1:0})})})},bT=I.memo(jD,rt),HD=({ref:t,...e})=>{const n=I.useRef(null),{transformation:r}=e;return R.jsx(Je,{...e,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:R.jsx("pixiContainer",{ref:n,x:r.x,y:r.y})})},vT=I.memo(HD,rt),xT=(t,e,n,r)=>n+(t-e)*r,TT=I.memo(({uniqueId:t,src:e,startAt:n,endAt:r,inPointFrames:i,level:o,pan:s,muted:a,visible:l=!0,trimStart:c=0,speed:u=1,transformation:f,onContainerRefReady:d})=>{const h=pt(),{tl:m,registerTimeUpdateListener:p,unregisterTimeUpdateListener:g}=I.useContext(Ve),y=h.framesToSeconds(i),_=h.fps,[v,x]=I.useState(null),E=I.useRef(null),T=I.useRef(s);T.current=s;const A=I.useCallback((k,w)=>{x(w)},[]),M=I.useCallback(k=>Math.max(0,Math.min(1,ge(o,1,xT(k,y,i,_)))),[o,y,i,_]),C=I.useCallback(k=>{const w=E.current;if(!w)return;const L=ge(T.current,0,xT(k,y,i,_));w.pan.value=Math.max(-1,Math.min(1,L))},[y,i,_]);return I.useEffect(()=>{if(s===void 0||!v)return;const k=Sr.getContext(),w=Sr.getOrCreateSourceNode(t);if(!k||!w||typeof k.createStereoPanner!="function")return;const L=k.createStereoPanner();try{w.disconnect(k.destination)}catch{}return w.connect(L).connect(k.destination),E.current=L,()=>{E.current=null;try{w.disconnect(L),L.disconnect(),w.connect(k.destination)}catch{}}},[v,s!==void 0,t]),I.useEffect(()=>{if(!(s===void 0||!p||!g))return p(C),()=>g(C)},[s!==void 0,C,p,g]),I.useEffect(()=>{s!==void 0&&C(m?.current?.time()??y)},[v,s,C,y,m]),R.jsx(U_,{uniqueId:t,src:e,startAt:n,endAt:r,audioStartAt:c,mute:!!a,speed:u,visible:l,getVolume:M,transformation:f,onAudioElementReady:A,onContainerRefReady:d})});TT.displayName="AepAudioLayer";function ET(t){return t&&typeof t=="object"&&"vertices"in t?t:Array.isArray(t)&&t.length>0?t[0].v:{vertices:[],inTangents:[],outTangents:[],closed:!1}}function ST(t,e){const{vertices:n,outTangents:r,inTangents:i,closed:o}=e;if(n.length<2)return;t.moveTo(n[0][0],n[0][1]);const s=o?n.length:n.length-1;for(let a=0;a<s;a++){const l=n[a],c=n[(a+1)%n.length],u=r[a],f=i[(a+1)%n.length];t.bezierCurveTo(l[0]+u[0],l[1]+u[1],c[0]+f[0],c[1]+f[1],c[0],c[1])}o&&t.closePath()}function wT(t,e){if(e.length!==0){for(const n of e)if(n.mode==="subtract"){const r=YD(ET(n.path));ST(t,r)}else ST(t,ET(n.path));t.fill({color:16777215,alpha:1})}}function YD(t){const e=t.vertices.length;return{vertices:t.vertices.slice().reverse(),outTangents:Array.from({length:e},(n,r)=>t.inTangents[e-1-r]),inTangents:Array.from({length:e},(n,r)=>t.outTangents[e-1-r]),closed:t.closed}}const WD={vertices:[],inTangents:[],outTangents:[],closed:!1},AT=({masks:t,children:e})=>{const n=I.useRef(null),r=I.useRef(null),o=hn()?.currentFrame??0;I.useEffect(()=>{const l=n.current,c=r.current;if(!(!l||!c))return l.mask=c,()=>{l.mask=null}},[]);const s=I.useMemo(()=>t.map(l=>({...l,path:mf(l.path,WD,o)})),[t,o]),a=I.useCallback(l=>{l.clear(),wT(l,s)},[s]);return R.jsxs("pixiContainer",{ref:n,children:[e,R.jsx("pixiGraphics",{ref:r,draw:a})]})},OT=({source:t,matted:e,mode:n,width:r,height:i})=>{const{app:o}=st.useApplication(),s=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(null);I.useEffect(()=>{if(o?.renderer)return c.current&&(c.current.width!==r||c.current.height!==i)&&(c.current.destroy(!0),c.current=null),c.current||(c.current=K.RenderTexture.create({width:Math.max(1,Math.round(r)),height:Math.max(1,Math.round(i))})),()=>{c.current?.destroy(!0),c.current=null}},[o,r,i]),I.useEffect(()=>{const h=o?.renderer;if(!h)return;const m=()=>{const p=c.current,g=s.current;!p||!g||(h.render({container:g,target:p}),l.current&&(l.current.texture=p))};return o.ticker.add(m),()=>{o.ticker.remove(m)}},[o]),I.useEffect(()=>{const h=a.current,m=l.current;if(!(!h||!m))return h.mask=m,()=>{h.mask=null}},[]);const u=n==="alpha-inverted"||n==="luma-inverted",f=n==="luma"||n==="luma-inverted",d=I.useMemo(()=>{if(!f)return;const h=new K.ColorMatrixFilter;return h.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,.2126,.7152,.0722,0,0],[h]},[f]);return R.jsxs("pixiContainer",{children:[R.jsx("pixiContainer",{ref:s,renderable:!0,alpha:0,children:t}),R.jsx("pixiContainer",{ref:a,children:e}),R.jsx("pixiSprite",{ref:l,width:r,height:i,alpha:1,filters:d,renderable:!1})]})};function Vf(t,e){if(!e)throw new Error(`AEP: unknown assetId '${t}' (no entry in comp.assets)`);return{url:e.src,mime:XD(e.type)}}function XD(t){switch(t){case"image":return"image/*";case"video":return"video/*";case"audio":return"audio/*";case"lottie":return"application/json";case"svg":return"image/svg+xml";case"model":return"model/gltf-binary";default:return}}const MT=I.createContext(null),IT=({resolver:t,children:e})=>R.jsx(MT.Provider,{value:t,children:e});function Kf(){return I.useContext(MT)??Vf}const CT=new WeakMap;function RT(t){let e=CT.get(t);return e||(e=new Map,CT.set(t,e)),e}function Ni(t){const e=Kf(),n=pt(),[r,i]=I.useState(()=>t?{url:"",state:"loading"}:{url:"",state:"idle"});return I.useEffect(()=>{if(!t){i({url:"",state:"idle"});return}const o=n.assets[t],s=RT(n.assets);let a=!1;const l=async()=>{const c=s.get(t);if(c)return c;const u=Promise.resolve(e(t,o));s.set(t,u);try{return await u}catch(f){throw s.delete(t),f}};return i({url:"",state:"loading"}),l().then(c=>{a||i({url:c.url,mime:c.mime,state:"ready"})}).catch(c=>{a||(console.error(`AEP asset resolver failed for '${t}':`,c),i({url:"",state:"error",error:c}))}),()=>{a=!0}},[t,e,n.assets]),r}function LT(t){const e=Kf(),n=pt(),r=[...new Set(t)].sort().join("|"),[i,o]=I.useState({});return I.useEffect(()=>{const s=r?r.split("|"):[],a=RT(n.assets);let l=!1;o(Object.fromEntries(s.map(c=>[c,{url:"",state:"loading"}])));for(const c of s){const u=n.assets[c];let f=a.get(c);f||(f=Promise.resolve(e(c,u)),a.set(c,f),f.catch(()=>a.delete(c))),f.then(d=>{l||o(h=>({...h,[c]:{url:d.url,mime:d.mime,state:"ready"}}))},d=>{l||(console.error(`AEP asset resolver failed for '${c}':`,d),o(h=>({...h,[c]:{url:"",state:"error",error:d}})))})}return()=>{l=!0}},[r,e,n.assets]),i}function kT(t,e){const n=[],r=new Set;let i=t;for(;i;){if(r.has(i.id))throw new Error(`cyclic parent chain detected at layer '${t.id}' via '${i.id}'`);r.add(i.id),n.push(i),i="parent"in i&&i.parent?e.get(i.parent):void 0}return n}function zD(t,e){const n=Math.cos(t.rotation*Math.PI/180),r=Math.sin(t.rotation*Math.PI/180),i=e.x*t.scaleX,o=e.y*t.scaleY;return{x:t.x+(n*i-r*o),y:t.y+(r*i+n*o),scaleX:t.scaleX*e.scaleX,scaleY:t.scaleY*e.scaleY,rotation:t.rotation+e.rotation,alpha:t.alpha*e.alpha}}function PT(t,e){const{layersById:n,currentFrame:r}=pt();return I.useMemo(()=>{const i=kT(t,n);let o={x:0,y:0,scaleX:1,scaleY:1,rotation:0,alpha:1};for(let u=i.length-1;u>=0;u--){const f=i[u];if(Tt(f))continue;const d=f.transform,[h,m]=pn(d.position,[0,0],r),[p,g]=pn(d.scale,[1,1],r);o=zD(o,{x:h,y:m,scaleX:p,scaleY:g,rotation:ge(d.rotation,0,r),alpha:ge(d.opacity,1,r)})}const[s,a]=pn(t.transform.anchor,[0,0],r),l=e.width>0?s/e.width:.5,c=e.height>0?a/e.height:.5;return{x:o.x,y:o.y,width:e.width,height:e.height,scale:[o.scaleX,o.scaleY],rotation:o.rotation,alpha:o.alpha,anchor:{x:l,y:c}}},[t,n,e.width,e.height,r])}function DT(t){return!!(t.splitMode&&t.splitMode!=="single"||t.animators&&t.animators.length>0||(t.style.runs?.length??0)>0||typeof t.style.align=="string"&&t.style.align.startsWith("justify")||Array.isArray(t.style.fill))}const ms=()=>{},$f=I.createContext({ready:!0,readyCount:0,total:0,register:()=>ms,markReady:ms,reset:ms,reportError:ms});function NT(){return I.useContext($f).ready}function Zf(){return I.useContext($f)}const FT=({children:t,onLayerError:e})=>{const[n,r]=I.useState(()=>new Map),[i,o]=I.useState(!1);I.useEffect(()=>{o(!0)},[]);const s=I.useRef(e);s.current=e;const a=I.useCallback(p=>(r(g=>{if(g.has(p))return g;const y=new Map(g);return y.set(p,!1),y}),()=>{r(g=>{if(!g.has(p))return g;const y=new Map(g);return y.delete(p),y})}),[]),l=I.useCallback(p=>{r(g=>{if(g.get(p)===!0||!g.has(p))return g;const y=new Map(g);return y.set(p,!0),y})},[]),c=I.useCallback(p=>{r(g=>{if(g.get(p)===!1||!g.has(p))return g;const y=new Map(g);return y.set(p,!1),y})},[]),u=I.useCallback((p,g)=>{console.error(`[model3d] layer '${p}' failed:`,g),s.current?.(p,g)},[]),f=n.size;let d=0;for(const p of n.values())p&&(d+=1);const h=i&&d===f,m=I.useMemo(()=>({ready:h,readyCount:d,total:f,register:a,markReady:l,reset:c,reportError:u}),[h,d,f,a,l,c,u]);return R.jsx($f.Provider,{value:m,children:t})},qD={can:[[0,0],[.5,0],[.5,.04],[.5,.9],[.48,.95],[.4,.99],[.4,1],[0,1]],bottle:[[0,0],[.3,0],[.4,.05],[.42,.2],[.4,.55],[.34,.68],[.18,.78],[.14,.86],[.14,.96],[.18,1],[0,1]],jar:[[0,0],[.46,0],[.5,.04],[.5,.82],[.46,.9],[.4,.94],[.4,1],[0,1]],tube:[[0,0],[.34,0],[.34,.08],[.34,.88],[.3,.94],[.3,1],[0,1]],pouch:[[0,0],[.22,0],[.38,.05],[.46,.2],[.44,.6],[.38,.82],[.24,.94],[.18,1],[0,1]]};function gs(t,e={}){const n=e.width??1,r=e.height??1;if(t==="box"){const l=e.depth??n;return new B.BoxGeometry(n,r,l)}const i=qD[t],o=i.map(([l,c])=>new B.Vector2(Math.max(0,l*n),(c-.5)*r)),s=new B.LatheGeometry(o,64),a=s.getAttribute("uv");for(let l=0;l<a.count;l++)a.setY(l,i[l%i.length][1]);return a.needsUpdate=!0,s}function ys(t,e,n=0){const r=t.map(_=>_[0]),i=t.map(_=>_[1]),o=Math.min(...r),s=Math.max(...r),a=Math.min(...i),l=Math.max(...i),c=(o+s)/2,u=(a+l)/2,f=Math.max(s-o,1e-6),d=Math.max(l-a,1e-6),h=new B.Shape;t.forEach(([_,v],x)=>{const E=_-c,T=u-v;x===0?h.moveTo(E,T):h.lineTo(E,T)}),h.closePath();const m=Math.max(e,1e-6),p=Math.max(0,n),g={generateTopUV(_,v,x,E,T){const A=M=>new B.Vector2((v[M*3]+f/2)/f,(v[M*3+1]+d/2)/d);return[A(x),A(E),A(T)]},generateSideWallUV(_,v,x,E,T,A){const M=C=>{const k=v[C*3],w=v[C*3+1],L=v[C*3+2];return new B.Vector2((k+f/2)/f,(w+d/2)/d+L/m)};return[M(x),M(E),M(T),M(A)]}},y=new B.ExtrudeGeometry(h,{depth:m,bevelEnabled:p>0,bevelThickness:p,bevelSize:p,bevelSegments:p>0?2:0,curveSegments:16,UVGenerator:g});return y.translate(0,0,-m/2),y.computeVertexNormals(),{geometry:y,width:f,height:d}}function VD(t,e){if(t.type==="primitive")return{geometry:gs(t.shape,t.proportions),materialGroups:t.shape==="box"?"box":"single"};if(t.type==="extrude")return{geometry:ys(t.contour,e,t.bevel).geometry,materialGroups:"extrude"};throw new Error("buildSourceGeometry does not handle gltf sources")}const Fi={studio:{preset:"studio",keyAzimuth:-35,keyElevation:38,keyIntensity:3.2,keyColor:"#fff7ec",fillIntensity:1.1,rimIntensity:1.6,ambientIntensity:.22,environmentIntensity:.75,environment:"room"},window:{preset:"window",keyAzimuth:-70,keyElevation:55,keyIntensity:2.4,keyColor:"#eef4ff",fillIntensity:1.5,rimIntensity:.6,ambientIntensity:.35,environmentIntensity:.85,environment:"room"},golden:{preset:"golden",keyAzimuth:-58,keyElevation:14,keyIntensity:3.6,keyColor:"#ffd29a",fillIntensity:.8,rimIntensity:1.2,ambientIntensity:.18,environmentIntensity:.55,environment:"room"},night:{preset:"night",keyAzimuth:28,keyElevation:30,keyIntensity:.85,keyColor:"#9fb6ff",fillIntensity:.35,rimIntensity:2.8,ambientIntensity:.12,environmentIntensity:.45,environment:"room"}},_s="studio";function Bi(t=_s,e={},n){const r=Fi[t];return{...r,keyAzimuth:e.keyAzimuth??r.keyAzimuth,keyElevation:e.keyElevation??r.keyElevation,keyIntensity:e.keyIntensity??r.keyIntensity,keyColor:e.keyColor??r.keyColor,fillIntensity:e.fillIntensity??r.fillIntensity,rimIntensity:e.rimIntensity??r.rimIntensity,environment:n??r.environment}}function BT(t,e){const n=t*Math.PI/180,r=e*Math.PI/180,i=Math.cos(r);return[Math.sin(n)*i,Math.sin(r),Math.cos(n)*i]}const Jf=12;function UT(t){const e=new B.AmbientLight(16777215,t.ambientIntensity),n=new B.DirectionalLight(new B.Color(t.keyColor),t.keyIntensity);n.castShadow=!0,n.shadow.mapSize.set(1024,1024),n.shadow.bias=-5e-4;const r=new B.DirectionalLight(16777215,t.fillIntensity),i=new B.DirectionalLight(16777215,t.rimIntensity),o=new B.Group;o.add(e,n,n.target,r,i);const s={group:o,ambient:e,key:n,fill:r,rim:i};return Qf(s,t),s}function Qf(t,e){t.ambient.intensity=e.ambientIntensity,t.key.intensity=e.keyIntensity,t.key.color.set(e.keyColor),eh(t.key,e.keyAzimuth,e.keyElevation),eh(t.fill,e.keyAzimuth+140,Math.max(5,e.keyElevation-20)),eh(t.rim,e.keyAzimuth+180,Math.max(10,e.keyElevation+5))}function eh(t,e,n){const[r,i,o]=BT(e,n);t.position.set(r*Jf,i*Jf,o*Jf),t.target.position.set(0,0,0),t.target.updateMatrixWorld()}function th(t){t.group.removeFromParent(),t.key.dispose(),t.fill.dispose(),t.rim.dispose(),t.ambient.dispose()}const GT=new WeakMap;function KD(t){const e=GT.get(t);if(e)return e;const n=new B.PMREMGenerator(t),r=new gS.RoomEnvironment,i=n.fromScene(r,.04);return r.traverse(o=>{const s=o;if(!s.isMesh)return;s.geometry?.dispose();const a=Array.isArray(s.material)?s.material:[s.material];for(const l of a)l?.dispose()}),n.dispose(),GT.set(t,i.texture),i.texture}function nh(t,e,n){t.environment=e.environment==="room"?KD(n):null,t.environmentIntensity=e.environmentIntensity}const Ot={rotation:[0,0,0],position:[0,0,0],scale:1,roughness:.35,metalness:.05,clearcoat:0,shadowOpacity:.35,shadowSoftness:.6,shadowOffsetY:0,fov:35,fit:1.35};function rh(t,e){const n=t.lighting?.preset??_s,r=Fi[n],i=t.source.type==="extrude"?ge(t.source.depth,100,e):1,o=t.shadow;return{rotation:wt(t.view?.rotation,Ot.rotation,e),position:wt(t.view?.position,Ot.position,e),scale:ge(t.view?.scale,Ot.scale,e),extrudeDepth:Math.max(i,1e-6),roughness:ge(t.material?.roughness,Ot.roughness,e),metalness:ge(t.material?.metalness,Ot.metalness,e),clearcoat:t.material?.clearcoat??Ot.clearcoat,preset:n,keyAzimuth:ge(t.lighting?.key?.azimuth,r.keyAzimuth,e),keyElevation:ge(t.lighting?.key?.elevation,r.keyElevation,e),keyIntensity:ge(t.lighting?.key?.intensity,r.keyIntensity,e),keyColor:t.lighting?.key?.color??r.keyColor,fillIntensity:ge(t.lighting?.fill?.intensity,r.fillIntensity,e),rimIntensity:ge(t.lighting?.rim?.intensity,r.rimIntensity,e),environment:t.lighting?.environment??r.environment,shadowOpacity:o?ge(o.opacity,Ot.shadowOpacity,e):0,shadowSoftness:o?.softness??Ot.shadowSoftness,shadowOffsetY:o?.offsetY??Ot.shadowOffsetY,fov:t.camera?.fov??Ot.fov,fit:t.camera?.fit??Ot.fit}}function jT(t){return JSON.stringify(t)}function $D(){const t=new B.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});return t.setPixelRatio(1),t.outputColorSpace=B.SRGBColorSpace,t.toneMapping=B.ACESFilmicToneMapping,t.toneMappingExposure=1,t.shadowMap.enabled=!0,t.shadowMap.type=B.PCFShadowMap,t.setClearColor(0,0),t}class HT{renderer;gl;width=0;height=0;constructor(e){this.gl=e??$D(),this.renderer=this.gl,globalThis.__AEP_OFFSCREEN_RENDERERS__?.push(this)}render({canvas:e,scene:n,camera:r,width:i,height:o}){const{gl:s}=this;(i!==this.width||o!==this.height)&&(s.setSize(i,o,!1),this.width=i,this.height=o),s.setViewport(0,0,i,o),s.render(n,r);const a=e.getContext("2d");if(!a)throw new Error("model3d: 2D canvas context unavailable");a.clearRect(0,0,i,o),a.drawImage(s.domElement,0,0,i,o)}dispose(){this.gl.dispose(),this.gl.forceContextLoss()}}function YT(t,e=2e3){const n=new Map;return{acquire(r){let i=n.get(r);return i||(i={value:t(),users:0,timer:null},n.set(r,i)),i.timer&&(clearTimeout(i.timer),i.timer=null),i.users+=1,i.value},release(r){const i=n.get(r);i&&(i.users=Math.max(0,i.users-1),!(i.users>0||i.timer)&&(i.timer=setTimeout(()=>{if(!(i.users>0)){n.delete(r);try{i.value.dispose()}catch{}}},e)))},size:()=>n.size}}const WT={},XT=YT(()=>new HT);function bs(t){return XT.acquire(t??WT)}function ih(t){XT.release(t??WT)}function ZD(t){return bs(t)}function oh(t,e){if(t.length===0)return null;if(e===void 0)return{clip:t[0],fellBack:!1};const n=typeof e=="number"?t[e]:t.find(r=>r.name===e);return n?{clip:n,fellBack:!1}:{clip:t[0],fellBack:!0}}const zT=1e-4;function qT(t,e,n,r,i){if(!(n>0))return 0;const o=Math.max(0,t-e)/n,s=(r?.offset??0)+o*(r?.speed??1);return r?.loop===!1&&i!==void 0&&i>0?Math.min(s,Math.max(0,i-zT)):s}const VT=new Map;function KT(t){const e=Math.max(2,Math.min(8,Math.round(t)));let n=VT.get(e);if(!n){const r=new Uint8Array(e);for(let i=0;i<e;i++)r[i]=Math.round((i+1)/e*255);n=new B.DataTexture(r,e,1,B.RedFormat),n.minFilter=B.NearestFilter,n.magFilter=B.NearestFilter,n.generateMipmaps=!1,n.userData.shared=!0,n.needsUpdate=!0,VT.set(e,n)}return n}function JD(t,e){const n=t,r=new B.MeshToonMaterial({color:n.color?n.color.clone():new B.Color("#ffffff"),map:n.map??null,normalMap:n.normalMap??null,emissive:n.emissive?n.emissive.clone():new B.Color(0),emissiveMap:n.emissiveMap??null,transparent:n.transparent,opacity:n.opacity,alphaTest:n.alphaTest,side:n.side,gradientMap:e});return r.shadowSide=B.FrontSide,r}function QD(t,e){const n=new B.MeshBasicMaterial({color:new B.Color(t),side:B.BackSide});return n.onBeforeCompile=r=>{r.uniforms.uOutlineWidth={value:e},r.vertexShader=r.vertexShader.replace("#include <common>",`#include <common>
1524
+ uniform float uOutlineWidth;`).replace("#include <begin_vertex>",`#include <begin_vertex>
1525
+ transformed += normalize(normal) * uOutlineWidth;`)},n}function eN(t){const e=t.clone();for(const r of Object.keys(e.attributes))r!=="position"&&e.deleteAttribute(r);e.clearGroups();const n=yS.mergeVertices(e,1e-4);return n.computeVertexNormals(),n}function vs(t,e){const n=[],r=[],i=[];t.traverse(a=>{a.isMesh&&i.push(a)});const o=e.toon?KT(e.steps):null,s=e.outline?QD(e.outline.color,e.outline.width):null;for(const a of i){if(o){const l=new Map,c=u=>{let f=l.get(u);return f||(f=JD(u,o),l.set(u,f),n.push(u)),f};a.material=Array.isArray(a.material)?a.material.map(c):c(a.material)}if(s){const l=a,c=l.isSkinnedMesh?new B.SkinnedMesh(a.geometry,s):new B.Mesh(eN(a.geometry),s);l.isSkinnedMesh&&c.bind(l.skeleton,l.bindMatrix),c.castShadow=!1,c.receiveShadow=!1,c.frustumCulled=!1,c.name=`${a.name}__outline`,a.add(c),r.push(c)}}return{replaced:n,hulls:r}}function Jt(t,e,n,r=!1){e&&e.wrapS!==B.RepeatWrapping&&(e.wrapS=B.RepeatWrapping,e.wrapT=B.ClampToEdgeWrapping,e.colorSpace=B.SRGBColorSpace,r&&(e.offset.x=.5),e.needsUpdate=!0);const i=new B.MeshPhysicalMaterial({color:new B.Color(e?"#ffffff":t),map:e,roughness:.35,metalness:.05,clearcoat:n,clearcoatRoughness:.2});return i.shadowSide=B.FrontSide,i}async function xs(t){const e=await new B.TextureLoader().loadAsync(t);return e.colorSpace=B.SRGBColorSpace,e.anisotropy=4,e}function tN(t){const e=new Set;return t.traverse(n=>{const r=n;if(!r.isMesh)return;const i=Array.isArray(r.material)?r.material:[r.material];for(const o of i){const s=o;s?.isMeshStandardMaterial&&e.add(s)}}),[...e]}function nN(t){return t.userData?.shared===!0}const sh=t=>t.userData?.stageOwned===!0;function Fr(t,e={}){const n=e.onlyOwned===!0;t.traverse(r=>{const i=r;if(!i.isMesh)return;(!n||i.geometry&&sh(i.geometry))&&i.geometry?.dispose();const o=Array.isArray(i.material)?i.material:[i.material];for(const s of o)if(s){for(const a of Object.values(s)){const l=a;l&&l.isTexture&&!nN(l)&&(!n||sh(l))&&l.dispose()}(!n||sh(s))&&s.dispose()}})}function $T(t,e,n,r){const i=od(e,n,r);return{position:[t[0],t[1],t[2]+i],target:[t[0],t[1],t[2]]}}function rN(t,e,n){return n>0?Math.max(0,t-e)/n:0}function ah(t,e,n){return t>=e&&t<n}function iN(t,e){return e?{center:e.center?[e.center[0],e.center[1],e.center[2]]:t.center,maxDim:Math.max(e.size[0],e.size[1],e.size[2],1e-4)}:t}const oN=({ref:t,layer:e,...n})=>{const r=pt(),i=r.currentFrame,o=I.useRef(i);o.current=i;const{register:s,markReady:a,reset:l,reportError:c}=Zf(),{app:u}=st.useApplication(),[f,d]=I.useState(null),[h,m]=I.useState(null),[p,g]=I.useState(null),[y,_]=I.useState(0),[v,x]=I.useState(!1),E=I.useRef(null),T=I.useRef(null),A=I.useRef("");I.useEffect(()=>{let U=!1;try{d(bs(u)),U=!0}catch(Z){c(e.id,Z)}return()=>{U&&(d(null),ih(u))}},[u,e.id,c]),I.useEffect(()=>s(e.id),[s,e.id]);const M=e.viewport.width,C=e.viewport.height;I.useEffect(()=>{const U=document.createElement("canvas");U.width=M,U.height=C;const Z=K.Texture.from(U);return T.current=Z,m(U),g(Z),()=>{T.current=null,g(null),m(null),Z.destroy(!0)}},[M,C]);const k=e.source.type==="gltf"?e.source.assetId:void 0,w=e.textures?.label,L=e.textures?.front,D=Ni(k),N=Ni(w),F=Ni(L),H=(!k||D.state==="ready")&&(!w||N.state==="ready")&&(!L||F.state==="ready"),V=(k&&D.state==="error"?D.error:void 0)??(w&&N.state==="error"?N.error:void 0)??(L&&F.state==="error"?F.error:void 0),$=I.useMemo(()=>JSON.stringify(e.source),[e.source]),re=I.useMemo(()=>JSON.stringify(e.textures??{}),[e.textures]),he=e.material?.clearcoat??0,q=I.useMemo(()=>JSON.stringify([e.material?.style??"standard",e.material?.toonSteps??3,e.material?.outline??null]),[e.material?.style,e.material?.toonSteps,e.material?.outline]);I.useEffect(()=>{if(!h||!f||!H)return;if(V){const ve=String(V);A.current!==ve&&(A.current=ve,c(e.id,V));return}let U=!1;l(e.id),ce.current=!1,x(!1);const Z=rh(e,o.current),W=Bi(Z.preset,{keyAzimuth:Z.keyAzimuth,keyElevation:Z.keyElevation,keyIntensity:Z.keyIntensity,keyColor:Z.keyColor,fillIntensity:Z.fillIntensity,rimIntensity:Z.rimIntensity},Z.environment),_e=new B.Scene,be=new B.PerspectiveCamera(Z.fov,M/C,.1,1e3),ee=new B.Group;_e.add(ee);const Ee=UT(W);_e.add(Ee.group),nh(_e,W,f.renderer);const de=sN();_e.add(de);const ke=[],je=()=>{E.current=null,_e.clear(),th(Ee),de&&(de.geometry.dispose(),de.material.dispose());for(const ve of ke)ve.dispose()},ut=ve=>{if(U)return;U=!0;const nt=String(ve);A.current!==nt&&(A.current=nt,c(e.id,ve)),je()},dt=(ve,nt,ct,Me)=>{if(U){Fr(ve);return}ee.add(ve),aN(ve,Ee);const Le=new B.Box3().setFromObject(ve),Ae=new B.Vector3,Be=new B.Vector3;Le.getSize(Ae),Le.getCenter(Be);const He=iN({center:[Be.x,Be.y,Be.z],maxDim:Math.max(Ae.x,Ae.y,Ae.z,1e-4)},e.bounds);Be.set(...He.center);const gt=He.maxDim;let ze=nt;const Re=e.material,Ue=Re?.style==="toon";if(Ue||Re?.outline){const{replaced:yt}=vs(ve,{toon:Ue,steps:Re?.toonSteps??3,outline:Re?.outline&&{color:Re.outline.color??"#000000",width:Re.outline.width}});if(Ue){for(const Ct of yt)Ct.dispose();ze=[]}}const en={scene:_e,camera:be,root:ee,content:ve,materials:ze,lighting:Ee,shadow:de,mixer:ct,clipDuration:Me,isExtrude:e.source.type==="extrude",baseExtrudeDepth:Math.max(Z.extrudeDepth,1e-6),maxDim:gt,center:Be,boundsOverride:e.bounds??null};E.current=en,x(ct!=null),_(yt=>yt+1)};return(async()=>{const ve=N.url?await xs(N.url):null;if(ve&&(ke.push(ve),U))return;const nt=F.url?await xs(F.url):null;if(nt&&(ke.push(nt),U))return;if(e.source.type==="gltf"){const ze=await new Os.GLTFLoader().loadAsync(D.url);if(U){Fr(ze.scene);return}const Re=tN(ze.scene),Ue=e.material?.clearcoat??0;for(const tn of Re)"clearcoat"in tn&&(tn.clearcoat=Ue,Ue>0&&(tn.needsUpdate=!0));let en=null,yt=0;const Ct=e.source.animation,Ut=oh(ze.animations,Ct?.clip);Ut&&(Ut.fellBack&&console.warn(`model3d '${e.id}': animation clip ${JSON.stringify(Ct?.clip)} not found; using '${Ut.clip.name}'. Available: ${ze.animations.map(tn=>tn.name).join(", ")}`),en=new B.AnimationMixer(ze.scene),en.clipAction(Ut.clip).play(),yt=Ut.clip.duration),dt(ze.scene,Re,en,yt);return}const ct=e.textures?.side??"#d8d8d8",Me=e.material?.clearcoat??0;if(e.source.type==="primitive"){const ze=gs(e.source.shape,e.source.proportions),Re=e.source.shape==="box";let Ue;if(Re){const yt=Jt(ct,null,Me),Ct=Jt(ct,nt??ve,Me);Ue=[yt,yt,yt,yt,Ct,yt]}else Ue=[Jt(ct,ve??nt,Me,!0)];const en=new B.Mesh(ze,Ue.length===1?Ue[0]:Ue);dt(en,Ue,null,0);return}const{geometry:Le}=ys(e.source.contour,Z.extrudeDepth,e.source.bevel),Ae=Jt(ct,nt,Me),Be=Jt(ct,null,Me),He=[Ae,Be],gt=new B.Mesh(Le,He);dt(gt,He,null,0)})().catch(ut),()=>{U=!0;const ve=E.current;if(ve){ve.mixer?.stopAllAction(),Fr(ve.content),ve.scene.clear(),th(ve.lighting),ve.shadow&&(ve.shadow.geometry.dispose(),ve.shadow.material.dispose());for(const nt of ke)nt.dispose();E.current=null}else je();_(0)}},[h,f,H,V,$,re,he,q,M,C,N.url,F.url,D.url,e.id,l,c]);const fe=I.useMemo(()=>rh(e,i),[e,i]),Y=jT(fe),te=v?i:0,z=ah(i,e.inPoint,e.outPoint),le=I.useRef(fe);le.current=fe;const Q=I.useRef(i);Q.current=i;const ce=I.useRef(!1);I.useEffect(()=>{const U=E.current,Z=h,W=T.current;if(!U||!Z||!W||!f||!z&&ce.current)return;const _e=le.current,be=Q.current;cN(U,_e),lN(U,_e),uN(U,_e);const ee=Bi(_e.preset,{keyAzimuth:_e.keyAzimuth,keyElevation:_e.keyElevation,keyIntensity:_e.keyIntensity,keyColor:_e.keyColor,fillIntensity:_e.fillIntensity,rimIntensity:_e.rimIntensity},_e.environment);Qf(U.lighting,ee),dN(U,_e,ee),U.mixer&&U.clipDuration>0&&U.mixer.setTime(qT(be,e.inPoint,r.fps,e.source.type==="gltf"?e.source.animation:void 0,U.clipDuration));try{f.render({canvas:Z,scene:U.scene,camera:U.camera,width:M,height:C}),W.source.update(),ce.current=!0,a(e.id)}catch(Ee){const de=String(Ee);A.current!==de&&(A.current=de,c(e.id,Ee))}},[Y,te,z,y,f,h,r.fps,e.id,e.inPoint,M,C,a,c]);const{transformation:ye}=n;return R.jsx(Je,{...n,ref:t,children:R.jsx("pixiContainer",{children:p&&R.jsx("pixiSprite",{texture:p,width:M,height:C,anchor:ye.anchor,x:ye.x,y:ye.y,alpha:n.visible?1:0})})})},ch=I.memo(oN);ch.displayName="Pixi3DModelLayer";function sN(){const t=new B.PlaneGeometry(1,1),e=new B.ShadowMaterial({opacity:0,transparent:!0}),n=new B.Mesh(t,e);return n.rotation.x=-Math.PI/2,n.position.y=-.5,n.receiveShadow=!0,n.castShadow=!1,n}function aN(t,e){t.traverse(i=>{const o=i;o.isMesh&&(o.castShadow=!0,o.receiveShadow=!0)});const n=6,r=e.key.shadow.camera;r.left=-n,r.right=n,r.top=n,r.bottom=-n,r.near=.1,r.far=60,r.updateProjectionMatrix()}function cN(t,e){const n=Math.PI/180;t.root.position.set(...e.position),t.root.rotation.set(e.rotation[0]*n,e.rotation[1]*n,e.rotation[2]*n),t.root.scale.setScalar(e.scale),t.isExtrude&&(t.content.scale.z=e.extrudeDepth/t.baseExtrudeDepth)}function lN(t,e){for(const n of t.materials)n.roughness=e.roughness,n.metalness=e.metalness}function uN(t,e){const{position:n,target:r}=$T([t.center.x,t.center.y,t.center.z],t.maxDim,e.fov,e.fit);t.camera.fov=e.fov,t.camera.position.set(...n),t.camera.lookAt(...r),t.camera.updateProjectionMatrix()}const ZT=new B.Box3,JT=new B.Vector3,QT=new B.Vector3;function dN(t,e,n){const r=t.shadow;if(!r)return;const i=r.material;if(i.opacity=e.shadowOpacity,r.visible=e.shadowOpacity>0&&n.keyIntensity>0,!r.visible)return;t.root.updateMatrixWorld(!0);const o=t.boundsOverride,s=o?ZT.setFromCenterAndSize(QT.set(...o.center??[t.center.x,t.center.y,t.center.z]),JT.set(...o.size)).applyMatrix4(t.root.matrixWorld):ZT.setFromObject(t.content);if(s.isEmpty())return;const a=s.getSize(JT),l=s.getCenter(QT),c=Math.max(a.x,a.z,.001)*2.6;r.scale.set(c,c,1),r.position.set(l.x,s.min.y-e.shadowOffsetY,l.z),t.lighting.key.shadow.radius=2+e.shadowSoftness*10}const fN="#d9cbb8",hN=[10,8],Ts={distance:3,height:5,curve:1},eE=16;function tE({width:t,distance:e,height:n,curve:r,wallUv:i=!1}){const o=Math.min(r,n),s=[];if(o>0)for(let p=0;p<=eE;p++){const g=p/eE*(Math.PI/2);s.push([o-o*Math.cos(g),-e+o-o*Math.sin(g),Math.cos(g),Math.sin(g)])}else s.push([0,-e,0,1]);s.push([n,-e,0,1]);const a=[0];for(let p=1;p<s.length;p++)a.push(a[p-1]+Math.hypot(s[p][0]-s[p-1][0],s[p][1]-s[p-1][1]));const l=a[a.length-1]||1,c=[],u=[],f=[],d=[],h=t/2;s.forEach(([p,g,y,_],v)=>{const x=i?p<=o?0:(p-o)/Math.max(n-o,1e-6):a[v]/l;for(const[E,T]of[[-h,0],[h,1]])c.push(E,p,g),u.push(0,y,_),f.push(T,x)});for(let p=0;p<s.length-1;p++){const g=p*2,y=g+1,_=g+2,v=g+3;d.push(g,y,_,y,v,_)}const m=new B.BufferGeometry;return m.setAttribute("position",new B.Float32BufferAttribute(c,3)),m.setAttribute("normal",new B.Float32BufferAttribute(u,3)),m.setAttribute("uv",new B.Float32BufferAttribute(f,2)),m.setIndex(d),m}function pN(t){return{...Bi(t.preset,{keyAzimuth:t.keyAzimuth,keyElevation:t.keyElevation,keyIntensity:t.keyIntensity,keyColor:t.keyColor,fillIntensity:t.fillIntensity,rimIntensity:t.rimIntensity},t.environment),ambientIntensity:t.ambient}}function mN(t,e,n){const{viewport:r}=t,i=new B.Scene,o=new B.PerspectiveCamera(t.camera.fov??35,r.width/r.height,.05,200);o.position.set(...t.camera.position),o.lookAt(...t.camera.target),o.updateProjectionMatrix(),o.updateMatrixWorld(!0);const[s,a]=t.set?.groundSize??hN,l={halfWidth:s/2,halfDepth:a/2},c=t.set?.ground??fN,u=new B.Mesh(new B.PlaneGeometry(s,a),new B.MeshStandardMaterial({color:c,roughness:.9,metalness:0}));u.name="stage-ground",u.rotation.x=-Math.PI/2,u.receiveShadow=!0,i.add(u);let f=null;const d=!!(t.set?.backdrop&&e);if(t.set?.backdrop||t.set?.wall){const E={...Ts,...t.set?.wall},T=tE({width:s,distance:E.distance??Ts.distance,height:E.height??Ts.height,curve:E.curve??Ts.curve,wallUv:d});let A;d&&e?(e.colorSpace=B.SRGBColorSpace,e.wrapS=B.ClampToEdgeWrapping,e.wrapT=B.ClampToEdgeWrapping,e.needsUpdate=!0,A=new B.MeshBasicMaterial({map:e,fog:!1})):A=new B.MeshStandardMaterial({color:c,roughness:.9,metalness:0}),f=new B.Mesh(T,A),f.name="stage-wall",f.receiveShadow=!d,i.add(f)}if(t.set?.fog){const{color:E,near:T,far:A}=t.set.fog;i.fog=new B.Fog(E,T,A)}const h=t.lights?.preset,m=Bi(h,{},t.lights?.environment),p=UT(m);i.add(p.group),n&&nh(i,m,n);const g=p.key.shadow.camera,y=Math.max(l.halfWidth,l.halfDepth)*1.1;g.left=-y,g.right=y,g.top=y,g.bottom=-y,g.near=.5,g.far=40,g.updateProjectionMatrix(),p.key.shadow.mapSize.set(2048,2048),p.key.shadow.bias=-5e-4,p.key.shadow.normalBias=.02,p.fill.castShadow=!1,p.rim.castShadow=!1;const _=new Map;for(const E of t.lights?.spots??[]){const T=new B.SpotLight(new B.Color(E.color??"#ffffff"),0,0,25*Math.PI/180,E.penumbra??.4,2);T.castShadow=E.castShadow??!0,T.shadow.mapSize.set(1024,1024),T.shadow.bias=-5e-4,T.shadow.normalBias=.02;const A=new B.Object3D;T.target=A,i.add(T,A),_.set(E.id,{light:T,target:A})}const v=new B.Group;return v.name="stage-members",i.add(v),{scene:i,camera:o,lighting:p,spots:_,ground:u,wall:f,hasBackdrop:d,membersRoot:v,extents:l,dispose:()=>{for(const E of[u,f]){if(!E)continue;E.geometry.dispose(),E.material.dispose()}e?.dispose(),th(p);for(const{light:E,target:T}of _.values())E.shadow.map?.dispose(),E.dispose(),T.removeFromParent();_.clear(),i.clear()}}}function gN(t,e,n){const r=pN(e.lighting);Qf(t.lighting,r),n?nh(t.scene,r,n):t.scene.environmentIntensity=r.environmentIntensity;const i=t.lighting.key;i.shadow.radius=1+e.shadowSoftness*6,i.shadow.intensity=e.shadowOpacity;for(const o of e.spots){const s=t.spots.get(o.id);s&&(s.light.position.set(...o.position),s.target.position.set(...o.target),s.target.updateMatrixWorld(),s.light.intensity=o.intensity,s.light.angle=o.angleDeg*Math.PI/180,s.light.shadow.intensity=e.shadowOpacity)}}function rr(t){return t.replace(/^mixamorig\d*[:_]?/i,"").replace(/[^a-z0-9]/gi,"").toLowerCase()}const yN=/^(.*)\.(position|quaternion|scale|morphTargetInfluences.*)$/;function lh(t){const e=yN.exec(t);return e?{node:e[1],property:e[2]}:null}function nE(t,e){const n=new Map;for(const s of e){const a=rr(s);a&&!n.has(a)&&n.set(a,s)}const r=new Map,i=new Set,o=new Set;for(const s of t){const a=lh(s);if(!a)continue;const l=rr(a.node),c=n.get(l);if(c===void 0){i.add(l);continue}o.add(l),r.set(s,`${c}.${a.property}`)}return{trackMap:r,missingBones:[...i].sort(),boundBones:o.size}}const rE=t=>rr(t)==="hips";function _N(t,e){let n=null;return t.traverse(r=>{!n&&rr(r.name)===e&&(n=r)}),n}function bN(t,e){const n=t.tracks.find(s=>{const a=lh(s.name);return a&&a.property==="position"&&rE(a.node)}),r=_N(e,"hips");if(!n||!r)return 1;const i=Math.abs(n.values[1]??0),o=Math.abs(r.position.y);return i>0&&o>0?o/i:1}function iE(t,e,n){const r=[];e.traverse(l=>{l.isBone&&r.push(l.name)}),r.length===0&&e.traverse(l=>r.push(l.name));const{trackMap:i,missingBones:o}=nE(t.tracks.map(l=>l.name),r),s=[];for(const l of t.tracks){const c=i.get(l.name);if(c===void 0)continue;const u=lh(c),f=l.clone();if(f.name=c,u.property==="position"){if(!rE(u.node))continue;const d=f.values;for(let h=0;h<d.length;h+=3)d[h]*=n.hipsScale,d[h+1]*=n.hipsScale,d[h+2]*=n.hipsScale;if(n.rootMotion==="strip"&&d.length>=3){const h=d[0],m=d[2];for(let p=0;p<d.length;p+=3)d[p]=h,d[p+2]=m}}s.push(f)}return{clip:new B.AnimationClip(t.name,t.duration,s),missingBones:o}}const uh={shadowOpacity:.55,shadowSoftness:.5,spotAngle:25},vN=t=>Math.min(1,Math.max(0,t));function oE(t,e,n){if(t.length===0)return[];const r=l=>{const c=t[l];return(c.offset??0)+Math.max(0,e-c.startFrame)/n*(c.speed??1)},i=(l,c)=>({clipIndex:l,weight:c,rawSeconds:r(l),loop:t[l].loop??!1});if(e<t[0].startFrame)return[i(0,1)];let o=0;for(let l=0;l<t.length&&t[l].startFrame<=e;l++)o=l;const s=o===0?0:t[o].fadeFrames??kd,a=s===0?1:vN((e-t[o].startFrame)/s);return o>0&&a<1?[i(o-1,1-a),i(o,a)]:[i(o,1)]}function sE(t,e,n){return e>0?n?t%e:Math.min(t,Math.max(0,e-zT)):0}const Ui=[0,0,0],xN=[1,1,1];function dh(t,e){return!t.hidden&&e>=t.inPoint&&e<t.outPoint}function aE(t,e){const n=t.lights?.preset??_s,r=Fi[n],i=t.lights;return{lighting:{preset:n,keyAzimuth:ge(i?.key?.azimuth,r.keyAzimuth,e),keyElevation:ge(i?.key?.elevation,r.keyElevation,e),keyIntensity:ge(i?.key?.intensity,r.keyIntensity,e),keyColor:i?.key?.color??r.keyColor,fillIntensity:ge(i?.fill?.intensity,r.fillIntensity,e),rimIntensity:ge(i?.rim?.intensity,r.rimIntensity,e),ambient:ge(i?.ambient,r.ambientIntensity,e),environment:i?.environment??r.environment},spots:(i?.spots??[]).map(o=>({id:o.id,position:wt(o.position,Ui,e),target:wt(o.target,Ui,e),intensity:ge(o.intensity,0,e),angleDeg:ge(o.angle,uh.spotAngle,e)})),shadowOpacity:ge(t.shadow?.opacity,uh.shadowOpacity,e),shadowSoftness:t.shadow?.softness??uh.shadowSoftness,focusDistance:t.camera.focus?ge(t.camera.focus.distance,1,e):null}}function cE(t,e,n){const r=dh(t,e),[i,o,s]=wt(t.marks,Ui,e);return{id:t.id,active:r,x:i,z:o,facingDeg:s,clips:r?oE(t.clips??[],e,n):[]}}function lE(t,e){return{id:t.id,active:dh(t,e),position:wt(t.position,Ui,e),rotationDeg:wt(t.rotation,Ui,e),scale:wt(t.scale,xN,e)}}function uE(t,e){return JSON.stringify([t,e])}const Gi=new B.Box3,dE=new B.Vector3,fh=new B.Vector3;function fE(t,e,n){t.updateMatrixWorld(!0),Gi.setFromObject(t,!0),Gi.getSize(dE);const r=n(dE),i=r>1e-9?e/r:1;return t.scale.multiplyScalar(i),t.updateMatrixWorld(!0),Gi.setFromObject(t,!0),Gi.getCenter(fh),t.position.x-=fh.x,t.position.z-=fh.z,t.position.y-=Gi.min.y,t.updateMatrixWorld(!0),{scale:i}}const TN=new B.Box3,EN=new B.Box3,kn=new B.Vector3;function hE(t){t.updateMatrixWorld(!0);let e=null;if(t.traverse(o=>{!e&&o.isMesh&&(e=o)}),!e)return 1;const n=e;n.geometry.computeBoundingBox(),TN.copy(n.geometry.boundingBox).getSize(kn);const r=Math.max(kn.x,kn.y,kn.z);EN.setFromObject(n,!0).getSize(kn);const i=Math.max(kn.x,kn.y,kn.z);return r>1e-9&&i>1e-9?i/r:1}const SN=1,wN={kind:"actor3d",order:0,assetIds:t=>[t.assetId,...(t.clips??[]).flatMap(e=>e.clipAssetId?[e.clipAssetId]:[])],structureOf:t=>({assetId:t.assetId,height:t.height,clips:t.clips,rootMotion:t.rootMotion,castShadow:t.castShadow}),sample:(t,e,n)=>cE(t,e,n),async build(t,e){return AN(t,e)}};async function AN(t,e){const n=await e.loadGltf(e.urls[t.assetId]),r=_S.clone(n.scene);fE(r,t.height??SN,d=>d.y);const i=t.castShadow??!0;r.traverse(d=>{const h=d;h.isMesh&&(h.castShadow=i,h.receiveShadow=!0,h.isSkinnedMesh&&(h.frustumCulled=!1))});const o=new B.Group;o.name=`actor:${t.id}`,o.userData.stageMemberId=t.id,o.add(r);const s=new B.AnimationMixer(r),a=[],l=[],c=t.rootMotion??"strip";for(const d of t.clips??[]){let h=n.animations,m=!1;d.clipAssetId&&(h=(await e.loadGltf(e.urls[d.clipAssetId])).animations,m=!0);const p=oh(h,d.name);if(!p){e.warn(`actor3d '${t.id}': no animation clips found for ${JSON.stringify(d.clipAssetId??d.name)}`),a.push(null),l.push(0);continue}p.fellBack&&e.warn(`actor3d '${t.id}': animation clip ${JSON.stringify(d.name)} not found; using '${p.clip.name}'. Available: ${h.map(v=>v.name).join(", ")}`);const g=m?bN(p.clip,r):1,y=iE(p.clip,r,{rootMotion:c,hipsScale:g});if(y.missingBones.length>0){const v=y.missingBones.slice(0,10).join(", ");e.warn(`actor3d '${t.id}': clip '${p.clip.name}' has bones missing on the actor: ${v}`+(y.missingBones.length>10?", ...":""))}const _=s.clipAction(y.clip);_.setEffectiveWeight(0),_.play(),a.push(_),l.push(y.clip.duration)}const u=hE(o);return{id:t.id,root:o,model:r,mixer:s,actions:a,durations:l,worldScale:u,apply(d){const h=d;if(o.visible=h.active,!!h.active){o.position.set(h.x,0,h.z),o.rotation.set(0,h.facingDeg*Math.PI/180,0);for(const m of a)m?.setEffectiveWeight(0);for(const m of h.clips){const p=a[m.clipIndex];p&&(p.enabled=!0,p.paused=!1,p.setEffectiveWeight(m.weight),p.time=sE(m.rawSeconds,l[m.clipIndex],m.loop))}s.update(0)}},worldBox(d){return d.setFromObject(o)},dispose(){s.stopAllAction(),s.uncacheRoot(r),r.traverse(d=>{const h=d;h.isSkinnedMesh&&h.skeleton.dispose()}),o.removeFromParent(),Fr(o,{onlyOwned:!0})}}}const ON=.4,hh=Math.PI/180,yn=t=>(t.userData.stageOwned=!0,t),MN={kind:"prop3d",order:1,assetIds:t=>[...t.source.type==="gltf"?[t.source.assetId]:[],...t.textures?.label?[t.textures.label]:[],...t.textures?.front?[t.textures.front]:[]],structureOf:t=>({role:t.role,source:t.source,textures:t.textures,size:t.size,castShadow:t.castShadow,attach:t.attach}),sample:(t,e)=>lE(t,e),async build(t,e){return CN(t,e)}};async function IN(t,e){const{source:n}=t;if(n.type==="gltf")return(await e.loadGltf(e.urls[n.assetId])).scene.clone(!0);const r=t.textures?.label?e.urls[t.textures.label]:void 0,i=t.textures?.front?e.urls[t.textures.front]:void 0,o=r?yn(await e.loadTexture(r)):null,s=i?yn(await e.loadTexture(i)):null,a=t.textures?.side??"#d8d8d8";if(n.type==="primitive"){const u=yn(gs(n.shape,n.proportions));let f;if(n.shape==="box"){const d=yn(Jt(a,null,0)),h=yn(Jt(a,s??o,0));f=[d,d,d,d,h,d]}else f=yn(Jt(a,o??s,0,!0));return new B.Mesh(u,f)}const l=ge(n.depth,100,t.inPoint),{geometry:c}=ys(n.contour,Math.max(l,1e-6),n.bevel);return yn(c),new B.Mesh(c,[yn(Jt(a,s,0)),yn(Jt(a,null,0))])}async function CN(t,e){const n=await IN(t,e);fE(n,t.size??ON,l=>Math.max(l.x,l.y,l.z));const r=t.castShadow??!0;n.traverse(l=>{const c=l;c.isMesh&&(c.castShadow=r,c.receiveShadow=!0)});const i=new B.Group;i.name=`prop:${t.id}`,i.userData.stageMemberId=t.id,i.add(n);const o=hE(i);let s=1,a=!1;if(t.attach){const l=e.rigs.get(t.attach.actor),c=rr(t.attach.bone);let u=null;if(l?.root.traverse(f=>{!u&&f.isBone&&rr(f.name)===c&&(u=f)}),l&&u){const f=u;l.root.updateMatrixWorld(!0),s=1/Math.max(f.getWorldScale(new B.Vector3).x,1e-9),f.add(i),a=!0}else e.warn(`prop3d '${t.id}': attach bone '${t.attach.bone}' not found on actor '${t.attach.actor}'; placing it in world space`)}return{id:t.id,root:i,worldScale:o,apply(l){const c=l;if(i.visible=c.active,!c.active)return;const u=a?s:1;i.position.set(c.position[0]*u,c.position[1]*u,c.position[2]*u),i.rotation.set(c.rotationDeg[0]*hh,c.rotationDeg[1]*hh,c.rotationDeg[2]*hh),i.scale.set(c.scale[0]*u,c.scale[1]*u,c.scale[2]*u)},worldBox(l){return l.setFromObject(i)},dispose(){i.removeFromParent(),Fr(i,{onlyOwned:!0})}}}const pE={actor3d:wN,prop3d:MN};function ji(t){return pE[t.kind]}const RN=(t,e)=>t.order-e.order;function mE(t,e){const n=[...e.members].sort(RN);if(t.worldKey!==e.worldKey)return{rebuildWorld:!0,build:n.map(a=>a.id),rebuild:[],dispose:t.members.map(a=>a.id)};const r=new Map(t.members.map(a=>[a.id,a])),i=new Set(e.members.map(a=>a.id)),o=t.members.filter(a=>!i.has(a.id)).map(a=>a.id),s=new Set;for(const a of e.members){const l=r.get(a.id);l&&l.key!==a.key&&s.add(a.id)}for(let a=!0;a;){a=!1;for(const l of e.members)l.attachTo&&s.has(l.attachTo)&&!s.has(l.id)&&r.has(l.id)&&(s.add(l.id),a=!0)}return{rebuildWorld:!1,build:n.filter(a=>!r.has(a.id)).map(a=>a.id),rebuild:n.filter(a=>s.has(a.id)).map(a=>a.id),dispose:o}}function gE(t){return{toon:(t?.shading??"toon")==="toon",steps:t?.toonSteps??3,outline:t?.outline?{color:t.outline.color??"#1a1a1a",width:t.outline.width}:null,exposure:t?.exposure??1}}const LN=t=>{const e=[];return t.traverse(n=>{n.isMesh&&e.push(n)}),e};function kN(t,e){if(!e.toon&&!e.outline)return;const{replaced:n,hulls:r}=vs(t.root,{toon:e.toon,steps:e.steps,outline:e.outline?{color:e.outline.color,width:e.outline.width/t.worldScale}:void 0});for(const i of LN(t.root)){const o=Array.isArray(i.material)?i.material:[i.material];for(const s of o)(s.isMeshToonMaterial||r.includes(i))&&(s.userData.stageOwned=!0)}for(const i of r)i.isSkinnedMesh||(i.geometry.userData.stageOwned=!0);for(const i of n)i.userData.stageOwned===!0&&i.dispose()}function PN(t,e){if(!e.toon)return;const n=[t.ground,t.hasBackdrop?null:t.wall].filter(r=>r!==null);for(const r of n){const{replaced:i}=vs(r,{toon:!0,steps:e.steps});for(const o of i)o.dispose()}}class DN{constructor(e={}){this.options=e}options;world=null;ready=!1;rigs=new Map;state={worldKey:null,members:[]};gen=0;disposed=!1;needsWarm=!1;queue=Promise.resolve();gltfCache=new Map;warned=new Set;loadGltf=e=>{let n=this.gltfCache.get(e);return n||(n=(this.options.loadGltf??(r=>new Os.GLTFLoader().loadAsync(r)))(e),this.gltfCache.set(e,n)),n};warn=e=>{this.warned.has(e)||(this.warned.add(e),(this.options.warn??(n=>console.warn(n)))(e))};reconcile(e){const n=++this.gen,r=this.queue.then(()=>this.run(n,e));return this.queue=r.then(()=>{},()=>{}),r}stale(e){return this.disposed||e!==this.gen}async run(e,n){if(this.stale(e))return!1;try{const r={worldKey:n.worldKey,members:n.members.map(({layer:l,key:c,attachTo:u})=>({id:l.id,key:c,attachTo:u,order:ji(l).order}))},i=mE(this.state,r),o=new Map(n.members.map(l=>[l.layer.id,l])),s=gE(n.worldLayer.style);if(i.rebuildWorld){const l=n.worldLayer.set?.backdrop,c=l?n.urls[l]:void 0,u=c?await(this.options.loadTexture??xs)(c):null;if(this.stale(e))return u?.dispose(),!1;n.worldLayer.camera.focus&&n.worldLayer.camera.focus.aperture>0&&this.warn("stage3d: camera.focus not supported yet"),this.disposeBuilt(),this.world=mN(n.worldLayer,u,this.options.renderer?.()),PN(this.world,s),this.state={worldKey:n.worldKey,members:[]},this.ready=!1}else for(const l of[...i.dispose,...i.rebuild])this.disposeMember(l);const a=[...i.build,...i.rebuild].map(l=>r.members.find(c=>c.id===l)).sort((l,c)=>l.order-c.order);for(const l of a){const c=o.get(l.id),u=ji(c.layer),f={urls:n.urls,loadGltf:this.loadGltf,loadTexture:this.options.loadTexture??xs,rigs:new Map([...this.rigs].map(([h,m])=>[h,m.rig])),warn:this.warn},d=await u.build(c.layer,f);if(this.stale(e)||!this.world)return d.dispose(),!1;kN(d,s),d.root.parent||this.world.membersRoot.add(d.root),this.rigs.set(l.id,{rig:d,layer:c.layer}),this.state.members.push(l)}return this.state={worldKey:r.worldKey,members:r.members.filter(l=>this.rigs.has(l.id))},this.ready=!0,this.needsWarm=!0,!0}catch(r){return this.options.onError?.(r),!1}}apply(e,n){if(!this.ready||!this.world)return!1;const r=this.options.renderer?.();gN(this.world,e,r),this.needsWarm&&(this.needsWarm=!1,this.warm(r));for(const[i,o]of this.rigs){const s=n.get(i);s!==void 0&&o.rig.apply(s)}return!0}warm(e){if(!(!e||!this.world)){for(const{rig:n}of this.rigs.values())n.root.visible=!0;try{e.render(this.world.scene,this.world.camera)}catch{}}}disposeMember(e){this.rigs.get(e)?.rig.dispose(),this.rigs.delete(e),this.state={...this.state,members:this.state.members.filter(n=>n.id!==e)}}disposeBuilt(){for(const{rig:e}of this.rigs.values())e.dispose();this.rigs.clear(),this.world?.dispose(),this.world=null,this.state={worldKey:null,members:[]},this.ready=!1}dispose(){this.disposed=!0,this.gen++;const e=this.queue.then(async()=>{this.disposeBuilt();const n=[...this.gltfCache.values()];this.gltfCache.clear();for(const r of n)try{const i=await r;Fr(i.scene)}catch{}});return this.queue=e,e}}const yE=I.createContext(null),_E=({onStageLayout:t,children:e})=>R.jsx(yE.Provider,{value:t??null,children:e});function bE(){return I.useContext(yE)}const Hi=new B.Vector3;function vE(t,e,n){if(t.isEmpty())return null;e.updateMatrixWorld();let r=1/0,i=1/0,o=-1/0,s=-1/0;for(let f=0;f<8;f++){if(Hi.set(f&1?t.max.x:t.min.x,f&2?t.max.y:t.min.y,f&4?t.max.z:t.min.z),Hi.clone().applyMatrix4(e.matrixWorldInverse).z>=-e.near)return null;Hi.project(e);const d=(Hi.x+1)/2*n.width,h=(1-Hi.y)/2*n.height;r=Math.min(r,d),o=Math.max(o,d),i=Math.min(i,h),s=Math.max(s,h)}const a=Math.max(0,r),l=Math.max(0,i),c=Math.min(n.width,o),u=Math.min(n.height,s);return c<=a||u<=l?null:{x:a,y:l,width:c-a,height:u-l}}function xE(t){const{layersById:e}=pt();return I.useMemo(()=>$b(e.values(),t),[e,t])}const NN=({ref:t,layer:e,...n})=>{const r=pt(),i=r.currentFrame,{register:o,markReady:s,reset:a,reportError:l}=Zf(),{app:c}=st.useApplication(),[u,f]=I.useState(null),[d,h]=I.useState(null),[m,p]=I.useState(null),g=bE(),y=I.useRef(g);y.current=g;const[_,v]=I.useState(null),[x,E]=I.useState(0),T=I.useRef(null),A=I.useRef(""),M=I.useRef(!1),C=I.useCallback(U=>{const Z=String(U);A.current!==Z&&(A.current=Z,l(e.id,U))},[e.id,l]);I.useEffect(()=>{let U=!1;try{f(bs(c)),U=!0}catch(Z){l(e.id,Z)}return()=>{U&&(f(null),ih(c))}},[c,e.id,l]),I.useEffect(()=>o(e.id),[o,e.id]);const k=e.viewport.width,w=e.viewport.height;I.useEffect(()=>{const U=document.createElement("canvas");U.width=k,U.height=w;const Z=K.Texture.from(U);return T.current=Z,h(U),p(Z),()=>{T.current=null,p(null),h(null),Z.destroy(!0)}},[k,w]),I.useEffect(()=>{if(!u)return;const U=new DN({renderer:()=>u.renderer,onError:C});return v(U),()=>{v(null),M.current=!1,U.dispose()}},[u,C]);const L=xE(e.id),D=e.set?.backdrop,N=I.useMemo(()=>{const U=new Set;D&&U.add(D);for(const Z of L)for(const W of ji(Z).assetIds(Z))U.add(W);return[...U]},[D,L]),F=LT(N),H=N.every(U=>F[U]?.state==="ready"),V=N.map(U=>F[U]?.state==="error"?F[U].error:void 0).find(U=>U!==void 0),$=N.map(U=>`${U}=${F[U]?.url??""}`).join("|"),re=I.useMemo(()=>Object.fromEntries(N.map(U=>[U,F[U]?.url??""])),[$]),he=I.useMemo(()=>JSON.stringify([e.viewport,e.camera,e.set,e.style,e.lights?.spots?.map(U=>[U.id,U.castShadow,U.penumbra,U.color]),D?re[D]:null]),[e.viewport,e.camera,e.set,e.style,e.lights?.spots,D,re]),q=I.useMemo(()=>{const U=W=>{const _e=ji(W);return JSON.stringify([_e.structureOf(W),_e.assetIds(W).map(be=>re[be])])},Z=new Map(L.map(W=>[W.id,W]));return L.map(W=>{const _e=W.kind==="prop3d"&&W.attach?Z.get(W.attach.actor):void 0;return{layer:W,key:_e?`${U(W)}@${U(_e)}`:U(W),attachTo:_e?.id}})},[L,re]),fe=q.map(U=>`${U.layer.id}:${U.key}`).join(`
1526
+ `),Y=I.useRef({layer:e,memberDescs:q,urls:re,worldKey:he});Y.current={layer:e,memberDescs:q,urls:re,worldKey:he},I.useEffect(()=>{if(!_)return;if(V){C(V);return}if(!H)return;let U=!1;a(e.id),M.current=!1;const Z=Y.current;return _.reconcile({worldLayer:Z.layer,worldKey:Z.worldKey,members:Z.memberDescs,urls:Z.urls}).then(W=>{W&&!U&&E(_e=>_e+1)}),()=>{U=!0}},[_,H,V,he,fe,e.id,a,C]);const te=I.useMemo(()=>aE(e,i),[e,i]),z=L.map(U=>ji(U).sample(U,i,r.fps)),le=uE(te,z),Q=ah(i,e.inPoint,e.outPoint),ce=I.useRef({sampledWorld:te,members:L,memberSamples:z});ce.current={sampledWorld:te,members:L,memberSamples:z},I.useLayoutEffect(()=>{const U=T.current;if(!_||!_.ready||!_.world||!d||!U||!u||!Q&&M.current)return;const Z=ce.current,W=new Map(Z.members.map((Ee,de)=>[Ee.id,Z.memberSamples[de]]));if(!_.apply(Z.sampledWorld,W))return;const _e=(Ee,de)=>{const ke=y.current;if(!ke||!_.world)return;const je=new B.Box3,ut={};for(const[dt,ot]of _.rigs){if(de.get(dt)?.active===!1)continue;const ve=vE(ot.rig.worldBox(je),_.world.camera,e.viewport);ve&&(ut[dt]=ot.layer.kind==="prop3d"?{...ve,role:ot.layer.role??"prop"}:ve)}ke({worldId:e.id,frame:Ee,viewport:e.viewport,rects:ut})},be=u.renderer,ee=be.toneMappingExposure;be.toneMappingExposure=gE(e.style).exposure;try{u.render({canvas:d,scene:_.world.scene,camera:_.world.camera,width:k,height:w}),U.source.update(),M.current=!0,s(e.id),_e(i,W)}catch(Ee){C(Ee)}finally{be.toneMappingExposure=ee}},[le,x,Q,_,u,d,k,w,e.id,s,C]);const{transformation:ye}=n;return R.jsx(Je,{...n,ref:t,children:R.jsx("pixiContainer",{children:m&&R.jsx("pixiSprite",{texture:m,width:k,height:w,anchor:ye.anchor,x:ye.x,y:ye.y,alpha:n.visible?1:0})})})},ph=I.memo(NN);ph.displayName="Pixi3DStageLayer";const TE=I.createContext(null),Es=({children:t,overrides:e,prefix:n=""})=>{const[r]=I.useState(()=>new Map),[i,o]=I.useState(0),s=I.useCallback((l,c)=>{c?r.set(l,c):r.delete(l),o(u=>u+1)},[r]),a=I.useMemo(()=>({containers:r,revision:i,registerContainer:s,overrides:e,prefix:n}),[r,i,s,e,n]);return R.jsx(TE.Provider,{value:a,children:t})},Br=()=>I.useContext(TE);function Yi(t){return Array.isArray(t)?t[0].v:t}const Ur=I.memo(({layer:t})=>t.kind==="camera"||t.kind==="light"||Tt(t)||"is3D"in t&&t.is3D===!0?null:R.jsx(FN,{layer:t}));Ur.displayName="AepLayerRouter";const FN=({layer:t})=>{const e=pt(),n=Br(),r=nr(),i=Li(t.id),o=e.framesToSeconds(t.inPoint),s=e.framesToSeconds(t.outPoint),a="assetId"in t?t.assetId:void 0,l=a?e.assets[a]:void 0,c=Ni(a),u=t.kind==="model3d"||t.kind==="stage3d"?{width:t.viewport.width,height:t.viewport.height}:{width:l?.width??e.width,height:l?.height??e.height},f=PT(t,u),d={x:f.x,y:f.y,width:f.width,height:f.height,anchor:f.anchor,rotation:f.rotation,alpha:f.alpha,scale:f.scale},h=I.useCallback((E,T)=>{},[]),m=I.useCallback(E=>n?.registerContainer(`${n.prefix}${t.id}`,E),[n?.registerContainer,n?.prefix,t.id]),p=_1(t),g=b1(t,p),y={uniqueId:t.id,startAt:o,endAt:s,visible:t.hidden!==!0,onContainerRefReady:h};function _(){switch(t.kind){case"image":return R.jsx(Nu,{...y,src:c.url,transformation:d});case"video":{const E="muted"in t?!!t.muted:!1;return R.jsx(Uf,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,mute:E,locked:!1})}case"audio":return R.jsx(TT,{uniqueId:t.id,src:c.url,startAt:o,endAt:s,inPointFrames:t.inPoint,level:t.level,pan:t.pan,muted:!1,visible:t.hidden!==!0,transformation:d,onContainerRefReady:h});case"gif":return R.jsx(H_,{...y,src:c.url,transformation:d});case"lottie":return R.jsx(Wf,{...y,src:c.url,transformation:d,frameStartAt:o,frameEndAt:s,locked:!1,loop:!0});case"svg":return R.jsx(n_,{...y,src:c.url,transformation:d});case"text":{const E=i??Yi(t.source),T=Yi(t.style.size),A=t.style.fill?Yi(t.style.fill):void 0,M=A==null?"#ffffff":typeof A=="string"?A:r?.[A.themeKey]??A.default;return DT(t)?R.jsx("pixiContainer",{alpha:f.alpha,children:R.jsx(Rf,{layer:t,animators:t.animators??[],x:f.x,y:f.y})}):R.jsx(db,{...y,text:E,transformation:{...d,fill:M,fontFamily:t.style.font,fontSize:T,fontColor:M,fontWeight:t.style.weight!=null?String(t.style.weight):void 0,fontStyle:t.style.italic?"italic":void 0,lineHeight:t.style.lineHeight?Yi(t.style.lineHeight):void 0,letterSpacing:t.style.letterSpacing?Yi(t.style.letterSpacing):void 0}})}case"shape":return R.jsx(bT,{...y,path:t.path,fill:t.fill,stroke:t.stroke,trimPath:t.trimPath,transformation:d,fps:e.fps,inPointFrames:t.inPoint});case"null":return R.jsx(vT,{...y,transformation:d});case"precomp":return R.jsx(wE,{...y,compId:t.compId,layerInPointFrames:t.inPoint,precompWidth:t.width,precompHeight:t.height,transformation:d});case"model3d":return R.jsx(ch,{...y,layer:t,transformation:d});case"stage3d":return R.jsx(ph,{...y,layer:t,transformation:d});default:return null}}const v=_();if(v===null||a&&c.state==="error")return null;let x=v;if(p.length>0&&(x=R.jsxs("pixiContainer",{filters:p,children:[g,x]})),"masks"in t&&t.masks&&t.masks.length>0&&(x=R.jsx(AT,{masks:t.masks,fps:e.fps,inPointFrames:t.inPoint,children:x})),"trackMatte"in t&&t.trackMatte){const E=e.layersById.get(t.trackMatte.sourceId);E&&(x=R.jsx(OT,{mode:t.trackMatte.mode,width:e.width,height:e.height,source:R.jsx(Ur,{layer:E}),matted:x}))}return R.jsx(j1,{uniqueId:`${n?.prefix??"aep:"}${t.id}`,startAt:o,endAt:s,onSequenceContainerReady:m,children:x})},EE=(t,e,n)=>{const{currentFrame:r}=pt(),i=I.useRef(r),o=I.useRef(new Set);i.current=r;const s=I.useCallback(a=>(o.current.add(a),a(i.current),()=>o.current.delete(a)),[]);return I.useLayoutEffect(()=>{for(const a of o.current)a(r)},[r]),I.useMemo(()=>({start:t,end:t+e,duration:e,ease:n,subscribe:s}),[t,e,n,s])},SE=t=>{const e=Array.isArray(t)?Vn(t):t??"none";return S.parseEase(e)??S.parseEase("none")},BN={},mh=I.memo(({transition:t,overrides:e})=>{const n=pt(),r=Br(),i=e?.[t.id],o=i?.name??t.name,s=i?.params??t.params??BN,a=i?.durationFrames??t.durationFrames,l=I.useMemo(()=>Array.isArray(t.from)?t.from:[t.from],[t.from]),c=I.useMemo(()=>Array.isArray(t.to)?t.to:[t.to],[t.to]),u=l[0]??"",f=c[0]??"",d=I.useMemo(()=>SE(t.ease),[t.ease]),h=EE(t.startFrame,a,d),m=r?.prefix??"",p=I.useCallback(()=>({from:r?.containers.get(`${m}${u}`)??null,to:r?.containers.get(`${m}${f}`)??null}),[r?.containers,r?.revision,m,u,f]),g=I.useMemo(()=>({pairId:`aep:${t.id}`,config:{type:o,name:o,duration:a,ease:"none",params:s},timing:{start:t.startFrame,end:t.startFrame+a,duration:a}}),[t.id,u,f,o,a,s,t.startFrame]),y=I.useCallback(A=>{const M=n.layersById,C=L=>[...new Set(L)].flatMap(D=>{const N=r?.containers.get(`${m}${D}`),F=[...M.keys()].indexOf(D);return N?[{container:N,zIndex:F}]:[]});let k=C(l),w=C(c);if(t.kind==="scene"&&t.includeShared){const L=new Set([...l,...c]),D=[...M.keys()].filter(N=>!L.has(N));k=[...k,...C(D)],w=[...w,...C(D)]}return{fromLayers:k,toLayers:w}},[n.layersById,r?.containers,r?.revision,m,l,c,t.kind,t.includeShared]),_=t.region,v=I.useCallback(()=>{if(_)return _;const A=r?.containers.get(`${m}${u}`),M=r?.containers.get(`${m}${f}`),C=k=>{if(!k)return null;const w=k.getLocalBounds();return{x:w.x,y:w.y,width:w.width,height:w.height}};return Ev([C(A),C(M)])},[_,r?.containers,m,u,f]),x=Math.max(1,Math.round(n.width)),E=Math.max(1,Math.round(n.height)),T=jf({transitionPair:g,width:x,height:E,clock:h,resolveEndpoints:p,getLayerSets:y,hideEndpointsInWindow:t.kind==="element",getRegion:v,fullCanvas:t.kind==="scene"});return R.jsx("pixiContainer",{ref:T,zIndex:Number.MAX_SAFE_INTEGER,sortableChildren:!0})});mh.displayName="AepTransitionMesh";const Wi=I.memo(({transition:t,overrides:e})=>{const n=Br(),r=e??n?.overrides;return r?.[t.id]?.disabled?null:R.jsx(mh,{transition:t,overrides:r})});Wi.displayName="AepTransitionLayer";const UN=({ref:t,...e})=>{const n=pt(),r=Br(),i=hv();if(i+1>Vo)throw new Error(`AEP precomp recursion depth exceeded (max ${Vo})`);const o=n.precomps[e.compId],s=n.framesToSeconds(e.layerInPointFrames),a=I.useMemo(()=>{if(!o)return null;const d=new Map(o.layers.map(p=>[p.id,p])),h=o.fps||n.fps,m=Math.max(0,(n.currentFrame/n.fps-s)*h);return{fps:h,durationInFrames:o.durationInFrames,width:o.width||e.precompWidth,height:o.height||e.precompHeight,assets:wi(n.assets,o.assets),layersById:d,precomps:{...n.precomps,...o.precomps??{}},framesToSeconds:p=>s+p/h,currentFrame:m}},[o,n,s,e.precompWidth,e.precompHeight]);if(!o||!a)return console.warn(`PixiPreComp: compId '${e.compId}' not found in precomps map`),null;const l=e.transformation.anchor,c=typeof l=="number"?l:l.x,u=typeof l=="number"?l:l.y,f={x:c*e.precompWidth,y:u*e.precompHeight};return R.jsx(Je,{...e,pivotOffset:f,ref:t,onContainerRefReady:e.onContainerRefReady,onSpriteRefReady:e.onSpriteRefReady,children:R.jsx("pixiContainer",{x:e.transformation.x,y:e.transformation.y,children:R.jsx(fv,{depth:i+1,children:R.jsx(Es,{overrides:r?.overrides,prefix:`${r?.prefix??""}${e.uniqueId??e.compId}/${e.compId}:`,children:R.jsxs(Si,{value:a,children:[o.layers.map(d=>R.jsx(Ur,{layer:d},d.id)),o.transitions?.map(d=>R.jsx(Wi,{transition:d,overrides:r?.overrides},d.id))]})})})})})},wE=I.memo(UN,rt);function AE(t,e=Vo,n=0){if(n>e)throw new Error(`AEP precomp recursion depth exceeded (max ${e})`);const r=t.precomps??{};for(const i of Object.values(r))AE(i,e,n+1)}function GN(t){const e=new Set;for(const n of t)"trackMatte"in n&&n.trackMatte&&e.add(n.trackMatte.sourceId);return e}const OE=I.createContext(null),jN=({children:t})=>{const e=I.useMemo(()=>({entries:new Map,subscribers:new Set}),[]);return R.jsx(OE.Provider,{value:e,children:t})};function gh(){return I.useContext(OE)}function ME(t){for(const e of t.subscribers)e()}function HN(t,e,n,r){if(!t)return null;let i=t.entries.get(e);return i?(i.width=n,i.height=r):(i={canvas:null,texture:null,width:n,height:r,rev:0},t.entries.set(e,i)),i}function YN(t,e){if(!t)return;const n=t.entries.get(e);n&&(n.texture&&n.texture.dispose(),t.entries.delete(e),ME(t))}function WN(t,e,n,r){if(!t)return;const i=t.entries.get(e);if(!i||!n?.renderer?.extract)return;const o=n.renderer.extract.canvas(r);i.canvas=o,i.texture?(i.texture.image=o,i.texture.needsUpdate=!0):(i.texture=new B.CanvasTexture(o),i.texture.flipY=!0,i.texture.minFilter=B.LinearFilter,i.texture.magFilter=B.LinearFilter),i.rev+=1,ME(t)}function IE(t){const e=gh(),[,n]=I.useReducer(r=>r+1,0);return I.useEffect(()=>{if(e)return e.subscribers.add(n),()=>{e.subscribers.delete(n)}},[e]),e?.entries.get(t)??null}const yh=new Map,XN=4;function zN(t,e){return`${Math.round(t)}x${Math.round(e)}`}let qN=(t,e)=>K.RenderTexture.create({width:t,height:e});function VN(t,e){const n=zN(t,e),r=yh.get(n)??[],i=r.find(s=>!s.inUse);if(i)return i.inUse=!0,i.texture;const o=qN(t,e);if(r.push({texture:o,inUse:!0}),r.length>XN){const s=r.findIndex(a=>!a.inUse);if(s>=0){const[a]=r.splice(s,1);try{a.texture.destroy(!0)}catch{}}}return yh.set(n,r),o}function KN(t){for(const e of yh.values())for(const n of e)if(n.texture===t){n.inUse=!1;return}}function CE(t,e){const n=I.useMemo(()=>VN(t,e),[t,e]);return I.useEffect(()=>()=>KN(n),[n]),n}const _h=({layer:t})=>{const e=pt(),n=Br(),{app:r}=st.useApplication(),i=gh(),o=e.precomps[t.compId],s=I.useRef(null),a=CE(o?.width??t.width,o?.height??t.height),l=I.useMemo(()=>{if(!o)return null;const c=new Map(o.layers.map(h=>[h.id,h])),u=o.fps||e.fps,f=e.framesToSeconds(t.inPoint),d=Math.max(0,(e.currentFrame/e.fps-f)*u);return{fps:u,durationInFrames:o.durationInFrames,width:o.width||t.width,height:o.height||t.height,assets:wi(e.assets,o.assets),layersById:c,precomps:o.precomps??{},framesToSeconds:h=>f+h/u,currentFrame:d}},[o,e,t.inPoint,t.width,t.height]);return I.useEffect(()=>(HN(i,t.id,o?.width??t.width,o?.height??t.height),()=>{YN(i,t.id)}),[i,t.id,o?.width,o?.height,t.width,t.height]),st.useTick(()=>{!r||!s.current||!a||(r.renderer.render({container:s.current,target:a}),WN(i,t.id,r,a))}),!o||!l?null:R.jsx("pixiContainer",{ref:s,renderable:!1,children:R.jsx(Es,{overrides:n?.overrides,prefix:`${n?.prefix??""}${t.id}/${t.compId}:`,children:R.jsxs(Si,{value:l,children:[o.layers.map(c=>R.jsx(Ur,{layer:c},c.id)),o.transitions?.map(c=>R.jsx(Wi,{transition:c,overrides:n?.overrides},c.id))]})})})};_h.displayName="AepPrecompRenderer";function $N({onReady:t}){const e=NT(),n=I.useRef(!1);return I.useEffect(()=>{!e||n.current||(n.current=!0,t?.())},[e,t]),null}function ZN(t,e){const[n,r]=I.useState(()=>{if(typeof t!="string")try{return qo(t)}catch(i){return e?.(i),null}return null});return I.useEffect(()=>{if(typeof t!="string")return;let i=!1;return fetch(t).then(o=>o.json()).then(o=>{if(!i)try{r(qo(o))}catch(s){e?.(s)}}).catch(o=>{i||e?.(o)}),()=>{i=!0}},[t,e]),n}const RE=I.memo(({src:t,assetMap:e,assetResolver:n,currentFrame:r,onReady:i,onError:o,theme:s,textOverrides:a,transitionOverrides:l,onRenderReady:c,onLayerError:u,onStageLayout:f})=>{const d=ZN(t,o),h=I.useMemo(()=>Mf(d?.theme,s),[d?.theme,s]);I.useEffect(()=>{d&&i?.(d)},[d,i]);const m=pv(d?.fps??30),p=r??m,g=I.useMemo(()=>{if(!d)return null;const w=new Map(d.layers.map(L=>[L.id,L]));return{fps:d.fps,durationInFrames:d.durationInFrames,width:d.width,height:d.height,assets:wi(d.assets,e),layersById:w,precomps:d.precomps??{},framesToSeconds:L=>L/d.fps,currentFrame:p}},[d,e,p]),{app:y}=st.useApplication();if(!d||!g)return null;let _;try{_=y?.screen}catch{_=void 0}const v=_?.width??d.width,x=_?.height??d.height,E=Math.min(v/d.width,x/d.height),T=(v-d.width*E)/2,A=(x-d.height*E)/2,M=n??Vf,C=GN(d.layers),k=d.layers.filter(w=>w.kind==="precomp"&&"is3D"in w&&w.is3D===!0);return R.jsxs(FT,{onLayerError:u,children:[R.jsx($N,{onReady:c}),R.jsx(IT,{resolver:M,children:R.jsx(Of,{value:h,children:R.jsx(S1,{value:a,children:R.jsx(Si,{value:g,children:R.jsx(_E,{onStageLayout:f,children:R.jsxs(Es,{overrides:l,prefix:"",children:[R.jsxs("pixiContainer",{x:T,y:A,scale:E,sortableChildren:!0,children:[d.layers.filter(w=>!C.has(w.id)).map(w=>R.jsx(Ur,{layer:w},w.id)),d.transitions?.map(w=>R.jsx(Wi,{transition:w,overrides:l},w.id))]}),k.map(w=>R.jsx(_h,{layer:w},`rt-${w.id}`))]})})})})})})]},d.id)});RE.displayName="AepComposition";const LE={x:0,y:0,z:0,rx:0,ry:0,rz:0,sx:1,sy:1,sz:1,alpha:1};function kE(t,e){const n=_=>_*Math.PI/180,r=Math.cos(n(e.rx)),i=Math.sin(n(e.rx)),o=Math.cos(n(e.ry)),s=Math.sin(n(e.ry)),a=Math.cos(n(e.rz)),l=Math.sin(n(e.rz));let c=t.x,u=t.y,f=t.z;const d=a*c-l*u,h=l*c+a*u;c=d,u=h;const m=o*c+s*f,p=-s*c+o*f;c=m,f=p;const g=r*u-i*f,y=i*u+r*f;return u=g,f=y,{x:c,y:u,z:f}}function PE(t,e){const n={x:e.x*t.sx,y:e.y*t.sy,z:e.z*t.sz},r=kE(n,t);return{x:t.x+r.x,y:t.y+r.y,z:t.z+r.z,rx:t.rx+e.rx,ry:t.ry+e.ry,rz:t.rz+e.rz,sx:t.sx*e.sx,sy:t.sy*e.sy,sz:t.sz*e.sz,alpha:t.alpha*e.alpha}}function Xi(t){const{layersById:e,currentFrame:n}=pt();return I.useMemo(()=>{const r=kT(t,e);let i={...LE};for(let o=r.length-1;o>=0;o--){const s=r[o],a=JN(s,n);i=PE(i,a)}return{position:[i.x,i.y,i.z],rotationEuler:[i.rx,i.ry,i.rz],scale:[i.sx,i.sy,i.sz],alpha:i.alpha}},[t,e,n])}function JN(t,e){return t.kind==="camera"||t.kind==="light"||"is3D"in t&&t.is3D===!0&&t.transform3D?DE(t.transform3D,e):Tt(t)?{x:0,y:0,z:0,rx:0,ry:0,rz:0,sx:1,sy:1,sz:1,alpha:1}:QN(t.transform,e)}function DE(t,e){const[n,r,i]=wt(t.position,[0,0,0],e),[o,s,a]=wt(t.rotation,[0,0,0],e),[l,c]=pn(t.scale,[1,1],e),u=ge(t.opacity,1,e);return{x:n,y:r,z:i,rx:o,ry:s,rz:a,sx:l,sy:c,sz:1,alpha:u}}function QN(t,e){const[n,r]=pn(t.position,[0,0],e),[i,o]=pn(t.scale,[1,1],e);return{x:n,y:r,z:0,rx:0,ry:0,rz:ge(t.rotation,0,e),sx:i,sy:o,sz:1,alpha:ge(t.opacity,1,e)}}const bh=({passes:t,currentFrame:e})=>{if(!t||t.length===0)return null;const n=t.filter(r=>r.enabled!==!1).map((r,i)=>t2(r,e,i)).filter(Boolean);return n.length===0?null:R.jsx(cr.EffectComposer,{children:n})};bh.displayName="Aep3DPostFx";function _n(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:ge(i,n,r)}function e2(t,e,n,r){const i=t[e];return i===void 0||typeof i=="boolean"||typeof i=="string"?n:Array.isArray(i)&&i.length===2&&typeof i[0]=="number"?[i[0],i[1]]:pn(i,n,r)}function t2(t,e,n){const r=t.params;switch(t.name){case"bloom":return R.jsx(cr.Bloom,{intensity:_n(r,"intensity",1,e),luminanceThreshold:_n(r,"luminanceThreshold",.9,e),radius:_n(r,"radius",.6,e)},n);case"chromaticAberration":{const[i,o]=e2(r,"offset",[.002,.002],e);return R.jsx(cr.ChromaticAberration,{offset:new Lh.Vector2(i,o),modulationOffset:0,radialModulation:!1},n)}case"vignette":return R.jsx(cr.Vignette,{darkness:_n(r,"darkness",.5,e),offset:_n(r,"offset",.5,e)},n);case"noise":return R.jsx(cr.Noise,{opacity:_n(r,"intensity",.15,e),premultiply:r.premultiply===!0},n);case"cameraLensBlur":return R.jsx(cr.DepthOfField,{focusDistance:_n(r,"focusDistance",.02,e),focalLength:_n(r,"focalLength",.05,e),bokehScale:_n(r,"bokehScale",2,e)},n);default:return null}}function NE(t){const e=new B.Shape;switch(t.kind){case"rect":{const n=Gr(t.size,[100,100]),[r,i]=n,o=r/2,s=i/2;return e.moveTo(-o,-s),e.lineTo(o,-s),e.lineTo(o,s),e.lineTo(-o,s),e.closePath(),e}case"ellipse":{const n=Gr(t.size,[100,100]),[r,i]=n;return e.absellipse(0,0,r/2,i/2,0,Math.PI*2,!1,0),e}case"polystar":{const n=Gr(t.points,5),r=Gr(t.outerRadius??50,50),i=Gr(t.innerRadius??20,20),o=t.starType==="star",s=o?n*2:n;for(let a=0;a<s;a++){const l=-Math.PI/2+a/s*Math.PI*2,c=o?a%2===0?r:i:r,u=c*Math.cos(l),f=c*Math.sin(l);a===0?e.moveTo(u,f):e.lineTo(u,f)}return e.closePath(),e}case"bezier":{const n=Gr(t.path,n2());return r2(n,e),e}default:return e}}function n2(){return{vertices:[],inTangents:[],outTangents:[],closed:!1}}function r2(t,e){const n=t.vertices,r=t.inTangents,i=t.outTangents;if(n.length){e.moveTo(n[0][0],n[0][1]);for(let o=1;o<n.length;o++){const s=n[o-1],a=n[o],l=i[o-1]??[0,0],c=r[o]??[0,0];e.bezierCurveTo(s[0]+l[0],s[1]+l[1],a[0]+c[0],a[1]+c[1],a[0],a[1])}if(t.closed&&n.length>2){const o=n[n.length-1],s=n[0],a=i[n.length-1]??[0,0],l=r[0]??[0,0];e.bezierCurveTo(o[0]+a[0],o[1]+a[1],s[0]+l[0],s[1]+l[1],s[0],s[1]),e.closePath()}}}function Gr(t,e){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]?t[0].v:t??e}function FE(t){return JSON.stringify(t)}const vh=({path:t,fill:e="#88ccff",extrusion:n,currentFrame:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=xh(ge(n.depth,1,r),.01),c=n.bevelThickness?xh(ge(n.bevelThickness,0,r),.01):0,u=n.bevelSize?xh(ge(n.bevelSize,0,r),.01):0,f=nr(),d=Qn(e,f),h=At(d,"#88ccff",r),m=I.useMemo(()=>{const p=NE(t),g={depth:l,bevelEnabled:n.bevelEnabled!==!1&&(c>0||u>0),bevelThickness:c,bevelSize:u,bevelSegments:n.bevelSegments??2,curveSegments:n.curveSegments??12};return new B.ExtrudeGeometry(p,g)},[FE(t),l,c,u,n.bevelEnabled,n.bevelSegments,n.curveSegments]);return I.useEffect(()=>()=>{m.dispose()},[m]),R.jsxs("mesh",{position:i,rotation:o,scale:s,children:[R.jsx("primitive",{object:m,attach:"geometry"}),R.jsx("meshStandardMaterial",{color:h,transparent:a<1,opacity:a,metalness:n.sideMaterial?.metalness??.1,roughness:n.sideMaterial?.roughness??.6})]})};vh.displayName="Aep3DShapeMesh";function xh(t,e){return Math.round(t/e)*e}const i2={get:()=>{}},BE=I.createContext(i2),UE=({value:t,children:e})=>R.jsx(BE.Provider,{value:t,children:e});function GE(t){const e=I.useContext(BE);if(t)return e.get(t)}class jE{map=new Map;set(e,n){this.map.set(e,n)}get(e){return this.map.get(e)}has(e){return this.map.has(e)}}function o2(t){if(t<=64)return 64;let e=64;for(;e<t;)e<<=1;return e}const jr=new B.Matrix4;function s2(t){return new B.ShaderMaterial({vertexShader:Iv,fragmentShader:Cv,uniforms:{uAtlas:{value:t.texture},uDistanceRange:{value:t.distanceRange}},transparent:!0,depthWrite:!1})}const a2=new B.PlaneGeometry(1,1),Th=({layer:t,atlas:e,currentFrame:n,position:r,rotation:i,scale:o,opacity:s})=>{const a=nr(),l=Li(t.id),c=I.useMemo(()=>l===void 0?t:{...t,source:l},[t,l]),u=ns(c,n,{theme:a}),f=ge(t.style.size,24,n),d=t.style.fill?At(Qn(t.style.fill,a),"#ffffff",n):"#ffffff",h=t.animators??[],m=I.useMemo(()=>h.map(T=>ge(T.amount,1,n)),[h,n]),p=I.useMemo(()=>rs(h,u.glyphs,m),[h,u.glyphs.length,m]),g=I.useMemo(()=>u.glyphs.filter(T=>!T.isWhitespace),[u.glyphs]),y=o2(g.length),_=I.useMemo(()=>s2(e),[e]),v=I.useRef(null),x=I.useRef(null),E=I.useRef(null);return I.useEffect(()=>{const T=v.current;if(!T)return;const A=new Float32Array(y*4),M=new Float32Array(y*4),C=new B.InstancedBufferAttribute(A,4),k=new B.InstancedBufferAttribute(M,4);return C.setUsage(B.DynamicDrawUsage),k.setUsage(B.DynamicDrawUsage),T.geometry.setAttribute("aUvRect",C),T.geometry.setAttribute("aColor",k),x.current=C,E.current=k,()=>{T.geometry.deleteAttribute("aUvRect"),T.geometry.deleteAttribute("aColor"),x.current=null,E.current=null}},[y]),As.useFrame(()=>{const T=v.current,A=x.current,M=E.current;if(!T||!A||!M)return;let C=0;for(let L=0;L<p.length;L++){const D=p[L]?.opacity??0;D>C&&(C=D)}if(s+C<=.01)return;const k=u.bounds.width/2,w=u.bounds.height/2;for(let L=0;L<g.length;L++){const D=g[L],N=e.glyphs.get(D.char);if(!N){jr.makeScale(0,0,0),T.setMatrixAt(L,jr);continue}const F=p[D.charIndex]??{position:[0,0],scale:[0,0],rotation:0,opacity:0};Dv(jr,N,{x:D.x,y:D.y,bounds:{width:k*2,height:w*2}},f,F),T.setMatrixAt(L,jr);const H=L*4;A.array[H]=N.uv[0],A.array[H+1]=N.uv[1],A.array[H+2]=N.uv[2],A.array[H+3]=N.uv[3];const V=t.style.runs?.[D.runIndex]?.fill,$=(typeof V=="string"?V:void 0)??d,re=Math.max(0,Math.min(1,s+F.opacity)),he=Nv($,re),q=L*4;M.array[q]=he[0],M.array[q+1]=he[1],M.array[q+2]=he[2],M.array[q+3]=he[3]}for(let L=g.length;L<y;L++)jr.makeScale(0,0,0),T.setMatrixAt(L,jr);T.instanceMatrix.needsUpdate=!0,A.needsUpdate=!0,M.needsUpdate=!0}),R.jsx("group",{position:r,rotation:i,scale:o,children:R.jsx("instancedMesh",{ref:v,args:[a2,_,y],frustumCulled:!1})})};Th.displayName="AepMsdfTextMesh";const Eh=({layer:t,extrusion:e,currentFrame:n,fontUrl:r,position:i,rotation:o,scale:s,opacity:a})=>{const l=nr(),c=Li(t.id),u=I.useMemo(()=>c===void 0?t:{...t,source:c},[t,c]),f=GE(t.style.font),d=e?.depth!=null&&ge(e.depth,0,n)>0,h=e?.depth?ge(e.depth,1,n):1,m=e?.bevelThickness?ge(e.bevelThickness,0,n):0,p=e?.bevelSize?ge(e.bevelSize,0,n):0,g=c1(r),y=ns(u,n,{boxWidth:t.style.boxWidth,metrics:g,theme:l});if(f&&!d)return R.jsx(Th,{layer:u,atlas:f,currentFrame:n,position:i,rotation:o,scale:s,opacity:a});const _=ge(t.style.size,24,n),v=t.style.fill?At(Qn(t.style.fill,l),"#ffffff",n):"#ffffff",x={font:r,size:_,height:h,bevelEnabled:m>0||p>0,bevelThickness:m,bevelSize:p,curveSegments:e?.curveSegments??12},E=t.animators??[],T=(t.style.runs?.length??0)>0;if(!(E.length>0||T||t.splitMode!=null&&t.splitMode!=="single"))return R.jsx("group",{position:i,rotation:o,scale:s,children:R.jsxs(kh.Text3D,{...x,children:[y.glyphs.map(L=>L.char).join(""),R.jsx("meshStandardMaterial",{color:v,transparent:a<1,opacity:a})]})});const M=E.map(L=>ge(L.amount,1,n)),C=rs(E,y.glyphs,M),k=y.bounds.width/2,w=y.bounds.height/2;return R.jsx("group",{position:i,rotation:o,scale:s,children:y.glyphs.map((L,D)=>{if(L.isWhitespace)return null;const N=C[D],F=t.style.runs?.[L.runIndex]?.fill,H=(typeof F=="string"?F:void 0)??v,V=L.x-k+N.position[0],$=-(L.y-w)+N.position[1],re=1+N.scale[0],he=1+N.scale[1],q=-N.rotation*Math.PI/180,fe=Math.max(0,Math.min(1,a+N.opacity)),Y=t.style.runs?.[L.runIndex],te=Y?.size!=null?typeof Y.size=="number"?Y.size:ge(Y.size,_,n):_;return R.jsx("group",{position:[V,$,0],scale:[re,he,1],rotation:[0,0,q],children:R.jsxs(kh.Text3D,{...x,size:te,children:[L.char,R.jsx("meshStandardMaterial",{color:H,transparent:fe<1,opacity:fe})]})},L.charIndex)})})};Eh.displayName="Aep3DTextMesh";const c2=t=>[t[0],-t[1],-t[2]],l2=t=>{const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]},Sh=({layer:t,zOrder:e})=>{const n=Xi(t),r=IE(t.id),[i,o,s]=c2(n.position),a=s+e*.001,[l,c,u]=l2(n.rotationEuler),[f,d]=[n.scale[0],n.scale[1]],h=r?.width??t.width,m=r?.height??t.height;return R.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[R.jsx("planeGeometry",{args:[h,m]}),R.jsx("meshBasicMaterial",{map:r?.texture??null,color:r?.texture?"#ffffff":"#1a2030",transparent:!0,opacity:n.alpha})]})};Sh.displayName="Aep3DPrecompPlane";function u2(t){const e=I.useRef(null);e.current===null&&(e.current=new jE);const n=e.current,[r,i]=I.useState(0);return I.useEffect(()=>{if(!t?.fonts3D)return;let o=!1;for(const[s,a]of Object.entries(t.fonts3D))a.msdf&&(n.has(s)||Mv(a.msdf.json,{pngUrl:a.msdf.png}).then(l=>{o||(n.set(s,l),i(c=>c+1))}).catch(l=>{o||console.warn(`[useMsdfAtlasRegistry] failed to load atlas for "${s}":`,l)}));return()=>{o=!0}},[t,n]),{registry:n,ready:r}}function HE(t,e){const n=[...t??[]];if(!e||e.disableCameraDoF)return n;const r=n.some(o=>o.name==="cameraLensBlur"),i=e.focusDistance!==void 0||e.aperture!==void 0||e.blurLevel!==void 0;return!r&&i&&n.unshift({name:"cameraLensBlur",params:{focusDistance:e.focusDistance??.02,focalLength:e.aperture??.05,bokehScale:e.blurLevel??2}}),n}const YE=({comp:t,currentFrame:e,width:n,height:r,background:i="transparent",disabled:o,theme:s})=>{const a=I.useMemo(()=>Mf(t.theme,s),[t.theme,s]),{cameras:l,lights:c,threeDLayers:u,hasAny:f}=I.useMemo(()=>d2(t.layers),[t.layers]),d=l[0],h=I.useMemo(()=>HE(t.postFx,d),[t.postFx,d]),m=I.useMemo(()=>{const y=new Map(t.layers.map(_=>[_.id,_]));return{fps:t.fps,durationInFrames:t.durationInFrames,width:t.width,height:t.height,assets:wi(t.assets,void 0),layersById:y,precomps:t.precomps??{},framesToSeconds:_=>_/t.fps,currentFrame:e}},[t,e]),{registry:p,ready:g}=u2(t);return o||!f?null:R.jsx(Y_,{width:n,height:r,background:i,defaultLights:c.length===0,children:R.jsx(UE,{value:p,children:R.jsx(Of,{value:a,children:R.jsxs(Si,{value:m,children:[d&&R.jsx(f2,{camera:d,currentFrame:e}),c.map(y=>R.jsx(h2,{light:y,currentFrame:e},y.id)),u.map((y,_)=>R.jsx(p2,{layer:y,currentFrame:e,zOrder:_},y.id)),R.jsx(bh,{passes:h,currentFrame:e})]})})},`msdf-${g}`)})};YE.displayName="Aep3DScene";function d2(t){const e=[],n=[],r=[];for(const i of t)i.kind==="camera"?e.push(i):i.kind==="light"?n.push(i):"is3D"in i&&i.is3D===!0&&r.push(i);return{cameras:e,lights:n,threeDLayers:r,hasAny:e.length+n.length+r.length>0}}function wh(t){return[t[0],-t[1],-t[2]]}function WE(t){const e=n=>n*Math.PI/180;return[e(t[0]),e(-t[1]),e(-t[2])]}const f2=({camera:t,currentFrame:e})=>{const{camera:n}=As.useThree(),r=Xi(t);return I.useEffect(()=>{if(!(n instanceof B.PerspectiveCamera))return;const[i,o,s]=wh(r.position);n.position.set(i,o,s);const[a,l,c]=WE(r.rotationEuler);n.rotation.set(a,l,c),n.fov=ge(t.fov,50,e),n.updateProjectionMatrix()}),null},h2=({light:t,currentFrame:e})=>{const n=Xi(t),[r,i,o]=wh(n.position),s=ge(t.intensity,1,e),a=At(t.color,"#ffffff",e),l=new B.Color(a);switch(t.lightType){case"ambient":return R.jsx("ambientLight",{color:l,intensity:s});case"point":return R.jsx("pointLight",{color:l,intensity:s,position:[r,i,o]});case"spot":{const c=t.coneAngle?ge(t.coneAngle,90,e):90,u=t.coneFeather?ge(t.coneFeather,50,e):50;return R.jsx("spotLight",{color:l,intensity:s,position:[r,i,o],angle:c/2*(Math.PI/180),penumbra:u/100})}default:return R.jsx("directionalLight",{color:l,intensity:s,position:[r,i,o]})}},p2=({layer:t,currentFrame:e,zOrder:n})=>{const r=Xi(t),[i,o,s]=wh(r.position),a=s+n*.001,[l,c,u]=WE(r.rotationEuler),[f,d]=[r.scale[0],r.scale[1]],h=r.alpha;if(t.kind==="precomp")return R.jsx(Sh,{layer:t,zOrder:n});if(t.kind==="shape"&&"extrusion"in t&&t.extrusion)return R.jsx(vh,{path:t.path,fill:t.fill??"#88ccff",extrusion:t.extrusion,currentFrame:e,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h});if(t.kind==="text"){const p=t.style.font,y=typeof p=="string"&&(p.endsWith(".json")||p.includes("/"))?p:"/fonts/helvetiker_regular.typeface.json",_="extrusion"in t&&t.extrusion?t.extrusion:void 0;return R.jsx(Eh,{layer:t,extrusion:_,currentFrame:e,fontUrl:y,position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],opacity:h})}const m=m2(t);return R.jsxs("mesh",{position:[i,o,a],rotation:[l,c,u],scale:[f,d,1],children:[R.jsx("planeGeometry",{args:[1,1]}),R.jsx("meshStandardMaterial",{color:m,transparent:!0,opacity:h})]})};function m2(t){return t.kind==="shape"&&typeof t.fill=="string"?t.fill:"#88ccff"}function g2(){const t=document.createElement("canvas");t.width=1,t.height=1;const e=new B.CanvasTexture(t);return e.flipY=!1,e.minFilter=B.LinearFilter,e.magFilter=B.LinearFilter,{texture:e,refresh:(i,o)=>{if(!i?.renderer?.extract)return;const s=i.renderer.extract.canvas(o);e.image=s,e.needsUpdate=!0},dispose:()=>{e.dispose()}}}function y2(t,e){const n={id:t.id,kind:"prop3d",stage:e,role:"product",inPoint:t.inPoint,outPoint:t.outPoint,source:t.source,size:.4,position:[0,0,0]};return t.name!==void 0&&(n.name=t.name),t.startTime!==void 0&&(n.startTime=t.startTime),t.hidden!==void 0&&(n.hidden=t.hidden),t.textures&&(n.textures=t.textures),t.view?.rotation!==void 0&&(n.rotation=t.view.rotation),n}var XE=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t))(XE||{});const _2=[{label:"Freeform",ratio:null},{label:"1 : 1",ratio:1},{label:"16 : 9",ratio:16/9},{label:"9 : 16",ratio:9/16},{label:"4 : 3",ratio:4/3},{label:"3 : 2",ratio:3/2},{label:"2 : 3",ratio:2/3}],b2=20,Ss=t=>Array.isArray(t)?t[0]:t;function zE(t,e){if(!(!t||!e))return[Ss(t.x),Ss(t.y),Ss(e.x),Ss(e.y)]}function Xe(t,e){if(!t)return;if(t.a===0)return e(t.k);const n=t.k;if(n?.length)return n.map((r,i)=>{const o=n[i+1],s=o?zE(r.o,o.i):void 0;return{t:r.t,v:e(r.s),easeOut:s,hold:r.h===1?!0:void 0}})}const Qt=t=>Array.isArray(t)?t[0]:t,bn=t=>{const e=Array.isArray(t)?t:[t,t];return[e[0],e[1]]},qE=t=>{const[e,n]=bn(t);return[e/100,n/100]},VE=t=>(Array.isArray(t)?t[0]:t)/100;function KE(t){return{vertices:(t.v??[]).map(e=>[e[0],e[1]]),inTangents:(t.i??[]).map(e=>[e[0],e[1]]),outTangents:(t.o??[]).map(e=>[e[0],e[1]]),closed:t.c===!0}}function v2(t){if(!t)return;if(t.a===0)return KE(t.k);const e=t.k;if(e?.length)return e.map((n,r)=>{const i=e[r+1],o=i?zE(n.o,i.i):void 0,s=Array.isArray(n.s)?n.s[0]:n.s;return{t:n.t,v:KE(s??{}),easeOut:o,hold:n.h===1?!0:void 0}})}const $E=[0,0],x2=[1,1];function ir(t){const e=Xe(t?.p,bn)??$E,n=Xe(t?.a,bn)??$E,r=Xe(t?.s,qE)??x2,i=Xe(t?.r,Qt)??0,o=Xe(t?.o,VE)??1,s={position:e,anchor:n,scale:r,rotation:i,opacity:o},a=Xe(t?.sk,Qt);a!==void 0&&(s.skew=a);const l=Xe(t?.sa,Qt);return l!==void 0&&(s.skewAxis=l),s}function Pn(t){const e=o=>Math.max(0,Math.min(255,Math.round(o*255))).toString(16).padStart(2,"0"),n=e(t[0]??0),r=e(t[1]??0),i=e(t[2]??0);return t.length===4&&t[3]!==void 0&&t[3]<1?`#${n}${r}${i}${e(t[3])}`:`#${n}${r}${i}`}function zi(t,e){return t?Xe(t,Qt)??e:e}function Ah(t,e=[0,0,0]){return t?Xe(t,r=>Array.isArray(r)?[r[0]??0,r[1]??0,r[2]??0]:e)??e:e}function T2(t,e="#ffffff"){return t?Xe(t,r=>{if(!Array.isArray(r))return e;const[i,o,s]=r;return Pn([i??1,o??1,s??1])})??e:e}function E2(t,e,n,r){if(!Array.isArray(t)&&typeof e=="number"&&typeof n=="number"&&typeof r=="number"){const[o,s,a]=t;return[o+e,s+n,a+r]}return t}function S2(t){return t.ty===13}function w2(t){return t.ty===14}function ZE(){return{position:[0,0],anchor:[0,0],scale:[1,1],rotation:0,opacity:1}}function Oh(t){const e=Ah(t?.or),n=zi(t?.rx,0),r=zi(t?.ry,0),i=zi(t?.rz??t?.r,0),o=Xe(t?.s??{a:0,k:[100,100,100]},a=>{const l=Array.isArray(a)?a:[100,100,100];return[(l[0]??100)/100,(l[1]??100)/100]})??[1,1],s=Xe(t?.o??{a:0,k:100},a=>(Array.isArray(a)?a[0]:a)/100)??1;return{position:Ah(t?.p),anchor:Ah(t?.a),scale:o,rotation:E2(e,n,r,i),opacity:s}}function JE(t,e){return{id:e,name:t.nm,inPoint:t.ip,outPoint:t.op,...typeof t.st=="number"&&{startTime:t.st},...typeof t.parent=="number"&&{parent:`layer_${t.parent}`},...t.hd===1&&{hidden:!0}}}function A2(t,e){const n=t.pe?Xe(t.pe,r=>{const i=Array.isArray(r)?r[0]:r;return typeof i=="number"?i:50})??50:50;return{kind:"camera",...JE(t,e),transform:ZE(),transform3D:Oh(t.ks),fov:n}}function O2(t){switch(t){case 1:return"parallel";case 2:return"spot";case 3:return"point";default:return"ambient"}}function M2(t,e){const n=O2(t.lt),r={kind:"light",...JE(t,e),transform:ZE(),transform3D:Oh(t.ks),lightType:n,intensity:Xe(t.in??{a:0,k:100},i=>{const o=Array.isArray(i)?i[0]:i;return typeof o=="number"?o/100:1})??1,color:T2(t.cl)};return n==="spot"&&(t.ca&&(r.coneAngle=zi(t.ca,90)),t.cf&&(r.coneFeather=zi(t.cf,50))),r}function QE(t){if(!t||typeof t!="object")return;const e=t.__aepPostFx;if(!Array.isArray(e))return;const n=[];for(const r of e){const i=Ad.safeParse(r);i.success?n.push(i.data):console.warn("bodymovin: dropping invalid __aepPostFx entry",i.error.issues[0]?.message)}return n.length>0?n:void 0}function eS(t){if(!t||typeof t!="object")return;const e=t.__aepExtrusion;if(!(!e||typeof e!="object"))return e}function I2(t){if(!t||typeof t!="object")return;const e=t.runs;if(!Array.isArray(e)||e.length===0)return;const n=[];for(const r of e){if(typeof r.from!="number"||typeof r.to!="number"||r.to<=r.from)continue;const i={from:r.from,to:r.to};typeof r.font=="string"&&(i.font=r.font),typeof r.size=="number"&&(i.size=r.size),Array.isArray(r.fc)&&r.fc.length===3&&(i.fill=Pn(r.fc)),(typeof r.weight=="number"||typeof r.weight=="string")&&(i.weight=r.weight),typeof r.italic=="boolean"&&(i.italic=r.italic),typeof r.tr=="number"&&typeof r.size=="number"?i.tracking=r.tr/1e3*r.size:typeof r.tr=="number"&&(i.tracking=r.tr/1e3),typeof r.bs=="number"&&(i.baselineShift=r.bs),n.push(i)}return n.length>0?n:void 0}function or(t){return typeof t.ind=="number"?`layer_${t.ind}`:(t.nm??"layer").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"layer"}function Hr(t){return{id:or(t),name:t.nm,inPoint:t.ip,outPoint:t.op,startTime:t.st,parent:typeof t.parent=="number"?`layer_${t.parent}`:void 0,hidden:t.hd===1?!0:void 0}}function tS(t){const e=[];for(const n of t)n.ty==="gr"&&n.it?e.push(...tS(n.it)):e.push(n);return e}function C2(t){switch(t.ty){case"rc":{const e=Xe(t.s,bn)??[0,0],n=Xe(t.p,bn),r=Xe(t.r,Qt);return{kind:"rect",size:e,...n!==void 0&&{position:n},...r!==void 0&&{roundness:r}}}case"el":{const e=Xe(t.s,bn)??[0,0],n=Xe(t.p,bn);return{kind:"ellipse",size:e,...n!==void 0&&{position:n}}}case"sr":{const e=Xe(t.pt,Qt)??5,n=Xe(t.or,Qt)??0,r=Xe(t.ir,Qt),i=Xe(t.r,Qt),o=Xe(t.p,bn);return{kind:"polystar",starType:t.sy===2?"polygon":"star",points:e,outerRadius:n,...r!==void 0&&{innerRadius:r},...i!==void 0&&{rotation:i},...o!==void 0&&{position:o}}}case"sh":{const e=v2(t.ks);return e===void 0?null:{kind:"bezier",path:e}}default:return null}}function R2(t){if(t?.c)return t.c.a===0?Pn(t.c.k):Pn(t.c.k[0].s)}function L2(t,e,n){const r=R2(t);if(r===void 0)return;const i=t?.c?.x;if(!i||!n)return r;const o=n(e,i);return o?{themeKey:o,default:r}:r}function k2(t,e){const n=tS(t.shapes),r=n.map(C2).filter(l=>l!==null);if(r.length===0)return[];const i=L2(n.find(l=>l.ty==="fl"),t.nm??"",e.resolveColorControl),o=or(t),s=Hr(t),a=ir(t.ks);return r.map((l,c)=>({kind:"shape",...s,id:c===0?s.id:`${o}_path_${c}`,...t.nm&&c>0&&{name:`${t.nm} / path ${c+1}`},transform:a,path:l,...i!==void 0&&{fill:i}}))}function P2(t){return{kind:"shape",...Hr(t),transform:ir(t.ks),path:{kind:"rect",size:[t.sw,t.sh]},fill:t.sc}}function D2(t){return{kind:"null",...Hr(t),transform:ir(t.ks)}}function N2(t){return{kind:"image",...Hr(t),assetId:t.refId,transform:ir(t.ks)}}function F2(t){return{kind:"precomp",...Hr(t),compId:t.refId,width:t.w,height:t.h,transform:ir(t.ks)}}function B2(t){const e=t.t?.d?.k?.[0]?.s;if(!e)return null;const n=I2(e),r={font:e.f,size:e.s,align:e.j===1?"right":e.j===2?"center":"left",...e.fc&&{fill:Pn(e.fc)},...e.lh!==void 0&&{lineHeight:e.lh},...e.tr!==void 0&&{letterSpacing:e.tr/1e3},...e.sc&&e.sw!==void 0&&{stroke:{color:Pn(e.sc),width:e.sw}},...n!==void 0&&{runs:n}};return{kind:"text",...Hr(t),transform:ir(t.ks),source:e.t,style:r}}function U2(t){switch(t.ty){case 0:return F2(t);case 1:return P2(t);case 2:return N2(t);case 3:return D2(t);case 5:return B2(t);default:return null}}function nS(t,e={}){if(S2(t))return[A2(t,or(t))];if(w2(t))return[M2(t,or(t))];let n;if(t.ty===4)n=k2(t,e);else{const r=U2(t);n=r?[r]:[]}return n.length===0?[]:n.map(r=>{if(r.kind==="camera"||r.kind==="light")return r;let i=r;if(t.ddd===1&&(i=j2(i,t)),e.matteSourceId&&t.tt!=null){const o=G2(t.tt);o&&(i.trackMatte={sourceId:e.matteSourceId,mode:o})}if(i.kind==="shape"||i.kind==="text"){const o=eS(t);o&&(i.extrusion=o)}return i})}function G2(t){switch(t){case 1:return"alpha";case 2:return"alpha-inverted";case 3:return"luma";case 4:return"luma-inverted";default:return null}}function j2(t,e){if(t.kind==="camera"||t.kind==="light")return t;const n=e.ks;return n?{...t,is3D:!0,transform3D:Oh(n)}:t}const at={precomp:0,solid:1,image:2,null:3,shape:4,text:5,audio:6,video:9,camera:13,light:14},H2=new Set([at.precomp,at.solid,at.image,at.null,at.shape,at.text,at.audio,at.video]),Y2=new Set([20,21,22,23,24,25,26,27,28,29,31,32,33,34]);function Mt(t){if(!t||typeof t!="object")return[];const e=t.layers;return Array.isArray(e)?e:[]}function mt(t){if(!t||typeof t!="object")return;const e=t.nm;return typeof e=="string"?e:void 0}function Mh(t,e,n=""){if(!t||typeof t!="object")return;if(Array.isArray(t)){t.forEach((i,o)=>Mh(i,e,`${n}[${o}]`));return}const r=t;("k"in r||"x"in r)&&e(r,n);for(const i of Object.keys(r))Mh(r[i],e,n?`${n}.${i}`:i)}const W2=[{id:"unsupported-layer-kind",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"unsupported-layer-kind"))return;const i=n.ty;if(typeof i!="number"){e.push({severity:"error",message:`Layer ${r} has no numeric \`ty\` — not a valid Bodymovin layer.`,layerIndex:r,layerName:mt(n)});return}i===at.camera||i===at.light||H2.has(i)||e.push({severity:"error",message:`Layer ${r} uses unsupported Bodymovin \`ty: ${i}\`. Drop the layer or pre-render it as a video asset.`,layerIndex:r,layerName:mt(n)})}),e}},{id:"expression",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{!n||typeof n!="object"||It(n,"expression")||Mh(n,(i,o)=>{typeof i.x=="string"&&i.x.length>0&&e.push({severity:"error",message:`Layer ${r} property ${o} carries an expression. Run the expression baker (aep-17) before export.`,layerIndex:r,layerName:mt(n),path:o})})}),e}},{id:"3d-layer",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"3d-layer"))return;n.ddd===1&&e.push({severity:"info",message:`Layer ${r} is 3D-toggled (ddd: 1). Will render via the Three sub-scene (aep-18).`,layerIndex:r,layerName:mt(n)})}),e}},{id:"camera-or-light",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"camera-or-light"))return;const i=n.ty;i===at.camera?e.push({severity:"info",message:`Layer ${r} is a camera (ty: 13). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:mt(n)}):i===at.light&&e.push({severity:"info",message:`Layer ${r} is a light (ty: 14). Routes through the Three sub-scene (aep-18).`,layerIndex:r,layerName:mt(n)})}),e}},{id:"layer-style",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"layer-style"))return;const i=n.sy;Array.isArray(i)&&i.length>0&&e.push({severity:"warn",message:`Layer ${r} uses ${i.length} layer style(s). Layer styles are not parsed; re-author using shape strokes / effect filters.`,layerIndex:r,layerName:mt(n)})}),e}},{id:"time-remap",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"time-remap"))return;const i=n.tm,o=n.sr;i!=null&&e.push({severity:"warn",message:`Layer ${r} uses time remap. Pre-bake to a flat keyframe timeline before export.`,layerIndex:r,layerName:mt(n),path:"tm"}),typeof o=="number"&&o!==1&&e.push({severity:"warn",message:`Layer ${r} has time stretch sr=${o}. Bake the stretch into keyframes or pre-render the source.`,layerIndex:r,layerName:mt(n),path:"sr"})}),e}},{id:"unsupported-effect",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"unsupported-effect"))return;const i=n.ef;Array.isArray(i)&&i.forEach((o,s)=>{if(!o||typeof o!="object")return;const a=o.ty;typeof a=="number"&&(Y2.has(a)||e.push({severity:"warn",message:`Layer ${r} effect[${s}] uses unsupported effect ty=${a}. Pre-render to footage or substitute with a supported effect.`,layerIndex:r,layerName:mt(n),path:`ef[${s}]`}))})}),e}},{id:"adjustment-layer",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"adjustment-layer"))return;const i=n.ao,o=n.ty;i===1&&o===at.solid&&e.push({severity:"warn",message:`Layer ${r} is an adjustment layer. The engine does not compose effects across sibling layers — apply effects per-layer instead.`,layerIndex:r,layerName:mt(n)})}),e}},{id:"shape-operator",check:t=>{const e=[],n=new Set(["mm","rp","op","pb","tw","zz","rd"]);function r(i,o,s,a){if(!i)return;if(Array.isArray(i)){i.forEach((u,f)=>r(u,o,s,`${a}[${f}]`));return}if(typeof i!="object")return;const l=i,c=l.ty;typeof c=="string"&&n.has(c)&&e.push({severity:"warn",message:`Layer ${o} shape operator '${c}' (${a}) is not supported. Pre-bake the path to a single bezier before export.`,layerIndex:o,layerName:mt(s),path:a}),Array.isArray(l.it)&&r(l.it,o,s,`${a}.it`),Array.isArray(l.shapes)&&r(l.shapes,o,s,`${a}.shapes`)}return Mt(t).forEach((i,o)=>{if(!i||typeof i!="object"||It(i,"shape-operator")||i.ty!==at.shape)return;const a=i.shapes;Array.isArray(a)&&r(a,o,i,"shapes")}),e}},{id:"text-runs-incomplete-coverage",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"text-runs-incomplete-coverage")||n.ty!==at.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=c.t;if(typeof f!="string")return;const d=f.length;if(d===0)return;const h=new Uint8Array(d);for(const p of u){if(!p||typeof p!="object")continue;const g=p.from,y=p.to;if(typeof g!="number"||typeof y!="number")continue;const _=Math.max(0,Math.floor(g)),v=Math.min(d,Math.floor(y));for(let x=_;x<v;x++)h[x]=1}let m=0;for(let p=0;p<d;p++)h[p]||m++;m>0&&e.push({severity:"warn",message:`Layer ${r} text \`runs\` cover ${d-m}/${d} chars; ${m} gap(s) filled with layer-level style at parse. Re-export with full per-letter coverage or remove \`runs\` to silence.`,layerIndex:r,layerName:mt(n),path:"t.d.k[0].s.runs"})}),e}},{id:"text-overlapping-runs",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"text-overlapping-runs")||n.ty!==at.text)return;const o=n.t;if(!o||typeof o!="object")return;const s=o.d;if(!s||typeof s!="object")return;const a=s.k;if(!Array.isArray(a)||a.length===0)return;const c=a[0]?.s;if(!c||typeof c!="object")return;const u=c.runs;if(!Array.isArray(u)||u.length===0)return;const f=u.filter(d=>!!d&&typeof d=="object"&&typeof d.from=="number"&&typeof d.to=="number").slice().sort((d,h)=>d.from-h.from);for(let d=1;d<f.length;d++){const h=f[d-1],m=f[d];m.from<h.to&&e.push({severity:"error",message:`Layer ${r} text \`runs\` overlap: [${h.from},${h.to}) ∩ [${m.from},${m.to}). Each character may be claimed by at most one run.`,layerIndex:r,layerName:mt(n),path:"t.d.k[0].s.runs"})}}),e}},{id:"extrusion-without-is3d",check:t=>{const e=[];return Mt(t).forEach((n,r)=>{if(!n||typeof n!="object"||It(n,"extrusion-without-is3d"))return;const i=n;(i.__aepExtrusion!==void 0||i.__aep_extrusion!==void 0)&&(i.ty!==at.shape&&i.ty!==at.text||i.ddd!==1&&e.push({severity:"warn",message:`Layer ${r} has \`extrusion\` set but is not 3D (\`ddd:0\`). Extrusion only renders in the Three sub-scene; toggle 3D in AE or remove the extrusion extension.`,layerIndex:r,layerName:mt(n),path:"__aepExtrusion"}))}),e}}];class rS extends Error{constructor(e){super(`Bodymovin lint found ${e.findings.filter(n=>n.severity==="error").length} error(s). First: ${e.findings.find(n=>n.severity==="error")?.message}`),this.report=e,this.name="LottieLintError"}report}function iS(t,e={}){const n=new Set(e.disabledRules??[]),r=W2.filter(s=>!n.has(s.id)),i=X2(t,r),o=z2(i);return{findings:o,hasErrors:o.some(s=>s.severity==="error"),hasWarnings:o.some(s=>s.severity==="warn")}}function X2(t,e){const n=[];for(const r of e)try{const i=r.check(t);for(const o of i)n.push({...o,ruleId:r.id})}catch{}return n}function z2(t){const e=new Set,n=[];for(const i of t){const o=`${i.ruleId}::${i.layerIndex??-1}::${i.path??""}`;e.has(o)||(e.add(o),n.push(i))}const r={error:0,warn:1,info:2};return n.sort((i,o)=>{const s=r[i.severity]-r[o.severity];return s!==0?s:(i.layerIndex??-1)-(o.layerIndex??-1)}),n}function It(t,e){if(!t||typeof t!="object")return!1;const n=t.__aepLintSuppress;return Array.isArray(n)?n.includes(e):!1}const q2="ADBE Color Control";function V2(t,e){const n={},r=new Set,i=new Map;for(const o of t){if(!Array.isArray(o.ef))continue;const s=o.ef.filter(c=>c.mn===q2);if(s.length===0)continue;r.add(e(o));const a=o.nm??"",l=new Map;for(const c of s){const u=c.nm;if(!u)continue;l.set(u,u);const d=c.ef?.find(h=>h.ty===2)?.v?.k;Array.isArray(d)&&d.length>=3&&(n[u]=Pn(d))}l.size>0&&i.set(a,l)}return{theme:n,sourceLayerIds:r,resolveToken(o,s){return i.get(o)?.get(s)}}}const K2=[/comp\([^)]+\)\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"](?:Color|"Color"|'Color')['"]\s*\)/,/thisComp\s*\.\s*layer\(\s*['"]([^'"]+)['"]\s*\)\s*\.\s*effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/],$2=/(?:^|[^.\w])effect\(\s*['"]([^'"]+)['"]\s*\)\s*\(\s*['"]Color['"]\s*\)/;function Z2(t){for(const n of K2){const r=n.exec(t);if(r)return{layerName:r[1],effectName:r[2]}}const e=$2.exec(t);return e?{layerName:"",effectName:e[1]}:null}function J2(t,e={}){const n=t;if(!n||typeof n.fr!="number"||!Array.isArray(n.layers))throw new Error("bodymovinToAep: input does not look like a Bodymovin JSON document");const r=e.lint??"strict";if(r!=="off"){const h=iS(t,{disabledRules:e.disabledRules});if(r==="strict"&&h.hasErrors)throw new rS(h);if(r==="warn"||r==="strict"&&h.hasWarnings)for(const m of h.findings)console.warn(`[bodymovin lint:${m.severity}] ${m.ruleId} — ${m.message}`)}const i=V2(n.layers,or),o=(h,m)=>{const p=Z2(m);if(!p)return;const g=p.layerName===""?h:p.layerName;return i.resolveToken(g,p.effectName)},{layers:s,assets:a,precomps:l}=oS(n.layers,o,i.sourceLayerIds),{mergedAssets:c,mergedPrecomps:u}=Q2(a,l,n.assets??[]),f=QE(t),d=Object.keys(i.theme).length?i.theme:void 0;return qo({version:"1.0.0",id:n.nm??"lottie-import",name:n.nm,width:n.w,height:n.h,fps:n.fr,durationInFrames:n.op,layers:s,assets:c,...Object.keys(u).length>0&&{precomps:u},...f&&{postFx:f},...d&&{theme:d}})}function oS(t,e,n){const r=t.map(o=>or(o)),i=[];for(let o=0;o<t.length;o++){const s=t[o];if(n?.has(r[o]))continue;const a=t[o-1],l=s.tt!=null&&s.tt>0&&a?.td===1?r[o-1]:void 0,c=nS(s,{matteSourceId:l,resolveColorControl:e});if(c.length===0){console.warn(`bodymovinToAep: dropping unsupported layer ty=${s.ty}`+(s.nm?` (${s.nm})`:""));continue}i.push(...c)}return{layers:i,assets:{},precomps:{}}}function Q2(t,e,n){const r={...t},i={...e};for(const o of n)if("layers"in o&&Array.isArray(o.layers)){const s=oS(o.layers);r[o.id]={type:"composition",src:""},i[o.id]={version:"1.0.0",id:o.id,width:0,height:0,fps:0,durationInFrames:1,layers:s.layers,assets:s.assets}}else{const s=o,a=(s.u??"")+(s.p??"");r[o.id]={type:"image",src:a,...s.w!==void 0&&{width:s.w},...s.h!==void 0&&{height:s.h}}}return{mergedAssets:r,mergedPrecomps:i}}const sS=(t,e)=>t.flatMap((n,r)=>yv(n.name)?[]:[{ruleId:"transition-unknown-name",severity:"warn",message:`Transition '${n.id}' uses unknown shader '${n.name}'; it will render as a crossfade.`,path:`${e}transitions.${r}.name`}]),e3=t=>{const e=[...sS(t.transitions??[],""),...Object.entries(t.precomps??{}).flatMap(([n,r])=>sS(r.transitions??[],`precomps.${n}.`))];return{findings:e,hasErrors:!1,hasWarnings:e.length>0}},Ih=t=>Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0],ws=t=>t===void 0?[]:Ih(t)?t.map(e=>e.v):[t],aS=t=>Ih(t)?t.map(e=>e.t):[],t3=[10,8],n3=3,cS=.3;function lS(t,e){const n=[],r=(u,f,d,h,m)=>n.push({ruleId:u,severity:f,message:d,layerIndex:h,layerName:m.name??m.id,path:`${e}layers.${h}`}),i=new Map(t.map((u,f)=>[u.id,f])),o=t.filter(u=>u.kind==="stage3d"),s=t.filter(Tt);for(const u of o){const f=i.get(u.id),d=s.filter(T=>T.stage===u.id),h=d.filter(T=>T.kind==="actor3d"),m=d.filter(T=>T.kind==="prop3d");d.length===0&&r("stage3d-world-empty","warn",`stage3d '${u.id}' has no actor3d / prop3d members.`,f,u);const p=u.set?.wall?.distance??(u.set?.backdrop||u.set?.wall?n3:null);p!==null&&u.camera.position[2]<=-p&&r("stage3d-camera-behind-wall","error",`stage3d '${u.id}' camera z (${u.camera.position[2]}) is at or behind the wall (z = -${p}).`,f,u);const g=Fi[u.lights?.preset??"studio"].keyIntensity,_=(u.lights?.key?.intensity===void 0?[g]:ws(u.lights.key.intensity)).every(T=>T===0),v=(u.lights?.spots??[]).some(T=>ws(T.intensity).some(A=>A>0));_&&!v&&r("stage3d-no-light","warn",`stage3d '${u.id}' has a key light at 0 and no lit spot light; the scene will be dark.`,f,u);for(const T of d){const A=i.get(T.id);A<f&&r("stage3d-member-before-world","info",`${T.kind} '${T.id}' is listed before its world '${u.id}' (works; convention is after).`,A,T),(T.outPoint<=u.inPoint||T.inPoint>=u.outPoint)&&r("stage3d-member-outside-world","warn",`${T.kind} '${T.id}' [${T.inPoint}, ${T.outPoint}) does not overlap its world '${u.id}' [${u.inPoint}, ${u.outPoint}); it will never show.`,A,T)}const[x,E]=u.set?.groundSize??t3;for(const T of h){const A=i.get(T.id);for(const C of T.clips??[])(C.startFrame<T.inPoint||C.startFrame>=T.outPoint)&&r("stage3d-clip-outside-layer","warn",`actor3d '${T.id}' clip at frame ${C.startFrame} starts outside its [${T.inPoint}, ${T.outPoint}) range.`,A,T);if(ws(T.marks).some(([C,k])=>Math.abs(C)>x/2||Math.abs(k)>E/2)&&r("stage3d-mark-off-ground","warn",`actor3d '${T.id}' has a mark outside the ${x} x ${E} m ground.`,A,T),Ih(T.marks)){const C=T.marks;for(let k=1;k<C.length;k++)if(Math.abs(C[k].v[2]-C[k-1].v[2])>180){r("stage3d-facing-wrap","warn",`actor3d '${T.id}' facing turns more than 180 degrees between frames ${C[k-1].t} and ${C[k].t}; it will spin the long way.`,A,T);break}}}for(let T=0;T<h.length;T++)for(let A=T+1;A<h.length;A++){const M=new Set([...aS(h[T].marks),...aS(h[A].marks)]);M.size===0&&M.add(0);for(const C of M){const[k,w]=wt(h[T].marks,[0,0,0],C),[L,D]=wt(h[A].marks,[0,0,0],C);if(Math.hypot(k-L,w-D)<cS){r("stage3d-actors-overlap","warn",`actor3d '${h[T].id}' and '${h[A].id}' are closer than ${cS} m at frame ${C}.`,i.get(h[T].id),h[T]);break}}}for(const T of m)T.attach||ws(T.position).some(A=>A[1]<0)&&r("stage3d-object-below-ground","warn",`prop3d '${T.id}' sinks below the ground (position y < 0).`,i.get(T.id),T)}const a=o.flatMap(u=>[{at:u.inPoint,d:1},{at:u.outPoint,d:-1}]);a.sort((u,f)=>u.at-f.at||u.d-f.d);let l=0,c=!1;for(const u of a)if(l+=u.d,l>2&&!c){c=!0;const f=o[0];r("stage3d-too-many-worlds","warn",`More than 2 stage3d worlds are active at frame ${u.at}; each one is a separate render.`,i.get(f.id),f)}return n}const r3=t=>{const e=[...lS(t.layers,""),...Object.entries(t.precomps??{}).flatMap(([n,r])=>lS(r.layers,`precomps.${n}.`))];return{findings:e,hasErrors:e.some(n=>n.severity==="error"),hasWarnings:e.some(n=>n.severity==="warn")}};b.AEP_MAX_PRECOMP_DEPTH=Vo,b.AEP_SCHEMA_MAJOR=Ud,b.AEP_SCHEMA_VERSION=NL,b.AEP_TEXT_ALIGN_VALUES=Hb,b.ALL_GOOGLE_FONTS=Hk,b.ANIMATION=a0,b.ANIMATIONS_WITHOUT_ALPHA=uc,b.ANIMATION_CONFIGS=Se,b.ANIMATION_TIMING=Yt,b.ASPECT_RATIOS=_2,b.AbstractContainer=Je,b.Aep3DPostFx=bh,b.Aep3DPrecompPlane=Sh,b.Aep3DScene=YE,b.Aep3DShapeMesh=vh,b.Aep3DTextMesh=Eh,b.AepAssetResolverProvider=IT,b.AepComposition=RE,b.AepLayerProvider=Si,b.AepLayerRouter=Ur,b.AepMaskContainer=AT,b.AepMsdfTextMesh=Th,b.AepPrecompRenderProvider=jN,b.AepPrecompRenderer=_h,b.AepReadinessProvider=FT,b.AepRecursionDepthProvider=fv,b.AepStageLayoutProvider=_E,b.AepTextOverrideProvider=S1,b.AepThemeProvider=Of,b.AepTransitionLayer=Wi,b.AepTransitionMesh=mh,b.AepTransitionProvider=Es,b.Animations=_o,b.AudioPlaybackManager=nd,b.BOXED_PADDING=Oi,b.BlendModes=XE,b.BorderMaskContainer=Pt,b.CANVAS_DEFAULTS=li,b.CANVAS_TEXT_MAX_LENGTH=e1,b.CLIP_LOCAL_TOLERANCE_SEC=rf,b.DEFAULT_BOXED_COLOR=Fx,b.DEFAULT_DUCK_FADE_SEC=Co,b.DEFAULT_DUCK_TO=Qu,b.DEFAULT_LIGHTING_PRESET=_s,b.DEFAULT_MAX_REGION_PIXELS=Wd,b.DEFAULT_SEGMENT_GAP_SEC=xx,b.DEFAULT_WORD_SPACING_EM=Bv,b.DRIFT_TOLERANCE_SEC=L_,b.EMOJI_CDN_BASE=mx,b.Events=Ne,b.FALLBACK_SPACE_EM=Fv,b.FONT_LOAD_TIMEOUT_MS=Qx,b.GLOW_POP_BLOOM_ALPHA=$v,b.GLOW_POP_BLOOM_BLUR_EM=Kv,b.GLOW_POP_BLOOM_PASSES=Zv,b.GLOW_POP_BLUR_EM=Vv,b.GLOW_POP_EMOJI_BLOOM_ALPHA=Jv,b.GLOW_POP_EMOJI_MS=qv,b.GLOW_POP_EMOJI_OFFSET_EM=$d,b.GLOW_POP_EMOJI_SIZE_EM=Kd,b.GLOW_POP_ENTER_MS=Xv,b.GLOW_POP_EXIT_MS=zv,b.GLOW_POP_STREAK_ALPHA=Vd,b.GOOGLE_FONTS=Jx,b.GlTransitionRegistryProvider=YP,b.GsapPixieContext=Ve,b.GsapPixieContextProvider=hw,b.IDENTITY_TRANSFORM_3D=LE,b.LIGHTING_PRESETS=Fi,b.LINE_PITCH=Uv,b.LOOP_ANIMATIONS=o0,b.LottieLintError=rS,b.MIN_CROP_SIZE=b2,b.MIN_VISIBLE_BLUR=cf,b.MODEL3D_DEFAULTS=Ot,b.MSDF_FRAGMENT_SHADER=Cv,b.MSDF_VERTEX_SHADER=Iv,b.MUSIC_BED_DEFAULT_VOLUME=FC,b.MaskTypes=Xt,b.MetricsCache=nb,b.MsdfAtlasProvider=UE,b.MsdfAtlasRegistry=jE,b.OverlayTilingSpriteTypes=_m,b.OverlayTypes=Qr,b.PIXITEXT_HITAREA_PREFIX=lb,b.PIXITEXT_TEXT_LABEL=ub,b.PRELOAD_FONTS=Yk,b.Pixi3DModelLayer=ch,b.Pixi3DStageLayer=ph,b.PixiAnimatedSprite=UP,b.PixiAudioSprite=U_,b.PixiCaptionsTrack=OP,b.PixiElementTransition=os,b.PixiGifSprite=H_,b.PixiGlTransition=z1,b.PixiImageSprite=Nu,b.PixiLottieSprite=Wf,b.PixiMorphSvgSprite=DC,b.PixiNullObject=vT,b.PixiOverlayTilingSprite=bm,b.PixiPreComp=wE,b.PixiRemotionGifSprite=iD,b.PixiRemotionImageSprite=eD,b.PixiRemotionSprite=JP,b.PixiRemotionVideoCanvaSprite=nD,b.PixiSceneTransition=Yf,b.PixiSequence=j1,b.PixiSequenceWrapper=GP,b.PixiShapeLayer=bT,b.PixiSvgImageSprite=xC,b.PixiSvgPathSprite=n_,b.PixiSvgRawSprite=t_,b.PixiTextSplit=Rf,b.PixiTextSprite=db,b.PixiThreeModelSprite=VC,b.PixiThreeSprite=Y_,b.PixiTrackMatte=OT,b.PixiUnifiedTransformer=RD,b.PixiVideoCanvasSyncSprite=FP,b.PixiVideoSprite=Uf,b.SPECIAL_ANIMATIONS=ui,b.SPRING_POP_AMPLITUDE_EM=rx,b.SPRING_POP_BLOOM_ALPHA=ax,b.SPRING_POP_BLOOM_BLUR_EM=sx,b.SPRING_POP_BLUR_ALPHA=Zd,b.SPRING_POP_BLUR_EM=ox,b.SPRING_POP_BLUR_MS=ix,b.SPRING_POP_DAMPING=nx,b.SPRING_POP_FREQUENCY_HZ=tx,b.SPRING_POP_SPLIT_ALPHA=hx,b.SPRING_POP_SPLIT_BOTTOM=fx,b.SPRING_POP_SPLIT_EM=ux,b.SPRING_POP_SPLIT_MS=lx,b.SPRING_POP_SPLIT_SETTLED_EM=Jd,b.SPRING_POP_SPLIT_TOP=dx,b.SPRITE_REF_PROP_NAMES=Gy,b.STAGE3D_DEFAULT_FADE_FRAMES=kd,b.STAGE3D_LIMITS=Dt,b.STAGE3D_MIN_VERSION=jd,b.STAGE_MEMBER_HANDLERS=pE,b.STAGE_MEMBER_KINDS=ZR,b.THREE_DEFAULTS=qt,b.TRANSITIONS_MIN_VERSION=Gd,b.TextRunsOverlapError=Wb,b.ThreeOffscreenRenderer=HT,b.Transitions=zL,b.VOICE_TRACK_ROLES=A_,b.WORDBOX_GROW_MS=Gx,b._listEffectHandlers=lP,b.acquireOffscreenRenderer=bs,b.acquireVideoAsset=qx,b.activeScaleFor=$o,b.activeWordIndexAt=Wv,b.activeWordScaleFor=Qd,b.activeWordWindow=jv,b.aepAnimatableOf=X,b.aepAssetKindSchema=Ob,b.aepAssetMapSchema=Ib,b.aepAssetSchema=Mb,b.aepBezierPathSchema=Ti,b.aepCameraLayerSchema=Db,b.aepColorSchema=Nt,b.aepCompositionSchema=zo,b.aepEaseHandleSchema=Ed,b.aepEffectNameSchema=Cb,b.aepEffectSchema=Rb,b.aepKeyframeOf=Sd,b.aepLayerSchema=av,b.aepLightLayerSchema=Nb,b.aepMaskModeSchema=kb,b.aepMaskSchema=Pb,b.aepModel3DLightingKeySchema=Nd,b.aepModel3DSourceSchema=Pd,b.aepModel3DTexturesSchema=Dd,b.aepModel3DViewportSchema=Fd,b.aepPostFxNameSchema=Lb,b.aepPostFxSchema=Ad,b.aepRangeBasedOnSchema=Bb,b.aepRangeShapeSchema=Fb,b.aepShapePathSchema=Qb,b.aepStageClipSchema=ov,b.aepTextAlignSchema=Yb,b.aepTextAnimatorSchema=Gb,b.aepTextRangeSelectorSchema=Ub,b.aepTextStyleRunSchema=jb,b.aepTextStyleSchema=tv,b.aepThemableColorSchema=Rd,b.aepThemableColorValueSchema=qb,b.aepThemeMapSchema=Vb,b.aepThemeRefSchema=zb,b.aepTransform3DSchema=Xo,b.aepTransformSchema=Wo,b.aepTransitionSchema=Kb,b.animationAffectsAlpha=MA,b.animationTimeSeconds=qT,b.applyAudioDecision=td,b.applyEntranceOverlaps=Dk,b.applyMaterialOverrides=q_,b.applyToonStyle=vs,b.areSpritePropsEqual=rt,b.asNumber=Qt,b.asOpacity=VE,b.asScale=qE,b.asVec2=bn,b.audioRegistry=Sr,b.bindClipToSkeleton=iE,b.bindTrackNames=nE,b.bodymovinToAep=J2,b.boxedBackgroundSpec=Ux,b.boxedRadiusFor=Bx,b.brightnessContrastHandler=Tf,b.buildAudioLevelTimeline=bP,b.buildBezierPathTimeline=v1,b.buildColorValueTimeline=t1,b.buildCycloramaGeometry=tE,b.buildExtrudeGeometry=ys,b.buildGainSpec=GC,b.buildLayerTimeline=uv,b.buildPrimitiveGeometry=gs,b.buildRasterSvg=Jy,b.buildResourceUrlModifier=K_,b.buildScalarValueTimeline=Af,b.buildSourceGeometry=VD,b.buildTextStyleOptions=dd,b.buildV8FillGradient=ab,b.buildVec2ValueTimeline=x1,b.camelToUpperSnake=vr,b.captionModeFor=Yv,b.captionSegmentSchema=bx,b.captionSegmentsSchema=vx,b.captionTimeAt=af,b.captionWordSchema=_x,b.captionWordText=Tk,b.clipFileTime=k_,b.clipLocalTime=sE,b.clipSegmentsToRange=Pk,b.clipTimeAt=X_,b.clipTimeSeconds=rN,b.clipVolumeAt=P_,b.clonePath=er,b.coerceLegacyTextAlign=Id,b.composeAnimators=rs,b.composeTransform3D=PE,b.computeInstanceMatrix=Dv,b.computeModelPose=W_,b.convertLayer=nS,b.convertProperty=Xe,b.convertTransform=ir,b.createAssetRefCounter=xc,b.createAudioRegistry=w_,b.createCanvasMetricsProvider=rb,b.createGLTransitionShader=vv,b.createPixiSelector=bM,b.createRendererPool=YT,b.cubicBezierEase=n1,b.dbToLinear=BC,b.decideAudioSync=ed,b.defaultAssetResolver=Vf,b.deriveDuckWindows=R_,b.detectOutlineIcon=Zy,b.detectSubtitleFormat=Ix,b.directionFromAzimuthElevation=BT,b.displayedWordsFor=Px,b.disposeObject=sd,b.drawAepMaskComposite=wT,b.drawMaskShape=vc,b.drawShape=mT,b.dropShadowHandler=yf,b.duckGainAt=M_,b.duckWindowsFromEnvelope=C_,b.easeCaptionProgress=In,b.easeNameFor=Vn,b.easeOutBack=Qv,b.emitCustomEvent=Hn,b.estimateWordTimings=nf,b.fadeGainAt=O_,b.fastBoxBlurHandler=Ef,b.findAllByPattern=bc,b.findByName=_c,b.fitCameraToObject=V_,b.fitDistance=od,b.flattenThemableColor=Qn,b.fontFamilyKey=df,b.fontWeightsOf=Ci,b.formatGoogleFamily=Ii,b.frameCamera=$T,b.fromMultiplierColorCorrection=mM,b.gainAt=I_,b.gaussianBlurHandler=gf,b.getAepTransitionEase=SE,b.getAvailableTransitions=_v,b.getEffectFilter=y0,b.getEffectHandler=wf,b.getElementName=yc,b.getLoadedFonts=Wk,b.getOffscreenRenderer=ZD,b.getPixiTextHitAreaName=_R,b.getToonGradientMap=KT,b.getTransitionInfo=VL,b.getTransitionShader=Ko,b.getUniqueIdFromName=yM,b.gifFrameAt=j_,b.glowHandler=_f,b.glowPopMotion=ex,b.googleFontsHref=Zx,b.groupWordsIntoSegments=Ak,b.hasMaterialOverrides=z_,b.hexToRgba=Nv,b.hueSaturationHandler=bf,b.hydrateMsdfAtlas=_k,b.interpolateBezierPath=hf,b.isClipLocal=Cx,b.isExternalUrl=XL,b.isFontSpecCovered=Kx,b.isFrameInRange=ah,b.isLoopAnimation=s0,b.isSingleWordMode=vk,b.isSpecialAnimation=IA,b.isStageMember=Tt,b.isSvgSource=e_,b.isTimeBasedMode=kx,b.isValidAnimation=CA,b.isWhitespaceChar=Z_,b.layerIdFor=or,b.layoutCaptionWords=Hv,b.layoutText=ib,b.lerpColor=o1,b.lerpNumber=r1,b.lerpVec2=i1,b.levelsHandler=vf,b.linearToDb=UC,b.lintAepStage3D=r3,b.lintAepTransitions=e3,b.lintBodymovinJson=iS,b.listGlTransitionNames=KL,b.loadGoogleFonts=Kk,b.loadMsdfAtlas=Mv,b.loadSpriteTexture=SM,b.loadSpriteTextureSync=vo,b.lottieColorToHex=Pn,b.mapV7DropShadow=ob,b.mapV7Stroke=sb,b.markVideoReady=es,b.materialOverrideKey=id,b.memberActive=dh,b.mergeAssetMaps=wi,b.mergeTheme=Mf,b.metricsCacheKey=tb,b.model3DStateKey=jT,b.model3dToProp3d=y2,b.newCustomEventEmitter=fw,b.normalizeAnimation=dc,b.normalizeBoneName=rr,b.normalizeCaptionSegments=wk,b.normalizeFontWeight=ld,b.normalizeLetterSpacing=cb,b.normalizeLoopAnimation=l0,b.normalizeTextRuns=Xb,b.notoEmojiFileName=gx,b.overlays=ja,b.parseAepComposition=qo,b.parseAepCompositionSafe=GL,b.parseCaptionColor=Nx,b.parseCaptionSegments=xk,b.parseHexColor=tr,b.parseSRT=Ox,b.parseSubtitles=Ck,b.parseTimestamp=Zo,b.parseVTT=Mx,b.pathHash=FE,b.pathToThreeShape=NE,b.pickClip=oh,b.planPropSegments=lv,b.planReconcile=mE,b.projectBoxToViewport=vE,b.projectSegments=kk,b.rangeShapeValue=If,b.readExtrusionExtension=eS,b.readOriginalSize=$y,b.readPostFxExtension=QE,b.refineActor3DLayer=Jb,b.refineStage3DLayer=Zb,b.registerEffectHandler=cP,b.registerVideo=Wx,b.releaseOffscreenRenderer=ih,b.releaseVideoAsset=Vx,b.resetVideoReadiness=Bk,b.resolveBlendModeString=hc,b.resolveBlendStrategy=kA,b.resolveCaptionOffset=Lk,b.resolveEmojiSrc=ef,b.resolveLightingConfig=Bi,b.resolvePostFxList=HE,b.resolveSequenceTransitions=W1,b.resolveSpaceWidth=Gv,b.resolveTextRuns=zd,b.resolveTextRunsWithWarnings=pk,b.resolveTextSource=vP,b.resolveTextSplitFills=w1,b.resolveThemedColorValue=Ld,b.resolveWordSpacing=qd,b.rewriteSvg=Qy,b.rgbaToHex=Ri,b.rotateVec3Euler=kE,b.sampleActor3D=cE,b.sampleAnimatable=Pr,b.sampleAnimatedBezier=mf,b.sampleBezierPath=dT,b.sampleCaptionAt=sf,b.sampleColor=At,b.sampleModel3DState=rh,b.samplePath=qf,b.sampleProp3D=lE,b.sampleScalar=ge,b.sampleStageWorld=aE,b.sampleVec2=pn,b.sanitizeCanvasText=Jk,b.sanitizeImageSrc=Tc,b.scheduleClips=oE,b.selectorPerChar=Cf,b.shouldSplitText=DT,b.splitGraphemes=$_,b.springPopMotion=cx,b.springPopSplit=px,b.stageFrameKey=uE,b.stageMembersOf=$b,b.staticParam=We,b.threeTextureFromPixi=g2,b.tintHandler=xf,b.transformCaptionText=Lr,b.transitionExists=yv,b.transitionLayerIds=Ei,b.trimPolyline=fT,b.unregisterVideo=Xx,b.useAepAssetResolver=Kf,b.useAepBezierPathAnimator=gP,b.useAepColorAnimator=pP,b.useAepCompositionReady=NT,b.useAepCurrentFrame=pv,b.useAepEffectKeyframes=b1,b.useAepEffects=_1,b.useAepKeyframes=YL,b.useAepLayerContext=pt,b.useAepLayerContextOptional=hn,b.useAepLayerTransform=PT,b.useAepLayerTransform3D=Xi,b.useAepPrecompStore=gh,b.useAepReadiness=Zf,b.useAepRecursionDepth=hv,b.useAepStageLayoutListener=bE,b.useAepTextLayout=ns,b.useAepTextOverride=Li,b.useAepTheme=nr,b.useAepTransitionClock=EE,b.useAepTransitionRegistry=Br,b.useAepValueAnimator=hP,b.useAepVec2Animator=_P,b.useAllVideosReady=jk,b.useAudioElementPlayer=G_,b.useAudioVisualizer=B_,b.useBlendFilter=h0,b.useCaptionPlayhead=A1,b.useCaptionStyles=M1,b.useCustomEventListener=tt,b.useDebouncedValue=hi,b.useEffects=sM,b.useEmojiTextures=I1,b.useFontEpoch=_i,b.useGLTransitionMesh=jf,b.useGsapEffect=i0,b.useHowlerAudioPlayer=XC,b.useMsdfAtlas=GE,b.usePixiAnimation=u0,b.usePixiRenderTexture=CE,b.usePrecompTexture=IE,b.useResolveAsset=Ni,b.useResolveAssets=LT,b.useSpriteFilters=lt,b.useStageMembers=xE,b.useSvgTexture=r_,b.useTypefaceMetrics=c1,b.useVideoLifecycle=B1,b.useVideoTexture=F1,b.useVideoTimelineSync=U1,b.usesClipLocalTime=Rx,b.validatePrecompDepth=AE,b.withEffectsHook=mc,b.withFiltersHook=m0,b.wordVisualFor=Lx,b.wordboxPillSpec=jx,b.writeInstanceColor=bk,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));