@galacean/cli 2.0.0-alpha.22 → 2.0.0-alpha.24

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 (90) hide show
  1. package/dist/cli.bundle.cjs +32922 -32372
  2. package/dist/preview-client/_static/{Accordion-b106eaf3.js → Accordion-f938dadf.js} +1 -1
  3. package/dist/preview-client/_static/{AmbientLightAsset-6b2d168c.js → AmbientLightAsset-e34de607.js} +1 -1
  4. package/dist/preview-client/_static/{AnimationClipAsset-a5d290cc.js → AnimationClipAsset-b084da2a.js} +1 -1
  5. package/dist/preview-client/_static/{AnimatorControllerAsset-616578b4.js → AnimatorControllerAsset-6cc04274.js} +1 -1
  6. package/dist/preview-client/_static/{AnimatorStore-bc865a7e.js → AnimatorStore-0bc90c37.js} +1 -1
  7. package/dist/preview-client/_static/{AssetViewer-1a9f3cad.js → AssetViewer-d2c63b00.js} +1 -1
  8. package/dist/preview-client/_static/{AudioAsset-24b03bc3.js → AudioAsset-9c715952.js} +1 -1
  9. package/dist/preview-client/_static/{AudioComponent-060f13a6.js → AudioComponent-80d06ef4.js} +1 -1
  10. package/dist/preview-client/_static/{Callout-c8b9b055.js → Callout-48e71f13.js} +1 -1
  11. package/dist/preview-client/_static/{CameraComponent-33b1918d.js → CameraComponent-9c9db3fb.js} +1 -1
  12. package/dist/preview-client/_static/{Component-3cb422ab.js → Component-b95aa2af.js} +1 -1
  13. package/dist/preview-client/_static/{DirectLight-072d3047.js → DirectLight-b0490ef7.js} +1 -1
  14. package/dist/preview-client/_static/{FontAsset-1e1118c1.js → FontAsset-6e9c0549.js} +1 -1
  15. package/dist/preview-client/_static/{FormItemArray-f1283fce.js → FormItemArray-b2a3d249.js} +1 -1
  16. package/dist/preview-client/_static/{GlTFAsset-dc68541e.js → GlTFAsset-83e8190e.js} +1 -1
  17. package/dist/preview-client/_static/{IconPlus-99d7bb90.js → IconPlus-172c6c17.js} +1 -1
  18. package/dist/preview-client/_static/{IconPointFilled-f8224625.js → IconPointFilled-bad94cf1.js} +1 -1
  19. package/dist/preview-client/_static/{LightBaseComponent-b610e42a.js → LightBaseComponent-b4854e8a.js} +1 -1
  20. package/dist/preview-client/_static/{LottieAnimationComponent-b70c2426.js → LottieAnimationComponent-efd5da2b.js} +1 -1
  21. package/dist/preview-client/_static/{MarkdownAsset-2a4a1d10.js → MarkdownAsset-b42846c0.js} +1 -1
  22. package/dist/preview-client/_static/{MaterialAsset-dfaa82d9.js → MaterialAsset-0b9d7eba.js} +1 -1
  23. package/dist/preview-client/_static/{MaterialInspector-21fc5b67.js → MaterialInspector-23ea0240.js} +1 -1
  24. package/dist/preview-client/_static/{Menu-62cee67e.js → Menu-05c1f0a4.js} +1 -1
  25. package/dist/preview-client/_static/{MeshAsset-07529e4e.js → MeshAsset-85e99837.js} +1 -1
  26. package/dist/preview-client/_static/{MeshRendererBaseComponent-2af8db12.js → MeshRendererBaseComponent-5621d663.js} +1 -1
  27. package/dist/preview-client/_static/{MeshRendererComponent-d9df7d58.js → MeshRendererComponent-c3c3c683.js} +1 -1
  28. package/dist/preview-client/_static/{MeshThumbnail-bd30617c.js → MeshThumbnail-b1283749.js} +1 -1
  29. package/dist/preview-client/_static/{ParticleRendererComponent-8729cfbf.js → ParticleRendererComponent-94656239.js} +1 -1
  30. package/dist/preview-client/_static/{PhysicsMaterialAsset-e9abb944.js → PhysicsMaterialAsset-cb9afb6e.js} +1 -1
  31. package/dist/preview-client/_static/{PhysicsStore-96164e4e.js → PhysicsStore-0a751fa0.js} +1 -1
  32. package/dist/preview-client/_static/{PointLight-76172b61.js → PointLight-a2bfed75.js} +1 -1
  33. package/dist/preview-client/_static/{PostProcessComponent-83f23ced.js → PostProcessComponent-040cf521.js} +1 -1
  34. package/dist/preview-client/_static/{PrefabAsset-4bac196b.js → PrefabAsset-265f6f48.js} +1 -1
  35. package/dist/preview-client/_static/{PrimitiveMesh-9ff7dbc1.js → PrimitiveMesh-70c93e7e.js} +1 -1
  36. package/dist/preview-client/_static/{ReferencedMaterial-27ba90e2.js → ReferencedMaterial-831d0583.js} +1 -1
  37. package/dist/preview-client/_static/{RenderTargetAsset-e112b8ca.js → RenderTargetAsset-b810caf3.js} +1 -1
  38. package/dist/preview-client/_static/{SceneAsset-a39f097a.js → SceneAsset-d05b1a79.js} +1 -1
  39. package/dist/preview-client/_static/{ShaderAsset-068b4b97.js → ShaderAsset-370b6f1c.js} +1 -1
  40. package/dist/preview-client/_static/{ShaderChunkAsset-bdb39acc.js → ShaderChunkAsset-e3487bd1.js} +1 -1
  41. package/dist/preview-client/_static/{ShaderUIScriptAsset-0c11d0ed.js → ShaderUIScriptAsset-ebf57ceb.js} +1 -1
  42. package/dist/preview-client/_static/{SkinnedMeshRendererComponent-5e58927a.js → SkinnedMeshRendererComponent-ee33da25.js} +1 -1
  43. package/dist/preview-client/_static/{SpineAnimationComponent-1ae4feaa.js → SpineAnimationComponent-12e694e8.js} +1 -1
  44. package/dist/preview-client/_static/{SpineSkeletonDataAsset-284f5f4d.js → SpineSkeletonDataAsset-0dffbb4d.js} +1 -1
  45. package/dist/preview-client/_static/{SpotLight-1a8af1d4.js → SpotLight-ada565f2.js} +1 -1
  46. package/dist/preview-client/_static/{SpriteBaseComponent-fd82e43b.js → SpriteBaseComponent-3156cb3b.js} +1 -1
  47. package/dist/preview-client/_static/{SpriteMaskComponent-eab0faf7.js → SpriteMaskComponent-a32024e1.js} +1 -1
  48. package/dist/preview-client/_static/{SpriteRendererComponent-1496fc43.js → SpriteRendererComponent-489486e0.js} +1 -1
  49. package/dist/preview-client/_static/{TextBaseComponent-7d2db29c.js → TextBaseComponent-520dea39.js} +1 -1
  50. package/dist/preview-client/_static/{TextRendererComponent-88494abb.js → TextRendererComponent-6be5f80c.js} +1 -1
  51. package/dist/preview-client/_static/{TextureAsset-7172cc65.js → TextureAsset-9cd94531.js} +1 -1
  52. package/dist/preview-client/_static/{Tooltip-9ce2e9d6.js → Tooltip-71e5a4e7.js} +1 -1
  53. package/dist/preview-client/_static/{TrailRendererComponent-4443baab.js → TrailRendererComponent-74bf88c0.js} +1 -1
  54. package/dist/preview-client/_static/{TransformBaseComponent-ca2fa45d.js → TransformBaseComponent-0d241199.js} +1 -1
  55. package/dist/preview-client/_static/{TransformComponent-683b5e9c.js → TransformComponent-49d279f5.js} +1 -1
  56. package/dist/preview-client/_static/{XRReferenceImageAsset-823e47cd.js → XRReferenceImageAsset-79e78558.js} +1 -1
  57. package/dist/preview-client/_static/{audio-10d03160.js → audio-5d0ddf55.js} +1 -1
  58. package/dist/preview-client/_static/{createOnModelChange-73358d10.js → createOnModelChange-e65da908.js} +1 -1
  59. package/dist/preview-client/_static/{createReactComponent-fcd6848b.js → createReactComponent-cb70ea50.js} +1 -1
  60. package/dist/preview-client/_static/index-0fef73f8.js +1 -0
  61. package/dist/preview-client/_static/index-1e036622.js +1 -0
  62. package/dist/preview-client/_static/index-1fd4207a.js +1 -0
  63. package/dist/preview-client/_static/{index-2202e8e4.js → index-46c87b46.js} +1 -1
  64. package/dist/preview-client/_static/index-6649d404.js +1 -0
  65. package/dist/preview-client/_static/{index-8d2f0997.js → index-788e8750.js} +1 -1
  66. package/dist/preview-client/_static/{index-2274eaf1.js → index-7e414715.js} +1 -1
  67. package/dist/preview-client/_static/index-87ef1c72.js +1 -0
  68. package/dist/preview-client/_static/{index-4ac10da2.js → index-b13216a9.js} +1 -1
  69. package/dist/preview-client/_static/{index-5392907c.js → index-b4bde36a.js} +3 -3
  70. package/dist/preview-client/_static/{index-4cde6efd.js → index-d00c8bc3.js} +1 -1
  71. package/dist/preview-client/_static/index-d9ee84ce.js +1 -0
  72. package/dist/preview-client/_static/{index-0a53aaef.js → index-debbe073.js} +1 -1
  73. package/dist/preview-client/_static/{index-03b6134d.js → index-e44b357e.js} +6 -6
  74. package/dist/preview-client/_static/{index-19f5510d.js → index-ea7fe254.js} +1 -1
  75. package/dist/preview-client/_static/{index-7e5ce9d9.js → index-f7bd6fef.js} +1 -1
  76. package/dist/preview-client/_static/{ktx2-encoder-4cac07f2.js → ktx2-encoder-522fc017.js} +1 -1
  77. package/dist/preview-client/_static/{module-101126a2.js → module-5547be1c.js} +1 -1
  78. package/dist/preview-client/_static/{module-5fa1eae0.js → module-57b6e417.js} +1 -1
  79. package/dist/preview-client/_static/{module-03df665c.js → module-5906e0d4.js} +1 -1
  80. package/dist/preview-client/_static/postmen-443b3e5f.js +2 -0
  81. package/dist/preview-client/_static/{shader-data-utils-d59bc4f5.js → shader-data-utils-000170ae.js} +1 -1
  82. package/dist/preview-client/index.html +1 -1
  83. package/package.json +1 -1
  84. package/dist/preview-client/_static/index-0a683358.js +0 -1
  85. package/dist/preview-client/_static/index-6f3c991c.js +0 -1
  86. package/dist/preview-client/_static/index-a2c9fc83.js +0 -1
  87. package/dist/preview-client/_static/index-c216bbcf.js +0 -1
  88. package/dist/preview-client/_static/index-f06b751f.js +0 -1
  89. package/dist/preview-client/_static/index-f4a0b8dd.js +0 -1
  90. package/dist/preview-client/_static/postmen-9e6354af.js +0 -2
