@forgeax/view 0.3.10 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-revision.json +1 -1
- package/dist/modules/chunks/App-CJACYWMZ.mjs +12 -12
- package/dist/modules/chunks/chunk-6KM24NH6.mjs +2 -2
- package/dist/modules/chunks/chunk-7WM3K454.mjs +1 -1
- package/dist/modules/chunks/chunk-B2C6UK5X.mjs +2 -2
- package/dist/modules/chunks/chunk-HUC3Z3ND.mjs +1 -1
- package/dist/modules/chunks/chunk-IJHKMD45.mjs +3 -3
- package/dist/modules/chunks/chunk-KY6QRQPJ.mjs +3 -3
- package/dist/modules/chunks/chunk-L7NLUVMI.mjs +3 -3
- package/dist/modules/chunks/chunk-TLZXTCET.mjs +2 -2
- package/dist/modules/chunks/chunk-XTCLBIHA.mjs +1 -1
- package/dist/modules/chunks/chunk-YZESHYM6.mjs +1 -1
- package/dist/modules/chunks/chunk-ZG2PD4QX.mjs +2 -2
- package/dist/modules/index.mjs +1 -1
- package/dist/viewer/assets/panels-lazy-BLB8MZ--.js +1 -1
- package/dist/viewer/assets/panels-lazy-BLB8MZ--.js.map +1 -1
- package/package.json +2 -10
|
@@ -800,7 +800,7 @@ fn fs_transport(input: CloudViewOut) -> CloudTransportOutput {
|
|
|
800
800
|
output.depth = vec4<f32>(select(vec3<f32>(0.0), (view.cameraPos + ray * representativeDistance) * 0.001, hasCloud), select(0.0, 1.0, hasCloud));
|
|
801
801
|
return output;
|
|
802
802
|
}
|
|
803
|
-
`.replace(`cloud_solar_cached_transmittance(samplePosition)`,`cloud_solar_transmittance(samplePosition)`);var lC={standard:`forgeax_material::standard`,unlit:`forgeax_material::unlit`,sprite:`forgeax_material::sprite`};lC.standard,lC.unlit,lC.sprite,Object.freeze([`box_project`,`sampleReflectionProbeSpecular`]);var uC=e({ParsedModule:()=>dC,RhiWgpuAdapter:()=>fC,RhiWgpuBindGroup:()=>pC,RhiWgpuBindGroupLayout:()=>mC,RhiWgpuBuffer:()=>hC,RhiWgpuCommandBuffer:()=>gC,RhiWgpuCommandEncoder:()=>_C,RhiWgpuComputePass:()=>vC,RhiWgpuComputePipeline:()=>yC,RhiWgpuDevice:()=>bC,RhiWgpuInstance:()=>xC,RhiWgpuPipelineLayout:()=>SC,RhiWgpuQuerySet:()=>CC,RhiWgpuQueue:()=>wC,RhiWgpuRenderBundle:()=>TC,RhiWgpuRenderBundleEncoder:()=>EC,RhiWgpuRenderPass:()=>DC,RhiWgpuRenderPipeline:()=>OC,RhiWgpuSampler:()=>kC,RhiWgpuShaderModule:()=>AC,RhiWgpuSurface:()=>jC,RhiWgpuSurfaceTexture:()=>MC,RhiWgpuTexture:()=>NC,RhiWgpuTextureView:()=>PC,ValidatedModule:()=>FC,compose_shader:()=>IC,default:()=>iT,emit_reflection:()=>LC,initSync:()=>rT,parse:()=>RC,start:()=>zC,validate:()=>BC,validate_render_entries:()=>VC}),dC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,KC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,KC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_parsedmodule_free(e,0)}};Symbol.dispose&&(dC.prototype[Symbol.dispose]=dC.prototype.free);var fC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,qC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,qC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuadapter_free(e,0)}get features(){return J.rhiwgpuadapter_features(this.__wbg_ptr)}requestDevice(e){return J.rhiwgpuadapter_requestDevice(this.__wbg_ptr,e)}};Symbol.dispose&&(fC.prototype[Symbol.dispose]=fC.prototype.free);var pC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,JC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,JC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpubindgroup_free(e,0)}};Symbol.dispose&&(pC.prototype[Symbol.dispose]=pC.prototype.free);var mC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,YC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,YC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpubindgrouplayout_free(e,0)}get forgeaxToken(){return J.rhiwgpubindgrouplayout_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(mC.prototype[Symbol.dispose]=mC.prototype.free);var hC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,XC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,XC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpubuffer_free(e,0)}destroy(){J.rhiwgpubuffer_destroy(this.__wbg_ptr)}get forgeaxToken(){return J.rhiwgpubuffer_forgeaxToken(this.__wbg_ptr)>>>0}getMappedRange(e,t){let n=J.rhiwgpubuffer_getMappedRange(this.__wbg_ptr,!K(e),K(e)?BigInt(0):e,!K(t),K(t)?BigInt(0):t);if(n[2])throw q(n[1]);return q(n[0])}mapAsync(e,t,n){return J.rhiwgpubuffer_mapAsync(this.__wbg_ptr,e,!K(t),K(t)?BigInt(0):t,!K(n),K(n)?BigInt(0):n)}unmap(){J.rhiwgpubuffer_unmap(this.__wbg_ptr)}};Symbol.dispose&&(hC.prototype[Symbol.dispose]=hC.prototype.free);var gC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,ZC.register(n,n.__wbg_ptr,n),n}static __unwrap(t){return t instanceof e?t.__destroy_into_raw():0}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ZC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucommandbuffer_free(e,0)}};Symbol.dispose&&(gC.prototype[Symbol.dispose]=gC.prototype.free);var _C=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,QC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,QC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucommandencoder_free(e,0)}beginComputePass(e){let t=J.rhiwgpucommandencoder_beginComputePass(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return vC.__wrap(t[0])}beginRenderPass(e){let t=J.rhiwgpucommandencoder_beginRenderPass(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return DC.__wrap(t[0])}clearBuffer(e,t,n){vw(e,hC),J.rhiwgpucommandencoder_clearBuffer(this.__wbg_ptr,e.__wbg_ptr,!K(t),K(t)?BigInt(0):t,!K(n),K(n)?BigInt(0):n)}copyBufferToBuffer(e,t,n,r,i){vw(e,hC),vw(n,hC),J.rhiwgpucommandencoder_copyBufferToBuffer(this.__wbg_ptr,e.__wbg_ptr,t,n.__wbg_ptr,r,i)}copyBufferToTexture(e,t,n,r,i,a,o,s,c,l,u,d,f){vw(e,hC),vw(i,NC),J.rhiwgpucommandencoder_copyBufferToTexture(this.__wbg_ptr,e.__wbg_ptr,t,K(n)?2**53-1:n>>>0,K(r)?2**53-1:r>>>0,i.__wbg_ptr,a,o,s,c,l,u,d,f)}copyTextureToBuffer(e,t,n,r,i,a,o,s,c,l,u,d,f){vw(e,NC),vw(o,hC),J.rhiwgpucommandencoder_copyTextureToBuffer(this.__wbg_ptr,e.__wbg_ptr,t,n,r,i,a,o.__wbg_ptr,s,K(c)?2**53-1:c>>>0,K(l)?2**53-1:l>>>0,u,d,f)}copyTextureToTexture(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){vw(e,NC),vw(o,NC),J.rhiwgpucommandencoder_copyTextureToTexture(this.__wbg_ptr,e.__wbg_ptr,t,n,r,i,a,o.__wbg_ptr,s,c,l,u,d,f,p,m)}finish(){let e=J.rhiwgpucommandencoder_finish(this.__wbg_ptr);return gC.__wrap(e)}insertDebugMarker(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpucommandencoder_insertDebugMarker(this.__wbg_ptr,t,n)}popDebugGroup(){J.rhiwgpucommandencoder_popDebugGroup(this.__wbg_ptr)}pushDebugGroup(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpucommandencoder_pushDebugGroup(this.__wbg_ptr,t,n)}resolveQuerySet(e,t,n,r,i){vw(e,CC),vw(r,hC),J.rhiwgpucommandencoder_resolveQuerySet(this.__wbg_ptr,e.__wbg_ptr,t,n,r.__wbg_ptr,i)}};Symbol.dispose&&(_C.prototype[Symbol.dispose]=_C.prototype.free);var vC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,$C.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,$C.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucomputepass_free(e,0)}dispatchWorkgroups(e,t,n){J.rhiwgpucomputepass_dispatchWorkgroups(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,K(n)?2**53-1:n>>>0)}dispatchWorkgroupsIndirect(e,t){vw(e,hC),J.rhiwgpucomputepass_dispatchWorkgroupsIndirect(this.__wbg_ptr,e.__wbg_ptr,t)}end(){J.rhiwgpucomputepass_end(this.__wbg_ptr)}setBindGroup(e,t,n){vw(t,pC),J.rhiwgpucomputepass_setBindGroup(this.__wbg_ptr,e,t.__wbg_ptr,n)}setPipeline(e){vw(e,yC),J.rhiwgpucomputepass_setPipeline(this.__wbg_ptr,e.__wbg_ptr)}};Symbol.dispose&&(vC.prototype[Symbol.dispose]=vC.prototype.free);var yC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,ew.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ew.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucomputepipeline_free(e,0)}};Symbol.dispose&&(yC.prototype[Symbol.dispose]=yC.prototype.free);var bC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,tw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,tw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpudevice_free(e,0)}createBindGroup(e){let t=J.rhiwgpudevice_createBindGroup(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return pC.__wrap(t[0])}createBindGroupLayout(e){let t=J.rhiwgpudevice_createBindGroupLayout(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return mC.__wrap(t[0])}createBuffer(e){let t=J.rhiwgpudevice_createBuffer(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return hC.__wrap(t[0])}createCommandEncoder(e){let t=J.rhiwgpudevice_createCommandEncoder(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return _C.__wrap(t[0])}createComputePipeline(e,t,n){vw(t,AC);let r=0;K(n)||(vw(n,SC),r=n.__destroy_into_raw());let i=J.rhiwgpudevice_createComputePipeline(this.__wbg_ptr,e,t.__wbg_ptr,r);if(i[2])throw q(i[1]);return yC.__wrap(i[0])}createPipelineLayout(e){let t=J.rhiwgpudevice_createPipelineLayout(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return SC.__wrap(t[0])}createQuerySet(e){let t=J.rhiwgpudevice_createQuerySet(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return CC.__wrap(t[0])}createRenderBundleEncoder(e){let t=J.rhiwgpudevice_createRenderBundleEncoder(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return EC.__wrap(t[0])}createRenderPipeline(e){let t=J.rhiwgpudevice_createRenderPipeline(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return OC.__wrap(t[0])}createSampler(e){let t=J.rhiwgpudevice_createSampler(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return kC.__wrap(t[0])}createShaderModule(e){let t=J.rhiwgpudevice_createShaderModule(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return AC.__wrap(t[0])}createTexture(e){let t=J.rhiwgpudevice_createTexture(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return NC.__wrap(t[0])}createTextureView(e,t){vw(e,NC);let n=J.rhiwgpudevice_createTextureView(this.__wbg_ptr,e.__wbg_ptr,t);if(n[2])throw q(n[1]);return PC.__wrap(n[0])}get forgeaxToken(){return J.rhiwgpudevice_forgeaxToken(this.__wbg_ptr)>>>0}get limits(){return J.rhiwgpudevice_limits(this.__wbg_ptr)}get queue(){let e=J.rhiwgpudevice_queue(this.__wbg_ptr);return wC.__wrap(e)}registerLostCallback(e){J.rhiwgpudevice_registerLostCallback(this.__wbg_ptr,e)}get surfaceViewFormats(){return J.rhiwgpudevice_surfaceViewFormats(this.__wbg_ptr)!==0}};Symbol.dispose&&(bC.prototype[Symbol.dispose]=bC.prototype.free);var xC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,nw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,nw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuinstance_free(e,0)}static create(){return J.rhiwgpuinstance_create()}createSurface(e){let t=J.rhiwgpuinstance_createSurface(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return jC.__wrap(t[0])}requestAdapter(){return J.rhiwgpuinstance_requestAdapter(this.__wbg_ptr)}requestAdapterWithCanvas(e){return J.rhiwgpuinstance_requestAdapterWithCanvas(this.__wbg_ptr,e)}};Symbol.dispose&&(xC.prototype[Symbol.dispose]=xC.prototype.free);var SC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,rw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,rw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpupipelinelayout_free(e,0)}get forgeaxToken(){return J.rhiwgpupipelinelayout_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(SC.prototype[Symbol.dispose]=SC.prototype.free);var CC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,iw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,iw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuqueryset_free(e,0)}};Symbol.dispose&&(CC.prototype[Symbol.dispose]=CC.prototype.free);var wC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,aw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,aw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuqueue_free(e,0)}submit(e){let t=J.rhiwgpuqueue_submit(this.__wbg_ptr,e);if(t[1])throw q(t[0])}writeBuffer(e,t,n,r,i){vw(e,hC);let a=qw(n,J.__wbindgen_malloc),o=eT;J.rhiwgpuqueue_writeBuffer(this.__wbg_ptr,e.__wbg_ptr,t,a,o,!K(r),K(r)?BigInt(0):r,!K(i),K(i)?BigInt(0):i)}writeTexture(e,t,n,r,i,a,o,s,c,l,u,d,f){vw(e,NC);let p=qw(o,J.__wbindgen_malloc),m=eT;J.rhiwgpuqueue_writeTexture(this.__wbg_ptr,e.__wbg_ptr,t,n,r,i,a,p,m,s,K(c)?2**53-1:c>>>0,K(l)?2**53-1:l>>>0,u,d,f)}};Symbol.dispose&&(wC.prototype[Symbol.dispose]=wC.prototype.free);var TC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,ow.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ow.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderbundle_free(e,0)}get forgeaxToken(){return J.rhiwgpurenderbundle_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(TC.prototype[Symbol.dispose]=TC.prototype.free);var EC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,sw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,sw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderbundleencoder_free(e,0)}draw(e,t,n,r){let i=J.rhiwgpurenderbundleencoder_draw(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,K(n)?2**53-1:n>>>0,K(r)?2**53-1:r>>>0);if(i[1])throw q(i[0])}drawIndexed(e,t,n,r,i){let a=J.rhiwgpurenderbundleencoder_drawIndexed(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,K(n)?2**53-1:n>>>0,K(r)?2**53-1:r>>0,K(i)?2**53-1:i>>>0);if(a[1])throw q(a[0])}drawIndexedIndirect(e,t){vw(e,hC);let n=J.rhiwgpurenderbundleencoder_drawIndexedIndirect(this.__wbg_ptr,e.__wbg_ptr,t);if(n[1])throw q(n[0])}drawIndirect(e,t){vw(e,hC);let n=J.rhiwgpurenderbundleencoder_drawIndirect(this.__wbg_ptr,e.__wbg_ptr,t);if(n[1])throw q(n[0])}finish(e){let t=J.rhiwgpurenderbundleencoder_finish(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return TC.__wrap(t[0])}insertDebugMarker(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT,r=J.rhiwgpurenderbundleencoder_insertDebugMarker(this.__wbg_ptr,t,n);if(r[1])throw q(r[0])}popDebugGroup(){let e=J.rhiwgpurenderbundleencoder_popDebugGroup(this.__wbg_ptr);if(e[1])throw q(e[0])}pushDebugGroup(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT,r=J.rhiwgpurenderbundleencoder_pushDebugGroup(this.__wbg_ptr,t,n);if(r[1])throw q(r[0])}setBindGroup(e,t,n,r,i){vw(t,pC);let a=J.rhiwgpurenderbundleencoder_setBindGroup(this.__wbg_ptr,e,t.__wbg_ptr,n,K(r)?2**53-1:r>>>0,K(i)?2**53-1:i>>>0);if(a[1])throw q(a[0])}setIndexBuffer(e,t,n,r){vw(e,hC);let i=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT,o=J.rhiwgpurenderbundleencoder_setIndexBuffer(this.__wbg_ptr,e.__wbg_ptr,i,a,!K(n),K(n)?BigInt(0):n,!K(r),K(r)?BigInt(0):r);if(o[1])throw q(o[0])}setPipeline(e){vw(e,OC);let t=J.rhiwgpurenderbundleencoder_setPipeline(this.__wbg_ptr,e.__wbg_ptr);if(t[1])throw q(t[0])}setVertexBuffer(e,t,n,r){vw(t,hC);let i=J.rhiwgpurenderbundleencoder_setVertexBuffer(this.__wbg_ptr,e,t.__wbg_ptr,!K(n),K(n)?BigInt(0):n,!K(r),K(r)?BigInt(0):r);if(i[1])throw q(i[0])}};Symbol.dispose&&(EC.prototype[Symbol.dispose]=EC.prototype.free);var DC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,cw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,cw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderpass_free(e,0)}beginOcclusionQuery(e){J.rhiwgpurenderpass_beginOcclusionQuery(this.__wbg_ptr,e)}draw(e,t,n,r){J.rhiwgpurenderpass_draw(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,n,r)}drawIndexed(e,t,n,r,i){J.rhiwgpurenderpass_drawIndexed(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,n,r,i)}drawIndexedIndirect(e,t){vw(e,hC),J.rhiwgpurenderpass_drawIndexedIndirect(this.__wbg_ptr,e.__wbg_ptr,t)}drawIndirect(e,t){vw(e,hC),J.rhiwgpurenderpass_drawIndirect(this.__wbg_ptr,e.__wbg_ptr,t)}end(){J.rhiwgpurenderpass_end(this.__wbg_ptr)}endOcclusionQuery(){J.rhiwgpurenderpass_endOcclusionQuery(this.__wbg_ptr)}executeBundles(e){let t=J.rhiwgpurenderpass_executeBundles(this.__wbg_ptr,e);if(t[1])throw q(t[0])}insertDebugMarker(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpurenderpass_insertDebugMarker(this.__wbg_ptr,t,n)}popDebugGroup(){J.rhiwgpurenderpass_popDebugGroup(this.__wbg_ptr)}pushDebugGroup(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpurenderpass_pushDebugGroup(this.__wbg_ptr,t,n)}setBindGroup(e,t,n,r,i){vw(t,pC),J.rhiwgpurenderpass_setBindGroup(this.__wbg_ptr,e,t.__wbg_ptr,n,K(r)?2**53-1:r>>>0,K(i)?2**53-1:i>>>0)}setBlendConstant(e){J.rhiwgpurenderpass_setBlendConstant(this.__wbg_ptr,e)}setIndexBuffer(e,t,n,r){vw(e,hC);let i=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;J.rhiwgpurenderpass_setIndexBuffer(this.__wbg_ptr,e.__wbg_ptr,i,a,!K(n),K(n)?BigInt(0):n,!K(r),K(r)?BigInt(0):r)}setPipeline(e){vw(e,OC),J.rhiwgpurenderpass_setPipeline(this.__wbg_ptr,e.__wbg_ptr)}setScissorRect(e,t,n,r){J.rhiwgpurenderpass_setScissorRect(this.__wbg_ptr,e,t,n,r)}setStencilReference(e){J.rhiwgpurenderpass_setStencilReference(this.__wbg_ptr,e)}setVertexBuffer(e,t,n,r){vw(t,hC),J.rhiwgpurenderpass_setVertexBuffer(this.__wbg_ptr,e,t.__wbg_ptr,n,!K(r),K(r)?BigInt(0):r)}setViewport(e,t,n,r,i,a){J.rhiwgpurenderpass_setViewport(this.__wbg_ptr,e,t,n,r,i,a)}};Symbol.dispose&&(DC.prototype[Symbol.dispose]=DC.prototype.free);var OC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,lw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,lw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderpipeline_free(e,0)}};Symbol.dispose&&(OC.prototype[Symbol.dispose]=OC.prototype.free);var kC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,uw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,uw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpusampler_free(e,0)}get forgeaxResourceKind(){let e,t;try{let n=J.rhiwgpusampler_forgeaxResourceKind(this.__wbg_ptr);return e=n[0],t=n[1],Rw(n[0],n[1])}finally{J.__wbindgen_free(e,t,1)}}get forgeaxToken(){return J.rhiwgpusampler_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(kC.prototype[Symbol.dispose]=kC.prototype.free);var AC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,dw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,dw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpushadermodule_free(e,0)}get forgeaxToken(){return J.rhiwgpushadermodule_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(AC.prototype[Symbol.dispose]=AC.prototype.free);var jC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,fw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,fw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpusurface_free(e,0)}configure(e){let t=J.rhiwgpusurface_configure(this.__wbg_ptr,e);if(t[1])throw q(t[0])}getCurrentTexture(){let e=J.rhiwgpusurface_getCurrentTexture(this.__wbg_ptr);if(e[2])throw q(e[1]);return MC.__wrap(e[0])}probeSurfacePresentation(){let e=J.rhiwgpusurface_probeSurfacePresentation(this.__wbg_ptr);if(e[2])throw q(e[1]);return q(e[0])}};Symbol.dispose&&(jC.prototype[Symbol.dispose]=jC.prototype.free);var MC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,pw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,pw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpusurfacetexture_free(e,0)}getTexture(){let e=J.rhiwgpusurfacetexture_getTexture(this.__wbg_ptr);return NC.__wrap(e)}present(){let e=J.rhiwgpusurfacetexture_present(this.__wbg_ptr);if(e[1])throw q(e[0])}};Symbol.dispose&&(MC.prototype[Symbol.dispose]=MC.prototype.free);var NC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,mw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,mw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgputexture_free(e,0)}createView(e){let t=J.rhiwgputexture_createView(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return PC.__wrap(t[0])}get depthOrArrayLayers(){return J.rhiwgputexture_depthOrArrayLayers(this.__wbg_ptr)>>>0}destroy(){J.rhiwgputexture_destroy(this.__wbg_ptr)}get height(){return J.rhiwgputexture_height(this.__wbg_ptr)>>>0}get width(){return J.rhiwgputexture_width(this.__wbg_ptr)>>>0}};Symbol.dispose&&(NC.prototype[Symbol.dispose]=NC.prototype.free);var PC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,hw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,hw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgputextureview_free(e,0)}get forgeaxResourceKind(){let e,t;try{let n=J.rhiwgputextureview_forgeaxResourceKind(this.__wbg_ptr);return e=n[0],t=n[1],Rw(n[0],n[1])}finally{J.__wbindgen_free(e,t,1)}}get forgeaxToken(){return J.rhiwgputextureview_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(PC.prototype[Symbol.dispose]=PC.prototype.free);var FC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,gw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,gw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_validatedmodule_free(e,0)}};Symbol.dispose&&(FC.prototype[Symbol.dispose]=FC.prototype.free);function IC(e,t,n){let r,i;try{let s=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),c=eT,l=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),u=eT,d=Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),f=eT,p=J.compose_shader(s,c,l,u,d,f);var a=p[0],o=p[1];if(p[3])throw a=0,o=0,q(p[2]);return r=a,i=o,Rw(a,o)}finally{J.__wbindgen_free(r,i,1)}}function LC(e,t){let n,r;try{vw(e,FC);let o=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),s=eT,c=J.emit_reflection(e.__wbg_ptr,o,s);var i=c[0],a=c[1];if(c[3])throw i=0,a=0,q(c[2]);return n=i,r=a,Rw(i,a)}finally{J.__wbindgen_free(n,r,1)}}function RC(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT,r=J.parse(t,n);if(r[2])throw q(r[1]);return dC.__wrap(r[0])}function zC(){J.start()}function BC(e){vw(e,dC);var t=e.__destroy_into_raw();let n=J.validate(t);if(n[2])throw q(n[1]);return FC.__wrap(n[0])}function VC(e,t,n,r){vw(e,FC);let i=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;var o=K(n)?0:Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),s=eT,c=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),l=eT;let u=J.validate_render_entries(e.__wbg_ptr,i,a,o,s,c,l);if(u[1])throw q(u[0])}function HC(){return{__proto__:null,"./wgpu_wasm_bg.js":{__proto__:null,__wbg_Error_bce6d499ff0a4aff:function(e,t){return Error(Rw(e,t))},__wbg_Number_b7972a139bfbfdf0:function(e){return Number(e)},__wbg_String_8564e559799eccda:function(e,t){let n=Jw(String(t),J.__wbindgen_malloc,J.__wbindgen_realloc),r=eT;kw().setInt32(e+4,r,!0),kw().setInt32(e+0,n,!0)},__wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83:function(e,t){let n=t,r=typeof n==`bigint`?n:void 0;kw().setBigInt64(e+8,K(r)?BigInt(0):r,!0),kw().setInt32(e+0,!K(r),!0)},__wbg___wbindgen_boolean_get_2304fb8c853028c8:function(e){let t=e,n=typeof t==`boolean`?t:void 0;return K(n)?16777215:+!!n},__wbg___wbindgen_debug_string_edece8177ad01481:function(e,t){let n=Jw(bw(t),J.__wbindgen_malloc,J.__wbindgen_realloc),r=eT;kw().setInt32(e+4,r,!0),kw().setInt32(e+0,n,!0)},__wbg___wbindgen_in_07056af4f902c445:function(e,t){return e in t},__wbg___wbindgen_is_bigint_aeae3893f30ed54e:function(e){return typeof e==`bigint`},__wbg___wbindgen_is_function_5cd60d5cf78b4eef:function(e){return typeof e==`function`},__wbg___wbindgen_is_null_2042690d351e14f0:function(e){return e===null},__wbg___wbindgen_is_object_b4593df85baada48:function(e){let t=e;return typeof t==`object`&&!!t},__wbg___wbindgen_is_string_dde0fd9020db4434:function(e){return typeof e==`string`},__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c:function(e,t){return e==t},__wbg___wbindgen_number_get_f73a1244370fcc2c:function(e,t){let n=t,r=typeof n==`number`?n:void 0;kw().setFloat64(e+8,K(r)?0:r,!0),kw().setInt32(e+0,!K(r),!0)},__wbg___wbindgen_string_get_d109740c0d18f4d7:function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_9c31b086c2b26051:function(e,t){throw Error(Rw(e,t))},__wbg__wbg_cb_unref_3fa391f3fcdb55f8:function(e){e._wbg_cb_unref()},__wbg_activeTexture_37cff0753870753b:function(e,t){e.activeTexture(t>>>0)},__wbg_activeTexture_4d2afad7cfda1396:function(e,t){e.activeTexture(t>>>0)},__wbg_add_07a7ab95134233b9:function(e,t){return e.add(t)},__wbg_attachShader_0a37c762590e5e1c:function(e,t,n){e.attachShader(t,n)},__wbg_attachShader_515800f4051247dc:function(e,t,n){e.attachShader(t,n)},__wbg_beginQuery_6c6c5b6d0d8a2c72:function(e,t,n){e.beginQuery(t>>>0,n)},__wbg_bindAttribLocation_07b2841d89fca977:function(e,t,n,r,i){e.bindAttribLocation(t,n>>>0,Rw(r,i))},__wbg_bindAttribLocation_1bbbcdee8d08ba2a:function(e,t,n,r,i){e.bindAttribLocation(t,n>>>0,Rw(r,i))},__wbg_bindBufferRange_b3fd6bf5761eb1af:function(e,t,n,r,i,a){e.bindBufferRange(t>>>0,n>>>0,r,i,a)},__wbg_bindBuffer_1a31fd3809dc22c8:function(e,t,n){e.bindBuffer(t>>>0,n)},__wbg_bindBuffer_4bf3ab31e8e200ed:function(e,t,n){e.bindBuffer(t>>>0,n)},__wbg_bindFramebuffer_751e5064f23ee1c4:function(e,t,n){e.bindFramebuffer(t>>>0,n)},__wbg_bindFramebuffer_92449a44405b6557:function(e,t,n){e.bindFramebuffer(t>>>0,n)},__wbg_bindRenderbuffer_1742855b643a7566:function(e,t,n){e.bindRenderbuffer(t>>>0,n)},__wbg_bindRenderbuffer_c46a8b6f3f8ba246:function(e,t,n){e.bindRenderbuffer(t>>>0,n)},__wbg_bindSampler_708d9901a5e548b8:function(e,t,n){e.bindSampler(t>>>0,n)},__wbg_bindTexture_7fd7f85d6f942f6f:function(e,t,n){e.bindTexture(t>>>0,n)},__wbg_bindTexture_85abbde679bce760:function(e,t,n){e.bindTexture(t>>>0,n)},__wbg_bindVertexArrayOES_fb7e8c5e8e106919:function(e,t){e.bindVertexArrayOES(t)},__wbg_bindVertexArray_f8587a616356d307:function(e,t){e.bindVertexArray(t)},__wbg_blendColor_82716e22a8f522ff:function(e,t,n,r,i){e.blendColor(t,n,r,i)},__wbg_blendColor_f877221c780bdbaf:function(e,t,n,r,i){e.blendColor(t,n,r,i)},__wbg_blendEquationSeparate_946c10181ab6c6cf:function(e,t,n){e.blendEquationSeparate(t>>>0,n>>>0)},__wbg_blendEquationSeparate_985f782fb54b29fe:function(e,t,n){e.blendEquationSeparate(t>>>0,n>>>0)},__wbg_blendEquation_519c57992eed79c1:function(e,t){e.blendEquation(t>>>0)},__wbg_blendEquation_f496fde4a67ecc1e:function(e,t){e.blendEquation(t>>>0)},__wbg_blendFuncSeparate_6f525092629a20ae:function(e,t,n,r,i){e.blendFuncSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_blendFuncSeparate_ea29c928bc1c4984:function(e,t,n,r,i){e.blendFuncSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_blendFunc_2e7b7adf253717a0:function(e,t,n){e.blendFunc(t>>>0,n>>>0)},__wbg_blendFunc_d29c837f8be35d6e:function(e,t,n){e.blendFunc(t>>>0,n>>>0)},__wbg_blitFramebuffer_8fd7726fe3c57e1a:function(e,t,n,r,i,a,o,s,c,l,u){e.blitFramebuffer(t,n,r,i,a,o,s,c,l>>>0,u>>>0)},__wbg_bufferData_74a0b79b4c9d8f96:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_886f34df840b0814:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_aebf4ed69e98d559:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_e8afecf0042a3eb9:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferSubData_0e5936ef36f518d2:function(e,t,n,r){e.bufferSubData(t>>>0,n,r)},__wbg_bufferSubData_ca02a13879fa62e8:function(e,t,n,r){e.bufferSubData(t>>>0,n,r)},__wbg_buffer_8d6798e32d1afd34:function(e){return e.buffer},__wbg_call_13665d9f14390edc:function(){return Gw(function(e,t){return e.call(t)},arguments)},__wbg_call_dfde26266607c996:function(){return Gw(function(e,t,n){return e.call(t,n)},arguments)},__wbg_call_faa0a261f288f846:function(){return Gw(function(e,t,n,r){return e.call(t,n,r)},arguments)},__wbg_clearBufferfv_a0bddf84cc04ef84:function(e,t,n,r,i){e.clearBufferfv(t>>>0,n,xw(r,i))},__wbg_clearBufferiv_9a3f2d1ec3f2296f:function(e,t,n,r,i){e.clearBufferiv(t>>>0,n,Cw(r,i))},__wbg_clearBufferuiv_d52433002e7330f8:function(e,t,n,r,i){e.clearBufferuiv(t>>>0,n,Ew(r,i))},__wbg_clearDepth_1eae37358a24b9db:function(e,t){e.clearDepth(t)},__wbg_clearDepth_f42ada4795e5a943:function(e,t){e.clearDepth(t)},__wbg_clearStencil_999f2e1ef49323e6:function(e,t){e.clearStencil(t)},__wbg_clearStencil_a58c15a1dcbf1fbe:function(e,t){e.clearStencil(t)},__wbg_clear_252bb7b11d5bea06:function(e,t){e.clear(t>>>0)},__wbg_clear_7d0a8d124c2a4b66:function(e,t){e.clear(t>>>0)},__wbg_clientWaitSync_fb0623a14def0f1e:function(e,t,n,r){return e.clientWaitSync(t,n>>>0,r>>>0)},__wbg_colorMask_0f86a23bfc7696a7:function(e,t,n,r,i){e.colorMask(t!==0,n!==0,r!==0,i!==0)},__wbg_colorMask_2d4b38c34bf55a02:function(e,t,n,r,i){e.colorMask(t!==0,n!==0,r!==0,i!==0)},__wbg_compileShader_a20e7b68d3edcd8a:function(e,t){e.compileShader(t)},__wbg_compileShader_b77bd79d00a03b02:function(e,t){e.compileShader(t)},__wbg_compressedTexSubImage2D_12adc86b34c12d28:function(e,t,n,r,i,a,o,s,c){e.compressedTexSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c)},__wbg_compressedTexSubImage2D_5336c9efcad92150:function(e,t,n,r,i,a,o,s,c){e.compressedTexSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c)},__wbg_compressedTexSubImage2D_7eb545d3f1d37773:function(e,t,n,r,i,a,o,s,c,l){e.compressedTexSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c,l)},__wbg_compressedTexSubImage3D_1bca0af82425d03d:function(e,t,n,r,i,a,o,s,c,l,u,d){e.compressedTexSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u,d)},__wbg_compressedTexSubImage3D_7f820492cb5a6d5e:function(e,t,n,r,i,a,o,s,c,l,u){e.compressedTexSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u)},__wbg_copyBufferSubData_8855e4c7f24415d6:function(e,t,n,r,i,a){e.copyBufferSubData(t>>>0,n>>>0,r,i,a)},__wbg_copyTexSubImage2D_68eb6addf3f910bb:function(e,t,n,r,i,a,o,s,c){e.copyTexSubImage2D(t>>>0,n,r,i,a,o,s,c)},__wbg_copyTexSubImage2D_c56507367f94e004:function(e,t,n,r,i,a,o,s,c){e.copyTexSubImage2D(t>>>0,n,r,i,a,o,s,c)},__wbg_copyTexSubImage3D_7f30d563975b3710:function(e,t,n,r,i,a,o,s,c,l){e.copyTexSubImage3D(t>>>0,n,r,i,a,o,s,c,l)},__wbg_createBuffer_1c3448547584bc5a:function(e){let t=e.createBuffer();return K(t)?0:_w(t)},__wbg_createBuffer_77da03de0620a199:function(e){let t=e.createBuffer();return K(t)?0:_w(t)},__wbg_createFramebuffer_22f50a7a9f8afdf0:function(e){let t=e.createFramebuffer();return K(t)?0:_w(t)},__wbg_createFramebuffer_73699dac20f72ffb:function(e){let t=e.createFramebuffer();return K(t)?0:_w(t)},__wbg_createProgram_a175fc4c32429a24:function(e){let t=e.createProgram();return K(t)?0:_w(t)},__wbg_createProgram_c9d6396ea0bc7522:function(e){let t=e.createProgram();return K(t)?0:_w(t)},__wbg_createQuery_5d92b56f0ca718af:function(e){let t=e.createQuery();return K(t)?0:_w(t)},__wbg_createRenderbuffer_483c206d1b62e6bd:function(e){let t=e.createRenderbuffer();return K(t)?0:_w(t)},__wbg_createRenderbuffer_f26e2b467988cc7e:function(e){let t=e.createRenderbuffer();return K(t)?0:_w(t)},__wbg_createSampler_80eb58b226692482:function(e){let t=e.createSampler();return K(t)?0:_w(t)},__wbg_createShader_25e11081fd48d141:function(e,t){let n=e.createShader(t>>>0);return K(n)?0:_w(n)},__wbg_createShader_9c5e52918428bd27:function(e,t){let n=e.createShader(t>>>0);return K(n)?0:_w(n)},__wbg_createTexture_5e721dc1ddd865e3:function(e){let t=e.createTexture();return K(t)?0:_w(t)},__wbg_createTexture_f1cc0c64fa9e22cf:function(e){let t=e.createTexture();return K(t)?0:_w(t)},__wbg_createVertexArrayOES_03fccccc43c10f77:function(e){let t=e.createVertexArrayOES();return K(t)?0:_w(t)},__wbg_createVertexArray_050d27763dfd72fa:function(e){let t=e.createVertexArray();return K(t)?0:_w(t)},__wbg_cullFace_632c5f88d252b4d7:function(e,t){e.cullFace(t>>>0)},__wbg_cullFace_962911677f1c30c6:function(e,t){e.cullFace(t>>>0)},__wbg_deleteBuffer_5c5c23d034945b7c:function(e,t){e.deleteBuffer(t)},__wbg_deleteBuffer_dd1d6f71883058cb:function(e,t){e.deleteBuffer(t)},__wbg_deleteFramebuffer_4d8be9eb882b0525:function(e,t){e.deleteFramebuffer(t)},__wbg_deleteFramebuffer_712016837ba2592e:function(e,t){e.deleteFramebuffer(t)},__wbg_deleteProgram_35e4ff7b82f1c4d5:function(e,t){e.deleteProgram(t)},__wbg_deleteProgram_771559436a63e7c1:function(e,t){e.deleteProgram(t)},__wbg_deleteQuery_1c30cae3b68f3fd7:function(e,t){e.deleteQuery(t)},__wbg_deleteRenderbuffer_16d1501ab6903d8e:function(e,t){e.deleteRenderbuffer(t)},__wbg_deleteRenderbuffer_aee8ffc30e0e35cb:function(e,t){e.deleteRenderbuffer(t)},__wbg_deleteSampler_ec0248a7607fb5e6:function(e,t){e.deleteSampler(t)},__wbg_deleteShader_5f66fd162cd9b6b4:function(e,t){e.deleteShader(t)},__wbg_deleteShader_718c5020e3d4f188:function(e,t){e.deleteShader(t)},__wbg_deleteSync_b589decdc7180f91:function(e,t){e.deleteSync(t)},__wbg_deleteTexture_3472fc261bb7ff34:function(e,t){e.deleteTexture(t)},__wbg_deleteTexture_6990124dfb5053bd:function(e,t){e.deleteTexture(t)},__wbg_deleteVertexArrayOES_b1b88aa74410f620:function(e,t){e.deleteVertexArrayOES(t)},__wbg_deleteVertexArray_85b79d70fae1d1da:function(e,t){e.deleteVertexArray(t)},__wbg_depthFunc_11c361d188403f52:function(e,t){e.depthFunc(t>>>0)},__wbg_depthFunc_cd5ad66da02ddb7c:function(e,t){e.depthFunc(t>>>0)},__wbg_depthMask_a00e4725581ef05d:function(e,t){e.depthMask(t!==0)},__wbg_depthMask_e15ec83686756c88:function(e,t){e.depthMask(t!==0)},__wbg_depthRange_2ed081b96c5c19be:function(e,t,n){e.depthRange(t,n)},__wbg_depthRange_7f3fef7f421c00d4:function(e,t,n){e.depthRange(t,n)},__wbg_disableVertexAttribArray_18b9a9fe235412a1:function(e,t){e.disableVertexAttribArray(t>>>0)},__wbg_disableVertexAttribArray_40a8f7d4d882728e:function(e,t){e.disableVertexAttribArray(t>>>0)},__wbg_disable_79f65722e686303b:function(e,t){e.disable(t>>>0)},__wbg_disable_df908054ffee7971:function(e,t){e.disable(t>>>0)},__wbg_document_3540635616a18455:function(e){let t=e.document;return K(t)?0:_w(t)},__wbg_done_54b8da57023b7ed2:function(e){return e.done},__wbg_drawArraysInstancedANGLE_a7a04432fa5e1577:function(e,t,n,r,i){e.drawArraysInstancedANGLE(t>>>0,n,r,i)},__wbg_drawArraysInstanced_0e6f9f2102461c2a:function(e,t,n,r,i){e.drawArraysInstanced(t>>>0,n,r,i)},__wbg_drawArrays_7f9a3dcec5315ce5:function(e,t,n,r){e.drawArrays(t>>>0,n,r)},__wbg_drawArrays_bceea06128f9d778:function(e,t,n,r){e.drawArrays(t>>>0,n,r)},__wbg_drawBuffersWEBGL_5fbba2b83de4c122:function(e,t){e.drawBuffersWEBGL(t)},__wbg_drawBuffers_217bd25bf75ccebd:function(e,t){e.drawBuffers(t)},__wbg_drawElementsInstancedANGLE_6794fe36875c5120:function(e,t,n,r,i,a){e.drawElementsInstancedANGLE(t>>>0,n,r>>>0,i,a)},__wbg_drawElementsInstanced_767ab401cd072fd4:function(e,t,n,r,i,a){e.drawElementsInstanced(t>>>0,n,r>>>0,i,a)},__wbg_enableVertexAttribArray_9963bb377f60317c:function(e,t){e.enableVertexAttribArray(t>>>0)},__wbg_enableVertexAttribArray_9e6e81b8b603d999:function(e,t){e.enableVertexAttribArray(t>>>0)},__wbg_enable_5c8f846164bc8138:function(e,t){e.enable(t>>>0)},__wbg_enable_ee1b63abdc3fdeb5:function(e,t){e.enable(t>>>0)},__wbg_endQuery_42d36ba1d568a37a:function(e,t){e.endQuery(t>>>0)},__wbg_entries_564a7e8b1e54ede5:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(Rw(e,t))}finally{J.__wbindgen_free(n,r,1)}},__wbg_fenceSync_59d6455faf4ba50a:function(e,t,n){let r=e.fenceSync(t>>>0,n>>>0);return K(r)?0:_w(r)},__wbg_flush_1e5245bab2bbc54b:function(e){e.flush()},__wbg_flush_279c03f2320388de:function(e){e.flush()},__wbg_framebufferRenderbuffer_49b9288b6a7b5629:function(e,t,n,r,i){e.framebufferRenderbuffer(t>>>0,n>>>0,r>>>0,i)},__wbg_framebufferRenderbuffer_9417c925d5389962:function(e,t,n,r,i){e.framebufferRenderbuffer(t>>>0,n>>>0,r>>>0,i)},__wbg_framebufferTexture2D_8882fef6f47df627:function(e,t,n,r,i,a){e.framebufferTexture2D(t>>>0,n>>>0,r>>>0,i,a)},__wbg_framebufferTexture2D_91e307404924ae24:function(e,t,n,r,i,a){e.framebufferTexture2D(t>>>0,n>>>0,r>>>0,i,a)},__wbg_framebufferTextureLayer_8256c57e84c45762:function(e,t,n,r,i,a){e.framebufferTextureLayer(t>>>0,n>>>0,r,i,a)},__wbg_framebufferTextureMultiviewOVR_fd3136c9d479feb2:function(e,t,n,r,i,a,o){e.framebufferTextureMultiviewOVR(t>>>0,n>>>0,r,i,a,o)},__wbg_from_fa561fa561dc8031:function(e){return Array.from(e)},__wbg_frontFace_1ab53137f5dcd7a2:function(e,t){e.frontFace(t>>>0)},__wbg_frontFace_53fc2aad7ead45c9:function(e,t){e.frontFace(t>>>0)},__wbg_getBufferSubData_f3d6368ec0319180:function(e,t,n,r){e.getBufferSubData(t>>>0,n,r)},__wbg_getContext_32d5f94659d12566:function(){return Gw(function(e,t,n,r){let i=e.getContext(Rw(t,n),r);return K(i)?0:_w(i)},arguments)},__wbg_getContext_50a6668bd78d1120:function(){return Gw(function(e,t,n,r){let i=e.getContext(Rw(t,n),r);return K(i)?0:_w(i)},arguments)},__wbg_getExtension_c76ccfc25e343ce6:function(){return Gw(function(e,t,n){let r=e.getExtension(Rw(t,n));return K(r)?0:_w(r)},arguments)},__wbg_getIndexedParameter_b83fcd0ac4c3a462:function(){return Gw(function(e,t,n){return e.getIndexedParameter(t>>>0,n>>>0)},arguments)},__wbg_getParameter_5f25c05c9a0f445a:function(){return Gw(function(e,t){return e.getParameter(t>>>0)},arguments)},__wbg_getParameter_827c3142b1ce3364:function(){return Gw(function(e,t){return e.getParameter(t>>>0)},arguments)},__wbg_getProgramInfoLog_6d6e22f0179f1acf:function(e,t,n){let r=t.getProgramInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getProgramInfoLog_e2fe4bdd00a597bc:function(e,t,n){let r=t.getProgramInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getProgramParameter_6927dedbc507dfc7:function(e,t,n){return e.getProgramParameter(t,n>>>0)},__wbg_getProgramParameter_c7abe52a31622ce2:function(e,t,n){return e.getProgramParameter(t,n>>>0)},__wbg_getQueryParameter_6817ddd38edd8e5c:function(e,t,n){return e.getQueryParameter(t,n>>>0)},__wbg_getShaderInfoLog_246aba1bd0b04ad2:function(e,t,n){let r=t.getShaderInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getShaderInfoLog_edfc45fd76ba8c81:function(e,t,n){let r=t.getShaderInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getShaderParameter_07fb35844118558b:function(e,t,n){return e.getShaderParameter(t,n>>>0)},__wbg_getShaderParameter_ac9e7f81d3268efe:function(e,t,n){return e.getShaderParameter(t,n>>>0)},__wbg_getSupportedExtensions_76f42c1e788da832:function(e){let t=e.getSupportedExtensions();return K(t)?0:_w(t)},__wbg_getSupportedProfiles_e4f6fd61b7c0362c:function(e){let t=e.getSupportedProfiles();return K(t)?0:_w(t)},__wbg_getSyncParameter_9f6e0bba77b398fa:function(e,t,n){return e.getSyncParameter(t,n>>>0)},__wbg_getUniformBlockIndex_3aa1c4c48062a404:function(e,t,n,r){return e.getUniformBlockIndex(t,Rw(n,r))},__wbg_getUniformLocation_1717b4ed42e2ccee:function(e,t,n,r){let i=e.getUniformLocation(t,Rw(n,r));return K(i)?0:_w(i)},__wbg_getUniformLocation_46373021b59d8832:function(e,t,n,r){let i=e.getUniformLocation(t,Rw(n,r));return K(i)?0:_w(i)},__wbg_get_3e9a707ab7d352eb:function(){return Gw(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_98fdf51d029a75eb:function(e,t){return e[t>>>0]},__wbg_get_dcf82ab8aad1a593:function(){return Gw(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_1dfe6d05ad91d9b7:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_includes_0ec85e8f9acc8cac:function(e,t,n){return e.includes(t,n)},__wbg_instanceof_ArrayBuffer_53db37b06f6b9afe:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_HtmlCanvasElement_a02da0a417f1bf3f:function(e){let t;try{t=e instanceof HTMLCanvasElement}catch{t=!1}return t},__wbg_instanceof_Uint32Array_6aece1e91fed8df4:function(e){let t;try{t=e instanceof Uint32Array}catch{t=!1}return t},__wbg_instanceof_Uint8Array_abd07d4bd221d50b:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_instanceof_WebGl2RenderingContext_419098f7bf88e87e:function(e){let t;try{t=e instanceof WebGL2RenderingContext}catch{t=!1}return t},__wbg_instanceof_Window_faa5cf994f49cca7:function(e){let t;try{t=e instanceof Window}catch{t=!1}return t},__wbg_invalidateFramebuffer_02a63100f262d6cb:function(){return Gw(function(e,t,n){e.invalidateFramebuffer(t>>>0,n)},arguments)},__wbg_isArray_74b636a53056fecb:function(e){return Array.isArray(e)},__wbg_isArray_94898ed3aad6947b:function(e){return Array.isArray(e)},__wbg_isSafeInteger_01e964d144ad3a55:function(e){return Number.isSafeInteger(e)},__wbg_is_032c49d03f47f420:function(e,t){return Object.is(e,t)},__wbg_iterator_1441b47f341dc34f:function(){return Symbol.iterator},__wbg_length_2591a0f4f659a55c:function(e){return e.length},__wbg_length_3a1b902b6cde9e2c:function(e){return e.length},__wbg_length_56fcd3e2b7e0299d:function(e){return e.length},__wbg_linkProgram_7689cb555b14a359:function(e,t){e.linkProgram(t)},__wbg_linkProgram_ec865896be2835c2:function(e,t){e.linkProgram(t)},__wbg_new_02d162bc6cf02f60:function(){return{}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_new_310879b66b6e95e1:function(){return[]},__wbg_new_6c6169c583e23af8:function(e){return new Set(e)},__wbg_new_7ddec6de44ff8f5d:function(e){return new Uint8Array(e)},__wbg_new_d8dfd33fa007511d:function(e,t){try{var n={a:e,b:t};return new Promise((e,t)=>{let r=n.a;n.a=0;try{return WC(r,n.b,e,t)}finally{n.a=r}})}finally{n.a=0}},__wbg_new_typed_c072c4ce9a2a0cdf:function(e,t){try{var n={a:e,b:t};return new Promise((e,t)=>{let r=n.a;n.a=0;try{return WC(r,n.b,e,t)}finally{n.a=r}})}finally{n.a=0}},__wbg_new_with_length_99887c91eae4abab:function(e){return new Uint8Array(e>>>0)},__wbg_next_2a4e19f4f5083b0f:function(e){return e.next},__wbg_next_6429a146bf756f93:function(){return Gw(function(e){return e.next()},arguments)},__wbg_of_d694dacacb7afa7f:function(e){return[e]},__wbg_pixelStorei_06b86995306b01dc:function(e,t,n){e.pixelStorei(t>>>0,n)},__wbg_pixelStorei_171e6a6629fd9e3c:function(e,t,n){e.pixelStorei(t>>>0,n)},__wbg_polygonOffset_690c52c5bfca2a27:function(e,t,n){e.polygonOffset(t,n)},__wbg_polygonOffset_cd648f07839ab009:function(e,t,n){e.polygonOffset(t,n)},__wbg_prototypesetcall_303283bf37c9f014:function(e,t,n){Uint32Array.prototype.set.call(Ew(e,t),n)},__wbg_prototypesetcall_5f9bdc8d75e07276:function(e,t,n){Uint8Array.prototype.set.call(Dw(e,t),n)},__wbg_push_b77c476b01548d0a:function(e,t){return e.push(t)},__wbg_queryCounterEXT_d92c246603070eed:function(e,t,n){e.queryCounterEXT(t,n>>>0)},__wbg_querySelector_54149fe79b2a2091:function(){return Gw(function(e,t,n){let r=e.querySelector(Rw(t,n));return K(r)?0:_w(r)},arguments)},__wbg_queueMicrotask_78d584b53af520f5:function(e){return e.queueMicrotask},__wbg_queueMicrotask_b39ea83c7f01971a:function(e){queueMicrotask(e)},__wbg_readBuffer_dc685ea6f3a7d5aa:function(e,t){e.readBuffer(t>>>0)},__wbg_readPixels_0529efa834a6960a:function(){return Gw(function(e,t,n,r,i,a,o,s){e.readPixels(t,n,r,i,a>>>0,o>>>0,s)},arguments)},__wbg_readPixels_3509816172f67b8a:function(){return Gw(function(e,t,n,r,i,a,o,s){e.readPixels(t,n,r,i,a>>>0,o>>>0,s)},arguments)},__wbg_readPixels_76225de67eebec03:function(){return Gw(function(e,t,n,r,i,a,o,s){e.readPixels(t,n,r,i,a>>>0,o>>>0,s)},arguments)},__wbg_renderbufferStorageMultisample_25941e0e73e50cd2:function(e,t,n,r,i,a){e.renderbufferStorageMultisample(t>>>0,n,r>>>0,i,a)},__wbg_renderbufferStorage_e46ef4833287e3bf:function(e,t,n,r,i){e.renderbufferStorage(t>>>0,n>>>0,r,i)},__wbg_renderbufferStorage_fd35a40ea121e819:function(e,t,n,r,i){e.renderbufferStorage(t>>>0,n>>>0,r,i)},__wbg_resolve_d17db9352f5a220e:function(e){return Promise.resolve(e)},__wbg_rhiwgpuadapter_new:function(e){return fC.__wrap(e)},__wbg_rhiwgpucommandbuffer_unwrap:function(e){return gC.__unwrap(e)},__wbg_rhiwgpudevice_new:function(e){return bC.__wrap(e)},__wbg_rhiwgpuinstance_new:function(e){return xC.__wrap(e)},__wbg_samplerParameterf_eb39264d0b3431ea:function(e,t,n,r){e.samplerParameterf(t,n>>>0,r)},__wbg_samplerParameteri_7a90e6197a393b63:function(e,t,n,r){e.samplerParameteri(t,n>>>0,r)},__wbg_scissor_eefeb709a030fe62:function(e,t,n,r,i){e.scissor(t,n,r,i)},__wbg_scissor_ffbc9d8b3e5bb99b:function(e,t,n,r,i){e.scissor(t,n,r,i)},__wbg_set_24d0fa9e104112f9:function(e,t,n){e.set(Dw(t,n))},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_a0e911be3da02782:function(){return Gw(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbg_set_height_bb0dc35fd1d941f5:function(e,t){e.height=t>>>0},__wbg_set_height_bdd58e6b04e88cca:function(e,t){e.height=t>>>0},__wbg_set_width_25112eb6bf1148df:function(e,t){e.width=t>>>0},__wbg_set_width_9d385df435c1f79d:function(e,t){e.width=t>>>0},__wbg_shaderSource_a304cd4ebd95c11b:function(e,t,n,r){e.shaderSource(t,Rw(n,r))},__wbg_shaderSource_eceb56c4b827824d:function(e,t,n,r){e.shaderSource(t,Rw(n,r))},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),i=eT;kw().setInt32(e+4,i,!0),kw().setInt32(e+0,r,!0)},__wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9:function(){let e=typeof globalThis>`u`?null:globalThis;return K(e)?0:_w(e)},__wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54:function(){let e=typeof global>`u`?null:global;return K(e)?0:_w(e)},__wbg_static_accessor_SELF_9b2406c23aeb2023:function(){let e=typeof self>`u`?null:self;return K(e)?0:_w(e)},__wbg_static_accessor_WINDOW_b34d2126934e16ba:function(){let e=typeof window>`u`?null:window;return K(e)?0:_w(e)},__wbg_stencilFuncSeparate_00281c346ccf1e19:function(e,t,n,r,i){e.stencilFuncSeparate(t>>>0,n>>>0,r,i>>>0)},__wbg_stencilFuncSeparate_5f7154fe74881dab:function(e,t,n,r,i){e.stencilFuncSeparate(t>>>0,n>>>0,r,i>>>0)},__wbg_stencilMaskSeparate_bd7c034fdfc6620c:function(e,t,n){e.stencilMaskSeparate(t>>>0,n>>>0)},__wbg_stencilMaskSeparate_d14d6ba494aeff5f:function(e,t,n){e.stencilMaskSeparate(t>>>0,n>>>0)},__wbg_stencilMask_15dfb3e60c15e612:function(e,t){e.stencilMask(t>>>0)},__wbg_stencilMask_2d63c2d3e068aca1:function(e,t){e.stencilMask(t>>>0)},__wbg_stencilOpSeparate_1fea3ed309a817f9:function(e,t,n,r,i){e.stencilOpSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_stencilOpSeparate_32876bf4c07b7065:function(e,t,n,r,i){e.stencilOpSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_texImage2D_17593ae6c467ae79:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texImage2D_2495ff54823b531b:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texImage2D_364c83aae17ba6d2:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texImage3D_3bcfec50659cc5ae:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u){e.texImage3D(t>>>0,n,r,i,a,o,s,c>>>0,l>>>0,u)},arguments)},__wbg_texImage3D_79d27507fa4470dd:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u){e.texImage3D(t>>>0,n,r,i,a,o,s,c>>>0,l>>>0,u)},arguments)},__wbg_texParameteri_2ef5b781bcfbdd64:function(e,t,n,r){e.texParameteri(t>>>0,n>>>0,r)},__wbg_texParameteri_c22838926a5dca2b:function(e,t,n,r){e.texParameteri(t>>>0,n>>>0,r)},__wbg_texStorage2D_afb762382f8a4678:function(e,t,n,r,i,a){e.texStorage2D(t>>>0,n,r>>>0,i,a)},__wbg_texStorage3D_66ff900ad02f2247:function(e,t,n,r,i,a,o){e.texStorage3D(t>>>0,n,r>>>0,i,a,o)},__wbg_texSubImage2D_0f88243806532534:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_203ff6bcf48e4d08:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_57a710f2064ab4ef:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_62d9e38e9378faff:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_668c5714e23e0e83:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_781892a0e05abd13:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_ad417daf4e038863:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_e1be0f65e9a35343:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage3D_11a4e6f278359fc4:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_36a195d4f535cfe6:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_54374f7f12d16e40:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_5cfc6bdc70a23b0d:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_72a9517857b52f44:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_a5b225452b0d7de3:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_ebb4d2dbc4680374:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_then_837494e384b37459:function(e,t){return e.then(t)},__wbg_then_bd927500e8905df2:function(e,t,n){return e.then(t,n)},__wbg_uniform1f_429e664ea89191db:function(e,t,n){e.uniform1f(t,n)},__wbg_uniform1f_709baed741125e5e:function(e,t,n){e.uniform1f(t,n)},__wbg_uniform1i_2be01a75c6619c15:function(e,t,n){e.uniform1i(t,n)},__wbg_uniform1i_717096cfb8ca6bc1:function(e,t,n){e.uniform1i(t,n)},__wbg_uniform1ui_eafd8b7523d6d39e:function(e,t,n){e.uniform1ui(t,n>>>0)},__wbg_uniform2fv_63f8c49c9f57e258:function(e,t,n,r){e.uniform2fv(t,xw(n,r))},__wbg_uniform2fv_9f8ce1c86ee13440:function(e,t,n,r){e.uniform2fv(t,xw(n,r))},__wbg_uniform2iv_c67b4ee9d082abdf:function(e,t,n,r){e.uniform2iv(t,Cw(n,r))},__wbg_uniform2iv_ec7e5887f2386d2c:function(e,t,n,r){e.uniform2iv(t,Cw(n,r))},__wbg_uniform2uiv_55a0e084de75c7b9:function(e,t,n,r){e.uniform2uiv(t,Ew(n,r))},__wbg_uniform3fv_2fb5418c1304ba72:function(e,t,n,r){e.uniform3fv(t,xw(n,r))},__wbg_uniform3fv_7c2935b7f05414ef:function(e,t,n,r){e.uniform3fv(t,xw(n,r))},__wbg_uniform3iv_ad46bb9ddf29111f:function(e,t,n,r){e.uniform3iv(t,Cw(n,r))},__wbg_uniform3iv_d82127ddeebb5154:function(e,t,n,r){e.uniform3iv(t,Cw(n,r))},__wbg_uniform3uiv_30e97efe980f53c9:function(e,t,n,r){e.uniform3uiv(t,Ew(n,r))},__wbg_uniform4f_7bc8db9ead983de4:function(e,t,n,r,i,a){e.uniform4f(t,n,r,i,a)},__wbg_uniform4f_be0bd0ea203aedfe:function(e,t,n,r,i,a){e.uniform4f(t,n,r,i,a)},__wbg_uniform4fv_622c64d35acf9214:function(e,t,n,r){e.uniform4fv(t,xw(n,r))},__wbg_uniform4fv_b0c5721b35cd3f06:function(e,t,n,r){e.uniform4fv(t,xw(n,r))},__wbg_uniform4iv_24df1fbc803c05db:function(e,t,n,r){e.uniform4iv(t,Cw(n,r))},__wbg_uniform4iv_2cccd5ae55d77224:function(e,t,n,r){e.uniform4iv(t,Cw(n,r))},__wbg_uniform4uiv_6f594d049d6d0038:function(e,t,n,r){e.uniform4uiv(t,Ew(n,r))},__wbg_uniformBlockBinding_25e6ae614200cf4d:function(e,t,n,r){e.uniformBlockBinding(t,n>>>0,r>>>0)},__wbg_uniformMatrix2fv_6918fd0909b6a167:function(e,t,n,r,i){e.uniformMatrix2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix2fv_840e6434707032cd:function(e,t,n,r,i){e.uniformMatrix2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix2x3fv_4a2dd969ec740f7d:function(e,t,n,r,i){e.uniformMatrix2x3fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix2x4fv_e3cdd10c182a5354:function(e,t,n,r,i){e.uniformMatrix2x4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3fv_6abd62dbed68830a:function(e,t,n,r,i){e.uniformMatrix3fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3fv_e380a7aa532c175a:function(e,t,n,r,i){e.uniformMatrix3fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3x2fv_2b07ce888bfa37c8:function(e,t,n,r,i){e.uniformMatrix3x2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3x4fv_0439a4fdd88af9de:function(e,t,n,r,i){e.uniformMatrix3x4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4fv_b5f678dc15314524:function(e,t,n,r,i){e.uniformMatrix4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4fv_d2b5005a92d27115:function(e,t,n,r,i){e.uniformMatrix4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4x2fv_7d12ae09d4b61a26:function(e,t,n,r,i){e.uniformMatrix4x2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4x3fv_f60d424ca4a02635:function(e,t,n,r,i){e.uniformMatrix4x3fv(t,n!==0,xw(r,i))},__wbg_useProgram_3cc1a6d58dac88b4:function(e,t){e.useProgram(t)},__wbg_useProgram_e45f506b921ab3f8:function(e,t){e.useProgram(t)},__wbg_value_9cc0518af87a489c:function(e){return e.value},__wbg_vertexAttribDivisorANGLE_47b6b82921bbf062:function(e,t,n){e.vertexAttribDivisorANGLE(t>>>0,n>>>0)},__wbg_vertexAttribDivisor_74454522a4976fc2:function(e,t,n){e.vertexAttribDivisor(t>>>0,n>>>0)},__wbg_vertexAttribIPointer_e65b21fd97a67466:function(e,t,n,r,i,a){e.vertexAttribIPointer(t>>>0,n,r>>>0,i,a)},__wbg_vertexAttribPointer_7f7185558bcaf24b:function(e,t,n,r,i,a,o){e.vertexAttribPointer(t>>>0,n,r>>>0,i!==0,a,o)},__wbg_vertexAttribPointer_85566c79cb366300:function(e,t,n,r,i,a,o){e.vertexAttribPointer(t>>>0,n,r>>>0,i!==0,a,o)},__wbg_viewport_3c149d0c6435f0ed:function(e,t,n,r,i){e.viewport(t,n,r,i)},__wbg_viewport_c25030cfbe3cddf4:function(e,t,n,r,i){e.viewport(t,n,r,i)},__wbindgen_cast_0000000000000001:function(e,t){return Kw(e,t,UC)},__wbindgen_cast_0000000000000002:function(e,t){return Kw(e,t,GC)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e,t){return xw(e,t)},__wbindgen_cast_0000000000000005:function(e,t){return Sw(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return Cw(e,t)},__wbindgen_cast_0000000000000007:function(e,t){return ww(e,t)},__wbindgen_cast_0000000000000008:function(e,t){return Tw(e,t)},__wbindgen_cast_0000000000000009:function(e,t){return Ew(e,t)},__wbindgen_cast_000000000000000a:function(e,t){return Dw(e,t)},__wbindgen_cast_000000000000000b:function(e,t){return Rw(e,t)},__wbindgen_cast_000000000000000c:function(e){return BigInt.asUintN(64,e)},__wbindgen_init_externref_table:function(){let e=J.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function UC(e,t,n){let r=J.wasm_bindgen_5989510ce0f9510c___convert__closures_____invoke___wasm_bindgen_5989510ce0f9510c___JsValue__core_f4ce2b6cc8c3b44d___result__Result_____wasm_bindgen_5989510ce0f9510c___JsError___true_(e,t,n);if(r[1])throw q(r[0])}function WC(e,t,n,r){J.wasm_bindgen_5989510ce0f9510c___convert__closures_____invoke___js_sys_c72f2fdc215f630f___Function_fn_wasm_bindgen_5989510ce0f9510c___JsValue_____wasm_bindgen_5989510ce0f9510c___sys__Undefined___js_sys_c72f2fdc215f630f___Function_fn_wasm_bindgen_5989510ce0f9510c___JsValue_____wasm_bindgen_5989510ce0f9510c___sys__Undefined_______true_(e,t,n,r)}function GC(e,t,n,r){let i=Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT,o=Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),s=eT;J.wasm_bindgen_5989510ce0f9510c___convert__closures_____invoke___alloc_864af3eab0b4f693___string__String__alloc_864af3eab0b4f693___string__String______true_(e,t,i,a,o,s)}var KC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_parsedmodule_free(e,1)),qC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuadapter_free(e,1)),JC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpubindgroup_free(e,1)),YC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpubindgrouplayout_free(e,1)),XC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpubuffer_free(e,1)),ZC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucommandbuffer_free(e,1)),QC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucommandencoder_free(e,1)),$C=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucomputepass_free(e,1)),ew=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucomputepipeline_free(e,1)),tw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpudevice_free(e,1)),nw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuinstance_free(e,1)),rw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpupipelinelayout_free(e,1)),iw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuqueryset_free(e,1)),aw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuqueue_free(e,1)),ow=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderbundle_free(e,1)),sw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderbundleencoder_free(e,1)),cw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderpass_free(e,1)),lw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderpipeline_free(e,1)),uw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpusampler_free(e,1)),dw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpushadermodule_free(e,1)),fw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpusurface_free(e,1)),pw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpusurfacetexture_free(e,1)),mw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgputexture_free(e,1)),hw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgputextureview_free(e,1)),gw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_validatedmodule_free(e,1));function _w(e){let t=J.__externref_table_alloc();return J.__wbindgen_externrefs.set(t,e),t}function vw(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}var yw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbindgen_destroy_closure(e.a,e.b));function bw(e){let t=typeof e;if(t==`number`||t==`boolean`||e==null)return`${e}`;if(t==`string`)return`"${e}"`;if(t==`symbol`){let t=e.description;return t==null?`Symbol`:`Symbol(${t})`}if(t==`function`){let t=e.name;return typeof t==`string`&&t.length>0?`Function(${t})`:`Function`}if(Array.isArray(e)){let t=e.length,n=`[`;t>0&&(n+=bw(e[0]));for(let r=1;r<t;r++)n+=`, `+bw(e[r]);return n+=`]`,n}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r==`Object`)try{return`Object(`+JSON.stringify(e)+`)`}catch{return`Object`}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function xw(e,t){return e>>>=0,jw().subarray(e/4,e/4+t)}function Sw(e,t){return e>>>=0,Nw().subarray(e/2,e/2+t)}function Cw(e,t){return e>>>=0,Fw().subarray(e/4,e/4+t)}function ww(e,t){return e>>>=0,Lw().subarray(e/1,e/1+t)}function Tw(e,t){return e>>>=0,Bw().subarray(e/2,e/2+t)}function Ew(e,t){return e>>>=0,Hw().subarray(e/4,e/4+t)}function Dw(e,t){return e>>>=0,Ww().subarray(e/1,e/1+t)}var Ow=null;function kw(){return(Ow===null||Ow.buffer.detached===!0||Ow.buffer.detached===void 0&&Ow.buffer!==J.memory.buffer)&&(Ow=new DataView(J.memory.buffer)),Ow}var Aw=null;function jw(){return(Aw===null||Aw.byteLength===0)&&(Aw=new Float32Array(J.memory.buffer)),Aw}var Mw=null;function Nw(){return(Mw===null||Mw.byteLength===0)&&(Mw=new Int16Array(J.memory.buffer)),Mw}var Pw=null;function Fw(){return(Pw===null||Pw.byteLength===0)&&(Pw=new Int32Array(J.memory.buffer)),Pw}var Iw=null;function Lw(){return(Iw===null||Iw.byteLength===0)&&(Iw=new Int8Array(J.memory.buffer)),Iw}function Rw(e,t){return Qw(e>>>0,t)}var zw=null;function Bw(){return(zw===null||zw.byteLength===0)&&(zw=new Uint16Array(J.memory.buffer)),zw}var Vw=null;function Hw(){return(Vw===null||Vw.byteLength===0)&&(Vw=new Uint32Array(J.memory.buffer)),Vw}var Uw=null;function Ww(){return(Uw===null||Uw.byteLength===0)&&(Uw=new Uint8Array(J.memory.buffer)),Uw}function Gw(e,t){try{return e.apply(this,t)}catch(e){let t=_w(e);J.__wbindgen_exn_store(t)}}function K(e){return e==null}function Kw(e,t,n){let r={a:e,b:t,cnt:1},i=(...e)=>{r.cnt++;let t=r.a;r.a=0;try{return n(t,r.b,...e)}finally{r.a=t,i._wbg_cb_unref()}};return i._wbg_cb_unref=()=>{--r.cnt===0&&(J.__wbindgen_destroy_closure(r.a,r.b),r.a=0,yw.unregister(r))},yw.register(i,r,r),i}function qw(e,t){let n=t(e.length*1,1)>>>0;return Ww().set(e,n/1),eT=e.length,n}function Jw(e,t,n){if(n===void 0){let n=$w.encode(e),r=t(n.length,1)>>>0;return Ww().subarray(r,r+n.length).set(n),eT=n.length,r}let r=e.length,i=t(r,1)>>>0,a=Ww(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=Ww().subarray(i+o,i+r),a=$w.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return eT=o,i}function q(e){let t=J.__wbindgen_externrefs.get(e);return J.__externref_table_dealloc(e),t}var Yw=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});Yw.decode();var Xw=2146435072,Zw=0;function Qw(e,t){return Zw+=t,Zw>=Xw&&(Yw=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),Yw.decode(),Zw=t),Yw.decode(Ww().subarray(e,e+t))}var $w=new TextEncoder;`encodeInto`in $w||($w.encodeInto=function(e,t){let n=$w.encode(e);return t.set(n),{read:e.length,written:n.length}});var eT=0,J;function tT(e,t){return J=e.exports,Ow=null,Aw=null,Mw=null,Pw=null,Iw=null,zw=null,Vw=null,Uw=null,J.__wbindgen_start(),J}async function nT(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function rT(e){if(J!==void 0)return J;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=HC();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),tT(new WebAssembly.Instance(e,t),e)}async function iT(e){if(J!==void 0)return J;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/wgpu_wasm_bg-C1seepuF.wasm`,``+import.meta.url));let t=HC();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await nT(await e,t);return tT(n,r)}var aT=null;async function oT(e){let t=globalThis.crypto?.subtle;if(t!==void 0){let n=await t.digest(`SHA-256`,e);return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}return(await h(()=>import(`node:crypto`),[])).createHash(`sha256`).update(e).digest(`hex`)}function sT(e){return JSON.stringify({schemaVersion:e.schemaVersion,sourceContentKey:e.sourceContentKey,artifactSha256:e.artifactSha256,glueSha256:e.glueSha256,toolchain:e.toolchain,dependencies:e.dependencies})}async function cT(e,t,n){let r;try{r=JSON.parse(new TextDecoder().decode(e))}catch{throw Error(`wgpu-wasm provenance manifest is not valid JSON`)}if(typeof r!=`object`||!r||r.schemaVersion!==`wgpu-wasm-provenance/1`)throw Error(`wgpu-wasm provenance manifest has an unsupported schemaVersion`);let i=r,a=await oT(t),o=await oT(n);if(a!==i.artifactSha256||t.byteLength!==i.artifactBytes)throw Error(`wgpu-wasm artifact bytes do not match provenance manifest`);if(o!==i.glueSha256||n.byteLength!==i.glueBytes)throw Error(`wgpu-wasm glue bytes do not match provenance manifest`);if(`sha256-${await oT(new TextEncoder().encode(sT(i)))}`!==i.compilerFingerprint)throw Error(`wgpu-wasm compiler fingerprint does not match provenance manifest`);return i}function lT(e){let t=new URL(e.href);return t.search=`${t.search}${t.search===``?`?`:`&`}raw`,t}async function uT(e){let t=new Uint8Array(await e.arrayBuffer()),n=new TextDecoder().decode(t);if(!n.startsWith(`export default `))return t;let r=n.slice(15).trim();r.endsWith(`;`)&&(r=r.slice(0,-1).trim());try{let e=JSON.parse(r);if(typeof e==`string`)return new TextEncoder().encode(e)}catch{}return t}async function dT(){let e=typeof globalThis.process?.versions?.node==`string`,t=new URL(`/assets/wgpu_wasm_bg-C1seepuF.wasm`,``+import.meta.url),n=new URL(`data:application/json;base64,ewogICJzY2hlbWFWZXJzaW9uIjogIndncHUtd2FzbS1wcm92ZW5hbmNlLzEiLAogICJzb3VyY2VDb250ZW50S2V5IjogInNoYTI1Ni1jZjRhZDY5OWY0YTJjMTIzZWFjYjJjNzRlYWVlNjBlOGViM2VjYjBiN2Y0MGQyNGUzOTQ2ZGU4YzQ0YzlhOWZhIiwKICAiYXJ0aWZhY3RTaGEyNTYiOiAiNDlkMzY0N2I1ZGI4MGExMGNlZTBlMzI5ZjlkYzBiMDg2M2RhNDAzMjA5NjE5MGUyZTFlMDZlY2Y2ODM2ZDc1MiIsCiAgImFydGlmYWN0Qnl0ZXMiOiA1NTcyMjAwLAogICJnbHVlU2hhMjU2IjogIjJkNDYzOTY1Mzc0NDdhNWUxYjdjYjA3MWNlYmFiNmQxNzE1NTAwZTU4YzEwZDU1MjAxZGQzZmFkYjg1NzNlMDkiLAogICJnbHVlQnl0ZXMiOiAxNDg1OTksCiAgInRvb2xjaGFpbiI6IHsKICAgICJydXN0YyI6ICJydXN0YyAxLjkzLjEgKDAxZjZkZGY3NSAyMDI2LTAyLTExKSIsCiAgICAid2FzbVBhY2siOiAid2FzbS1wYWNrIDAuMTQuMCIsCiAgICAid2FzbUJpbmRnZW4iOiAidW5hdmFpbGFibGUiCiAgfSwKICAiZGVwZW5kZW5jaWVzIjogewogICAgIndncHUiOiAiMjkuMC4zIiwKICAgICJuYWdhIjogIjI5LjAuMyIsCiAgICAibmFnYU9pbCI6ICIwLjIyLjAiLAogICAgIndhc21CaW5kZ2VuIjogIjAuMi4xMjEiCiAgfSwKICAiY29tcGlsZXJGaW5nZXJwcmludCI6ICJzaGEyNTYtYWE0YmZjYzUxZDJkZTNmMDgyYmMxYWY3OGI3MTNhYTBiMTkzNTIzNjM3ZjdiN2RmMmU1ZWU2ZTU2MGUzNGQ5MCIKfQo=`,``+import.meta.url),r=new URL(`/assets/wgpu_wasm-DZKPZXEq.js`,``+import.meta.url);if(e){let e=await h(()=>import(`node:fs/promises`),[]),i=await h(()=>import(`node:url`),[]),a=await e.readFile(i.fileURLToPath(t));await cT(await e.readFile(i.fileURLToPath(n)),a,await e.readFile(i.fileURLToPath(r))),await iT({module_or_path:a})}else{let[e,i,a]=await Promise.all([fetch(n),fetch(t),fetch(lT(r))]);if(!e.ok||!i.ok||!a.ok)throw Error(`wgpu-wasm provenance or generated bytes could not be fetched`);let[o,s,c]=await Promise.all([e.arrayBuffer(),i.arrayBuffer(),uT(a)]);await cT(new Uint8Array(o),new Uint8Array(s),new Uint8Array(c)),await iT({module_or_path:s})}return uC}var fT=()=>(aT||=dT().catch(e=>{throw aT=null,e}),aT);function pT(e){return new sC({code:`shader-compile-failed`,expected:`WGSL source parses + validates against naga IR`,message:e.message,hint:e.hint,...e.lineNum===void 0?{}:{lineNum:e.lineNum},...e.linePos===void 0?{}:{linePos:e.linePos},...e.compilerMessages===void 0?{}:{detail:{code:`shader-compile-failed`,compilerMessages:e.compilerMessages,...e.reason===void 0?{}:{reason:e.reason}}}})}function mT(e,t){if(e instanceof Error)try{let n=JSON.parse(e.message);return pT({message:n.summary??n.message??e.message,hint:t??`fix the WGSL source at the indicated line/column; see ShaderError.detail.compilerMessages for full diagnostic frame`,...typeof n.line_num==`number`?{lineNum:n.line_num}:{},...typeof n.line_pos==`number`?{linePos:n.line_pos}:{}})}catch{return pT({message:e.message,hint:t??`check WGSL syntax + validation rules; consult naga error output for details`})}return pT({message:String(e),hint:t??`unknown error type from @forgeax/engine-wgpu-wasm; report as @forgeax/engine-naga bug`})}async function hT(e){let t;try{t=await fT()}catch(e){return y(mT(e,`rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm`))}try{return v(t.parse(e))}catch(e){return y(mT(e))}}async function gT(e){let t;try{t=await fT()}catch(e){return y(mT(e,`rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm`))}try{return v(t.validate(e))}catch(e){return y(mT(e))}}function _T(e,t,n,r){return{code:e,detail:t,hint:n,message:t,expected:`a viewer-private selected-raster shader preview`,...r?.line===void 0?{}:{line:r.line},...r?.column===void 0?{}:{column:r.column}}}function vT(e=`preview apply was cancelled`){return _T(`preview-aborted`,e,`apply the current selection again`)}var yT=256,bT=256,xT=17;function ST(e){return[e.tapeDigest,e.workIndex,e.stage??`none`,e.shaderModuleId].join(`/`)}function CT(e){return e.pipelineKind===`render`?e.stage===null||e.stage===`compute`?y(_T(`preview-not-applicable`,`the selected shader has no raster stage`,`select vertex or fragment`)):e.entryPoint===null||e.source.trim()===``?y(_T(`preview-not-applicable`,`the selected shader is incomplete`,`select a recorded module with a source and entry point`)):v(e):y(_T(`preview-not-applicable`,`compute pipelines do not have a selected-raster preview`,`select a render work item`))}function wT(e){let t=e.stage===`vertex`?{source:e.source,entryPoint:e.entryPoint}:e.stages?.vertex,n=e.stage===`fragment`?{source:e.source,entryPoint:e.entryPoint}:e.stages?.fragment;return t===void 0||n===void 0||t.source.trim()===``||n.source.trim()===``||t.entryPoint===null||n.entryPoint===null?y(_T(`preview-pipeline-incompatible`,`the selected raster work has no paired vertex and fragment stage facts`,`select a pipeline with complete vertex and fragment module sources and entry points`)):v({vertex:{source:t.source,entryPoint:t.entryPoint},fragment:{source:n.source,entryPoint:n.entryPoint}})}var TT=class{generation=0;controller=null;disposed=!1;async apply(e,t,n={}){this.controller?.abort();let r=new AbortController;this.controller=r;let i=++this.generation,a=n.signal,o=()=>this.disposed||r.signal.aborted||a?.aborted===!0;if(o())return y(vT());let s=CT({...e,source:t});if(!s.ok)return s;if(n.backend===void 0&&(n.webgpuAvailable===!1||typeof navigator>`u`||navigator.gpu===void 0))return y(_T(`preview-not-applicable`,`WebGPU is unavailable for the temporary preview session`,`open the viewer in a WebGPU-capable browser`));let c=await hT(t);if(o())return y(vT());if(!c.ok)return y(_T(`preview-compile-failed`,c.error.message,c.error.hint,{...c.error.lineNum===void 0?{}:{line:c.error.lineNum},...c.error.linePos===void 0?{}:{column:c.error.linePos}}));let l=await gT(c.value);if(o())return y(vT());if(!l.ok)return y(_T(`preview-validation-failed`,l.error.message,l.error.hint,{...l.error.lineNum===void 0?{}:{line:l.error.lineNum},...l.error.linePos===void 0?{}:{column:l.error.linePos}}));let u=n.backend===void 0?await this.openBackend():v(n.backend);if(!u.ok)return u;if(o())return y(vT());let d=await this.renderPreview(s.value,u.value,o);if(!d.ok)return d;if(o())return y(vT());if(n.canvas!==void 0){let e=jT(n.canvas,d.value.pixels,yT,bT);if(!e.ok)return e}return v({provenance:`preview`,key:ST(s.value),generation:i,source:t,width:yT,height:bT,pixels:d.value.pixels,pixelDigest:MT(d.value.pixels)})}abort(){this.controller?.abort(),this.controller=null,this.generation+=1}dispose(){this.disposed=!0,this.abort()}async openBackend(){try{let e=await Bp.requestAdapter();if(!e.ok)return y(_T(`preview-not-applicable`,`${e.error.code}: ${e.error.hint}`,`open the viewer in a WebGPU-capable browser`));let t=await e.value.requestDevice();return t.ok?v({device:t.value,createShaderModule:Pp}):y(_T(`preview-not-applicable`,`${t.error.code}: ${t.error.hint}`,`open the viewer in a WebGPU-capable browser`))}catch(e){return y(_T(`preview-not-applicable`,e instanceof Error?e.message:String(e),`open the viewer in a WebGPU-capable browser`))}}async renderPreview(e,t,n){let r=e.work;if(r===void 0||r.pipeline.status!==`available`||r.pipeline.kind!==`render`)return y(_T(`preview-not-applicable`,`the selected work has no complete render pipeline facts`,`select a raster work with pipeline, attachment, and draw facts`));if(r.attachments===null||r.attachments.colorViewHandleIds.length===0)return y(_T(`preview-not-applicable`,`the selected work has no color attachment to preview`,`select a render work with a captured color attachment`));if(r.bindings.length>0||r.indexBuffer!==null)return y(_T(`preview-not-applicable`,`the selected work requires replayed bindings or an index buffer`,`select a work whose required resources are represented by the viewer-private preview seam`));let i=AT(r.pipeline.descriptor);if(i===null)return y(_T(`preview-not-applicable`,`the selected render pipeline has no supported primitive topology fact`,`select a render work with a supported raster topology`));let a=wT(e);if(!a.ok)return a;let o=ET(r.drawCall);if(!o.ok)return o;let{device:s}=t,c;try{if(n())return y(vT());let l=await t.createShaderModule(s,{code:a.value.vertex.source});if(!l.ok)return y(_T(`preview-compile-failed`,`${l.error.code}: ${l.error.hint}`,`fix the vertex WGSL diagnostics, then Apply again`));let u=await t.createShaderModule(s,{code:a.value.fragment.source});if(!u.ok)return y(_T(`preview-compile-failed`,`${u.error.code}: ${u.error.hint}`,`fix the fragment WGSL diagnostics, then Apply again`));if(n())return y(vT());let d=e.targetFormat??kT(r.pipeline.descriptor);if(d===null)return y(_T(`preview-not-applicable`,`the selected raster work has no captured color target format`,`select a render pipeline with a concrete color target format`));let f=s.createTexture({size:{width:yT,height:bT,depthOrArrayLayers:1},format:d,usage:xT,dimension:`2d`,mipLevelCount:1,sampleCount:1});if(!f.ok)return y(_T(`preview-pipeline-incompatible`,`${f.error.code}: ${f.error.hint}`,`select a renderable color target for the selected pipeline`));c=f.value;let p=s.createTextureView(c,{dimension:`2d`,aspect:`all`,baseMipLevel:0,mipLevelCount:1,baseArrayLayer:0,arrayLayerCount:1});if(!p.ok)return y(_T(`preview-pipeline-incompatible`,`${p.error.code}: ${p.error.hint}`,`select a renderable color target for the selected pipeline`));let m=s.createRenderPipeline({layout:`auto`,vertex:{module:l.value,entryPoint:a.value.vertex.entryPoint,buffers:[]},fragment:{module:u.value,entryPoint:a.value.fragment.entryPoint,targets:[{format:d}]},primitive:{topology:i}});if(!m.ok)return y(_T(`preview-pipeline-incompatible`,`${m.error.code}: ${m.error.hint}`,`select a pipeline compatible with the selected work preview facts`));let h=s.createCommandEncoder({});if(!h.ok)return y(_T(`preview-pipeline-incompatible`,`${h.error.code}: ${h.error.hint}`,`retry the isolated preview after the device is ready`));let g=h.value.beginRenderPass({colorAttachments:[{view:p.value,clearValue:{r:0,g:0,b:0,a:1},loadOp:`clear`,storeOp:`store`}]});g.setPipeline(m.value),g.draw(o.value.vertexCount,o.value.instanceCount,o.value.firstVertex,o.value.firstInstance),g.end();let _=h.value.finish();if(!_.ok)return y(_T(`preview-pipeline-incompatible`,`${_.error.code}: ${_.error.hint}`,`retry the isolated preview after the device is ready`));let b=s.queue.submit([_.value]);return b.ok?(await s.queue.onSubmittedWorkDone(),n()?y(vT()):v({pixels:await wl(s,c,yT,bT,{bytesPerTexel:4,mipLevel:0,baseArrayLayer:0,aspect:`all`})})):y(_T(`preview-pipeline-incompatible`,`${b.error.code}: ${b.error.hint}`,`retry the isolated preview after the device is ready`))}catch(e){return n()?y(vT()):y(_T(`preview-pipeline-incompatible`,e instanceof Error?e.message:String(e),`select a compatible raster pipeline or reset the editor`))}finally{c!==void 0&&s.destroyTexture(c)}}};function ET(e){if(typeof e!=`object`||!e||Array.isArray(e))return y(_T(`preview-not-applicable`,`the selected work has no structured non-indexed draw facts`,`select a direct render work with vertexCount and instanceCount`));let t=e;if(t.kind!==`draw`)return y(_T(`preview-not-applicable`,`the selected work uses ${typeof t.kind==`string`?t.kind:`an unknown command`} and cannot be reconstructed by the temporary seam`,`select a direct non-indexed draw work for local preview`));let n=(e,n)=>{let r=t[e];return r===void 0?n:typeof r==`number`&&Number.isSafeInteger(r)&&r>=0?r:null},r=n(`vertexCount`,0),i=n(`instanceCount`,1),a=n(`firstVertex`,0),o=n(`firstInstance`,0);return r===null||i===null||a===null||o===null||r===0||i===0?y(_T(`preview-not-applicable`,`the selected draw facts are missing a positive vertex or instance count`,`select a direct draw with complete non-zero counts`)):v({vertexCount:r,instanceCount:i,firstVertex:a,firstInstance:o})}function DT(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function OT(e){let t=DT(e);return DT(t?.desc)??t}function kT(e){let t=DT(OT(e)?.fragment),n=DT((Array.isArray(t?.targets)?t.targets:[])[0]);return typeof n?.format==`string`?n.format:null}function AT(e){let t=DT(OT(e)?.primitive)?.topology;return t===`point-list`||t===`line-list`||t===`line-strip`||t===`triangle-list`||t===`triangle-strip`?t:null}function jT(e,t,n,r){let i=e.getContext(`2d`);return i===null?y(_T(`preview-pipeline-incompatible`,`the preview canvas does not expose a 2D presentation context`,`use a browser canvas that supports 2D presentation`)):(e.width=n,e.height=r,i.putImageData(new ImageData(new Uint8ClampedArray(t),n,r),0,0),v(void 0))}function MT(e){let t=2166136261;for(let n of e)t^=n,t=Math.imul(t,16777619);return`fnv1a:${(t>>>0).toString(16)}`}var NT=1024,PT=0,FT=class{constructor(e,t){this.from=e,this.to=t}},IT=class{constructor(e={}){this.id=PT++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=zT.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};IT.closedBy=new IT({deserialize:e=>e.split(` `)}),IT.openedBy=new IT({deserialize:e=>e.split(` `)}),IT.group=new IT({deserialize:e=>e.split(` `)}),IT.isolate=new IT({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),IT.contextHash=new IT({perNode:!0}),IT.lookAhead=new IT({perNode:!0}),IT.mounted=new IT({perNode:!0});var LT=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[IT.mounted.id]}},RT=Object.create(null),zT=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):RT,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(IT.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(IT.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};zT.none=new zT(``,Object.create(null),0,8);var BT=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new zT(e.name,r,e.id,e.flags):e)}return new e(n)}},VT=new WeakMap,HT=new WeakMap,UT;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(UT||={});var WT=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=LT.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new iE(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new iE(VT.get(this)||this.topNode);return r.moveTo(e,t),VT.set(this,r._tree),r}get topNode(){return new XT(this,0,0,null)}resolve(e,t=0){let n=JT(VT.get(this)||this.topNode,e,t,!1);return VT.set(this,n),n}resolveInner(e,t=0){let n=JT(HT.get(this)||this.topNode,e,t,!0);return HT.set(this,n),n}resolveStack(e,t=0){return rE(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&UT.IncludeAnonymous)>0;for(let e=this.cursor(a|UT.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:lE(zT.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(zT.none,t,n,r)))}static build(e){return oE(e)}};WT.empty=new WT(zT.none,[],[],0);var GT=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},KT=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return zT.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(qT(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function qT(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function JT(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof XT&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:UT.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof XT&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var YT=class{cursor(e=0){return new iE(this,e)}getChild(e,t=null,n=null){let r=ZT(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return ZT(this,e,t,n)}resolve(e,t=0){return JT(this,e,t,!1)}resolveInner(e,t=0){return JT(this,e,t,!0)}matchContext(e){return QT(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},XT=class e extends YT{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&UT.EnterBracketed&&l instanceof WT&&(d=LT.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!qT(i,r,u,u+l.length))){if(l instanceof KT){if(a&UT.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new eE(new $T(o,l,t,u),null,e)}else if(a&UT.IncludeAnonymous||!l.type.isAnonymous||aE(l)){let s;if(!(a&UT.IgnoreMounts)&&(s=LT.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&UT.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&UT.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&UT.IgnoreOverlays)&&(i=LT.get(this._tree))&&i.overlay){let a=t-this.from,o=r&UT.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function ZT(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function QT(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var $T=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},eE=class e extends YT{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&UT.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new WT(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function tE(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof XT&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new nE(i,n)}var nE=class{constructor(e,t){this.heads=e,this.node=t}get next(){return tE(this.heads)}};function rE(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof XT?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=LT.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new XT(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(JT(o,t,n,!1))}}return i?tE(i):r}var iE=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~UT.EnterBracketed,e instanceof XT)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof XT?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&UT.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&UT.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&UT.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&UT.IncludeAnonymous||e instanceof KT||!e.type.isAnonymous||aE(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new eE(this.buffer,t,this.stack[e]);return this.bufferNode=new eE(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return QT(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return QT(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function aE(e){return e.children.some(e=>e instanceof KT||!e.type.isAnonymous||aE(e))}function oE(e){let{buffer:t,nodeSet:n,maxBufferLength:r=NT,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new GT(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,ee=c;if(w<0)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let E=s[x],D,te,ne=S-e;if(C-S<=r&&(te=h(o.pos-t,y))){let t=new Uint16Array(te.size-te.skip),r=o.pos-te.size,i=t.length;for(;o.pos>r;)i=g(te.start,t,i);D=new KT(t,C-te.start,n),ne=te.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,ee),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,ee),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(E,ee);D=lE(E,t,n,0,t.length,0,C-S,e,e)}else D=m(E,t,n,C-S,T-C,ee)}_.push(D),v.push(ne)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new KT(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof WT){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(IT.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[IT.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[IT.lookAhead,i];o=o?[e].concat(o):[e]}return new WT(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new WT(s[e.topID],_.reverse(),v.reverse(),y)}var sE=new WeakMap;function cE(e,t){if(!e.isAnonymous||t instanceof KT||t.type!=e)return 1;let n=sE.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof WT)){n=1;break}n+=cE(e,r)}sE.set(t,n)}return n}function lE(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=cE(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=cE(e,t[s]);for(s++;s<i;s++){let n=cE(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(lE(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var uE=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},dE=class{startParse(e,t,n){return typeof e==`string`&&(e=new fE(e)),n=n?n.length?n.map(e=>new FT(e.from,e.to)):[new FT(0,0)]:[new FT(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},fE=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new IT({perNode:!0});var pE=0,mE=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=pE++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new gE(e);return e=>e.modified.indexOf(t)>-1?e:gE.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},hE=0,gE=class e{constructor(e){this.name=e,this.instances=[],this.id=hE++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&_E(n,e.modified));if(r)return r;let i=[],a=new mE(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=vE(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function _E(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function vE(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function yE(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new xE(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return bE.add(t)}var bE=new IT({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new xE(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),xE=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};xE.empty=new xE([],2,null);function SE(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function CE(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function wE(e,t,n,r=0,i=e.length){let a=new TE(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var TE=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=EE(e)||xE.empty,u=CE(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(IT.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function EE(e){let t=e.type.prop(bE);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var Y=mE.define,DE=Y(),OE=Y(),kE=Y(OE),AE=Y(OE),jE=Y(),ME=Y(jE),NE=Y(jE),PE=Y(),FE=Y(PE),IE=Y(),LE=Y(),RE=Y(),zE=Y(RE),BE=Y(),X={comment:DE,lineComment:Y(DE),blockComment:Y(DE),docComment:Y(DE),name:OE,variableName:Y(OE),typeName:kE,tagName:Y(kE),propertyName:AE,attributeName:Y(AE),className:Y(OE),labelName:Y(OE),namespace:Y(OE),macroName:Y(OE),literal:jE,string:ME,docString:Y(ME),character:Y(ME),attributeValue:Y(ME),number:NE,integer:Y(NE),float:Y(NE),bool:Y(jE),regexp:Y(jE),escape:Y(jE),color:Y(jE),url:Y(jE),keyword:IE,self:Y(IE),null:Y(IE),atom:Y(IE),unit:Y(IE),modifier:Y(IE),operatorKeyword:Y(IE),controlKeyword:Y(IE),definitionKeyword:Y(IE),moduleKeyword:Y(IE),operator:LE,derefOperator:Y(LE),arithmeticOperator:Y(LE),logicOperator:Y(LE),bitwiseOperator:Y(LE),compareOperator:Y(LE),updateOperator:Y(LE),definitionOperator:Y(LE),typeOperator:Y(LE),controlOperator:Y(LE),punctuation:RE,separator:Y(RE),bracket:zE,angleBracket:Y(zE),squareBracket:Y(zE),paren:Y(zE),brace:Y(zE),content:PE,heading:FE,heading1:Y(FE),heading2:Y(FE),heading3:Y(FE),heading4:Y(FE),heading5:Y(FE),heading6:Y(FE),contentSeparator:Y(PE),list:Y(PE),quote:Y(PE),emphasis:Y(PE),strong:Y(PE),link:Y(PE),monospace:Y(PE),strikethrough:Y(PE),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:BE,documentMeta:Y(BE),annotation:Y(BE),processingInstruction:Y(BE),definition:mE.defineModifier(`definition`),constant:mE.defineModifier(`constant`),function:mE.defineModifier(`function`),standard:mE.defineModifier(`standard`),local:mE.defineModifier(`local`),special:mE.defineModifier(`special`)};for(let e in X){let t=X[e];t instanceof mE&&(t.name=e)}SE([{tag:X.link,class:`tok-link`},{tag:X.heading,class:`tok-heading`},{tag:X.emphasis,class:`tok-emphasis`},{tag:X.strong,class:`tok-strong`},{tag:X.keyword,class:`tok-keyword`},{tag:X.atom,class:`tok-atom`},{tag:X.bool,class:`tok-bool`},{tag:X.url,class:`tok-url`},{tag:X.labelName,class:`tok-labelName`},{tag:X.inserted,class:`tok-inserted`},{tag:X.deleted,class:`tok-deleted`},{tag:X.literal,class:`tok-literal`},{tag:X.string,class:`tok-string`},{tag:X.number,class:`tok-number`},{tag:[X.regexp,X.escape,X.special(X.string)],class:`tok-string2`},{tag:X.variableName,class:`tok-variableName`},{tag:X.local(X.variableName),class:`tok-variableName tok-local`},{tag:X.definition(X.variableName),class:`tok-variableName tok-definition`},{tag:X.special(X.variableName),class:`tok-variableName2`},{tag:X.definition(X.propertyName),class:`tok-propertyName tok-definition`},{tag:X.typeName,class:`tok-typeName`},{tag:X.namespace,class:`tok-namespace`},{tag:X.className,class:`tok-className`},{tag:X.macroName,class:`tok-macroName`},{tag:X.propertyName,class:`tok-propertyName`},{tag:X.operator,class:`tok-operator`},{tag:X.comment,class:`tok-comment`},{tag:X.meta,class:`tok-meta`},{tag:X.invalid,class:`tok-invalid`},{tag:X.punctuation,class:`tok-punctuation`}]);var VE=new IT;function HE(e){return W.define({combine:e?t=>t.concat(e):void 0})}var UE=new IT,WE=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,jh.prototype.hasOwnProperty(`tree`)||Object.defineProperty(jh.prototype,`tree`,{get(){return KE(this)}}),this.parser=t,this.extension=[tD.of(this),jh.languageData.of((e,t,n)=>{let r=GE(e,t,n),i=r.type.prop(VE);if(!i)return[];let a=e.facet(i),o=r.type.prop(UE);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return GE(e,t,n).type.prop(VE)==this.data}findRegions(e){let t=e.facet(tD);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(VE)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(IT.mounted);if(i){if(i.tree.prop(VE)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof WT&&r(i,e.positions[n]+t)}};return r(KE(e),0),n}get allowsNesting(){return!0}};WE.setState=gh.define();function GE(e,t,n){let r=e.facet(tD),i=KE(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,UT.ExcludeBuffers|UT.EnterBracketed))e.type.isTop&&(i=e);return i}function KE(e){let t=e.field(WE.state,!1);return t?t.tree:WT.empty}var qE=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},JE=null,YE=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],WT.empty,0,r,[],null)}startParse(){return this.parser.startParse(new qE(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=WT.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(uE.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(uE.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=JE;JE=this;try{return e()}finally{JE=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=XE(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=uE.applyChanges(r,e),i=WT.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=XE(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends dE{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=JE;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new WT(zT.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return JE}};function XE(e,t,n){return uE.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var ZE=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=YE.create(t.facet(tD).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};WE.state=Ym.define({create:ZE.init,update(e,t){for(let e of t.effects)if(e.is(WE.setState))return e.value;return t.startState.facet(tD)==t.state.facet(tD)?e.apply(t):ZE.init(t.state)}});var QE=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(QE=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var $E=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,eD=ev.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(WE.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(WE.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=QE(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(WE.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!$E?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>$E&&$E()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:WE.setState.of(new ZE(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>X_(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),tD=W.define({combine(e){return e.length?e[0]:null},enables:e=>[WE.state,eD,lx.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),nD=W.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function rD(e){let t=e.facet(nD);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}var iD=new IT,aD=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=ng.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof WE?e=>e.prop(VE)==a.data:a?e=>e==a:void 0,this.style=SE(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new ng(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},oD=W.define(),sD=W.define({combine(e){return e.length?[e[0]]:null}});function cD(e){let t=e.facet(oD);return t.length?t:e.facet(sD)}function lD(e,t){let n=[dD],r;return e instanceof aD&&(e.module&&n.push(lx.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(sD.of(e)):r?n.push(oD.computeN([lx.darkTheme],t=>t.facet(lx.darkTheme)==(r==`dark`)?[e]:[])):n.push(oD.of(e)),n}var uD=class{constructor(e){this.markCache=Object.create(null),this.tree=KE(e.state),this.decorations=this.buildDeco(e,cD(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=KE(e.state),n=cD(e.state),r=n!=cD(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ag.none;let n=new Bh;for(let{from:r,to:i}of e.visibleRanges)wE(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Ag.mark({class:r})))},r,i);return n.finish()}},dD=Qm.high(ev.fromClass(uD,{decorations:e=>e.decorations}));X.meta,X.link,X.heading,X.emphasis,X.strong,X.strikethrough,X.keyword,X.atom,X.bool,X.url,X.contentSeparator,X.labelName,X.literal,X.inserted,X.string,X.deleted,X.regexp,X.escape,X.string,X.variableName,X.variableName,X.typeName,X.namespace,X.className,X.variableName,X.macroName,X.propertyName,X.comment,X.invalid;function fD(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}var pD=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=fD(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??fD(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}};function mD(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||hD,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||CD,mergeTokens:e.mergeTokens!==!1}}function hD(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}var gD=new WeakMap,_D=class e extends WE{constructor(e){let t=HE(e.languageData),n=mD(e),r,i=new class extends dE{createParse(e,t,n){return new xD(r,e,t,n)}};super(t,i,[],e.name),this.topNode=ND(t,this),r=this,this.streamParser=n,this.stateAfter=new IT({perNode:!0}),this.tokenTable=e.tokenTable?new kD(n.tokenTable):AD}static define(t){return new e(t)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=gD.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=vD(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new pD(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)SD(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&gD.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}};function vD(e,t,n,r,i){let a=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let o=t.children[a],s=n+t.positions[a],c=o instanceof WT&&s<i&&vD(e,o,s,r,i);if(c)return c}return null}function yD(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&n==0&&t.type==e.topNode&&(i=!0);for(let a=t.children.length-1;a>=0;a--){let o=t.positions[a],s=t.children[a],c;if(o<r&&s instanceof WT){if(!(c=yD(e,s,n-o,r-o,i)))break;return i?new WT(t.type,t.children.slice(0,a).concat(c),t.positions.slice(0,a+1),o+c.length):c}}return null}function bD(e,t,n,r,i){for(let i of t){let t=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),o=t<=n&&a>n&&vD(e,i.tree,0-i.offset,n,a),s;if(o&&o.pos<=r&&(s=yD(e,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(i?rD(i):4),tree:WT.empty}}var xD=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=YE.get(),a=r[0].from,{state:o,tree:s}=bD(e,n,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(rD(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=YE.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
803
|
+
`.replace(`cloud_solar_cached_transmittance(samplePosition)`,`cloud_solar_transmittance(samplePosition)`);var lC={standard:`forgeax_material::standard`,unlit:`forgeax_material::unlit`,sprite:`forgeax_material::sprite`};lC.standard,lC.unlit,lC.sprite,Object.freeze([`box_project`,`sampleReflectionProbeSpecular`]);var uC=e({ParsedModule:()=>dC,RhiWgpuAdapter:()=>fC,RhiWgpuBindGroup:()=>pC,RhiWgpuBindGroupLayout:()=>mC,RhiWgpuBuffer:()=>hC,RhiWgpuCommandBuffer:()=>gC,RhiWgpuCommandEncoder:()=>_C,RhiWgpuComputePass:()=>vC,RhiWgpuComputePipeline:()=>yC,RhiWgpuDevice:()=>bC,RhiWgpuInstance:()=>xC,RhiWgpuPipelineLayout:()=>SC,RhiWgpuQuerySet:()=>CC,RhiWgpuQueue:()=>wC,RhiWgpuRenderBundle:()=>TC,RhiWgpuRenderBundleEncoder:()=>EC,RhiWgpuRenderPass:()=>DC,RhiWgpuRenderPipeline:()=>OC,RhiWgpuSampler:()=>kC,RhiWgpuShaderModule:()=>AC,RhiWgpuSurface:()=>jC,RhiWgpuSurfaceTexture:()=>MC,RhiWgpuTexture:()=>NC,RhiWgpuTextureView:()=>PC,ValidatedModule:()=>FC,compose_shader:()=>IC,default:()=>iT,emit_reflection:()=>LC,initSync:()=>rT,parse:()=>RC,start:()=>zC,validate:()=>BC,validate_render_entries:()=>VC}),dC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,KC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,KC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_parsedmodule_free(e,0)}};Symbol.dispose&&(dC.prototype[Symbol.dispose]=dC.prototype.free);var fC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,qC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,qC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuadapter_free(e,0)}get features(){return J.rhiwgpuadapter_features(this.__wbg_ptr)}requestDevice(e){return J.rhiwgpuadapter_requestDevice(this.__wbg_ptr,e)}};Symbol.dispose&&(fC.prototype[Symbol.dispose]=fC.prototype.free);var pC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,JC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,JC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpubindgroup_free(e,0)}};Symbol.dispose&&(pC.prototype[Symbol.dispose]=pC.prototype.free);var mC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,YC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,YC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpubindgrouplayout_free(e,0)}get forgeaxToken(){return J.rhiwgpubindgrouplayout_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(mC.prototype[Symbol.dispose]=mC.prototype.free);var hC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,XC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,XC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpubuffer_free(e,0)}destroy(){J.rhiwgpubuffer_destroy(this.__wbg_ptr)}get forgeaxToken(){return J.rhiwgpubuffer_forgeaxToken(this.__wbg_ptr)>>>0}getMappedRange(e,t){let n=J.rhiwgpubuffer_getMappedRange(this.__wbg_ptr,!K(e),K(e)?BigInt(0):e,!K(t),K(t)?BigInt(0):t);if(n[2])throw q(n[1]);return q(n[0])}mapAsync(e,t,n){return J.rhiwgpubuffer_mapAsync(this.__wbg_ptr,e,!K(t),K(t)?BigInt(0):t,!K(n),K(n)?BigInt(0):n)}unmap(){J.rhiwgpubuffer_unmap(this.__wbg_ptr)}};Symbol.dispose&&(hC.prototype[Symbol.dispose]=hC.prototype.free);var gC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,ZC.register(n,n.__wbg_ptr,n),n}static __unwrap(t){return t instanceof e?t.__destroy_into_raw():0}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ZC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucommandbuffer_free(e,0)}};Symbol.dispose&&(gC.prototype[Symbol.dispose]=gC.prototype.free);var _C=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,QC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,QC.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucommandencoder_free(e,0)}beginComputePass(e){let t=J.rhiwgpucommandencoder_beginComputePass(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return vC.__wrap(t[0])}beginRenderPass(e){let t=J.rhiwgpucommandencoder_beginRenderPass(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return DC.__wrap(t[0])}clearBuffer(e,t,n){vw(e,hC),J.rhiwgpucommandencoder_clearBuffer(this.__wbg_ptr,e.__wbg_ptr,!K(t),K(t)?BigInt(0):t,!K(n),K(n)?BigInt(0):n)}copyBufferToBuffer(e,t,n,r,i){vw(e,hC),vw(n,hC),J.rhiwgpucommandencoder_copyBufferToBuffer(this.__wbg_ptr,e.__wbg_ptr,t,n.__wbg_ptr,r,i)}copyBufferToTexture(e,t,n,r,i,a,o,s,c,l,u,d,f){vw(e,hC),vw(i,NC),J.rhiwgpucommandencoder_copyBufferToTexture(this.__wbg_ptr,e.__wbg_ptr,t,K(n)?2**53-1:n>>>0,K(r)?2**53-1:r>>>0,i.__wbg_ptr,a,o,s,c,l,u,d,f)}copyTextureToBuffer(e,t,n,r,i,a,o,s,c,l,u,d,f){vw(e,NC),vw(o,hC),J.rhiwgpucommandencoder_copyTextureToBuffer(this.__wbg_ptr,e.__wbg_ptr,t,n,r,i,a,o.__wbg_ptr,s,K(c)?2**53-1:c>>>0,K(l)?2**53-1:l>>>0,u,d,f)}copyTextureToTexture(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){vw(e,NC),vw(o,NC),J.rhiwgpucommandencoder_copyTextureToTexture(this.__wbg_ptr,e.__wbg_ptr,t,n,r,i,a,o.__wbg_ptr,s,c,l,u,d,f,p,m)}finish(){let e=J.rhiwgpucommandencoder_finish(this.__wbg_ptr);return gC.__wrap(e)}insertDebugMarker(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpucommandencoder_insertDebugMarker(this.__wbg_ptr,t,n)}popDebugGroup(){J.rhiwgpucommandencoder_popDebugGroup(this.__wbg_ptr)}pushDebugGroup(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpucommandencoder_pushDebugGroup(this.__wbg_ptr,t,n)}resolveQuerySet(e,t,n,r,i){vw(e,CC),vw(r,hC),J.rhiwgpucommandencoder_resolveQuerySet(this.__wbg_ptr,e.__wbg_ptr,t,n,r.__wbg_ptr,i)}};Symbol.dispose&&(_C.prototype[Symbol.dispose]=_C.prototype.free);var vC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,$C.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,$C.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucomputepass_free(e,0)}dispatchWorkgroups(e,t,n){J.rhiwgpucomputepass_dispatchWorkgroups(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,K(n)?2**53-1:n>>>0)}dispatchWorkgroupsIndirect(e,t){vw(e,hC),J.rhiwgpucomputepass_dispatchWorkgroupsIndirect(this.__wbg_ptr,e.__wbg_ptr,t)}end(){J.rhiwgpucomputepass_end(this.__wbg_ptr)}setBindGroup(e,t,n){vw(t,pC),J.rhiwgpucomputepass_setBindGroup(this.__wbg_ptr,e,t.__wbg_ptr,n)}setPipeline(e){vw(e,yC),J.rhiwgpucomputepass_setPipeline(this.__wbg_ptr,e.__wbg_ptr)}};Symbol.dispose&&(vC.prototype[Symbol.dispose]=vC.prototype.free);var yC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,ew.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ew.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpucomputepipeline_free(e,0)}};Symbol.dispose&&(yC.prototype[Symbol.dispose]=yC.prototype.free);var bC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,tw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,tw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpudevice_free(e,0)}createBindGroup(e){let t=J.rhiwgpudevice_createBindGroup(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return pC.__wrap(t[0])}createBindGroupLayout(e){let t=J.rhiwgpudevice_createBindGroupLayout(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return mC.__wrap(t[0])}createBuffer(e){let t=J.rhiwgpudevice_createBuffer(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return hC.__wrap(t[0])}createCommandEncoder(e){let t=J.rhiwgpudevice_createCommandEncoder(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return _C.__wrap(t[0])}createComputePipeline(e,t,n){vw(t,AC);let r=0;K(n)||(vw(n,SC),r=n.__destroy_into_raw());let i=J.rhiwgpudevice_createComputePipeline(this.__wbg_ptr,e,t.__wbg_ptr,r);if(i[2])throw q(i[1]);return yC.__wrap(i[0])}createPipelineLayout(e){let t=J.rhiwgpudevice_createPipelineLayout(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return SC.__wrap(t[0])}createQuerySet(e){let t=J.rhiwgpudevice_createQuerySet(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return CC.__wrap(t[0])}createRenderBundleEncoder(e){let t=J.rhiwgpudevice_createRenderBundleEncoder(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return EC.__wrap(t[0])}createRenderPipeline(e){let t=J.rhiwgpudevice_createRenderPipeline(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return OC.__wrap(t[0])}createSampler(e){let t=J.rhiwgpudevice_createSampler(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return kC.__wrap(t[0])}createShaderModule(e){let t=J.rhiwgpudevice_createShaderModule(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return AC.__wrap(t[0])}createTexture(e){let t=J.rhiwgpudevice_createTexture(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return NC.__wrap(t[0])}createTextureView(e,t){vw(e,NC);let n=J.rhiwgpudevice_createTextureView(this.__wbg_ptr,e.__wbg_ptr,t);if(n[2])throw q(n[1]);return PC.__wrap(n[0])}get forgeaxToken(){return J.rhiwgpudevice_forgeaxToken(this.__wbg_ptr)>>>0}get limits(){return J.rhiwgpudevice_limits(this.__wbg_ptr)}get queue(){let e=J.rhiwgpudevice_queue(this.__wbg_ptr);return wC.__wrap(e)}registerLostCallback(e){J.rhiwgpudevice_registerLostCallback(this.__wbg_ptr,e)}get surfaceViewFormats(){return J.rhiwgpudevice_surfaceViewFormats(this.__wbg_ptr)!==0}};Symbol.dispose&&(bC.prototype[Symbol.dispose]=bC.prototype.free);var xC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,nw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,nw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuinstance_free(e,0)}static create(){return J.rhiwgpuinstance_create()}createSurface(e){let t=J.rhiwgpuinstance_createSurface(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return jC.__wrap(t[0])}requestAdapter(){return J.rhiwgpuinstance_requestAdapter(this.__wbg_ptr)}requestAdapterWithCanvas(e){return J.rhiwgpuinstance_requestAdapterWithCanvas(this.__wbg_ptr,e)}};Symbol.dispose&&(xC.prototype[Symbol.dispose]=xC.prototype.free);var SC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,rw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,rw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpupipelinelayout_free(e,0)}get forgeaxToken(){return J.rhiwgpupipelinelayout_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(SC.prototype[Symbol.dispose]=SC.prototype.free);var CC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,iw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,iw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuqueryset_free(e,0)}};Symbol.dispose&&(CC.prototype[Symbol.dispose]=CC.prototype.free);var wC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,aw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,aw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpuqueue_free(e,0)}submit(e){let t=J.rhiwgpuqueue_submit(this.__wbg_ptr,e);if(t[1])throw q(t[0])}writeBuffer(e,t,n,r,i){vw(e,hC);let a=qw(n,J.__wbindgen_malloc),o=eT;J.rhiwgpuqueue_writeBuffer(this.__wbg_ptr,e.__wbg_ptr,t,a,o,!K(r),K(r)?BigInt(0):r,!K(i),K(i)?BigInt(0):i)}writeTexture(e,t,n,r,i,a,o,s,c,l,u,d,f){vw(e,NC);let p=qw(o,J.__wbindgen_malloc),m=eT;J.rhiwgpuqueue_writeTexture(this.__wbg_ptr,e.__wbg_ptr,t,n,r,i,a,p,m,s,K(c)?2**53-1:c>>>0,K(l)?2**53-1:l>>>0,u,d,f)}};Symbol.dispose&&(wC.prototype[Symbol.dispose]=wC.prototype.free);var TC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,ow.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ow.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderbundle_free(e,0)}get forgeaxToken(){return J.rhiwgpurenderbundle_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(TC.prototype[Symbol.dispose]=TC.prototype.free);var EC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,sw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,sw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderbundleencoder_free(e,0)}draw(e,t,n,r){let i=J.rhiwgpurenderbundleencoder_draw(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,K(n)?2**53-1:n>>>0,K(r)?2**53-1:r>>>0);if(i[1])throw q(i[0])}drawIndexed(e,t,n,r,i){let a=J.rhiwgpurenderbundleencoder_drawIndexed(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,K(n)?2**53-1:n>>>0,K(r)?2**53-1:r>>0,K(i)?2**53-1:i>>>0);if(a[1])throw q(a[0])}drawIndexedIndirect(e,t){vw(e,hC);let n=J.rhiwgpurenderbundleencoder_drawIndexedIndirect(this.__wbg_ptr,e.__wbg_ptr,t);if(n[1])throw q(n[0])}drawIndirect(e,t){vw(e,hC);let n=J.rhiwgpurenderbundleencoder_drawIndirect(this.__wbg_ptr,e.__wbg_ptr,t);if(n[1])throw q(n[0])}finish(e){let t=J.rhiwgpurenderbundleencoder_finish(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return TC.__wrap(t[0])}insertDebugMarker(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT,r=J.rhiwgpurenderbundleencoder_insertDebugMarker(this.__wbg_ptr,t,n);if(r[1])throw q(r[0])}popDebugGroup(){let e=J.rhiwgpurenderbundleencoder_popDebugGroup(this.__wbg_ptr);if(e[1])throw q(e[0])}pushDebugGroup(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT,r=J.rhiwgpurenderbundleencoder_pushDebugGroup(this.__wbg_ptr,t,n);if(r[1])throw q(r[0])}setBindGroup(e,t,n,r,i){vw(t,pC);let a=J.rhiwgpurenderbundleencoder_setBindGroup(this.__wbg_ptr,e,t.__wbg_ptr,n,K(r)?2**53-1:r>>>0,K(i)?2**53-1:i>>>0);if(a[1])throw q(a[0])}setIndexBuffer(e,t,n,r){vw(e,hC);let i=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT,o=J.rhiwgpurenderbundleencoder_setIndexBuffer(this.__wbg_ptr,e.__wbg_ptr,i,a,!K(n),K(n)?BigInt(0):n,!K(r),K(r)?BigInt(0):r);if(o[1])throw q(o[0])}setPipeline(e){vw(e,OC);let t=J.rhiwgpurenderbundleencoder_setPipeline(this.__wbg_ptr,e.__wbg_ptr);if(t[1])throw q(t[0])}setVertexBuffer(e,t,n,r){vw(t,hC);let i=J.rhiwgpurenderbundleencoder_setVertexBuffer(this.__wbg_ptr,e,t.__wbg_ptr,!K(n),K(n)?BigInt(0):n,!K(r),K(r)?BigInt(0):r);if(i[1])throw q(i[0])}};Symbol.dispose&&(EC.prototype[Symbol.dispose]=EC.prototype.free);var DC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,cw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,cw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderpass_free(e,0)}beginOcclusionQuery(e){J.rhiwgpurenderpass_beginOcclusionQuery(this.__wbg_ptr,e)}draw(e,t,n,r){J.rhiwgpurenderpass_draw(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,n,r)}drawIndexed(e,t,n,r,i){J.rhiwgpurenderpass_drawIndexed(this.__wbg_ptr,e,K(t)?2**53-1:t>>>0,n,r,i)}drawIndexedIndirect(e,t){vw(e,hC),J.rhiwgpurenderpass_drawIndexedIndirect(this.__wbg_ptr,e.__wbg_ptr,t)}drawIndirect(e,t){vw(e,hC),J.rhiwgpurenderpass_drawIndirect(this.__wbg_ptr,e.__wbg_ptr,t)}end(){J.rhiwgpurenderpass_end(this.__wbg_ptr)}endOcclusionQuery(){J.rhiwgpurenderpass_endOcclusionQuery(this.__wbg_ptr)}executeBundles(e){let t=J.rhiwgpurenderpass_executeBundles(this.__wbg_ptr,e);if(t[1])throw q(t[0])}insertDebugMarker(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpurenderpass_insertDebugMarker(this.__wbg_ptr,t,n)}popDebugGroup(){J.rhiwgpurenderpass_popDebugGroup(this.__wbg_ptr)}pushDebugGroup(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT;J.rhiwgpurenderpass_pushDebugGroup(this.__wbg_ptr,t,n)}setBindGroup(e,t,n,r,i){vw(t,pC),J.rhiwgpurenderpass_setBindGroup(this.__wbg_ptr,e,t.__wbg_ptr,n,K(r)?2**53-1:r>>>0,K(i)?2**53-1:i>>>0)}setBlendConstant(e){J.rhiwgpurenderpass_setBlendConstant(this.__wbg_ptr,e)}setIndexBuffer(e,t,n,r){vw(e,hC);let i=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;J.rhiwgpurenderpass_setIndexBuffer(this.__wbg_ptr,e.__wbg_ptr,i,a,!K(n),K(n)?BigInt(0):n,!K(r),K(r)?BigInt(0):r)}setPipeline(e){vw(e,OC),J.rhiwgpurenderpass_setPipeline(this.__wbg_ptr,e.__wbg_ptr)}setScissorRect(e,t,n,r){J.rhiwgpurenderpass_setScissorRect(this.__wbg_ptr,e,t,n,r)}setStencilReference(e){J.rhiwgpurenderpass_setStencilReference(this.__wbg_ptr,e)}setVertexBuffer(e,t,n,r){vw(t,hC),J.rhiwgpurenderpass_setVertexBuffer(this.__wbg_ptr,e,t.__wbg_ptr,n,!K(r),K(r)?BigInt(0):r)}setViewport(e,t,n,r,i,a){J.rhiwgpurenderpass_setViewport(this.__wbg_ptr,e,t,n,r,i,a)}};Symbol.dispose&&(DC.prototype[Symbol.dispose]=DC.prototype.free);var OC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,lw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,lw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpurenderpipeline_free(e,0)}};Symbol.dispose&&(OC.prototype[Symbol.dispose]=OC.prototype.free);var kC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,uw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,uw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpusampler_free(e,0)}get forgeaxResourceKind(){let e,t;try{let n=J.rhiwgpusampler_forgeaxResourceKind(this.__wbg_ptr);return e=n[0],t=n[1],Rw(n[0],n[1])}finally{J.__wbindgen_free(e,t,1)}}get forgeaxToken(){return J.rhiwgpusampler_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(kC.prototype[Symbol.dispose]=kC.prototype.free);var AC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,dw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,dw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpushadermodule_free(e,0)}get forgeaxToken(){return J.rhiwgpushadermodule_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(AC.prototype[Symbol.dispose]=AC.prototype.free);var jC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,fw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,fw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpusurface_free(e,0)}configure(e){let t=J.rhiwgpusurface_configure(this.__wbg_ptr,e);if(t[1])throw q(t[0])}getCurrentTexture(){let e=J.rhiwgpusurface_getCurrentTexture(this.__wbg_ptr);if(e[2])throw q(e[1]);return MC.__wrap(e[0])}probeSurfacePresentation(){let e=J.rhiwgpusurface_probeSurfacePresentation(this.__wbg_ptr);if(e[2])throw q(e[1]);return q(e[0])}};Symbol.dispose&&(jC.prototype[Symbol.dispose]=jC.prototype.free);var MC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,pw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,pw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgpusurfacetexture_free(e,0)}getTexture(){let e=J.rhiwgpusurfacetexture_getTexture(this.__wbg_ptr);return NC.__wrap(e)}present(){let e=J.rhiwgpusurfacetexture_present(this.__wbg_ptr);if(e[1])throw q(e[0])}};Symbol.dispose&&(MC.prototype[Symbol.dispose]=MC.prototype.free);var NC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,mw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,mw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgputexture_free(e,0)}createView(e){let t=J.rhiwgputexture_createView(this.__wbg_ptr,e);if(t[2])throw q(t[1]);return PC.__wrap(t[0])}get depthOrArrayLayers(){return J.rhiwgputexture_depthOrArrayLayers(this.__wbg_ptr)>>>0}destroy(){J.rhiwgputexture_destroy(this.__wbg_ptr)}get height(){return J.rhiwgputexture_height(this.__wbg_ptr)>>>0}get width(){return J.rhiwgputexture_width(this.__wbg_ptr)>>>0}};Symbol.dispose&&(NC.prototype[Symbol.dispose]=NC.prototype.free);var PC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,hw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,hw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_rhiwgputextureview_free(e,0)}get forgeaxResourceKind(){let e,t;try{let n=J.rhiwgputextureview_forgeaxResourceKind(this.__wbg_ptr);return e=n[0],t=n[1],Rw(n[0],n[1])}finally{J.__wbindgen_free(e,t,1)}}get forgeaxToken(){return J.rhiwgputextureview_forgeaxToken(this.__wbg_ptr)>>>0}};Symbol.dispose&&(PC.prototype[Symbol.dispose]=PC.prototype.free);var FC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,gw.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,gw.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_validatedmodule_free(e,0)}};Symbol.dispose&&(FC.prototype[Symbol.dispose]=FC.prototype.free);function IC(e,t,n){let r,i;try{let s=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),c=eT,l=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),u=eT,d=Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),f=eT,p=J.compose_shader(s,c,l,u,d,f);var a=p[0],o=p[1];if(p[3])throw a=0,o=0,q(p[2]);return r=a,i=o,Rw(a,o)}finally{J.__wbindgen_free(r,i,1)}}function LC(e,t){let n,r;try{vw(e,FC);let o=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),s=eT,c=J.emit_reflection(e.__wbg_ptr,o,s);var i=c[0],a=c[1];if(c[3])throw i=0,a=0,q(c[2]);return n=i,r=a,Rw(i,a)}finally{J.__wbindgen_free(n,r,1)}}function RC(e){let t=Jw(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=eT,r=J.parse(t,n);if(r[2])throw q(r[1]);return dC.__wrap(r[0])}function zC(){J.start()}function BC(e){vw(e,dC);var t=e.__destroy_into_raw();let n=J.validate(t);if(n[2])throw q(n[1]);return FC.__wrap(n[0])}function VC(e,t,n,r){vw(e,FC);let i=Jw(t,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;var o=K(n)?0:Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),s=eT,c=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),l=eT;let u=J.validate_render_entries(e.__wbg_ptr,i,a,o,s,c,l);if(u[1])throw q(u[0])}function HC(){return{__proto__:null,"./wgpu_wasm_bg.js":{__proto__:null,__wbg_Error_bce6d499ff0a4aff:function(e,t){return Error(Rw(e,t))},__wbg_Number_b7972a139bfbfdf0:function(e){return Number(e)},__wbg_String_8564e559799eccda:function(e,t){let n=Jw(String(t),J.__wbindgen_malloc,J.__wbindgen_realloc),r=eT;kw().setInt32(e+4,r,!0),kw().setInt32(e+0,n,!0)},__wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83:function(e,t){let n=t,r=typeof n==`bigint`?n:void 0;kw().setBigInt64(e+8,K(r)?BigInt(0):r,!0),kw().setInt32(e+0,!K(r),!0)},__wbg___wbindgen_boolean_get_2304fb8c853028c8:function(e){let t=e,n=typeof t==`boolean`?t:void 0;return K(n)?16777215:+!!n},__wbg___wbindgen_debug_string_edece8177ad01481:function(e,t){let n=Jw(bw(t),J.__wbindgen_malloc,J.__wbindgen_realloc),r=eT;kw().setInt32(e+4,r,!0),kw().setInt32(e+0,n,!0)},__wbg___wbindgen_in_07056af4f902c445:function(e,t){return e in t},__wbg___wbindgen_is_bigint_aeae3893f30ed54e:function(e){return typeof e==`bigint`},__wbg___wbindgen_is_function_5cd60d5cf78b4eef:function(e){return typeof e==`function`},__wbg___wbindgen_is_null_2042690d351e14f0:function(e){return e===null},__wbg___wbindgen_is_object_b4593df85baada48:function(e){let t=e;return typeof t==`object`&&!!t},__wbg___wbindgen_is_string_dde0fd9020db4434:function(e){return typeof e==`string`},__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c:function(e,t){return e==t},__wbg___wbindgen_number_get_f73a1244370fcc2c:function(e,t){let n=t,r=typeof n==`number`?n:void 0;kw().setFloat64(e+8,K(r)?0:r,!0),kw().setInt32(e+0,!K(r),!0)},__wbg___wbindgen_string_get_d109740c0d18f4d7:function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_9c31b086c2b26051:function(e,t){throw Error(Rw(e,t))},__wbg__wbg_cb_unref_3fa391f3fcdb55f8:function(e){e._wbg_cb_unref()},__wbg_activeTexture_37cff0753870753b:function(e,t){e.activeTexture(t>>>0)},__wbg_activeTexture_4d2afad7cfda1396:function(e,t){e.activeTexture(t>>>0)},__wbg_add_07a7ab95134233b9:function(e,t){return e.add(t)},__wbg_attachShader_0a37c762590e5e1c:function(e,t,n){e.attachShader(t,n)},__wbg_attachShader_515800f4051247dc:function(e,t,n){e.attachShader(t,n)},__wbg_beginQuery_6c6c5b6d0d8a2c72:function(e,t,n){e.beginQuery(t>>>0,n)},__wbg_bindAttribLocation_07b2841d89fca977:function(e,t,n,r,i){e.bindAttribLocation(t,n>>>0,Rw(r,i))},__wbg_bindAttribLocation_1bbbcdee8d08ba2a:function(e,t,n,r,i){e.bindAttribLocation(t,n>>>0,Rw(r,i))},__wbg_bindBufferRange_b3fd6bf5761eb1af:function(e,t,n,r,i,a){e.bindBufferRange(t>>>0,n>>>0,r,i,a)},__wbg_bindBuffer_1a31fd3809dc22c8:function(e,t,n){e.bindBuffer(t>>>0,n)},__wbg_bindBuffer_4bf3ab31e8e200ed:function(e,t,n){e.bindBuffer(t>>>0,n)},__wbg_bindFramebuffer_751e5064f23ee1c4:function(e,t,n){e.bindFramebuffer(t>>>0,n)},__wbg_bindFramebuffer_92449a44405b6557:function(e,t,n){e.bindFramebuffer(t>>>0,n)},__wbg_bindRenderbuffer_1742855b643a7566:function(e,t,n){e.bindRenderbuffer(t>>>0,n)},__wbg_bindRenderbuffer_c46a8b6f3f8ba246:function(e,t,n){e.bindRenderbuffer(t>>>0,n)},__wbg_bindSampler_708d9901a5e548b8:function(e,t,n){e.bindSampler(t>>>0,n)},__wbg_bindTexture_7fd7f85d6f942f6f:function(e,t,n){e.bindTexture(t>>>0,n)},__wbg_bindTexture_85abbde679bce760:function(e,t,n){e.bindTexture(t>>>0,n)},__wbg_bindVertexArrayOES_fb7e8c5e8e106919:function(e,t){e.bindVertexArrayOES(t)},__wbg_bindVertexArray_f8587a616356d307:function(e,t){e.bindVertexArray(t)},__wbg_blendColor_82716e22a8f522ff:function(e,t,n,r,i){e.blendColor(t,n,r,i)},__wbg_blendColor_f877221c780bdbaf:function(e,t,n,r,i){e.blendColor(t,n,r,i)},__wbg_blendEquationSeparate_946c10181ab6c6cf:function(e,t,n){e.blendEquationSeparate(t>>>0,n>>>0)},__wbg_blendEquationSeparate_985f782fb54b29fe:function(e,t,n){e.blendEquationSeparate(t>>>0,n>>>0)},__wbg_blendEquation_519c57992eed79c1:function(e,t){e.blendEquation(t>>>0)},__wbg_blendEquation_f496fde4a67ecc1e:function(e,t){e.blendEquation(t>>>0)},__wbg_blendFuncSeparate_6f525092629a20ae:function(e,t,n,r,i){e.blendFuncSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_blendFuncSeparate_ea29c928bc1c4984:function(e,t,n,r,i){e.blendFuncSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_blendFunc_2e7b7adf253717a0:function(e,t,n){e.blendFunc(t>>>0,n>>>0)},__wbg_blendFunc_d29c837f8be35d6e:function(e,t,n){e.blendFunc(t>>>0,n>>>0)},__wbg_blitFramebuffer_8fd7726fe3c57e1a:function(e,t,n,r,i,a,o,s,c,l,u){e.blitFramebuffer(t,n,r,i,a,o,s,c,l>>>0,u>>>0)},__wbg_bufferData_74a0b79b4c9d8f96:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_886f34df840b0814:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_aebf4ed69e98d559:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferData_e8afecf0042a3eb9:function(e,t,n,r){e.bufferData(t>>>0,n,r>>>0)},__wbg_bufferSubData_0e5936ef36f518d2:function(e,t,n,r){e.bufferSubData(t>>>0,n,r)},__wbg_bufferSubData_ca02a13879fa62e8:function(e,t,n,r){e.bufferSubData(t>>>0,n,r)},__wbg_buffer_8d6798e32d1afd34:function(e){return e.buffer},__wbg_call_13665d9f14390edc:function(){return Gw(function(e,t){return e.call(t)},arguments)},__wbg_call_dfde26266607c996:function(){return Gw(function(e,t,n){return e.call(t,n)},arguments)},__wbg_call_faa0a261f288f846:function(){return Gw(function(e,t,n,r){return e.call(t,n,r)},arguments)},__wbg_clearBufferfv_a0bddf84cc04ef84:function(e,t,n,r,i){e.clearBufferfv(t>>>0,n,xw(r,i))},__wbg_clearBufferiv_9a3f2d1ec3f2296f:function(e,t,n,r,i){e.clearBufferiv(t>>>0,n,Cw(r,i))},__wbg_clearBufferuiv_d52433002e7330f8:function(e,t,n,r,i){e.clearBufferuiv(t>>>0,n,Ew(r,i))},__wbg_clearDepth_1eae37358a24b9db:function(e,t){e.clearDepth(t)},__wbg_clearDepth_f42ada4795e5a943:function(e,t){e.clearDepth(t)},__wbg_clearStencil_999f2e1ef49323e6:function(e,t){e.clearStencil(t)},__wbg_clearStencil_a58c15a1dcbf1fbe:function(e,t){e.clearStencil(t)},__wbg_clear_252bb7b11d5bea06:function(e,t){e.clear(t>>>0)},__wbg_clear_7d0a8d124c2a4b66:function(e,t){e.clear(t>>>0)},__wbg_clientWaitSync_fb0623a14def0f1e:function(e,t,n,r){return e.clientWaitSync(t,n>>>0,r>>>0)},__wbg_colorMask_0f86a23bfc7696a7:function(e,t,n,r,i){e.colorMask(t!==0,n!==0,r!==0,i!==0)},__wbg_colorMask_2d4b38c34bf55a02:function(e,t,n,r,i){e.colorMask(t!==0,n!==0,r!==0,i!==0)},__wbg_compileShader_a20e7b68d3edcd8a:function(e,t){e.compileShader(t)},__wbg_compileShader_b77bd79d00a03b02:function(e,t){e.compileShader(t)},__wbg_compressedTexSubImage2D_12adc86b34c12d28:function(e,t,n,r,i,a,o,s,c){e.compressedTexSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c)},__wbg_compressedTexSubImage2D_5336c9efcad92150:function(e,t,n,r,i,a,o,s,c){e.compressedTexSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c)},__wbg_compressedTexSubImage2D_7eb545d3f1d37773:function(e,t,n,r,i,a,o,s,c,l){e.compressedTexSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c,l)},__wbg_compressedTexSubImage3D_1bca0af82425d03d:function(e,t,n,r,i,a,o,s,c,l,u,d){e.compressedTexSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u,d)},__wbg_compressedTexSubImage3D_7f820492cb5a6d5e:function(e,t,n,r,i,a,o,s,c,l,u){e.compressedTexSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u)},__wbg_copyBufferSubData_8855e4c7f24415d6:function(e,t,n,r,i,a){e.copyBufferSubData(t>>>0,n>>>0,r,i,a)},__wbg_copyTexSubImage2D_68eb6addf3f910bb:function(e,t,n,r,i,a,o,s,c){e.copyTexSubImage2D(t>>>0,n,r,i,a,o,s,c)},__wbg_copyTexSubImage2D_c56507367f94e004:function(e,t,n,r,i,a,o,s,c){e.copyTexSubImage2D(t>>>0,n,r,i,a,o,s,c)},__wbg_copyTexSubImage3D_7f30d563975b3710:function(e,t,n,r,i,a,o,s,c,l){e.copyTexSubImage3D(t>>>0,n,r,i,a,o,s,c,l)},__wbg_createBuffer_1c3448547584bc5a:function(e){let t=e.createBuffer();return K(t)?0:_w(t)},__wbg_createBuffer_77da03de0620a199:function(e){let t=e.createBuffer();return K(t)?0:_w(t)},__wbg_createFramebuffer_22f50a7a9f8afdf0:function(e){let t=e.createFramebuffer();return K(t)?0:_w(t)},__wbg_createFramebuffer_73699dac20f72ffb:function(e){let t=e.createFramebuffer();return K(t)?0:_w(t)},__wbg_createProgram_a175fc4c32429a24:function(e){let t=e.createProgram();return K(t)?0:_w(t)},__wbg_createProgram_c9d6396ea0bc7522:function(e){let t=e.createProgram();return K(t)?0:_w(t)},__wbg_createQuery_5d92b56f0ca718af:function(e){let t=e.createQuery();return K(t)?0:_w(t)},__wbg_createRenderbuffer_483c206d1b62e6bd:function(e){let t=e.createRenderbuffer();return K(t)?0:_w(t)},__wbg_createRenderbuffer_f26e2b467988cc7e:function(e){let t=e.createRenderbuffer();return K(t)?0:_w(t)},__wbg_createSampler_80eb58b226692482:function(e){let t=e.createSampler();return K(t)?0:_w(t)},__wbg_createShader_25e11081fd48d141:function(e,t){let n=e.createShader(t>>>0);return K(n)?0:_w(n)},__wbg_createShader_9c5e52918428bd27:function(e,t){let n=e.createShader(t>>>0);return K(n)?0:_w(n)},__wbg_createTexture_5e721dc1ddd865e3:function(e){let t=e.createTexture();return K(t)?0:_w(t)},__wbg_createTexture_f1cc0c64fa9e22cf:function(e){let t=e.createTexture();return K(t)?0:_w(t)},__wbg_createVertexArrayOES_03fccccc43c10f77:function(e){let t=e.createVertexArrayOES();return K(t)?0:_w(t)},__wbg_createVertexArray_050d27763dfd72fa:function(e){let t=e.createVertexArray();return K(t)?0:_w(t)},__wbg_cullFace_632c5f88d252b4d7:function(e,t){e.cullFace(t>>>0)},__wbg_cullFace_962911677f1c30c6:function(e,t){e.cullFace(t>>>0)},__wbg_deleteBuffer_5c5c23d034945b7c:function(e,t){e.deleteBuffer(t)},__wbg_deleteBuffer_dd1d6f71883058cb:function(e,t){e.deleteBuffer(t)},__wbg_deleteFramebuffer_4d8be9eb882b0525:function(e,t){e.deleteFramebuffer(t)},__wbg_deleteFramebuffer_712016837ba2592e:function(e,t){e.deleteFramebuffer(t)},__wbg_deleteProgram_35e4ff7b82f1c4d5:function(e,t){e.deleteProgram(t)},__wbg_deleteProgram_771559436a63e7c1:function(e,t){e.deleteProgram(t)},__wbg_deleteQuery_1c30cae3b68f3fd7:function(e,t){e.deleteQuery(t)},__wbg_deleteRenderbuffer_16d1501ab6903d8e:function(e,t){e.deleteRenderbuffer(t)},__wbg_deleteRenderbuffer_aee8ffc30e0e35cb:function(e,t){e.deleteRenderbuffer(t)},__wbg_deleteSampler_ec0248a7607fb5e6:function(e,t){e.deleteSampler(t)},__wbg_deleteShader_5f66fd162cd9b6b4:function(e,t){e.deleteShader(t)},__wbg_deleteShader_718c5020e3d4f188:function(e,t){e.deleteShader(t)},__wbg_deleteSync_b589decdc7180f91:function(e,t){e.deleteSync(t)},__wbg_deleteTexture_3472fc261bb7ff34:function(e,t){e.deleteTexture(t)},__wbg_deleteTexture_6990124dfb5053bd:function(e,t){e.deleteTexture(t)},__wbg_deleteVertexArrayOES_b1b88aa74410f620:function(e,t){e.deleteVertexArrayOES(t)},__wbg_deleteVertexArray_85b79d70fae1d1da:function(e,t){e.deleteVertexArray(t)},__wbg_depthFunc_11c361d188403f52:function(e,t){e.depthFunc(t>>>0)},__wbg_depthFunc_cd5ad66da02ddb7c:function(e,t){e.depthFunc(t>>>0)},__wbg_depthMask_a00e4725581ef05d:function(e,t){e.depthMask(t!==0)},__wbg_depthMask_e15ec83686756c88:function(e,t){e.depthMask(t!==0)},__wbg_depthRange_2ed081b96c5c19be:function(e,t,n){e.depthRange(t,n)},__wbg_depthRange_7f3fef7f421c00d4:function(e,t,n){e.depthRange(t,n)},__wbg_disableVertexAttribArray_18b9a9fe235412a1:function(e,t){e.disableVertexAttribArray(t>>>0)},__wbg_disableVertexAttribArray_40a8f7d4d882728e:function(e,t){e.disableVertexAttribArray(t>>>0)},__wbg_disable_79f65722e686303b:function(e,t){e.disable(t>>>0)},__wbg_disable_df908054ffee7971:function(e,t){e.disable(t>>>0)},__wbg_document_3540635616a18455:function(e){let t=e.document;return K(t)?0:_w(t)},__wbg_done_54b8da57023b7ed2:function(e){return e.done},__wbg_drawArraysInstancedANGLE_a7a04432fa5e1577:function(e,t,n,r,i){e.drawArraysInstancedANGLE(t>>>0,n,r,i)},__wbg_drawArraysInstanced_0e6f9f2102461c2a:function(e,t,n,r,i){e.drawArraysInstanced(t>>>0,n,r,i)},__wbg_drawArrays_7f9a3dcec5315ce5:function(e,t,n,r){e.drawArrays(t>>>0,n,r)},__wbg_drawArrays_bceea06128f9d778:function(e,t,n,r){e.drawArrays(t>>>0,n,r)},__wbg_drawBuffersWEBGL_5fbba2b83de4c122:function(e,t){e.drawBuffersWEBGL(t)},__wbg_drawBuffers_217bd25bf75ccebd:function(e,t){e.drawBuffers(t)},__wbg_drawElementsInstancedANGLE_6794fe36875c5120:function(e,t,n,r,i,a){e.drawElementsInstancedANGLE(t>>>0,n,r>>>0,i,a)},__wbg_drawElementsInstanced_767ab401cd072fd4:function(e,t,n,r,i,a){e.drawElementsInstanced(t>>>0,n,r>>>0,i,a)},__wbg_enableVertexAttribArray_9963bb377f60317c:function(e,t){e.enableVertexAttribArray(t>>>0)},__wbg_enableVertexAttribArray_9e6e81b8b603d999:function(e,t){e.enableVertexAttribArray(t>>>0)},__wbg_enable_5c8f846164bc8138:function(e,t){e.enable(t>>>0)},__wbg_enable_ee1b63abdc3fdeb5:function(e,t){e.enable(t>>>0)},__wbg_endQuery_42d36ba1d568a37a:function(e,t){e.endQuery(t>>>0)},__wbg_entries_564a7e8b1e54ede5:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(Rw(e,t))}finally{J.__wbindgen_free(n,r,1)}},__wbg_fenceSync_59d6455faf4ba50a:function(e,t,n){let r=e.fenceSync(t>>>0,n>>>0);return K(r)?0:_w(r)},__wbg_flush_1e5245bab2bbc54b:function(e){e.flush()},__wbg_flush_279c03f2320388de:function(e){e.flush()},__wbg_framebufferRenderbuffer_49b9288b6a7b5629:function(e,t,n,r,i){e.framebufferRenderbuffer(t>>>0,n>>>0,r>>>0,i)},__wbg_framebufferRenderbuffer_9417c925d5389962:function(e,t,n,r,i){e.framebufferRenderbuffer(t>>>0,n>>>0,r>>>0,i)},__wbg_framebufferTexture2D_8882fef6f47df627:function(e,t,n,r,i,a){e.framebufferTexture2D(t>>>0,n>>>0,r>>>0,i,a)},__wbg_framebufferTexture2D_91e307404924ae24:function(e,t,n,r,i,a){e.framebufferTexture2D(t>>>0,n>>>0,r>>>0,i,a)},__wbg_framebufferTextureLayer_8256c57e84c45762:function(e,t,n,r,i,a){e.framebufferTextureLayer(t>>>0,n>>>0,r,i,a)},__wbg_framebufferTextureMultiviewOVR_fd3136c9d479feb2:function(e,t,n,r,i,a,o){e.framebufferTextureMultiviewOVR(t>>>0,n>>>0,r,i,a,o)},__wbg_from_fa561fa561dc8031:function(e){return Array.from(e)},__wbg_frontFace_1ab53137f5dcd7a2:function(e,t){e.frontFace(t>>>0)},__wbg_frontFace_53fc2aad7ead45c9:function(e,t){e.frontFace(t>>>0)},__wbg_getBufferSubData_f3d6368ec0319180:function(e,t,n,r){e.getBufferSubData(t>>>0,n,r)},__wbg_getContext_32d5f94659d12566:function(){return Gw(function(e,t,n,r){let i=e.getContext(Rw(t,n),r);return K(i)?0:_w(i)},arguments)},__wbg_getContext_50a6668bd78d1120:function(){return Gw(function(e,t,n,r){let i=e.getContext(Rw(t,n),r);return K(i)?0:_w(i)},arguments)},__wbg_getExtension_c76ccfc25e343ce6:function(){return Gw(function(e,t,n){let r=e.getExtension(Rw(t,n));return K(r)?0:_w(r)},arguments)},__wbg_getIndexedParameter_b83fcd0ac4c3a462:function(){return Gw(function(e,t,n){return e.getIndexedParameter(t>>>0,n>>>0)},arguments)},__wbg_getParameter_5f25c05c9a0f445a:function(){return Gw(function(e,t){return e.getParameter(t>>>0)},arguments)},__wbg_getParameter_827c3142b1ce3364:function(){return Gw(function(e,t){return e.getParameter(t>>>0)},arguments)},__wbg_getProgramInfoLog_6d6e22f0179f1acf:function(e,t,n){let r=t.getProgramInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getProgramInfoLog_e2fe4bdd00a597bc:function(e,t,n){let r=t.getProgramInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getProgramParameter_6927dedbc507dfc7:function(e,t,n){return e.getProgramParameter(t,n>>>0)},__wbg_getProgramParameter_c7abe52a31622ce2:function(e,t,n){return e.getProgramParameter(t,n>>>0)},__wbg_getQueryParameter_6817ddd38edd8e5c:function(e,t,n){return e.getQueryParameter(t,n>>>0)},__wbg_getShaderInfoLog_246aba1bd0b04ad2:function(e,t,n){let r=t.getShaderInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getShaderInfoLog_edfc45fd76ba8c81:function(e,t,n){let r=t.getShaderInfoLog(n);var i=K(r)?0:Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT;kw().setInt32(e+4,a,!0),kw().setInt32(e+0,i,!0)},__wbg_getShaderParameter_07fb35844118558b:function(e,t,n){return e.getShaderParameter(t,n>>>0)},__wbg_getShaderParameter_ac9e7f81d3268efe:function(e,t,n){return e.getShaderParameter(t,n>>>0)},__wbg_getSupportedExtensions_76f42c1e788da832:function(e){let t=e.getSupportedExtensions();return K(t)?0:_w(t)},__wbg_getSupportedProfiles_e4f6fd61b7c0362c:function(e){let t=e.getSupportedProfiles();return K(t)?0:_w(t)},__wbg_getSyncParameter_9f6e0bba77b398fa:function(e,t,n){return e.getSyncParameter(t,n>>>0)},__wbg_getUniformBlockIndex_3aa1c4c48062a404:function(e,t,n,r){return e.getUniformBlockIndex(t,Rw(n,r))},__wbg_getUniformLocation_1717b4ed42e2ccee:function(e,t,n,r){let i=e.getUniformLocation(t,Rw(n,r));return K(i)?0:_w(i)},__wbg_getUniformLocation_46373021b59d8832:function(e,t,n,r){let i=e.getUniformLocation(t,Rw(n,r));return K(i)?0:_w(i)},__wbg_get_3e9a707ab7d352eb:function(){return Gw(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_98fdf51d029a75eb:function(e,t){return e[t>>>0]},__wbg_get_dcf82ab8aad1a593:function(){return Gw(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_1dfe6d05ad91d9b7:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_includes_0ec85e8f9acc8cac:function(e,t,n){return e.includes(t,n)},__wbg_instanceof_ArrayBuffer_53db37b06f6b9afe:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_HtmlCanvasElement_a02da0a417f1bf3f:function(e){let t;try{t=e instanceof HTMLCanvasElement}catch{t=!1}return t},__wbg_instanceof_Uint32Array_6aece1e91fed8df4:function(e){let t;try{t=e instanceof Uint32Array}catch{t=!1}return t},__wbg_instanceof_Uint8Array_abd07d4bd221d50b:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_instanceof_WebGl2RenderingContext_419098f7bf88e87e:function(e){let t;try{t=e instanceof WebGL2RenderingContext}catch{t=!1}return t},__wbg_instanceof_Window_faa5cf994f49cca7:function(e){let t;try{t=e instanceof Window}catch{t=!1}return t},__wbg_invalidateFramebuffer_02a63100f262d6cb:function(){return Gw(function(e,t,n){e.invalidateFramebuffer(t>>>0,n)},arguments)},__wbg_isArray_74b636a53056fecb:function(e){return Array.isArray(e)},__wbg_isArray_94898ed3aad6947b:function(e){return Array.isArray(e)},__wbg_isSafeInteger_01e964d144ad3a55:function(e){return Number.isSafeInteger(e)},__wbg_is_032c49d03f47f420:function(e,t){return Object.is(e,t)},__wbg_iterator_1441b47f341dc34f:function(){return Symbol.iterator},__wbg_length_2591a0f4f659a55c:function(e){return e.length},__wbg_length_3a1b902b6cde9e2c:function(e){return e.length},__wbg_length_56fcd3e2b7e0299d:function(e){return e.length},__wbg_linkProgram_7689cb555b14a359:function(e,t){e.linkProgram(t)},__wbg_linkProgram_ec865896be2835c2:function(e,t){e.linkProgram(t)},__wbg_new_02d162bc6cf02f60:function(){return{}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_new_310879b66b6e95e1:function(){return[]},__wbg_new_6c6169c583e23af8:function(e){return new Set(e)},__wbg_new_7ddec6de44ff8f5d:function(e){return new Uint8Array(e)},__wbg_new_d8dfd33fa007511d:function(e,t){try{var n={a:e,b:t};return new Promise((e,t)=>{let r=n.a;n.a=0;try{return WC(r,n.b,e,t)}finally{n.a=r}})}finally{n.a=0}},__wbg_new_typed_c072c4ce9a2a0cdf:function(e,t){try{var n={a:e,b:t};return new Promise((e,t)=>{let r=n.a;n.a=0;try{return WC(r,n.b,e,t)}finally{n.a=r}})}finally{n.a=0}},__wbg_new_with_length_99887c91eae4abab:function(e){return new Uint8Array(e>>>0)},__wbg_next_2a4e19f4f5083b0f:function(e){return e.next},__wbg_next_6429a146bf756f93:function(){return Gw(function(e){return e.next()},arguments)},__wbg_of_d694dacacb7afa7f:function(e){return[e]},__wbg_pixelStorei_06b86995306b01dc:function(e,t,n){e.pixelStorei(t>>>0,n)},__wbg_pixelStorei_171e6a6629fd9e3c:function(e,t,n){e.pixelStorei(t>>>0,n)},__wbg_polygonOffset_690c52c5bfca2a27:function(e,t,n){e.polygonOffset(t,n)},__wbg_polygonOffset_cd648f07839ab009:function(e,t,n){e.polygonOffset(t,n)},__wbg_prototypesetcall_303283bf37c9f014:function(e,t,n){Uint32Array.prototype.set.call(Ew(e,t),n)},__wbg_prototypesetcall_5f9bdc8d75e07276:function(e,t,n){Uint8Array.prototype.set.call(Dw(e,t),n)},__wbg_push_b77c476b01548d0a:function(e,t){return e.push(t)},__wbg_queryCounterEXT_d92c246603070eed:function(e,t,n){e.queryCounterEXT(t,n>>>0)},__wbg_querySelector_54149fe79b2a2091:function(){return Gw(function(e,t,n){let r=e.querySelector(Rw(t,n));return K(r)?0:_w(r)},arguments)},__wbg_queueMicrotask_78d584b53af520f5:function(e){return e.queueMicrotask},__wbg_queueMicrotask_b39ea83c7f01971a:function(e){queueMicrotask(e)},__wbg_readBuffer_dc685ea6f3a7d5aa:function(e,t){e.readBuffer(t>>>0)},__wbg_readPixels_0529efa834a6960a:function(){return Gw(function(e,t,n,r,i,a,o,s){e.readPixels(t,n,r,i,a>>>0,o>>>0,s)},arguments)},__wbg_readPixels_3509816172f67b8a:function(){return Gw(function(e,t,n,r,i,a,o,s){e.readPixels(t,n,r,i,a>>>0,o>>>0,s)},arguments)},__wbg_readPixels_76225de67eebec03:function(){return Gw(function(e,t,n,r,i,a,o,s){e.readPixels(t,n,r,i,a>>>0,o>>>0,s)},arguments)},__wbg_renderbufferStorageMultisample_25941e0e73e50cd2:function(e,t,n,r,i,a){e.renderbufferStorageMultisample(t>>>0,n,r>>>0,i,a)},__wbg_renderbufferStorage_e46ef4833287e3bf:function(e,t,n,r,i){e.renderbufferStorage(t>>>0,n>>>0,r,i)},__wbg_renderbufferStorage_fd35a40ea121e819:function(e,t,n,r,i){e.renderbufferStorage(t>>>0,n>>>0,r,i)},__wbg_resolve_d17db9352f5a220e:function(e){return Promise.resolve(e)},__wbg_rhiwgpuadapter_new:function(e){return fC.__wrap(e)},__wbg_rhiwgpucommandbuffer_unwrap:function(e){return gC.__unwrap(e)},__wbg_rhiwgpudevice_new:function(e){return bC.__wrap(e)},__wbg_rhiwgpuinstance_new:function(e){return xC.__wrap(e)},__wbg_samplerParameterf_eb39264d0b3431ea:function(e,t,n,r){e.samplerParameterf(t,n>>>0,r)},__wbg_samplerParameteri_7a90e6197a393b63:function(e,t,n,r){e.samplerParameteri(t,n>>>0,r)},__wbg_scissor_eefeb709a030fe62:function(e,t,n,r,i){e.scissor(t,n,r,i)},__wbg_scissor_ffbc9d8b3e5bb99b:function(e,t,n,r,i){e.scissor(t,n,r,i)},__wbg_set_24d0fa9e104112f9:function(e,t,n){e.set(Dw(t,n))},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_a0e911be3da02782:function(){return Gw(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbg_set_height_bb0dc35fd1d941f5:function(e,t){e.height=t>>>0},__wbg_set_height_bdd58e6b04e88cca:function(e,t){e.height=t>>>0},__wbg_set_width_25112eb6bf1148df:function(e,t){e.width=t>>>0},__wbg_set_width_9d385df435c1f79d:function(e,t){e.width=t>>>0},__wbg_shaderSource_a304cd4ebd95c11b:function(e,t,n,r){e.shaderSource(t,Rw(n,r))},__wbg_shaderSource_eceb56c4b827824d:function(e,t,n,r){e.shaderSource(t,Rw(n,r))},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),i=eT;kw().setInt32(e+4,i,!0),kw().setInt32(e+0,r,!0)},__wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9:function(){let e=typeof globalThis>`u`?null:globalThis;return K(e)?0:_w(e)},__wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54:function(){let e=typeof global>`u`?null:global;return K(e)?0:_w(e)},__wbg_static_accessor_SELF_9b2406c23aeb2023:function(){let e=typeof self>`u`?null:self;return K(e)?0:_w(e)},__wbg_static_accessor_WINDOW_b34d2126934e16ba:function(){let e=typeof window>`u`?null:window;return K(e)?0:_w(e)},__wbg_stencilFuncSeparate_00281c346ccf1e19:function(e,t,n,r,i){e.stencilFuncSeparate(t>>>0,n>>>0,r,i>>>0)},__wbg_stencilFuncSeparate_5f7154fe74881dab:function(e,t,n,r,i){e.stencilFuncSeparate(t>>>0,n>>>0,r,i>>>0)},__wbg_stencilMaskSeparate_bd7c034fdfc6620c:function(e,t,n){e.stencilMaskSeparate(t>>>0,n>>>0)},__wbg_stencilMaskSeparate_d14d6ba494aeff5f:function(e,t,n){e.stencilMaskSeparate(t>>>0,n>>>0)},__wbg_stencilMask_15dfb3e60c15e612:function(e,t){e.stencilMask(t>>>0)},__wbg_stencilMask_2d63c2d3e068aca1:function(e,t){e.stencilMask(t>>>0)},__wbg_stencilOpSeparate_1fea3ed309a817f9:function(e,t,n,r,i){e.stencilOpSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_stencilOpSeparate_32876bf4c07b7065:function(e,t,n,r,i){e.stencilOpSeparate(t>>>0,n>>>0,r>>>0,i>>>0)},__wbg_texImage2D_17593ae6c467ae79:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texImage2D_2495ff54823b531b:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texImage2D_364c83aae17ba6d2:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texImage3D_3bcfec50659cc5ae:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u){e.texImage3D(t>>>0,n,r,i,a,o,s,c>>>0,l>>>0,u)},arguments)},__wbg_texImage3D_79d27507fa4470dd:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u){e.texImage3D(t>>>0,n,r,i,a,o,s,c>>>0,l>>>0,u)},arguments)},__wbg_texParameteri_2ef5b781bcfbdd64:function(e,t,n,r){e.texParameteri(t>>>0,n>>>0,r)},__wbg_texParameteri_c22838926a5dca2b:function(e,t,n,r){e.texParameteri(t>>>0,n>>>0,r)},__wbg_texStorage2D_afb762382f8a4678:function(e,t,n,r,i,a){e.texStorage2D(t>>>0,n,r>>>0,i,a)},__wbg_texStorage3D_66ff900ad02f2247:function(e,t,n,r,i,a,o){e.texStorage3D(t>>>0,n,r>>>0,i,a,o)},__wbg_texSubImage2D_0f88243806532534:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_203ff6bcf48e4d08:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_57a710f2064ab4ef:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_62d9e38e9378faff:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_668c5714e23e0e83:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_781892a0e05abd13:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_ad417daf4e038863:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage2D_e1be0f65e9a35343:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l){e.texSubImage2D(t>>>0,n,r,i,a,o,s>>>0,c>>>0,l)},arguments)},__wbg_texSubImage3D_11a4e6f278359fc4:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_36a195d4f535cfe6:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_54374f7f12d16e40:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_5cfc6bdc70a23b0d:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_72a9517857b52f44:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_a5b225452b0d7de3:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_texSubImage3D_ebb4d2dbc4680374:function(){return Gw(function(e,t,n,r,i,a,o,s,c,l,u,d){e.texSubImage3D(t>>>0,n,r,i,a,o,s,c,l>>>0,u>>>0,d)},arguments)},__wbg_then_837494e384b37459:function(e,t){return e.then(t)},__wbg_then_bd927500e8905df2:function(e,t,n){return e.then(t,n)},__wbg_uniform1f_429e664ea89191db:function(e,t,n){e.uniform1f(t,n)},__wbg_uniform1f_709baed741125e5e:function(e,t,n){e.uniform1f(t,n)},__wbg_uniform1i_2be01a75c6619c15:function(e,t,n){e.uniform1i(t,n)},__wbg_uniform1i_717096cfb8ca6bc1:function(e,t,n){e.uniform1i(t,n)},__wbg_uniform1ui_eafd8b7523d6d39e:function(e,t,n){e.uniform1ui(t,n>>>0)},__wbg_uniform2fv_63f8c49c9f57e258:function(e,t,n,r){e.uniform2fv(t,xw(n,r))},__wbg_uniform2fv_9f8ce1c86ee13440:function(e,t,n,r){e.uniform2fv(t,xw(n,r))},__wbg_uniform2iv_c67b4ee9d082abdf:function(e,t,n,r){e.uniform2iv(t,Cw(n,r))},__wbg_uniform2iv_ec7e5887f2386d2c:function(e,t,n,r){e.uniform2iv(t,Cw(n,r))},__wbg_uniform2uiv_55a0e084de75c7b9:function(e,t,n,r){e.uniform2uiv(t,Ew(n,r))},__wbg_uniform3fv_2fb5418c1304ba72:function(e,t,n,r){e.uniform3fv(t,xw(n,r))},__wbg_uniform3fv_7c2935b7f05414ef:function(e,t,n,r){e.uniform3fv(t,xw(n,r))},__wbg_uniform3iv_ad46bb9ddf29111f:function(e,t,n,r){e.uniform3iv(t,Cw(n,r))},__wbg_uniform3iv_d82127ddeebb5154:function(e,t,n,r){e.uniform3iv(t,Cw(n,r))},__wbg_uniform3uiv_30e97efe980f53c9:function(e,t,n,r){e.uniform3uiv(t,Ew(n,r))},__wbg_uniform4f_7bc8db9ead983de4:function(e,t,n,r,i,a){e.uniform4f(t,n,r,i,a)},__wbg_uniform4f_be0bd0ea203aedfe:function(e,t,n,r,i,a){e.uniform4f(t,n,r,i,a)},__wbg_uniform4fv_622c64d35acf9214:function(e,t,n,r){e.uniform4fv(t,xw(n,r))},__wbg_uniform4fv_b0c5721b35cd3f06:function(e,t,n,r){e.uniform4fv(t,xw(n,r))},__wbg_uniform4iv_24df1fbc803c05db:function(e,t,n,r){e.uniform4iv(t,Cw(n,r))},__wbg_uniform4iv_2cccd5ae55d77224:function(e,t,n,r){e.uniform4iv(t,Cw(n,r))},__wbg_uniform4uiv_6f594d049d6d0038:function(e,t,n,r){e.uniform4uiv(t,Ew(n,r))},__wbg_uniformBlockBinding_25e6ae614200cf4d:function(e,t,n,r){e.uniformBlockBinding(t,n>>>0,r>>>0)},__wbg_uniformMatrix2fv_6918fd0909b6a167:function(e,t,n,r,i){e.uniformMatrix2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix2fv_840e6434707032cd:function(e,t,n,r,i){e.uniformMatrix2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix2x3fv_4a2dd969ec740f7d:function(e,t,n,r,i){e.uniformMatrix2x3fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix2x4fv_e3cdd10c182a5354:function(e,t,n,r,i){e.uniformMatrix2x4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3fv_6abd62dbed68830a:function(e,t,n,r,i){e.uniformMatrix3fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3fv_e380a7aa532c175a:function(e,t,n,r,i){e.uniformMatrix3fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3x2fv_2b07ce888bfa37c8:function(e,t,n,r,i){e.uniformMatrix3x2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix3x4fv_0439a4fdd88af9de:function(e,t,n,r,i){e.uniformMatrix3x4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4fv_b5f678dc15314524:function(e,t,n,r,i){e.uniformMatrix4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4fv_d2b5005a92d27115:function(e,t,n,r,i){e.uniformMatrix4fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4x2fv_7d12ae09d4b61a26:function(e,t,n,r,i){e.uniformMatrix4x2fv(t,n!==0,xw(r,i))},__wbg_uniformMatrix4x3fv_f60d424ca4a02635:function(e,t,n,r,i){e.uniformMatrix4x3fv(t,n!==0,xw(r,i))},__wbg_useProgram_3cc1a6d58dac88b4:function(e,t){e.useProgram(t)},__wbg_useProgram_e45f506b921ab3f8:function(e,t){e.useProgram(t)},__wbg_value_9cc0518af87a489c:function(e){return e.value},__wbg_vertexAttribDivisorANGLE_47b6b82921bbf062:function(e,t,n){e.vertexAttribDivisorANGLE(t>>>0,n>>>0)},__wbg_vertexAttribDivisor_74454522a4976fc2:function(e,t,n){e.vertexAttribDivisor(t>>>0,n>>>0)},__wbg_vertexAttribIPointer_e65b21fd97a67466:function(e,t,n,r,i,a){e.vertexAttribIPointer(t>>>0,n,r>>>0,i,a)},__wbg_vertexAttribPointer_7f7185558bcaf24b:function(e,t,n,r,i,a,o){e.vertexAttribPointer(t>>>0,n,r>>>0,i!==0,a,o)},__wbg_vertexAttribPointer_85566c79cb366300:function(e,t,n,r,i,a,o){e.vertexAttribPointer(t>>>0,n,r>>>0,i!==0,a,o)},__wbg_viewport_3c149d0c6435f0ed:function(e,t,n,r,i){e.viewport(t,n,r,i)},__wbg_viewport_c25030cfbe3cddf4:function(e,t,n,r,i){e.viewport(t,n,r,i)},__wbindgen_cast_0000000000000001:function(e,t){return Kw(e,t,UC)},__wbindgen_cast_0000000000000002:function(e,t){return Kw(e,t,GC)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e,t){return xw(e,t)},__wbindgen_cast_0000000000000005:function(e,t){return Sw(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return Cw(e,t)},__wbindgen_cast_0000000000000007:function(e,t){return ww(e,t)},__wbindgen_cast_0000000000000008:function(e,t){return Tw(e,t)},__wbindgen_cast_0000000000000009:function(e,t){return Ew(e,t)},__wbindgen_cast_000000000000000a:function(e,t){return Dw(e,t)},__wbindgen_cast_000000000000000b:function(e,t){return Rw(e,t)},__wbindgen_cast_000000000000000c:function(e){return BigInt.asUintN(64,e)},__wbindgen_init_externref_table:function(){let e=J.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function UC(e,t,n){let r=J.wasm_bindgen_5989510ce0f9510c___convert__closures_____invoke___wasm_bindgen_5989510ce0f9510c___JsValue__core_f4ce2b6cc8c3b44d___result__Result_____wasm_bindgen_5989510ce0f9510c___JsError___true_(e,t,n);if(r[1])throw q(r[0])}function WC(e,t,n,r){J.wasm_bindgen_5989510ce0f9510c___convert__closures_____invoke___js_sys_c72f2fdc215f630f___Function_fn_wasm_bindgen_5989510ce0f9510c___JsValue_____wasm_bindgen_5989510ce0f9510c___sys__Undefined___js_sys_c72f2fdc215f630f___Function_fn_wasm_bindgen_5989510ce0f9510c___JsValue_____wasm_bindgen_5989510ce0f9510c___sys__Undefined_______true_(e,t,n,r)}function GC(e,t,n,r){let i=Jw(n,J.__wbindgen_malloc,J.__wbindgen_realloc),a=eT,o=Jw(r,J.__wbindgen_malloc,J.__wbindgen_realloc),s=eT;J.wasm_bindgen_5989510ce0f9510c___convert__closures_____invoke___alloc_864af3eab0b4f693___string__String__alloc_864af3eab0b4f693___string__String______true_(e,t,i,a,o,s)}var KC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_parsedmodule_free(e,1)),qC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuadapter_free(e,1)),JC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpubindgroup_free(e,1)),YC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpubindgrouplayout_free(e,1)),XC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpubuffer_free(e,1)),ZC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucommandbuffer_free(e,1)),QC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucommandencoder_free(e,1)),$C=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucomputepass_free(e,1)),ew=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpucomputepipeline_free(e,1)),tw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpudevice_free(e,1)),nw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuinstance_free(e,1)),rw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpupipelinelayout_free(e,1)),iw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuqueryset_free(e,1)),aw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpuqueue_free(e,1)),ow=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderbundle_free(e,1)),sw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderbundleencoder_free(e,1)),cw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderpass_free(e,1)),lw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpurenderpipeline_free(e,1)),uw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpusampler_free(e,1)),dw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpushadermodule_free(e,1)),fw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpusurface_free(e,1)),pw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgpusurfacetexture_free(e,1)),mw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgputexture_free(e,1)),hw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_rhiwgputextureview_free(e,1)),gw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_validatedmodule_free(e,1));function _w(e){let t=J.__externref_table_alloc();return J.__wbindgen_externrefs.set(t,e),t}function vw(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}var yw=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbindgen_destroy_closure(e.a,e.b));function bw(e){let t=typeof e;if(t==`number`||t==`boolean`||e==null)return`${e}`;if(t==`string`)return`"${e}"`;if(t==`symbol`){let t=e.description;return t==null?`Symbol`:`Symbol(${t})`}if(t==`function`){let t=e.name;return typeof t==`string`&&t.length>0?`Function(${t})`:`Function`}if(Array.isArray(e)){let t=e.length,n=`[`;t>0&&(n+=bw(e[0]));for(let r=1;r<t;r++)n+=`, `+bw(e[r]);return n+=`]`,n}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r==`Object`)try{return`Object(`+JSON.stringify(e)+`)`}catch{return`Object`}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function xw(e,t){return e>>>=0,jw().subarray(e/4,e/4+t)}function Sw(e,t){return e>>>=0,Nw().subarray(e/2,e/2+t)}function Cw(e,t){return e>>>=0,Fw().subarray(e/4,e/4+t)}function ww(e,t){return e>>>=0,Lw().subarray(e/1,e/1+t)}function Tw(e,t){return e>>>=0,Bw().subarray(e/2,e/2+t)}function Ew(e,t){return e>>>=0,Hw().subarray(e/4,e/4+t)}function Dw(e,t){return e>>>=0,Ww().subarray(e/1,e/1+t)}var Ow=null;function kw(){return(Ow===null||Ow.buffer.detached===!0||Ow.buffer.detached===void 0&&Ow.buffer!==J.memory.buffer)&&(Ow=new DataView(J.memory.buffer)),Ow}var Aw=null;function jw(){return(Aw===null||Aw.byteLength===0)&&(Aw=new Float32Array(J.memory.buffer)),Aw}var Mw=null;function Nw(){return(Mw===null||Mw.byteLength===0)&&(Mw=new Int16Array(J.memory.buffer)),Mw}var Pw=null;function Fw(){return(Pw===null||Pw.byteLength===0)&&(Pw=new Int32Array(J.memory.buffer)),Pw}var Iw=null;function Lw(){return(Iw===null||Iw.byteLength===0)&&(Iw=new Int8Array(J.memory.buffer)),Iw}function Rw(e,t){return Qw(e>>>0,t)}var zw=null;function Bw(){return(zw===null||zw.byteLength===0)&&(zw=new Uint16Array(J.memory.buffer)),zw}var Vw=null;function Hw(){return(Vw===null||Vw.byteLength===0)&&(Vw=new Uint32Array(J.memory.buffer)),Vw}var Uw=null;function Ww(){return(Uw===null||Uw.byteLength===0)&&(Uw=new Uint8Array(J.memory.buffer)),Uw}function Gw(e,t){try{return e.apply(this,t)}catch(e){let t=_w(e);J.__wbindgen_exn_store(t)}}function K(e){return e==null}function Kw(e,t,n){let r={a:e,b:t,cnt:1},i=(...e)=>{r.cnt++;let t=r.a;r.a=0;try{return n(t,r.b,...e)}finally{r.a=t,i._wbg_cb_unref()}};return i._wbg_cb_unref=()=>{--r.cnt===0&&(J.__wbindgen_destroy_closure(r.a,r.b),r.a=0,yw.unregister(r))},yw.register(i,r,r),i}function qw(e,t){let n=t(e.length*1,1)>>>0;return Ww().set(e,n/1),eT=e.length,n}function Jw(e,t,n){if(n===void 0){let n=$w.encode(e),r=t(n.length,1)>>>0;return Ww().subarray(r,r+n.length).set(n),eT=n.length,r}let r=e.length,i=t(r,1)>>>0,a=Ww(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=Ww().subarray(i+o,i+r),a=$w.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return eT=o,i}function q(e){let t=J.__wbindgen_externrefs.get(e);return J.__externref_table_dealloc(e),t}var Yw=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});Yw.decode();var Xw=2146435072,Zw=0;function Qw(e,t){return Zw+=t,Zw>=Xw&&(Yw=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),Yw.decode(),Zw=t),Yw.decode(Ww().subarray(e,e+t))}var $w=new TextEncoder;`encodeInto`in $w||($w.encodeInto=function(e,t){let n=$w.encode(e);return t.set(n),{read:e.length,written:n.length}});var eT=0,J;function tT(e,t){return J=e.exports,Ow=null,Aw=null,Mw=null,Pw=null,Iw=null,zw=null,Vw=null,Uw=null,J.__wbindgen_start(),J}async function nT(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function rT(e){if(J!==void 0)return J;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=HC();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),tT(new WebAssembly.Instance(e,t),e)}async function iT(e){if(J!==void 0)return J;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/wgpu_wasm_bg-C1seepuF.wasm`,``+import.meta.url));let t=HC();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await nT(await e,t);return tT(n,r)}var aT=null;async function oT(e){let t=globalThis.crypto?.subtle;if(t!==void 0){let n=await t.digest(`SHA-256`,e);return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}return(await h(()=>import(`node:crypto`),[])).createHash(`sha256`).update(e).digest(`hex`)}function sT(e){return JSON.stringify({schemaVersion:e.schemaVersion,sourceContentKey:e.sourceContentKey,artifactSha256:e.artifactSha256,glueSha256:e.glueSha256,toolchain:e.toolchain,dependencies:e.dependencies})}async function cT(e,t,n){let r;try{r=JSON.parse(new TextDecoder().decode(e))}catch{throw Error(`wgpu-wasm provenance manifest is not valid JSON`)}if(typeof r!=`object`||!r||r.schemaVersion!==`wgpu-wasm-provenance/1`)throw Error(`wgpu-wasm provenance manifest has an unsupported schemaVersion`);let i=r,a=await oT(t),o=await oT(n);if(a!==i.artifactSha256||t.byteLength!==i.artifactBytes)throw Error(`wgpu-wasm artifact bytes do not match provenance manifest`);if(o!==i.glueSha256||n.byteLength!==i.glueBytes)throw Error(`wgpu-wasm glue bytes do not match provenance manifest`);if(`sha256-${await oT(new TextEncoder().encode(sT(i)))}`!==i.compilerFingerprint)throw Error(`wgpu-wasm compiler fingerprint does not match provenance manifest`);return i}function lT(e){let t=new URL(e.href);return t.search=`${t.search}${t.search===``?`?`:`&`}raw`,t}async function uT(e){let t=new Uint8Array(await e.arrayBuffer()),n=new TextDecoder().decode(t);if(!n.startsWith(`export default `))return t;let r=n.slice(15).trim();r.endsWith(`;`)&&(r=r.slice(0,-1).trim());try{let e=JSON.parse(r);if(typeof e==`string`)return new TextEncoder().encode(e)}catch{}return t}async function dT(){let e=typeof globalThis.process?.versions?.node==`string`,t=new URL(`/assets/wgpu_wasm_bg-C1seepuF.wasm`,``+import.meta.url),n=new URL(`data:application/json;base64,ewogICJzY2hlbWFWZXJzaW9uIjogIndncHUtd2FzbS1wcm92ZW5hbmNlLzEiLAogICJzb3VyY2VDb250ZW50S2V5IjogInNoYTI1Ni1jZjRhZDY5OWY0YTJjMTIzZWFjYjJjNzRlYWVlNjBlOGViM2VjYjBiN2Y0MGQyNGUzOTQ2ZGU4YzQ0YzlhOWZhIiwKICAiYXJ0aWZhY3RTaGEyNTYiOiAiNDlkMzY0N2I1ZGI4MGExMGNlZTBlMzI5ZjlkYzBiMDg2M2RhNDAzMjA5NjE5MGUyZTFlMDZlY2Y2ODM2ZDc1MiIsCiAgImFydGlmYWN0Qnl0ZXMiOiA1NTcyMjAwLAogICJnbHVlU2hhMjU2IjogIjJkNDYzOTY1Mzc0NDdhNWUxYjdjYjA3MWNlYmFiNmQxNzE1NTAwZTU4YzEwZDU1MjAxZGQzZmFkYjg1NzNlMDkiLAogICJnbHVlQnl0ZXMiOiAxNDg1OTksCiAgInRvb2xjaGFpbiI6IHsKICAgICJydXN0YyI6ICJydXN0YyAxLjkzLjEgKDAxZjZkZGY3NSAyMDI2LTAyLTExKSIsCiAgICAid2FzbVBhY2siOiAid2FzbS1wYWNrIDAuMTQuMCIsCiAgICAid2FzbUJpbmRnZW4iOiAidW5hdmFpbGFibGUiCiAgfSwKICAiZGVwZW5kZW5jaWVzIjogewogICAgIndncHUiOiAiMjkuMC4zIiwKICAgICJuYWdhIjogIjI5LjAuMyIsCiAgICAibmFnYU9pbCI6ICIwLjIyLjAiLAogICAgIndhc21CaW5kZ2VuIjogIjAuMi4xMjEiCiAgfSwKICAiY29tcGlsZXJGaW5nZXJwcmludCI6ICJzaGEyNTYtYWE0YmZjYzUxZDJkZTNmMDgyYmMxYWY3OGI3MTNhYTBiMTkzNTIzNjM3ZjdiN2RmMmU1ZWU2ZTU2MGUzNGQ5MCIKfQo=`,``+import.meta.url),r=new URL(`/assets/wgpu_wasm-DZKPZXEq.js`,``+import.meta.url);if(e){let e=await h(()=>import(`node:fs/promises`),[]),i=await h(()=>import(`node:url`),[]),a=await e.readFile(i.fileURLToPath(t));await cT(await e.readFile(i.fileURLToPath(n)),a,await e.readFile(i.fileURLToPath(r))),await iT({module_or_path:a})}else{let[e,i,a]=await Promise.all([fetch(n),fetch(t),fetch(lT(r))]);if(!e.ok||!i.ok||!a.ok)throw Error(`wgpu-wasm provenance or generated bytes could not be fetched`);let[o,s,c]=await Promise.all([e.arrayBuffer(),i.arrayBuffer(),uT(a)]);await cT(new Uint8Array(o),new Uint8Array(s),new Uint8Array(c)),await iT({module_or_path:s})}return uC}var fT=()=>(aT||=dT().catch(e=>{throw aT=null,e}),aT);function pT(e){return new sC({code:`shader-compile-failed`,expected:`WGSL source parses + validates against naga IR`,message:e.message,hint:e.hint,...e.lineNum===void 0?{}:{lineNum:e.lineNum},...e.linePos===void 0?{}:{linePos:e.linePos},...e.compilerMessages===void 0?{}:{detail:{code:`shader-compile-failed`,compilerMessages:e.compilerMessages,...e.reason===void 0?{}:{reason:e.reason}}}})}function mT(e,t){if(e instanceof Error)try{let n=JSON.parse(e.message);return pT({message:n.summary??n.message??e.message,hint:t??`fix the WGSL source at the indicated line/column; see ShaderError.detail.compilerMessages for full diagnostic frame`,...typeof n.line_num==`number`?{lineNum:n.line_num}:{},...typeof n.line_pos==`number`?{linePos:n.line_pos}:{}})}catch{return pT({message:e.message,hint:t??`check WGSL syntax + validation rules; consult naga error output for details`})}return pT({message:String(e),hint:t??`unknown error type from @forgeax/engine/wgpu-wasm; report as @forgeax/engine/naga bug`})}async function hT(e){let t;try{t=await fT()}catch(e){return y(mT(e,`rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm`))}try{return v(t.parse(e))}catch(e){return y(mT(e))}}async function gT(e){let t;try{t=await fT()}catch(e){return y(mT(e,`rerun bash packages/wgpu-wasm/build.sh and verify packages/wgpu-wasm/pkg contains a fresh .wasm`))}try{return v(t.validate(e))}catch(e){return y(mT(e))}}function _T(e,t,n,r){return{code:e,detail:t,hint:n,message:t,expected:`a viewer-private selected-raster shader preview`,...r?.line===void 0?{}:{line:r.line},...r?.column===void 0?{}:{column:r.column}}}function vT(e=`preview apply was cancelled`){return _T(`preview-aborted`,e,`apply the current selection again`)}var yT=256,bT=256,xT=17;function ST(e){return[e.tapeDigest,e.workIndex,e.stage??`none`,e.shaderModuleId].join(`/`)}function CT(e){return e.pipelineKind===`render`?e.stage===null||e.stage===`compute`?y(_T(`preview-not-applicable`,`the selected shader has no raster stage`,`select vertex or fragment`)):e.entryPoint===null||e.source.trim()===``?y(_T(`preview-not-applicable`,`the selected shader is incomplete`,`select a recorded module with a source and entry point`)):v(e):y(_T(`preview-not-applicable`,`compute pipelines do not have a selected-raster preview`,`select a render work item`))}function wT(e){let t=e.stage===`vertex`?{source:e.source,entryPoint:e.entryPoint}:e.stages?.vertex,n=e.stage===`fragment`?{source:e.source,entryPoint:e.entryPoint}:e.stages?.fragment;return t===void 0||n===void 0||t.source.trim()===``||n.source.trim()===``||t.entryPoint===null||n.entryPoint===null?y(_T(`preview-pipeline-incompatible`,`the selected raster work has no paired vertex and fragment stage facts`,`select a pipeline with complete vertex and fragment module sources and entry points`)):v({vertex:{source:t.source,entryPoint:t.entryPoint},fragment:{source:n.source,entryPoint:n.entryPoint}})}var TT=class{generation=0;controller=null;disposed=!1;async apply(e,t,n={}){this.controller?.abort();let r=new AbortController;this.controller=r;let i=++this.generation,a=n.signal,o=()=>this.disposed||r.signal.aborted||a?.aborted===!0;if(o())return y(vT());let s=CT({...e,source:t});if(!s.ok)return s;if(n.backend===void 0&&(n.webgpuAvailable===!1||typeof navigator>`u`||navigator.gpu===void 0))return y(_T(`preview-not-applicable`,`WebGPU is unavailable for the temporary preview session`,`open the viewer in a WebGPU-capable browser`));let c=await hT(t);if(o())return y(vT());if(!c.ok)return y(_T(`preview-compile-failed`,c.error.message,c.error.hint,{...c.error.lineNum===void 0?{}:{line:c.error.lineNum},...c.error.linePos===void 0?{}:{column:c.error.linePos}}));let l=await gT(c.value);if(o())return y(vT());if(!l.ok)return y(_T(`preview-validation-failed`,l.error.message,l.error.hint,{...l.error.lineNum===void 0?{}:{line:l.error.lineNum},...l.error.linePos===void 0?{}:{column:l.error.linePos}}));let u=n.backend===void 0?await this.openBackend():v(n.backend);if(!u.ok)return u;if(o())return y(vT());let d=await this.renderPreview(s.value,u.value,o);if(!d.ok)return d;if(o())return y(vT());if(n.canvas!==void 0){let e=jT(n.canvas,d.value.pixels,yT,bT);if(!e.ok)return e}return v({provenance:`preview`,key:ST(s.value),generation:i,source:t,width:yT,height:bT,pixels:d.value.pixels,pixelDigest:MT(d.value.pixels)})}abort(){this.controller?.abort(),this.controller=null,this.generation+=1}dispose(){this.disposed=!0,this.abort()}async openBackend(){try{let e=await Bp.requestAdapter();if(!e.ok)return y(_T(`preview-not-applicable`,`${e.error.code}: ${e.error.hint}`,`open the viewer in a WebGPU-capable browser`));let t=await e.value.requestDevice();return t.ok?v({device:t.value,createShaderModule:Pp}):y(_T(`preview-not-applicable`,`${t.error.code}: ${t.error.hint}`,`open the viewer in a WebGPU-capable browser`))}catch(e){return y(_T(`preview-not-applicable`,e instanceof Error?e.message:String(e),`open the viewer in a WebGPU-capable browser`))}}async renderPreview(e,t,n){let r=e.work;if(r===void 0||r.pipeline.status!==`available`||r.pipeline.kind!==`render`)return y(_T(`preview-not-applicable`,`the selected work has no complete render pipeline facts`,`select a raster work with pipeline, attachment, and draw facts`));if(r.attachments===null||r.attachments.colorViewHandleIds.length===0)return y(_T(`preview-not-applicable`,`the selected work has no color attachment to preview`,`select a render work with a captured color attachment`));if(r.bindings.length>0||r.indexBuffer!==null)return y(_T(`preview-not-applicable`,`the selected work requires replayed bindings or an index buffer`,`select a work whose required resources are represented by the viewer-private preview seam`));let i=AT(r.pipeline.descriptor);if(i===null)return y(_T(`preview-not-applicable`,`the selected render pipeline has no supported primitive topology fact`,`select a render work with a supported raster topology`));let a=wT(e);if(!a.ok)return a;let o=ET(r.drawCall);if(!o.ok)return o;let{device:s}=t,c;try{if(n())return y(vT());let l=await t.createShaderModule(s,{code:a.value.vertex.source});if(!l.ok)return y(_T(`preview-compile-failed`,`${l.error.code}: ${l.error.hint}`,`fix the vertex WGSL diagnostics, then Apply again`));let u=await t.createShaderModule(s,{code:a.value.fragment.source});if(!u.ok)return y(_T(`preview-compile-failed`,`${u.error.code}: ${u.error.hint}`,`fix the fragment WGSL diagnostics, then Apply again`));if(n())return y(vT());let d=e.targetFormat??kT(r.pipeline.descriptor);if(d===null)return y(_T(`preview-not-applicable`,`the selected raster work has no captured color target format`,`select a render pipeline with a concrete color target format`));let f=s.createTexture({size:{width:yT,height:bT,depthOrArrayLayers:1},format:d,usage:xT,dimension:`2d`,mipLevelCount:1,sampleCount:1});if(!f.ok)return y(_T(`preview-pipeline-incompatible`,`${f.error.code}: ${f.error.hint}`,`select a renderable color target for the selected pipeline`));c=f.value;let p=s.createTextureView(c,{dimension:`2d`,aspect:`all`,baseMipLevel:0,mipLevelCount:1,baseArrayLayer:0,arrayLayerCount:1});if(!p.ok)return y(_T(`preview-pipeline-incompatible`,`${p.error.code}: ${p.error.hint}`,`select a renderable color target for the selected pipeline`));let m=s.createRenderPipeline({layout:`auto`,vertex:{module:l.value,entryPoint:a.value.vertex.entryPoint,buffers:[]},fragment:{module:u.value,entryPoint:a.value.fragment.entryPoint,targets:[{format:d}]},primitive:{topology:i}});if(!m.ok)return y(_T(`preview-pipeline-incompatible`,`${m.error.code}: ${m.error.hint}`,`select a pipeline compatible with the selected work preview facts`));let h=s.createCommandEncoder({});if(!h.ok)return y(_T(`preview-pipeline-incompatible`,`${h.error.code}: ${h.error.hint}`,`retry the isolated preview after the device is ready`));let g=h.value.beginRenderPass({colorAttachments:[{view:p.value,clearValue:{r:0,g:0,b:0,a:1},loadOp:`clear`,storeOp:`store`}]});g.setPipeline(m.value),g.draw(o.value.vertexCount,o.value.instanceCount,o.value.firstVertex,o.value.firstInstance),g.end();let _=h.value.finish();if(!_.ok)return y(_T(`preview-pipeline-incompatible`,`${_.error.code}: ${_.error.hint}`,`retry the isolated preview after the device is ready`));let b=s.queue.submit([_.value]);return b.ok?(await s.queue.onSubmittedWorkDone(),n()?y(vT()):v({pixels:await wl(s,c,yT,bT,{bytesPerTexel:4,mipLevel:0,baseArrayLayer:0,aspect:`all`})})):y(_T(`preview-pipeline-incompatible`,`${b.error.code}: ${b.error.hint}`,`retry the isolated preview after the device is ready`))}catch(e){return n()?y(vT()):y(_T(`preview-pipeline-incompatible`,e instanceof Error?e.message:String(e),`select a compatible raster pipeline or reset the editor`))}finally{c!==void 0&&s.destroyTexture(c)}}};function ET(e){if(typeof e!=`object`||!e||Array.isArray(e))return y(_T(`preview-not-applicable`,`the selected work has no structured non-indexed draw facts`,`select a direct render work with vertexCount and instanceCount`));let t=e;if(t.kind!==`draw`)return y(_T(`preview-not-applicable`,`the selected work uses ${typeof t.kind==`string`?t.kind:`an unknown command`} and cannot be reconstructed by the temporary seam`,`select a direct non-indexed draw work for local preview`));let n=(e,n)=>{let r=t[e];return r===void 0?n:typeof r==`number`&&Number.isSafeInteger(r)&&r>=0?r:null},r=n(`vertexCount`,0),i=n(`instanceCount`,1),a=n(`firstVertex`,0),o=n(`firstInstance`,0);return r===null||i===null||a===null||o===null||r===0||i===0?y(_T(`preview-not-applicable`,`the selected draw facts are missing a positive vertex or instance count`,`select a direct draw with complete non-zero counts`)):v({vertexCount:r,instanceCount:i,firstVertex:a,firstInstance:o})}function DT(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function OT(e){let t=DT(e);return DT(t?.desc)??t}function kT(e){let t=DT(OT(e)?.fragment),n=DT((Array.isArray(t?.targets)?t.targets:[])[0]);return typeof n?.format==`string`?n.format:null}function AT(e){let t=DT(OT(e)?.primitive)?.topology;return t===`point-list`||t===`line-list`||t===`line-strip`||t===`triangle-list`||t===`triangle-strip`?t:null}function jT(e,t,n,r){let i=e.getContext(`2d`);return i===null?y(_T(`preview-pipeline-incompatible`,`the preview canvas does not expose a 2D presentation context`,`use a browser canvas that supports 2D presentation`)):(e.width=n,e.height=r,i.putImageData(new ImageData(new Uint8ClampedArray(t),n,r),0,0),v(void 0))}function MT(e){let t=2166136261;for(let n of e)t^=n,t=Math.imul(t,16777619);return`fnv1a:${(t>>>0).toString(16)}`}var NT=1024,PT=0,FT=class{constructor(e,t){this.from=e,this.to=t}},IT=class{constructor(e={}){this.id=PT++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=zT.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};IT.closedBy=new IT({deserialize:e=>e.split(` `)}),IT.openedBy=new IT({deserialize:e=>e.split(` `)}),IT.group=new IT({deserialize:e=>e.split(` `)}),IT.isolate=new IT({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),IT.contextHash=new IT({perNode:!0}),IT.lookAhead=new IT({perNode:!0}),IT.mounted=new IT({perNode:!0});var LT=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[IT.mounted.id]}},RT=Object.create(null),zT=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):RT,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(IT.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(IT.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};zT.none=new zT(``,Object.create(null),0,8);var BT=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new zT(e.name,r,e.id,e.flags):e)}return new e(n)}},VT=new WeakMap,HT=new WeakMap,UT;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(UT||={});var WT=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=LT.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new iE(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new iE(VT.get(this)||this.topNode);return r.moveTo(e,t),VT.set(this,r._tree),r}get topNode(){return new XT(this,0,0,null)}resolve(e,t=0){let n=JT(VT.get(this)||this.topNode,e,t,!1);return VT.set(this,n),n}resolveInner(e,t=0){let n=JT(HT.get(this)||this.topNode,e,t,!0);return HT.set(this,n),n}resolveStack(e,t=0){return rE(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&UT.IncludeAnonymous)>0;for(let e=this.cursor(a|UT.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:lE(zT.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(zT.none,t,n,r)))}static build(e){return oE(e)}};WT.empty=new WT(zT.none,[],[],0);var GT=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},KT=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return zT.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(qT(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function qT(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function JT(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof XT&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:UT.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof XT&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var YT=class{cursor(e=0){return new iE(this,e)}getChild(e,t=null,n=null){let r=ZT(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return ZT(this,e,t,n)}resolve(e,t=0){return JT(this,e,t,!1)}resolveInner(e,t=0){return JT(this,e,t,!0)}matchContext(e){return QT(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},XT=class e extends YT{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&UT.EnterBracketed&&l instanceof WT&&(d=LT.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!qT(i,r,u,u+l.length))){if(l instanceof KT){if(a&UT.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new eE(new $T(o,l,t,u),null,e)}else if(a&UT.IncludeAnonymous||!l.type.isAnonymous||aE(l)){let s;if(!(a&UT.IgnoreMounts)&&(s=LT.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&UT.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&UT.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&UT.IgnoreOverlays)&&(i=LT.get(this._tree))&&i.overlay){let a=t-this.from,o=r&UT.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function ZT(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function QT(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var $T=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},eE=class e extends YT{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&UT.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new WT(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function tE(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof XT&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new nE(i,n)}var nE=class{constructor(e,t){this.heads=e,this.node=t}get next(){return tE(this.heads)}};function rE(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof XT?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=LT.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new XT(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(JT(o,t,n,!1))}}return i?tE(i):r}var iE=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~UT.EnterBracketed,e instanceof XT)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof XT?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&UT.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&UT.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&UT.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&UT.IncludeAnonymous||e instanceof KT||!e.type.isAnonymous||aE(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new eE(this.buffer,t,this.stack[e]);return this.bufferNode=new eE(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return QT(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return QT(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function aE(e){return e.children.some(e=>e instanceof KT||!e.type.isAnonymous||aE(e))}function oE(e){let{buffer:t,nodeSet:n,maxBufferLength:r=NT,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new GT(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,ee=c;if(w<0)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let E=s[x],D,te,ne=S-e;if(C-S<=r&&(te=h(o.pos-t,y))){let t=new Uint16Array(te.size-te.skip),r=o.pos-te.size,i=t.length;for(;o.pos>r;)i=g(te.start,t,i);D=new KT(t,C-te.start,n),ne=te.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,ee),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,ee),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(E,ee);D=lE(E,t,n,0,t.length,0,C-S,e,e)}else D=m(E,t,n,C-S,T-C,ee)}_.push(D),v.push(ne)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new KT(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof WT){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(IT.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[IT.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[IT.lookAhead,i];o=o?[e].concat(o):[e]}return new WT(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new WT(s[e.topID],_.reverse(),v.reverse(),y)}var sE=new WeakMap;function cE(e,t){if(!e.isAnonymous||t instanceof KT||t.type!=e)return 1;let n=sE.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof WT)){n=1;break}n+=cE(e,r)}sE.set(t,n)}return n}function lE(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=cE(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=cE(e,t[s]);for(s++;s<i;s++){let n=cE(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(lE(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var uE=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},dE=class{startParse(e,t,n){return typeof e==`string`&&(e=new fE(e)),n=n?n.length?n.map(e=>new FT(e.from,e.to)):[new FT(0,0)]:[new FT(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},fE=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new IT({perNode:!0});var pE=0,mE=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=pE++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new gE(e);return e=>e.modified.indexOf(t)>-1?e:gE.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},hE=0,gE=class e{constructor(e){this.name=e,this.instances=[],this.id=hE++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&_E(n,e.modified));if(r)return r;let i=[],a=new mE(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=vE(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function _E(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function vE(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function yE(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new xE(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return bE.add(t)}var bE=new IT({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new xE(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),xE=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};xE.empty=new xE([],2,null);function SE(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function CE(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function wE(e,t,n,r=0,i=e.length){let a=new TE(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var TE=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=EE(e)||xE.empty,u=CE(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(IT.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function EE(e){let t=e.type.prop(bE);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var Y=mE.define,DE=Y(),OE=Y(),kE=Y(OE),AE=Y(OE),jE=Y(),ME=Y(jE),NE=Y(jE),PE=Y(),FE=Y(PE),IE=Y(),LE=Y(),RE=Y(),zE=Y(RE),BE=Y(),X={comment:DE,lineComment:Y(DE),blockComment:Y(DE),docComment:Y(DE),name:OE,variableName:Y(OE),typeName:kE,tagName:Y(kE),propertyName:AE,attributeName:Y(AE),className:Y(OE),labelName:Y(OE),namespace:Y(OE),macroName:Y(OE),literal:jE,string:ME,docString:Y(ME),character:Y(ME),attributeValue:Y(ME),number:NE,integer:Y(NE),float:Y(NE),bool:Y(jE),regexp:Y(jE),escape:Y(jE),color:Y(jE),url:Y(jE),keyword:IE,self:Y(IE),null:Y(IE),atom:Y(IE),unit:Y(IE),modifier:Y(IE),operatorKeyword:Y(IE),controlKeyword:Y(IE),definitionKeyword:Y(IE),moduleKeyword:Y(IE),operator:LE,derefOperator:Y(LE),arithmeticOperator:Y(LE),logicOperator:Y(LE),bitwiseOperator:Y(LE),compareOperator:Y(LE),updateOperator:Y(LE),definitionOperator:Y(LE),typeOperator:Y(LE),controlOperator:Y(LE),punctuation:RE,separator:Y(RE),bracket:zE,angleBracket:Y(zE),squareBracket:Y(zE),paren:Y(zE),brace:Y(zE),content:PE,heading:FE,heading1:Y(FE),heading2:Y(FE),heading3:Y(FE),heading4:Y(FE),heading5:Y(FE),heading6:Y(FE),contentSeparator:Y(PE),list:Y(PE),quote:Y(PE),emphasis:Y(PE),strong:Y(PE),link:Y(PE),monospace:Y(PE),strikethrough:Y(PE),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:BE,documentMeta:Y(BE),annotation:Y(BE),processingInstruction:Y(BE),definition:mE.defineModifier(`definition`),constant:mE.defineModifier(`constant`),function:mE.defineModifier(`function`),standard:mE.defineModifier(`standard`),local:mE.defineModifier(`local`),special:mE.defineModifier(`special`)};for(let e in X){let t=X[e];t instanceof mE&&(t.name=e)}SE([{tag:X.link,class:`tok-link`},{tag:X.heading,class:`tok-heading`},{tag:X.emphasis,class:`tok-emphasis`},{tag:X.strong,class:`tok-strong`},{tag:X.keyword,class:`tok-keyword`},{tag:X.atom,class:`tok-atom`},{tag:X.bool,class:`tok-bool`},{tag:X.url,class:`tok-url`},{tag:X.labelName,class:`tok-labelName`},{tag:X.inserted,class:`tok-inserted`},{tag:X.deleted,class:`tok-deleted`},{tag:X.literal,class:`tok-literal`},{tag:X.string,class:`tok-string`},{tag:X.number,class:`tok-number`},{tag:[X.regexp,X.escape,X.special(X.string)],class:`tok-string2`},{tag:X.variableName,class:`tok-variableName`},{tag:X.local(X.variableName),class:`tok-variableName tok-local`},{tag:X.definition(X.variableName),class:`tok-variableName tok-definition`},{tag:X.special(X.variableName),class:`tok-variableName2`},{tag:X.definition(X.propertyName),class:`tok-propertyName tok-definition`},{tag:X.typeName,class:`tok-typeName`},{tag:X.namespace,class:`tok-namespace`},{tag:X.className,class:`tok-className`},{tag:X.macroName,class:`tok-macroName`},{tag:X.propertyName,class:`tok-propertyName`},{tag:X.operator,class:`tok-operator`},{tag:X.comment,class:`tok-comment`},{tag:X.meta,class:`tok-meta`},{tag:X.invalid,class:`tok-invalid`},{tag:X.punctuation,class:`tok-punctuation`}]);var VE=new IT;function HE(e){return W.define({combine:e?t=>t.concat(e):void 0})}var UE=new IT,WE=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,jh.prototype.hasOwnProperty(`tree`)||Object.defineProperty(jh.prototype,`tree`,{get(){return KE(this)}}),this.parser=t,this.extension=[tD.of(this),jh.languageData.of((e,t,n)=>{let r=GE(e,t,n),i=r.type.prop(VE);if(!i)return[];let a=e.facet(i),o=r.type.prop(UE);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return GE(e,t,n).type.prop(VE)==this.data}findRegions(e){let t=e.facet(tD);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(VE)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(IT.mounted);if(i){if(i.tree.prop(VE)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof WT&&r(i,e.positions[n]+t)}};return r(KE(e),0),n}get allowsNesting(){return!0}};WE.setState=gh.define();function GE(e,t,n){let r=e.facet(tD),i=KE(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,UT.ExcludeBuffers|UT.EnterBracketed))e.type.isTop&&(i=e);return i}function KE(e){let t=e.field(WE.state,!1);return t?t.tree:WT.empty}var qE=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},JE=null,YE=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],WT.empty,0,r,[],null)}startParse(){return this.parser.startParse(new qE(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=WT.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(uE.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(uE.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=JE;JE=this;try{return e()}finally{JE=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=XE(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=uE.applyChanges(r,e),i=WT.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=XE(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends dE{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=JE;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new WT(zT.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return JE}};function XE(e,t,n){return uE.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var ZE=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=YE.create(t.facet(tD).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};WE.state=Ym.define({create:ZE.init,update(e,t){for(let e of t.effects)if(e.is(WE.setState))return e.value;return t.startState.facet(tD)==t.state.facet(tD)?e.apply(t):ZE.init(t.state)}});var QE=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(QE=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var $E=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,eD=ev.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(WE.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(WE.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=QE(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(WE.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!$E?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>$E&&$E()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:WE.setState.of(new ZE(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>X_(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),tD=W.define({combine(e){return e.length?e[0]:null},enables:e=>[WE.state,eD,lx.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),nD=W.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function rD(e){let t=e.facet(nD);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}var iD=new IT,aD=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=ng.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof WE?e=>e.prop(VE)==a.data:a?e=>e==a:void 0,this.style=SE(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new ng(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},oD=W.define(),sD=W.define({combine(e){return e.length?[e[0]]:null}});function cD(e){let t=e.facet(oD);return t.length?t:e.facet(sD)}function lD(e,t){let n=[dD],r;return e instanceof aD&&(e.module&&n.push(lx.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(sD.of(e)):r?n.push(oD.computeN([lx.darkTheme],t=>t.facet(lx.darkTheme)==(r==`dark`)?[e]:[])):n.push(oD.of(e)),n}var uD=class{constructor(e){this.markCache=Object.create(null),this.tree=KE(e.state),this.decorations=this.buildDeco(e,cD(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=KE(e.state),n=cD(e.state),r=n!=cD(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ag.none;let n=new Bh;for(let{from:r,to:i}of e.visibleRanges)wE(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Ag.mark({class:r})))},r,i);return n.finish()}},dD=Qm.high(ev.fromClass(uD,{decorations:e=>e.decorations}));X.meta,X.link,X.heading,X.emphasis,X.strong,X.strikethrough,X.keyword,X.atom,X.bool,X.url,X.contentSeparator,X.labelName,X.literal,X.inserted,X.string,X.deleted,X.regexp,X.escape,X.string,X.variableName,X.variableName,X.typeName,X.namespace,X.className,X.variableName,X.macroName,X.propertyName,X.comment,X.invalid;function fD(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}var pD=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=fD(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??fD(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}};function mD(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||hD,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||CD,mergeTokens:e.mergeTokens!==!1}}function hD(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}var gD=new WeakMap,_D=class e extends WE{constructor(e){let t=HE(e.languageData),n=mD(e),r,i=new class extends dE{createParse(e,t,n){return new xD(r,e,t,n)}};super(t,i,[],e.name),this.topNode=ND(t,this),r=this,this.streamParser=n,this.stateAfter=new IT({perNode:!0}),this.tokenTable=e.tokenTable?new kD(n.tokenTable):AD}static define(t){return new e(t)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=gD.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=vD(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new pD(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)SD(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&gD.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}};function vD(e,t,n,r,i){let a=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let o=t.children[a],s=n+t.positions[a],c=o instanceof WT&&s<i&&vD(e,o,s,r,i);if(c)return c}return null}function yD(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&n==0&&t.type==e.topNode&&(i=!0);for(let a=t.children.length-1;a>=0;a--){let o=t.positions[a],s=t.children[a],c;if(o<r&&s instanceof WT){if(!(c=yD(e,s,n-o,r-o,i)))break;return i?new WT(t.type,t.children.slice(0,a).concat(c),t.positions.slice(0,a+1),o+c.length):c}}return null}function bD(e,t,n,r,i){for(let i of t){let t=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),o=t<=n&&a>n&&vD(e,i.tree,0-i.offset,n,a),s;if(o&&o.pos<=r&&(s=yD(e,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(i?rD(i):4),tree:WT.empty}}var xD=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=YE.get(),a=r[0].from,{state:o,tree:s}=bD(e,n,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(rD(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=YE.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
804
804
|
`&&(t=``);else{let e=t.indexOf(`
|
|
805
805
|
`);e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length))break;let i=this.ranges[e].from,a=this.lineAfter(i);t+=a,n=i+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;let a=this.ranges[++this.rangeIndex].from;t+=a-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let e=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-e}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==t?this.chunk[a+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,a=new pD(t,e?e.state.tabSize:4,e?rD(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let e=SD(i.token,a,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=WT.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:TD,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new WT(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new WT(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function SD(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error(`Stream parser failed to advance stream.`)}var CD=Object.create(null),wD=[zT.none],TD=new BT(wD),ED=[],DD=Object.create(null),OD=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])OD[e]=MD(CD,t);var kD=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),OD)}resolve(e){return e?this.table[e]||(this.table[e]=MD(this.extra,e)):0}},AD=new kD(CD);function jD(e,t){ED.indexOf(e)>-1||(ED.push(e),console.warn(t))}function MD(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||X[n];r?typeof r==`function`?t.length?t=t.map(r):jD(n,`Modifier ${n} used at start of tag`):t.length?jD(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:jD(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=DD[i];if(a)return a.id;let o=DD[i]=zT.define({id:wD.length,name:r,props:[yE({[r]:n})]});return wD.push(o),o.id}function ND(e,t){let n=zT.define({id:wD.length,name:`Document`,props:[VE.add(()=>e),iD.add(()=>e=>t.getIndent(e))],top:!0});return wD.push(n),n}f_.RTL,f_.LTR;var PD=new Set(`alias break case const const_assert continue continuing default diagnostic discard else enable false fn for if let loop override requires return struct switch true var while`.split(` `)),FD=new Set(`bool f16 f32 i32 u32 vec2f vec3f vec4f vec2i vec3i vec4i vec2u vec3u vec4u mat2x2f mat3x3f mat4x4f array atomic ptr sampler sampler_comparison texture_2d texture_2d_array texture_3d texture_cube`.split(` `)),ID=new Set(`abs acos asin atan atan2 ceil clamp cos cross degrees distance dot exp floor fract length max min mix normalize pow radians reflect refract round sign sin smoothstep sqrt step tan textureDimensions textureLoad textureSample textureStore`.split(` `)),LD=_D.define({startState:()=>({}),token(e){if(e.eatSpace())return null;if(e.match(`//`))return e.skipToEnd(),`comment`;if(e.peek()===`"`){for(e.next();e.peek()!==void 0&&e.next()!==`"`;)e.current().endsWith(`\\`)&&e.next();return`string`}if(e.peek()===`@`)return e.next(),e.match(/[A-Za-z_][\w]*/,!0),`keyword`;if(e.match(/(?:0[xX][0-9a-fA-F_]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?[uifh]?|\.\d+)/,!0))return`number`;if(e.match(/[A-Za-z_][\w]*/,!0)){let t=e.current();return PD.has(t)?`keyword`:FD.has(t)?`typeName`:ID.has(t)?`builtin`:`variableName`}return e.next(),/[+\-*/%&|^~!=<>?:;,()[\]{}]/.test(e.current())?`operator`:null}}),RD=lD(aD.define([{tag:X.keyword,color:`#c678dd`},{tag:X.typeName,color:`#e5c07b`},{tag:X.variableName,color:`#abb2bf`},{tag:X.comment,color:`#5c6370`,fontStyle:`italic`},{tag:X.string,color:`#98c379`},{tag:X.number,color:`#d19a66`},{tag:X.operator,color:`#56b6c2`},{tag:X.function(X.variableName),color:`#61afef`}]));function zD(e,t){let n=t.line??1,r=Math.min(Math.max(1,n),e.state.doc.lines),i=e.state.doc.line(r),a=Math.max(1,t.column??1),o=Math.min(i.to,i.from+a-1);return{from:o,to:Math.min(i.to,Math.max(o,o+1)),severity:`error`,source:`WGSL`,message:`${t.code}: ${t.detail}`}}function BD({selection:e}){let t=(0,l.useRef)(null),n=(0,l.useRef)(null),r=(0,l.useRef)(null),i=(0,l.useRef)(new TT),a=(0,l.useRef)(!1),o=(0,l.useRef)(0),[s,c]=(0,l.useState)(!1),[d,f]=(0,l.useState)(null),[p,m]=(0,l.useState)(null),[h,g]=(0,l.useState)(null),_=ST(e);(0,l.useEffect)(()=>{if(n.current?.destroy(),t.current?.replaceChildren(),!(!t.current||e.source===``))return n.current=new lx({state:jh.create({doc:e.source,extensions:[LD,RD,oS(),KS(),lx.editable.of(s),jh.readOnly.of(!s)]}),parent:t.current}),()=>n.current?.destroy()},[e.source,s]),(0,l.useEffect)(()=>(a.current=!0,()=>{a.current=!1,o.current+=1,i.current.abort()}),[]),(0,l.useEffect)(()=>()=>{o.current+=1,i.current.abort(),g(null),f(null),m(null);let e=r.current;e!==null&&(e.width=0,e.height=0)},[_]);async function v(){let t=n.current;if(!t)return;let s=++o.current;f(`Compiling WGSL and rendering a temporary preview...`),m(null),t.dispatch(pS(t.state,[]));let c=r.current,l=await i.current.apply(e,t.state.doc.toString(),c===null?{}:{canvas:c});if(!(!a.current||o.current!==s||n.current!==t)){if(!l.ok){g(null),m(l.error),f(l.error.detail??l.error.code),t.dispatch(pS(t.state,[zD(t,l.error)]));return}g(l.value),m(null),f(`Preview ready (${l.value.provenance}); pixels ${l.value.pixelDigest}; canonical tape unchanged.`)}}function y(){let t=n.current;o.current+=1,i.current.abort(),g(null),f(null),m(null),t&&(t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e.source}}),t.dispatch(pS(t.state,[])));let a=r.current;a!==null&&(a.width=0,a.height=0)}let b=CT(e);return b.ok?(0,u.jsxs)(`div`,{className:`mt-2 space-y-2`,"data-forgeax-shader-editor":!0,"data-forgeax-editor-key":_,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[(0,u.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[e.stage,` / `,e.entryPoint]}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`forgeax-button-quiet h-6 px-2 text-[10px]`,children:s?`Done`:`Edit`}),s&&(0,u.jsxs)(`button`,{type:`button`,onClick:()=>void v(),className:`forgeax-button-primary h-6 px-2 text-[10px]`,children:[(0,u.jsx)(wo,{size:11}),` Apply`]}),s&&(0,u.jsxs)(`button`,{type:`button`,onClick:y,className:`forgeax-button-quiet h-6 px-2 text-[10px]`,children:[(0,u.jsx)(Co,{size:11}),` Reset`]})]}),s&&(0,u.jsx)(`p`,{className:`text-[10px] text-brand`,children:`Preview only. No tape, model, replay, or canonical pixels are written.`}),(0,u.jsx)(`div`,{ref:t,className:`max-h-64 overflow-auto rounded-lg border border-border text-xs`}),(0,u.jsx)(`canvas`,{ref:r,className:h===null?`hidden`:`mt-2 h-48 w-48 rounded border border-brand/50`,...h===null?{}:{[Mo()]:``},"aria-label":`Viewer-private shader preview`}),h!==null&&(0,u.jsxs)(`p`,{className:`text-[10px] text-brand`,children:[`preview provenance · `,h.width,`x`,h.height,` · `,h.pixelDigest]}),d&&(0,u.jsxs)(`div`,{className:`text-[10px] text-muted-foreground space-y-0.5`,role:`status`,"data-forgeax-preview-error":p?.code,children:[(0,u.jsx)(`p`,{children:d}),p!==null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`p`,{"data-forgeax-preview-code":!0,children:p.code}),(0,u.jsx)(`p`,{"data-forgeax-preview-detail":!0,children:p.detail}),(0,u.jsx)(`p`,{"data-forgeax-preview-expected":!0,children:p.expected}),(0,u.jsx)(`p`,{"data-forgeax-preview-hint":!0,children:p.hint}),p.line!==void 0&&(0,u.jsxs)(`p`,{"data-forgeax-preview-line":String(p.line),children:[`line `,p.line]}),p.column!==void 0&&(0,u.jsxs)(`p`,{"data-forgeax-preview-column":String(p.column),children:[`column `,p.column]})]})]})]}):(0,u.jsxs)(`div`,{className:`text-xs text-muted-foreground space-y-1`,"data-forgeax-preview-error":b.error.code,children:[(0,u.jsxs)(`p`,{children:[(0,u.jsx)(`span`,{"data-forgeax-preview-code":!0,children:b.error.code}),`:`,` `,b.error.detail]}),(0,u.jsx)(`p`,{"data-forgeax-preview-expected":!0,children:b.error.expected}),(0,u.jsx)(`p`,{"data-forgeax-preview-hint":!0,children:b.error.hint})]})}var VD=[`inputAssembly`,`vertexInput`,`shaders`,`rasterizer`,`depthStencil`,`blend`,`multisample`,`resourceBindings`],HD={inputAssembly:`Input Assembly`,vertexInput:`Vertex Input`,shaders:`Shaders`,rasterizer:`Rasterizer`,depthStencil:`Depth-Stencil`,blend:`Blend`,multisample:`Multisample`,resourceBindings:`Resource Bindings`};function UD(e){let t=2166136261;for(let n of JSON.stringify(e))t^=n.charCodeAt(0),t=Math.imul(t,16777619);return`fnv1a:${(t>>>0).toString(16)}`}function WD(e,t,n){let r=e.works.find(e=>e.workIndex===t),i=r?.pipeline.shaders.find(e=>e.stage===n);if(r===void 0||i===void 0)return null;let a=Object.fromEntries(r.pipeline.shaders.filter(e=>(e.stage===`vertex`||e.stage===`fragment`)&&e.source!==null).map(e=>[e.stage,{source:e.source,entryPoint:e.entryPoint}])),o={tapeDigest:UD(e),workIndex:t,stage:i.stage,shaderModuleId:i.moduleHandleId,entryPoint:i.entryPoint,source:i.source??``,pipelineKind:r.pipeline.kind??`compute`,work:{drawCall:r.drawCall,pipeline:r.pipeline,bindings:r.bindings,vertexBuffers:r.vertexBuffers,indexBuffer:r.indexBuffer,attachments:r.attachments}};return Object.keys(a).length===0?o:{...o,stages:a}}function GD(e){let t=Yp(),n=am(),{selectedWorkIndex:r,selectResource:i}=Eo(),a=(t?.works??[]).find(e=>e.workIndex===r),o=a!==void 0,s=e=>{if(t===null)return;let r=tm(t,e);if(r!==void 0){i(r.resourceId),n(`draw-call-viewer`);return}i(e),n(`resource-inspector`)};return(0,u.jsxs)(`section`,{className:`forgeax-panel overflow-auto`,[Io()]:o?`selected`:`default`,children:[(0,u.jsxs)(`header`,{className:`forgeax-panel-header`,children:[(0,u.jsx)(`span`,{children:`Pipeline State`}),o&&(0,u.jsxs)(`span`,{className:`forgeax-badge`,children:[`work `,a.workIndex]})]}),!o||t===null?(0,u.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`Select a work item to view pipeline state`}):(0,u.jsxs)(`div`,{className:`space-y-3 p-3 text-xs`,children:[(0,u.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 rounded-lg border border-border/70 bg-background/45 p-2.5`,children:[(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:`workIndex`}),(0,u.jsx)(`span`,{"data-forgeax-work-index":String(a.workIndex),children:a.workIndex}),(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:`eventIndex`}),(0,u.jsx)(`span`,{children:a.eventIndex}),(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:`passIndex`}),(0,u.jsx)(`span`,{children:a.passIndex}),(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:`method`}),(0,u.jsx)(`span`,{className:`font-mono`,children:a.kind})]}),(0,u.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:VD.map(e=>(0,u.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-background/35 p-2`,children:[(0,u.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-brand`,children:HD[e]}),(0,u.jsx)(`div`,{className:`mt-1 break-all text-muted-foreground`,children:e===`shaders`?a.pipeline.shaders.map(e=>`${e.stage}:${e.entryPoint??`-`}`).join(`, `)||`none`:e===`resourceBindings`?a.bindings.length===0?`none`:`${a.bindings.length} bindings · ${a.bindings.map(e=>e.resourceKind??`unknown`).join(`, `)}`:e===`vertexInput`?`${a.vertexBuffers.length} vertex buffers${a.indexBuffer===null?``:`, index ${a.indexBuffer.format}`}`:e===`inputAssembly`?JSON.stringify(a.drawCall):e===`rasterizer`?a.pipeline.kind??`unavailable`:e===`depthStencil`?a.attachments?.depthStencilViewHandleId??`none`:`captured`})]},e))}),(0,u.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2 rounded-lg border border-border/70 bg-background/35 p-2.5`,children:[(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:`pipeline`}),a.pipeline.pipelineHandleId===void 0?(0,u.jsx)(`span`,{className:`font-mono`,children:a.pipeline.status}):(0,u.jsx)(`button`,{type:`button`,className:`forgeax-resource-link`,"aria-label":`Open ${a.pipeline.pipelineHandleId} in Resource Inspector`,title:`Double-click to open Resource Inspector`,onDoubleClick:()=>s(a.pipeline.pipelineHandleId),children:a.pipeline.pipelineHandleId}),(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:`pipeline descriptor`}),(0,u.jsx)(`span`,{className:`break-all font-mono text-[10px]`,"data-forgeax-pipeline-descriptor":!0,children:a.pipeline.descriptor===void 0?a.pipeline.reason??`unavailable`:JSON.stringify(a.pipeline.descriptor)}),a.pipeline.shaders.map(e=>{let n=WD(t,a.workIndex,e.stage);return(0,u.jsxs)(`div`,{className:`col-span-2 rounded-md border border-border/70 bg-background/50 p-2`,children:[(0,u.jsxs)(`span`,{className:`font-mono`,children:[e.stage,` `,e.moduleHandleId,` `,e.entryPoint??`-`]}),n===null?(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`Shader facts unavailable.`}):(0,u.jsx)(BD,{selection:n})]},e.stage)}),a.bindings.map(e=>{let n=e.resourceId,r=(n===null?void 0:tm(t,n))===void 0?`Resource Inspector`:`Draw Call Viewer`;return(0,u.jsxs)(`button`,{type:`button`,className:`forgeax-resource-link col-span-2`,"aria-label":`Open ${n??`unavailable resource`} in ${r}`,title:`Double-click to open ${r}`,disabled:n===null,onDoubleClick:()=>{n!==null&&s(n)},children:[`group `,e.groupIndex,` · binding `,e.binding,` ·`,` `,e.resourceKind??`unknown`,` · `,e.bindGroupId,` ·`,` `,n??`no resource`]},`${e.groupIndex}:${e.binding}`)}),a.vertexBuffers.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`forgeax-resource-link col-span-2`,"aria-label":`Open ${e.bufferHandleId} in Resource Inspector`,title:`Double-click to open Resource Inspector`,onDoubleClick:()=>s(e.bufferHandleId),children:[`vertex slot `,e.slot,` `,e.bufferHandleId,` offset `,e.offset,` size`,` `,e.size??`all`]},e.slot)),a.indexBuffer!==null&&(0,u.jsxs)(`button`,{type:`button`,className:`forgeax-resource-link col-span-2`,"aria-label":`Open ${a.indexBuffer.bufferHandleId} in Resource Inspector`,title:`Double-click to open Resource Inspector`,onDoubleClick:()=>s(a.indexBuffer?.bufferHandleId),children:[`index `,a.indexBuffer.bufferHandleId,` `,a.indexBuffer.format,` offset`,` `,a.indexBuffer.offset,` size `,a.indexBuffer.size??`all`]})]})]})]})}function KD(e){return Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(` `)}function qD(e){if(e.byteLength<4||e.byteLength%4!=0)return`unavailable`;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=[];for(let r=0;r<e.byteLength;r+=4)n.push(t.getUint32(r,!0));return`uint32 [${n.join(`, `)}]`}function JD(e){let t=e.provenance.subresource;return e.kind!==`buffer`||t===null||!(`offset`in t)?{offset:0,size:e.bytes.byteLength}:{offset:t.offset,size:t.size??e.bytes.byteLength}}function YD(e){let t=Yp(),n=Zp(),{selectedWorkIndex:r,selectedResourceId:i,selectResource:a,selectWork:o}=Eo(),[s,c]=(0,l.useState)(``),[d,f]=(0,l.useState)(null),[p,m]=(0,l.useState)(null),h=(0,l.useMemo)(()=>{let e=t?.resources??[],n=s.trim().toLowerCase();return n.length===0?e:e.filter(e=>e.resourceId.toLowerCase().includes(n))},[s,t]),g=h.find(e=>e.resourceId===i)??(r>=0?h.find(e=>e.consumers.some(e=>e.workIndex===r)):void 0),_=(i===null?void 0:t?.resources.find(e=>e.resourceId===i))?.kind===`buffer`,v=r>=0||i!==null,y=e=>{let n=t?t.resources.find(t=>t.resourceId===e):void 0,r=n?.consumers.find(e=>e.workIndex!==null);r?.workIndex!==null&&r?.workIndex!==void 0&&o(r.workIndex,r.eventIndex,n?.createEventIndex??-1),a(e)};return(0,l.useEffect)(()=>{if(f(null),m(null),i===null||n===null||!_)return;let e=new AbortController;return n(i,void 0,e.signal).then(t=>{e.signal.aborted||(t.ok?f(t.value):m(t.error))}),()=>e.abort()},[n,_,i]),(0,u.jsxs)(`section`,{className:`forgeax-panel overflow-auto`,[Vo()]:v?`selected`:`empty`,children:[(0,u.jsxs)(`header`,{className:`forgeax-panel-header`,children:[(0,u.jsx)(`span`,{children:`Resource Inspector`}),(0,u.jsxs)(`span`,{className:`forgeax-badge`,children:[h.length,` shown`]})]}),(0,u.jsxs)(`div`,{className:`p-3`,children:[(0,u.jsxs)(`label`,{className:`forgeax-field-label block`,children:[(0,u.jsx)(`span`,{className:`mb-1 block`,children:`Filter resources`}),(0,u.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),className:`w-full font-mono normal-case tracking-normal`,placeholder:`texture:, buffer:, pipeline:...`,"aria-label":`Filter resource IDs`})]}),(0,u.jsx)(`div`,{className:`max-h-64 space-y-1 overflow-auto pt-3 pr-1`,children:h.length===0?(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No resources in tape`}):h.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:i===e.resourceId?`w-full rounded-md border border-brand/35 bg-brand/10 px-2 py-1.5 text-left text-xs text-brand`:`w-full rounded-md border border-border/70 bg-background/35 px-2 py-1.5 text-left text-xs transition-colors hover:border-brand/25 hover:bg-muted/60`,onClick:()=>y(e.resourceId),[Ho()]:e.resourceId,children:[(0,u.jsx)(`span`,{className:`font-mono`,children:e.resourceId}),(0,u.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:e.kind})]},e.resourceId))}),v&&(0,u.jsxs)(`p`,{className:`pt-3 text-[10px] text-muted-foreground`,children:[`Linked from workIndex `,r]}),g!==void 0&&(0,u.jsxs)(`div`,{className:`mt-3 space-y-1 rounded-lg border border-border/70 bg-background/45 p-2.5 text-xs`,children:[(0,u.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-brand`,children:`Resource facts`}),(0,u.jsx)(`div`,{className:`forgeax-code-block break-all`,children:JSON.stringify(g.descriptor)}),(0,u.jsxs)(`div`,{children:[`lifecycle `,g.lifecycle.state]}),(0,u.jsxs)(`div`,{children:[`consumers `,g.consumers.length]}),g.consumers.map(e=>(0,u.jsxs)(`div`,{className:`font-mono`,children:[`eventIndex `,e.eventIndex,` workIndex `,e.workIndex??`none`,` `,e.access]},`${e.eventIndex}:${e.access}`))]}),_&&i!==null&&d!==null&&(0,u.jsxs)(`div`,{className:`mt-3 rounded-lg border border-success/25 bg-success/5 p-2.5 text-xs`,children:[(0,u.jsxs)(`div`,{className:`text-brand`,children:[`Readback `,i]}),d.kind===`texture`?(0,u.jsxs)(`div`,{className:`font-mono`,children:[d.format??`texture`,` `,d.width??0,`x`,d.height??0,(0,u.jsxs)(`div`,{"data-forgeax-resource-provenance":!0,children:[d.provenance.resourceId,` `,JSON.stringify(d.provenance.subresource)]})]}):(0,u.jsx)(XD,{result:d})]}),_&&i!==null&&p!==null&&(0,u.jsxs)(`div`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger/5 p-2.5 text-xs text-danger`,children:[(0,u.jsx)(`div`,{"data-forgeax-buffer-status":p.code,children:p.code}),(0,u.jsx)(`div`,{children:p.code}),(0,u.jsx)(`div`,{children:p.hint})]}),_&&i!==null&&d===null&&p===null&&(0,u.jsx)(`div`,{className:`mt-3 text-xs text-muted-foreground`,"data-forgeax-buffer-status":`pending`,children:`Readback pending`})]})]})}function XD({result:e}){let t=JD(e);return(0,u.jsxs)(`div`,{className:`space-y-1 font-mono`,"data-forgeax-buffer-status":`ok`,children:[(0,u.jsxs)(`div`,{children:[`offset `,t.offset]}),(0,u.jsxs)(`div`,{children:[`size `,t.size]}),(0,u.jsxs)(`div`,{children:[`hex `,KD(e.bytes)]}),(0,u.jsx)(`div`,{children:qD(e.bytes)})]})}var ZD={mipLevel:0,arrayLayer:0,aspect:`all`,zoom:`fit`};function QD(e){return e?.endsWith(`-stencil8`)?[`depth-only`,`stencil-only`]:e?.startsWith(`depth`)?[`depth-only`]:[`all`]}function $D(e){if(typeof e!=`object`||!e)return tO();let t=e,n=t.desc!==null&&typeof t.desc==`object`?t.desc:t,r=n.size,i=Array.isArray(r)?r:typeof r==`object`&&r?[r.width,r.height,r.depthOrArrayLayers]:[];return{dimension:typeof n.dimension==`string`?n.dimension:`2d`,format:typeof n.format==`string`?n.format:null,width:eO(i[0],1),height:eO(i[1],1),arrayLayerCount:eO(i[2],1),mipLevelCount:eO(n.mipLevelCount,1)}}function eO(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0?e:t}function tO(){return{dimension:`2d`,format:null,width:1,height:1,arrayLayerCount:1,mipLevelCount:1}}var nO={x:0,y:0},rO=1,iO=65536,aO=.002;function oO(e,t,n){return Math.min(n,Math.max(t,e))}function sO(e){let t=Yp(),n=Xp(),r=Zp(),i=Qp(),{selectedWorkIndex:a,selectedResourceId:o,selectResource:s}=Eo(),[c,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),[g,_]=(0,l.useState)(ZD),[v,y]=(0,l.useState)(nO),[b,x]=(0,l.useState)(!1),S=(0,l.useRef)(null),C=(0,l.useRef)(null),w=(t?.works??[]).find(e=>e.workIndex===a),T=t===null?[]:nm(t,w),ee=t!==null&&o!==null?tm(t,o):void 0,E=T.find(e=>e.resourceId===ee?.resourceId),D=T[0],te=E??D,ne=$D(te?.descriptor),re=QD(ne.format),O=re.includes(g.aspect)?g.aspect:re[0],ie=w!==void 0,ae=ie?c??(i.kind===`webgpu`?`loading`:`no-webgpu`):`no-rt`;(0,l.useEffect)(()=>{if(m===null||S.current===null)return;let e=S.current;e.width=m.width,e.height=m.height;let t=e.getContext(`2d`);if(t===null)return;let n=t.createImageData(m.width,m.height);n.data.set(m.rgba),t.putImageData(n,0,0)},[m]);let oe=(0,l.useCallback)(e=>{y(nO),_(t=>({...t,zoom:e}))},[]),se=(0,l.useCallback)(e=>{if(m===null)return;e.preventDefault();let t=e.currentTarget.getBoundingClientRect();if(t.width<=0||t.height<=0)return;let n=g.zoom===`fit`?Math.min(t.width/m.width,t.height/m.height):g.zoom/100,r=m.width*n,i=m.height*n,a=t.left+(t.width-r)/2+v.x,o=t.top+(t.height-i)/2+v.y,s=oO((e.clientX-a)/r,0,1),c=oO((e.clientY-o)/i,0,1),l=e.deltaY*(e.deltaMode===1?16:e.deltaMode===2?t.height:1),u=Math.round(oO(n*Math.exp(-l*aO)*100,rO,iO)),d=m.width*(u/100),f=m.height*(u/100),p=t.left+(t.width-d)/2,h=t.top+(t.height-f)/2;y({x:e.clientX-s*d-p,y:e.clientY-c*f-h}),_(e=>({...e,zoom:u}))},[v.x,v.y,m,g.zoom]),ce=(0,l.useCallback)(e=>{e.button!==0||m===null||(e.preventDefault(),C.current={pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,pan:v},x(!0),e.currentTarget.setPointerCapture?.(e.pointerId))},[v,m]),le=(0,l.useCallback)(e=>{let t=C.current;t===null||t.pointerId!==e.pointerId||(e.preventDefault(),y({x:t.pan.x+e.clientX-t.originX,y:t.pan.y+e.clientY-t.originY}))},[]),ue=(0,l.useCallback)(e=>{C.current?.pointerId===e.pointerId&&(C.current=null,x(!1),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),de=(0,l.useCallback)(async e=>{if(E===void 0&&(w===void 0||n===null))return;d(i.kind===`webgpu`?`loading`:`no-webgpu`),p(null);let t=E!==void 0&&r!==null?await r(E.resourceId,{mipLevel:g.mipLevel,arrayLayer:g.arrayLayer,aspect:O},e):w===void 0||n===null?null:await n(w.workIndex,[`pixels`],e);if(e?.aborted)return;let a=i.kind===`no-webgpu`;if(t===null)return;if(!t.ok){h(null),p(t.error),d(a?`no-webgpu`:`error`);return}p(null);let o=`attachment`in t.value?t.value.attachment:t.value;if(o?.kind!==`texture`||o.format===void 0||o.width===void 0||o.height===void 0){h(null),p({code:`readback-failed`,expected:`a texture attachment with format, width, height, and bytes`,hint:`inspect the selected resource descriptor and retry the readback operation`,detail:{stage:`readback`,cause:`canonical readback did not contain a decodable texture attachment`}}),d(`error`);return}let s=wc(o.bytes,o.format,o.width,o.height,O);if(s===null){h(null),p({code:`readback-failed`,expected:`a decodable color texture readback`,hint:`inspect the recorded texture format and retry the readback operation`,detail:{stage:`readback`,cause:`texture format ${o.format} could not be decoded by the viewer`}}),d(`error`);return}h({width:o.width,height:o.height,rgba:s}),d(`ok`)},[i.kind,E,n,r,g.arrayLayer,O,g.mipLevel,w]);return(0,l.useEffect)(()=>{if(!ie)return;let e=new AbortController;return de(e.signal),()=>e.abort()},[de,ie]),(0,u.jsxs)(`section`,{className:`forgeax-panel overflow-auto`,[Lo()]:ie?`selected`:`default`,[No()]:i.kind,children:[(0,u.jsxs)(`header`,{className:`forgeax-panel-header`,children:[(0,u.jsx)(`span`,{children:`Draw Call Viewer`}),ie&&(0,u.jsxs)(`span`,{className:`forgeax-badge`,children:[`work `,w.workIndex]})]}),ie?(0,u.jsxs)(`div`,{className:`space-y-3 p-3 text-xs`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:E===void 0?`Draw attachment`:`Selected resource`}),(0,u.jsx)(`span`,{className:ae===`ok`?`forgeax-badge border-success/30 bg-success/10 text-success`:ae===`error`?`forgeax-badge border-danger/30 bg-danger/10 text-danger`:`forgeax-badge`,[jo()]:ae,children:ae===`ok`?`pixels ready`:ae})]}),te!==void 0&&(0,u.jsxs)(`div`,{className:`space-y-1`,children:[(0,u.jsxs)(`div`,{className:`font-mono text-[11px] text-brand`,children:[E===void 0?`attachment`:`resource`,` ·`,` `,te.resourceId]}),(0,u.jsx)(`div`,{className:`forgeax-code-block break-all`,children:JSON.stringify(te.descriptor)})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 rounded-lg border border-border/70 bg-background/45 p-2`,children:[(0,u.jsxs)(`div`,{className:`forgeax-segmented`,children:[(0,u.jsx)(`button`,{type:`button`,className:g.zoom===`fit`?`forgeax-segment-active`:`forgeax-segment`,onClick:()=>oe(`fit`),children:`Fit`}),(0,u.jsx)(`button`,{type:`button`,className:g.zoom===100?`forgeax-segment-active`:`forgeax-segment`,onClick:()=>oe(100),children:`1:1`})]}),(0,u.jsxs)(`label`,{className:`forgeax-field-label`,children:[(0,u.jsx)(`span`,{children:`Zoom`}),(0,u.jsx)(`input`,{"aria-label":`Texture zoom`,className:`w-16 font-mono`,value:g.zoom===`fit`?`fit`:g.zoom,onChange:e=>{let t=Number(e.target.value);oe(Number.isFinite(t)?oO(Math.round(t),rO,iO):`fit`)},[zo()]:g.zoom===`fit`?`fit`:String(g.zoom)})]}),(0,u.jsxs)(`label`,{className:`forgeax-field-label`,children:[(0,u.jsx)(`span`,{children:`Mip`}),(0,u.jsx)(`select`,{className:`min-w-14 font-mono`,value:g.mipLevel,onChange:e=>_(t=>({...t,mipLevel:Number(e.target.value)})),children:Array.from({length:ne.mipLevelCount},(e,t)=>({key:`mip-${t}`,value:t})).map(e=>(0,u.jsx)(`option`,{value:e.value,children:e.value},e.key))})]}),(0,u.jsxs)(`label`,{className:`forgeax-field-label`,children:[(0,u.jsx)(`span`,{children:`Slice`}),(0,u.jsx)(`select`,{className:`min-w-14 font-mono`,value:g.arrayLayer,onChange:e=>_(t=>({...t,arrayLayer:Number(e.target.value)})),[Ro()]:String(g.arrayLayer),children:Array.from({length:ne.arrayLayerCount},(e,t)=>({key:`layer-${t}`,value:t})).map(e=>(0,u.jsx)(`option`,{value:e.value,children:e.value},e.key))})]}),(0,u.jsxs)(`label`,{className:`forgeax-field-label`,children:[(0,u.jsx)(`span`,{children:`Aspect`}),(0,u.jsx)(`select`,{className:`min-w-24`,value:O,onChange:e=>_(t=>({...t,aspect:e.target.value})),children:re.map(e=>(0,u.jsx)(`option`,{value:e,children:e},e))})]}),(0,u.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:`Wheel zoom · left-drag pan`})]}),(0,u.jsx)(`div`,{className:`forgeax-status-card space-y-2`,[jo()]:ae,children:(0,u.jsxs)(`div`,{className:`forgeax-texture-stage ${b?`is-dragging`:``}`,"data-forgeax-texture-stage":``,onWheel:se,onPointerDown:ce,onPointerMove:le,onPointerUp:ue,onPointerCancel:ue,onLostPointerCapture:ue,children:[m!==null&&(0,u.jsx)(`canvas`,{"aria-label":`RHI debug texture pixels`,"data-forgeax-rt-canvas":``,ref:S,className:`image-pixelated`,style:m===null||g.zoom===`fit`?{width:`100%`,height:`100%`,maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,transform:`translate3d(${v.x}px, ${v.y}px, 0)`}:{width:`${Math.max(1,m.width*(g.zoom/100))}px`,height:`${Math.max(1,m.height*(g.zoom/100))}px`,maxWidth:`none`,maxHeight:`none`,transform:`translate3d(${v.x}px, ${v.y}px, 0)`}}),ae!==`ok`&&(0,u.jsx)(`div`,{className:`absolute inset-0 z-10 grid place-items-center overflow-auto bg-background/72 p-4 text-center backdrop-blur-[2px]`,"data-forgeax-texture-overlay":ae,children:ae===`no-webgpu`?(0,u.jsxs)(`div`,{className:`max-w-md space-y-1`,children:[(0,u.jsx)(`strong`,{children:`Pixels unavailable: no WebGPU`}),(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`Structure is available; open this tape in a WebGPU host to inspect pixels.`}),f!==null&&(0,u.jsxs)(`div`,{className:`text-danger space-y-1`,"data-forgeax-readback-error":f.code,children:[(0,u.jsx)(`strong`,{children:f.code}),(0,u.jsx)(`p`,{"data-forgeax-readback-detail":!0,children:JSON.stringify(f.detail)}),(0,u.jsx)(`p`,{"data-forgeax-readback-expected":!0,children:f.expected}),(0,u.jsx)(`p`,{"data-forgeax-readback-hint":!0,children:f.hint})]})]}):ae===`no-rt`?(0,u.jsxs)(`div`,{className:`text-muted-foreground`,children:[(0,u.jsx)(`p`,{className:`font-medium text-foreground`,children:`Pixel replay is ready`}),(0,u.jsx)(`p`,{className:`mt-1`,children:`Inspect the selected draw attachment or choose a texture.`})]}):ae===`loading`?(0,u.jsxs)(`div`,{"data-forgeax-texture-loading-overlay":``,children:[(0,u.jsx)(`div`,{className:`mx-auto h-5 w-5 animate-spin rounded-full border-2 border-brand/20 border-t-brand`}),(0,u.jsx)(`p`,{className:`mt-3 font-medium text-foreground`,children:`Replaying selected work`}),(0,u.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Keeping the viewport stable until fresh pixels arrive`})]}):(0,u.jsxs)(`div`,{className:`text-danger max-w-md space-y-1`,"data-forgeax-readback-error":f?.code??`readback-failed`,children:[(0,u.jsx)(`strong`,{children:f?.code??`readback-failed`}),(0,u.jsx)(`p`,{"data-forgeax-readback-detail":!0,children:f===null?`Pixel inspection failed.`:JSON.stringify(f.detail)}),(0,u.jsx)(`p`,{"data-forgeax-readback-expected":!0,children:f?.expected??`a successful canonical readback`}),(0,u.jsx)(`p`,{"data-forgeax-readback-hint":!0,children:f?.hint??`retry the readback operation`})]})})]})}),(0,u.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,[Bo()]:``,children:m===null?ae===`loading`?`Automatic readback in progress`:`Replay has not produced texels yet`:`${m.width}×${m.height} · first texel ${Array.from(m.rgba.slice(0,4)).join(`, `)}`}),(0,u.jsxs)(`div`,{className:`space-y-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Draw textures`}),(0,u.jsx)(`span`,{className:`forgeax-badge`,children:T.length})]}),T.length===0?(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No texture attachments or bindings for this work`}):(0,u.jsx)(`div`,{className:`grid max-h-44 grid-cols-2 gap-1 overflow-auto pr-1`,children:T.map((e,t)=>(0,u.jsx)(`button`,{type:`button`,className:E?.resourceId===e.resourceId?`rounded-md border border-brand/45 bg-brand/10 px-2 py-1.5 text-left font-mono text-[10px] text-brand`:`rounded-md border border-border/70 bg-background/35 px-2 py-1.5 text-left font-mono text-[10px] text-muted-foreground hover:border-brand/25 hover:text-foreground`,onClick:()=>s(e.resourceId),"data-forgeax-texture-thumbnail":String(t),children:e.resourceId},e.resourceId))})]})]}):(0,u.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`Select a work item to inspect its attachment`})]})}function cO(e){return vl(e)}async function lO(e){try{let t=new Uint8Array(await e.arrayBuffer()),n=cO(t);return n.ok?v({tape:n.value,artifactRef:{kind:`rhi-tape`,digest:await fO(t),source:`viewer.import`,path:e.name}}):n}catch(e){return y({code:`tape-invalid`,expected:`a readable v7 RHI debug tape`,hint:`obtain complete .rhitape bytes and retry`,detail:{stage:`decode`,cause:String(e)}})}}async function uO(e){return e.length!==1||!e[0]?.name.endsWith(`.rhitape`)?y({code:`tape-invalid`,expected:`exactly one .rhitape file`,hint:`drop exactly one v7 .rhitape artifact`,detail:{stage:`validate`,cause:`viewer import cardinality or extension mismatch`}}):lO(e[0])}async function dO(e){try{let t=await fetch(e);if(!t.ok)return y({code:`tape-invalid`,expected:`a fetchable v7 RHI debug tape`,hint:`verify the tape URL and retry`,detail:{stage:`decode`,cause:`HTTP ${t.status}`}});let n=new Uint8Array(await t.arrayBuffer()),r=cO(n);return r.ok?v({tape:r.value,artifactRef:{kind:`rhi-tape`,digest:await fO(n),source:`viewer.url`,path:e}}):r}catch(e){return y({code:`tape-invalid`,expected:`a fetchable v7 RHI debug tape`,hint:`verify the tape URL and retry`,detail:{stage:`decode`,cause:String(e)}})}}async function fO(e){try{if(typeof globalThis.crypto?.subtle?.digest==`function`){let t=new Uint8Array(e.byteLength);t.set(e);let n=await globalThis.crypto.subtle.digest(`SHA-256`,t);return`sha256:${Array.from(new Uint8Array(n),e=>e.toString(16).padStart(2,`0`)).join(``)}`}}catch{}let t=2166136261;for(let n of e)t^=n,t=Math.imul(t,16777619);return`fnv1a:${(t>>>0).toString(16)}`}function pO(e){return{...nl(e),events:e.events}}var mO=`forgeax-rhi-debug-viewer-layout`,hO=[`event-browser`,`pipeline-state`,`draw-call-viewer`,`resource-inspector`],gO=new Set(hO),_O={schemaVersion:3,topology:{groups:[{id:`events`,type:`split`,direction:`vertical`,size:.25},{id:`draw`,type:`split`,direction:`vertical`,size:.45},{id:`inspection`,type:`stack`,size:.3,activePanel:`pipeline-state`}],panels:hO.map(e=>({id:e,group:e===`event-browser`?`events`:e===`draw-call-viewer`?`draw`:`inspection`})),activeTab:`draw-call-viewer`}};function vO(e,t){return{ok:!1,error:{code:e,detail:t}}}function yO(e){if(Array.isArray(e)){for(let t of e){let e=yO(t);if(e)return e}return null}if(typeof e!=`object`||!e)return null;for(let[t,n]of Object.entries(e)){if(t===`panels`||t===`views`){if(Array.isArray(n)){for(let e of n)if(e&&typeof e==`object`){let t=e.id;if(typeof t==`string`&&!gO.has(t))return t}}}else if(t===`panel`||t===`panelId`||t===`activePanel`){let e=typeof n==`string`?n:null;if(e&&!gO.has(e))return e}let e=yO(n);if(e)return e}return null}function bO(e){let t=e&&typeof e==`object`&&`schemaVersion`in e&&`topology`in e?e:{schemaVersion:3,topology:e};return JSON.stringify(t)}function xO(e){if(typeof e!=`string`)return vO(`layout-corrupt`,`No saved layout was found.`);let t;try{t=JSON.parse(e)}catch{return vO(`layout-corrupt`,`Saved layout is not valid JSON.`)}if(typeof t!=`object`||!t)return vO(`layout-corrupt`,`Saved layout must be an object.`);let n=t;if(n.schemaVersion!==3)return vO(`layout-schema-mismatch`,`Saved layout uses an unsupported schema version.`);if(!(`topology`in n))return vO(`layout-corrupt`,`Saved layout is missing its topology.`);let r=yO(n.topology);return r?vO(`layout-unknown-panel`,`Saved layout contains panel ${r}.`):{ok:!0,value:{schemaVersion:3,topology:n.topology}}}function SO(e){e.setItem(mO,bO(_O))}function CO(e){try{let t=e.getItem(mO);if(t===null)return{layout:_O,recovery:null};let n=xO(t);return n.ok?{layout:n.value,recovery:null}:{layout:_O,recovery:n.error}}catch(e){return{layout:_O,recovery:{code:`layout-storage-failed`,detail:e instanceof Error?e.message:`Layout storage is unavailable.`}}}}function wO(e,t){try{return e.setItem(mO,bO(t)),{ok:!0,value:{schemaVersion:3,topology:t}}}catch(e){return vO(`layout-storage-failed`,e instanceof Error?e.message:`Layout storage is unavailable.`)}}var TO=e({App:()=>FO});function EO(){return Promise.resolve(y(Wp()))}function DO(){return Promise.resolve(y(Wp()))}function OO({model:e,inspectWork:t,readResource:n,artifactRef:r,capability:i}){let a=Eo(),o=(0,l.useMemo)(()=>({selectedWorkIndex:a.selectedWorkIndex,selectedCommandIndex:a.selectedCommandIndex,selectedEventIndex:a.selectedEventIndex,selectedPassIndex:a.selectedPassIndex,selectedResourceId:a.selectedResourceId,selectedSubresource:a.selectedSubresource}),[a.selectedCommandIndex,a.selectedEventIndex,a.selectedPassIndex,a.selectedResourceId,a.selectedSubresource,a.selectedWorkIndex]);return(0,l.useEffect)(()=>{typeof window>`u`||(window.__forgeaxRhiDebug={model:e,artifactRef:r,inspectWork:t,readResource:n,capability:i,selection:o})},[r,i,t,e,n,o]),null}function kO({actions:e}){let[t,n]=(0,l.useState)(!1),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!t)return;let e=e=>{r.current?.contains(e.target)||n(!1)},i=e=>{e.key===`Escape`&&n(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,i)}},[t]);let i=e=>{e?.(),n(!1)};return(0,u.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`forgeax-button-quiet`,"aria-label":`Layout menu`,"aria-haspopup":`menu`,"aria-expanded":t,disabled:e===null,onClick:()=>n(e=>!e),children:[(0,u.jsx)(yo,{size:13}),` Layout `,(0,u.jsx)(mo,{size:12})]}),t&&(0,u.jsxs)(`div`,{className:`forgeax-layout-menu`,role:`menu`,"aria-label":`Layout actions`,children:[(0,u.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-forgeax-layout-action":`float`,onClick:()=>i(e?.floatResource),children:[(0,u.jsx)(xo,{size:14}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`Float resource`}),(0,u.jsx)(`small`,{children:`Detach Buffer / Resource`})]})]}),(0,u.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-forgeax-layout-action":`split`,onClick:()=>i(e?.splitResource),children:[(0,u.jsx)(go,{size:14}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`Split resource`}),(0,u.jsx)(`small`,{children:`Move it beside inspectors`})]})]}),(0,u.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-forgeax-layout-action":`stack`,onClick:()=>i(e?.stackPipeline),children:[(0,u.jsx)(vo,{size:14}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`Stack pipeline`}),(0,u.jsx)(`small`,{children:`Return Pipeline to the Resource Inspector group`})]})]}),(0,u.jsx)(`div`,{className:`forgeax-layout-menu-separator`}),(0,u.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>i(e?.reset),children:[(0,u.jsx)(Co,{size:14}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`Reset layout`}),(0,u.jsx)(`small`,{children:`Restore the three-region default`})]})]})]})]})}function AO(e,t){return function(){return(0,u.jsx)(`div`,{className:`h-full min-h-0`,"data-forgeax-panel":e,children:(0,u.jsx)(t,{})})}}var jO={eventBrowser:AO(hO[0],$p),pipelineState:AO(hO[1],GD),drawCallViewer:AO(hO[2],sO),resourceInspector:AO(hO[3],YD)};function MO(e){e.addPanel({id:hO[0],component:`eventBrowser`,title:`Event browser`,renderer:`always`}),e.addPanel({id:hO[2],component:`drawCallViewer`,title:`Draw Call Viewer`,renderer:`always`,position:{referencePanel:hO[0],direction:`right`}}),e.addPanel({id:hO[1],component:`pipelineState`,title:`Pipeline state`,renderer:`always`,position:{referencePanel:hO[2],direction:`right`}}),e.addPanel({id:hO[3],component:`resourceInspector`,title:`Resource Inspector`,renderer:`always`,position:{referencePanel:hO[1],direction:`within`},inactive:!0})}function NO(e){return!!(e&&typeof e==`object`&&`grid`in e)}function PO({model:e,tape:t,inspectWork:n,readResource:r,artifactRef:i,capability:a,onRecovery:o,onLayoutActions:s}){let c=(0,l.useRef)(null),d=typeof window>`u`?null:(()=>{try{return window.localStorage}catch{return null}})();(0,l.useEffect)(()=>{e!==null||typeof window>`u`||delete window.__forgeaxRhiDebug},[e]);let f=(0,l.useCallback)(()=>{let e=c.current;if(!e||!d)return;let t=wO(d,e.toJSON());t.ok||o(t.error)},[o,d]),p=(0,l.useCallback)(({api:e})=>{c.current=e;let t={layout:_O,recovery:null};if(d&&(t=CO(d)),o(t.recovery),e.clear(),NO(t.layout.topology))try{e.fromJSON(t.layout.topology,{reuseExistingPanels:!1})}catch(t){o({code:`layout-corrupt`,detail:t instanceof Error?t.message:`Saved layout could not be restored.`}),e.clear(),MO(e)}else MO(e);e.onDidLayoutChange(()=>f()),f()},[o,f,d]),m=(0,l.useCallback)(()=>{let e=c.current;if(e){if(e.clear(),MO(e),d)try{SO(d)}catch(e){o({code:`layout-storage-failed`,detail:e instanceof Error?e.message:`Layout storage is unavailable.`});return}o(null),f()}},[o,f,d]),h=(0,l.useCallback)(e=>{let t=c.current;if(t)try{e(t),f()}catch(e){o({code:`layout-corrupt`,detail:e instanceof Error?e.message:`Dockview layout action failed.`})}},[o,f]),g=(0,l.useCallback)(()=>{h(e=>{let t=e.getPanel(hO[3]);t&&e.addFloatingGroup(t,{x:760,y:120,width:460,height:320})})},[h]),_=(0,l.useCallback)(()=>{h(e=>{let t=e.getPanel(hO[3]),n=e.getPanel(hO[1]);!t||!n||t.api.moveTo({group:n.group,position:`right`})})},[h]),v=(0,l.useCallback)(()=>{h(e=>{let t=e.getPanel(hO[1]),n=e.getPanel(hO[3]);!t||!n||t.api.moveTo({group:n.group,position:`center`})})},[h]),y=(0,l.useCallback)(e=>{c.current?.getPanel(e)?.api.setActive()},[]);return(0,l.useEffect)(()=>(s({floatResource:g,splitResource:_,stackPipeline:v,reset:m}),()=>s(null)),[g,s,m,_,v]),(0,u.jsx)(`div`,{className:`forgeax-workspace flex h-full min-h-0 flex-col`,"data-forgeax-workspace":`dockview`,"data-forgeax-layout-key":mO,children:(0,u.jsx)(Hp.Provider,{value:e,children:e&&t?(0,u.jsx)(Vp.Provider,{value:{model:e,tape:t,inspectWork:n,readResource:r,capability:a},children:(0,u.jsx)(im,{openPanel:y,children:(0,u.jsxs)(Do,{children:[(0,u.jsx)(OO,{model:e,inspectWork:n,readResource:r,artifactRef:i,capability:a}),(0,u.jsx)(`div`,{className:`forgeax-dockview dockview-theme-abyss min-h-0 flex-1`,children:(0,u.jsx)(Ya,{components:jO,onReady:p})})]})})}):(0,u.jsx)(im,{openPanel:y,children:(0,u.jsx)(Do,{children:(0,u.jsx)(`div`,{className:`forgeax-dockview dockview-theme-abyss min-h-0 flex-1`,children:(0,u.jsx)(Ya,{components:jO,onReady:p})})})})})})}function FO(){let[e,t]=(0,l.useState)({status:`empty`}),[n,r]=(0,l.useState)(!1),i=(0,l.useRef)(null),a=(0,l.useRef)(0),o=(0,l.useRef)(0),s=(0,l.useRef)(null),[c,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(null),m=(0,l.useCallback)(e=>{let t=s.current;s.current=e,t!==null&&t.dispose()},[]),h=(0,l.useCallback)(async(e,n)=>{let r=++o.current;t({status:`loading`,fileName:e.length===1&&e[0]!==void 0?e[0].name:`${e.length} files`,source:n});let i=await uO(e);if(r!==o.current)return;if(!i.ok){m(null),t({status:`parse-error`,error:i.error});return}let a=await Jp(i.value.tape);if(r!==o.current){await a.dispose();return}m(a),t({status:`loaded`,tape:i.value.tape,model:pO(i.value.tape),artifactRef:i.value.artifactRef,replay:a})},[m]);(0,l.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`tapeUrl`);if(!e)return;let n=++o.current;return(async()=>{let r=await dO(e);if(n!==o.current)return;if(!r.ok){m(null),t({status:`parse-error`,error:r.error});return}let i=await Jp(r.value.tape);if(n!==o.current){await i.dispose();return}m(i),t({status:`loaded`,tape:r.value.tape,model:pO(r.value.tape),artifactRef:r.value.artifactRef,replay:i})})(),()=>{o.current===n&&o.current++}},[m]),(0,l.useEffect)(()=>()=>{m(null)},[m]),(0,l.useEffect)(()=>{let e=e=>Array.from(e.dataTransfer?.types??[]).includes(`Files`),t=t=>{e(t)&&(t.preventDefault(),a.current++,r(!0))},n=t=>{e(t)&&(t.preventDefault(),t.dataTransfer!==null&&(t.dataTransfer.dropEffect=`copy`))},i=t=>{e(t)&&(t.preventDefault(),a.current=Math.max(0,a.current-1),(a.current===0||t.relatedTarget===null)&&r(!1))},o=t=>{e(t)&&(t.preventDefault(),t.stopPropagation(),a.current=0,r(!1),h(Array.from(t.dataTransfer?.files??[]),`drop`))};return window.addEventListener(`dragenter`,t,!0),window.addEventListener(`dragover`,n,!0),window.addEventListener(`dragleave`,i,!0),window.addEventListener(`drop`,o,!0),()=>{window.removeEventListener(`dragenter`,t,!0),window.removeEventListener(`dragover`,n,!0),window.removeEventListener(`dragleave`,i,!0),window.removeEventListener(`drop`,o,!0)}},[h]);let g=e.status===`loaded`,_=e.status===`loaded`?`${e.model.passes.length} passes · ${e.model.works.length} works · ${e.model.resources.length} resources`:e.status===`loading`?`Loading ${e.fileName}`:`Deterministic frame replay and inspection`;return(0,u.jsxs)(`section`,{className:`dark min-h-screen h-screen flex flex-col bg-background text-foreground`,"aria-label":`RHI tape drop area`,[Ao()]:e.status,children:[(0,u.jsxs)(`header`,{className:`forgeax-appbar`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,u.jsx)(`div`,{className:`forgeax-logo`,children:`RHI`}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h1`,{className:`text-sm font-semibold tracking-tight`,children:`RHI Debug Viewer`}),(0,u.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:_})]})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(kO,{actions:f}),(0,u.jsx)(`span`,{className:`forgeax-badge`,children:`v7 · .rhitape`}),(0,u.jsxs)(`button`,{type:`button`,className:`forgeax-button-primary`,onClick:()=>i.current?.click(),children:[(0,u.jsx)(_o,{size:13}),` Import tape`]}),(0,u.jsx)(`input`,{ref:i,type:`file`,accept:`.rhitape`,className:`hidden`,"aria-label":`Select one v7 RHI tape`,onChange:e=>{h(Array.from(e.target.files??[]),`picker`),e.target.value=``}})]})]}),e.status===`parse-error`&&(0,u.jsxs)(`div`,{className:`border-b border-danger/40 bg-danger/10 px-4 py-2 text-xs`,[Ao()]:`parse-error`,children:[(0,u.jsx)(`strong`,{children:e.error.code}),`: `,e.error.hint]}),e.status===`loading`&&(0,u.jsxs)(`div`,{className:`border-b border-brand/35 bg-brand/10 px-4 py-2 text-xs text-brand`,[Ao()]:`loading`,children:[`Loading `,e.fileName,` from `,e.source===`drop`?`drop`:`file picker`,`…`]}),c&&(0,u.jsxs)(`div`,{className:`border-b border-warning/40 bg-warning/10 px-4 py-2 text-xs`,"data-forgeax-layout-recovery":c.code,children:[`Layout reset: `,c.code,` — `,c.detail]}),(0,u.jsx)(`main`,{className:`flex-1 min-h-0 p-2`,[Ao()]:g?`loaded`:e.status,children:(0,u.jsx)(PO,{model:e.status===`loaded`?e.model:null,tape:e.status===`loaded`?e.tape:null,inspectWork:e.status===`loaded`?e.replay.inspectWork:EO,readResource:e.status===`loaded`?e.replay.readResource:DO,artifactRef:e.status===`loaded`?e.artifactRef:null,capability:e.status===`loaded`?e.replay.capability:Up(),onRecovery:d,onLayoutActions:p})}),n&&(0,u.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 grid place-items-center border-2 border-brand/70 bg-background/75 text-sm backdrop-blur-sm`,"data-forgeax-drop-overlay":`ready`,children:(0,u.jsxs)(`div`,{className:`rounded-xl border border-brand/40 bg-card/95 px-8 py-6 text-center shadow-2xl`,children:[(0,u.jsx)(_o,{className:`mx-auto mb-3 text-brand`,size:28}),(0,u.jsx)(`strong`,{children:`Drop one .rhitape file`}),(0,u.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`It will replace the current tape.`})]})})]})}var IO=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function LO(e){return RO(e)}function RO(e){return Array.isArray(e)?zO(e):e instanceof RegExp?e:typeof e==`object`?BO(e):e}function zO(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=RO(e[n]);return t}function BO(e){let t={};for(let n in e)t[n]=RO(e[n]);return t}function VO(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function HO(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?HO(e.substring(0,e.length-1)):e.substr(~t+1)}var UO=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,WO=class{static hasCaptures(e){return e===null?!1:(UO.lastIndex=0,UO.test(e))}static replaceCaptures(e,t,n){return e.replace(UO,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function GO(e,t){return e<t?-1:+(e>t)}function KO(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=GO(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function qO(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function JO(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var YO=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},XO=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(tk(e),t)}static createFromParsedTheme(e,t){return ik(e,t)}_cachedMatchRoot=new YO(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>QO(e.parent,t.parentScopes));return n?new ek(n.fontStyle,n.foreground,n.background):null}},ZO=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function QO(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!$O(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function $O(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ek=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function tk(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&qO(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&qO(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new nk(l,u,e,o,s,c)}}return n}var nk=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},rk=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(rk||{});function ik(e,t){e.sort((e,t)=>{let n=GO(e.scope,t.scope);return n!==0||(n=KO(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ak(t),o=new ek(n,a.getId(r),a.getId(i)),s=new ck(new sk(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new XO(a,o,s)}var ak=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ok=Object.freeze([]),sk=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ok,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},ck=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),sk.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(KO(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new sk(e,t,n,r,i))}},lk=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=dk(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function uk(e){return e}function dk(e){return e}function fk(e,t){let n=[],r=mk(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(pk(i)){let e=[];do e.push(i),i=r.next();while(pk(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function pk(e){return!!e&&!!e.match(/[\w\.:]+/)}function mk(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function hk(e){typeof e.dispose==`function`&&e.dispose()}var gk=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_k=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},vk=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},yk=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new gk(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new vk;for(let n of e)bk(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof gk){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function bk(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof gk?Sk({baseGrammar:a,selfGrammar:i},r):xk(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new gk(e))}function xk(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Ck([r],t,n)}}function Sk(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ck(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ck(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ck(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?VO({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ck(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=kk(i);switch(a.kind){case 0:Sk({...t,selfGrammar:t.baseGrammar},n);break;case 1:Sk(t,n);break;case 2:xk(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?xk(a.ruleName,i,n):Sk(i,n)}else a.kind===4?n.add(new _k(a.scopeName,a.ruleName)):n.add(new gk(a.scopeName));break}}}var wk=class{kind=0},Tk=class{kind=1},Ek=class{constructor(e){this.ruleName=e}kind=2},Dk=class{constructor(e){this.scopeName=e}kind=3},Ok=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function kk(e){if(e===`$base`)return new wk;if(e===`$self`)return new Tk;let t=e.indexOf(`#`);return t===-1?new Dk(e):t===0?new Ek(e.substring(1)):new Ok(e.substring(0,t),e.substring(t+1))}var Ak=/\\(\d+)/,jk=/\\(\d+)/g,Mk=-1,Nk=-2;function Pk(e){return e}function Fk(e){return e}var Ik=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=WO.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=WO.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${HO(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:WO.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:WO.replaceCaptures(this._contentName,e,t)}},Lk=class extends Ik{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Rk=class extends Ik{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Uk(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Wk,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zk=class extends Ik{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Wk,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bk=class extends Ik{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Uk(i,this.id),this.beginCaptures=a,this._end=new Uk(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Wk;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Vk=class extends Ik{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Uk(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Uk(o,Nk),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Wk;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Wk,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Hk=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Lk(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Rk(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=VO({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new zk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Vk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Bk(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=kk(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof zk||e instanceof Bk||e instanceof Vk)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Uk=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Ak.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return jk.lastIndex=0,this.source.replace(jk,(e,t)=>JO(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Wk=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Gk(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Gk(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Gk=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
806
806
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Kk=class{constructor(e,t){this.languageId=e,this.tokenType=t}},qk=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Kk(e,8),this._embeddedLanguagesMatcher=new Jk(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Kk(0,0);_getBasicScopeAttributes=new YO(e=>new Kk(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Jk=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>JO(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Yk=!1,Xk=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Zk(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Qk(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Xk(i,!0);f()}return new Xk(i,!1);function f(){let o=$k(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Mk){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),aA(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Bk){let r=o;aA(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Vk){let r=o;aA(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(aA(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Qk(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Vk&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=rA(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Nk){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),aA(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function $k(e,t,n,r,i,a){let o=eA(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=tA(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function eA(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=nA(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function tA(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=nA(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function nA(e,t,n,r,i){return Yk?{ruleScanner:e.compile(t,n),findOptions:iA(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function rA(e,t,n,r,i){return Yk?{ruleScanner:e.compileWhile(t,n),findOptions:iA(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function iA(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function aA(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Zk(e,p,n&&d.start===0,d.start,f,i,!1,0),hk(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new oA(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var oA=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function sA(e,t,n,r,i,a,o,s){return new dA(e,t,n,r,i,a,o,s)}function cA(e,t,n,r,i){let a=fk(t,lA),o=Hk.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function lA(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(uA(t[r],e))return n=r+1,!0;return!1})}function uA(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var dA=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new qk(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=fA(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=fk(e,lA);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)cA(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&cA(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Pk(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Fk(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=fA(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Hk.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===mA.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=lk.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?pA.createRootAndLookUpScopeName(a,r,this):pA.createRoot(`unknown`,r),t=new mA(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|