PageSourceSearch

https://moonsh.jp/_next/static/chunks/448.f602c79160522ed0.js

js moonsh.jp collected 2026-10-05 06:01:01 UTC 47,617 bytes, 20 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:note-front-custom-domain":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b0683355-e846-49cf-81f5-f9557de72519",e._sentryDebugIdIdentifier="sentry-dbid-b0683355-e846-49cf-81f5-f9557de72519")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[448],{10448:(e,t,r)=>{r.d(t,{WebGLRenderer:()=>eI});"use strict";var s,i,n,a,o,_=r(34943),l=r(19677),u=r(60175),h=r(70728),c=r(17897),d=r(32360),E=r(66359),g=r(24555),f=r(33026),m=r(96197),R=r(7258);class T{init(){let e=new R.k({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new l.u,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),t=(0,u.a)(),r=(0,h.I)({name:"graphics",bits:[c.a,(0,d.P)(t),E.mA,g.m]});this.shader=new m.M({glProgram:r,resources:{localUniforms:e,batchSamplers:(0,f.n)(t)}})}execute(e,t){let r=t.context,s=r.customShader||this.shader,i=e.renderer,{batcher:n,instructions:a}=i.graphicsContext.getContextRenderData(r);s.groups[0]=i.globalUniforms.bindGroup,i.state.set(e.state),i.shader.bind(s),i.geometry.bind(n.geometry,s.glProgram);let o=a.instructions;for(let e=0;e<a.instructionSize;e++){let t=o[e];if(t.size){for(let e=0;e<t.textures.count;e++)i.texture.bind(t.textures.textures[e],e);i.geometry.draw(t.topology,t.size,t.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}T.extension={type:[_.Ag.WebGLPipesAdaptor],name:"graphics"};"use strict";var b=r(9349),x=r(46480),S=r(53670);class p{init(){let e=(0,h.I)({name:"mesh",bits:[E.mA,b.m,g.m]});this._shader=new m.M({glProgram:e,resources:{uTexture:x.g.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new l.u}}}})}execute(e,t){let r=e.renderer,s=t._shader;if(s){if(!s.glProgram)return void(0,S.R)("Mesh shader has no glProgram",t.shader)}else{s=this._shader;let e=t.texture,r=e.source;s.resources.uTexture=r,s.resources.uSampler=r.style,s.resources.textureUniforms.uniforms.uTextureMatrix=e.textureMatrix.mapCoord}s.groups[100]=r.globalUniforms.bindGroup,s.groups[101]=e.localUniformsBindGroup,r.encoder.draw({geometry:t._geometry,shader:s,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}p.extension={type:[_.Ag.WebGLPipesAdaptor],name:"mesh"};"use strict";var A=r(14545);class B{constructor(){this._tempState=A.U.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,t,r){let s=e.renderer,i=this._didUploadHash[r.uid];s.shader.bind(r,i),i||(this._didUploadHash[r.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(t,r.glProgram)}execute(e,t){let r=e.renderer;this._tempState.blendMode=t.blendMode,r.state.set(this._tempState);let s=t.textures.textures;for(let e=0;e<t.textures.count;e++)r.texture.bind(s[e],e);r.geometry.draw(t.topology,t.size,t.start)}}B.extension={type:[_.Ag.WebGLPipesAdaptor],name:"batch"};var N=r(46508),G=r(50945),C=r(7475),I=r(30204),O=((s=O||{})[s.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",s[s.ARRAY_BUFFER=34962]="ARRAY_BUFFER",s[s.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",s);class D{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t}}"use strict";class F{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){let e=this._gl=this._renderer.gl;this._gpuBuffers=Object.create(null),this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){let{_gl:t}=this,r=this.getGlBuffer(e);t.bindBuffer(r.type,r.buffer)}bindBufferBase(e,t){let{_gl:r}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,r.bindBufferBase(r.UNIFORM_BUFFER,t,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let r=0,s=this._nextBindBaseIndex;for(;r<2;){s>=this._maxBindings&&(s=this._minBaseLocation,r++);let e=this._boundBufferBases[s];if(e&&e._lastBindCallId===this._bindCallId){s++;continue}break}return(t=s,this._nextBindBaseIndex=s+1,r>=2)?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){let t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,r,s){let{_gl:i}=this;r||(r=0),t||(t=0),this._boundBufferBases[t]=null,i.bindBufferRange(i.UNIFORM_BUFFER,t||0,e.buffer,256*r,s||256)}updateBuffer(e){let{_gl:t}=this,r=this.getGlBuffer(e);if(e._updateID===r.updateID)return r;r.updateID=e._updateID,t.bindBuffer(r.type,r.buffer);let s=e.data,i=e.descriptor.usage&I.S.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return s?r.byteLength>=s.byteLength?t.bufferSubData(r.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(r.byteLength=s.byteLength,t.bufferData(r.type,s,i)
1):(r.byteLength=e.descriptor.size,t.bufferData(r.type,r.byteLength,i)),r}destroyAll(){let e=this._gl;for(let t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,t){let r=this._gpuBuffers[e.uid],s=this._gl;t||s.deleteBuffer(r.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){let{_gl:t}=this,r=O.ARRAY_BUFFER;e.descriptor.usage&I.S.INDEX?r=O.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&I.S.UNIFORM&&(r=O.UNIFORM_BUFFER);let s=new D(t.createBuffer(),r);return this._gpuBuffers[e.uid]=s,e.on("destroy",this.onBufferDestroy,this),s}resetState(){this._boundBufferBases=Object.create(null)}}F.extension={type:[_.Ag.WebGLSystem],name:"buffer"};"use strict";var M=r(47397);let U=class e{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(t){t={...e.defaultOptions,...t};let r=this.multiView=t.multiView;if(t.context&&r&&((0,S.R)("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=M.e.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,t.context)this.initFromContext(t.context);else{let e=this._renderer.background.alpha<1,r=t.premultipliedAlpha??!0,s=t.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(t.preferWebGLVersion,{alpha:e,premultipliedAlpha:r,antialias:s,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&(0,S.R)("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof M.e.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);let t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,!1),t.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,t){let r,s=this.canvas;if(2===e&&(r=s.getContext("webgl2",t)),!r&&!(r=s.getContext("webgl",t)))throw Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=r,this.initFromContext(this.gl)}getExtensions(){let{gl:e}=this,t={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(1===this.webGLVersion)this.extensions={...t,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={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};let r=e.getExtension("WEBGL_provoking_vertex");r&&r.provokingVertexWEBGL(r.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){let e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){let t=e.getContextAttributes();t&&!t.stencil&&(0,S.R)("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let r=this.supports,s=2===this.webGLVersion,i=this.extensions;r.uint32Indices=s||!!i.uint32ElementIndex,r.uniformBufferObject=s,r.vertexArrayObject=s||!!i.vertexArrayObject,r.srgbTextures=s||!!i.srgb,r.nonPowOf2wrapping=s,r.nonPowOf2mipmaps=s,r.msaa=s,r.uint32Indices||(0,S.R)("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};U.extension={type:[_.Ag.WebGLSystem],name:"context"},U.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};"use strict";var L=r(68176),y=r(37606),P=((i=P||{})[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i),v=((n=v||{})[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n),H=((a=H||{})[a.CLAMP=33071]="CLAMP",a[a.REPEAT=10497]="REPEAT",a[a.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",a),w=((o=w||{})[o.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",o[o.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",o[o.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",o[o.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",o[o.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",o[o.UNSIGNED_INT=5125]="UNSIGNED_INT",o[o.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",o[o.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",o[o.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",o[o.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",o[o.BYTE=5120]="BYTE",o[o.SHORT=5122]="SHORT",o[o.INT=5124]="INT",o[o.FLOAT=5126]="FLOAT",o[o.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",o[o.HALF_FLOAT=36193]="HALF_FLOAT",o);"use strict";let X={uint8x2:w.UNSIGNED_BYTE,uint8x4:w.UNSIGNED_BYTE,sint8x2:w.BYTE,sint8x4:w.BYTE,unorm8x2:w.UNSIGNED_BYTE,unorm8x4:w.UNSIGNED_BYTE,snorm8x2:w.BYTE,snorm8x4:w.BYTE,uint16x2:w.UNSIGNED_SHORT,uint16x4:w.UNSIGNED_SHORT,sint16x2:w.SHORT,sint16x4:w.SHORT,unorm16x2:w.UNSIGNED_SHORT,unorm16x4:w.UNSIGNED_SHORT,snorm16x2:w.SHORT,snorm16x4:w.SHORT,float16x2:w.HALF_FLOAT,float16x4:w.HALF_FLOAT,float32:w.FLOAT,float32x2:w.FLOAT,float32x3:w.FLOAT,float32x4:w.FLOAT,uint32:w.UNSIGNED_INT,uint32x2:w.UNSIGNED_INT,uint32x3:w.UNSIGNED_INT,uint32x4:w.UNSIGNED_INT,sint32:w.INT,sint32x2:w.INT,sint32x3:w.INT,sint32x4:w.INT},V={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class k{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){let e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw Error("[PixiJS] Vertex Array Objects are not supported on this device");let t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e));let r=this._renderer.context.extensions.vertexAttribDivisorANGLE;r&&(e.drawArraysInstanced=(e,t,s,i)=>{r.drawArraysInstancedANGLE(e,t,s,i)},e.drawElementsInstanced=(e,t,s,i,n)=>{r.drawElementsInstancedANGLE(e,t,s,i,n)},e.vertexAttribDivisor=(e,t)=>
1r.vertexAttribDivisorANGLE(e,t)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,t){let r=this.gl;this._activeGeometry=e;let s=this.getVao(e,t);this._activeVao!==s&&(this._activeVao=s,r.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){let e=this._activeGeometry,t=this._renderer.buffer;for(let r=0;r<e.buffers.length;r++){let s=e.buffers[r];t.updateBuffer(s)}}checkCompatibility(e,t){let r=e.attributes,s=t._attributeData;for(let e in s)if(!r[e])throw Error(`shader and geometry incompatible, geometry missing the "${e}" attribute`)}getSignature(e,t){let r=e.attributes,s=t._attributeData,i=["g",e.uid];for(let e in r)s[e]&&i.push(e,s[e].location);return i.join("-")}getVao(e,t){return this._geometryVaoHash[e.uid]?.[t._key]||this.initGeometryVao(e,t)}initGeometryVao(e,t,r=!0){let s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);let n=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));let a=this._geometryVaoHash[e.uid],o=a[n];if(o)return a[t._key]=o,o;(0,y.q)(e,t._attributeData);let _=e.buffers;o=s.createVertexArray(),s.bindVertexArray(o);for(let e=0;e<_.length;e++){let t=_[e];i.bind(t)}return this.activateVao(e,t),a[t._key]=o,a[n]=o,s.bindVertexArray(null),o}onGeometryDestroy(e,t){let r=this._geometryVaoHash[e.uid],s=this.gl;if(r){if(t)for(let e in r)this._activeVao!==r[e]&&this.unbind(),s.deleteVertexArray(r[e]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){let t=this.gl;for(let r in this._geometryVaoHash){if(e)for(let e in this._geometryVaoHash[r]){let s=this._geometryVaoHash[r];this._activeVao!==s&&this.unbind(),t.deleteVertexArray(s[e])}this._geometryVaoHash[r]=null}}activateVao(e,t){let r=this._renderer.gl,s=this._renderer.buffer,i=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let n=null;for(let e in i){let a=i[e],o=a.buffer,_=s.getGlBuffer(o),l=t._attributeData[e];if(l){n!==_&&(s.bind(o),n=_);let e=l.location;r.enableVertexAttribArray(e);let t=(0,L.m)(a.format),i=X[a.format]??X.float32;if(l.format?.substring(1,4)==="int"?r.vertexAttribIPointer(e,t.size,i,a.stride,a.offset):r.vertexAttribPointer(e,t.size,i,t.normalised,a.stride,a.offset),a.instance)if(this.hasInstance){let t=a.divisor??1;r.vertexAttribDivisor(e,t)}else throw Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,r,s){let{gl:i}=this._renderer,n=this._activeGeometry,a=V[e||n.topology];if(s??(s=n.instanceCount),n.indexBuffer){let e=n.indexBuffer.data.BYTES_PER_ELEMENT,o=2===e?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s>1?i.drawElementsInstanced(a,t||n.indexBuffer.data.length,o,(r||0)*e,s):i.drawElements(a,t||n.indexBuffer.data.length,o,(r||0)*e)}else s>1?i.drawArraysInstanced(a,r||0,t||n.getSize(),s):i.drawArrays(a,r||0,t||n.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}}k.extension={type:[_.Ag.WebGLSystem],name:"geometry"};"use strict";var W=r(97786),Y=r(28513),K=r(22236);let j=new W.V({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),z=class e{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(t={}){let{useBackBuffer:r,antialias:s}={...e.defaultOptions,...t};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||((0,S.R)("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=A.U.for2d();let i=new K.M({vertex:`
2                attribute vec2 aPosition;
3                out vec2 vUv;
4
5                void main() {
6                    gl_Position = vec4(aPosition, 0.0, 1.0);
7
8                    vUv = (aPosition + 1.0) / 2.0;
9
10                    // flip dem UVs
11                    vUv.y = 1.0 - vUv.y;
12                }`,fragment:`
13                in vec2 vUv;
14                out vec4 finalColor;
15
16                uniform sampler2D uTexture;
17
18                void main() {
19                    finalColor = texture(uTexture, vUv);
20                }
20`,name:"big-triangle"});this._bigTriangleShader=new m.M({glProgram:i,resources:{uTexture:x.g.WHITE.source}})}renderStart(e){let t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){let t=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=t.colorTexture,e.target=this._getBackBufferTexture(t.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){let e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:j,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new x.g({source:new Y.v({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};z.extension={type:[_.Ag.WebGLSystem],name:"backBuffer",priority:1},z.defaultOptions={useBackBuffer:!1};"use strict";class q{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(8&e),!!(4&e),!!(2&e),!!(1&e)))}}"use strict";q.extension={type:[_.Ag.WebGLSystem],name:"colorMask"};class Z{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,t){this._renderer.geometry.bind(e,t.glProgram)}finishRenderPass(){}draw(e){let t=this._renderer,{geometry:r,shader:s,state:i,skipSync:n,topology:a,size:o,start:_,instanceCount:l}=e;t.shader.bind(s,n),t.geometry.bind(r,t.shader._activeProgram),i&&t.state.set(i),t.geometry.draw(a,o,_,l??r.instanceCount)}destroy(){this._renderer=null}}Z.extension={type:[_.Ag.WebGLSystem],name:"encoder"};"use strict";var Q=r(5164),J=r(99359);class ${constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:J.K.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this.resetState()}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:J.K.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference)}resetState(){this._stencilCache.enabled=!1,this._stencilCache.stencilMode=J.K.NONE,this._stencilCache.stencilReference=0}setStencilMode(e,t){let r=this._renderTargetStencilState[this._activeRenderTarget.uid],s=this._gl,i=Q.g[e],n=this._stencilCache;if(r.stencilMode=e,r.stencilReference=t,e===J.K.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,s.disable(s.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,s.enable(s.STENCIL_TEST)),(e!==n.stencilMode||n.stencilReference!==t)&&(n.stencilMode=e,n.stencilReference=t,s.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],t,255),s.stencilOp(s.KEEP,s.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))}}$.extension={type:[_.Ag.WebGLSystem],name:"stencil"};var ee=r(10303),et=r(78348),er=r(16434),es=r(31112),ei=r(81935);class en{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}"use strict";class ea{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new er.M}init(e,t){this._renderer=e,this._renderTargetSystem=t,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new er.M}copyToTexture(e,t,r,s,i){let n=this._renderTargetSystem,a=this._renderer,o=n.getGpuRenderTarget(e),_=a.gl;return this.finishRenderPass(e),_.bindFramebuffer(_.FRAMEBUFFER,o.resolveTargetFramebuffer),a.texture.bind(t,0),_.copyTexSubImage2D(_.TEXTURE_2D,0,i.x,i.y,r.x,r.y,s.width,s.height),t}startRenderPass(e,t=!0,r,s){let i=this._renderTargetSystem,n=e.colorTexture,a=i.getGpuRenderTarget(e),o=s.y;
20e.isRoot&&(o=n.pixelHeight-s.height),e.colorTextures.forEach(e=>{this._renderer.texture.unbind(e)});let _=this._renderer.gl;_.bindFramebuffer(_.FRAMEBUFFER,a.framebuffer);let l=this._viewPortCache;(l.x!==s.x||l.y!==o||l.width!==s.width||l.height!==s.height)&&(l.x=s.x,l.y=o,l.width=s.width,l.height=s.height,_.viewport(s.x,o,s.width,s.height)),!a.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(a),this.clear(e,t,r)}finishRenderPass(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);if(!t.msaa)return;let r=this._renderer.gl;r.bindFramebuffer(r.FRAMEBUFFER,t.resolveTargetFramebuffer),r.bindFramebuffer(r.READ_FRAMEBUFFER,t.framebuffer),r.blitFramebuffer(0,0,t.width,t.height,0,0,t.width,t.height,r.COLOR_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(r.FRAMEBUFFER,t.framebuffer)}initGpuRenderTarget(e){let t=this._renderer.gl,r=new en,s=e.colorTexture;return es.q.test(s.resource)?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),r.framebuffer=null):(this._initColor(e,r),t.bindFramebuffer(t.FRAMEBUFFER,null)),r}destroyGpuRenderTarget(e){let t=this._renderer.gl;e.framebuffer&&(t.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(t.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(t.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(e=>{t.deleteRenderbuffer(e)}),e.msaaRenderBuffer=null}clear(e,t,r){if(!t)return;let s=this._renderTargetSystem;"boolean"==typeof t&&(t=t?ei.u.ALL:ei.u.NONE);let i=this._renderer.gl;if(t&ei.u.COLOR){r??(r=s.defaultClearColor);let e=this._clearColorCache,t=r;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],i.clearColor(t[0],t[1],t[2],t[3]))}i.clear(t)}resizeGpuRenderTarget(e){if(e.isRoot)return;let t=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,t),(e.stencil||e.depth)&&this._resizeStencil(t)}_initColor(e,t){let r=this._renderer,s=r.gl,i=s.createFramebuffer();if(t.resolveTargetFramebuffer=i,s.bindFramebuffer(s.FRAMEBUFFER,i),t.width=e.colorTexture.source.pixelWidth,t.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((e,i)=>{let n=e.source;n.antialias&&(r.context.supports.msaa?t.msaa=!0:(0,S.R)("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),r.texture.bindSource(n,0);let a=r.texture.getGlSource(n).texture;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+i,3553,a,0)}),t.msaa){let r=s.createFramebuffer();t.framebuffer=r,s.bindFramebuffer(s.FRAMEBUFFER,r),e.colorTextures.forEach((e,r)=>{let i=s.createRenderbuffer();t.msaaRenderBuffer[r]=i})}else t.framebuffer=i;this._resizeColor(e,t)}_resizeColor(e,t){let r=e.colorTexture.source;if(t.width=r.pixelWidth,t.height=r.pixelHeight,e.colorTextures.forEach((e,t)=>{0!==t&&e.source.resize(r.width,r.height,r._resolution)}),t.msaa){let r=this._renderer,s=r.gl,i=t.framebuffer;s.bindFramebuffer(s.FRAMEBUFFER,i),e.colorTextures.forEach((e,i)=>{let n=e.source;r.texture.bindSource(n,0);let a=r.texture.getGlSource(n).internalFormat,o=t.msaaRenderBuffer[i];s.bindRenderbuffer(s.RENDERBUFFER,o),s.renderbufferStorageMultisample(s.RENDERBUFFER,4,a,n.pixelWidth,n.pixelHeight),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+i,s.RENDERBUFFER,o)})}}_initStencil(e){if(null===e.framebuffer)return;let t=this._renderer.gl,r=t.createRenderbuffer();e.depthStencilRenderBuffer=r,t.bindRenderbuffer(t.RENDERBUFFER,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,r),this._resizeStencil(e)}_resizeStencil(e){let t=this._renderer.gl;t.bindRenderbuffer(t.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,2===this._renderer.context.webGLVersion?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL,e.width,e.height)}prerender(e){let t=e.colorTexture.resource;this._renderer.context.multiView&&es.q.test(t)&&this._renderer.context.ensureCanvasSize(t)}postrender(e){if(this._renderer.context.multiView&&es.q.test(e.colorTexture.resource)){let t=this._renderer.context.canvas,r=e.colorTexture;r.context2D.drawImage(t,0,r.pixelHeight-t.height)}}}"use strict";class eo extends et.l{constructor(e){super(e),this.adaptor=new ea,this.adaptor.init(e,this)}}eo.extension={type:[_.Ag.WebGLSystem],name:"renderTarget"};"use strict";"use strict";var e_=r(11278),el=r(8139);let eu=class e{constructor(e){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=A.U.for2d(),e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(e){this.gl=e,this.blendModesMap=function(e){let t={};if(t.normal=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t.add=[e.ONE,e.ONE],t.multiply=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t.screen=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[e.SRC_ALPHA,e.ONE,e.ONE,e.ONE],t["screen-npm"]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t.erase
20=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],e instanceof M.e.get().getWebGLRenderingContext()){let r=e.getExtension("EXT_blend_minmax");r&&(t.min=[e.ONE,e.ONE,e.ONE,e.ONE,r.MIN_EXT,r.MIN_EXT],t.max=[e.ONE,e.ONE,e.ONE,e.ONE,r.MAX_EXT,r.MAX_EXT])}else t.min=[e.ONE,e.ONE,e.ONE,e.ONE,e.MIN,e.MIN],t.max=[e.ONE,e.ONE,e.ONE,e.ONE,e.MAX,e.MAX];return t}(e),this.resetState()}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,r=0;for(;t;)1&t&&this.map[r].call(this,!!(e.data&1<<r)),t>>=1,r++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(t){this._updateCheck(e._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(e._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=!1;let t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]))}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;let t=this.blendModesMap[e],r=this.gl;2===t.length?r.blendFunc(t[0],t[1]):r.blendFuncSeparate(t[0],t[1],t[2],t[3]),6===t.length?(this._blendEq=!0,r.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,t){let r=this.checks.indexOf(e);t&&-1===r?this.checks.push(e):t||-1===r||this.checks.splice(r,1)}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};eu.extension={type:[_.Ag.WebGLSystem],name:"state"};"use strict";class eh{constructor(e){this.target=v.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=w.UNSIGNED_BYTE,this.internalFormat=P.RGBA,this.format=P.RGBA,this.samplerType=0}}"use strict";"use strict";let ec={id:"buffer",upload(e,t,r){t.width===e.width||t.height===e.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.width,e.height,t.format,t.type,e.resource):r.texImage2D(t.target,0,t.internalFormat,e.width,e.height,0,t.format,t.type,e.resource),t.width=e.width,t.height=e.height}},ed={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0}
20,eE={id:"compressed",upload(e,t,r){r.pixelStorei(r.UNPACK_ALIGNMENT,4);let s=e.pixelWidth,i=e.pixelHeight,n=!!ed[e.format];for(let a=0;a<e.resource.length;a++){let o=e.resource[a];n?r.compressedTexImage2D(r.TEXTURE_2D,a,t.internalFormat,s,i,0,o):r.texImage2D(r.TEXTURE_2D,a,t.internalFormat,s,i,0,t.format,t.type,o),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},eg={id:"image",upload(e,t,r,s){let i=t.width,n=t.height,a=e.pixelWidth,o=e.pixelHeight,_=e.resourceWidth,l=e.resourceHeight;_<a||l<o?((i!==a||n!==o)&&r.texImage2D(t.target,0,t.internalFormat,a,o,0,t.format,t.type,null),2===s?r.texSubImage2D(r.TEXTURE_2D,0,0,0,_,l,t.format,t.type,e.resource):r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.format,t.type,e.resource)):i===a&&n===o?r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.format,t.type,e.resource):2===s?r.texImage2D(t.target,0,t.internalFormat,a,o,0,t.format,t.type,e.resource):r.texImage2D(t.target,0,t.internalFormat,t.format,t.type,e.resource),t.width=a,t.height=o}},ef={id:"video",upload(e,t,r,s){e.isValid?eg.upload(e,t,r,s):r.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null)}},em={linear:9729,nearest:9728},eR={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},eT={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},eb={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function ex(e,t,r,s,i,n,a,o){if(!o||"repeat"!==e.addressModeU||"repeat"!==e.addressModeV||"repeat"!==e.addressModeW){let r=eT[a?"clamp-to-edge":e.addressModeU],s=eT[a?"clamp-to-edge":e.addressModeV],o=eT[a?"clamp-to-edge":e.addressModeW];t[i](n,t.TEXTURE_WRAP_S,r),t[i](n,t.TEXTURE_WRAP_T,s),t.TEXTURE_WRAP_R&&t[i](n,t.TEXTURE_WRAP_R,o)}if(o&&"linear"===e.magFilter||t[i](n,t.TEXTURE_MAG_FILTER,em[e.magFilter]),r){if(!o||"linear"!==e.mipmapFilter){let r=eR[e.minFilter][e.mipmapFilter];t[i](n,t.TEXTURE_MIN_FILTER,r)}}else t[i](n,t.TEXTURE_MIN_FILTER,em[e.minFilter]);if(s&&e.maxAnisotropy>1){let r=Math.min(e.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](n,s.TEXTURE_MAX_ANISOTROPY_EXT,r)}e.compare&&t[i](n,t.TEXTURE_COMPARE_FUNC,eb[e.compare])}"use strict";"use strict";class eS{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:eg,buffer:ec,video:ef,compressed:eE},this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers")}contextChange(e){if(this._gl=e,!this._mapFormatToInternalFormat){var t;let r,s;this._mapFormatToInternalFormat=(t=this._renderer.context.extensions,r={},s=e.RGBA,e instanceof M.e.get().getWebGLRenderingContext()?t.srgb&&(r={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":e.SRGB8_ALPHA8,"bgra8unorm-srgb":e.SRGB8_ALPHA8},s=e.RGBA8),{r8unorm:e.R8,r8snorm:e.R8_SNORM,r8uint:e.R8UI,r8sint:e.R8I,r16uint:e.R16UI,r16sint:e.R16I,r16float:e.R16F,rg8unorm:e.RG8,rg8snorm:e.RG8_SNORM,rg8uint:e.RG8UI,rg8sint:e.RG8I,r32uint:e.R32UI,r32sint:e.R32I,r32float:e.R32F,rg16uint:e.RG16UI,rg16sint:e.RG16I,rg16float:e.RG16F,rgba8unorm:e.RGBA,...r,rgba8snorm:e.RGBA8_SNORM,rgba8uint:e.RGBA8UI,rgba8sint:e.RGBA8I,bgra8unorm:s,rgb9e5ufloat:e.RGB9_E5,rgb10a2unorm:e.RGB10_A2,rg11b10ufloat:e.R11F_G11F_B10F,rg32uint:e.RG32UI,rg32sint:e.RG32I,rg32float:e.RG32F,rgba16uint:e.RGBA16UI,rgba16sint:e.RGBA16I,rgba16float:e.RGBA16F,rgba32uint:e.RGBA32UI,rgba32sint:e.RGBA32I,rgba32float:e.RGBA32F,stencil8:e.STENCIL_INDEX8,depth16unorm:e.DEPTH_COMPONENT16,depth24plus:e.DEPTH_COMPONENT24,"depth24plus-stencil8":e.DEPTH24_STENCIL8,depth32float:e.DEPTH_COMPONENT32F,"depth32float-stencil8":e.DEPTH32F_STENCIL8,...t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}
20,...t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}),this._mapFormatToType={r8unorm:e.UNSIGNED_BYTE,r8snorm:e.BYTE,r8uint:e.UNSIGNED_BYTE,r8sint:e.BYTE,r16uint:e.UNSIGNED_SHORT,r16sint:e.SHORT,r16float:e.HALF_FLOAT,rg8unorm:e.UNSIGNED_BYTE,rg8snorm:e.BYTE,rg8uint:e.UNSIGNED_BYTE,rg8sint:e.BYTE,r32uint:e.UNSIGNED_INT,r32sint:e.INT,r32float:e.FLOAT,rg16uint:e.UNSIGNED_SHORT,rg16sint:e.SHORT,rg16float:e.HALF_FLOAT,rgba8unorm:e.UNSIGNED_BYTE,"rgba8unorm-srgb":e.UNSIGNED_BYTE,rgba8snorm:e.BYTE,rgba8uint:e.UNSIGNED_BYTE,rgba8sint:e.BYTE,bgra8unorm:e.UNSIGNED_BYTE,"bgra8unorm-srgb":e.UNSIGNED_BYTE,rgb9e5ufloat:e.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:e.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:e.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:e.UNSIGNED_INT,rg32sint:e.INT,rg32float:e.FLOAT,rgba16uint:e.UNSIGNED_SHORT,rgba16sint:e.SHORT,rgba16float:e.HALF_FLOAT,rgba32uint:e.UNSIGNED_INT,rgba32sint:e.INT,rgba32float:e.FLOAT,stencil8:e.UNSIGNED_BYTE,depth16unorm:e.UNSIGNED_SHORT,depth24plus:e.UNSIGNED_INT,"depth24plus-stencil8":e.UNSIGNED_INT_24_8,depth32float:e.FLOAT,"depth32float-stencil8":e.FLOAT_32_UNSIGNED_INT_24_8_REV},this._mapFormatToFormat={r8unorm:e.RED,r8snorm:e.RED,r8uint:e.RED,r8sint:e.RED,r16uint:e.RED,r16sint:e.RED,r16float:e.RED,rg8unorm:e.RG,rg8snorm:e.RG,rg8uint:e.RG,rg8sint:e.RG,r32uint:e.RED,r32sint:e.RED,r32float:e.RED,rg16uint:e.RG,rg16sint:e.RG,rg16float:e.RG,rgba8unorm:e.RGBA,"rgba8unorm-srgb":e.RGBA,rgba8snorm:e.RGBA,rgba8uint:e.RGBA,rgba8sint:e.RGBA,bgra8unorm:e.RGBA,"bgra8unorm-srgb":e.RGBA,rgb9e5ufloat:e.RGB,rgb10a2unorm:e.RGBA,rg11b10ufloat:e.RGB,rg32uint:e.RG,rg32sint:e.RG,rg32float:e.RG,rgba16uint:e.RGBA,rgba16sint:e.RGBA,rgba16float:e.RGBA,rgba32uint:e.RGBA,rgba32sint:e.RGBA,rgba32float:e.RGBA,stencil8:e.STENCIL_INDEX8,depth16unorm:e.DEPTH_COMPONENT,depth24plus:e.DEPTH_COMPONENT,"depth24plus-stencil8":e.DEPTH_STENCIL,depth32float:e.DEPTH_COMPONENT,"depth32float-stencil8":e.DEPTH_STENCIL}}this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let e=0;e<16;e++)this.bind(x.g.EMPTY,e)}initSource(e){this.bind(e)}bind(e,t=0){let r=e.source;e?(this.bindSource(r,t),this._useSeparateSamplers&&this._bindSampler(r.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t))}bindSource(e,t=0){let r=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=x.g.EMPTY.source);let s=this.getGlSource(e);r.bindTexture(s.target,s.texture)}}_bindSampler(e,t=0){let r=this._gl;if(!e){this._boundSamplers[t]=null,r.bindSampler(t,null);return}let s=this._getGlSampler(e);this._boundSamplers[t]!==s&&(this._boundSamplers[t]=s,r.bindSampler(t,s))}unbind(e){let t=e.source,r=this._boundTextures,s=this._gl;for(let e=0;e<r.length;e++)if(r[e]===t){this._activateLocation(e);let i=this.getGlSource(t);s.bindTexture(i.target,null),r[e]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){let t=new eh(this._gl.createTexture());if(t.type=this._mapFormatToType[e.format],t.internalFormat=this._mapFormatToInternalFormat[e.format],t.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){let t=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(t))+1}return this._glTextures[e.uid]=t,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),t}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,t){let r=this._gl,s=this.getGlSource(e);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,ex(e.style,r,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",r.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t)}onSourceUnload(e){let t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture))}onSourceUpdate(e){let t=this._gl,r=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,r.texture),this._boundTextures[this._activeTextureLocation]=e;let s="premultiply-alpha-on-upload"===e.alphaMode;this._premultiplyAlpha!==s&&(this._premultiplyAlpha=s,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,r,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,t=!0){t&&this.bindSource(e,0);let r=this.getGlSource(e);this._gl.generateMipmap(r.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){let t=this._gl,r=this._gl.createSampler();return this._glSamplers[e._resourceId]=r,ex(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>
201,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",r,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:r,height:s}=this.getPixels(e),i=M.e.get().createCanvas();i.width=r,i.height=s;let n=i.getContext("2d");if(n){let e=n.createImageData(r,s);e.data.set(t),n.putImageData(e,0,0)}return i}getPixels(e){let t=e.source.resolution,r=e.frame,s=Math.max(Math.round(r.width*t),1),i=Math.max(Math.round(r.height*t),1),n=new Uint8Array(4*s*i),a=this._renderer,o=a.renderTarget.getRenderTarget(e),_=a.renderTarget.getGpuRenderTarget(o),l=a.gl;return l.bindFramebuffer(l.FRAMEBUFFER,_.resolveTargetFramebuffer),l.readPixels(Math.round(r.x*t),Math.round(r.y*t),s,i,l.RGBA,l.UNSIGNED_BYTE,n),{pixels:new Uint8ClampedArray(n.buffer),width:s,height:i}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(x.g.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=!1,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}}"use strict";eS.extension={type:[_.Ag.WebGLSystem],name:"texture"};let ep=[...G.i,ee.z,z,U,F,eS,eo,k,el.e,e_.S,Z,eu,$,q],eA=[...G.f],eB=[B,p,T],eN=[],eG=[],eC=[];_.XO.handleByNamedList(_.Ag.WebGLSystem,eN),_.XO.handleByNamedList(_.Ag.WebGLPipes,eG),_.XO.handleByNamedList(_.Ag.WebGLPipesAdaptor,eC),_.XO.add(...ep,...eA,...eB);class eI extends N.k{constructor(){super({name:"webgl",type:C.W.WEBGL,systems:eN,renderPipes:eG,renderPipeAdaptors:eC})}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.