@@ -1 +1 @@
1
- var m=Object.defineProperty;var f=(r,e,t)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var S=(r,e,t)=>(f(r,typeof e!="symbol"?e+"":e,t),t);import{a as s,E as o,b as u}from"./ShaderUIScriptAsset-0c11d0ed.js";import{t as P}from"./ShaderUIScriptAsset-0c11d0ed.js";import{q as g,aT as h}from"./index-03b6134d.js";import"./index-0a53aaef.js";import"./postmen-9e6354af.js";var l=Object.defineProperty,M=Object.getOwnPropertyDescriptor,b=(r,e,t,p)=>{for(var a=p>1?void 0:p?M(e,t):e,i=r.length-1,c;i>=0;i--)(c=r[i])&&(a=(p?c(e,t,a):c(a))||a);return p&&a&&l(e,t,a),a};class n extends s{constructor(){super(...arguments);S(this,"subType",o.StateMachine)}getMetaConfig(){let t=s.getRegisteredAssetMeta(s);return t={...t,defaultName:"StateMachineScript.ts",dragLayer:g.StateMachineScript},t}}b([h()],n.prototype,"subType",2);s.registerScriptConstruct(o.ShaderUI,u);s.registerScriptConstruct(o.StateMachine,n);export{o as EScriptSubType,s as ScriptAsset,u as ShaderUIScriptAsset,n as StateMachineScript,P as scriptTemplates};
1
+ var m=Object.defineProperty;var f=(r,e,t)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var S=(r,e,t)=>(f(r,typeof e!="symbol"?e+"":e,t),t);import{a as s,E as o,b as u}from"./ShaderUIScriptAsset-ebf57ceb.js";import{t as P}from"./ShaderUIScriptAsset-ebf57ceb.js";import{q as g,aT as h}from"./index-e44b357e.js";import"./index-debbe073.js";import"./postmen-443b3e5f.js";var l=Object.defineProperty,M=Object.getOwnPropertyDescriptor,b=(r,e,t,p)=>{for(var a=p>1?void 0:p?M(e,t):e,i=r.length-1,c;i>=0;i--)(c=r[i])&&(a=(p?c(e,t,a):c(a))||a);return p&&a&&l(e,t,a),a};class n extends s{constructor(){super(...arguments);S(this,"subType",o.StateMachine)}getMetaConfig(){let t=s.getRegisteredAssetMeta(s);return t={...t,defaultName:"StateMachineScript.ts",dragLayer:g.StateMachineScript},t}}b([h()],n.prototype,"subType",2);s.registerScriptConstruct(o.ShaderUI,u);s.registerScriptConstruct(o.StateMachine,n);export{o as EScriptSubType,s as ScriptAsset,u as ShaderUIScriptAsset,n as StateMachineScript,P as scriptTemplates};
@@ -1,4 +1,4 @@
1
- import{f0 as q,aH as b,aM as S,av as n,b7 as w,b8 as De,f1 as G,f2 as Oe,aI as Ye,f3 as it,aL as se,aP as st,f4 as at}from"./index-03b6134d.js";import{C as lt,M as ct}from"./Menu-62cee67e.js";/**
1
+ import{f0 as q,aH as b,aM as S,av as n,b7 as w,b8 as De,f1 as G,f2 as Oe,aI as Ye,f3 as it,aL as se,aP as st,f4 as at}from"./index-e44b357e.js";import{C as lt,M as ct}from"./Menu-05c1f0a4.js";/**
2
2
  * @license @tabler/icons-react v3.24.0 - MIT
3
3
  *
4
4
  * This source code is licensed under the MIT license.
@@ -1 +1 @@
1
- var x=Object.defineProperty;var C=(r,t,e)=>t in r?x(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var w=(r,t,e)=>(C(r,typeof t!="symbol"?t+"":t,e),e);import{dG as F,dH as U,dI as E,dJ as B,dK as R,dL as L}from"./index-03b6134d.js";import{T as M}from"./TaskQueue-05c94a4d.js";import{r as g,w as T}from"./ktx-parse.modern-6c9f771f.js";class P{constructor(t=4,e){w(this,"_taskQueue",[]);w(this,"_workerStatus",0);w(this,"_workerItems");this.limitedCount=t,this._workerCreator=e,this._workerItems=new Array(t)}prepareWorker(){const t=this.limitedCount,e=new Array(t);for(let a=0;a<t;a++)e.push(this._initWorker(a));return Promise.all(e)}postMessage(t){return new Promise((e,a)=>{const s=this._getIdleWorkerId();if(this._workerStatus|=1<<s,s!==-1){const n=this._workerItems;Promise.resolve(n[s]??this._initWorker(s)).then(()=>{const i=n[s];i.resolve=e,i.reject=a,i.worker.postMessage(t)}).catch(i=>{this._workerStatus^=1<<s,a(i)})}else this._taskQueue.push({resolve:e,reject:a,message:t})})}destroy(){const t=this._workerItems;for(let e=0,a=t.length;e<a;e++){const s=t[e];s.worker.terminate(),s.reject=null,s.resolve=null}t.length=0,this._taskQueue.length=0,this._workerStatus=0}_initWorker(t){return Promise.resolve(this._workerCreator()).then(e=>{const a=s=>{const n=this._workerItems[t];n!=null&&n.reject&&(n.reject(s.error||new Error("Worker error")),this._nextTask(t))};return e.addEventListener("message",this._onMessage.bind(this,t)),e.addEventListener("error",a),e.onerror=a,this._workerItems[t]={worker:e,resolve:null,reject:null},e})}_getIdleWorkerId(){for(let t=0,e=this.limitedCount;t<e;t++)if(!(this._workerStatus&1<<t))return t;return-1}_onMessage(t,e){e.data.error?this._workerItems[t].reject(e.data.error):this._workerItems[t].resolve(e),this._nextTask(t)}_nextTask(t){if(this._taskQueue.length){const e=this._taskQueue.shift(),a=this._workerItems[t];a.resolve=e.resolve,a.reject=e.reject,a.worker.postMessage(e.message)}else this._workerStatus^=1<<t}}var k=(r=>(r[r.cBASISTexType2D=0]="cBASISTexType2D",r[r.cBASISTexType2DArray=1]="cBASISTexType2DArray",r[r.cBASISTexTypeCubemapArray=2]="cBASISTexTypeCubemapArray",r[r.cBASISTexTypeVideoFrames=3]="cBASISTexTypeVideoFrames",r[r.cBASISTexTypeVolume=4]="cBASISTexTypeVolume",r))(k||{}),y=(r=>(r[r.RAW=0]="RAW",r[r.PNG=1]="PNG",r))(y||{}),v=(r=>(r[r.RGBAHalfFloat=0]="RGBAHalfFloat",r[r.RGBAFloat=1]="RGBAFloat",r[r.EXR=3]="EXR",r[r.HDR=4]="HDR",r))(v||{});const G=new M,D=F("ktx2","upload-cache");class p{get(t){return G.enqueue(()=>U(t,D))}set(t,e){return E(t,e,D)}}const b=new p,W={enableDebug:!1,isUASTC:!0,isKTX2File:!0,isInputSRGB:!0,generateMipmap:!0,needSupercompression:!0,isSetKTX2SRGBTransferFunc:!0,isHDR:!1,qualityLevel:150};function I(r={},t){r={...W,...r},r.enableDebug!==void 0&&t.setDebug(r.enableDebug),r.isUASTC!==void 0&&t.setUASTC(r.isUASTC),r.isKTX2File!==void 0&&t.setCreateKTX2File(r.isKTX2File),r.isSetKTX2SRGBTransferFunc!==void 0&&t.setKTX2SRGBTransferFunc(r.isSetKTX2SRGBTransferFunc),r.generateMipmap!==void 0&&t.setMipGen(r.generateMipmap),r.isYFlip!==void 0&&t.setYFlip(r.isYFlip),r.isNormalMap===!0&&t.setNormalMap(),r.qualityLevel!==void 0&&t.setQualityLevel(r.qualityLevel),r.compressionLevel!==void 0&&t.setCompressionLevel(r.compressionLevel),r.needSupercompression!==void 0&&t.setKTX2UASTCSupercompression(r.needSupercompression),r.enableRDO&&t.setRDOUASTC(!0),r.rdoQualityLevel!==void 0&&t.setRDOUASTCQualityScalar(r.rdoQualityLevel),r.uastcLDRQualityLevel!==void 0&&t.setPackUASTCFlags(r.uastcLDRQualityLevel),r.isHDR&&(t.setHDR(r.isHDR),r.hdrQualityLevel&&t.setUASTCHDRQualityLevel(r.hdrQualityLevel)),r.isPerceptual!==void 0&&t.setPerceptual(r.isPerceptual)}const X="https://mdn.alipayobjects.com/rms/afts/file/A*r7D4SKbksYcAAAAAAAAAAAAAARQnAQ/basis_encoder.wasm";let f=null;async function Q(r){return f||(f=(async()=>{const t=(r==null?void 0:r.wasmUrl)??X,e=(r==null?void 0:r.jsUrl)??"../basis/basis_encoder.js",[{default:a},s]=await Promise.all([fetch(e).then(i=>i.text()).then(i=>{const c=new Blob([i],{type:"application/javascript"});return B(()=>import(URL.createObjectURL(c)),[])}),t?fetch(t).then(i=>i.arrayBuffer()):void 0]),n=await a({wasmBinary:s});return n.initializeBasis(),n})()),f}async function K(r){const e=(()=>{let o=null;return()=>(o||(o=new OffscreenCanvas(128,128).getContext("webgl2",{premultipliedAlpha:!1})),o)})()(),a=await createImageBitmap(new Blob([r])),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a);const n=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);const{width:i,height:c}=a,l=new Uint8Array(i*c*4);return e.readPixels(0,0,i,c,e.RGBA,e.UNSIGNED_BYTE,l),e.deleteTexture(s),e.deleteFramebuffer(n),{data:l,width:i,height:c}}class H{async encode(t,e={}){const a=await Q(e);e.imageDecoder??(e.imageDecoder=K);const s=new a.BasisEncoder,n=Array.isArray(t)&&Array.isArray(t[0]),i=n||Array.isArray(t)&&t.length===6;if(n)return s.delete(),this._encodeCubeMipmap(a,t,e);I(e,s),s.setTexType(i?k.cBASISTexTypeCubemapArray:k.cBASISTexType2D);{const d=Array.isArray(t)?t:[t];for(let u=0;u<d.length;u++){const h=d[u];if(e.isHDR){const m=e.imageType,S=m===v.RGBAHalfFloat||m===v.RGBAFloat;s.setSliceSourceImageHDR(u,h,S?e.width:0,S?e.height:0,m,!0)}else{const m=await e.imageDecoder(h);s.setSliceSourceImage(u,new Uint8Array(m.data),m.width,m.height,y.RAW)}}}const c=new Uint8Array(1024*1024*(e.isHDR?24:10)),l=s.encode(c);if(l===0)throw new Error("Encode failed");let o=new Uint8Array(c.buffer,0,l);if(e.kvData){const d=g(o);for(let u in e.kvData)d.keyValue[u]=e.kvData[u];o=T(d,{keepWriter:!0})}return o}async _encodeCubeMipmap(t,e,a){const s={...a,generateMipmap:!1},n=a.width,i=a.height;let c=null;for(let l=0;l<e.length;l++){const o=e[l],d=n>>l,u=i>>l,h=new t.BasisEncoder;I(s,h),h.setTexType(k.cBASISTexTypeCubemapArray);for(let A=0;A<o.length;A++)a.isHDR?h.setSliceSourceImageHDR(A,o[A],d,u,a.imageType,!0):h.setSliceSourceImage(A,o[A],d,u,y.RAW);const m=new Uint8Array(1024*1024*(a.isHDR?24:10)),S=h.encode(m);if(h.delete(),S===0)throw new Error(`Encode failed at mip level ${l}`);const _=g(new Uint8Array(m.buffer,0,S));l===0?c=_:c.levels.push(_.levels[0])}if(a.kvData)for(const l in a.kvData)c.keyValue[l]=a.kvData[l];return T(c,{keepWriter:!0})}setTextureParams(t,e){const a=g(t);return a.keyValue.GalaceanTextureParams=new Uint8Array([e.wrapModeU,e.wrapModeV,e.filterMode,e.anisoLevel]),T(a)}}const j=new H,N=L("ktx2");class V{constructor(){w(this,"encoderWorkerPool");w(this,"initPromise");this.encoderWorkerPool=new P(4,()=>new Worker(new URL("/_static/ktx2-worker-7926d92b.js",self.location),{type:"module"})),this.initPromise=this.encoderWorkerPool.prepareWorker()}async encode(t,e={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){let a;const s=R.create();if(Array.isArray(t)&&Array.isArray(t[0])){for(const i of t)for(const c of i)s.update(c);a=s.hex()}else if(Array.isArray(t)){for(const i of t)s.update(i);a=s.hex()}else a=R(t);const n=a+JSON.stringify(e);try{const i=await b.get(n);if(i)return i}catch(i){console.error(i)}return this._encode(n,t,e)}setTextureParams(t,e){return j.setTextureParams(t,e)}async _encode(t,e,a={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){N.info(`cannot find cache, use worker encoder for ${t}`),await this.initPromise;const{data:s}=await this.encoderWorkerPool.postMessage({buffer:e,options:a});return b.set(t,s),s}}const $=new V;export{v as H,$ as k};
1
+ var x=Object.defineProperty;var C=(r,t,e)=>t in r?x(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var w=(r,t,e)=>(C(r,typeof t!="symbol"?t+"":t,e),e);import{dG as F,dH as U,dI as E,dJ as B,dK as R,dL as L}from"./index-e44b357e.js";import{T as M}from"./TaskQueue-05c94a4d.js";import{r as g,w as T}from"./ktx-parse.modern-6c9f771f.js";class P{constructor(t=4,e){w(this,"_taskQueue",[]);w(this,"_workerStatus",0);w(this,"_workerItems");this.limitedCount=t,this._workerCreator=e,this._workerItems=new Array(t)}prepareWorker(){const t=this.limitedCount,e=new Array(t);for(let a=0;a<t;a++)e.push(this._initWorker(a));return Promise.all(e)}postMessage(t){return new Promise((e,a)=>{const s=this._getIdleWorkerId();if(this._workerStatus|=1<<s,s!==-1){const n=this._workerItems;Promise.resolve(n[s]??this._initWorker(s)).then(()=>{const i=n[s];i.resolve=e,i.reject=a,i.worker.postMessage(t)}).catch(i=>{this._workerStatus^=1<<s,a(i)})}else this._taskQueue.push({resolve:e,reject:a,message:t})})}destroy(){const t=this._workerItems;for(let e=0,a=t.length;e<a;e++){const s=t[e];s.worker.terminate(),s.reject=null,s.resolve=null}t.length=0,this._taskQueue.length=0,this._workerStatus=0}_initWorker(t){return Promise.resolve(this._workerCreator()).then(e=>{const a=s=>{const n=this._workerItems[t];n!=null&&n.reject&&(n.reject(s.error||new Error("Worker error")),this._nextTask(t))};return e.addEventListener("message",this._onMessage.bind(this,t)),e.addEventListener("error",a),e.onerror=a,this._workerItems[t]={worker:e,resolve:null,reject:null},e})}_getIdleWorkerId(){for(let t=0,e=this.limitedCount;t<e;t++)if(!(this._workerStatus&1<<t))return t;return-1}_onMessage(t,e){e.data.error?this._workerItems[t].reject(e.data.error):this._workerItems[t].resolve(e),this._nextTask(t)}_nextTask(t){if(this._taskQueue.length){const e=this._taskQueue.shift(),a=this._workerItems[t];a.resolve=e.resolve,a.reject=e.reject,a.worker.postMessage(e.message)}else this._workerStatus^=1<<t}}var k=(r=>(r[r.cBASISTexType2D=0]="cBASISTexType2D",r[r.cBASISTexType2DArray=1]="cBASISTexType2DArray",r[r.cBASISTexTypeCubemapArray=2]="cBASISTexTypeCubemapArray",r[r.cBASISTexTypeVideoFrames=3]="cBASISTexTypeVideoFrames",r[r.cBASISTexTypeVolume=4]="cBASISTexTypeVolume",r))(k||{}),y=(r=>(r[r.RAW=0]="RAW",r[r.PNG=1]="PNG",r))(y||{}),v=(r=>(r[r.RGBAHalfFloat=0]="RGBAHalfFloat",r[r.RGBAFloat=1]="RGBAFloat",r[r.EXR=3]="EXR",r[r.HDR=4]="HDR",r))(v||{});const G=new M,D=F("ktx2","upload-cache");class p{get(t){return G.enqueue(()=>U(t,D))}set(t,e){return E(t,e,D)}}const b=new p,W={enableDebug:!1,isUASTC:!0,isKTX2File:!0,isInputSRGB:!0,generateMipmap:!0,needSupercompression:!0,isSetKTX2SRGBTransferFunc:!0,isHDR:!1,qualityLevel:150};function I(r={},t){r={...W,...r},r.enableDebug!==void 0&&t.setDebug(r.enableDebug),r.isUASTC!==void 0&&t.setUASTC(r.isUASTC),r.isKTX2File!==void 0&&t.setCreateKTX2File(r.isKTX2File),r.isSetKTX2SRGBTransferFunc!==void 0&&t.setKTX2SRGBTransferFunc(r.isSetKTX2SRGBTransferFunc),r.generateMipmap!==void 0&&t.setMipGen(r.generateMipmap),r.isYFlip!==void 0&&t.setYFlip(r.isYFlip),r.isNormalMap===!0&&t.setNormalMap(),r.qualityLevel!==void 0&&t.setQualityLevel(r.qualityLevel),r.compressionLevel!==void 0&&t.setCompressionLevel(r.compressionLevel),r.needSupercompression!==void 0&&t.setKTX2UASTCSupercompression(r.needSupercompression),r.enableRDO&&t.setRDOUASTC(!0),r.rdoQualityLevel!==void 0&&t.setRDOUASTCQualityScalar(r.rdoQualityLevel),r.uastcLDRQualityLevel!==void 0&&t.setPackUASTCFlags(r.uastcLDRQualityLevel),r.isHDR&&(t.setHDR(r.isHDR),r.hdrQualityLevel&&t.setUASTCHDRQualityLevel(r.hdrQualityLevel)),r.isPerceptual!==void 0&&t.setPerceptual(r.isPerceptual)}const X="https://mdn.alipayobjects.com/rms/afts/file/A*r7D4SKbksYcAAAAAAAAAAAAAARQnAQ/basis_encoder.wasm";let f=null;async function Q(r){return f||(f=(async()=>{const t=(r==null?void 0:r.wasmUrl)??X,e=(r==null?void 0:r.jsUrl)??"../basis/basis_encoder.js",[{default:a},s]=await Promise.all([fetch(e).then(i=>i.text()).then(i=>{const c=new Blob([i],{type:"application/javascript"});return B(()=>import(URL.createObjectURL(c)),[])}),t?fetch(t).then(i=>i.arrayBuffer()):void 0]),n=await a({wasmBinary:s});return n.initializeBasis(),n})()),f}async function K(r){const e=(()=>{let o=null;return()=>(o||(o=new OffscreenCanvas(128,128).getContext("webgl2",{premultipliedAlpha:!1})),o)})()(),a=await createImageBitmap(new Blob([r])),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a);const n=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0);const{width:i,height:c}=a,l=new Uint8Array(i*c*4);return e.readPixels(0,0,i,c,e.RGBA,e.UNSIGNED_BYTE,l),e.deleteTexture(s),e.deleteFramebuffer(n),{data:l,width:i,height:c}}class H{async encode(t,e={}){const a=await Q(e);e.imageDecoder??(e.imageDecoder=K);const s=new a.BasisEncoder,n=Array.isArray(t)&&Array.isArray(t[0]),i=n||Array.isArray(t)&&t.length===6;if(n)return s.delete(),this._encodeCubeMipmap(a,t,e);I(e,s),s.setTexType(i?k.cBASISTexTypeCubemapArray:k.cBASISTexType2D);{const d=Array.isArray(t)?t:[t];for(let u=0;u<d.length;u++){const h=d[u];if(e.isHDR){const m=e.imageType,S=m===v.RGBAHalfFloat||m===v.RGBAFloat;s.setSliceSourceImageHDR(u,h,S?e.width:0,S?e.height:0,m,!0)}else{const m=await e.imageDecoder(h);s.setSliceSourceImage(u,new Uint8Array(m.data),m.width,m.height,y.RAW)}}}const c=new Uint8Array(1024*1024*(e.isHDR?24:10)),l=s.encode(c);if(l===0)throw new Error("Encode failed");let o=new Uint8Array(c.buffer,0,l);if(e.kvData){const d=g(o);for(let u in e.kvData)d.keyValue[u]=e.kvData[u];o=T(d,{keepWriter:!0})}return o}async _encodeCubeMipmap(t,e,a){const s={...a,generateMipmap:!1},n=a.width,i=a.height;let c=null;for(let l=0;l<e.length;l++){const o=e[l],d=n>>l,u=i>>l,h=new t.BasisEncoder;I(s,h),h.setTexType(k.cBASISTexTypeCubemapArray);for(let A=0;A<o.length;A++)a.isHDR?h.setSliceSourceImageHDR(A,o[A],d,u,a.imageType,!0):h.setSliceSourceImage(A,o[A],d,u,y.RAW);const m=new Uint8Array(1024*1024*(a.isHDR?24:10)),S=h.encode(m);if(h.delete(),S===0)throw new Error(`Encode failed at mip level ${l}`);const _=g(new Uint8Array(m.buffer,0,S));l===0?c=_:c.levels.push(_.levels[0])}if(a.kvData)for(const l in a.kvData)c.keyValue[l]=a.kvData[l];return T(c,{keepWriter:!0})}setTextureParams(t,e){const a=g(t);return a.keyValue.GalaceanTextureParams=new Uint8Array([e.wrapModeU,e.wrapModeV,e.filterMode,e.anisoLevel]),T(a)}}const j=new H,N=L("ktx2");class V{constructor(){w(this,"encoderWorkerPool");w(this,"initPromise");this.encoderWorkerPool=new P(4,()=>new Worker(new URL("/_static/ktx2-worker-7926d92b.js",self.location),{type:"module"})),this.initPromise=this.encoderWorkerPool.prepareWorker()}async encode(t,e={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){let a;const s=R.create();if(Array.isArray(t)&&Array.isArray(t[0])){for(const i of t)for(const c of i)s.update(c);a=s.hex()}else if(Array.isArray(t)){for(const i of t)s.update(i);a=s.hex()}else a=R(t);const n=a+JSON.stringify(e);try{const i=await b.get(n);if(i)return i}catch(i){console.error(i)}return this._encode(n,t,e)}setTextureParams(t,e){return j.setTextureParams(t,e)}async _encode(t,e,a={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){N.info(`cannot find cache, use worker encoder for ${t}`),await this.initPromise;const{data:s}=await this.encoderWorkerPool.postMessage({buffer:e,options:a});return b.set(t,s),s}}const $=new V;export{v as H,$ as k};
@@ -1 +1 @@
1
- import{F as wt,G as ct,H as tt,I as bt,J as V,K as q,N as it,T as xt,O as Pt,Q as St,U as nt,W as zt,a as At,S as Lt,X as W,Y as st,Z as et,_ as Tt,$ as Mt}from"./index-03b6134d.js";function ot(a,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function Rt(a,n,i){return n&&ot(a.prototype,n),i&&ot(a,i),a}function Y(a,n){return Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Y(a,n)}function A(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Y(a,n)}function O(a,n,i,t){var e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,i):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,n,i,t);else for(var o=a.length-1;o>=0;o--)(s=a[o])&&(r=(e<3?s(r):e>3?s(n,i,r):s(n,i))||r);return e>3&&r&&Object.defineProperty(n,i,r),r}var Ot=4,It=.001,Ct=1e-7,Ft=10,D=11,N=1/(D-1),Vt=typeof Float32Array=="function";function _t(a,n){return 1-3*n+3*a}function dt(a,n){return 3*n-6*a}function yt(a){return 3*a}function G(a,n,i){return((_t(n,i)*a+dt(n,i))*a+yt(n))*a}function gt(a,n,i){return 3*_t(n,i)*a*a+2*dt(n,i)*a+yt(n)}function Ut(a,n,i,t,e){var r,s,o=0;do s=n+(i-n)/2,r=G(s,t,e)-a,r>0?i=s:n=s;while(Math.abs(r)>Ct&&++o<Ft);return s}function Bt(a,n,i,t){for(var e=0;e<Ot;++e){var r=gt(n,i,t);if(r===0)return n;var s=G(n,i,t)-a;n-=s/r}return n}function jt(a){return a}var Dt=function(n,i,t,e){if(!(0<=n&&n<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===i&&t===e)return jt;for(var r=Vt?new Float32Array(D):new Array(D),s=0;s<D;++s)r[s]=G(s*N,n,t);function o(u){for(var h=0,f=1,l=D-1;f!==l&&r[f]<=u;++f)h+=N;--f;var p=(u-r[f])/(r[f+1]-r[f]),c=h+p*N,v=gt(c,n,t);return v>=It?Bt(u,c,n,t):v===0?c:Ut(u,h,h+N,n,t)}return function(h){return h===0?0:h===1?1:G(o(h),i,e)}},at=200,ht={};function qt(a,n,i,t,e){var r=e||("bez_"+a+"_"+n+"_"+i+"_"+t).replace(/\./g,"p"),s=ht[r];return s||(s=Dt(a,n,i,t),ht[r]=s,s)}var $={};function Nt(a,n,i,t,e){var r=e?Math.min(e,at):at,s=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+i[0]+"_"+i[1]+"_"+t[0]+"_"+t[1]+"_"+r).replace(/\./g,"p");if(!$[s]){for(var o=0,u,h=[],f=0;f<r;f++){for(var l=i.length,p=new Array(l),c=f/(r-1),v=0,_=0;_<l;_+=1){var d=Math.pow(1-c,3)*a[_]+3*Math.pow(1-c,2)*c*(a[_]+i[_])+3*(1-c)*Math.pow(c,2)*(n[_]+t[_])+Math.pow(c,3)*n[_];p[_]=d,u&&(v+=Math.pow(p[_]-u[_],2))}v=Math.sqrt(v),o+=v,h.push({partialLength:v,point:p}),u=p}$[s]={segmentLength:o,points:h}}return $[s]}var K={buildBezierData:Nt,getBezierEasing:qt},L={euclideanModulo:function(n,i){return(n%i+i)%i},codomainBounce:function(n,i,t){return n<i?2*i-n:n>t?2*t-n:n},clamp:function(n,i,t){return n<i?i:n>t?t:n}},mt=/(loopIn|loopOut)\(([^)]+)/,Wt=/["']\w+["']/,ut=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in")return t>=this.begin?t:this.end-L.euclideanModulo(this.begin-t,this.total);if(this.type==="out")return t<=this.end?t:this.begin+L.euclideanModulo(t-this.end,this.total)},a}(),lt=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in"&&t<this.begin||this.type==="out"&&t>this.end){var e=t-this.end;return this.pingpong(e)}return t},n.pingpong=function(t){var e=Math.floor(t/this.total)%2;return e?this.begin+L.euclideanModulo(t,this.total):this.end-L.euclideanModulo(t,this.total)},a}(),ft={loopIn:function(n,i,t){var e=n[0].t,r=n.length-1,s=Math.min(r,t),o=n[s].t;switch(i){case"cycle":return new ut("in",e,o);case"pingpong":return new lt("in",e,o)}return null},loopOut:function(n,i,t){var e=n.length-1,r=Math.max(0,e-t),s=n[r].t,o=n[e].t;switch(i){case"cycle":return new ut("out",s,o);case"pingpong":return new lt("out",s,o)}return null}};function Gt(a){var n=a.split(/\s*,\s*/);return n.map(function(i){return Wt.test(i)?i.replace(/"|'/g,""):parseInt(i)})}function Kt(a){var n=a.match(mt),i=Gt(n[2]);return{name:n[1],mode:i[0],offset:i[1]}}function Ht(a){return a.x&&mt.test(a.x)}function Jt(a){var n=Kt(a.x),i=n.name,t=n.mode,e=n.offset,r=e===void 0?0:e,s=r===0?a.k.length-1:r;return ft[i]&&ft[i](a.k,t,s)}var H={hasSupportExpression:Ht,getExpression:Jt},Q=function(){function a(i,t){this.mult=t||1,this.value=i.k,this.animated=i.a,H.hasSupportExpression(i)&&(this.expression=H.getExpression(i))}var n=a.prototype;return n.getValue=function(t,e,r,s){var o,u=r.t,h=s.t,f=r.s[e],l=(s.s||r.e)[e];if(r.h===1)return f;if(t>=h)o=1;else if(t<u)o=0;else{var p=r.beziers[e];p||(typeof r.o.x=="number"?p=K.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y):p=K.getBezierEasing(r.o.x[e],r.o.y[e],r.i.x[e],r.i.y[e]),r.beziers[e]=p),o=p((t-u)/(h-u))}return f+(l-f)*o},n.reset=function(){},a}(),Qt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r.v=e?r.value*e:r.value,r}var i=n.prototype;return i.update=function(){this.v=this.value*this.mult},n}(Q),Zt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;r=a.call(this,t,e)||this;var s=r.value.length;r.v=new Float32Array(s),r.newValue=new Float32Array(s);for(var o=0;o<s;o+=1)r.v[o]=r.value[o]*r.mult;return r}var i=n.prototype;return i.update=function(){var e;e=this.value;for(var r=0,s=this.v.length;r<s;r++)this.v[r]=e[r]*this.mult},n}(Q),$t=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r._value=0,r.v=0,H.hasSupportExpression(t)&&(r.expression=H.getExpression(t)),r}var i=n.prototype;return i.reset=function(){this._value=0},i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s,o,u=0,h=r.length-1;u<h&&(s=r[u],o=r[u+1],!(o.t>e));u++);s.beziers||(s.beziers=[]),this.v=this.getValue(e,0,s,o)*this.mult},n}(Q),kt=function(a){A(n,a);function n(t,e,r){e===void 0&&(e=1);var s;s=a.call(this,t,e)||this,s._lastPoint=0,s._addedLength=0;var o=s.value[0].s.length;return r&&(s._frames=r>>0),s.newValue=new Float32Array(o),s.v=new Float32Array(o),s}var i=n.prototype;return i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s=this.newValue,o,u,h=0,f=r.length-1;h<f;h++)if(o=r[h],u=r[h+1],u.t>e){this._lastPoint=0,this._addedLength=0;break}if(e>u.t){for(var l=0,p=this.v.length;l<p;l++)this.v[l]=this.getValue(e,l,o,u)*this.mult;return}if(o.to){var c=u.t,v=o.t;o.bezierData||(o.bezierData=K.buildBezierData(o.s,u.s||o.e,o.to,o.ti,this._frames));var _=o.bezierData,d=_.points,m=_.segmentLength,y=o.timeBezier;y||(y=K.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n),o.timeBezier=y);var b=0;c>=0&&(b=(e-v)/(c-v),b=Math.min(Math.max(0,b),1));for(var g=y(b),x=m*g,E=this._addedLength,P=this._lastPoint,w=P,T=d.length;w<T;w++){if(w===T-1){P=0,E=0;break}P=w;var M=d[w],R=d[w+1],I=R.partialLength;if(x>=E&&x<E+I){for(var U=(x-E)/I,S=0,B=M.point.length;S<B;S+=1)s[S]=M.point[S]+(R.point[S]-M.point[S])*U;break}E+=I}this._lastPoint=P,this._addedLength=E}else{o.beziers||(o.beziers=[]);for(var C=0,j=o.s.length;C<j;C++)s[C]=this.getValue(e,C,o,u)}for(var F=0,Z=this.v.length;F<Z;F++)this.v[F]=s[F]*this.mult},n}(Q),Yt=function(){function a(i){this.properties=[],this.autoOrient=!1;var t=a.create;i.p.k?(this.p=t(i.p,1),this.properties.push(this.p)):(i.p.x&&(this.x=t(i.p.x,1),this.properties.push(this.x)),i.p.y&&(this.y=t(i.p.y,1),this.properties.push(this.y)),i.p.z&&(this.z=t(i.p.z,1),this.properties.push(this.z))),this.a=t(i.a,1),this.properties.push(this.a),this.s=t(i.s,1,.01),this.properties.push(this.s),this.o=t(i.o,0,.01),this.properties.push(this.o),i.r?(this.r=t(i.r,0),this.properties.push(this.r)):i.rx||i.ry||i.rz?(i.rx&&(this.rx=t(i.rx,0),this.properties.push(this.rx)),i.ry&&(this.ry=t(i.ry,0),this.properties.push(this.ry)),i.rz&&(this.rz=t(i.rz,0),this.properties.push(this.rz))):i.or&&(this.or=t(i.or,1),this.properties.push(this.or)),this.properties.length||this.update()}var n=a.prototype;return n.reset=function(){for(var t=0,e=this.properties.length;t<e;t++)this.properties[t].reset()},n.update=function(t){t===void 0&&(t=0);for(var e=this.properties.length,r=0;r<e;r++)this.properties[r].update(t);this.autoOrient},a.create=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t.k.length?typeof t.k[0]=="number"?new Zt(t,r):e?new kt(t,r,t.k[t.k.length-1].t-t.k[0].t):new $t(t,r):new Qt(t,r)},a}(),rt=function(){function a(i){this.stretch=1,this.parent=null,this.visible=!0,this.startTime=0,this.treeIndex=[],this.childLayers=[],this.is3D=!!i.ddd,this.name=i.nm||"",this.index=i.index,this.timeRemapping=i.tm,this.width=i.w,this.height=i.h,this.inPoint=i.ip,this.outPoint=i.op,i.st&&(this.startTime=i.st),this.stretch=i.stretch||1,this.offsetTime=i.offsetTime||0,i.ks&&(this.transform=new Yt(i.ks))}var n=a.prototype;return n.reset=function(){this.transform&&this.transform.reset();for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].reset()},n.update=function(t,e){t===void 0&&(t=0);var r=(t-this.offsetTime)/this.stretch;e===!0?this.visible=this.inPoint<=r&&this.outPoint>=r:e===!1&&(this.visible=!1),this.transform&&this.visible&&this.transform.update(r);for(var s=0;s<this.childLayers.length;s++)this.childLayers[s].update(t,this.visible)},n.addChild=function(t){t.parent=this,t.entity.parent=this.entity,this.childLayers.push(t)},n.destroy=function(){this.entity.parent=null,this.entity.destroy(),this.entity=null,this.transform=null,this.parent=null},a}(),k=function(a){A(n,a);function n(t,e,r,s){var o;if(o=a.call(this,t)||this,o.layers=t.layers,o.comps=t.comps,r)o.entity=r,s&&(o.entity.name=s);else{var u=new q(e,s);o.entity=u}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.layers=null,this.comps=null},n}(rt),Xt=function(a){A(n,a);function n(t,e,r,s){var o;o=a.call(this,t)||this;var u;if(t.refId){if(s)o.entity=s,u=s.getComponent(it),o.sprite=u.sprite;else{o.sprite=e.getSprite(t.refId);var h=new q(r.engine,t.nm);u=h.addComponent(it),u.sprite=o.sprite,o.entity=h}var f=o.sprite,l=f.atlasRegion,p=f.texture;p.wrapModeU=p.wrapModeV=xt.Clamp,o.spriteRenderer=u,u.priority=(Number.MAX_SAFE_INTEGER-o.index*1e6)/Number.MAX_SAFE_INTEGER,o.width=l.width*p.width,o.height=l.height*p.height}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.sprite=null,this.spriteRenderer=null},n}(rt),te=function(a){A(n,a);function n(i,t,e,r){var s,o,u,h;s=a.call(this,i)||this,e?(s.entity=e,r&&(s.entity.name=r)):s.entity=new q(t,i.nm);var f=s.entity.addComponent(Pt),l=(h=i)==null||(u=h.t)==null||(o=u.d)==null?void 0:o.k;if(l.length===1){var p,c,v=(c=l)==null||(p=c[0])==null?void 0:p.s;if(v){var _=v.t,d=v.f,m=v.s,y=v.fc,b=v.lh;f.font=St.createFromOS(t,d),f.text=_,f.fontSize=m,f.color.set(y[0],y[1],y[2],1),f.lineSpacing=b}else nt.warn("TextLottieElement: "+r+", No corresponding text data found.")}else nt.warn("TextLottieElement: multi keyframes feature is not supported in this version.");return f.priority=(Number.MAX_SAFE_INTEGER-s.index*1e6)/Number.MAX_SAFE_INTEGER,s}return n}(rt),z=function(a){A(n,a);function n(){var t;return t=a.apply(this,arguments)||this,t.repeats=0,t.isLooping=!1,t.isAlternate=!1,t.direction=1,t.speed=1,t.pixelsPerUnit=zt._pixelsPerUnit,t._alpha=1,t._priority=0,t._priorityDirty=!0,t._layer=At.Layer0,t._layerDirty=!0,t._autoPlay=!1,t._clipEndCallbacks={},t._isPlaying=!1,t._curFrame=0,t._frame=0,t._root=null,t}var i=n.prototype;return i.play=function(e){var r=this;if(e){var s=this.resource.clips[e];this._clip=s}else this._clip=null;return this._isPlaying=!0,this._frame=this._curFrame,new Promise(function(o){e?r._clipEndCallbacks[e]=o:r._clipEndCallbacks.ALL=o})},i.pause=function(){this._isPlaying=!1,this._curFrame=this._frame},i.stop=function(){this._isPlaying=!1,this._curFrame=0,this._frame=0},i._setLayer=function(e,r){r||(r=this.entity),r.layer=e;for(var s=r.children,o=s.length-1;o>=0;o--){var u=s[o];u.layer=e,this._setLayer(e,u)}},i._createLayerElements=function(e,r,s,o){if(e)for(var u=0,h=e.length;u<h;u++){var f=e[u],l=null;if(f.td===void 0){var p=s.treeIndex.concat(u),c=o&&this._findEntityInTree(p);switch(f.ty){case 0:l=new k(f,this.engine,c,f.id);break;case 2:l=new Xt(f,this._resource.atlas,this.entity,c);break;case 3:var v,_,d;((d=f)==null||(_=d.ks)==null||(v=_.o)==null?void 0:v.k)===0&&(f.ks.o.k=100),l=new k(f,this.engine,c,f.id);break;case 5:l=new te(f,this.engine,c,f.id);break}l&&(l.treeIndex=p,r.push(l),s.addChild(l),f.layers&&this._createLayerElements(f.layers,r,l,o))}}},i._findEntityInTree=function(e){for(var r,s=0,o=e.length;s<o;s++){var u=e[s];r?r=r.children[u]:r=this.entity.children[u]}return r},i._createElements=function(e,r){var s=new k(e,this.engine,this.entity);this._root=s;var o=s.layers,u=[];this._createLayerElements(o,u,s,r),this._elements=u},i._updateElements=function(e){this._root.update(e);for(var r=this._elements,s=0,o=r.length;s<o;s++){var u=r[s];this._updateElement(u)}},i._updateElement=function(e){var r,s,o,u,h=e.transform,f=e.entity,l=e.sprite,p=e.spriteRenderer,c=e.parent,v=e.width,_=e.height,d=f.transform,m=h.a.v,y=h.s.v,b=h.o.v,g=this.pixelsPerUnit,x=0,E=0,P=0;if(h.p){var w=h.p.v,T;x=(T=w[0])!=null?T:0;var M;E=(M=w[1])!=null?M:0;var R;P=(R=w[2])!=null?R:0}else h.x&&(x=h.x.v),h.y&&(E=h.y.v),h.z&&(P=h.z.v);var I=0,U=0,S=0;if(!e.visible){f.isActive=e.visible;return}if(h.r)S=h.r.v;else if(h.rx||h.ry||h.rz)I=h.rx?h.rx.v:0,U=h.ry?h.ry.v:0,S=h.rz?h.rz.v:0;else if(h.or){var B=h.or.v;I=B[0],U=B[1],S=B[2]}if(!((s=c)==null||(r=s.transform)==null)&&r.o){var C;b*=(C=c)==null?void 0:C.transform.o.v}if(l){var j=p.color,F=j.r,Z=j.g,Et=j.b;p.color.set(F,Z,Et,b*this._alpha),l.pixelsPerUnit=g,l.pivot=n._pivotVector.set(m[0]/v,(_-m[1])/_)}f.isActive=e.visible,d.setScale(y[0],y[1],y[2]),d.setRotation(I,U,-S),!((u=c)==null||(o=u.transform)==null)&&o.a?d.setPosition((x-c.transform.a.v[0])/g,(-E+c.transform.a.v[1])/g,P/g):d.setPosition((x-this._width/2)/g,(-E+this._height/2)/g,P/g)},i._resetElements=function(){for(var e=this._elements,r=0,s=e.length;r<s;r++)e[r].reset()},i.onUpdate=function(e){if(!this._isPlaying||!this._resource)return null;if(this._priorityDirty){this._priorityDirty=!1;var r=n._tempRenderers;r.length=0,this.entity.getComponentsIncludeChildren(bt,r);for(var s=0,o=0,u=r.length;o<u;++o){var h=r[o];o===0&&(s=this._priority-Math.floor(h.priority)),h.priority=h.priority+s}}this._layerDirty&&(this._layerDirty=!1,this._setLayer(this.layer,this.entity));var f=this.direction*this.speed*e*1e3;this._frame+=f/this._resource.timePerFrame;var l=this._clip;if(this._spill()){var p=this._resource.duration;if(this._resetElements(),this.repeats>0||this.isLooping)this.repeats>0&&--this.repeats,this.isAlternate?(this.direction*=-1,l?this._frame=L.codomainBounce(this._frame,0,l.end-l.start):this._frame=L.codomainBounce(this._frame,0,p)):(this.direction=1,l?this._frame=L.euclideanModulo(this._frame,l.end-l.start):this._frame=L.euclideanModulo(this._frame,p));else if(l){if(this._frame>=l.end-l.start){var c=this._clipEndCallbacks[l.name];c&&c(l)}this._frame=L.clamp(this._frame,0,l.end-l.start)}else{if(this._frame>=p){var v=this._clipEndCallbacks.ALL;v&&v()}this._frame=L.clamp(this._frame,0,p)}}l?this._updateElements(this._resource.inPoint+this._frame+l.start):this._updateElements(this._resource.inPoint+this._frame)},i._spill=function(){var e;if(this._clip){var r=this._clip;e=r.end-r.start}else e=this._resource.duration;var s=this._frame<=0&&this.direction===-1,o=this._frame>=e&&this.direction===1;return s||o},i._cloneTo=function(e){e._createElements(this._resource,!0)},i._destroy=function(){var e=this._elements;if(e)for(var r=0,s=e.length;r<s;r++)e[r].destroy()},i.onDestroy=function(){this._destroy()},Rt(n,[{key:"resource",get:function(){return this._resource},set:function(e){this._resource!==e&&(this._resource&&(this.pause(),this._destroy(),this._resource.refCount--,this._resource.refCount<=0&&this._resource.destroy()),this._resource=e,e&&(e.refCount++,this._width=e.width,this._height=e.height,this._createElements(e),this._priorityDirty=!0,this._layerDirty=!0),this._curFrame=0,this.play(),this.onUpdate(0),this.autoPlay||this.pause())}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!==e&&(this._priority=e,this._priorityDirty=!0)}},{key:"layer",get:function(){return this._layer},set:function(e){this._layer!==e&&(this._layer=e,this._layerDirty=!0)}},{key:"alpha",get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this.isPlaying||(this.play(),this.onUpdate(0),this.pause()))}},{key:"autoPlay",get:function(){return this._autoPlay},set:function(e){this._autoPlay=e,e&&this.play()}},{key:"frame",get:function(){return this._frame}},{key:"isPlaying",get:function(){return this._isPlaying}}]),n}(Lt);(function(){z._pivotVector=new wt})();(function(){z._tempRenderers=[]})();O([V],z.prototype,"_clipEndCallbacks",void 0);O([V],z.prototype,"_isPlaying",void 0);O([V],z.prototype,"_curFrame",void 0);O([V],z.prototype,"_frame",void 0);O([V],z.prototype,"_root",void 0);O([V],z.prototype,"_elements",void 0);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function J(){return J=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},J.apply(this,arguments)}function re(a){"@swc/helpers - typeof";return a&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a}var X=function(a){A(n,a);function n(t,e,r){var s;s=a.call(this,t)||this,s.refCount=0,s.timePerFrame=1e3/e.fr,s.duration=Math.floor(e.op-e.ip),s.width=e.w,s.height=e.h,s.inPoint=e.ip,s.outPoint=e.op,s.atlas=r,s.layers=e.layers,s.comps=e.assets,s.name=e.nm,s.clips={};var o={},u=ee(s).comps;if(u)for(var h=0,f=u.length;h<f;h++){var l=u[h];l.id&&(o[l.id]=l)}return s._buildTree(s.layers,o),e.lolitaAnimations&&s._parseAnimations(e.lolitaAnimations),s}var i=n.prototype;return i.setClips=function(e){this.clips={},this._parseAnimations(e)},i._parseAnimations=function(e){var r=this;e.forEach(function(s){r.clips[s.name]=J({},s)})},i._buildTree=function(e,r,s,o,u,h){s===void 0&&(s=0),o===void 0&&(o=1),u===void 0&&(u=0),h===void 0&&(h=1);for(var f={},l=0,p=e.length;l<p;l++){var c=e[l],v;f[(v=c.ind)!=null?v:l]=c}for(var _=e.length-1;_>=0;_--){var d=e[_],m=d.refId,y=d.parent;d.offsetTime=s,d.stretch=o;var b;if(d.index=((b=d.ind)!=null?b:_)*h+u,y&&(f[y].layers||(f[y].layers=[]),f[y].layers.push(d),e.splice(_,1)),m&&r[m]){for(var g=[],x=0;x<r[m].layers.length;x++)g.push(this._deepClone(r[m].layers[x]));var E=(d.offsetTime||0)+(d.st||0),P=(d.stretch||1)*(d.sr||1),w=g.length-1,T,M=h/(((T=g[w].ind)!=null?T:w)+1)*h;if(this._buildTree(g,r,E,P,d.index,M),d.layers){var R;(R=d.layers).push.apply(R,[].concat(g))}else d.layers=[].concat(g)}}},i._deepClone=function(e){var r=this,s=Array.isArray(e)?[].concat(e):J({},e);return Reflect.ownKeys(s).map(function(o){s[o]=r._isObject(e[o])?r._deepClone(e[o]):e[o]}),s},i._isObject=function(e){return(typeof e=="object"||typeof e=="function")&&(typeof e>"u"?"undefined":re(e))!==null},i.destroy=function(){var e,r;(e=(r=this.atlas).destroy)==null||e.call(r),this.atlas=null,this.layers=null,this.clips=null,this.comps=null,a.prototype.destroy.call(this)},n}(Tt),pt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){return new W(function(s,o){var u=e.url;r._request(u,{type:"json"}).then(function(h){var f=h.jsonUrl,l=h.atlasUrl,p=r._request(st.resolveAbsoluteUrl(u,f),r),c=r.load({url:st.resolveAbsoluteUrl(u,l),type:et.SpriteAtlas});W.all([p,c]).then(function(v){var _=v[0],d=v[1],m=r.engine,y=new X(m,_,d);s(y)}).catch(o)}).catch(o)})},n}(tt);pt=O([ct("EditorLottie",["json"])],pt);var ie=function(){function a(i,t){var e=this;this.sprites={},this.assetsPromises=[],this.assetsPromises=i.map(function(r){return t.resourceManager.load({url:r.p,type:et.Texture2D}).then(function(s){var o=new Mt(t);o.texture=s,e.sprites[r.id]=o})})}var n=a.prototype;return n.request=function(){return Promise.all(this.assetsPromises)},n.getSprite=function(t){return this.sprites[t]},a}(),vt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){var s=e.urls,o=r._request(s[0],{type:"json"});if(s[1]){var u=r.load({url:s[1],type:et.SpriteAtlas});return W.all([o,u]).then(function(h){var f=h[0],l=h[1],p=r.engine,c=new X(p,f,l),v=new q(p),_=v.addComponent(z);return _.resource=c,v})}else return W.all([o]).then(function(h){var f=h[0],l=r.engine,p=f.assets.filter(function(v){return v.p});f.assets=f.assets.filter(function(v){return!v.p});var c=new ie(p,l);return c.request().then(function(){var v=new X(l,f,c),_=new q(l),d=_.addComponent(z);return d.resource=v,_})})},n}(tt);vt=O([ct("lottie",["json"])],vt);tt.registerClass("LottieAnimation",z);export{z as L};
1
+ import{F as wt,G as ct,H as tt,I as bt,J as V,K as q,N as it,T as xt,O as Pt,Q as St,U as nt,W as zt,a as At,S as Lt,X as W,Y as st,Z as et,_ as Tt,$ as Mt}from"./index-e44b357e.js";function ot(a,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function Rt(a,n,i){return n&&ot(a.prototype,n),i&&ot(a,i),a}function Y(a,n){return Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Y(a,n)}function A(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Y(a,n)}function O(a,n,i,t){var e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,i):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,n,i,t);else for(var o=a.length-1;o>=0;o--)(s=a[o])&&(r=(e<3?s(r):e>3?s(n,i,r):s(n,i))||r);return e>3&&r&&Object.defineProperty(n,i,r),r}var Ot=4,It=.001,Ct=1e-7,Ft=10,D=11,N=1/(D-1),Vt=typeof Float32Array=="function";function _t(a,n){return 1-3*n+3*a}function dt(a,n){return 3*n-6*a}function yt(a){return 3*a}function G(a,n,i){return((_t(n,i)*a+dt(n,i))*a+yt(n))*a}function gt(a,n,i){return 3*_t(n,i)*a*a+2*dt(n,i)*a+yt(n)}function Ut(a,n,i,t,e){var r,s,o=0;do s=n+(i-n)/2,r=G(s,t,e)-a,r>0?i=s:n=s;while(Math.abs(r)>Ct&&++o<Ft);return s}function Bt(a,n,i,t){for(var e=0;e<Ot;++e){var r=gt(n,i,t);if(r===0)return n;var s=G(n,i,t)-a;n-=s/r}return n}function jt(a){return a}var Dt=function(n,i,t,e){if(!(0<=n&&n<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===i&&t===e)return jt;for(var r=Vt?new Float32Array(D):new Array(D),s=0;s<D;++s)r[s]=G(s*N,n,t);function o(u){for(var h=0,f=1,l=D-1;f!==l&&r[f]<=u;++f)h+=N;--f;var p=(u-r[f])/(r[f+1]-r[f]),c=h+p*N,v=gt(c,n,t);return v>=It?Bt(u,c,n,t):v===0?c:Ut(u,h,h+N,n,t)}return function(h){return h===0?0:h===1?1:G(o(h),i,e)}},at=200,ht={};function qt(a,n,i,t,e){var r=e||("bez_"+a+"_"+n+"_"+i+"_"+t).replace(/\./g,"p"),s=ht[r];return s||(s=Dt(a,n,i,t),ht[r]=s,s)}var $={};function Nt(a,n,i,t,e){var r=e?Math.min(e,at):at,s=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+i[0]+"_"+i[1]+"_"+t[0]+"_"+t[1]+"_"+r).replace(/\./g,"p");if(!$[s]){for(var o=0,u,h=[],f=0;f<r;f++){for(var l=i.length,p=new Array(l),c=f/(r-1),v=0,_=0;_<l;_+=1){var d=Math.pow(1-c,3)*a[_]+3*Math.pow(1-c,2)*c*(a[_]+i[_])+3*(1-c)*Math.pow(c,2)*(n[_]+t[_])+Math.pow(c,3)*n[_];p[_]=d,u&&(v+=Math.pow(p[_]-u[_],2))}v=Math.sqrt(v),o+=v,h.push({partialLength:v,point:p}),u=p}$[s]={segmentLength:o,points:h}}return $[s]}var K={buildBezierData:Nt,getBezierEasing:qt},L={euclideanModulo:function(n,i){return(n%i+i)%i},codomainBounce:function(n,i,t){return n<i?2*i-n:n>t?2*t-n:n},clamp:function(n,i,t){return n<i?i:n>t?t:n}},mt=/(loopIn|loopOut)\(([^)]+)/,Wt=/["']\w+["']/,ut=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in")return t>=this.begin?t:this.end-L.euclideanModulo(this.begin-t,this.total);if(this.type==="out")return t<=this.end?t:this.begin+L.euclideanModulo(t-this.end,this.total)},a}(),lt=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in"&&t<this.begin||this.type==="out"&&t>this.end){var e=t-this.end;return this.pingpong(e)}return t},n.pingpong=function(t){var e=Math.floor(t/this.total)%2;return e?this.begin+L.euclideanModulo(t,this.total):this.end-L.euclideanModulo(t,this.total)},a}(),ft={loopIn:function(n,i,t){var e=n[0].t,r=n.length-1,s=Math.min(r,t),o=n[s].t;switch(i){case"cycle":return new ut("in",e,o);case"pingpong":return new lt("in",e,o)}return null},loopOut:function(n,i,t){var e=n.length-1,r=Math.max(0,e-t),s=n[r].t,o=n[e].t;switch(i){case"cycle":return new ut("out",s,o);case"pingpong":return new lt("out",s,o)}return null}};function Gt(a){var n=a.split(/\s*,\s*/);return n.map(function(i){return Wt.test(i)?i.replace(/"|'/g,""):parseInt(i)})}function Kt(a){var n=a.match(mt),i=Gt(n[2]);return{name:n[1],mode:i[0],offset:i[1]}}function Ht(a){return a.x&&mt.test(a.x)}function Jt(a){var n=Kt(a.x),i=n.name,t=n.mode,e=n.offset,r=e===void 0?0:e,s=r===0?a.k.length-1:r;return ft[i]&&ft[i](a.k,t,s)}var H={hasSupportExpression:Ht,getExpression:Jt},Q=function(){function a(i,t){this.mult=t||1,this.value=i.k,this.animated=i.a,H.hasSupportExpression(i)&&(this.expression=H.getExpression(i))}var n=a.prototype;return n.getValue=function(t,e,r,s){var o,u=r.t,h=s.t,f=r.s[e],l=(s.s||r.e)[e];if(r.h===1)return f;if(t>=h)o=1;else if(t<u)o=0;else{var p=r.beziers[e];p||(typeof r.o.x=="number"?p=K.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y):p=K.getBezierEasing(r.o.x[e],r.o.y[e],r.i.x[e],r.i.y[e]),r.beziers[e]=p),o=p((t-u)/(h-u))}return f+(l-f)*o},n.reset=function(){},a}(),Qt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r.v=e?r.value*e:r.value,r}var i=n.prototype;return i.update=function(){this.v=this.value*this.mult},n}(Q),Zt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;r=a.call(this,t,e)||this;var s=r.value.length;r.v=new Float32Array(s),r.newValue=new Float32Array(s);for(var o=0;o<s;o+=1)r.v[o]=r.value[o]*r.mult;return r}var i=n.prototype;return i.update=function(){var e;e=this.value;for(var r=0,s=this.v.length;r<s;r++)this.v[r]=e[r]*this.mult},n}(Q),$t=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r._value=0,r.v=0,H.hasSupportExpression(t)&&(r.expression=H.getExpression(t)),r}var i=n.prototype;return i.reset=function(){this._value=0},i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s,o,u=0,h=r.length-1;u<h&&(s=r[u],o=r[u+1],!(o.t>e));u++);s.beziers||(s.beziers=[]),this.v=this.getValue(e,0,s,o)*this.mult},n}(Q),kt=function(a){A(n,a);function n(t,e,r){e===void 0&&(e=1);var s;s=a.call(this,t,e)||this,s._lastPoint=0,s._addedLength=0;var o=s.value[0].s.length;return r&&(s._frames=r>>0),s.newValue=new Float32Array(o),s.v=new Float32Array(o),s}var i=n.prototype;return i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s=this.newValue,o,u,h=0,f=r.length-1;h<f;h++)if(o=r[h],u=r[h+1],u.t>e){this._lastPoint=0,this._addedLength=0;break}if(e>u.t){for(var l=0,p=this.v.length;l<p;l++)this.v[l]=this.getValue(e,l,o,u)*this.mult;return}if(o.to){var c=u.t,v=o.t;o.bezierData||(o.bezierData=K.buildBezierData(o.s,u.s||o.e,o.to,o.ti,this._frames));var _=o.bezierData,d=_.points,m=_.segmentLength,y=o.timeBezier;y||(y=K.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n),o.timeBezier=y);var b=0;c>=0&&(b=(e-v)/(c-v),b=Math.min(Math.max(0,b),1));for(var g=y(b),x=m*g,E=this._addedLength,P=this._lastPoint,w=P,T=d.length;w<T;w++){if(w===T-1){P=0,E=0;break}P=w;var M=d[w],R=d[w+1],I=R.partialLength;if(x>=E&&x<E+I){for(var U=(x-E)/I,S=0,B=M.point.length;S<B;S+=1)s[S]=M.point[S]+(R.point[S]-M.point[S])*U;break}E+=I}this._lastPoint=P,this._addedLength=E}else{o.beziers||(o.beziers=[]);for(var C=0,j=o.s.length;C<j;C++)s[C]=this.getValue(e,C,o,u)}for(var F=0,Z=this.v.length;F<Z;F++)this.v[F]=s[F]*this.mult},n}(Q),Yt=function(){function a(i){this.properties=[],this.autoOrient=!1;var t=a.create;i.p.k?(this.p=t(i.p,1),this.properties.push(this.p)):(i.p.x&&(this.x=t(i.p.x,1),this.properties.push(this.x)),i.p.y&&(this.y=t(i.p.y,1),this.properties.push(this.y)),i.p.z&&(this.z=t(i.p.z,1),this.properties.push(this.z))),this.a=t(i.a,1),this.properties.push(this.a),this.s=t(i.s,1,.01),this.properties.push(this.s),this.o=t(i.o,0,.01),this.properties.push(this.o),i.r?(this.r=t(i.r,0),this.properties.push(this.r)):i.rx||i.ry||i.rz?(i.rx&&(this.rx=t(i.rx,0),this.properties.push(this.rx)),i.ry&&(this.ry=t(i.ry,0),this.properties.push(this.ry)),i.rz&&(this.rz=t(i.rz,0),this.properties.push(this.rz))):i.or&&(this.or=t(i.or,1),this.properties.push(this.or)),this.properties.length||this.update()}var n=a.prototype;return n.reset=function(){for(var t=0,e=this.properties.length;t<e;t++)this.properties[t].reset()},n.update=function(t){t===void 0&&(t=0);for(var e=this.properties.length,r=0;r<e;r++)this.properties[r].update(t);this.autoOrient},a.create=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t.k.length?typeof t.k[0]=="number"?new Zt(t,r):e?new kt(t,r,t.k[t.k.length-1].t-t.k[0].t):new $t(t,r):new Qt(t,r)},a}(),rt=function(){function a(i){this.stretch=1,this.parent=null,this.visible=!0,this.startTime=0,this.treeIndex=[],this.childLayers=[],this.is3D=!!i.ddd,this.name=i.nm||"",this.index=i.index,this.timeRemapping=i.tm,this.width=i.w,this.height=i.h,this.inPoint=i.ip,this.outPoint=i.op,i.st&&(this.startTime=i.st),this.stretch=i.stretch||1,this.offsetTime=i.offsetTime||0,i.ks&&(this.transform=new Yt(i.ks))}var n=a.prototype;return n.reset=function(){this.transform&&this.transform.reset();for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].reset()},n.update=function(t,e){t===void 0&&(t=0);var r=(t-this.offsetTime)/this.stretch;e===!0?this.visible=this.inPoint<=r&&this.outPoint>=r:e===!1&&(this.visible=!1),this.transform&&this.visible&&this.transform.update(r);for(var s=0;s<this.childLayers.length;s++)this.childLayers[s].update(t,this.visible)},n.addChild=function(t){t.parent=this,t.entity.parent=this.entity,this.childLayers.push(t)},n.destroy=function(){this.entity.parent=null,this.entity.destroy(),this.entity=null,this.transform=null,this.parent=null},a}(),k=function(a){A(n,a);function n(t,e,r,s){var o;if(o=a.call(this,t)||this,o.layers=t.layers,o.comps=t.comps,r)o.entity=r,s&&(o.entity.name=s);else{var u=new q(e,s);o.entity=u}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.layers=null,this.comps=null},n}(rt),Xt=function(a){A(n,a);function n(t,e,r,s){var o;o=a.call(this,t)||this;var u;if(t.refId){if(s)o.entity=s,u=s.getComponent(it),o.sprite=u.sprite;else{o.sprite=e.getSprite(t.refId);var h=new q(r.engine,t.nm);u=h.addComponent(it),u.sprite=o.sprite,o.entity=h}var f=o.sprite,l=f.atlasRegion,p=f.texture;p.wrapModeU=p.wrapModeV=xt.Clamp,o.spriteRenderer=u,u.priority=(Number.MAX_SAFE_INTEGER-o.index*1e6)/Number.MAX_SAFE_INTEGER,o.width=l.width*p.width,o.height=l.height*p.height}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.sprite=null,this.spriteRenderer=null},n}(rt),te=function(a){A(n,a);function n(i,t,e,r){var s,o,u,h;s=a.call(this,i)||this,e?(s.entity=e,r&&(s.entity.name=r)):s.entity=new q(t,i.nm);var f=s.entity.addComponent(Pt),l=(h=i)==null||(u=h.t)==null||(o=u.d)==null?void 0:o.k;if(l.length===1){var p,c,v=(c=l)==null||(p=c[0])==null?void 0:p.s;if(v){var _=v.t,d=v.f,m=v.s,y=v.fc,b=v.lh;f.font=St.createFromOS(t,d),f.text=_,f.fontSize=m,f.color.set(y[0],y[1],y[2],1),f.lineSpacing=b}else nt.warn("TextLottieElement: "+r+", No corresponding text data found.")}else nt.warn("TextLottieElement: multi keyframes feature is not supported in this version.");return f.priority=(Number.MAX_SAFE_INTEGER-s.index*1e6)/Number.MAX_SAFE_INTEGER,s}return n}(rt),z=function(a){A(n,a);function n(){var t;return t=a.apply(this,arguments)||this,t.repeats=0,t.isLooping=!1,t.isAlternate=!1,t.direction=1,t.speed=1,t.pixelsPerUnit=zt._pixelsPerUnit,t._alpha=1,t._priority=0,t._priorityDirty=!0,t._layer=At.Layer0,t._layerDirty=!0,t._autoPlay=!1,t._clipEndCallbacks={},t._isPlaying=!1,t._curFrame=0,t._frame=0,t._root=null,t}var i=n.prototype;return i.play=function(e){var r=this;if(e){var s=this.resource.clips[e];this._clip=s}else this._clip=null;return this._isPlaying=!0,this._frame=this._curFrame,new Promise(function(o){e?r._clipEndCallbacks[e]=o:r._clipEndCallbacks.ALL=o})},i.pause=function(){this._isPlaying=!1,this._curFrame=this._frame},i.stop=function(){this._isPlaying=!1,this._curFrame=0,this._frame=0},i._setLayer=function(e,r){r||(r=this.entity),r.layer=e;for(var s=r.children,o=s.length-1;o>=0;o--){var u=s[o];u.layer=e,this._setLayer(e,u)}},i._createLayerElements=function(e,r,s,o){if(e)for(var u=0,h=e.length;u<h;u++){var f=e[u],l=null;if(f.td===void 0){var p=s.treeIndex.concat(u),c=o&&this._findEntityInTree(p);switch(f.ty){case 0:l=new k(f,this.engine,c,f.id);break;case 2:l=new Xt(f,this._resource.atlas,this.entity,c);break;case 3:var v,_,d;((d=f)==null||(_=d.ks)==null||(v=_.o)==null?void 0:v.k)===0&&(f.ks.o.k=100),l=new k(f,this.engine,c,f.id);break;case 5:l=new te(f,this.engine,c,f.id);break}l&&(l.treeIndex=p,r.push(l),s.addChild(l),f.layers&&this._createLayerElements(f.layers,r,l,o))}}},i._findEntityInTree=function(e){for(var r,s=0,o=e.length;s<o;s++){var u=e[s];r?r=r.children[u]:r=this.entity.children[u]}return r},i._createElements=function(e,r){var s=new k(e,this.engine,this.entity);this._root=s;var o=s.layers,u=[];this._createLayerElements(o,u,s,r),this._elements=u},i._updateElements=function(e){this._root.update(e);for(var r=this._elements,s=0,o=r.length;s<o;s++){var u=r[s];this._updateElement(u)}},i._updateElement=function(e){var r,s,o,u,h=e.transform,f=e.entity,l=e.sprite,p=e.spriteRenderer,c=e.parent,v=e.width,_=e.height,d=f.transform,m=h.a.v,y=h.s.v,b=h.o.v,g=this.pixelsPerUnit,x=0,E=0,P=0;if(h.p){var w=h.p.v,T;x=(T=w[0])!=null?T:0;var M;E=(M=w[1])!=null?M:0;var R;P=(R=w[2])!=null?R:0}else h.x&&(x=h.x.v),h.y&&(E=h.y.v),h.z&&(P=h.z.v);var I=0,U=0,S=0;if(!e.visible){f.isActive=e.visible;return}if(h.r)S=h.r.v;else if(h.rx||h.ry||h.rz)I=h.rx?h.rx.v:0,U=h.ry?h.ry.v:0,S=h.rz?h.rz.v:0;else if(h.or){var B=h.or.v;I=B[0],U=B[1],S=B[2]}if(!((s=c)==null||(r=s.transform)==null)&&r.o){var C;b*=(C=c)==null?void 0:C.transform.o.v}if(l){var j=p.color,F=j.r,Z=j.g,Et=j.b;p.color.set(F,Z,Et,b*this._alpha),l.pixelsPerUnit=g,l.pivot=n._pivotVector.set(m[0]/v,(_-m[1])/_)}f.isActive=e.visible,d.setScale(y[0],y[1],y[2]),d.setRotation(I,U,-S),!((u=c)==null||(o=u.transform)==null)&&o.a?d.setPosition((x-c.transform.a.v[0])/g,(-E+c.transform.a.v[1])/g,P/g):d.setPosition((x-this._width/2)/g,(-E+this._height/2)/g,P/g)},i._resetElements=function(){for(var e=this._elements,r=0,s=e.length;r<s;r++)e[r].reset()},i.onUpdate=function(e){if(!this._isPlaying||!this._resource)return null;if(this._priorityDirty){this._priorityDirty=!1;var r=n._tempRenderers;r.length=0,this.entity.getComponentsIncludeChildren(bt,r);for(var s=0,o=0,u=r.length;o<u;++o){var h=r[o];o===0&&(s=this._priority-Math.floor(h.priority)),h.priority=h.priority+s}}this._layerDirty&&(this._layerDirty=!1,this._setLayer(this.layer,this.entity));var f=this.direction*this.speed*e*1e3;this._frame+=f/this._resource.timePerFrame;var l=this._clip;if(this._spill()){var p=this._resource.duration;if(this._resetElements(),this.repeats>0||this.isLooping)this.repeats>0&&--this.repeats,this.isAlternate?(this.direction*=-1,l?this._frame=L.codomainBounce(this._frame,0,l.end-l.start):this._frame=L.codomainBounce(this._frame,0,p)):(this.direction=1,l?this._frame=L.euclideanModulo(this._frame,l.end-l.start):this._frame=L.euclideanModulo(this._frame,p));else if(l){if(this._frame>=l.end-l.start){var c=this._clipEndCallbacks[l.name];c&&c(l)}this._frame=L.clamp(this._frame,0,l.end-l.start)}else{if(this._frame>=p){var v=this._clipEndCallbacks.ALL;v&&v()}this._frame=L.clamp(this._frame,0,p)}}l?this._updateElements(this._resource.inPoint+this._frame+l.start):this._updateElements(this._resource.inPoint+this._frame)},i._spill=function(){var e;if(this._clip){var r=this._clip;e=r.end-r.start}else e=this._resource.duration;var s=this._frame<=0&&this.direction===-1,o=this._frame>=e&&this.direction===1;return s||o},i._cloneTo=function(e){e._createElements(this._resource,!0)},i._destroy=function(){var e=this._elements;if(e)for(var r=0,s=e.length;r<s;r++)e[r].destroy()},i.onDestroy=function(){this._destroy()},Rt(n,[{key:"resource",get:function(){return this._resource},set:function(e){this._resource!==e&&(this._resource&&(this.pause(),this._destroy(),this._resource.refCount--,this._resource.refCount<=0&&this._resource.destroy()),this._resource=e,e&&(e.refCount++,this._width=e.width,this._height=e.height,this._createElements(e),this._priorityDirty=!0,this._layerDirty=!0),this._curFrame=0,this.play(),this.onUpdate(0),this.autoPlay||this.pause())}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!==e&&(this._priority=e,this._priorityDirty=!0)}},{key:"layer",get:function(){return this._layer},set:function(e){this._layer!==e&&(this._layer=e,this._layerDirty=!0)}},{key:"alpha",get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this.isPlaying||(this.play(),this.onUpdate(0),this.pause()))}},{key:"autoPlay",get:function(){return this._autoPlay},set:function(e){this._autoPlay=e,e&&this.play()}},{key:"frame",get:function(){return this._frame}},{key:"isPlaying",get:function(){return this._isPlaying}}]),n}(Lt);(function(){z._pivotVector=new wt})();(function(){z._tempRenderers=[]})();O([V],z.prototype,"_clipEndCallbacks",void 0);O([V],z.prototype,"_isPlaying",void 0);O([V],z.prototype,"_curFrame",void 0);O([V],z.prototype,"_frame",void 0);O([V],z.prototype,"_root",void 0);O([V],z.prototype,"_elements",void 0);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function J(){return J=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},J.apply(this,arguments)}function re(a){"@swc/helpers - typeof";return a&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a}var X=function(a){A(n,a);function n(t,e,r){var s;s=a.call(this,t)||this,s.refCount=0,s.timePerFrame=1e3/e.fr,s.duration=Math.floor(e.op-e.ip),s.width=e.w,s.height=e.h,s.inPoint=e.ip,s.outPoint=e.op,s.atlas=r,s.layers=e.layers,s.comps=e.assets,s.name=e.nm,s.clips={};var o={},u=ee(s).comps;if(u)for(var h=0,f=u.length;h<f;h++){var l=u[h];l.id&&(o[l.id]=l)}return s._buildTree(s.layers,o),e.lolitaAnimations&&s._parseAnimations(e.lolitaAnimations),s}var i=n.prototype;return i.setClips=function(e){this.clips={},this._parseAnimations(e)},i._parseAnimations=function(e){var r=this;e.forEach(function(s){r.clips[s.name]=J({},s)})},i._buildTree=function(e,r,s,o,u,h){s===void 0&&(s=0),o===void 0&&(o=1),u===void 0&&(u=0),h===void 0&&(h=1);for(var f={},l=0,p=e.length;l<p;l++){var c=e[l],v;f[(v=c.ind)!=null?v:l]=c}for(var _=e.length-1;_>=0;_--){var d=e[_],m=d.refId,y=d.parent;d.offsetTime=s,d.stretch=o;var b;if(d.index=((b=d.ind)!=null?b:_)*h+u,y&&(f[y].layers||(f[y].layers=[]),f[y].layers.push(d),e.splice(_,1)),m&&r[m]){for(var g=[],x=0;x<r[m].layers.length;x++)g.push(this._deepClone(r[m].layers[x]));var E=(d.offsetTime||0)+(d.st||0),P=(d.stretch||1)*(d.sr||1),w=g.length-1,T,M=h/(((T=g[w].ind)!=null?T:w)+1)*h;if(this._buildTree(g,r,E,P,d.index,M),d.layers){var R;(R=d.layers).push.apply(R,[].concat(g))}else d.layers=[].concat(g)}}},i._deepClone=function(e){var r=this,s=Array.isArray(e)?[].concat(e):J({},e);return Reflect.ownKeys(s).map(function(o){s[o]=r._isObject(e[o])?r._deepClone(e[o]):e[o]}),s},i._isObject=function(e){return(typeof e=="object"||typeof e=="function")&&(typeof e>"u"?"undefined":re(e))!==null},i.destroy=function(){var e,r;(e=(r=this.atlas).destroy)==null||e.call(r),this.atlas=null,this.layers=null,this.clips=null,this.comps=null,a.prototype.destroy.call(this)},n}(Tt),pt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){return new W(function(s,o){var u=e.url;r._request(u,{type:"json"}).then(function(h){var f=h.jsonUrl,l=h.atlasUrl,p=r._request(st.resolveAbsoluteUrl(u,f),r),c=r.load({url:st.resolveAbsoluteUrl(u,l),type:et.SpriteAtlas});W.all([p,c]).then(function(v){var _=v[0],d=v[1],m=r.engine,y=new X(m,_,d);s(y)}).catch(o)}).catch(o)})},n}(tt);pt=O([ct("EditorLottie",["json"])],pt);var ie=function(){function a(i,t){var e=this;this.sprites={},this.assetsPromises=[],this.assetsPromises=i.map(function(r){return t.resourceManager.load({url:r.p,type:et.Texture2D}).then(function(s){var o=new Mt(t);o.texture=s,e.sprites[r.id]=o})})}var n=a.prototype;return n.request=function(){return Promise.all(this.assetsPromises)},n.getSprite=function(t){return this.sprites[t]},a}(),vt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){var s=e.urls,o=r._request(s[0],{type:"json"});if(s[1]){var u=r.load({url:s[1],type:et.SpriteAtlas});return W.all([o,u]).then(function(h){var f=h[0],l=h[1],p=r.engine,c=new X(p,f,l),v=new q(p),_=v.addComponent(z);return _.resource=c,v})}else return W.all([o]).then(function(h){var f=h[0],l=r.engine,p=f.assets.filter(function(v){return v.p});f.assets=f.assets.filter(function(v){return!v.p});var c=new ie(p,l);return c.request().then(function(){var v=new X(l,f,c),_=new q(l),d=_.addComponent(z);return d.resource=v,_})})},n}(tt);vt=O([ct("lottie",["json"])],vt);tt.registerClass("LottieAnimation",z);export{z as L};