From d6bd31c9a06774d4141b3458577f30bdd20c3893 Mon Sep 17 00:00:00 2001 From: palmcivet Date: Sun, 7 Jul 2024 05:11:06 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20palmcive?= =?UTF-8?q?t/vector-network@5db55fbc97ea8e0d9573bed31bca0d82d064c9de=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{CanvasPool-CHCBO5uV.js => CanvasPool-CRu07Ks4.js} | 2 +- ...{SharedSystems-Bx3mXfBj.js => SharedSystems-CRMtzBk2.js} | 2 +- ...{WebGLRenderer-N8rVeROe.js => WebGLRenderer-Bo2izwAR.js} | 2 +- ...ebGPURenderer-lyM9mhaa.js => WebGPURenderer-CYDRqglR.js} | 2 +- assets/batchSamplersUniformGroup-BHYQQvaj.js | 1 - assets/batchSamplersUniformGroup-BaLj5C5z.js | 1 + assets/{browserAll-DQuq1onv.js => browserAll-BWV3Mmhk.js} | 2 +- ...olorToUniform-DMqhVWWI.js => colorToUniform-CFyxXhhI.js} | 2 +- assets/{index-DS_dDDq2.js => index-CjFptCTD.js} | 6 +++--- .../{webworkerAll-D78yVGWs.js => webworkerAll-_jBWuT__.js} | 2 +- index.html | 6 +++--- 11 files changed, 14 insertions(+), 14 deletions(-) rename assets/{CanvasPool-CHCBO5uV.js => CanvasPool-CRu07Ks4.js} (90%) rename assets/{SharedSystems-Bx3mXfBj.js => SharedSystems-CRMtzBk2.js} (99%) rename assets/{WebGLRenderer-N8rVeROe.js => WebGLRenderer-Bo2izwAR.js} (99%) rename assets/{WebGPURenderer-lyM9mhaa.js => WebGPURenderer-CYDRqglR.js} (99%) delete mode 100644 assets/batchSamplersUniformGroup-BHYQQvaj.js create mode 100644 assets/batchSamplersUniformGroup-BaLj5C5z.js rename assets/{browserAll-DQuq1onv.js => browserAll-BWV3Mmhk.js} (99%) rename assets/{colorToUniform-DMqhVWWI.js => colorToUniform-CFyxXhhI.js} (99%) rename assets/{index-DS_dDDq2.js => index-CjFptCTD.js} (70%) rename assets/{webworkerAll-D78yVGWs.js => webworkerAll-_jBWuT__.js} (99%) diff --git a/assets/CanvasPool-CHCBO5uV.js b/assets/CanvasPool-CRu07Ks4.js similarity index 90% rename from assets/CanvasPool-CHCBO5uV.js rename to assets/CanvasPool-CRu07Ks4.js index e669025..d5f2631 100644 --- a/assets/CanvasPool-CHCBO5uV.js +++ b/assets/CanvasPool-CRu07Ks4.js @@ -1 +1 @@ -import{D as c,n}from"./index-DS_dDDq2.js";class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,t){const s=c.get().createCanvas();s.width=a,s.height=t;const e=s.getContext("2d");return{canvas:s,context:e}}getOptimalCanvasAndContext(a,t,s=1){a=Math.ceil(a*s-1e-6),t=Math.ceil(t*s-1e-6),a=n(a),t=n(t);const e=(a<<17)+(t<<1);this._canvasPool[e]||(this._canvasPool[e]=[]);let o=this._canvasPool[e].pop();return o||(o=this._createCanvasAndContext(a,t)),o}returnCanvasAndContext(a){const{width:t,height:s}=a.canvas,e=(t<<17)+(s<<1);this._canvasPool[e].push(a)}clear(){this._canvasPool={}}}const C=new l;export{C}; +import{D as c,n}from"./index-CjFptCTD.js";class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,t){const s=c.get().createCanvas();s.width=a,s.height=t;const e=s.getContext("2d");return{canvas:s,context:e}}getOptimalCanvasAndContext(a,t,s=1){a=Math.ceil(a*s-1e-6),t=Math.ceil(t*s-1e-6),a=n(a),t=n(t);const e=(a<<17)+(t<<1);this._canvasPool[e]||(this._canvasPool[e]=[]);let o=this._canvasPool[e].pop();return o||(o=this._createCanvasAndContext(a,t)),o}returnCanvasAndContext(a){const{width:t,height:s}=a.canvas,e=(t<<17)+(s<<1);this._canvasPool[e].push(a)}clear(){this._canvasPool={}}}const C=new l;export{C}; diff --git a/assets/SharedSystems-Bx3mXfBj.js b/assets/SharedSystems-CRMtzBk2.js similarity index 99% rename from assets/SharedSystems-Bx3mXfBj.js rename to assets/SharedSystems-CRMtzBk2.js index 04beadc..088be57 100644 --- a/assets/SharedSystems-Bx3mXfBj.js +++ b/assets/SharedSystems-CRMtzBk2.js @@ -1,4 +1,4 @@ -import{l as Re,j as g,m as Ge,o as Be,E as u,p as b,q as Ue,s as N,F as q,t as Ae,k as m,S as p,d as G,w as K,v as Ie,b as z,B as k,h as B,u as C,i as _,R as w,x as Fe,a as De,C as S,y as Y,z as Ee,G as Oe,H as ze,I as J,e as X,J as Le,P as He,c as We,D as Q,K as Ve,L as je}from"./index-DS_dDDq2.js";import{b as $e,S as Z,G as ee,f as te,U as re,T as L,h as H,B as Ne,i as qe,R as se}from"./colorToUniform-DMqhVWWI.js";const ae=class U extends $e{constructor(e){e={...U.defaultOptions,...e},super(e),this.enabled=!0,this._state=Z.for2d(),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.addResource("uTexture",0,1)}apply(e,t,r,a){e.applyFilter(this,t,r,a)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...a}=e;let n,i;return t&&(n=ee.from(t)),r&&(i=te.from(r)),new U({gpuProgram:n,glProgram:i,...a})}};ae.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1};let Ke=ae;var Ye=`in vec2 vMaskCoord; +import{l as Re,j as g,m as Ge,o as Be,E as u,p as b,q as Ue,s as N,F as q,t as Ae,k as m,S as p,d as G,w as K,v as Ie,b as z,B as k,h as B,u as C,i as _,R as w,x as Fe,a as De,C as S,y as Y,z as Ee,G as Oe,H as ze,I as J,e as X,J as Le,P as He,c as We,D as Q,K as Ve,L as je}from"./index-CjFptCTD.js";import{b as $e,S as Z,G as ee,f as te,U as re,T as L,h as H,B as Ne,i as qe,R as se}from"./colorToUniform-CFyxXhhI.js";const ae=class U extends $e{constructor(e){e={...U.defaultOptions,...e},super(e),this.enabled=!0,this._state=Z.for2d(),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.addResource("uTexture",0,1)}apply(e,t,r,a){e.applyFilter(this,t,r,a)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...a}=e;let n,i;return t&&(n=ee.from(t)),r&&(i=te.from(r)),new U({gpuProgram:n,glProgram:i,...a})}};ae.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1};let Ke=ae;var Ye=`in vec2 vMaskCoord; in vec2 vTextureCoord; uniform sampler2D uTexture; diff --git a/assets/WebGLRenderer-N8rVeROe.js b/assets/WebGLRenderer-Bo2izwAR.js similarity index 99% rename from assets/WebGLRenderer-N8rVeROe.js rename to assets/WebGLRenderer-Bo2izwAR.js index ae2c0ee..3385101 100644 --- a/assets/WebGLRenderer-N8rVeROe.js +++ b/assets/WebGLRenderer-Bo2izwAR.js @@ -1,4 +1,4 @@ -import{M as $,E as l,B as A,D as G,w as b,N as Be,k as S,i as z,S as g,R as w,h as Ne,d as B,j as Y,e as v,A as Ie}from"./index-DS_dDDq2.js";import{S as U,j as O,k as q,m as Z,n as P,b as x,h as Q,f as De,U as F,o as J,R as ye}from"./colorToUniform-DMqhVWWI.js";import{b as ee}from"./batchSamplersUniformGroup-BHYQQvaj.js";import{e as Ce,G as Ge,c as Ue,b as Oe,U as Pe,R as Fe,B as te,d as N,f as Me,S as Le,a as He}from"./SharedSystems-Bx3mXfBj.js";class re{constructor(){this._didUpload=!1,this._tempState=U.for2d()}init(e){const r=O({name:"batch",bits:[q,Z($),P]});this._shader=new x({glProgram:r,resources:{batchSamplers:ee}}),e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r){const s=e.renderer;s.shader.bind(this._shader,this._didUpload),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,this._shader.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class we{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class se{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&A.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&A.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&A.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new we(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}se.extension={type:[l.WebGLSystem],name:"buffer"};const M=class ne{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){if(e={...ne.defaultOptions,...e},e.context)this.initFromContext(e.context);else{const r=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:r,premultipliedAlpha:s,antialias:n,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof G.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let s;const n=this._renderer.view.canvas;if(e===2&&(s=n.getContext("webgl2",r)),!s&&(s=n.getContext("webgl",r),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const s=e.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{var r;this.gl.isContextLost()&&((r=this.extensions.loseContext)==null||r.restoreContext())},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){var r;const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),(r=this.extensions.loseContext)==null||r.loseContext()}forceContextLoss(){var e;(e=this.extensions.loseContext)==null||e.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};M.extension={type:[l.WebGLSystem],name:"context"};M.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2};let ke=M;var y=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(y||{}),ie=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(ie||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const k={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function Ve(t){return k[t]??k.float32}const Xe={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ae{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[l.WebGLSystem],name:"geometry"};const We=new Be({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),L=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=U.for2d();const n=new De({vertex:` +import{M as $,E as l,B as A,D as G,w as b,N as Be,k as S,i as z,S as g,R as w,h as Ne,d as B,j as Y,e as v,A as Ie}from"./index-CjFptCTD.js";import{S as U,j as O,k as q,m as Z,n as P,b as x,h as Q,f as De,U as F,o as J,R as ye}from"./colorToUniform-CFyxXhhI.js";import{b as ee}from"./batchSamplersUniformGroup-BaLj5C5z.js";import{e as Ce,G as Ge,c as Ue,b as Oe,U as Pe,R as Fe,B as te,d as N,f as Me,S as Le,a as He}from"./SharedSystems-CRMtzBk2.js";class re{constructor(){this._didUpload=!1,this._tempState=U.for2d()}init(e){const r=O({name:"batch",bits:[q,Z($),P]});this._shader=new x({glProgram:r,resources:{batchSamplers:ee}}),e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r){const s=e.renderer;s.shader.bind(this._shader,this._didUpload),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,this._shader.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class we{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class se{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&A.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&A.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&A.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new we(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}se.extension={type:[l.WebGLSystem],name:"buffer"};const M=class ne{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){if(e={...ne.defaultOptions,...e},e.context)this.initFromContext(e.context);else{const r=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:r,premultipliedAlpha:s,antialias:n,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof G.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let s;const n=this._renderer.view.canvas;if(e===2&&(s=n.getContext("webgl2",r)),!s&&(s=n.getContext("webgl",r),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const s=e.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{var r;this.gl.isContextLost()&&((r=this.extensions.loseContext)==null||r.restoreContext())},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){var r;const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),(r=this.extensions.loseContext)==null||r.loseContext()}forceContextLoss(){var e;(e=this.extensions.loseContext)==null||e.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&b("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||b("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};M.extension={type:[l.WebGLSystem],name:"context"};M.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2};let ke=M;var y=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(y||{}),ie=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(ie||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const k={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function Ve(t){return k[t]??k.float32}const Xe={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ae{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ae.extension={type:[l.WebGLSystem],name:"geometry"};const We=new Be({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),L=class oe{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...oe.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(b("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=U.for2d();const n=new De({vertex:` attribute vec2 aPosition; out vec2 vUv; diff --git a/assets/WebGPURenderer-lyM9mhaa.js b/assets/WebGPURenderer-CYDRqglR.js similarity index 99% rename from assets/WebGPURenderer-lyM9mhaa.js rename to assets/WebGPURenderer-CYDRqglR.js index 85424cd..43822e6 100644 --- a/assets/WebGPURenderer-lyM9mhaa.js +++ b/assets/WebGPURenderer-CYDRqglR.js @@ -1,4 +1,4 @@ -import{M as R,g as E,E as l,f as ie,S as P,B as S,b as ne,c as A,d as b,h as oe,i as ae,D as ue,j as k,k as M,w as ce,e as G,A as de}from"./index-DS_dDDq2.js";import{S as D,c as T,a as z,g as L,r as C,b as v,d as he,U as pe,l as le,e as fe,R as ge}from"./colorToUniform-DMqhVWWI.js";import{c as me,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te}from"./SharedSystems-Bx3mXfBj.js";import{C as w}from"./CanvasPool-CHCBO5uV.js";const y=D.for2d();class O{init(){const e=T({name:"batch",bits:[z,L(R),C]});this._shader=new v({gpuProgram:e,groups:{}})}start(e,t){const r=e.renderer,s=r.encoder,i=this._shader.gpuProgram;this._geometry=t,s.setGeometry(t),y.blendMode="normal",r.pipeline.getPipeline(t,i,y);const n=r.globalUniforms.bindGroup;s.resetBindGroup(1),s.setBindGroup(0,n,i)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=E(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}destroy(){this._shader.destroy(!0),this._shader=null}}O.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class H{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const g=d.buffer;p={buffer:o.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}H.extension={type:[l.WebGPUSystem],name:"bindGroup"};class F{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ie(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,this._managedBuffers.push(e),t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}F.extension={type:[l.WebGPUSystem],name:"buffer"};class Ce{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await navigator.gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class W{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e){for(const t in e.attributes){const r=e.attributes[t];this._setVertexBuffer(r.location,r.buffer)}e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}W.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class V{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:P.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}V.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:4,size:4},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:8,size:6},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:8,size:8},"mat2x2":{align:8,size:16},"mat2x2":{align:4,size:8},"mat3x2":{align:8,size:24},"mat3x2":{align:4,size:12},"mat4x2":{align:8,size:32},"mat4x2":{align:4,size:16},"mat2x3":{align:16,size:32},"mat2x3":{align:8,size:16},"mat3x3":{align:16,size:48},"mat3x3":{align:8,size:24},"mat4x3":{align:16,size:64},"mat4x3":{align:8,size:32},"mat2x4":{align:16,size:32},"mat2x4":{align:8,size:16},"mat3x4":{align:16,size:48},"mat3x4":{align:8,size:24},"mat4x4":{align:16,size:64},"mat4x4":{align:8,size:32}};function ve(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return` +import{M as R,g as E,E as l,f as ie,S as P,B as S,b as ne,c as A,d as b,h as oe,i as ae,D as ue,j as k,k as M,w as ce,e as G,A as de}from"./index-CjFptCTD.js";import{S as D,c as T,a as z,g as L,r as C,b as v,d as he,U as pe,l as le,e as fe,R as ge}from"./colorToUniform-CFyxXhhI.js";import{c as me,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te}from"./SharedSystems-CRMtzBk2.js";import{C as w}from"./CanvasPool-CRu07Ks4.js";const y=D.for2d();class O{init(){const e=T({name:"batch",bits:[z,L(R),C]});this._shader=new v({gpuProgram:e,groups:{}})}start(e,t){const r=e.renderer,s=r.encoder,i=this._shader.gpuProgram;this._geometry=t,s.setGeometry(t),y.blendMode="normal",r.pipeline.getPipeline(t,i,y);const n=r.globalUniforms.bindGroup;s.resetBindGroup(1),s.setBindGroup(0,n,i)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=E(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}destroy(){this._shader.destroy(!0),this._shader=null}}O.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class H{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const g=d.buffer;p={buffer:o.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}H.extension={type:[l.WebGPUSystem],name:"bindGroup"};class F{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ie(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,this._managedBuffers.push(e),t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}F.extension={type:[l.WebGPUSystem],name:"buffer"};class Ce{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await navigator.gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class W{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e){for(const t in e.attributes){const r=e.attributes[t];this._setVertexBuffer(r.location,r.buffer)}e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}W.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class V{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:P.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}V.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:4,size:4},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:8,size:6},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:8,size:8},"mat2x2":{align:8,size:16},"mat2x2":{align:4,size:8},"mat3x2":{align:8,size:24},"mat3x2":{align:4,size:12},"mat4x2":{align:8,size:32},"mat4x2":{align:4,size:16},"mat2x3":{align:16,size:32},"mat2x3":{align:8,size:16},"mat3x3":{align:16,size:48},"mat3x3":{align:8,size:24},"mat4x3":{align:16,size:64},"mat4x3":{align:8,size:32},"mat2x4":{align:16,size:32},"mat2x4":{align:8,size:16},"mat3x4":{align:16,size:48},"mat3x4":{align:8,size:24},"mat4x4":{align:16,size:64},"mat4x4":{align:8,size:32}};function ve(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return` v = uv.${a.data.name}; ${e!==0?`offset += ${e};`:""} diff --git a/assets/batchSamplersUniformGroup-BHYQQvaj.js b/assets/batchSamplersUniformGroup-BHYQQvaj.js deleted file mode 100644 index 01db5b5..0000000 --- a/assets/batchSamplersUniformGroup-BHYQQvaj.js +++ /dev/null @@ -1 +0,0 @@ -import{M as e}from"./index-DS_dDDq2.js";import{U as o}from"./colorToUniform-DMqhVWWI.js";const t=new Int32Array(e);for(let r=0;r1&&typeof MSStream>"u"};function te(r){return function(e){return e.test(r)}}function W(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),(e=this._renderer.view.canvas.parentNode)==null||e.appendChild(this._div))}_deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),(e=this._div.parentNode)==null||e.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(s,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(B.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(B.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{e.currentTarget=i[s],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;h--){const l=v[h],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,i,n,s,o||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();(u.length>0||d)&&(d&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let v=c.length-1;v>=0;v--){const h=c[v],l=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,p,n,s);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const u=e.isInteractive();return(l.length>0||u)&&l.push(e),l}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i0&&s!==t.target){const v=e.type==="mousemove"?"mouseout":"pointerout",h=this.createPointerEvent(e,v,s);if(this.dispatchEvent(h,"pointerout"),i&&this.dispatchEvent(h,"mouseout"),!t.composedPath().includes(s)){const l=this.createPointerEvent(e,"pointerleave",s);for(l.eventPhase=l.AT_TARGET;l.target&&!t.composedPath().includes(l.target);)l.currentTarget=l.target,this.notifyTarget(l),i&&this.notifyTarget(l,"mouseleave"),l.target=l.target.parent;this.freeEvent(l)}this.freeEvent(h)}if(s!==t.target){const v=e.type==="mousemove"?"mouseover":"pointerover",h=this.clonePointerEvent(t,v);this.dispatchEvent(h,"pointerover"),i&&this.dispatchEvent(h,"mouseover");let l=s==null?void 0:s.parent;for(;l&&l!==this.rootTarget.parent&&l!==t.target;)l=l.parent;if(!l||l===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(h)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(p=t.target)==null?void 0:p.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};L.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};L.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=L;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(r){this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(r,a,o)}),s?c.once(r,a,o):c.on(r,a,o)},removeEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,n)},dispatchEvent(r){if(!(r instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me); +import{P as m,r as J,E as w,T as B,U as Q,a as ee,w as y,e as z,C as Z}from"./index-CjFptCTD.js";import"./webworkerAll-_jBWuT__.js";import"./colorToUniform-CFyxXhhI.js";import"./CanvasPool-CRu07Ks4.js";import"./batchSamplersUniformGroup-BaLj5C5z.js";class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function te(r){return function(e){return e.test(r)}}function W(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),(e=this._renderer.view.canvas.parentNode)==null||e.appendChild(this._div))}_deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),(e=this._div.parentNode)==null||e.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(s,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(B.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(B.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{e.currentTarget=i[s],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;h--){const l=v[h],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,i,n,s,o||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();(u.length>0||d)&&(d&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let v=c.length-1;v>=0;v--){const h=c[v],l=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,p,n,s);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const u=e.isInteractive();return(l.length>0||u)&&l.push(e),l}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i0&&s!==t.target){const v=e.type==="mousemove"?"mouseout":"pointerout",h=this.createPointerEvent(e,v,s);if(this.dispatchEvent(h,"pointerout"),i&&this.dispatchEvent(h,"mouseout"),!t.composedPath().includes(s)){const l=this.createPointerEvent(e,"pointerleave",s);for(l.eventPhase=l.AT_TARGET;l.target&&!t.composedPath().includes(l.target);)l.currentTarget=l.target,this.notifyTarget(l),i&&this.notifyTarget(l,"mouseleave"),l.target=l.target.parent;this.freeEvent(l)}this.freeEvent(h)}if(s!==t.target){const v=e.type==="mousemove"?"mouseover":"pointerover",h=this.clonePointerEvent(t,v);this.dispatchEvent(h,"pointerover"),i&&this.dispatchEvent(h,"mouseover");let l=s==null?void 0:s.parent;for(;l&&l!==this.rootTarget.parent&&l!==t.target;)l=l.parent;if(!l||l===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(h)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(p=t.target)==null?void 0:p.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};L.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};L.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=L;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(r){this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(r,a,o)}),s?c.once(r,a,o):c.on(r,a,o)},removeEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,n)},dispatchEvent(r){if(!(r instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me); diff --git a/assets/colorToUniform-DMqhVWWI.js b/assets/colorToUniform-CFyxXhhI.js similarity index 99% rename from assets/colorToUniform-DMqhVWWI.js rename to assets/colorToUniform-CFyxXhhI.js index 06e64c2..ddb5487 100644 --- a/assets/colorToUniform-DMqhVWWI.js +++ b/assets/colorToUniform-CFyxXhhI.js @@ -1,4 +1,4 @@ -import{D as ft,u as K,a as dt,c as T,i as mt,k as ht,n as X,w as pt}from"./index-DS_dDDq2.js";const $=Object.create(null),q=Object.create(null);function V(o,t){let e=q[o];return e===void 0&&($[t]===void 0&&($[t]=1),q[o]=e=$[t]++),e}let y;function gt(){return(!y||y!=null&&y.isContextLost())&&(y=ft.get().createCanvas().getContext("webgl",{})),y}let S;function xt(){if(!S){S="mediump";const o=gt();o&&o.getShaderPrecisionFormat&&(S=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision?"highp":"mediump")}return S}function vt(o,t,e){return t?o:e?(o=o.replace("out vec4 finalColor;",""),` +import{D as ft,u as K,a as dt,c as T,i as mt,k as ht,n as X,w as pt}from"./index-CjFptCTD.js";const $=Object.create(null),q=Object.create(null);function V(o,t){let e=q[o];return e===void 0&&($[t]===void 0&&($[t]=1),q[o]=e=$[t]++),e}let y;function gt(){return(!y||y!=null&&y.isContextLost())&&(y=ft.get().createCanvas().getContext("webgl",{})),y}let S;function xt(){if(!S){S="mediump";const o=gt();o&&o.getShaderPrecisionFormat&&(S=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision?"highp":"mediump")}return S}function vt(o,t,e){return t?o:e?(o=o.replace("out vec4 finalColor;",""),` #ifdef GL_ES // This checks if it is WebGL1 #define in varying diff --git a/assets/index-DS_dDDq2.js b/assets/index-CjFptCTD.js similarity index 70% rename from assets/index-DS_dDDq2.js rename to assets/index-CjFptCTD.js index 76197ae..acb00df 100644 --- a/assets/index-DS_dDDq2.js +++ b/assets/index-CjFptCTD.js @@ -1,12 +1,12 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/browserAll-DQuq1onv.js","assets/webworkerAll-D78yVGWs.js","assets/colorToUniform-DMqhVWWI.js","assets/CanvasPool-CHCBO5uV.js","assets/batchSamplersUniformGroup-BHYQQvaj.js","assets/WebGPURenderer-lyM9mhaa.js","assets/SharedSystems-Bx3mXfBj.js","assets/WebGLRenderer-N8rVeROe.js"] + __vite__mapDeps.viteFileDeps = ["assets/browserAll-BWV3Mmhk.js","assets/webworkerAll-_jBWuT__.js","assets/colorToUniform-CFyxXhhI.js","assets/CanvasPool-CRu07Ks4.js","assets/batchSamplersUniformGroup-BaLj5C5z.js","assets/WebGPURenderer-CYDRqglR.js","assets/SharedSystems-CRMtzBk2.js","assets/WebGLRenderer-Bo2izwAR.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -var Rr=Object.defineProperty;var Br=(s,t,e)=>t in s?Rr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var Ye=(s,t,e)=>(Br(s,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function e(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(r){if(r.ep)return;r.ep=!0;const n=e(r);fetch(r.href,n)}})();const Lr=(s,t)=>s===t,Os={equals:Lr};let vi=Ti;const _t=1,Me=2,Ai={owned:null,cleanups:null,context:null,owner:null};var $=null;let $e=null,Fr=null,U=null,j=null,dt=null,Le=0;function Dr(s,t){const e=U,i=$,r=s.length===0,n=t===void 0?i:t,o=r?Ai:{owned:null,cleanups:null,context:n?n.context:null,owner:n},a=r?s:()=>s(()=>Yt(()=>De(o)));$=o,U=null;try{return he(a,!0)}finally{U=e,$=i}}function Gr(s,t){t=t?Object.assign({},Os,t):Os;const e={value:s,observers:null,observerSlots:null,comparator:t.equals||void 0},i=r=>(typeof r=="function"&&(r=r(e.value)),Si(e,r));return[Or.bind(e),i]}function Se(s,t,e){const i=Pi(s,t,!1,_t);Fe(i)}function Nr(s,t,e){vi=Hr;const i=Pi(s,t,!1,_t);(!e||!e.render)&&(i.user=!0),dt?dt.push(i):Fe(i)}function Yt(s){if(U===null)return s();const t=U;U=null;try{return s()}finally{U=t}}function Mi(s){Nr(()=>Yt(s))}function Ur(s){return $===null||($.cleanups===null?$.cleanups=[s]:$.cleanups.push(s)),s}function Or(){if(this.sources&&this.state)if(this.state===_t)Fe(this);else{const s=j;j=null,he(()=>Te(this),!1),j=s}if(U){const s=this.observers?this.observers.length:0;U.sources?(U.sources.push(this),U.sourceSlots.push(s)):(U.sources=[this],U.sourceSlots=[s]),this.observers?(this.observers.push(U),this.observerSlots.push(U.sources.length-1)):(this.observers=[U],this.observerSlots=[U.sources.length-1])}return this.value}function Si(s,t,e){let i=s.value;return(!s.comparator||!s.comparator(i,t))&&(s.value=t,s.observers&&s.observers.length&&he(()=>{for(let r=0;r1e6)throw j=[],new Error},!1)),t}function Fe(s){if(!s.fn)return;De(s);const t=Le;Yr(s,s.value,t)}function Yr(s,t,e){let i;const r=$,n=U;U=$=s;try{i=s.fn(t)}catch(o){return s.pure&&(s.state=_t,s.owned&&s.owned.forEach(De),s.owned=null),s.updatedAt=e+1,Ii(o)}finally{U=n,$=r}(!s.updatedAt||s.updatedAt<=e)&&(s.updatedAt!=null&&"observers"in s?Si(s,i):s.value=i,s.updatedAt=e)}function Pi(s,t,e,i=_t,r){const n={fn:s,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:$,context:$?$.context:null,pure:e};return $===null||$!==Ai&&($.owned?$.owned.push(n):$.owned=[n]),n}function Pe(s){if(s.state===0)return;if(s.state===Me)return Te(s);if(s.suspense&&Yt(s.suspense.inFallback))return s.suspense.effects.push(s);const t=[s];for(;(s=s.owner)&&(!s.updatedAt||s.updatedAt=0;e--)if(s=t[e],s.state===_t)Fe(s);else if(s.state===Me){const i=j;j=null,he(()=>Te(s,t[0]),!1),j=i}}function he(s,t){if(j)return s();let e=!1;t||(j=[]),dt?e=!0:dt=[],Le++;try{const i=s();return $r(e),i}catch(i){e||(dt=null),j=null,Ii(i)}}function $r(s){if(j&&(Ti(j),j=null),s)return;const t=dt;dt=null,t.length&&he(()=>vi(t),!1)}function Ti(s){for(let t=0;t=0;t--)De(s.owned[t]);s.owned=null}if(s.cleanups){for(t=s.cleanups.length-1;t>=0;t--)s.cleanups[t]();s.cleanups=null}s.state=0}function zr(s){return s instanceof Error?s:new Error(typeof s=="string"?s:"Unknown error",{cause:s})}function Ii(s,t=$){throw zr(s)}function st(s,t){return Yt(()=>s(t||{}))}function Xr(s,t,e){let i=e.length,r=t.length,n=i,o=0,a=0,h=t[r-1].nextSibling,c=null;for(;ol-a){const f=t[o];for(;a{r=n,t===document?s():lt(t,s(),t.firstChild?null:void 0,e)},i.owner),()=>{r(),t.textContent=""}}function et(s,t,e){let i;const r=()=>{const o=document.createElement("template");return o.innerHTML=s,e?o.content.firstChild.firstChild:o.content.firstChild},n=t?()=>Yt(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return n.cloneNode=n,n}function Wr(s,t=window.document){const e=t[Ys]||(t[Ys]=new Set);for(let i=0,r=s.length;is(t,e))}function lt(s,t,e,i){if(e!==void 0&&!i&&(i=[]),typeof t!="function")return ke(s,t,i,e);Se(r=>ke(s,t(),r,e),i)}function jr(s){const t=`$$${s.type}`;let e=s.composedPath&&s.composedPath()[0]||s.target;for(s.target!==e&&Object.defineProperty(s,"target",{configurable:!0,value:e}),Object.defineProperty(s,"currentTarget",{configurable:!0,get(){return e||document}});e;){const i=e[t];if(i&&!e.disabled){const r=e[`${t}Data`];if(r!==void 0?i.call(e,r,s):i.call(e,s),s.cancelBubble)return}e=e._$host||e.parentNode||e.host}}function ke(s,t,e,i,r){for(;typeof e=="function";)e=e();if(t===e)return e;const n=typeof t,o=i!==void 0;if(s=o&&e[0]&&e[0].parentNode||s,n==="string"||n==="number")if(n==="number"&&(t=t.toString()),o){let a=e[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),e=Lt(s,e,i,a)}else e!==""&&typeof e=="string"?e=s.firstChild.data=t:e=s.textContent=t;else if(t==null||n==="boolean")e=Lt(s,e,i);else{if(n==="function")return Se(()=>{let a=t();for(;typeof a=="function";)a=a();e=ke(s,a,e,i)}),()=>e;if(Array.isArray(t)){const a=[],h=e&&Array.isArray(e);if(as(a,t,e,r))return Se(()=>e=ke(s,a,e,i,!0)),()=>e;if(a.length===0){if(e=Lt(s,e,i),o)return e}else h?e.length===0?$s(s,a,i):Xr(s,e,a):(e&&Lt(s),$s(s,a));e=a}else if(t.nodeType){if(Array.isArray(e)){if(o)return e=Lt(s,e,i,t);Lt(s,e,null,t)}else e==null||e===""||!s.firstChild?s.appendChild(t):s.replaceChild(t,s.firstChild);e=t}}return e}function as(s,t,e,i){let r=!1;for(let n=0,o=t.length;n=0;o--){const a=t[o];if(r!==a){const h=a.parentNode===s;!n&&!o?h?s.replaceChild(r,a):s.insertBefore(r,e):h&&a.remove()}else n=!0}}else s.insertBefore(r,e);return[r]}var Zr=et('
Figma Vector Networkv');function Jr(){return(()=>{var s=Qr(),t=s.firstChild,e=t.firstChild,i=e.firstChild,r=i.nextSibling,n=r.firstChild;return n.firstChild,lt(n,"0.0.0",null),lt(t,st(Kr,{url:"https://github.com/palmcivet/vector-network"}),null),s})()}var tn=et(''),en=et(''),sn=et(''),rn=et(''),nn=et('');const on=()=>tn(),an=()=>en(),hn=()=>sn(),ln=()=>rn(),cn=()=>nn();var un=et('
'),dn=et('
');const fn={Move:st(on,{}),Pen:st(an,{}),Pencil:st(hn,{}),Bend:st(ln,{}),Paint:st(cn,{})};function pn(){return(()=>{var s=un();return lt(s,()=>Object.entries(fn).map(([t,e])=>(()=>{var i=dn();return i.$$click=()=>t,lt(i,e),i})())),s})()}Wr(["click"]);const mn="modulepreload",gn=function(s){return"/"+s},Hs={},Ie=function(t,e,i){let r=Promise.resolve();if(e&&e.length>0){const n=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.all(e.map(h=>{if(h=gn(h),h in Hs)return;Hs[h]=!0;const c=h.endsWith(".css"),l=c?'[rel="stylesheet"]':"";if(!!i)for(let p=n.length-1;p>=0;p--){const f=n[p];if(f.href===h&&(!c||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${l}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":mn,c||(d.as="script",d.crossOrigin=""),d.href=h,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((p,f)=>{d.addEventListener("load",p),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${h}`)))})}))}return r.then(()=>t()).catch(n=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=n,window.dispatchEvent(o),!o.defaultPrevented)throw n})};var H=(s=>(s.Application="application",s.WebGLPipes="webgl-pipes",s.WebGLPipesAdaptor="webgl-pipes-adaptor",s.WebGLSystem="webgl-system",s.WebGPUPipes="webgpu-pipes",s.WebGPUPipesAdaptor="webgpu-pipes-adaptor",s.WebGPUSystem="webgpu-system",s.CanvasSystem="canvas-system",s.CanvasPipesAdaptor="canvas-pipes-adaptor",s.CanvasPipes="canvas-pipes",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s.MaskEffect="mask-effect",s.BlendMode="blend-mode",s.TextureSource="texture-source",s.Environment="environment",s))(H||{});const hs=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},de=(s,t)=>hs(s).priority??t,Bt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(hs).forEach(t=>{t.type.forEach(e=>{var i,r;return(r=(i=this._removeHandlers)[e])==null?void 0:r.call(i,t)})}),this},add(...s){return s.map(hs).forEach(t=>{t.type.forEach(e=>{var n,o;const i=this._addHandlers,r=this._queue;i[e]?(o=i[e])==null||o.call(i,t):(r[e]=r[e]||[],(n=r[e])==null||n.push(t))})}),this},handle(s,t,e){var o;const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&((o=n[s])==null||o.forEach(a=>t(a)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(s,t,e=-1){return this.handle(s,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>de(o.value,e)-de(n.value,e)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>de(n,e)-de(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})}},yn={extension:{type:H.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Ie(()=>import("./browserAll-DQuq1onv.js"),__vite__mapDeps([0,1,2,3,4]))}},xn={extension:{type:H.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Ie(()=>import("./webworkerAll-D78yVGWs.js"),__vite__mapDeps([1,2,3,4]))}};class J{constructor(t,e,i){this._x=e||0,this._y=i||0,this._observer=t}clone(t){return new J(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}function As(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ei={exports:{}};(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,c,l){this.fn=h,this.context=c,this.once=l||!1}function n(h,c,l,u,d){if(typeof l!="function")throw new TypeError("The listener must be a function");var p=new r(l,u||h,d),f=e?e+c:c;return h._events[f]?h._events[f].fn?h._events[f]=[h._events[f],p]:h._events[f].push(p):(h._events[f]=p,h._eventsCount++),h}function o(h,c){--h._eventsCount===0?h._events=new i:delete h._events[c]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)t.call(l,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},a.prototype.listeners=function(c){var l=e?e+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,p=u.length,f=new Array(p);dSt[s],uY:s=>Pt[s],vX:s=>Tt[s],vY:s=>kt[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>ls[s][t],sub:(s,t)=>ls[s][F.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?F.S:F.N:Math.abs(t)*2<=Math.abs(s)?s>0?F.E:F.W:t>0?s>0?F.SE:F.SW:s>0?F.NE:F.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=Ri[F.inv(t)];r.tx=e,r.ty=i,s.append(r)}},pe=[new q,new q,new q,new q];class V{constructor(t=0,e=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r)}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 V(0,0,0,0)}clone(){return new V(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=h&&t<=c&&e>=l&&e<=u&&!(t>d&&tf&&et.right?t.right:this.right)<=A)return!1;const C=this.yt.bottom?t.bottom:this.bottom)>C}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=pe[0].set(t.left,t.top),h=pe[1].set(t.left,t.bottom),c=pe[2].set(t.right,t.top),l=pe[3].set(t.right,t.bottom);if(c.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(c,c),e.apply(l,l),Math.max(a.x,h.x,c.x,l.x)<=i||Math.min(a.x,h.x,c.x,l.x)>=r||Math.max(a.y,h.y,c.y,l.y)<=n||Math.min(a.y,h.y,c.y,l.y)>=o))return!1;const d=u*(h.y-a.y),p=u*(a.x-h.x),f=d*i+p*n,g=d*r+p*n,m=d*i+p*o,_=d*r+p*o;if(Math.max(f,g,m,_)<=d*a.x+p*a.y||Math.min(f,g,m,_)>=d*l.x+p*l.y)return!1;const y=u*(a.y-c.y),x=u*(c.x-a.x),b=y*i+x*n,M=y*r+x*n,I=y*i+x*o,v=y*r+x*o;return!(Math.max(b,M,I,v)<=y*a.x+x*a.y||Math.min(b,M,I,v)>=y*l.x+x*l.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this}getBounds(t){return t=t||new V,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ze={default:-1};function W(s="default"){return ze[s]===void 0&&(ze[s]=-1),++ze[s]}const zs={},O="8.0.0";function Y(s,t,e=3){if(zs[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} +var Br=Object.defineProperty;var Lr=(s,t,e)=>t in s?Br(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var Ye=(s,t,e)=>(Lr(s,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function e(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(r){if(r.ep)return;r.ep=!0;const n=e(r);fetch(r.href,n)}})();const Fr=(s,t)=>s===t,Ys={equals:Fr};let Ai=ki;const _t=1,Me=2,Mi={owned:null,cleanups:null,context:null,owner:null};var $=null;let $e=null,Dr=null,U=null,j=null,dt=null,Le=0;function Gr(s,t){const e=U,i=$,r=s.length===0,n=t===void 0?i:t,o=r?Mi:{owned:null,cleanups:null,context:n?n.context:null,owner:n},a=r?s:()=>s(()=>Yt(()=>De(o)));$=o,U=null;try{return he(a,!0)}finally{U=e,$=i}}function Nr(s,t){t=t?Object.assign({},Ys,t):Ys;const e={value:s,observers:null,observerSlots:null,comparator:t.equals||void 0},i=r=>(typeof r=="function"&&(r=r(e.value)),Pi(e,r));return[Yr.bind(e),i]}function Se(s,t,e){const i=Ti(s,t,!1,_t);Fe(i)}function Ur(s,t,e){Ai=zr;const i=Ti(s,t,!1,_t);(!e||!e.render)&&(i.user=!0),dt?dt.push(i):Fe(i)}function Yt(s){if(U===null)return s();const t=U;U=null;try{return s()}finally{U=t}}function Si(s){Ur(()=>Yt(s))}function Or(s){return $===null||($.cleanups===null?$.cleanups=[s]:$.cleanups.push(s)),s}function Yr(){if(this.sources&&this.state)if(this.state===_t)Fe(this);else{const s=j;j=null,he(()=>Te(this),!1),j=s}if(U){const s=this.observers?this.observers.length:0;U.sources?(U.sources.push(this),U.sourceSlots.push(s)):(U.sources=[this],U.sourceSlots=[s]),this.observers?(this.observers.push(U),this.observerSlots.push(U.sources.length-1)):(this.observers=[U],this.observerSlots=[U.sources.length-1])}return this.value}function Pi(s,t,e){let i=s.value;return(!s.comparator||!s.comparator(i,t))&&(s.value=t,s.observers&&s.observers.length&&he(()=>{for(let r=0;r1e6)throw j=[],new Error},!1)),t}function Fe(s){if(!s.fn)return;De(s);const t=Le;$r(s,s.value,t)}function $r(s,t,e){let i;const r=$,n=U;U=$=s;try{i=s.fn(t)}catch(o){return s.pure&&(s.state=_t,s.owned&&s.owned.forEach(De),s.owned=null),s.updatedAt=e+1,Ei(o)}finally{U=n,$=r}(!s.updatedAt||s.updatedAt<=e)&&(s.updatedAt!=null&&"observers"in s?Pi(s,i):s.value=i,s.updatedAt=e)}function Ti(s,t,e,i=_t,r){const n={fn:s,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:$,context:$?$.context:null,pure:e};return $===null||$!==Mi&&($.owned?$.owned.push(n):$.owned=[n]),n}function Pe(s){if(s.state===0)return;if(s.state===Me)return Te(s);if(s.suspense&&Yt(s.suspense.inFallback))return s.suspense.effects.push(s);const t=[s];for(;(s=s.owner)&&(!s.updatedAt||s.updatedAt=0;e--)if(s=t[e],s.state===_t)Fe(s);else if(s.state===Me){const i=j;j=null,he(()=>Te(s,t[0]),!1),j=i}}function he(s,t){if(j)return s();let e=!1;t||(j=[]),dt?e=!0:dt=[],Le++;try{const i=s();return Hr(e),i}catch(i){e||(dt=null),j=null,Ei(i)}}function Hr(s){if(j&&(ki(j),j=null),s)return;const t=dt;dt=null,t.length&&he(()=>Ai(t),!1)}function ki(s){for(let t=0;t=0;t--)De(s.owned[t]);s.owned=null}if(s.cleanups){for(t=s.cleanups.length-1;t>=0;t--)s.cleanups[t]();s.cleanups=null}s.state=0}function Xr(s){return s instanceof Error?s:new Error(typeof s=="string"?s:"Unknown error",{cause:s})}function Ei(s,t=$){throw Xr(s)}function st(s,t){return Yt(()=>s(t||{}))}function Vr(s,t,e){let i=e.length,r=t.length,n=i,o=0,a=0,h=t[r-1].nextSibling,c=null;for(;ol-a){const f=t[o];for(;a{r=n,t===document?s():lt(t,s(),t.firstChild?null:void 0,e)},i.owner),()=>{r(),t.textContent=""}}function et(s,t,e){let i;const r=()=>{const o=document.createElement("template");return o.innerHTML=s,e?o.content.firstChild.firstChild:o.content.firstChild},n=t?()=>Yt(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return n.cloneNode=n,n}function qr(s,t=window.document){const e=t[$s]||(t[$s]=new Set);for(let i=0,r=s.length;is(t,e))}function lt(s,t,e,i){if(e!==void 0&&!i&&(i=[]),typeof t!="function")return ke(s,t,i,e);Se(r=>ke(s,t(),r,e),i)}function Zr(s){const t=`$$${s.type}`;let e=s.composedPath&&s.composedPath()[0]||s.target;for(s.target!==e&&Object.defineProperty(s,"target",{configurable:!0,value:e}),Object.defineProperty(s,"currentTarget",{configurable:!0,get(){return e||document}});e;){const i=e[t];if(i&&!e.disabled){const r=e[`${t}Data`];if(r!==void 0?i.call(e,r,s):i.call(e,s),s.cancelBubble)return}e=e._$host||e.parentNode||e.host}}function ke(s,t,e,i,r){for(;typeof e=="function";)e=e();if(t===e)return e;const n=typeof t,o=i!==void 0;if(s=o&&e[0]&&e[0].parentNode||s,n==="string"||n==="number")if(n==="number"&&(t=t.toString()),o){let a=e[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),e=Lt(s,e,i,a)}else e!==""&&typeof e=="string"?e=s.firstChild.data=t:e=s.textContent=t;else if(t==null||n==="boolean")e=Lt(s,e,i);else{if(n==="function")return Se(()=>{let a=t();for(;typeof a=="function";)a=a();e=ke(s,a,e,i)}),()=>e;if(Array.isArray(t)){const a=[],h=e&&Array.isArray(e);if(hs(a,t,e,r))return Se(()=>e=ke(s,a,e,i,!0)),()=>e;if(a.length===0){if(e=Lt(s,e,i),o)return e}else h?e.length===0?Hs(s,a,i):Vr(s,e,a):(e&&Lt(s),Hs(s,a));e=a}else if(t.nodeType){if(Array.isArray(e)){if(o)return e=Lt(s,e,i,t);Lt(s,e,null,t)}else e==null||e===""||!s.firstChild?s.appendChild(t):s.replaceChild(t,s.firstChild);e=t}}return e}function hs(s,t,e,i){let r=!1;for(let n=0,o=t.length;n=0;o--){const a=t[o];if(r!==a){const h=a.parentNode===s;!n&&!o?h?s.replaceChild(r,a):s.insertBefore(r,e):h&&a.remove()}else n=!0}}else s.insertBefore(r,e);return[r]}var Kr=et('
Figma Vector Networkv');function tn(){return(()=>{var s=Jr(),t=s.firstChild,e=t.firstChild,i=e.firstChild,r=i.nextSibling,n=r.firstChild;return n.firstChild,lt(n,"0.0.0",null),lt(t,st(Qr,{url:"https://github.com/palmcivet/vector-network"}),null),s})()}var en=et(''),sn=et(''),rn=et(''),nn=et(''),on=et('');const an=()=>en(),hn=()=>sn(),ln=()=>rn(),cn=()=>nn(),un=()=>on();var dn=et('
'),fn=et('
');const pn={Move:st(an,{}),Pen:st(hn,{}),Pencil:st(ln,{}),Bend:st(cn,{}),Paint:st(un,{})};function mn(){return(()=>{var s=dn();return lt(s,()=>Object.entries(pn).map(([t,e])=>(()=>{var i=fn();return i.$$click=()=>t,lt(i,e),i})())),s})()}qr(["click"]);const gn="modulepreload",yn=function(s){return"/vector-network/"+s},zs={},Ie=function(t,e,i){let r=Promise.resolve();if(e&&e.length>0){const n=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.all(e.map(h=>{if(h=yn(h),h in zs)return;zs[h]=!0;const c=h.endsWith(".css"),l=c?'[rel="stylesheet"]':"";if(!!i)for(let p=n.length-1;p>=0;p--){const f=n[p];if(f.href===h&&(!c||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${l}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":gn,c||(d.as="script",d.crossOrigin=""),d.href=h,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((p,f)=>{d.addEventListener("load",p),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${h}`)))})}))}return r.then(()=>t()).catch(n=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=n,window.dispatchEvent(o),!o.defaultPrevented)throw n})};var H=(s=>(s.Application="application",s.WebGLPipes="webgl-pipes",s.WebGLPipesAdaptor="webgl-pipes-adaptor",s.WebGLSystem="webgl-system",s.WebGPUPipes="webgpu-pipes",s.WebGPUPipesAdaptor="webgpu-pipes-adaptor",s.WebGPUSystem="webgpu-system",s.CanvasSystem="canvas-system",s.CanvasPipesAdaptor="canvas-pipes-adaptor",s.CanvasPipes="canvas-pipes",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s.MaskEffect="mask-effect",s.BlendMode="blend-mode",s.TextureSource="texture-source",s.Environment="environment",s))(H||{});const ls=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},de=(s,t)=>ls(s).priority??t,Bt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(ls).forEach(t=>{t.type.forEach(e=>{var i,r;return(r=(i=this._removeHandlers)[e])==null?void 0:r.call(i,t)})}),this},add(...s){return s.map(ls).forEach(t=>{t.type.forEach(e=>{var n,o;const i=this._addHandlers,r=this._queue;i[e]?(o=i[e])==null||o.call(i,t):(r[e]=r[e]||[],(n=r[e])==null||n.push(t))})}),this},handle(s,t,e){var o;const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&((o=n[s])==null||o.forEach(a=>t(a)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(s,t,e=-1){return this.handle(s,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>de(o.value,e)-de(n.value,e)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>de(n,e)-de(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})}},xn={extension:{type:H.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Ie(()=>import("./browserAll-BWV3Mmhk.js"),__vite__mapDeps([0,1,2,3,4]))}},_n={extension:{type:H.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Ie(()=>import("./webworkerAll-_jBWuT__.js"),__vite__mapDeps([1,2,3,4]))}};class J{constructor(t,e,i){this._x=e||0,this._y=i||0,this._observer=t}clone(t){return new J(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}function Ms(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ri={exports:{}};(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,c,l){this.fn=h,this.context=c,this.once=l||!1}function n(h,c,l,u,d){if(typeof l!="function")throw new TypeError("The listener must be a function");var p=new r(l,u||h,d),f=e?e+c:c;return h._events[f]?h._events[f].fn?h._events[f]=[h._events[f],p]:h._events[f].push(p):(h._events[f]=p,h._eventsCount++),h}function o(h,c){--h._eventsCount===0?h._events=new i:delete h._events[c]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)t.call(l,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},a.prototype.listeners=function(c){var l=e?e+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,p=u.length,f=new Array(p);dSt[s],uY:s=>Pt[s],vX:s=>Tt[s],vY:s=>kt[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>cs[s][t],sub:(s,t)=>cs[s][F.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?F.S:F.N:Math.abs(t)*2<=Math.abs(s)?s>0?F.E:F.W:t>0?s>0?F.SE:F.SW:s>0?F.NE:F.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=Bi[F.inv(t)];r.tx=e,r.ty=i,s.append(r)}},pe=[new q,new q,new q,new q];class V{constructor(t=0,e=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r)}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 V(0,0,0,0)}clone(){return new V(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=h&&t<=c&&e>=l&&e<=u&&!(t>d&&tf&&et.right?t.right:this.right)<=A)return!1;const C=this.yt.bottom?t.bottom:this.bottom)>C}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=pe[0].set(t.left,t.top),h=pe[1].set(t.left,t.bottom),c=pe[2].set(t.right,t.top),l=pe[3].set(t.right,t.bottom);if(c.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(c,c),e.apply(l,l),Math.max(a.x,h.x,c.x,l.x)<=i||Math.min(a.x,h.x,c.x,l.x)>=r||Math.max(a.y,h.y,c.y,l.y)<=n||Math.min(a.y,h.y,c.y,l.y)>=o))return!1;const d=u*(h.y-a.y),p=u*(a.x-h.x),f=d*i+p*n,g=d*r+p*n,m=d*i+p*o,x=d*r+p*o;if(Math.max(f,g,m,x)<=d*a.x+p*a.y||Math.min(f,g,m,x)>=d*l.x+p*l.y)return!1;const y=u*(a.y-c.y),_=u*(c.x-a.x),b=y*i+_*n,M=y*r+_*n,I=y*i+_*o,v=y*r+_*o;return!(Math.max(b,M,I,v)<=y*a.x+_*a.y||Math.min(b,M,I,v)>=y*l.x+_*l.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this}getBounds(t){return t=t||new V,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ze={default:-1};function W(s="default"){return ze[s]===void 0&&(ze[s]=-1),++ze[s]}const Xs={},O="8.0.0";function Y(s,t,e=3){if(Xs[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${s}`):(i=i.split(` `).splice(e).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} -Deprecated since v${s}`),console.warn(i))),zs[t]=!0}const Bi=()=>{};function vh(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Xs(s){return!(s&s-1)&&!!s}function Sn(s){const t={};for(const e in s)s[e]!==void 0&&(t[e]=s[e]);return t}const Vs=Object.create(null);function Pn(s){const t=Vs[s];return t===void 0&&(Vs[s]=W("resource")),t}const Li=class Fi extends gt{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Fi.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){Y(O,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Pn(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Li.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Tn=Li;const Di=class Gi extends gt{constructor(t={}){super(),this.options=t,this.uid=W("textureSource"),this._resourceType="textureSource",this._resourceId=W("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.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Gi.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.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=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Tn(Sn(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var e,i;this.style!==t&&((e=this._style)==null||e.off("change",this._onStyleChange,this),this._style=t,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=W("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,i){i=i||this._resolution,t=t||this.width,e=e||this.height;const r=Math.round(t*i),n=Math.round(e*i);return this.width=r/i,this.height=n/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=n,this.emit("resize",this),this._resourceId=W("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Xs(this.pixelWidth)&&Xs(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Di.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let bt=Di;class Ms extends bt{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let i=t.format;i||(e instanceof Float32Array?i="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?i="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?i="rgba16uint":(e instanceof Int8Array,i="bgra8unorm")),super({...t,resource:e,format:i}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Ms.extension=H.TextureSource;const Ws=new E;class kn{constructor(t,e){this.mapCoord=new E,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var e;this.texture!==t&&((e=this._texture)==null||e.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let r=0;r0:typeof s=="number"},X=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*s)/e+0},it=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),s>e?e:s>t?s:t},Ni=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},qs=function(s){return{r:it(s.r,0,255),g:it(s.g,0,255),b:it(s.b,0,255),a:it(s.a)}},Xe=function(s){return{r:X(s.r),g:X(s.g),b:X(s.b),a:X(s.a,3)}},Rn=/^#([0-9a-f]{3,8})$/i,me=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},Ui=function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=Math.max(t,e,i),o=n-Math.min(t,e,i),a=o?n===t?(e-i)/o:n===e?2+(i-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},Oi=function(s){var t=s.h,e=s.s,i=s.v,r=s.a;t=t/360*6,e/=100,i/=100;var n=Math.floor(t),o=i*(1-e),a=i*(1-(t-n)*e),h=i*(1-(1-t+n)*e),c=n%6;return{r:255*[i,a,o,o,h,i][c],g:255*[h,i,i,a,o,o][c],b:255*[o,o,h,i,i,a][c],a:r}},js=function(s){return{h:Ni(s.h),s:it(s.s,0,100),l:it(s.l,0,100),a:it(s.a)}},Zs=function(s){return{h:X(s.h),s:X(s.s),l:X(s.l),a:X(s.a,3)}},Ks=function(s){return Oi((e=(t=s).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Jt=function(s){return{h:(t=Ui(s)).h,s:(r=(200-(e=t.s))*(i=t.v)/100)>0&&r<200?e*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,i,r},Bn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ln=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Fn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Dn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cs={string:[[function(s){var t=Rn.exec(s);return t?(s=t[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?X(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?X(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var t=Fn.exec(s)||Dn.exec(s);return t?t[2]!==t[4]||t[4]!==t[6]?null:qs({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(s){var t=Bn.exec(s)||Ln.exec(s);if(!t)return null;var e,i,r=js({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(En[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Ks(r)},"hsl"]],object:[[function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=r===void 0?1:r;return ut(t)&&ut(e)&&ut(i)?qs({r:Number(t),g:Number(e),b:Number(i),a:Number(n)}):null},"rgb"],[function(s){var t=s.h,e=s.s,i=s.l,r=s.a,n=r===void 0?1:r;if(!ut(t)||!ut(e)||!ut(i))return null;var o=js({h:Number(t),s:Number(e),l:Number(i),a:Number(n)});return Ks(o)},"hsl"],[function(s){var t=s.h,e=s.s,i=s.v,r=s.a,n=r===void 0?1:r;if(!ut(t)||!ut(e)||!ut(i))return null;var o=function(a){return{h:Ni(a.h),s:it(a.s,0,100),v:it(a.v,0,100),a:it(a.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(n)});return Oi(o)},"hsv"]]},Qs=function(s,t){for(var e=0;e=.5},s.prototype.toHex=function(){return t=Xe(this.rgba),e=t.r,i=t.g,r=t.b,o=(n=t.a)<1?me(X(255*n)):"","#"+me(e)+me(i)+me(r)+o;var t,e,i,r,n,o},s.prototype.toRgb=function(){return Xe(this.rgba)},s.prototype.toRgbString=function(){return t=Xe(this.rgba),e=t.r,i=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+i+", "+r+", "+n+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,n},s.prototype.toHsl=function(){return Zs(Jt(this.rgba))},s.prototype.toHslString=function(){return t=Zs(Jt(this.rgba)),e=t.h,i=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+n+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,n},s.prototype.toHsv=function(){return t=Ui(this.rgba),{h:X(t.h),s:X(t.s),v:X(t.v),a:X(t.a,3)};var t},s.prototype.invert=function(){return at({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},s.prototype.saturate=function(t){return t===void 0&&(t=.1),at(Ve(this.rgba,t))},s.prototype.desaturate=function(t){return t===void 0&&(t=.1),at(Ve(this.rgba,-t))},s.prototype.grayscale=function(){return at(Ve(this.rgba,-1))},s.prototype.lighten=function(t){return t===void 0&&(t=.1),at(Js(this.rgba,t))},s.prototype.darken=function(t){return t===void 0&&(t=.1),at(Js(this.rgba,-t))},s.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},s.prototype.alpha=function(t){return typeof t=="number"?at({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):X(this.rgba.a,3);var e},s.prototype.hue=function(t){var e=Jt(this.rgba);return typeof t=="number"?at({h:t,s:e.s,l:e.l,a:e.a}):X(e.h)},s.prototype.isEqual=function(t){return this.toHex()===at(t).toHex()},s}(),at=function(s){return s instanceof us?s:new us(s)},ti=[],Nn=function(s){s.forEach(function(t){ti.indexOf(t)<0&&(t(us,cs),ti.push(t))})};function Un(s,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in e)i[e[r]]=r;var n={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,c=i[this.toHex()];if(c)return c;if(o!=null&&o.closest){var l=this.toRgb(),u=1/0,d="black";if(!n.length)for(var p in e)n[p]=new s(e[p]).toRgb();for(var f in e){var g=(a=l,h=n[f],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));gn===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t=t||this._arrayRgb,t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t=t||this._arrayRgba;const[e,i,r,n]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t=t||this._arrayRgb;const[e,i,r]=this._components;return t[0]=e,t[1]=i,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,e,i]=this.toUint8RgbArray();return(i<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,r,n]=Kt._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=r,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(i=i*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(i<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,i,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,i=(o>>8&255)/255,r=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,r,n=255]=t,e/=255,i/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Kt.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=at(t);o.isValid()&&({r:e,g:i,b:r,a:n}=o.rgba,e/=255,i/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=r,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),i)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Kt||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Ut.shared=new Ut;Ut._temp=new Ut;Ut.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let tt=Ut;const On={cullArea:null,cullable:!1,cullableChildren:!0};function Yn(s,t,e){const i=s.length;let r;if(t>=i||e===0)return;e=t+e>i?i-t:e;const n=i-e;for(r=t;r0&&i<=e){for(let n=e-1;n>=s;n--){const o=this.children[n];o&&(this.renderGroup&&this.renderGroup.removeChild(o),r.push(o),o.parent=null)}Yn(this.children,s,e);for(let n=0;n=this.children.length)throw new Error(`getChildAt: Index (${s}) does not exist.`);return this.children[s]},setChildIndex(s,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(s),this.addChildAt(s,t)},getChildIndex(s){const t=this.children.indexOf(s);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(s,t){this.allowChildren||Y(O,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${s}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(s.parent){const i=s.parent.children.indexOf(s);if(s.parent===this&&i===t)return s;i!==-1&&s.parent.children.splice(i,1)}return t===e.length?e.push(s):e.splice(t,0,s),s.parent=this,s.didChange=!0,s.didViewUpdate=!1,s._updateFlags=15,this.renderGroup&&this.renderGroup.addChild(s),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",s,this,t),s.emit("added",this),s},swapChildren(s,t){if(s===t)return;const e=this.getChildIndex(s),i=this.getChildIndex(t);this.children[e]=t,this.children[i]=s},removeFromParent(){var s;(s=this.parent)==null||s.removeChild(this)}};class Hn{constructor(t){this.pipe="filter",this.priority=1,this.filters=t==null?void 0:t.filters,this.filterArea=t==null?void 0:t.filterArea}destroy(){for(let t=0;t0?e=this._pool[--this._index]:e=new this._classType,(i=e.init)==null||i.call(e,t),e}return(t){var e;(e=t.reset)==null||e.call(t),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}}class zn{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Ss(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const i=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[i]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}}const ot=new zn;class Xn{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;ee.priority-i.priority),this.renderGroup&&(this.renderGroup.structureDidChange=!0),this._updateIsSimple())},removeEffect(s){const t=this.effects.indexOf(s);t!==-1&&(this.effects.splice(t,1),!this.isRenderGroupRoot&&this.renderGroup&&(this.renderGroup.structureDidChange=!0),this._updateIsSimple())},set mask(s){if(this._mask||(this._mask={mask:null,effect:null}),this._mask.mask===s||(this._mask.effect&&(this.removeEffect(this._mask.effect),ds.returnMaskEffect(this._mask.effect),this._mask.effect=null),this._mask.mask=s,s==null))return;const t=ds.getMaskEffect(s);this._mask.effect=t,this.addEffect(t)},get mask(){var s;return(s=this._mask)==null?void 0:s.mask},set filters(s){!Array.isArray(s)&&s&&(s=[s]),s=s,this._filters||(this._filters={filters:null,effect:null,filterArea:null});const t=(s==null?void 0:s.length)>0,e=this._filters.effect&&!t||!this._filters.effect&&t;if(s=Array.isArray(s)?s.slice(0):s,this._filters.filters=Object.freeze(s),e)if(t){const i=ot.get(Hn);this._filters.effect=i,this.addEffect(i)}else{const i=this._filters.effect;this.removeEffect(i),i.filterArea=null,i.filters=null,this._filters.effect=null,ot.return(i)}t&&(this._filters.effect.filters=s,this._filters.effect.filterArea=this.filterArea)},get filters(){var s;return(s=this._filters)==null?void 0:s.filters},set filterArea(s){this._filters||(this._filters={filters:null,effect:null,filterArea:null}),this._filters.filterArea=s},get filterArea(){var s;return(s=this._filters)==null?void 0:s.filterArea}},Wn={label:null,get name(){return Y(O,"Container.name property has been removed, use Container.label instead"),this.label},set name(s){Y(O,"Container.name property has been removed, use Container.label instead"),this.label=s},getChildByName(s,t=!1){return this.getChildByLabel(s,t)},getChildByLabel(s,t=!1){const e=this.children;for(let i=0;ithis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new V);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=ei,this}set(t,e,i,r){this.minX=t,this.minY=e,this.maxX=i,this.maxY=r}addFrame(t,e,i,r,n){n||(n=this.matrix);const o=n.a,a=n.b,h=n.c,c=n.d,l=n.tx,u=n.ty;let d=this.minX,p=this.minY,f=this.maxX,g=this.maxY,m=o*t+h*e+l,_=a*t+c*e+u;mf&&(f=m),_>g&&(g=_),m=o*i+h*e+l,_=a*i+c*e+u,mf&&(f=m),_>g&&(g=_),m=o*t+h*r+l,_=a*t+c*r+u,mf&&(f=m),_>g&&(g=_),m=o*i+h*r+l,_=a*i+c*r+u,mf&&(f=m),_>g&&(g=_),this.minX=d,this.minY=p,this.maxX=f,this.maxY=g}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxXthis.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*e+h*n+l,p=a*e+c*n+u,this.minX=dthis.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*r+h*n+l,p=a*r+c*n+u,this.minX=dthis.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY}fit(t){return this.minXt.right&&(this.maxX=t.right),this.minYt.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,i,r){return this.minXe&&(this.maxX=e),this.minYr&&(this.maxY=r),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new mt(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,i,r){let n=this.minX,o=this.minY,a=this.maxX,h=this.maxY;r||(r=this.matrix);const c=r.a,l=r.b,u=r.c,d=r.d,p=r.tx,f=r.ty;for(let g=e;ga?y:a,h=x>h?x:h}this.minX=n,this.minY=o,this.maxX=a,this.maxY=h}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}}const ft=new Ss(E),Ot=new Ss(mt);function Yi(s,t,e){e.clear();let i,r;return s.parent?t?i=s.parent.worldTransform:(r=ft.get().identity(),i=Ee(s,r)):i=E.IDENTITY,$i(s,e,i,t),r&&ft.return(r),e.isValid||e.set(0,0,0,0),e}function $i(s,t,e,i){var a,h;if(!s.visible||!s.measurable)return;let r;i?r=s.worldTransform:(s.updateLocalTransform(),r=ft.get(),r.appendFrom(s.localTransform,e));const n=t,o=!!s.effects.length;if(o&&(t=Ot.get().clear()),s.boundsArea)t.addRect(s.boundsArea,r);else{s.addBounds&&(t.matrix=r,s.addBounds(t));for(let c=0;c>12&&(s.didChange=!0,s.data[0]=this._didChangeId>>12),Xi(this,s),s.didChange&&Hi(this,s.localBounds,qn),s.localBounds},getBounds(s,t){return Yi(this,s,t||new mt)}},Zn={_onRender:null,set onRender(s){const t=this.renderGroup;if(!s){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=s},get onRender(){return this._onRender}},Kn={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(s){this._zIndex!==s&&(this._zIndex=s,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Qn))}};function Qn(s,t){return s._zIndex-t._zIndex}const Jn={getGlobalPosition(s=new q,t=!1){return this.parent?this.parent.toGlobal(this._position,s,t):(s.x=this._position.x,s.y=this._position.y),s},toGlobal(s,t,e=!1){if(!e){this.updateLocalTransform();const i=Ee(this,new E);return i.append(this.localTransform),i.apply(s,t)}return this.worldTransform.apply(s,t)},toLocal(s,t,e,i){if(t&&(s=t.toGlobal(s,e,i)),!i){this.updateLocalTransform();const r=Ee(this,new E);return r.append(this.localTransform),r.applyInverse(s,e)}return this.worldTransform.applyInverse(s,e)}};class Vi{constructor(){this.uid=W("instructionSet"),this.instructions=[],this.instructionSize=0}reset(){this.instructionSize=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}class to{constructor(t){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this._children=[],this.worldTransform=new E,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Vi,this._onRenderContainers=[],this.root=t,this.addChild(t)}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.onChildUpdate(t.root),this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){t.root.didChange&&this._removeChildFromUpdate(t.root);const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t!==this.root&&(this._children.push(t),t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t._onRender&&this.addOnRender(t)),t.renderGroup){if(t.renderGroup.root===t){this.addRenderGroupChild(t.renderGroup);return}}else t.renderGroup=this,t.didChange=!0;const e=t.children;t.isRenderGroupRoot||this.onChildUpdate(t);for(let i=0;i-1&&this._children.splice(e,1)}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(t.didViewUpdate=!1,this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t))}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}_removeChildFromUpdate(t){const e=this.childrenToUpdate[t.relativeRenderGroupDepth];if(!e)return;const i=e.list.indexOf(t);i>-1&&e.list.splice(i,1),e.index--}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(){for(let t=0;tthis.addChild(r)),this.effects=[],(i=t.parent)==null||i.addChild(this)}static mixin(t){Object.defineProperties(Z.prototype,Object.getOwnPropertyDescriptors(t))}addChild(...t){if(this.allowChildren||Y(O,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let i=0;i1){for(let r=0;r-1&&(this.children.splice(i,1),this.renderGroup&&this.renderGroup.removeChild(e),e.parent=null,this.emit("childRemoved",e,this,i),e.emit("removed",this)),e}_onUpdate(t){if(t&&t===this._skew&&this._updateSkew(),this._didChangeId++,!this.didChange)if(this.didChange=!0,this.isRenderGroupRoot){const e=this.renderGroup.renderGroupParent;e&&e.onChildUpdate(this)}else this.renderGroup&&this.renderGroup.onChildUpdate(this)}set isRenderGroup(t){if(this.isRenderGroupRoot&&t===!1)throw new Error("[Pixi] cannot undo a render group just yet");t&&this.enableRenderGroup()}get isRenderGroup(){return this.isRenderGroupRoot}enableRenderGroup(){if(this.renderGroup&&this.renderGroup.root===this)return;this.isRenderGroupRoot=!0;const t=this.renderGroup;if(t&&t.removeChild(this),this.renderGroup=new to(this),t){for(let e=0;e>16&255)}set blendMode(t){this.localBlendMode!==t&&(this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._updateFlags|=so,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?1:0;(this.localDisplayStatus&2)>>1!==e&&(this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._updateFlags|=Qe,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?1:0;(this.localDisplayStatus&4)>>2!==e&&(this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._updateFlags|=Qe,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=Qe,this.localDisplayStatus^=1,this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0,this.removeFromParent(),this.parent=null,this._mask=null,this._filters=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners();const e=typeof t=="boolean"?t:t==null?void 0:t.children,i=this.removeChildren(0,this.children.length);if(e)for(let r=0;r{this.onViewUpdate()}}),i?this.anchor=i:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=r??!1,n&&(this.width=n),o&&(this.height=o)}static from(t,e=!1){return t instanceof B?new se(t):new se(B.from(t,e))}set texture(t){t||(t=B.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())}get texture(){return this._texture}get bounds(){return this._boundsDirty&&(this._updateBounds(),this._boundsDirty=!1),this._bounds}get sourceBounds(){return this._sourceBoundsDirty&&(this._updateSourceBounds(),this._sourceBoundsDirty=!1),this._sourceBounds}containsPoint(t){const e=this.sourceBounds;return t.x>=e.maxX&&t.x<=e.minX&&t.y>=e.maxY&&t.y<=e.minY}addBounds(t){const e=this._texture.trim?this.sourceBounds:this.bounds;t.addFrame(e.minX,e.minY,e.maxX,e.maxY)}onViewUpdate(){this._didChangeId+=4096,this._didSpriteUpdate=!0,this._sourceBoundsDirty=this._boundsDirty=!0,!this.didViewUpdate&&(this.didViewUpdate=!0,this.renderGroup&&this.renderGroup.onChildViewUpdate(this))}_updateBounds(){In(this._bounds,this._anchor,this._texture,0)}_updateSourceBounds(){const t=this._anchor,e=this._texture,i=this._sourceBounds,{width:r,height:n}=e.orig;i.maxX=-t._x*r,i.minX=i.maxX+r,i.maxY=-t._y*n,i.minY=i.maxY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const i=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(i)}this._texture=null,this._bounds=null,this._sourceBounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width)}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){let i,r;typeof t!="object"?(i=t,r=e??t):(i=t.width,r=t.height??t.width),i!==void 0&&this._setWidth(i,this._texture.orig.width),r!==void 0&&this._setHeight(r,this._texture.orig.height)}}const io=new mt;function Wi(s,t,e){const i=io;s.measurable=!0,Yi(s,e,i),t.addBoundsMask(i),s.measurable=!1}function qi(s,t,e){const i=Ot.get();s.measurable=!0;const r=ft.get().identity(),n=ji(s,e,r);Hi(s,i,n),s.measurable=!1,t.addBoundsMask(i),ft.return(r),Ot.return(i)}function ji(s,t,e){return s?(s!==t&&(ji(s.parent,t,e),s.updateLocalTransform(),e.append(s.localTransform)),e):(pt("Mask bounds, renderable is not inside the root container"),e)}class Zi{constructor(t){this.priority=0,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof se),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){Wi(this.mask,t,e)}addLocalBounds(t,e){qi(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof se}}Zi.extension=H.MaskEffect;class Ki{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Ki.extension=H.MaskEffect;class Qi{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){Wi(this.mask,t,e)}addLocalBounds(t,e){qi(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof Z}}Qi.extension=H.MaskEffect;const ro={createCanvas:(s,t)=>{const e=document.createElement("canvas");return e.width=s,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,t)=>fetch(s,t),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")};let ri=ro;const It={get(){return ri},set(s){ri=s}};class Ji extends bt{constructor(t){t.resource||(t.resource=It.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity;const e=t.resource;(this.pixelWidth!==e.width||this.pixelWidth!==e.height)&&this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,i=this._resolution){const r=super.resize(t,e,i);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}}Ji.extension=H.TextureSource;class Ps extends bt{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=It.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0),t.resource=e,pt("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead.")}super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap}}Ps.extension=H.TextureSource;var fs=(s=>(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(fs||{});class Je{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=i,this._once=r}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const tr=class Q{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Je(null,null,1/0),this.deltaMS=1/Q.targetFPMS,this.elapsedMS=1/Q.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=fs.NORMAL){return this._addListener(new Je(t,e,i))}addOnce(t,e,i=fs.NORMAL){return this._addListener(new Je(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n{var o;const t=document.createElement("canvas").getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(a=>{const h=document.createElement("video");h.onloadeddata=()=>a(h),h.onerror=()=>a(null),h.autoplay=!1,h.crossOrigin="anonymous",h.preload="auto",h.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",h.load()});if(!e)return"premultiply-alpha-on-upload";const i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(r),t.deleteTexture(i),(o=t.getExtension("WEBGL_lose_context"))==null||o.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),ts}const Ge=class er extends bt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...er.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=ge.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await no(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ge.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ge.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ge.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||globalThis.VideoFrame&&t instanceof VideoFrame}};Ge.extension=H.TextureSource;Ge.defaultOptions={...bt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Ge.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let oo=Ge;const Dt=(s,t,e=!1)=>(Array.isArray(s)||(s=[s]),t?s.map(i=>typeof i=="string"||e?t(i):i):s);class ao{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||pt(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=Dt(t);let r;for(let h=0;h{n.set(h,e)});const o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(h=>{this._cacheMap.set(h,a)}),o.forEach(h=>{const c=r?r[h]:e;this._cache.has(h)&&this._cache.get(h)!==c&&pt("[Cache] already has key:",h),this._cache.set(h,n.get(h))})}remove(t){if(!this._cacheMap.has(t)){pt(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(r=>{this._cache.delete(r)}),e.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Gt=new ao,ps=[];Bt.handleByList(H.TextureSource,ps);function ho(s={}){const t=s&&s.resource,e=t?s.resource:s,i=t?s:{resource:s};for(let r=0;r{Gt.has(i)&&Gt.remove(i)}),t||Gt.set(i,n),n}function co(s,t=!1){return typeof s=="string"?Gt.get(s):s instanceof bt?new B({source:s}):lo(s,t)}B.from=co;Bt.add(Zi,Ki,Qi,oo,Ps,Ji,Ms);var sr=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(sr||{});function nt(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function Vt(s){return s.split("?")[0].split("#")[0]}function uo(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fo(s,t,e){return s.replace(new RegExp(uo(t),"g"),e)}function po(s,t){let e="",i=0,r=-1,n=0,o=-1;for(let a=0;a<=s.length;++a){if(a2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),r=a,n=0;continue}}else if(e.length===2||e.length===1){e="",i=0,r=a,n=0;continue}}t&&(e.length>0?e+="/..":e="..",i=2)}else e.length>0?e+=`/${s.slice(r+1,a)}`:e=s.slice(r+1,a),i=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}const ie={toPosix(s){return fo(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){nt(s),s=this.toPosix(s);const t=/^file:\/\/\//.exec(s);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(s);return e?e[0]:""},toAbsolute(s,t,e){if(nt(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=Vt(this.toPosix(t??It.get().getBaseUrl())),r=Vt(this.toPosix(e??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?ie.join(r,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(nt(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let t="";const e=s.startsWith("/");this.hasProtocol(s)&&(t=this.rootname(s),s=s.slice(t.length));const i=s.endsWith("/");return s=po(s,!1),s.length>0&&i&&(s+="/"),e?`/${s}`:t+s},isAbsolute(s){return nt(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=i;else{const r=s[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(s){if(nt(s),s.length===0)return".";s=this.toPosix(s);let t=s.charCodeAt(0);const e=t===47;let i=-1,r=!0;const n=this.getProtocol(s),o=s;s=s.slice(n.length);for(let a=s.length-1;a>=1;--a)if(t=s.charCodeAt(a),t===47){if(!r){i=a;break}}else r=!1;return i===-1?e?"/":this.isUrl(o)?n+s:n:e&&i===1?"//":n+s.slice(0,i)},rootname(s){nt(s),s=this.toPosix(s);let t="";if(s.startsWith("/")?t="/":t=this.getProtocol(s),this.isUrl(s)){const e=s.indexOf("/",t.length);e!==-1?t=s.slice(0,e):t=s,t.endsWith("/")||(t+="/")}return t},basename(s,t){nt(s),t&&nt(t),s=Vt(this.toPosix(s));let e=0,i=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=s.length){if(t.length===s.length&&t===s)return"";let o=t.length-1,a=-1;for(n=s.length-1;n>=0;--n){const h=s.charCodeAt(n);if(h===47){if(!r){e=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a))}return e===i?i=a:i===-1&&(i=s.length),s.slice(e,i)}for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!r){e=n+1;break}}else i===-1&&(r=!1,i=n+1);return i===-1?"":s.slice(e,i)},extname(s){nt(s),s=Vt(this.toPosix(s));let t=-1,e=0,i=-1,r=!0,n=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!r){e=o+1;break}continue}i===-1&&(r=!1,i=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||i===-1||n===0||n===1&&t===i-1&&t===e+1?"":s.slice(t,i)},parse(s){nt(s);const t={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return t;s=Vt(this.toPosix(s));let e=s.charCodeAt(0);const i=this.isAbsolute(s);let r;t.root=this.rootname(s),i||this.hasProtocol(s)?r=1:r=0;let n=-1,o=0,a=-1,h=!0,c=s.length-1,l=0;for(;c>=r;--c){if(e=s.charCodeAt(c),e===47){if(!h){o=c+1;break}continue}a===-1&&(h=!1,a=c+1),e===46?n===-1?n=c:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||a===-1||l===0||l===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&i?t.base=t.name=s.slice(1,a):t.base=t.name=s.slice(o,a)):(o===0&&i?(t.name=s.slice(1,n),t.base=s.slice(1,a)):(t.name=s.slice(o,n),t.base=s.slice(o,a)),t.ext=s.slice(n,a)),t.dir=this.dirname(s),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function ir(s,t,e,i,r){const n=t[e];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),ir(s,r,0,e,i)}else i.push(s);return i}const ni=s=>!Array.isArray(s);class rr{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,src:i}=t;return Dt(e||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>(o==null?void 0:o.src)??o):n!=null&&n.src?n.src:n,!0)}addManifest(t){this._manifest&&pt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];let r=e;Array.isArray(e)||(r=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),r.forEach(n=>{const o=n.src,a=n.alias;let h;if(typeof a=="string"){const c=this._createBundleAssetId(t,a);i.push(c),h=[a,c]}else{const c=a.map(l=>this._createBundleAssetId(t,l));i.push(...c),h=[...a,...c]}this.add({...n,alias:h,src:o})}),this._bundles[t]=i}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let i;i=n=>{this.hasKey(n)&&pt(`[Resolver] already has key: ${n} overwriting`)},Dt(e).forEach(n=>{const{src:o}=n;let{data:a,format:h,loadParser:c}=n;const l=Dt(o).map(p=>typeof p=="string"?mo(p):Array.isArray(p)?p:[p]),u=this.getAlias(n);Array.isArray(u)?u.forEach(i):i(u);const d=[];l.forEach(p=>{p.forEach(f=>{let g={};if(typeof f!="object"){g.src=f;for(let m=0;m{this._assetMap[p]=d})})}resolveBundle(t){const e=ni(t);t=Dt(t);const i={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const h in o){const c=o[h];a[this._extractAssetIdFromBundle(r,h)]=c}i[r]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const r in e)i[r]=e[r].src;return i}return e.src}resolve(t){const e=ni(t);t=Dt(t);const i={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const o=this._getPreferredOrder(n);o==null||o.priority.forEach(a=>{o.params[a].forEach(h=>{const c=n.filter(l=>l[a]?l[a]===h:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;en.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:i,data:r,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=ie.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??go(t.src),t}}rr.RETINA_PREFIX=/@([0-9\.]+)x/;function go(s){return s.split(".").pop().split("?").shift().split("#").shift()}const oi=(s,t)=>{const e=t.split("?")[1];return e&&(s+=`?${e}`),s},nr=class Qt{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof B?t:null,this.textureSource=t.source,this.textures={},this.animations={},this.data=e;const i=parseFloat(e.meta.scale);i?(this.resolution=i,t.source.resolution=this.resolution):this.resolution=t.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Qt.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=Qt.BATCH_SIZE;for(;e-t{this._batchIndex*Qt.BATCH_SIZE{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[r]=t.textures[r]}),!e){const r=ie.dirname(s[0]);t.linkedSheets.forEach((n,o)=>{const a=or([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(i,a)})}return i}const xo={extension:H.Asset,cache:{test:s=>s instanceof ai,getCacheableAssets:(s,t)=>or(s,t,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),i=e.pop(),r=e.pop();return i==="json"&&yo.includes(r)},parse:s=>{var e;const t=s.split(".");return{resolution:parseFloat(((e=rr.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:t[t.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:H.LoadParser,priority:sr.Normal},async testParse(s,t){return ie.extname(t.src).toLowerCase()===".json"&&!!s.frames},async parse(s,t,e){var c,l;const{texture:i,imageFilename:r}=(t==null?void 0:t.data)??{};let n=ie.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");let o;if(i instanceof B)o=i;else{const u=oi(n+(r??s.meta.image),t.src);o=(await e.load([u]))[u]}const a=new ai(o.source,s);await a.parse();const h=(c=s==null?void 0:s.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(h)){const u=[];for(const p of h){if(typeof p!="string")continue;let f=n+p;(l=t.data)!=null&&l.ignoreMultiPack||(f=oi(f,t.src),u.push(e.load({src:f,data:{ignoreMultiPack:!0}})))}const d=await Promise.all(u);a.linkedSheets=d,d.forEach(p=>{p.linkedSheets=[a].concat(a.linkedSheets.filter(f=>f!==p))})}return a},async unload(s,t,e){await e.unload(s.textureSource._sourceOrigin),s.destroy(!1)}}};Bt.add(xo);class _o{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const i in t){const r=t[i];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const i in this.resources)t[e++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,e){var r,n;const i=this.resources[e];t!==i&&(i&&((r=t.off)==null||r.call(t,"change",this.onResourceChange,this)),(n=t.on)==null||n.call(t,"change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const i in e)e[i]._touched=t}destroy(){var e;const t=this.resources;for(const i in t){const r=t[i];(e=r.off)==null||e.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const i in e)e[i]===t&&(e[i]=null)}else this._updateKey()}}const ms=[];Bt.handleByNamedList(H.Environment,ms);async function bo(s){if(s)for(let t=0;t80*e){a=c=s[0],h=l=s[1];for(var f=e;fc&&(c=u),d>l&&(l=d);p=Math.max(c-a,l-h),p=p!==0?32767/p:0}return re(n,o,e,a,h,p,0),o}function ar(s,t,e,i,r){var n,o;if(r===xs(s,t,e,i)>0)for(n=t;n=t;n-=i)o=hi(n,s[n],s[n+1],o);return o&&Ue(o,o.next)&&(oe(o),o=o.next),o}function Et(s,t){if(!s)return s;t||(t=s);var e=s,i;do if(i=!1,!e.steiner&&(Ue(e,e.next)||D(e.prev,e,e.next)===0)){if(oe(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function re(s,t,e,i,r,n,o){if(s){!o&&n&&Eo(s,i,r,n);for(var a=s,h,c;s.prev!==s.next;){if(h=s.prev,c=s.next,n?vo(s,i,r,n):Co(s)){t.push(h.i/e|0),t.push(s.i/e|0),t.push(c.i/e|0),oe(s),s=c.next,a=c.next;continue}if(s=c,s===a){o?o===1?(s=Ao(Et(s),t,e),re(s,t,e,i,r,n,2)):o===2&&Mo(s,t,e,i,r,n):re(Et(s),t,e,i,r,n,1);break}}}}function Co(s){var t=s.prev,e=s,i=s.next;if(D(t,e,i)>=0)return!1;for(var r=t.x,n=e.x,o=i.x,a=t.y,h=e.y,c=i.y,l=rn?r>o?r:o:n>o?n:o,p=a>h?a>c?a:c:h>c?h:c,f=i.next;f!==t;){if(f.x>=l&&f.x<=d&&f.y>=u&&f.y<=p&&Nt(r,a,n,h,o,c,f.x,f.y)&&D(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function vo(s,t,e,i){var r=s.prev,n=s,o=s.next;if(D(r,n,o)>=0)return!1;for(var a=r.x,h=n.x,c=o.x,l=r.y,u=n.y,d=o.y,p=ah?a>c?a:c:h>c?h:c,m=l>u?l>d?l:d:u>d?u:d,_=gs(p,f,t,e,i),y=gs(g,m,t,e,i),x=s.prevZ,b=s.nextZ;x&&x.z>=_&&b&&b.z<=y;){if(x.x>=p&&x.x<=g&&x.y>=f&&x.y<=m&&x!==r&&x!==o&&Nt(a,l,h,u,c,d,x.x,x.y)&&D(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=p&&b.x<=g&&b.y>=f&&b.y<=m&&b!==r&&b!==o&&Nt(a,l,h,u,c,d,b.x,b.y)&&D(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=_;){if(x.x>=p&&x.x<=g&&x.y>=f&&x.y<=m&&x!==r&&x!==o&&Nt(a,l,h,u,c,d,x.x,x.y)&&D(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=y;){if(b.x>=p&&b.x<=g&&b.y>=f&&b.y<=m&&b!==r&&b!==o&&Nt(a,l,h,u,c,d,b.x,b.y)&&D(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Ao(s,t,e){var i=s;do{var r=i.prev,n=i.next.next;!Ue(r,n)&&hr(r,i,i.next,n)&&ne(r,n)&&ne(n,r)&&(t.push(r.i/e|0),t.push(i.i/e|0),t.push(n.i/e|0),oe(i),oe(i.next),i=s=n),i=i.next}while(i!==s);return Et(i)}function Mo(s,t,e,i,r,n){var o=s;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Lo(o,a)){var h=lr(o,a);o=Et(o,o.next),h=Et(h,h.next),re(o,t,e,i,r,n,0),re(h,t,e,i,r,n,0);return}a=a.next}o=o.next}while(o!==s)}function So(s,t,e,i){var r=[],n,o,a,h,c;for(n=0,o=t.length;n=e.next.y&&e.next.y!==e.y){var a=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=i&&a>n&&(n=a,o=e.x=e.x&&e.x>=c&&i!==e.x&&Nt(ro.x||e.x===o.x&&Io(o,e)))&&(o=e,u=d)),e=e.next;while(e!==h);return o}function Io(s,t){return D(s.prev,s,t.prev)<0&&D(t.next,s,s.next)<0}function Eo(s,t,e,i){var r=s;do r.z===0&&(r.z=gs(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==s);r.prevZ.nextZ=null,r.prevZ=null,Ro(r)}function Ro(s){var t,e,i,r,n,o,a,h,c=1;do{for(e=s,s=null,n=null,o=0;e;){for(o++,i=e,a=0,t=0;t0||h>0&&i;)a!==0&&(h===0||!i||e.z<=i.z)?(r=e,e=e.nextZ,a--):(r=i,i=i.nextZ,h--),n?n.nextZ=r:s=r,r.prevZ=n,n=r;e=i}n.nextZ=null,c*=2}while(o>1);return s}function gs(s,t,e,i,r){return s=(s-e)*r|0,t=(t-i)*r|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,s|t<<1}function Bo(s){var t=s,e=s;do(t.x=(s-o)*(n-a)&&(s-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(r-o)*(i-a)}function Lo(s,t){return s.next.i!==t.i&&s.prev.i!==t.i&&!Fo(s,t)&&(ne(s,t)&&ne(t,s)&&Do(s,t)&&(D(s.prev,s,t.prev)||D(s,t.prev,t))||Ue(s,t)&&D(s.prev,s,s.next)>0&&D(t.prev,t,t.next)>0)}function D(s,t,e){return(t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y)}function Ue(s,t){return s.x===t.x&&s.y===t.y}function hr(s,t,e,i){var r=xe(D(s,t,e)),n=xe(D(s,t,i)),o=xe(D(e,i,s)),a=xe(D(e,i,t));return!!(r!==n&&o!==a||r===0&&ye(s,e,t)||n===0&&ye(s,i,t)||o===0&&ye(e,s,i)||a===0&&ye(e,t,i))}function ye(s,t,e){return t.x<=Math.max(s.x,e.x)&&t.x>=Math.min(s.x,e.x)&&t.y<=Math.max(s.y,e.y)&&t.y>=Math.min(s.y,e.y)}function xe(s){return s>0?1:s<0?-1:0}function Fo(s,t){var e=s;do{if(e.i!==s.i&&e.next.i!==s.i&&e.i!==t.i&&e.next.i!==t.i&&hr(e,e.next,s,t))return!0;e=e.next}while(e!==s);return!1}function ne(s,t){return D(s.prev,s,s.next)<0?D(s,t,s.next)>=0&&D(s,s.prev,t)>=0:D(s,t,s.prev)<0||D(s,s.next,t)<0}function Do(s,t){var e=s,i=!1,r=(s.x+t.x)/2,n=(s.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==s);return i}function lr(s,t){var e=new ys(s.i,s.x,s.y),i=new ys(t.i,t.x,t.y),r=s.next,n=t.prev;return s.next=t,t.prev=s,e.next=r,r.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function hi(s,t,e,i){var r=new ys(s,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function oe(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function ys(s,t,e){this.i=s,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ne.deviation=function(s,t,e,i){var r=t&&t.length,n=r?t[0]*e:s.length,o=Math.abs(xs(s,0,n,e));if(r)for(var a=0,h=t.length;a0&&(i+=s[r-1].length,e.holes.push(i))}return e};var Go=Ts.exports;const No=As(Go);var cr=(s=>(s[s.NONE=0]="NONE",s[s.COLOR=16384]="COLOR",s[s.STENCIL=1024]="STENCIL",s[s.DEPTH=256]="DEPTH",s[s.COLOR_DEPTH=16640]="COLOR_DEPTH",s[s.COLOR_STENCIL=17408]="COLOR_STENCIL",s[s.DEPTH_STENCIL=1280]="DEPTH_STENCIL",s[s.ALL=17664]="ALL",s))(cr||{});class Uo{constructor(t){this.items=[],this._name=t}emit(t,e,i,r,n,o,a,h){const{name:c,items:l}=this;for(let u=0,d=l.length;u{this.runners[e]=new Uo(e)})}_addSystems(t){let e;for(e in t){const i=t[e];this._addSystem(i.value,i.name)}}_addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,e){const i=e.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!wo())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};ur.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let fr=ur,_e;function Yo(s){return _e!==void 0||(_e=(()=>{var e;const t={stencil:!0,failIfMajorPerformanceCaveat:s??fr.defaultOptions.failIfMajorPerformanceCaveat};try{if(!It.get().getWebGLRenderingContext())return!1;let r=It.get().createCanvas().getContext("webgl",t);const n=!!((e=r==null?void 0:r.getContextAttributes())!=null&&e.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch{return!1}})()),_e}let be;async function $o(s={}){return be!==void 0||(be=await(async()=>{if(!It.get().getNavigator().gpu)return!1;try{return await(await navigator.gpu.requestAdapter(s)).requestDevice(),!0}catch{return!1}})()),be}const li=["webgl","webgpu","canvas"];async function Ho(s){let t=[];s.preference?(t.push(s.preference),li.forEach(n=>{n!==s.preference&&t.push(n)})):t=li.slice();let e;await bo(s.manageImports??!0);let i={};for(let n=0;nimport("./WebGPURenderer-lyM9mhaa.js"),__vite__mapDeps([5,2,6,3]));e=a,i={...s,...s.webgpu};break}else if(o==="webgl"&&Yo(s.failIfMajorPerformanceCaveat??fr.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Ie(()=>import("./WebGLRenderer-N8rVeROe.js"),__vite__mapDeps([7,2,4,6]));e=a,i={...s,...s.webgl};break}else if(o==="canvas"){i={...s};break}}delete i.webgpu,delete i.webgl;const r=new e;return await r.init(i),r}const pr=class _s{constructor(...t){this.stage=new Z,t[0]!==void 0&&Y(O,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await Ho(t),_s._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Y(O,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const i=_s._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};pr._plugins=[];let mr=pr;Bt.handleByList(H.Application,mr._plugins);var zo=Vo,es={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Xo=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function Vo(s){var t=[];return s.replace(Xo,function(e,i,r){var n=i.toLowerCase();for(r=qo(r),n=="m"&&r.length>2&&(t.push([i].concat(r.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(r.length==es[n])return r.unshift(i),t.push(r);if(r.length0&&(r=i.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:pt(`Unknown SVG path command: ${c}`)}c!=="Z"&&c!=="z"&&r===null&&(r={startX:n,startY:o},i.push(r))}return t}class ks{constructor(t=0,e=0,i=0){this.type="circle",this.x=t,this.y=e,this.radius=i}clone(){return new ks(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i}strokeContains(t,e,i){if(this.radius===0)return!1;const r=this.x-t,n=this.y-e,o=this.radius,a=i/2,h=Math.sqrt(r*r+n*n);return ho-a}getBounds(t){return t=t||new V,t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Is{constructor(t=0,e=0,i=0,r=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=i,this.halfHeight=r}clone(){return new Is(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(t,e,i){const{halfWidth:r,halfHeight:n}=this;if(r<=0||n<=0)return!1;const o=i/2,a=r-o,h=n-o,c=r+o,l=n+o,u=t-this.x,d=e-this.y,p=u*u/(a*a)+d*d/(h*h),f=u*u/(c*c)+d*d/(l*l);return p>1&&f<=1}getBounds(){return new V(this.x-this.halfWidth,this.y-this.halfHeight,this.halfWidth*2,this.halfHeight*2)}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Ko(s,t,e,i,r,n){const o=s-e,a=t-i,h=r-e,c=n-i,l=o*h+a*c,u=h*h+c*c;let d=-1;u!==0&&(d=l/u);let p,f;d<0?(p=e,f=i):d>1?(p=r,f=n):(p=e+d*h,f=i+d*c);const g=s-p,m=t-f;return g*g+m*m}class te{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let r=0,n=e.length;re!=l>e&&t<(c-a)*((e-h)/(l-h))+a&&(i=!i)}return i}strokeContains(t,e,i){const r=i/2,n=r*r,{points:o}=this,a=o.length-(this.closePath?0:2);for(let h=0;hr?c:r,n=lo?l:o}return t.x=i,t.width=r-i,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const we=(s,t,e,i,r,n)=>{const o=s-e,a=t-i,h=Math.sqrt(o*o+a*a);return h>=r-n&&h<=r+n};class Es{constructor(t=0,e=0,i=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n}getBounds(t){return t=t||new V,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Es(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=e-(this.y+i);const o=i*i;if(r*r+n*n<=o||(r=t-(this.x+this.width-i),r*r+n*n<=o)||(n=e-(this.y+this.height-i),r*r+n*n<=o)||(r=t-(this.x+i),r*r+n*n<=o))return!0}return!1}strokeContains(t,e,i){const{x:r,y:n,width:o,height:a,radius:h}=this,c=i/2,l=r+h,u=n+h,d=o-h*2,p=a-h*2,f=r+o,g=n+a;return(t>=r-c&&t<=r+c||t>=f-c&&t<=f+c)&&e>=u&&e<=u+p||(e>=n-c&&e<=n+c||e>=g-c&&e<=g+c)&&t>=l&&t<=l+d?!0:tf-h&&ef-h&&e>g-h&&we(t,e,f-h,g-h,h,c)||tg-h&&we(t,e,l,g-h,h,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}var K=(s=>(s[s.MAP_READ=1]="MAP_READ",s[s.MAP_WRITE=2]="MAP_WRITE",s[s.COPY_SRC=4]="COPY_SRC",s[s.COPY_DST=8]="COPY_DST",s[s.INDEX=16]="INDEX",s[s.VERTEX=32]="VERTEX",s[s.UNIFORM=64]="UNIFORM",s[s.STORAGE=128]="STORAGE",s[s.INDIRECT=256]="INDIRECT",s[s.QUERY_RESOLVE=512]="QUERY_RESOLVE",s[s.STATIC=1024]="STATIC",s))(K||{});class ae extends gt{constructor(t){let{data:e,size:i}=t;const{usage:r,label:n,shrinkToFit:o}=t;super(),this.uid=W("buffer"),this._resourceType="buffer",this._resourceId=W("resource"),this._touched=0,this._updateID=1,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,i=i??(e==null?void 0:e.byteLength);const a=!!e;this.descriptor={size:i,usage:r,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get static(){return!!(this.descriptor.usage&K.STATIC)}set static(t){t?this.descriptor.usage|=K.STATIC:this.descriptor.usage&=~K.STATIC}setDataWithSize(t,e,i){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){i&&this.emit("update",this);return}const r=this._data;if(this._data=t,r.length!==t.length){!this.shrinkToFit&&t.byteLengtha&&(a=p),f>h&&(h=f),pe.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const ea=new Float32Array(1),sa=new Uint32Array(1);class ia extends ta{constructor(){const e=new ae({data:ea,label:"attribute-batch-buffer",usage:K.VERTEX|K.COPY_DST,shrinkToFit:!1}),i=new ae({data:sa,label:"index-batch-buffer",usage:K.INDEX|K.COPY_DST,shrinkToFit:!1}),r=6*4;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:r,offset:0,location:1},aUV:{buffer:e,format:"float32x2",stride:r,offset:2*4,location:3},aColor:{buffer:e,format:"unorm8x4",stride:r,offset:4*4,location:0},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:r,offset:5*4,location:2}},indexBuffer:i})}}const yr=16,xr={};function ra(s,t){let e=0;for(let i=0;i>>0;return xr[e]||na(s,e)}function na(s,t){const e={};let i=0;for(let n=0;n0){const o=new Uint8Array(s,e*8,n);new Uint8Array(t,e*8,n).set(o)}}const oa={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var aa=(s=>(s[s.DISABLED=0]="DISABLED",s[s.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",s[s.MASK_ACTIVE=2]="MASK_ACTIVE",s[s.RENDERING_MASK_REMOVE=3]="RENDERING_MASK_REMOVE",s[s.NONE=4]="NONE",s))(aa||{});function di(s,t){return t.alphaMode==="no-premultiply-alpha"&&oa[s]||s}class fi{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;tthis.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const o=this.attributeBuffer.float32View,a=this.attributeBuffer.uint32View,h=this.indexBuffer;let c=this._batchIndexSize,l=this._batchIndexStart,u="startBatch",d=this._batchPool[this._batchPoolIndex++]||new pi;for(let p=this.elementStart;p=yr||y)&&(this._finishBatch(d,l,c-l,i,n,t,u),u="renderBatch",l=c,n=_,i=this._textureBatchPool[this._textureBatchPoolIndex++]||new fi,i.clear(),d=this._batchPool[this._batchPoolIndex++]||new pi,++qt),f.textureId=m._textureBindLocation=i.count,i.ids[m.uid]=i.count,i.textures[i.count++]=m,f.batch=d,c+=f.indexSize,f.packAttributes(o,a,f.location,f.textureId),f.packIndex(h,f.indexStart,f.location/this._vertexSize)}i.count>0&&(this._finishBatch(d,l,c-l,i,n,t,u),l=c,++qt),this.elementStart=this.elementSize,this._batchIndexStart=l,this._batchIndexSize=c}_finishBatch(t,e,i,r,n,o,a){t.gpuBindGroup=null,t.action=a,t.batcher=this,t.textures=r,t.blendMode=n,t.start=e,t.size=i,++qt,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),i=new ci(e);ui(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(t){const e=this.indexBuffer;let i=Math.max(t,e.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n>16&255,r=s>>8&255,n=s&255,o=t>>16&255,a=t>>8&255,h=t&255,c=i+(o-i)*e,l=r+(a-r)*e,u=n+(h-n)*e;return(c<<16)+(l<<8)+u}const ss=16777215;function da(s,t){return s===ss||t===ss?s+t-ss:ua(s,t,.5)}class Cr{constructor(){this.batcher=null,this.batch=null,this.applyTransform=!0,this.roundPixels=0}get blendMode(){return this.applyTransform?this.renderable.groupBlendMode:"normal"}packIndex(t,e,i){const r=this.geometryData.indices;for(let n=0;n>16|u&65280|(u&255)<<16;if(this.applyTransform){const p=da(d,o.groupColor)+(this.alpha*o.groupAlpha*255<<24),f=o.groupTransform,g=r<<16|this.roundPixels&65535,m=f.a,_=f.b,y=f.c,x=f.d,b=f.tx,M=f.ty;for(let I=c;I=0&&a>=0&&r>=0&&n>=0))return t;const h=Math.ceil(2.3*Math.sqrt(o+a)),c=h*8+(r?4:0)+(n?4:0);if(c===0)return t;if(h===0)return t[0]=t[6]=e+r,t[1]=t[3]=i+n,t[2]=t[4]=e-r,t[5]=t[7]=i-n,t;let l=0,u=h*4+(r?2:0)+2,d=u,p=c,f=r+o,g=n,m=e+f,_=e-f,y=i+g;if(t[l++]=m,t[l++]=y,t[--u]=y,t[--u]=_,n){const b=i-g;t[d++]=_,t[d++]=b,t[--p]=b,t[--p]=m}for(let b=1;b0&&(r[n++]=h,r[n++]=c,r[n++]=h-1),h++;r[n++]=c+1,r[n++]=c,r[n++]=h-1}},fa=1e-4,mi=1e-4;function pa(s){const t=s.length;if(t<6)return 1;let e=0;for(let i=0,r=s[t-2],n=s[t-1];iu&&(u+=Math.PI*2);let d=l;const p=u-l,f=Math.abs(p),g=Math.sqrt(h*h+c*c),m=(15*f*Math.sqrt(g)/Math.PI>>0)+1,_=p/m;if(d+=_,a){o.push(s,t),o.push(e,i);for(let y=1,x=d;y=0&&(l.join==="round"?y+=Mt(w,C,w-T*S,C-P*S,w-L*S,C-N*S,m,!1)+4:y+=2,m.push(w-L*k,C-N*k),m.push(w+L*S,C+N*S));continue}const Gs=(-T+v)*(-P+C)-(-T+w)*(-P+A),Ns=(-L+G)*(-N+C)-(-L+w)*(-N+ct),ce=(yt*Ns-Ht*Gs)/le,ue=(zt*Gs-$t*Ns)/le,Oe=(ce-w)*(ce-w)+(ue-C)*(ue-C),wt=w+(ce-w)*S,Ct=C+(ue-C)*S,vt=w-(ce-w)*k,At=C-(ue-C)*k,Ir=Math.min(yt*yt+$t*$t,Ht*Ht+zt*zt),Us=Xt?S:k,Er=Ir+Us*Us*M;Oe<=Er?l.join==="bevel"||Oe/M>I?(Xt?(m.push(wt,Ct),m.push(w+T*k,C+P*k),m.push(wt,Ct),m.push(w+L*k,C+N*k)):(m.push(w-T*S,C-P*S),m.push(vt,At),m.push(w-L*S,C-N*S),m.push(vt,At)),y+=2):l.join==="round"?Xt?(m.push(wt,Ct),m.push(w+T*k,C+P*k),y+=Mt(w,C,w+T*k,C+P*k,w+L*k,C+N*k,m,!0)+4,m.push(wt,Ct),m.push(w+L*k,C+N*k)):(m.push(w-T*S,C-P*S),m.push(vt,At),y+=Mt(w,C,w-T*S,C-P*S,w-L*S,C-N*S,m,!1)+4,m.push(w-L*S,C-N*S),m.push(vt,At)):(m.push(wt,Ct),m.push(vt,At)):(m.push(w-T*S,C-P*S),m.push(w+T*k,C+P*k),l.join==="round"?Xt?y+=Mt(w,C,w+T*k,C+P*k,w+L*k,C+N*k,m,!0)+2:y+=Mt(w,C,w-T*S,C-P*S,w-L*S,C-N*S,m,!1)+2:l.join==="miter"&&Oe/M<=I&&(Xt?(m.push(vt,At),m.push(vt,At)):(m.push(wt,Ct),m.push(wt,Ct)),y+=2),m.push(w-L*S,C-N*S),m.push(w+L*k,C+N*k),y+=2)}v=s[(_-2)*2],A=s[(_-2)*2+1],w=s[(_-1)*2],C=s[(_-1)*2+1],T=-(A-C),P=v-w,rt=Math.sqrt(T*T+P*P),T/=rt,P/=rt,T*=b,P*=b,m.push(w-T*S,C-P*S),m.push(w+T*k,C+P*k),f||(l.cap==="round"?y+=Mt(w-T*(S-k)*.5,C-P*(S-k)*.5,w-T*S,C-P*S,w+T*k,C+P*k,m,!1)+2:l.cap==="square"&&(y+=gi(w,C,T,P,S,k,!1,m)));const kr=mi*mi;for(let R=x;R=0&&o>=0&&(t[0]=i,t[1]=r,t[2]=i+n,t[3]=r,t[4]=i+n,t[5]=r+o,t[6]=i,t[7]=r+o),t},triangulate(s,t,e,i,r,n){let o=0;i*=e,t[i+o]=s[0],t[i+o+1]=s[1],o+=e,t[i+o]=s[2],t[i+o+1]=s[3],o+=e,t[i+o]=s[6],t[i+o+1]=s[7],o+=e,t[i+o]=s[4],t[i+o+1]=s[5],o+=e;const a=i/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2,r[n++]=a+1,r[n++]=a+3,r[n++]=a+2}},_a={build(s,t){return t[0]=s.x,t[1]=s.y,t[2]=s.x2,t[3]=s.y2,t[4]=s.x3,t[5]=s.y3,t},triangulate(s,t,e,i,r,n){let o=0;i*=e,t[i+o]=s[0],t[i+o+1]=s[1],o+=e,t[i+o]=s[2],t[i+o+1]=s[3],o+=e,t[i+o]=s[4],t[i+o+1]=s[5];const a=i/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2}},Rs={rectangle:xa,polygon:ya,triangle:_a,circle:is,ellipse:is,roundedRectangle:is},ba=new V;function wa(s,t){const{geometryData:e,batches:i}=t;i.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let r=0;r{const p=h.length,f=o.length/2,g=[],m=Rs[l.type];if(m.build(l,g),u&&wr(g,u),i){const b=l.closePath??!0;ma(g,t,!1,b,o,2,f,h)}else if(e&&c===d){c!==0&&console.warn("[Pixi Graphics] only the last shape have be cut out");const b=[],M=g.slice();va(e.shapePath).forEach(v=>{b.push(M.length/2),M.push(...v)}),vr(M,b,o,2,f,h,p)}else m.triangulate(g,o,2,f,h,p);const _=a.length/2,y=t.texture;if(y!==B.WHITE){const b=t.matrix;u&&b.append(u.clone().invert()),la(o,2,f,a,_,2,o.length/2-f,b)}else ca(a,_,2,o.length/2-f);const x=ot.get(Cr);x.indexOffset=p,x.indexSize=h.length-p,x.vertexOffset=f,x.vertexSize=o.length/2-f,x.color=t.color,x.alpha=t.alpha,x.texture=y,x.geometryData=n,r.push(x)})}function va(s){if(!s)return[];const t=s.shapePrimitives,e=[];for(let i=0;i{ot.return(i)})}destroy(){for(const t of this._needsContextNeedsRebuild)this._gpuContextHash[t.uid]&&this.onGraphicsContextDestroy(t);this._needsContextNeedsRebuild.length=0}};Bs.extension={type:[H.WebGLSystem,H.WebGPUSystem,H.CanvasSystem],name:"graphicsContext"};Bs.defaultOptions={bezierSmoothness:.5};let Ar=Bs;const Sa=8,Ce=11920929e-14,Pa=1;function Mr(s,t,e,i,r,n,o,a,h,c){const u=Math.min(.99,Math.max(0,c??Ar.defaultOptions.bezierSmoothness));let d=(Pa-u)/1;return d*=d,Ta(t,e,i,r,n,o,a,h,s,d),s}function Ta(s,t,e,i,r,n,o,a,h,c){ws(s,t,e,i,r,n,o,a,h,c,0),h.push(o,a)}function ws(s,t,e,i,r,n,o,a,h,c,l){if(l>Sa)return;const u=(s+e)/2,d=(t+i)/2,p=(e+r)/2,f=(i+n)/2,g=(r+o)/2,m=(n+a)/2,_=(u+p)/2,y=(d+f)/2,x=(p+g)/2,b=(f+m)/2,M=(_+x)/2,I=(y+b)/2;if(l>0){let v=o-s,A=a-t;const w=Math.abs((e-o)*A-(i-a)*v),C=Math.abs((r-o)*A-(n-a)*v);if(w>Ce&&C>Ce){if((w+C)*(w+C)<=c*(v*v+A*A)){h.push(M,I);return}}else if(w>Ce){if(w*w<=c*(v*v+A*A)){h.push(M,I);return}}else if(C>Ce){if(C*C<=c*(v*v+A*A)){h.push(M,I);return}}else if(v=M-(s+o)/2,A=I-(t+a)/2,v*v+A*A<=c){h.push(M,I);return}}ws(s,t,u,d,_,y,M,I,h,c,l+1),ws(M,I,x,b,g,m,o,a,h,c,l+1)}const ka=8,Ia=11920929e-14,Ea=1;function Ra(s,t,e,i,r,n,o,a){const c=Math.min(.99,Math.max(0,a??Ar.defaultOptions.bezierSmoothness));let l=(Ea-c)/1;return l*=l,Ba(t,e,i,r,n,o,s,l),s}function Ba(s,t,e,i,r,n,o,a){Cs(o,s,t,e,i,r,n,a,0),o.push(r,n)}function Cs(s,t,e,i,r,n,o,a,h){if(h>ka)return;const c=(t+i)/2,l=(e+r)/2,u=(i+n)/2,d=(r+o)/2,p=(c+u)/2,f=(l+d)/2;let g=n-t,m=o-e;const _=Math.abs((i-n)*m-(r-o)*g);if(_>Ia){if(_*_<=a*(g*g+m*m)){s.push(p,f);return}}else if(g=p-(t+n)/2,m=f-(e+o)/2,g*g+m*m<=a){s.push(p,f);return}Cs(s,t,e,c,l,p,f,a,h+1),Cs(s,p,f,u,d,n,o,a,h+1)}function Sr(s,t,e,i,r,n,o,a){let h=Math.abs(r-n);(!o&&r>n||o&&n>r)&&(h=2*Math.PI-h),a=a||Math.max(6,Math.floor(6*Math.pow(i,1/3)*(h/Math.PI))),a=Math.max(a,3);let c=h/a,l=r;c*=o?-1:1;for(let u=0;uu*h)}const ee=Math.PI*2,rs={centerX:0,centerY:0,ang1:0,ang2:0},ns=({x:s,y:t},e,i,r,n,o,a,h)=>{s*=e,t*=i;const c=r*s-n*t,l=n*s+r*t;return h.x=c+o,h.y=l+a,h};function Fa(s,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),i=t===1.5707963267948966?.551915024494:e,r=Math.cos(s),n=Math.sin(s),o=Math.cos(s+t),a=Math.sin(s+t);return[{x:r-n*i,y:n+r*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}const xi=(s,t,e,i)=>{const r=s*i-t*e<0?-1:1;let n=s*e+t*i;return n>1&&(n=1),n<-1&&(n=-1),r*Math.acos(n)},Da=(s,t,e,i,r,n,o,a,h,c,l,u,d)=>{const p=Math.pow(r,2),f=Math.pow(n,2),g=Math.pow(l,2),m=Math.pow(u,2);let _=p*f-p*m-f*g;_<0&&(_=0),_/=p*m+f*g,_=Math.sqrt(_)*(o===a?-1:1);const y=_*r/n*u,x=_*-n/r*l,b=c*y-h*x+(s+e)/2,M=h*y+c*x+(t+i)/2,I=(l-y)/r,v=(u-x)/n,A=(-l-y)/r,w=(-u-x)/n,C=xi(1,0,I,v);let G=xi(I,v,A,w);a===0&&G>0&&(G-=ee),a===1&&G<0&&(G+=ee),d.centerX=b,d.centerY=M,d.ang1=C,d.ang2=G};function Ga(s,t,e,i,r,n,o,a=0,h=0,c=0){if(n===0||o===0)return;const l=Math.sin(a*ee/360),u=Math.cos(a*ee/360),d=u*(t-i)/2+l*(e-r)/2,p=-l*(t-i)/2+u*(e-r)/2;if(d===0&&p===0)return;n=Math.abs(n),o=Math.abs(o);const f=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(o,2);f>1&&(n*=Math.sqrt(f),o*=Math.sqrt(f)),Da(t,e,i,r,n,o,h,c,l,u,d,p,rs);let{ang1:g,ang2:m}=rs;const{centerX:_,centerY:y}=rs;let x=Math.abs(m)/(ee/4);Math.abs(1-x)<1e-7&&(x=1);const b=Math.max(Math.ceil(x),1);m/=b;let M=s[s.length-2],I=s[s.length-1];const v={x:0,y:0};for(let A=0;A{const h=a.x-o.x,c=a.y-o.y,l=Math.sqrt(h*h+c*c),u=h/l,d=c/l;return{len:l,nx:u,ny:d}},r=(o,a)=>{o===0?s.moveTo(a.x,a.y):s.lineTo(a.x,a.y)};let n=t[t.length-1];for(let o=0;o0&&(p=-1,f=!0);const g=d/2;let m,_=Math.abs(Math.cos(g)*h/Math.sin(g));_>Math.min(l.len/2,u.len/2)?(_=Math.min(l.len/2,u.len/2),m=Math.abs(_*Math.sin(g)/Math.cos(g))):m=h;const y=a.x+u.nx*_+-u.ny*m*p,x=a.y+u.ny*_+u.nx*m*p,b=Math.atan2(l.ny,l.nx)+Math.PI/2*p,M=Math.atan2(u.ny,u.nx)-Math.PI/2*p;o===0&&s.moveTo(y+Math.cos(b)*m,x+Math.sin(b)*m),s.arc(y,x,m,b,M,f),n=a}}function Ua(s,t,e,i){const r=(a,h)=>Math.sqrt((a.x-h.x)**2+(a.y-h.y)**2),n=(a,h,c)=>({x:a.x+(h.x-a.x)*c,y:a.y+(h.y-a.y)*c}),o=t.length;for(let a=0;a=2;u-=2)l[u]===l[u-2]&&l[u-1]===l[u-3]&&l.splice(u-1,2);return this.poly(l,!0,o)}ellipse(t,e,i,r,n){return this.drawShape(new Is(t,e,i,r),n),this}roundRect(t,e,i,r,n,o){return this.drawShape(new Es(t,e,i,r,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let i=this._currentPoly;return i&&this.endPoly(),i=new te,i.points.push(t,e),this._currentPoly=i,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new te,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let i=e.shape.x,r=e.shape.y;if(!e.transform.isIdentity()){const n=e.transform,o=i;i=n.a*i+n.c*r+n.tx,r=n.b*o+n.d*r+n.ty}this._currentPoly.points.push(i,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;eparseInt(A,10)),t.context.poly(y,!0),e&&t.context.fill(),i&&t.context.stroke();break;case"polyline":x=s.getAttribute("points"),y=x.match(/\d+/g).map(A=>parseInt(A,10)),t.context.poly(y,!1),i&&t.context.stroke();break;case"g":case"svg":break;default:{console.info(`[SVG parser] <${s.nodeName}> elements unsupported`);break}}for(let A=0;A0}function Ka(s){return s.strokeCap!==void 0&&s.strokeCap==="ARROW_EQUILATERAL"}function Qa(s,t){var e;return((e=s.get(t))==null?void 0:e.length)===1}function Ja(s,t){var e;return((e=s.get(t))==null?void 0:e.length)===2}function th(s){return s.tangentStart!==void 0&&(s.tangentStart.x!==0||s.tangentStart.y!==0)||s.tangentEnd!==void 0&&(s.tangentEnd.x!==0||s.tangentEnd.y!==0)}function xt(s,t){const e=s.x-t.x,i=s.y-t.y;return Math.sqrt(e*e+i*i)}function eh(s,t,e){const i=xt(s,t),r=xt(t,e),n=xt(s,e),o=(Math.pow(i,2)+Math.pow(n,2)-Math.pow(r,2))/(2*i*r);return Math.acos(o)}const os="_VECTOR_NETWORK_DATA_";function sh(s){return s&&!0}function ih(s){return s&&!0}function rh(s){return s&&!0}function wi(s){return sh(s.vertices)&&ih(s.segments)&&rh(s.regions)}function nh(s,t,e){const i=xt(s,t),r=xt(s,e),{cornerRadius:n}=s,o=it.x?1:-1,r=s.y>t.y?1:-1;return{x:t.x+e*Math.abs(s.x-t.x)*i,y:t.y+e*Math.abs(s.y-t.y)*r}}function oh(s,t,e,i=5){const r=xt(s,t),n=s.x+i*e*(t.x-s.x)/r,o=s.y+i*e*(t.y-s.y)/r;return{x:n,y:o}}function ah(s,t,e){const i=eh(s,t,e),r=nh(s,t,e),n=r/Math.tan(i/2),o=xt(t,s),a=xt(e,s),h=4/3*(1-Math.cos(i/2))/Math.sin(i/2),c=ve(t,s,n/o),l=ve(e,s,n/a),u=ve(c,s,(n-h*r)/n),d=ve(l,s,(n-h*r)/n);return{from:c,to:l,controlFrom:u,controlTo:d}}function hh({start:s,end:t},{tangentStart:e,tangentEnd:i}){return{from:s,to:t,controlFrom:{x:s.x+e.x,y:s.y+e.y},controlTo:{x:t.x+i.x,y:t.y+i.y}}}function lh(s,t,e){const i=[],r={},n=qa(t),o=ja(t);for(let h=0;h');function fh(){let s;return Mi(()=>{const t=s;Be.mount(t)}),Ur(()=>{Be.unmount()}),(()=>{var t=dh(),e=t.firstChild,i=s;return typeof i=="function"?qr(i,e):s=e,t})()}var ph=et('
Vector Network