@deck.gl/jupyter-widget 9.0.0-beta.3 → 9.0.0-beta.4
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/index.js +5 -5
- package/dist/index.js.map +3 -3
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -550,7 +550,7 @@ ${n}${o}${t.type.toUpperCase()}: ${t.message}
|
|
|
550
550
|
${s}
|
|
551
551
|
</pre></code>`,l.style.top="10px",l.style.left="10px",l.style.position="absolute",l.style.zIndex="9999",l.style.width="100%",l.style.textAlign="left",document.body.appendChild(l);let c=document.getElementsByClassName("luma-compiler-log-error");(i=c[0])!==null&&i!==void 0&&i.scrollIntoView&&c[0].scrollIntoView(),l.onclick=()=>{let h=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(h)}}};cd.defaultProps={...tn.defaultProps,language:"auto",stage:"vertex",source:"",sourceMap:null,entryPoint:"main",debug:"errors"};function LQ(t){return PM(t.source).name||t.id||uo(`unnamed ${t.stage}-shader`)}var ON;ON=Symbol.toStringTag;var fd=class extends tn{get[ON](){return"Sampler"}constructor(e,r){super(e,r,fd.defaultProps)}};fd.defaultProps={...tn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1};var DN;DN=Symbol.toStringTag;var vf=class extends tn{get[DN](){return"Framebuffer"}constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e,r,vf.defaultProps),this.width=void 0,this.height=void 0,this.colorAttachments=[],this.depthStencilAttachment=null,this.width=this.props.width,this.height=this.props.height}resize(e){let r=!e;if(e){let[i,n]=Array.isArray(e)?e:[e.width,e.height];r=r||n!==this.height||i!==this.width,this.width=i,this.height=n}r&&(gr.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.colorAttachments=this.props.colorAttachments.map(e=>{if(typeof e=="string"){let r=this.createColorTexture(e);return this.attachResource(r),r}return e}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){let e=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(e),this.depthStencilAttachment=e}else this.depthStencilAttachment=this.props.depthStencilAttachment}createColorTexture(e){return this.device.createTexture({id:"color-attachment",usage:Bs.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}createDepthStencilTexture(e){return this.device.createTexture({id:"depth-stencil-attachment",usage:Bs.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,r){for(let i=0;i<this.colorAttachments.length;++i)if(this.colorAttachments[i]){let n=this.device._createTexture({...this.colorAttachments[i].props,width:e,height:r});this.destroyAttachedResource(this.colorAttachments[i]),this.colorAttachments[i]=n,this.attachResource(n)}if(this.depthStencilAttachment){let i=this.device._createTexture({...this.depthStencilAttachment.props,width:e,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=i,this.attachResource(i)}}};vf.defaultProps={...tn.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null};var LN;LN=Symbol.toStringTag;var rc=class extends tn{get[LN](){return"RenderPipeline"}constructor(e,r){super(e,r,rc.defaultProps),this.hash="",this.vs=void 0,this.fs=void 0,this.shaderLayout=void 0,this.bufferLayout=void 0,this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}};rc.defaultProps={...tn.defaultProps,vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}};var FN;FN=Symbol.toStringTag;var MA=class extends tn{get[FN](){return"ComputePipeline"}constructor(e,r){super(e,r,MA.defaultProps),this.hash=""}};MA.defaultProps={...tn.defaultProps,cs:void 0,csEntryPoint:void 0,csConstants:{},shaderLayout:[]};var NN;NN=Symbol.toStringTag;var hd=class extends tn{get[NN](){return"RenderPass"}constructor(e,r){super(e,r,hd.defaultProps)}};hd.defaultProps={...tn.defaultProps,framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1};var kN;kN=Symbol.toStringTag;var rv=class extends tn{get[kN](){return"ComputePass"}constructor(e,r){super(e,r,tn.defaultProps)}};rv.defaultProps={...tn.defaultProps};var UN;UN=Symbol.toStringTag;var dd=class extends tn{get[UN](){return"CommandEncoder"}constructor(e,r){super(e,r,dd.defaultProps)}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}};dd.defaultProps={...tn.defaultProps,measureExecutionTime:void 0};var zN;zN=Symbol.toStringTag;var pd=class extends tn{get[zN](){return"CommandBuffer"}constructor(e,r){super(e,r,pd.defaultProps)}};pd.defaultProps={...tn.defaultProps};function yw(t){let[e,r]=NQ[t],i=e==="i32"||e==="u32",n=e!=="u32",o=kQ[e]*r,s=FQ(e,r);return{dataType:e,components:r,defaultVertexFormat:s,byteLength:o,integer:i,signed:n}}function FQ(t,e){let r;switch(t){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?r:`${r}x${e}`}var NQ={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},kQ={f32:4,f16:2,i32:4,u32:4};function vw(t){let e=VN[t],r=UQ(e),i=t.includes("norm"),n=!i&&!t.startsWith("float"),o=t.startsWith("s");return{dataType:VN[t],byteLength:r,integer:n,signed:o,normalized:i}}function UQ(t){return zQ[t]}var VN={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},zQ={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function iv(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);let[r,i]=t.split("x"),n=r,o=i?parseInt(i):1,s=vw(n),l={type:n,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return e&&(l.webglOnly=!0),l}function nv(t,e){let r={};for(let i of t.attributes)r[i.name]=VQ(t,e,i.name);return r}function HN(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,i=nv(t,e),n=new Array(r).fill(null);for(let o of Object.values(i))n[o.location]=o;return n}function VQ(t,e,r){let i=HQ(t,r),n=jQ(e,r);if(!i)return null;let o=yw(i.type),s=n?.vertexFormat||o.defaultVertexFormat,l=iv(s);return{attributeName:n?.attributeName||i.name,bufferName:n?.bufferName||i.name,location:i.location,shaderType:i.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:s,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:o.integer,stepMode:n?.stepMode||i.stepMode,byteOffset:n?.byteOffset||0,byteStride:n?.byteStride||0}}function HQ(t,e){let r=t.attributes.find(i=>i.name===e);return r||gr.warn(`shader layout attribute "${e}" not present in shader`),r||null}function jQ(t,e){GQ(t);let r=WQ(t,e);return r||(r=qQ(t,e),r)?r:(gr.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function GQ(t){for(let e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&gr.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function WQ(t,e){for(let r of t)if(r.format&&r.name===e)return{attributeName:r.name,bufferName:e,stepMode:r.stepMode,vertexFormat:r.format,byteOffset:0,byteStride:r.byteStride||0};return null}function qQ(t,e){for(let i of t){var r;let n=i.byteStride;if(typeof i.byteStride!="number")for(let s of i.attributes||[]){let l=iv(s.format);n+=l.byteLength}let o=(r=i.attributes)===null||r===void 0?void 0:r.find(s=>s.attribute===e);if(o)return{attributeName:o.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:o.format,byteOffset:o.byteOffset,byteStride:n}}return null}function xw(t,e){let r={...t,attributes:t.attributes.map(i=>({...i}))};for(let i of e?.attributes||[]){let n=r.attributes.find(o=>o.name===i.name);n?(n.type=i.type||n.type,n.stepMode=i.stepMode||n.stepMode):gr.warn(`shader layout attribute ${i.name} not present in shader`)}return r}var jN;jN=Symbol.toStringTag;var Ad=class extends tn{get[jN](){return"VertexArray"}constructor(e,r){super(e,r,Ad.defaultProps),this.maxVertexAttributes=void 0,this.attributeInfos=void 0,this.indexBuffer=null,this.attributes=void 0,this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=HN(r.renderPipeline.shaderLayout,r.renderPipeline.bufferLayout,this.maxVertexAttributes)}};Ad.defaultProps={...tn.defaultProps,renderPipeline:null};var GN;GN=Symbol.toStringTag;var md=class extends tn{get[GN](){return"TransformFeedback"}constructor(e,r){super(e,r,md.defaultProps)}};md.defaultProps={...tn.defaultProps,layout:void 0,buffers:{}};var XQ={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function bw(t){let e=XQ[t];return _i(t),e}function WN(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var ww;function ov(t){return(!ww||ww.byteLength<t)&&(ww=new ArrayBuffer(t)),ww}function Tw(t,e){let r=ov(t.BYTES_PER_ELEMENT*e);return new t(r,0,e)}function Ew(t){let{target:e,source:r,start:i=0,count:n=1}=t,o=r.length,s=n*o,l=0;for(let c=i;l<o;l++)e[c++]=r[l];for(;l<s;)l<s-l?(e.copyWithin(i+l,i,i+l),l*=2):(e.copyWithin(i+l,i,i+s-l),l=s);return t.target}var qN=1024,Qg=class{constructor(e){this.layout={},this.byteLength=void 0;let r=0;for(let[n,o]of Object.entries(e)){let s=bw(o),{type:l,components:c}=s;r=WN(r,c);let h=r;r+=c,this.layout[n]={type:l,size:c,offset:h}}r+=(4-r%4)%4;let i=r*4;this.byteLength=Math.max(i,qN)}getData(e){let r=Math.max(this.byteLength,qN),i=ov(r),n={i32:new Int32Array(i),u32:new Uint32Array(i),f32:new Float32Array(i),f16:new Uint16Array(i)};for(let[o,s]of Object.entries(e)){let l=this.layout[o];if(!l){gr.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:c,size:h,offset:g}=l,b=n[c];if(h===1){if(typeof s!="number"&&typeof s!="boolean"){gr.warn(`Supplied value for single component uniform ${o} is not a number: ${s}`)();continue}b[g]=Number(s)}else{let T=Dc(s);if(!T){gr.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${s}`)();continue}b.set(T,g)}}return new Uint8Array(i)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function XN(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(t!==e)return!1;let i=Dc(t);if(!i)return!1;let n=Dc(e);if(n&&i.length===n.length){for(let o=0;o<i.length;++o)if(n[o]!==i[o])return!1}return!0}function YN(t){let e=Dc(t);return e?e.slice():t}var $g=class{constructor(e){if(this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=e?.name,e!=null&&e.name&&e!==null&&e!==void 0&&e.shaderLayout){var r;let i=e==null||(r=e.shaderLayout.bindings)===null||r===void 0?void 0:r.find(o=>o.type==="uniform"&&o.name===e?.name);if(!i)throw new Error(e?.name);let n=i;for(let o of n.uniforms||[])this.bindingLayout[o.name]=o}}setUniforms(e){for(let[r,i]of Object.entries(e))this._setUniform(r,i),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${r}=${i}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,r){XN(this.uniforms[e],r)||(this.uniforms[e]=YN(r),this.modifiedUniforms[e]=!0,this.modified=!0)}};var e0=class{constructor(e){this.uniformBlocks=new Map,this.uniformBufferLayouts=new Map,this.uniformBuffers=new Map;for(let[r,i]of Object.entries(e)){let n=r,o=new Qg(i.uniformTypes||{});this.uniformBufferLayouts.set(n,o);let s=new $g({name:r});s.setUniforms(i.defaultUniforms||{}),this.uniformBlocks.set(n,s)}}destroy(){for(let e of Object.values(this.uniformBuffers))e.destroy()}setUniforms(e){for(let[r,i]of Object.entries(e))this.uniformBlocks.get(r).setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e).byteLength}getUniformBufferData(e){let r=this.uniformBlocks.get(e).getAllUniforms();return this.uniformBufferLayouts.get(e).getData(r)}createUniformBuffer(e,r,i){i&&this.setUniforms(i);let n=this.getUniformBufferByteLength(r),o=e.createBuffer({usage:rn.UNIFORM|rn.COPY_DST,byteLength:n}),s=this.getUniformBufferData(r);return o.write(s),o}getManagedUniformBuffer(e,r){if(!this.uniformBuffers.get(r)){let i=this.getUniformBufferByteLength(r),n=e.createBuffer({usage:rn.UNIFORM|rn.COPY_DST,byteLength:i});this.uniformBuffers.set(r,n)}return this.uniformBuffers.get(r)}updateUniformBuffers(){let e=!1;for(let r of this.uniformBlocks.keys()){let i=this.updateUniformBuffer(r);e||(e=i)}return e&&gr.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let r=this.uniformBlocks.get(e),i=this.uniformBuffers.get(e),n=!1;if(i&&r.needsRedraw){n||(n=r.needsRedraw);let o=this.getUniformBufferData(e);this.uniformBuffers.get(e).write(o);let l=this.uniformBlocks.get(e).getAllUniforms();gr.log(4,`Writing to uniform buffer ${String(e)}`,o,l)()}return n}};var YQ=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function sv(t){let e=YQ.exec(t);if(e){let[,r,i,n,o,s]=e;if(r){let l=`${n}${i}`,c=vw(l);return{format:r,components:r.length,srgb:o==="-srgb",unsized:s==="-unsized",webgl:s==="-webgl",...c}}}return ZQ(t)}var KQ={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function ZQ(t){var e;let r=KQ[t];if(!r)throw new Error(`Unknown format ${t}`);return{format:r.format||"",components:r.components||((e=r.format)===null||e===void 0?void 0:e.length)||1,byteLength:r.bpp||1,srgb:!1,unsized:!1}}function RM(t){let e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function Sw(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function Cw(t,e,r){if(!e||e>4)throw new Error(`size ${e}`);let i=e,n=RM(t);if(n==="uint8"||n==="sint8"){if(i===1||i===3)throw new Error(`size: ${e}`);return r&&(n=n.replace("int","norm")),`${n}x${i}`}if(n==="uint16"||n==="sint16"){if(i===1||i===3)throw new Error(`size: ${e}`);return r&&(n=n.replace("int","norm")),`${n}x${i}`}return i===1?n:`${n}x${i}`}function BM(t){return t}function OM(t){return Dc(t)!==null||typeof t=="number"||typeof t=="boolean"}function t0(t){let e={bindings:{},uniforms:{}};return Object.keys(t).forEach(r=>{let i=t[r];OM(i)?e.uniforms[r]=i:e.bindings[r]=i}),e}function JQ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{maxElts:r=16,size:i=1}=e,n="[";for(let s=0;s<t.length&&s<r;++s)s>0&&(n+=`,${s%i===0?" ":""}`),n+=DM(t[s],e);let o=t.length>r?"...":"]";return`${n}${o}`}function DM(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=1e-16,{isInteger:i=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return JQ(t,e);if(typeof t!="number")return String(t);if(Math.abs(t)<r)return i?"0":"0.";if(i||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);let n=t.toPrecision(2);return n.indexOf(".0")===n.length-2?n.slice(0,-1):n}function Mw(t,e,r,i){let n=`See luma.gl ${r} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,o=Object.getPrototypeOf(t);i.forEach(s=>{o.methodName||(o[s]=()=>{throw gr.removed(`Calling removed method ${e}.${s}: `,n)(),new Error(s)})})}function Iw(t,e,r){let{removedProps:i={},deprecatedProps:n={},replacedProps:o={}}=r;for(let l in i)if(l in e){let h=i[l]?`${t}.${i[l]}`:"N/A";gr.removed(`${t}.${l}`,h)()}for(let l in n)if(l in e){let c=n[l];gr.deprecated(`${t}.${l}`,`${t}.${c}`)()}let s=null;for(let[l,c]of Object.entries(o))l in e&&(gr.deprecated(`${t}.${l}`,`${t}.${c}`)(),s=s||Object.assign({},e),s[c]=e[l],delete s[l]);return s||e}var Pw="";function KN(t){Pw=t}async function ZN(t,e){t=t.startsWith("http")?t:Pw+t;let r=e?.dataType||"text";return await(await fetch(t,e))[r]()}async function JN(t,e){let r=new Image;return r.crossOrigin=e?.crossOrigin||"anonymous",r.src=t.startsWith("http")?t:Pw+t,await r.decode(),await createImageBitmap(r)}async function Rw(t,e){return new Promise((r,i)=>{try{let n=new Image;n.onload=()=>r(n),n.onerror=()=>i(new Error(`Could not load image ${t}.`)),n.crossOrigin=e?.crossOrigin||"anonymous",n.src=t.startsWith("http")?t:Pw+t}catch(n){i(n)}})}async function r0(t,e){let r=document.getElementsByTagName("head")[0];if(!r)throw new Error("loadScript");let i=document.createElement("script");return i.setAttribute("type","text/javascript"),i.setAttribute("src",t),e&&(i.id=e),new Promise((n,o)=>{i.onload=n,i.onerror=s=>o(new Error(`Unable to load script '${t}': ${s}`)),r.appendChild(i)})}function LM(){let t=1,e=1;return()=>(t=Math.sin(e*17.23),e=Math.cos(t*27.92),QQ(Math.abs(t*e)*1432.71))}function QQ(t){return t-Math.floor(t)}var QN=LM();function i0(t,e,r){if(t===e)return!0;if(!r||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!i0(t[i],e[i],r-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){let i=Object.keys(t),n=Object.keys(e);if(i.length!==n.length)return!1;for(let o of i)if(!e.hasOwnProperty(o)||!i0(t[o],e[o],r-1))return!1;return!0}return!1}function Bw(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function Ow(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var FM=t=>`${t}`;var $Q="Failed to create WebGL context in Node.js, headless gl returned null",e$=" luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",t$={width:1,height:1,debug:!0,throwOnError:!1},Dw=null;function $N(t){Dw=t}function e4(){return Dw!==null}function t4(t){t={...t$,...t};let{width:e,height:r,webgl1:i,webgl2:n}=t;if(n&&!i)throw new Error("headless-gl does not support WebGL2");if(!Dw)throw new Error(e$);let o=Dw(e,r,t);if(!o)throw new Error($Q);return o}var av={};function r$(t){globalThis.console&&globalThis.console.error&&globalThis.console.error(t)}function i$(t){globalThis.console&&globalThis.console.log&&globalThis.console.log(t)}function n$(t,e){av[t]=!0,e!==void 0&&r$(e)}function o$(t){let e=t.getError;t.getError=function(){let i;do i=e.apply(t),i!==0&&(av[i]=!0);while(i!==0);for(i in av)if(av[i])return delete av[i],parseInt(i,10);return 0}}var lv=function t(e){let r=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i<this.attribs.length;i++){let n=new t.VertexAttrib(r);this.attribs[i]=n}this.maxAttrib=0};lv.VertexAttrib=function(e){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};lv.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var IA=function(e){let r=this;this.gl=e,o$(e);let i=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(o){return o===r.VERTEX_ARRAY_BINDING_OES?r.currentVertexArrayObject===r.defaultVertexArrayObject?null:r.currentVertexArrayObject:i.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(o){let s=r.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,o);let l=s.attribs[o];return l.enabled=!0,i.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(o){let s=r.currentVertexArrayObject;s.maxAttrib=Math.max(s.maxAttrib,o);let l=s.attribs[o];return l.enabled=!1,i.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(o,s){switch(o){case 34962:r.currentArrayBuffer=s;break;case 34963:r.currentVertexArrayObject.elementArrayBuffer=s;break;default:}return i.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(o,s){let c=r.currentVertexArrayObject.attribs[o];switch(s){case 34975:return c.buffer;case 34338:return c.enabled;case 34339:return c.size;case 34340:return c.stride;case 34341:return c.type;case 34922:return c.normalized;default:return i.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(o,s,l,c,h,g){let b=r.currentVertexArrayObject;b.maxAttrib=Math.max(b.maxAttrib,o);let T=b.attribs[o];return T.buffer=r.currentArrayBuffer,T.size=s,T.type=l,T.normalized=c,T.stride=h,T.offset=g,T.recache(),i.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",()=>{i$("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};IA.prototype.VERTEX_ARRAY_BINDING_OES=34229;IA.prototype.reset_=function(){if(this.vertexArrayObjects!==void 0)for(let i=0;i<this.vertexArrayObjects.length;++i)this.vertexArrayObjects.isAlive=!1;let r=this.gl;this.maxVertexAttribs=r.getParameter(34921),this.defaultVertexArrayObject=new lv(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};IA.prototype.createVertexArrayOES=function(){let e=new lv(this);return this.vertexArrayObjects.push(e),e};IA.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)};IA.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof lv&&e.hasBeenBound&&e.ext===this)};IA.prototype.bindVertexArrayOES=function(e){let r=this.gl;if(e&&!e.isAlive){n$(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}let i=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;let o=this.currentVertexArrayObject;if(n===o)return;(!n||o.elementArrayBuffer!==n.elementArrayBuffer)&&i.bindBuffer.call(r,34963,o.elementArrayBuffer);let s=this.currentArrayBuffer,l=Math.max(n?n.maxAttrib:0,o.maxAttrib);for(let c=0;c<=l;c++){let h=o.attribs[c],g=n?n.attribs[c]:null;if((!n||h.enabled!==g.enabled)&&(h.enabled?i.enableVertexAttribArray.call(r,c):i.disableVertexAttribArray.call(r,c)),h.enabled){let b=!1;(!n||h.buffer!==g.buffer)&&(s!==h.buffer&&(i.bindBuffer.call(r,34962,h.buffer),s=h.buffer),b=!0),(b||h.cached!==g.cached)&&i.vertexAttribPointer.call(r,c,h.size,h.type,h.normalized,h.stride,h.offset)}}this.currentArrayBuffer!==s&&i.bindBuffer.call(r,34962,this.currentArrayBuffer)};function r4(t){if(typeof t.createVertexArray=="function")return;let e=t.getSupportedExtensions;t.getSupportedExtensions=function(){let n=e.call(this)||[];return n.indexOf("OES_vertex_array_object")<0&&n.push("OES_vertex_array_object"),n};let r=t.getExtension;t.getExtension=function(n){let o=r.call(this,n);return o||(n!=="OES_vertex_array_object"?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new IA(this)),this.__OESVertexArrayObject))}}var s$="Invalid WebGLRenderingContext";var a$="Requires WebGL2";function NM(t){return typeof WebGLRenderingContext<"u"&&t instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function zn(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&t._version===2)}function uv(t){return zn(t)?t:null}function Lw(t){return _i(NM(t),s$),t}function i4(t){return _i(zn(t),a$),t}var n4="OES_element_index",o4="WEBGL_draw_buffers",l$="EXT_disjoint_timer_query",u$="EXT_disjoint_timer_query_webgl2",c$="EXT_texture_filter_anisotropic",s4="WEBGL_debug_renderer_info",f$=35723,h$=4352,d$=36795,p$=34047,A$=37445,m$=37446,Ts=t=>zn(t)?void 0:0,g$={[3074]:t=>zn(t)?void 0:36064,[f$]:t=>zn(t)?void 0:h$,[35977]:Ts,[32937]:Ts,[d$]:(t,e)=>{let r=zn(t)?t.getExtension(u$):t.getExtension(l$);return r&&r.GPU_DISJOINT_EXT?e(r.GPU_DISJOINT_EXT):0},[A$]:(t,e)=>{let r=t.getExtension(s4);return e(r&&r.UNMASKED_VENDOR_WEBGL||7936)},[m$]:(t,e)=>{let r=t.getExtension(s4);return e(r&&r.UNMASKED_RENDERER_WEBGL||7937)},[p$]:(t,e)=>{var r;let i=((r=t.luma)===null||r===void 0||(r=r.extensions)===null||r===void 0?void 0:r[c$])||t.getExtension("EXT_texture_filter_anisotropic");return i?e(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},[32883]:Ts,[35071]:Ts,[37447]:Ts,[36063]:(t,e)=>{if(!zn(t)){let r=t.getExtension(o4);return r?e(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}},[35379]:Ts,[35374]:Ts,[35377]:Ts,[34852]:t=>{if(!zn(t)){let e=t.getExtension(o4);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},[36203]:t=>t.getExtension(n4)?2147483647:65535,[33001]:t=>t.getExtension(n4)?16777216:65535,[33e3]:t=>16777216,[37157]:Ts,[35373]:Ts,[35657]:Ts,[36183]:Ts,[37137]:Ts,[34045]:Ts,[35978]:Ts,[35979]:Ts,[35968]:Ts,[35376]:Ts,[35375]:Ts,[35659]:Ts,[37154]:Ts,[35371]:Ts,[35658]:Ts,[35076]:Ts,[35077]:Ts,[35380]:Ts};function a4(t,e,r){let i=g$[r],n=typeof i=="function"?i(t,e,r):i;return n!==void 0?n:e(r)}function n0(t){if(!t.luma){let r={_polyfilled:!1,_extensions:{}};t.luma=r}return t.luma}var _$="OES_vertex_array_object",l4="ANGLE_instanced_arrays",y$="WEBGL_draw_buffers",v$="EXT_disjoint_timer_query",x$="EXT_texture_filter_anisotropic",b$="VertexArray requires WebGL2 or OES_vertex_array_object extension";function w$(t,e){return{webgl2:zn(t),ext:t.getExtension(e)}}var kM={[_$]:{meta:{suffix:"OES"},createVertexArray:()=>{_i(!1,b$)},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[l4]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){_i(e===0,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},[y$]:{meta:{suffix:"WEBGL"},drawBuffers:()=>{_i(!1)}},[v$]:{meta:{suffix:"EXT"},createQuery:()=>{_i(!1)},deleteQuery:()=>{_i(!1)},beginQuery:()=>{_i(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:(t,e)=>{}}},Fw={readBuffer:(t,e,r)=>{zn(t)&&e(r)},getVertexAttrib:(t,e,r,i)=>{let{webgl2:n,ext:o}=w$(t,l4),s;switch(i){case 35069:s=n?void 0:!1;break;case 35070:s=!n&&!o?0:void 0;break;default:}return s!==void 0?s:e(r,i)},getProgramParameter:(t,e,r,i)=>{if(!zn(t))switch(i){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return e(r,i)},getInternalformatParameter:(t,e,r,i,n)=>{if(!zn(t))switch(n){case 32937:return new Int32Array([0]);default:}return t.getInternalformatParameter(r,i,n)},getTexParameter(t,e,r,i){switch(i){case 34046:let n=n0(t),{_extensions:o}=n,s=o[x$];i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return e(r,i)},getParameter:a4,hint(t,e,r,i){return e(r,i)}};function Nw(t){let e=n0(t);return e._polyfilled||(r4(t),T$(t),E$(t,kM),C$(t,{target:e,target2:t}),e._polyfilled=!0),t}function T$(t){let e=n0(t),r=t.getSupportedExtensions()||[],i=["WEBGL_polygon_mode"];for(let n of r)if(!i.includes(n)){let o=t.getExtension(n);e._extensions[n]=o}}function E$(t,e){let r=n0(t);for(let i of Object.getOwnPropertyNames(e))i!=="overrides"&&S$(t,{extension:i,target:r,target2:t})}function S$(t,e){let{extension:r,target:i,target2:n}=e,o=kM[r];_i(o);let{meta:s={}}=o,{suffix:l=""}=s,c=t.getExtension(r);for(let h of Object.keys(o)){let g=`${h}${l}`,b=null;h==="meta"||typeof t[h]=="function"||(c&&typeof c[g]=="function"?b=function(){return c[g](...arguments)}:typeof o[h]=="function"&&(b=o[h].bind(i))),b&&(i[h]=b,n[h]=b)}}function C$(t,e){let{target:r,target2:i}=e;Object.keys(Fw).forEach(n=>{if(typeof Fw[n]=="function"){let o=t[n]?t[n].bind(t):()=>{},s=Fw[n].bind(null,t,o);r[n]=s,i[n]=s}})}var fv={[3042]:!1,[32773]:new Float32Array([0,0,0,0]),[32777]:32774,[34877]:32774,[32969]:1,[32968]:0,[32971]:1,[32970]:0,[3106]:new Float32Array([0,0,0,0]),[3107]:[!0,!0,!0,!0],[2884]:!1,[2885]:1029,[2929]:!1,[2931]:1,[2932]:513,[2928]:new Float32Array([0,1]),[2930]:!0,[3024]:!0,[35725]:null,[36006]:null,[36007]:null,[34229]:null,[34964]:null,[2886]:2305,[33170]:4352,[2849]:1,[32823]:!1,[32824]:0,[10752]:0,[32926]:!1,[32928]:!1,[32938]:1,[32939]:!1,[3089]:!1,[3088]:new Int32Array([0,0,1024,1024]),[2960]:!1,[2961]:0,[2968]:4294967295,[36005]:4294967295,[2962]:519,[2967]:0,[2963]:4294967295,[34816]:519,[36003]:0,[36004]:4294967295,[2964]:7680,[2965]:7680,[2966]:7680,[34817]:7680,[34818]:7680,[34819]:7680,[2978]:[0,0,1024,1024],[3333]:4,[3317]:4,[37440]:!1,[37441]:!1,[37443]:37444,[36389]:null,[36662]:null,[36663]:null,[35053]:null,[35055]:null,[35723]:4352,[36010]:null,[35977]:!1,[3330]:0,[3332]:0,[3331]:0,[3314]:0,[32878]:0,[3316]:0,[3315]:0,[32877]:0},Ah=(t,e,r)=>e?t.enable(r):t.disable(r),u4=(t,e,r)=>t.hint(r,e),ic=(t,e,r)=>t.pixelStorei(r,e),c4=(t,e,r)=>{let i;return r===36006?i=zn(t)?36009:36160:i=36008,t.bindFramebuffer(i,e)},cv=(t,e,r)=>{let n={[34964]:34962,[36662]:36662,[36663]:36663,[35053]:35051,[35055]:35052}[r];t.bindBuffer(n,e)};function UM(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}var f4={[3042]:Ah,[32773]:(t,e)=>t.blendColor(...e),[32777]:"blendEquation",[34877]:"blendEquation",[32969]:"blendFunc",[32968]:"blendFunc",[32971]:"blendFunc",[32970]:"blendFunc",[3106]:(t,e)=>t.clearColor(...e),[3107]:(t,e)=>t.colorMask(...e),[2884]:Ah,[2885]:(t,e)=>t.cullFace(e),[2929]:Ah,[2931]:(t,e)=>t.clearDepth(e),[2932]:(t,e)=>t.depthFunc(e),[2928]:(t,e)=>t.depthRange(...e),[2930]:(t,e)=>t.depthMask(e),[3024]:Ah,[35723]:u4,[35725]:(t,e)=>t.useProgram(e),[36007]:(t,e)=>t.bindRenderbuffer(36161,e),[36389]:(t,e)=>{var r,i;return(r=(i=t).bindTransformFeedback)===null||r===void 0?void 0:r.call(i,36386,e)},[34229]:(t,e)=>t.bindVertexArray(e),[36006]:c4,[36010]:c4,[34964]:cv,[36662]:cv,[36663]:cv,[35053]:cv,[35055]:cv,[2886]:(t,e)=>t.frontFace(e),[33170]:u4,[2849]:(t,e)=>t.lineWidth(e),[32823]:Ah,[32824]:"polygonOffset",[10752]:"polygonOffset",[35977]:Ah,[32926]:Ah,[32928]:Ah,[32938]:"sampleCoverage",[32939]:"sampleCoverage",[3089]:Ah,[3088]:(t,e)=>t.scissor(...e),[2960]:Ah,[2961]:(t,e)=>t.clearStencil(e),[2968]:(t,e)=>t.stencilMaskSeparate(1028,e),[36005]:(t,e)=>t.stencilMaskSeparate(1029,e),[2962]:"stencilFuncFront",[2967]:"stencilFuncFront",[2963]:"stencilFuncFront",[34816]:"stencilFuncBack",[36003]:"stencilFuncBack",[36004]:"stencilFuncBack",[2964]:"stencilOpFront",[2965]:"stencilOpFront",[2966]:"stencilOpFront",[34817]:"stencilOpBack",[34818]:"stencilOpBack",[34819]:"stencilOpBack",[2978]:(t,e)=>t.viewport(...e),[3333]:ic,[3317]:ic,[37440]:ic,[37441]:ic,[37443]:ic,[3330]:ic,[3332]:ic,[3331]:ic,[3314]:ic,[32878]:ic,[3316]:ic,[3315]:ic,[32877]:ic,framebuffer:(t,e)=>{let r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{let r=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...r)},blendFunc:(t,e)=>{let r=e?.length===2?[...e,...e]:e;t.blendFuncSeparate(...r)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=UM(e)?e:[e,e];let[r,i]=e;t.stencilMaskSeparate(1028,r),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=UM(e)&&e.length===3?[...e,...e]:e;let[r,i,n,o,s,l]=e;t.stencilFuncSeparate(1028,r,i,n),t.stencilFuncSeparate(1029,o,s,l)},stencilOp:(t,e)=>{e=UM(e)&&e.length===3?[...e,...e]:e;let[r,i,n,o,s,l]=e;t.stencilOpSeparate(1028,r,i,n),t.stencilOpSeparate(1029,o,s,l)},viewport:(t,e)=>t.viewport(...e)};function ua(t,e,r){return e[t]!==void 0?e[t]:r[t]}var h4={blendEquation:(t,e,r)=>t.blendEquationSeparate(ua(32777,e,r),ua(34877,e,r)),blendFunc:(t,e,r)=>t.blendFuncSeparate(ua(32969,e,r),ua(32968,e,r),ua(32971,e,r),ua(32970,e,r)),polygonOffset:(t,e,r)=>t.polygonOffset(ua(32824,e,r),ua(10752,e,r)),sampleCoverage:(t,e,r)=>t.sampleCoverage(ua(32938,e,r),ua(32939,e,r)),stencilFuncFront:(t,e,r)=>t.stencilFuncSeparate(1028,ua(2962,e,r),ua(2967,e,r),ua(2963,e,r)),stencilFuncBack:(t,e,r)=>t.stencilFuncSeparate(1029,ua(34816,e,r),ua(36003,e,r),ua(36004,e,r)),stencilOpFront:(t,e,r)=>t.stencilOpSeparate(1028,ua(2964,e,r),ua(2965,e,r),ua(2966,e,r)),stencilOpBack:(t,e,r)=>t.stencilOpSeparate(1029,ua(34817,e,r),ua(34818,e,r),ua(34819,e,r))},zM={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,r)=>t({[e]:r}),hint:(t,e,r)=>t({[e]:r}),useProgram:(t,e)=>t({[35725]:e}),bindRenderbuffer:(t,e,r)=>t({[36007]:r}),bindTransformFeedback:(t,e,r)=>t({[36389]:r}),bindVertexArray:(t,e)=>t({[34229]:e}),bindFramebuffer:(t,e,r)=>{switch(e){case 36160:return t({[36006]:r,[36010]:r});case 36009:return t({[36006]:r});case 36008:return t({[36010]:r});default:return null}},bindBuffer:(t,e,r)=>{let i={[34962]:[34964],[36662]:[36662],[36663]:[36663],[35051]:[35053],[35052]:[35055]}[e];return i?t({[i]:r}):{valueChanged:!0}},blendColor:(t,e,r,i,n)=>t({[32773]:new Float32Array([e,r,i,n])}),blendEquation:(t,e)=>t({[32777]:e,[34877]:e}),blendEquationSeparate:(t,e,r)=>t({[32777]:e,[34877]:r}),blendFunc:(t,e,r)=>t({[32969]:e,[32968]:r,[32971]:e,[32970]:r}),blendFuncSeparate:(t,e,r,i,n)=>t({[32969]:e,[32968]:r,[32971]:i,[32970]:n}),clearColor:(t,e,r,i,n)=>t({[3106]:new Float32Array([e,r,i,n])}),clearDepth:(t,e)=>t({[2931]:e}),clearStencil:(t,e)=>t({[2961]:e}),colorMask:(t,e,r,i,n)=>t({[3107]:[e,r,i,n]}),cullFace:(t,e)=>t({[2885]:e}),depthFunc:(t,e)=>t({[2932]:e}),depthRange:(t,e,r)=>t({[2928]:new Float32Array([e,r])}),depthMask:(t,e)=>t({[2930]:e}),frontFace:(t,e)=>t({[2886]:e}),lineWidth:(t,e)=>t({[2849]:e}),polygonOffset:(t,e,r)=>t({[32824]:e,[10752]:r}),sampleCoverage:(t,e,r)=>t({[32938]:e,[32939]:r}),scissor:(t,e,r,i,n)=>t({[3088]:new Int32Array([e,r,i,n])}),stencilMask:(t,e)=>t({[2968]:e,[36005]:e}),stencilMaskSeparate:(t,e,r)=>t({[e===1028?2968:36005]:r}),stencilFunc:(t,e,r,i)=>t({[2962]:e,[2967]:r,[2963]:i,[34816]:e,[36003]:r,[36004]:i}),stencilFuncSeparate:(t,e,r,i,n)=>t({[e===1028?2962:34816]:r,[e===1028?2967:36003]:i,[e===1028?2963:36004]:n}),stencilOp:(t,e,r,i)=>t({[2964]:e,[2965]:r,[2966]:i,[34817]:e,[34818]:r,[34819]:i}),stencilOpSeparate:(t,e,r,i,n)=>t({[e===1028?2964:34817]:r,[e===1028?2965:34818]:i,[e===1028?2966:34819]:n}),viewport:(t,e,r,i,n)=>t({[2978]:[e,r,i,n]})},mh=(t,e)=>t.isEnabled(e),VM={[3042]:mh,[2884]:mh,[2929]:mh,[3024]:mh,[32823]:mh,[32926]:mh,[32928]:mh,[3089]:mh,[2960]:mh,[35977]:mh},d4=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Lu(t,e){let i=Qo.attach(t).gl;if(M$(e))return;let n={};for(let s in e){let l=Number(s),c=f4[s];c&&(typeof c=="string"?n[c]=!0:c(i,e[s],l))}let o=i.state&&i.state.cache;if(o)for(let s in n){let l=h4[s];l(i,e,o)}}function o0(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fv,i=Qo.attach(t).gl;if(typeof e=="number"){let s=e,l=VM[s];return l?l(i,s):i.getParameter(s)}let n=Array.isArray(e)?e:Object.keys(e),o={};for(let s of n){let l=VM[s];o[s]=l?l(i,Number(s)):i.getParameter(Number(s))}return o}function p4(t){Lu(t,fv)}function M$(t){for(let e in t)return!1;return!0}function A4(t,e){if(t===e)return!0;let r=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&i&&t.length===e.length){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}return!1}var HM=class{constructor(e){let{copyState:r=!1,log:i=()=>{}}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=void 0,this.program=null,this.stateStack=[],this.enable=!0,this.cache=void 0,this.log=void 0,this.gl=e,this.cache=r?o0(e):Object.assign({},fv),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})}pop(){_i(this.stateStack.length>0);let e=this.stateStack[this.stateStack.length-1];Lu(this.gl,e),this.stateStack.pop()}_updateCache(e){let r=!1,i,n=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(let o in e){_i(o!==void 0);let s=e[o],l=this.cache[o];A4(s,l)||(r=!0,i=l,n&&!(o in n)&&(n[o]=l),this.cache[o]=s)}return{valueChanged:r,oldValue:i}}};function PA(t){return t.state}function hv(t,e){let{enable:r=!0,copyState:i}=e;if(_i(i!==void 0),!t.state){t.state=new HM(t,{copyState:i}),P$(t);for(let o in zM){let s=zM[o];I$(t,o,s)}m4(t,"getParameter"),m4(t,"isEnabled")}let n=PA(t);return n.enable=r,t}function xf(t){let e=PA(t);e||(hv(t,{copyState:!1}),e=PA(t)),e.push()}function Lc(t){let e=PA(t);_i(e),e.pop()}function m4(t,e){let r=t[e].bind(t);t[e]=function(n){if(n===void 0||d4.has(n))return r(n);let o=PA(t);return n in o.cache||(o.cache[n]=r(n)),o.enable?o.cache[n]:r(n)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function I$(t,e,r){if(!t[e])return;let i=t[e].bind(t);t[e]=function(){let o=PA(t);for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];let{valueChanged:h,oldValue:g}=r(o._updateCache,...l);return h&&i(...l),g},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function P$(t){let e=t.useProgram.bind(t);t.useProgram=function(i){let n=PA(t);n.program!==i&&(e(i),n.program=i)}}var R$={webgl2:!0,webgl1:!0,powerPreference:"high-performance",onContextLost:()=>console.error("WebGL context lost"),onContextRestored:()=>console.info("WebGL context restored")};function g4(t,e){e={...R$,...e};let r=null,i=o=>r=o.statusMessage||r;t.addEventListener("webglcontextcreationerror",i,!1);let n=null;if(e.type==="webgl2"&&(e={...e,webgl1:!1}),e.type==="webgl1"&&(e={...e,webgl2:!1}),!n&&e.webgl2&&(n=t.getContext("webgl2",e)),!n&&e.webgl1&&(n=t.getContext("webgl",e)),t.removeEventListener("webglcontextcreationerror",i,!1),!n)throw new Error(`Failed to create ${e.webgl2&&!e.webgl1?"WebGL2":"WebGL"} context: ${r||"Unknown error"}`);if(e.onContextLost){let{onContextLost:o}=e;t.addEventListener("webglcontextlost",s=>o(s),!1)}if(e.onContextRestored){let{onContextRestored:o}=e;t.addEventListener("webglcontextrestored",s=>o(s),!1)}return n}function _4(t){let e=t.getParameter(7936),r=t.getParameter(7937),i=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),o=t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),s=n||e,l=o||r,c=t.getParameter(7938),h=y4(s,l),g=B$(s,l),b=O$(s,l),T="glsl",C=zn(t)?300:100;return{type:zn(t)?"webgl2":"webgl",gpu:h,gpuType:b,gpuBackend:g,vendor:s,renderer:l,version:c,shadingLanguage:T,shadingLanguageVersion:C}}function y4(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function B$(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function O$(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(y4(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function v4(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=typeof window<"u"?window.navigator||{}:{},r=t.userAgent||e.userAgent||"",i=r.indexOf("MSIE ")!==-1,n=r.indexOf("Trident/")!==-1;return i||n}function kw(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}var Zl="texture-compression-bc",as="texture-compression-astc",gh="texture-compression-etc2",D$="texture-compression-etc1-webgl",Uw="texture-compression-pvrtc-webgl",jM="texture-compression-atc-webgl",dv="WEBGL_compressed_texture_s3tc",pv="WEBGL_compressed_texture_s3tc_srgb",s0="EXT_texture_compression_rgtc",Av="EXT_texture_compression_bptc",L$="WEBGL_compressed_texture_etc",F$="WEBGL_compressed_texture_astc",N$="WEBGL_compressed_texture_etc1",k$="WEBGL_compressed_texture_pvrtc",U$="WEBGL_compressed_texture_atc",x4="EXT_sRGB",gd="EXT_texture_norm16",z$="WEBGL_color_buffer_float",V$="EXT_color_buffer_float",bf=(t,e)=>t.getExtension(e),RA=(t,e)=>e.every(r=>t.getExtension(r)),GM={"texture-blend-float-webgl1":t=>zn(t)?!0:bf(t,"EXT_float_blend"),"texture-formats-srgb-webgl1":t=>zn(t)?!0:bf(t,x4),"texture-formats-depth-webgl1":t=>zn(t)?!0:bf(t,"WEBGL_depth_texture"),"texture-formats-float32-webgl1":t=>zn(t)?!0:bf(t,"OES_texture_float"),"texture-formats-float16-webgl1":t=>zn(t)?!0:bf(t,"OES_texture_half_float"),"texture-formats-norm16-webgl":t=>zn(t)?bf(t,gd):!1,"texture-filter-linear-float32-webgl":t=>bf(t,"OES_texture_float_linear"),"texture-filter-linear-float16-webgl":t=>bf(t,"OES_texture_half_float_linear"),"texture-filter-anisotropic-webgl":t=>bf(t,"EXT_texture_filter_anisotropic"),"texture-renderable-float32-webgl":t=>bf(t,"EXT_color_buffer_float"),"texture-renderable-float16-webgl":t=>bf(t,"EXT_color_buffer_half_float"),"texture-compression-bc":t=>RA(t,[dv,pv,s0,Av]),"texture-compression-bc5-webgl":t=>RA(t,[s0]),"texture-compression-etc2":t=>RA(t,[L$]),"texture-compression-astc":t=>RA(t,[F$]),"texture-compression-etc1-webgl":t=>RA(t,[N$]),"texture-compression-pvrtc-webgl":t=>RA(t,[k$]),"texture-compression-atc-webgl":t=>RA(t,[U$])};function H$(t,e){var r;return((r=GM[e])===null||r===void 0?void 0:r.call(GM,t))||!1}function b4(t){return Object.keys(GM).filter(r=>H$(t,r))}var BA={"rgb8unorm-unsized":{gl:6407,gl1:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,gl1:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,renderbuffer:!0},r8snorm:{gl:36756,b:1,c:1},r8uint:{gl:33330,b:1,c:1,renderbuffer:!0},r8sint:{gl:33329,b:1,c:1,renderbuffer:!0},rg8unorm:{gl:33323,b:2,c:2,renderbuffer:!0},rg8snorm:{gl:36757,b:2,c:2},rg8uint:{gl:33336,b:2,c:2,renderbuffer:!0},rg8sint:{gl:33335,b:2,c:2,renderbuffer:!0},r16uint:{gl:33332,b:2,c:1,renderbuffer:!0},r16sint:{gl:33331,b:2,c:1,renderbuffer:!0},r16float:{gl:33325,b:2,c:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:gd},"r16snorm-webgl":{gl:36760,b:2,c:1,f:"texture-formats-norm16-webgl",x:gd},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,gl1:6408,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,gl1:35906,b:4,c:4,gl1ext:x4,bpp:4},rgba8snorm:{gl:36759,b:4,c:4},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,f:"texture-formats-norm16-webgl",x:gd},"rg16snorm-webgl":{gl:36761,b:2,c:2,f:"texture-formats-norm16-webgl",x:gd},r32uint:{gl:33334,b:4,c:1,bpp:4,renderbuffer:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,renderbuffer:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl"},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:"texture-renderable-float32-webgl",renderbuffer:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,renderbuffer:!0},"rgb10a2unorm-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,renderbuffer:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:"texture-formats-norm16-webgl",x:gd},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:"texture-formats-norm16-webgl",x:gd},rg32uint:{gl:33340,b:8,c:2,renderbuffer:!0},rg32sint:{gl:33339,b:8,c:2,renderbuffer:!0},rg32float:{gl:33328,b:8,c:2,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},rgba16uint:{gl:36214,b:8,c:4,renderbuffer:!0},rgba16sint:{gl:36232,b:8,c:4,renderbuffer:!0},rgba16float:{gl:34842,gl1:6408,b:8,c:4,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},"rgba16unorm-webgl":{gl:32859,b:2,c:4,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:gd},"rgba16snorm-webgl":{gl:36763,b:2,c:4,f:"texture-formats-norm16-webgl",x:gd},"rgb32float-webgl":{gl:34837,gl1:6407,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",gl2ext:V$,gl1ext:z$,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,renderbuffer:!0},rgba32sint:{gl:36226,b:16,c:4,renderbuffer:!0},rgba32float:{gl:34836,b:16,c:4,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},stencil8:{gl:36168,gl1:36168,b:1,c:1,attachment:36128,renderbuffer:!0},depth16unorm:{gl:33189,gl1:33189,b:2,c:1,attachment:36096,renderbuffer:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096},depth32float:{gl:36012,b:4,c:1,attachment:36096,renderbuffer:!0},"depth24plus-stencil8":{gl:34041,gl1:34041,b:4,c:2,p:1,attachment:33306,renderbuffer:!0,depthTexture:!0},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,renderbuffer:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,renderbuffer:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:dv,f:Zl},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:pv,f:Zl},"bc1-rgba-unorm":{gl:33777,x:dv,f:Zl},"bc1-rgba-unorm-srgb":{gl:35916,x:pv,f:Zl},"bc2-rgba-unorm":{gl:33778,x:dv,f:Zl},"bc2-rgba-unorm-srgb":{gl:35918,x:pv,f:Zl},"bc3-rgba-unorm":{gl:33779,x:dv,f:Zl},"bc3-rgba-unorm-srgb":{gl:35919,x:pv,f:Zl},"bc4-r-unorm":{gl:36283,x:s0,f:Zl},"bc4-r-snorm":{gl:36284,x:s0,f:Zl},"bc5-rg-unorm":{gl:36285,x:s0,f:Zl},"bc5-rg-snorm":{gl:36286,x:s0,f:Zl},"bc6h-rgb-ufloat":{gl:36495,x:Av,f:Zl},"bc6h-rgb-float":{gl:36494,x:Av,f:Zl},"bc7-rgba-unorm":{gl:36492,x:Av,f:Zl},"bc7-rgba-unorm-srgb":{gl:36493,x:Av,f:Zl},"etc2-rgb8unorm":{gl:37492,f:gh},"etc2-rgb8unorm-srgb":{gl:37494,f:gh},"etc2-rgb8a1unorm":{gl:37496,f:gh},"etc2-rgb8a1unorm-srgb":{gl:37497,f:gh},"etc2-rgba8unorm":{gl:37493,f:gh},"etc2-rgba8unorm-srgb":{gl:37495,f:gh},"eac-r11unorm":{gl:37488,f:gh},"eac-r11snorm":{gl:37489,f:gh},"eac-rg11unorm":{gl:37490,f:gh},"eac-rg11snorm":{gl:37491,f:gh},"astc-4x4-unorm":{gl:37808,f:as},"astc-4x4-unorm-srgb":{gl:37840,f:as},"astc-5x4-unorm":{gl:37809,f:as},"astc-5x4-unorm-srgb":{gl:37841,f:as},"astc-5x5-unorm":{gl:37810,f:as},"astc-5x5-unorm-srgb":{gl:37842,f:as},"astc-6x5-unorm":{gl:37811,f:as},"astc-6x5-unorm-srgb":{gl:37843,f:as},"astc-6x6-unorm":{gl:37812,f:as},"astc-6x6-unorm-srgb":{gl:37844,f:as},"astc-8x5-unorm":{gl:37813,f:as},"astc-8x5-unorm-srgb":{gl:37845,f:as},"astc-8x6-unorm":{gl:37814,f:as},"astc-8x6-unorm-srgb":{gl:37846,f:as},"astc-8x8-unorm":{gl:37815,f:as},"astc-8x8-unorm-srgb":{gl:37847,f:as},"astc-10x5-unorm":{gl:37819,f:as},"astc-10x5-unorm-srgb":{gl:37851,f:as},"astc-10x6-unorm":{gl:37817,f:as},"astc-10x6-unorm-srgb":{gl:37849,f:as},"astc-10x8-unorm":{gl:37818,f:as},"astc-10x8-unorm-srgb":{gl:37850,f:as},"astc-10x10-unorm":{gl:37819,f:as},"astc-10x10-unorm-srgb":{gl:37851,f:as},"astc-12x10-unorm":{gl:37820,f:as},"astc-12x10-unorm-srgb":{gl:37852,f:as},"astc-12x12-unorm":{gl:37821,f:as},"astc-12x12-unorm-srgb":{gl:37853,f:as},"pvrtc-rgb4unorm-webgl":{gl:35840,f:Uw},"pvrtc-rgba4unorm-webgl":{gl:35842,f:Uw},"pvrtc-rbg2unorm-webgl":{gl:35841,f:Uw},"pvrtc-rgba2unorm-webgl":{gl:35843,f:Uw},"etc1-rbg-unorm-webgl":{gl:36196,f:D$},"atc-rgb-unorm-webgl":{gl:35986,f:jM},"atc-rgba-unorm-webgl":{gl:35986,f:jM},"atc-rgbai-unorm-webgl":{gl:34798,f:jM}},j$={[6403]:1,[36244]:1,[33319]:2,[33320]:2,[6407]:3,[36248]:3,[6408]:4,[36249]:4,[6402]:1,[34041]:1,[6406]:1,[6409]:1,[6410]:2},G$={[5126]:4,[5125]:4,[5124]:4,[5123]:2,[5122]:2,[5131]:2,[5120]:1,[5121]:1};function mv(t,e){let r=OA(e),i=BA[r];if(!i||(zn(t)?i.gl===void 0:i.gl1===void 0))return!1;let n=i.x||zn(t)&&i.gl2ext||i.gl1ext;return n?Boolean(t.getExtension(n)):!0}function w4(t,e){var r;return mv(t,e)&&((r=BA[e])===null||r===void 0?void 0:r.renderbuffer)}function OA(t){if(typeof t=="string")return t;let e=Object.entries(BA).find(r=>{let[,i]=r;return i.gl===t||i.gl1===t});if(!e)throw new Error(`Unknown texture format ${t}`);return e[0]}function gv(t,e){let r=BA[t],i=e?r?.gl:r?.gl1;if(i===void 0)throw new Error(`Unsupported texture format ${t}`);return i}function T4(t,e){let r=OA(e);if(!mv(t,r))return!1;try{if(sv(r).signed)return!1}catch{return!1}return r.endsWith("32float")?Boolean(t.getExtension("OES_texture_float_linear")):r.endsWith("16float")?Boolean(t.getExtension("OES_texture_half_float_linear")):!0}function E4(t,e){let r=OA(e);return!(!mv(t,r)||typeof r=="number")}function a0(t,e){let r=OA(t),i=gv(r,e),n=sv(r);return{format:i,dataFormat:W$(n.format,n.integer,n.normalized,i),type:n.dataType?kw(n.dataType):5121,compressed:n.compressed}}function S4(t){let e=BA[t];if(!(e!=null&&e.attachment))throw new Error(`${t} is not a depth stencil format`);return e.attachment}function zw(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6408,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6408,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5121,n=null,o=null;try{n=t.createTexture(),t.bindTexture(3553,n);let s=0,l=1,c=1,h=0,g=new Uint8Array([0,0,255,255]);t.texImage2D(3553,s,e,l,c,h,r,i,g),o=t.createFramebuffer(),t.bindFramebuffer(36160,o),t.framebufferTexture2D(36160,36064,3553,n,0);let b=t.checkFramebufferStatus(36160)===36053;return t.bindTexture(3553,null),b}finally{t.deleteTexture(n),t.deleteFramebuffer(o)}}function _v(t,e){let r=OA(t),i=a0(r,e),n=j$[i.dataFormat]||4,o=G$[i.type]||1;return n*o}function W$(t,e,r,i){if(i===6408||i===6407)return i;switch(t){case"r":return e&&!r?36244:6403;case"rg":return e&&!r?33320:33319;case"rgb":return e&&!r?36248:6407;case"rgba":return e&&!r?36249:6408;default:return 6408}}function C4(t){let e=q$(t);for(let r of b4(t))e.add(r);return e}function q$(t){t.getExtension("EXT_color_buffer_float"),t.getExtension("WEBGL_color_buffer_float"),t.getExtension("EXT_float_blend");let e=new Set;for(let r of Object.keys(M4))X$(t,r)&&e.add(r);return e}function X$(t,e){let r=M4[e];if(!r)return!1;let[i,n]=r||[],o=zn(t)?n:i;if(typeof o=="boolean")return o;switch(e){case"texture-renderable-rgba32float-webgl":return zn(t)?Boolean(t.getExtension(o)):zw(t);case"glsl-derivatives":return qM(t,o);case"glsl-frag-data":return qM(t,o,{behavior:"require"});case"glsl-frag-depth":return qM(t,o);default:return Boolean(t.getExtension(o))}}var WM={};function qM(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!v4(r))return!0;if(e in WM)return WM[e];let i=r.behavior||"enable",n=`#extension GL_${e} : ${i}
|
|
552
552
|
void main(void) {}`,o=t.createShader(35633);if(!o)throw new Error("shader");t.shaderSource(o,n),t.compileShader(o);let s=t.getShaderParameter(o,35713);return t.deleteShader(o),WM[e]=s,s}var M4={webgl:[!0,!0],webgl2:[!1,!0],"timer-query-webgl":["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],"transform-feedback-webgl2":[!1,!0],"vertex-array-object-webgl1":["OES_vertex_array_object",!0],"instanced-rendering-webgl1":["ANGLE_instanced_arrays",!0],"multiple-render-targets-webgl1":["WEBGL_draw_buffers",!0],"index-uint32-webgl1":["OES_element_index_uint",!0],"blend-minmax-webgl1":["EXT_blend_minmax",!0],"texture-blend-float-webgl1":["EXT_float_blend","EXT_float_blend"],"texture-formats-srgb-webgl1":["EXT_sRGB",!0],"texture-formats-depth-webgl1":["WEBGL_depth_texture",!0],"texture-formats-float32-webgl1":["OES_texture_float",!0],"texture-formats-float16-webgl1":["OES_texture_half_float",!0],"texture-filter-linear-float32-webgl":["OES_texture_float_linear","OES_texture_float_linear"],"texture-filter-linear-float16-webgl":["OES_texture_half_float_linear","OES_texture_half_float_linear"],"texture-filter-anisotropic-webgl":["EXT_texture_filter_anisotropic","EXT_texture_filter_anisotropic"],"texture-renderable-rgba32float-webgl":["WEBGL_color_buffer_float","EXT_color_buffer_float"],"texture-renderable-float32-webgl":[!1,"EXT_color_buffer_float"],"texture-renderable-float16-webgl":["EXT_color_buffer_half_float","EXT_color_buffer_half_float"],"glsl-frag-data":["WEBGL_draw_buffers",!0],"glsl-frag-depth":["EXT_frag_depth",!0],"glsl-derivatives":["OES_standard_derivatives",!0],"glsl-texture-lod":["EXT_shader_texture_lod",!0]};function I4(t){let e=uv(t);return{maxTextureDimension1D:0,maxTextureDimension2D:t.getParameter(3379),maxTextureDimension3D:e?e.getParameter(32883):0,maxTextureArrayLayers:e?e.getParameter(35071):0,maxBindGroups:1,maxDynamicUniformBuffersPerPipelineLayout:0,maxDynamicStorageBuffersPerPipelineLayout:0,maxSampledTexturesPerShaderStage:t.getParameter(35660),maxSamplersPerShaderStage:t.getParameter(35661),maxStorageBuffersPerShaderStage:0,maxStorageTexturesPerShaderStage:0,maxUniformBuffersPerShaderStage:e?e.getParameter(35375):0,maxUniformBufferBindingSize:e?e.getParameter(35376):0,maxStorageBufferBindingSize:0,minUniformBufferOffsetAlignment:e?e.getParameter(35380):0,minStorageBufferOffsetAlignment:0,maxVertexBuffers:0,maxVertexAttributes:t.getParameter(34921),maxVertexBufferArrayStride:2048,maxInterStageShaderComponents:e?e.getParameter(35659):0,maxComputeWorkgroupStorageSize:0,maxComputeInvocationsPerWorkgroup:0,maxComputeWorkgroupSizeX:0,maxComputeWorkgroupSizeY:0,maxComputeWorkgroupSizeZ:0,maxComputeWorkgroupsPerDimension:0}}function P4(t){let e=uv(t);function r(n){return t.getParameter(n)}function i(n,o){return e?e.getParameter(n):o||0}return{[33902]:r(33902),[33901]:r(33901),[3379]:r(3379),[34076]:r(34076),[34930]:r(34930),[35661]:r(35661),[35660]:r(35660),[34024]:r(34024),[36348]:r(36348),[34921]:r(34921),[36347]:r(36347),[36349]:r(36349),[3386]:r(3386),[34047]:r(34047),[32883]:i(32883),[35071]:i(35071),[37447]:i(37447),[36063]:i(36063),[35379]:i(35379),[35374]:i(35374),[35377]:i(35377),[34852]:i(34852),[36203]:i(36203),[33001]:i(33001),[33e3]:i(33e3),[37157]:i(37157),[35373]:i(35373),[35657]:i(35657),[36183]:i(36183),[37137]:i(37137),[34045]:i(34045),[35978]:i(35978),[35979]:i(35979),[35968]:i(35968),[35376]:i(35376),[35375]:i(35375),[35659]:i(35659),[37154]:i(37154),[35371]:i(35371),[35658]:i(35658),[35076]:i(35076),[35077]:i(35077),[35380]:i(35380)}}function Fu(t,e,r){let n=Qo.attach(t).gl;if(Y$(e))return r(t);let{nocatch:o=!0}=e;xf(n),Lu(n,e);let s;if(o)s=r(n),Lc(n);else try{s=r(n)}finally{Lc(n)}return s}function Y$(t){for(let e in t)return!1;return!0}function B4(t,e,r,i){if(EA(e))return i(t);xf(t.gl);try{return jw(t,e),Lu(t,r),i(t)}finally{Lc(t.gl)}}function O4(t,e,r){if(EA(e))return r(t);xf(t.gl);try{return jw(t,e),r(t)}finally{Lc(t.gl)}}function jw(t,e){let r=Qo.attach(t),{gl:i}=r;if(e.cullMode)switch(e.cullMode){case"none":i.disable(2884);break;case"front":i.enable(2884),i.cullFace(1028);break;case"back":i.enable(2884),i.cullFace(1029);break}if(e.frontFace&&i.frontFace(yv("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.depthBias!==void 0&&i.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0),e.depthWriteEnabled!==void 0&&i.depthMask(Z$("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?i.enable(2929):i.disable(2929),i.depthFunc(Hw("depthCompare",e.depthCompare))),e.stencilWriteMask){let n=e.stencilWriteMask;i.stencilMaskSeparate(1028,n),i.stencilMaskSeparate(1029,n)}if(e.stencilReadMask&&gr.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){let n=e.stencilReadMask||4294967295,o=Hw("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?i.enable(2960):i.disable(2960),i.stencilFuncSeparate(1028,o,0,n),i.stencilFuncSeparate(1029,o,0,n)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){let n=XM("stencilPassOperation",e.stencilPassOperation),o=XM("stencilFailOperation",e.stencilFailOperation),s=XM("stencilDepthFailOperation",e.stencilDepthFailOperation);i.stencilOpSeparate(1028,o,s,n),i.stencilOpSeparate(1029,o,s,n)}if(e.blendColorOperation||e.blendAlphaOperation){i.enable(3042);let n=R4("blendColorOperation",e.blendColorOperation||"add"),o=R4("blendAlphaOperation",e.blendAlphaOperation||"add");i.blendEquationSeparate(n,o);let s=Vw("blendColorSrcFactor",e.blendColorSrcFactor||"one"),l=Vw("blendColorDstFactor",e.blendColorDstFactor||"zero"),c=Vw("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),h=Vw("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");i.blendFuncSeparate(s,l,c,h)}}function Hw(t,e){return yv(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function XM(t,e){return yv(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function R4(t,e){return yv(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function Vw(t,e){return yv(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773})}function K$(t,e){return`Illegal parameter ${e} for ${t}`}function yv(t,e,r){if(!(e in r))throw new Error(K$(t,e));return r[e]}function Z$(t,e){return e}function Gw(t){let e={};return t.addressModeU&&(e[10242]=YM(t.addressModeU)),t.addressModeV&&(e[10243]=YM(t.addressModeV)),t.addressModeW&&(e[32882]=YM(t.addressModeW)),t.magFilter&&(e[10240]=L4(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=J$(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=Hw("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function D4(t){let e={...t};return t[10241]!==9728&&(e[10241]=9729),e[10242]=33071,e[10243]=33071,e}function YM(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function L4(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function J$(t,e){if(!e)return L4(t);switch(t){case"nearest":return e==="nearest"?9984:9986;case"linear":return e==="nearest"?9985:9987}}var Jl=class extends rn{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e,r),this.device=void 0,this.gl=void 0,this.gl2=void 0,this.handle=void 0,this.glTarget=void 0,this.glUsage=void 0,this.glIndexType=5123,this.byteLength=void 0,this.bytesUsed=void 0,this.device=e,this.gl=this.device.gl,this.gl2=this.device.gl2;let i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),e.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=Q$(this.props.usage),this.glUsage=$$(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.byteLength+r,n=this.glTarget;this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,this.glUsage),this.gl.bufferSubData(n,r,e),this.gl.bindBuffer(n,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(e,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(e){_i(e>=0);let r=e;e===0&&(r=new Float32Array(0));let i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=e,this.byteLength=e,this._setDebugData(null,0,e),this.trackAllocatedMemory(e),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=0,n=void 0,o=this.device.isWebGL2?36663:this.glTarget;this.gl.bindBuffer(o,this.handle),i!==0||n!==void 0?(this.device.assertWebGL2(),this.gl2.bufferSubData(o,r,e,i,n)):this.gl.bufferSubData(o,r,e),this.gl.bindBuffer(o,null),this._setDebugData(e,r,e.byteLength)}async readAsync(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=arguments.length>1?arguments[1]:void 0;return this.readSyncWebGL2(e,r)}readSyncWebGL2(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;this.device.assertWebGL2(),i=(e=i)!==null&&e!==void 0?e:this.byteLength-r;let n=new Uint8Array(i),o=0;return this.gl.bindBuffer(36662,this.handle),this.gl2.getBufferSubData(36662,r,n,o,i),this.gl.bindBuffer(36662,null),this._setDebugData(n,r,i),n}};function Q$(t){return t&rn.INDEX?34963:t&rn.VERTEX?34962:t&rn.UNIFORM?35345:34962}function $$(t){return t&rn.INDEX||t&rn.VERTEX?35044:t&rn.UNIFORM?35048:35044}var _d=class extends fd{constructor(e,r){super(e,r),this.device=void 0,this.handle=void 0,this.parameters=void 0,this.device=e,this.parameters=Gw(r),this.device.isWebGL2&&(this.handle=this.handle||this.device.gl2.createSampler(),this._setSamplerParameters(this.parameters))}destroy(){this.handle&&(this.device.gl2.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(e){for(let[r,i]of Object.entries(e)){let n=Number(r);switch(n){case 33082:case 33083:this.device.gl2.samplerParameterf(this.handle,n,i);break;default:this.device.gl2.samplerParameteri(this.handle,n,i);break}}}};var eee={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},Da=class extends Bs{constructor(e,r){var i;super(e,{...eee,format:"rgba8unorm",...r}),this.MAX_ATTRIBUTES=void 0,this.device=void 0,this.gl=void 0,this.gl2=void 0,this.handle=void 0,this.sampler=void 0,this.glFormat=void 0,this.type=void 0,this.dataFormat=void 0,this.mipmaps=void 0,this.target=void 0,this.textureUnit=void 0,this.loaded=!1,this._video=void 0,this.device=e,this.gl=this.device.gl,this.gl2=this.device.gl2,this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glFormat=6408,this.target=tee(this.props),this.loaded=!1,typeof((i=this.props)===null||i===void 0?void 0:i.data)=="string"&&Object.assign(this.props,{data:Rw(this.props.data)}),this.initialize(this.props),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.props.dimension==="cube")return this.initializeCube(e);let r=e.data;if(r instanceof Promise)return r.then(U=>this.initialize(Object.assign({},e,{pixels:U,data:U}))),this;let i=typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement;if(i&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",()=>this.initialize(e)),this;let{parameters:n={}}=e,{pixels:o=null,pixelStore:s={},textureUnit:l=void 0}=e;r||(r=o);let{width:c,height:h,dataFormat:g,type:b,compressed:T=!1,mipmaps:C=!0}=e,{depth:P=0}=e,H=gv(e.format,this.device.isWebGL2);return{width:c,height:h,compressed:T,dataFormat:g,type:b}=this._deduceParameters({format:e.format,type:b,dataFormat:g,compressed:T,data:r,width:c,height:h}),this.width=c,this.height=h,this.glFormat=H,this.type=b,this.dataFormat=g,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this.device.isWebGL1&&Ww(this.width,this.height)&&(gr.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaps`)(),C=!1),this.mipmaps=C,this.setImageData({data:r,width:c,height:h,depth:P,format:H,type:b,dataFormat:g,parameters:s,compressed:T}),this.setSampler(e.sampler),this._setSamplerParameters(n),C&&this.generateMipmap(),i&&(this._video={video:r,parameters:n,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}initializeCube(e){let{mipmaps:r=!0,parameters:i={}}=e;return this.setCubeMapImageData(e).then(()=>{this.loaded=!0,r&&this.generateMipmap(e),this.setSampler(e.sampler),this._setSamplerParameters(i)}),this}setSampler(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r;e instanceof _d?(this.sampler=e,r=e.props):(this.sampler=new _d(this.device,e),r=e);let i=Gw(r);return this._setSamplerParameters(i),this}resize(e){let{height:r,width:i,mipmaps:n=!1}=e;return i!==this.width||r!==this.height?this.initialize({width:i,height:r,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:n}):this}update(){if(this._video){let{video:e,parameters:r,lastTime:i}=this._video;if(i===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}generateMipmap(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.device.isWebGL1&&Ww(this.width,this.height)?(gr.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Fu(this.gl,e,()=>{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(e);this.trackDeallocatedMemory("Texture");let{target:r=this.target,pixels:i=null,level:n=0,glFormat:o=this.glFormat,offset:s=0,parameters:l={}}=e,{data:c=null,type:h=this.type,width:g=this.width,height:b=this.height,dataFormat:T=this.dataFormat,compressed:C=!1}=e;c||(c=i),{type:h,dataFormat:T,compressed:C,width:g,height:b}=this._deduceParameters({format:this.props.format,type:h,dataFormat:T,compressed:C,data:c,width:g,height:b});let{gl:P}=this;P.bindTexture(this.target,this.handle);let H=null;({data:c,dataType:H}=this._getDataType({data:c,compressed:C}));let U;if(Fu(this.gl,l,()=>{switch(H){case"null":P.texImage2D(r,n,o,g,b,0,T,h,c);break;case"typed-array":P.texImage2D(r,n,o,g,b,0,T,h,c,s);break;case"buffer":U=this.device.assertWebGL2(),U.bindBuffer(35052,c.handle||c),U.texImage2D(r,n,o,g,b,0,T,h,s),U.bindBuffer(35052,null);break;case"browser-object":this.device.isWebGL2?P.texImage2D(r,n,o,g,b,0,T,h,c):P.texImage2D(r,n,o,T,h,c);break;case"compressed":for(let[J,ee]of c.entries())P.compressedTexImage2D(r,J,ee.format,ee.width,ee.height,0,ee.data);break;default:_i(!1,"Unknown image data type")}}),c&&c.byteLength)this.trackAllocatedMemory(c.byteLength,"Texture");else{let J=_v(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*J,"Texture")}return this.loaded=!0,this}setSubImageData(e){let{target:r=this.target,pixels:i=null,data:n=null,x:o=0,y:s=0,width:l=this.width,height:c=this.height,level:h=0,glFormat:g=this.glFormat,type:b=this.type,dataFormat:T=this.dataFormat,compressed:C=!1,offset:P=0,parameters:H={}}=e;if({type:b,dataFormat:T,compressed:C,width:l,height:c}=this._deduceParameters({format:this.props.format,type:b,dataFormat:T,compressed:C,data:n,width:l,height:c}),_i(this.depth===1,"texSubImage not supported for 3D textures"),n||(n=i),n&&n.data){let U=n;n=U.data,l=U.shape[0],c=U.shape[1]}n instanceof Jl&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),Fu(this.gl,H,()=>{if(C)this.gl.compressedTexSubImage2D(r,h,o,s,l,c,g,n);else if(n===null)this.gl.texSubImage2D(r,h,o,s,l,c,T,b,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(r,h,o,s,l,c,T,b,n,P);else if(typeof WebGLBuffer<"u"&&n instanceof WebGLBuffer){let U=this.device.assertWebGL2();U.bindBuffer(35052,n),U.texSubImage2D(r,h,o,s,l,c,T,b,P),U.bindBuffer(35052,null)}else this.device.isWebGL2?this.device.assertWebGL2().texSubImage2D(r,h,o,s,l,c,T,b,n):this.gl.texSubImage2D(r,h,o,s,T,b,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return gr.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.target,this.handle),e}unbind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.target,null),e}_getDataType(e){let{data:r,compressed:i=!1}=e;return i?{data:r,dataType:"compressed"}:r===null?{data:r,dataType:"null"}:ArrayBuffer.isView(r)?{data:r,dataType:"typed-array"}:r instanceof Jl?{data:r.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&r instanceof WebGLBuffer?{data:r,dataType:"buffer"}:{data:r,dataType:"browser-object"}}_deduceParameters(e){let{format:r,data:i}=e,{width:n,height:o,dataFormat:s,type:l,compressed:c}=e,h=a0(r,this.device.isWebGL2);return s=s||h.dataFormat,l=l||h.type,c=c||h.compressed,{width:n,height:o}=this._deduceImageSize(i,n,o),{dataFormat:s,type:l,compressed:c,width:n,height:o,format:r,data:i}}_deduceImageSize(e,r,i){let n;return typeof ImageData<"u"&&e instanceof ImageData?n={width:e.width,height:e.height}:typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement?n={width:e.naturalWidth,height:e.naturalHeight}:typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement?n={width:e.width,height:e.height}:typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n={width:e.width,height:e.height}:typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?n={width:e.videoWidth,height:e.videoHeight}:e?n={width:r,height:i}:n={width:r>=0?r:1,height:i>=0?i:1},_i(n,"Could not deduced texture size"),_i(r===void 0||n.width===r,"Deduced texture width does not match supplied width"),_i(i===void 0||n.height===i,"Deduced texture height does not match supplied height"),n}async setCubeMapImageData(e){let{gl:r}=this,{width:i,height:n,pixels:o,data:s,format:l=6408,type:c=5121}=e,h=o||s,g=await Promise.all(Da.FACES.map(b=>{let T=h[b];return Promise.all(Array.isArray(T)?T:[T])}));this.bind(),Da.FACES.forEach((b,T)=>{g[T].length>1&&this.props.mipmaps!==!1&&gr.warn(`${this.id} has mipmap and multiple LODs.`)(),g[T].forEach((C,P)=>{i&&n?r.texImage2D(b,P,l,i,n,0,l,c,C):r.texImage2D(b,P,l,l,c,C)})}),this.unbind()}setImageDataForFace(e){let{face:r,width:i,height:n,pixels:o,data:s,format:l=6408,type:c=5121}=e,{gl:h}=this,g=o||s;return this.bind(),g instanceof Promise?g.then(b=>this.setImageDataForFace(Object.assign({},e,{face:r,data:b,pixels:b}))):this.width||this.height?h.texImage2D(r,0,l,i,n,0,l,c,g):h.texImage2D(r,0,l,l,c,g),this}setImageData3D(e){let{level:r=0,dataFormat:i,format:n,type:o,width:s,height:l,depth:c=1,offset:h=0,data:g,parameters:b={}}=e;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);let T=a0(n,this.device.isWebGL2);if(Fu(this.gl,b,()=>{ArrayBuffer.isView(g)&&this.gl.texImage3D(this.target,r,T.format,s,l,c,0,T.dataFormat,T.type,g),g instanceof Jl&&(this.gl.bindBuffer(35052,g.handle),this.gl.texImage3D(this.target,r,i,s,l,c,0,n,o,h))}),g&&g.byteLength)this.trackAllocatedMemory(g.byteLength,"Texture");else{let C=_v(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*this.depth*C,"Texture")}return this.loaded=!0,this}_setSamplerParameters(e){if(this.device.isWebGL1&&Ww(this.width,this.height)&&(e=D4(e)),!EA(e)){ree(e),this.gl.bindTexture(this.target,this.handle);for(let[r,i]of Object.entries(e)){let n=Number(r),o=i;switch(n){case 33082:case 33083:this.gl.texParameterf(this.target,n,o);break;default:this.gl.texParameteri(this.target,n,o);break}}this.gl.bindTexture(this.target,null)}}_getWebGL1NPOTParameterOverride(e,r){if(this.device.isWebGL1&&Ww(this.width,this.height))switch(e){case 10241:if(r!==9729&&r!==9728)return 9729;break;case 10242:case 10243:return 33071;default:break}return r}};Da.FACES=[34069,34070,34071,34072,34073,34074];function tee(t){switch(t.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;case"1d":case"cube-array":default:throw new Error(t.dimension)}}function Ww(t,e){return!t||!e?!1:!tv(t)||!tv(e)}function ree(t){gr.log(1,"texture sampler parameters",t)()}function qw(t,e){if(typeof e!="string")return e;let r=Number(e);if(!isNaN(r))return r;e=e.replace(/^.*\./,"");let i=t[e];return _i(i!==void 0,`Accessing undefined constant GL.${e}`),i}var l0="Resource subclass must define virtual methods",DA=class extends tn{constructor(e,r,i){super(e,r,i),this.device=void 0,this.gl=void 0,this.gl2=void 0,this._handle=void 0,this._bound=!1,this.byteLength=0,this.device=Qo.attach(e);let n=this.device.gl;Lw(n);let{id:o}=r||{};this.gl=n,this.gl2=n,this.id=o||uo(this.constructor.name),this._handle=r?.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete(){let{deleteChildren:e=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this._handle&&this._deleteHandle(this._handle);return this._handle&&this.removeStats(),this._handle=null,r&&e&&r.filter(Boolean).forEach(i=>i.destroy()),this}bind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof e!="function")return this._bindHandle(e),this;let r;return this._bound?r=e():(this._bindHandle(this.handle),this._bound=!0,r=e(),this._bound=!1,this._bindHandle(null)),r}unbind(){this.bind(null)}getParameter(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e=qw(this.gl,e),_i(e);let n=(this.constructor.PARAMETERS||{})[e];if(n){let o=zn(this.gl);if(!((!("webgl2"in n)||o)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){let l=n.webgl1,c="webgl2"in n?n.webgl2:n.webgl1;return o?c:l}}return this._getParameter(e,r)}getParameters(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{parameters:r,keys:i}=e,n=this.constructor.PARAMETERS||{},o=zn(this.gl),s={},l=r||Object.keys(n);for(let c of l){let h=n[c];if(h&&(!("webgl2"in h)||o)&&(!("extension"in h)||this.gl.getExtension(h.extension))){let b=i?this.device.getGLKey(c):c;s[b]=this.getParameter(c,e),i&&h.type==="GLenum"&&(s[b]=this.device.getGLKey(s[b]))}}return s}setParameter(e,r){e=qw(this.gl,e),_i(e);let n=(this.constructor.PARAMETERS||{})[e];if(n){let o=zn(this.gl);if(!((!("webgl2"in n)||o)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");n.type==="GLenum"&&(r=qw(r))}return this._setParameter(e,r),this}setParameters(e){for(let r in e)this.setParameter(r,e[r]);return this}stubRemovedMethods(e,r,i){return Mw(this,e,r,i)}initialize(e){}_createHandle(){throw new Error(l0)}_deleteHandle(){throw new Error(l0)}_bindHandle(e){throw new Error(l0)}_getOptsFromHandle(){throw new Error(l0)}_getParameter(e,r){throw new Error(l0)}_setParameter(e,r){throw new Error(l0)}};var F4;F4=Symbol.toStringTag;var Fc=class extends DA{get[F4](){return"Renderbuffer"}get width(){return this.props.width}get height(){return this.props.height}get format(){return this.props.format}get samples(){return this.props.samples}get attachment(){}static isTextureFormatSupported(e,r){return w4(e.gl,r)}constructor(e,r){if(typeof r.format=="number")throw new Error("Renderbuffer");super(e,r,Fc.defaultProps),this.glFormat=void 0,this.glFormat=gv(this.props.format,e.isWebGL2),this._initialize(this.props)}resize(e){(e.width!==this.width||e.height!==this.height)&&(Object.assign(this.props,{...e,format:this.format,samples:this.samples}),this._initialize(this.props))}_initialize(e){let{format:r,width:i,height:n,samples:o}=e;_i(r,"Needs format"),this.trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),o!==0&&this.device.isWebGL2?this.gl2.renderbufferStorageMultisample(36161,o,this.glFormat,i,n):this.gl.renderbufferStorage(36161,this.glFormat,i,n),this.gl.bindRenderbuffer(36161,null),this.trackAllocatedMemory(i*n*(o||1)*_v(this.glFormat,this.device.isWebGL2))}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this.trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}};Fc.defaultProps={id:void 0,handle:void 0,userData:void 0,format:void 0,width:1,height:1,samples:0};var Nc=class extends vf{get texture(){return this.colorAttachments[0]}constructor(e,r){super(e,r),this.device=void 0,this.gl=void 0,this.handle=void 0;let i=r.handle===null;if(this.device=e,this.gl=e.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),!i){e.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures(),this.gl.bindFramebuffer(36160,this.handle);for(let n=0;n<this.colorAttachments.length;++n){let o=this.colorAttachments[n],s=36064+n;o&&this._attachOne(s,o)}this.depthStencilAttachment&&this._attachOne(S4(this.depthStencilAttachment.format),this.depthStencilAttachment),this.gl.bindFramebuffer(36160,null)}r.check!==!1&&this._checkStatus()}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}_checkStatus(){let{gl:e}=this,r=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,r||null),i!==36053)throw new Error(`Framebuffer ${nee(i)}`)}createDepthStencilTexture(e){return new Fc(this.device,{id:`${this.id}-depth-stencil`,format:e,width:this.width,height:this.height})}resizeAttachments(e,r){if(this.handle===null)return this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;e===void 0&&(e=this.gl.drawingBufferWidth),r===void 0&&(r=this.gl.drawingBufferHeight);for(let i of this.colorAttachments)i.resize({width:e,height:r});return this.depthStencilAttachment&&this.depthStencilAttachment.resize({width:e,height:r}),this}_attachOne(e,r){if(r instanceof Fc)return this._attachWEBGLRenderbuffer(e,r),r;if(Array.isArray(r)){let[i,n=0,o=0]=r;return this._attachTexture(e,i,n,o),i}else if(r instanceof Da)return this._attachTexture(e,r,0,0),r;throw new Error("attach")}_attachWEBGLRenderbuffer(e,r){this.gl.framebufferRenderbuffer(36160,e,36161,r.handle)}_attachTexture(e,r,i,n){let{gl:o,gl2:s}=this.device;switch(o.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:this.device.assertWebGL2(),s?.framebufferTextureLayer(36160,e,r.target,n,i);break;case 34067:let l=iee(i);o.framebufferTexture2D(36160,e,l,r.handle,n);break;case 3553:o.framebufferTexture2D(36160,e,3553,r.handle,n);break;default:_i(!1,"Illegal texture type")}o.bindTexture(r.target,null)}};function iee(t){return t<34069?t+34069:t}function nee(t){switch(t){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return`${t}`}}var u0=class extends ud{constructor(e,r){super(r),this.device=void 0,this.presentationSize=void 0,this._framebuffer=null,this.device=e,this.presentationSize=[-1,-1],this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this.update()}getCurrentFramebuffer(){return this.update(),this._framebuffer=this._framebuffer||new Nc(this.device,{handle:null}),this._framebuffer}update(){let e=this.getPixelSize();(e[0]!==this.presentationSize[0]||e[1]!==this.presentationSize[1])&&(this.presentationSize=e,this.resize())}resize(e){if(!this.device.gl)return;if(this.canvas){let i=this.getDevicePixelRatio(e?.useDevicePixels);this.setDevicePixelRatio(i,e);return}let r=this.device.gl.getExtension("STACKGL_resize_drawingbuffer");r&&e&&"width"in e&&"height"in e&&r.resize(e.width,e.height)}commit(){}};var oee={spector:gr.get("spector")||gr.get("inspect")},see="https://spectorcdn.babylonjs.com/spector.bundle.js",aee=1,Nu=null,N4=!1;async function k4(t){if(!globalThis.SPECTOR)try{await r0(see)}catch(e){gr.warn(String(e))}}function U4(t){var e,r;if(t={...oee,...t},!((e=t)!==null&&e!==void 0&&e.spector)||(!Nu&&globalThis.SPECTOR&&(gr.probe(aee,"SPECTOR found and initialized")(),Nu=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=Nu)),!Nu))return null;if(!N4){var i,n;N4=!0,Nu.spyCanvases(),(i=Nu)===null||i===void 0||i.onCaptureStarted.add(l=>gr.info("Spector capture started:",l)()),(n=Nu)===null||n===void 0||n.onCapture.add(l=>{var c,h,g;gr.info("Spector capture complete:",l)(),(c=Nu)===null||c===void 0||c.getResultUI(),(h=Nu)===null||h===void 0||h.resultView.display(),(g=Nu)===null||g===void 0||g.resultView.addCapture(l)})}if((r=t)!==null&&r!==void 0&&r.canvas){var o,s;if(typeof t.spector=="string"&&t.spector!==t.canvas.id)return Nu;(o=Nu)===null||o===void 0||o.startCapture((s=t)===null||s===void 0?void 0:s.canvas,500),new Promise(l=>setTimeout(l,2e3)).then(l=>{var c;gr.info("Spector capture stopped after 2 seconds")(),(c=Nu)===null||c===void 0||c.stopCapture()})}return Nu}var Ct=function(t){return t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.SRGB_EXT=35904]="SRGB_EXT",t[t.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",t[t.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",t[t.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",t[t.RGBA32F_EXT=34836]="RGBA32F_EXT",t[t.RGB32F_EXT=34837]="RGB32F_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",t[t.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",t[t.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",t[t.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",t[t.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",t[t.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",t[t.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",t[t.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",t[t.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",t[t.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",t[t.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",t[t.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",t[t.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",t[t.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",t[t.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",t[t.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",t[t.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",t[t.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",t[t.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",t[t.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",t[t.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",t[t.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",t[t.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",t[t.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",t[t.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",t[t.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",t[t.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",t[t.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",t[t.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",t[t.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",t[t.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",t[t.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",t[t.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",t[t.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",t[t.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",t[t.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",t[t.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t}(Ct||{});var lee="https://unpkg.com/webgl-debug@2.0.1/index.js";function z4(t){return t.luma=t.luma||{},t.luma}async function V4(){Rs()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await r0(lee))}function H4(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.debug?cee(t,e):uee(t):null}function uee(t){let e=z4(t);return e.realContext?e.realContext:t}function cee(t,e){if(!globalThis.WebGLDebugUtils)return gr.warn("webgl-debug not loaded")(),t;let r=z4(t);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init({...Ct,...t});let i=globalThis.WebGLDebugUtils.makeDebugContext(t,fee.bind(null,e),hee.bind(null,e));for(let s in Ct)!(s in i)&&typeof Ct[s]=="number"&&(i[s]=Ct[s]);class n{}Object.setPrototypeOf(i,Object.getPrototypeOf(t)),Object.setPrototypeOf(n,i);let o=Object.create(n);return r.realContext=t,r.debugContext=o,o.debug=!0,o}function KM(t,e){e=Array.from(e).map(i=>i===void 0?"undefined":i);let r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return r=`${r.slice(0,100)}${r.length>100?"...":""}`,`gl.${t}(${r})`}function fee(t,e,r,i){i=Array.from(i).map(c=>c===void 0?"undefined":c);let n=globalThis.WebGLDebugUtils.glEnumToString(e),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,i),s=t.webgl2?"gl2":"gl1",l=`${n} in ${s}.${r}(${o})`;gr.error(l)();debugger;if(t.throwOnError)throw new Error(l)}function hee(t,e,r){let i="";if(gr.level>=1&&(i=KM(e,r),gr.log(1,i)()),t.break&&t.break.length>0&&(i=i||KM(e,r),t.break.every(o=>i.indexOf(o)!==-1)))debugger;for(let n of r)if(n===void 0){if(i=i||KM(e,r),t.throwOnError)throw new Error(`Undefined argument: ${i}`);gr.error(`Undefined argument: ${i}`)();debugger}}function G4(t){let e=t.split(/\r?\n/),r=[];for(let i of e){if(i.length<=1)continue;let n=i.split(":");if(n.length===2){let[b,T]=n;r.push({message:T.trim(),type:j4(b),lineNum:0,linePos:0});continue}let[o,s,l,...c]=n,h=parseInt(l,10);isNaN(h)&&(h=0);let g=parseInt(s,10);isNaN(g)&&(g=0),r.push({message:c.join(":").trim(),type:j4(o),lineNum:h,linePos:g})}return r}function j4(t){let e=["warning","error","info"],r=t.toLowerCase();return e.includes(r)?r:"info"}var c0=class extends cd{constructor(e,r){switch(super(e,r),this.device=void 0,this.handle=void 0,this.device=e,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}async getCompilationInfo(){return this.getCompilationInfoSync()}getCompilationInfoSync(){let e=this.device.gl.getShaderInfoLog(this.handle);return G4(e)}_compile(e){e=(n=>n.startsWith("#version ")?n:`#version 100
|
|
553
|
-
${n}`)(e);let{gl:i}=this.device;if(i.shaderSource(this.handle,e),i.compileShader(this.handle),this.compilationStatus=i.getShaderParameter(this.handle,35713)?"success":"error",this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`)}};var dee=256,pee=1024,Aee=16384,ZM=6144,f0=class extends hd{constructor(e,r){super(e,r),this.device=void 0,this.glParameters=void 0,this.device=e,xf(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){Lc(this.device.gl),this.props.framebuffer&&Lu(this.device,{framebuffer:null})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={};this.props.framebuffer&&(r.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(r.viewport=e.viewport.slice(0,4),r.depthRange=[e.viewport[4],e.viewport[5]]):r.viewport=e.viewport),r.scissorTest=Boolean(e.scissorRect),e.scissorRect&&(r.scissor=e.scissorRect),e.blendConstant&&(r.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),e[2967]=e.stencilReference),this.glParameters=r,Lu(this.device,r)}clear(){let e={...this.glParameters},r=0;this.props.clearColor!==!1&&(r|=Aee,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=dee,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=pee,e.clearStencil=this.props.clearStencil),r!==0&&Fu(this.device,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];Fu(this.device.gl2,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int32Array:this.device.gl2.clearBufferiv(ZM,e,r);break;case Uint32Array:this.device.gl2.clearBufferuiv(ZM,e,r);break;case Float32Array:default:this.device.gl2.clearBufferfv(ZM,e,r);break}})}};var mee="Failed to deduce GL constant from typed array";function W4(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(mee)}}function vv(t,e){let{clamped:r=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var gee={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},_ee={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},_h=class{static getBytesPerElement(e){return vv(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return _i(e.size),vv(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new _h(gee,...r)}constructor(){this.offset=void 0,this.stride=void 0,this.type=void 0,this.size=void 0,this.divisor=void 0,this.normalized=void 0,this.integer=void 0,this.buffer=void 0,this.index=void 0;for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];r.forEach(n=>this._assign(n)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return _h.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _h.getBytesPerVertex(this)}_assign(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e=Iw("Accessor",e,_ee),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}};function q4(t){return yee.includes(t)}var yee=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],X4={[5126]:[5126,1,"float","f32","float32"],[35664]:[5126,2,"vec2","vec2<f32>","float32x2"],[35665]:[5126,3,"vec3","vec3<f32>","float32x3"],[35666]:[5126,4,"vec4","vec4<f32>","float32x4"],[5124]:[5124,1,"int","i32","sint32"],[35667]:[5124,2,"ivec2","vec2<i32>","sint32x2"],[35668]:[5124,3,"ivec3","vec3<i32>","sint32x3"],[35669]:[5124,4,"ivec4","vec4<i32>","sint32x4"],[5125]:[5125,1,"uint","u32","uint32"],[36294]:[5125,2,"uvec2","vec2<u32>","uint32x2"],[36295]:[5125,3,"uvec3","vec3<u32>","uint32x3"],[36296]:[5125,4,"uvec4","vec4<u32>","uint32x4"],[35670]:[5126,1,"bool","f32","float32"],[35671]:[5126,2,"bvec2","vec2<f32>","float32x2"],[35672]:[5126,3,"bvec3","vec3<f32>","float32x3"],[35673]:[5126,4,"bvec4","vec4<f32>","float32x4"],[35674]:[5126,8,"mat2","mat2x2<f32>"],[35685]:[5126,8,"mat2x3","mat2x3<f32>"],[35686]:[5126,8,"mat2x4","mat2x4<f32>"],[35687]:[5126,12,"mat3x2","mat3x2<f32>"],[35675]:[5126,12,"mat3","mat3x3<f32>"],[35688]:[5126,12,"mat3x4","mat3x4<f32>"],[35689]:[5126,16,"mat4x2","mat4x2<f32>"],[35690]:[5126,16,"mat4x3","mat4x3<f32>"],[35676]:[5126,16,"mat4","mat4x4<f32>"]};function JM(t){let e=X4[t];if(!e)throw new Error("uniform");let[r,i,,n]=e;return{format:n,components:i,glType:r}}function Y4(t){let e=X4[t];if(!e)throw new Error("attribute");let[,r,,i,n]=e;return{attributeType:i,vertexFormat:n,components:r}}function Xw(t,e){let r={attributes:[],bindings:[]};r.attributes=vee(t,e);let i=wee(t,e);for(let l of i){let c=l.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));r.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:c})}let n=bee(t,e),o=0;for(let l of n)if(q4(l.type)){let{viewDimension:c,sampleType:h}=Eee(l.type);r.bindings.push({type:"texture",name:l.name,location:o,viewDimension:c,sampleType:h}),l.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=xee(t,e);return s!=null&&s.length&&(r.varyings=s),r}function vee(t,e){let r=[],i=t.getProgramParameter(e,35721);for(let n=0;n<i;n++){let o=t.getActiveAttrib(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l}=o,c=t.getAttribLocation(e,s);if(c>=0){let{attributeType:h}=Y4(l),g=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:c,stepMode:g,type:h})}}return r.sort((n,o)=>n.location-o.location),r}function xee(t,e){if(!zn(t))return[];let r=t,i=[],n=t.getProgramParameter(e,35971);for(let o=0;o<n;o++){let s=r.getTransformFeedbackVarying(e,o);if(!s)throw new Error("activeInfo");let{name:l,type:c,size:h}=s,{glType:g,components:b}=JM(c),T=new _h({type:g,size:h*b}),C={location:o,name:l,accessor:T};i.push(C)}return i.sort((o,s)=>o.location-s.location),i}function bee(t,e){let r=[],i=t.getProgramParameter(e,35718);for(let n=0;n<i;n++){let o=t.getActiveUniform(e,n);if(!o)throw new Error("activeInfo");let{name:s,size:l,type:c}=o,{name:h,isArray:g}=See(s),b=t.getUniformLocation(e,h),T={location:b,name:h,size:l,type:c,isArray:g};if(r.push(T),T.size>1)for(let C=0;C<T.size;C++){let P=`${h}[${C}]`;b=t.getUniformLocation(e,P);let H={...T,name:P,location:b};r.push(H)}}return r}function wee(t,e){if(!zn(t))return[];let r=t,i=(s,l)=>r.getActiveUniformBlockParameter(e,s,l),n=[],o=r.getProgramParameter(e,35382);for(let s=0;s<o;s++){let l={name:r.getActiveUniformBlockName(e,s)||"",location:i(s,35391),byteLength:i(s,35392),vertex:i(s,35396),fragment:i(s,35398),uniformCount:i(s,35394),uniforms:[]},c=i(s,35395)||[],h=r.getActiveUniforms(e,c,35383),g=r.getActiveUniforms(e,c,35384),b=r.getActiveUniforms(e,c,35387),T=r.getActiveUniforms(e,c,35388);for(let C=0;C<l.uniformCount;++C){let P=r.getActiveUniform(e,c[C]);if(!P)throw new Error("activeInfo");l.uniforms.push({name:P.name,format:JM(h[C]).format,type:h[C],arrayLength:g[C],byteOffset:b[C],byteStride:T[C]})}n.push(l)}return n.sort((s,l)=>s.location-l.location),n}var Tee={[35678]:["2d","float"],[35680]:["cube","float"],[35679]:["3d","float"],[35682]:["3d","depth"],[36289]:["2d-array","float"],[36292]:["2d-array","depth"],[36293]:["cube","float"],[36298]:["2d","sint"],[36299]:["3d","sint"],[36300]:["cube","sint"],[36303]:["2d-array","uint"],[36306]:["2d","uint"],[36307]:["3d","uint"],[36308]:["cube","uint"],[36311]:["2d-array","uint"]};function Eee(t){let e=Tee[t];if(!e)throw new Error("sampler");let[r,i]=e;return{viewDimension:r,sampleType:i}}function See(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};let r=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function K4(t,e,r,i){let n=t,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:return t.uniform1iv(e,s);case 35667:return t.uniform2iv(e,s);case 35668:return t.uniform3iv(e,s);case 35669:return t.uniform4iv(e,s);case 35670:return t.uniform1iv(e,s);case 35671:return t.uniform2iv(e,s);case 35672:return t.uniform3iv(e,s);case 35673:return t.uniform4iv(e,s);case 5125:return n.uniform1uiv(e,s,1);case 36294:return n.uniform2uiv(e,s,2);case 36295:return n.uniform3uiv(e,s,3);case 36296:return n.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return n.uniformMatrix2x3fv(e,!1,s);case 35686:return n.uniformMatrix2x4fv(e,!1,s);case 35687:return n.uniformMatrix3x2fv(e,!1,s);case 35688:return n.uniformMatrix3x4fv(e,!1,s);case 35689:return n.uniformMatrix4x2fv(e,!1,s);case 35690:return n.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function Z4(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function J4(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}var Q4=4,h0=class extends rc{constructor(e,r){super(e,r),this.device=void 0,this.handle=void 0,this.vs=void 0,this.fs=void 0,this.introspectedLayout=void 0,this.uniforms={},this.bindings={},this.varyings=null,this._uniformCount=0,this._uniformSetters={},this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;if(i&&i.length>0){var o;this.device.assertWebGL2(),this.varyings=i,(o=this.device.gl2)===null||o===void 0||o.transformFeedbackVaryings(this.handle,i,n)}switch(this._compileAndLink(),this.introspectedLayout=Xw(this.device.gl,this.handle),this.shaderLayout=xw(this.introspectedLayout,r.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":gr.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break;default:}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e){for(let[r,i]of Object.entries(e)){let n=this.shaderLayout.bindings.find(o=>o.name===r)||this.shaderLayout.bindings.find(o=>o.name===`${r}Uniforms`);if(!n){let o=this.shaderLayout.bindings.map(s=>`"${s.name}"`).join(", ");gr.warn(`Unknown binding "${r}" in render pipeline "${this.id}", expected one of ${o}`)();continue}switch(i||gr.warn(`Unsetting binding "${r}" in render pipeline "${this.id}"`)(),n.type){case"uniform":if(!(i instanceof Jl)&&!(i.buffer instanceof Jl))throw new Error("buffer value");break;case"texture":if(!(i instanceof Da||i instanceof Nc))throw new Error("texture value");break;case"sampler":gr.warn(`Ignoring sampler ${r}`)();break;default:throw new Error(n.type)}this.bindings[r]=i}}setUniforms(e){let{bindings:r}=t0(e);Object.keys(r).forEach(i=>{gr.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,e)}draw(e){var r;let{renderPass:i,vertexArray:n,vertexCount:o,instanceCount:s,firstVertex:l=0,transformFeedback:c}=e,h=Z4(this.props.topology),g=Boolean(n.indexBuffer),b=(r=n.indexBuffer)===null||r===void 0?void 0:r.glIndexType,T=Number(s)>0;if(!this._areTexturesRenderable()||o===0)return!1;this.device.gl.useProgram(this.handle),n.bindBeforeRender(i),c&&c.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let C=i;return B4(this.device,this.props.parameters,C.glParameters,()=>{if(g&&T){var P;(P=this.device.gl2)===null||P===void 0||P.drawElementsInstanced(h,o||0,b,l,s||0)}else if(g)this.device.gl.drawElements(h,o||0,b,l);else if(T){var H;(H=this.device.gl2)===null||H===void 0||H.drawArraysInstanced(h,l,o||0,s||0)}else this.device.gl.drawArrays(h,l,o||0);c&&c.end()}),n.unbindAfterRender(i),!0}_compileAndLink(){let{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),gr.time(Q4,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),gr.timeEnd(Q4,`linkProgram for ${this.id}`)(),!e.debug&&gr.level,!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}_areTexturesRenderable(){let e=!0;for(let[,r]of Object.entries(this.bindings))r instanceof Da&&(r.update(),e=e&&r.loaded);return e}_applyBindings(){this.device.gl.useProgram(this.handle);let{gl2:e}=this.device;if(!e)throw new Error("bindings");let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case"uniform":let{name:s}=n,l=e.getUniformBlockIndex(this.handle,s);if(l===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,i,l),o instanceof Jl?e.bindBufferBase(35345,i,o.handle):e.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case"texture":if(!(o instanceof Da||o instanceof Nc))throw new Error("texture");let c;if(o instanceof Da)c=o;else if(o instanceof Nc&&o.colorAttachments[0]instanceof Da)gr.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),c=o.colorAttachments[0];else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(c.target,c.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let r of this.shaderLayout.uniforms||[]){var e;let{name:i,location:n,type:o,textureUnit:s}=r,l=(e=this.uniforms[i])!==null&&e!==void 0?e:s;l!==void 0&&K4(this.device.gl,n,o,l)}}};var Yw=class extends pd{constructor(e){super(e,{}),this.device=void 0,this.commands=[],this.device=e}submitCommands(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.commands;for(let r of e)switch(r.name){case"copy-buffer-to-buffer":Cee(this.device,r.options);break;case"copy-buffer-to-texture":Mee(this.device,r.options);break;case"copy-texture-to-buffer":Iee(this.device,r.options);break;case"copy-texture-to-texture":Pee(this.device,r.options);break}}};function Cee(t,e){let r=e.source,i=e.destination,n=t.assertWebGL2();if(n){var o,s;n.bindBuffer(36662,r.handle),n.bindBuffer(36663,i.handle),n.copyBufferSubData(36662,36663,(o=e.sourceOffset)!==null&&o!==void 0?o:0,(s=e.destinationOffset)!==null&&s!==void 0?s:0,e.size),n.bindBuffer(36662,null),n.bindBuffer(36663,null)}else throw new Error("copyBufferToBuffer not implemented in WebGL1")}function Mee(t,e){throw new Error("Not implemented")}function Iee(t,e){let{source:r,mipLevel:i=0,aspect:n="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:l=0,origin:c=[0,0],destination:h,byteOffset:g=0,bytesPerRow:b,rowsPerImage:T}=e;if(n!=="all")throw new Error("not supported");if(i!==0||l!==0||b||T)throw new Error("not implemented");let C=t.assertWebGL2(),{framebuffer:P,destroyFramebuffer:H}=$4(r);try{let U=h,J=o||P.width,ee=s||P.height,ne=a0(P.texture.format,!0),oe=ne.dataFormat,k=ne.type;C.bindBuffer(35051,U.handle),C.bindFramebuffer(36160,P.handle),C.readPixels(c[0],c[1],J,ee,oe,k,g)}finally{C.bindBuffer(35051,null),C.bindFramebuffer(36160,null),H&&P.destroy()}}function Pee(t,e){let{source:r,origin:i=[0,0],destination:n}=e,{width:o=e.destination.width,height:s=e.destination.width}=e,l=0,c=6408,{framebuffer:h,destroyFramebuffer:g}=$4(r),[b,T]=i,C=!1;t.gl.bindFramebuffer(36160,h.handle);let P=null,H;if(n instanceof Da)P=n,o=Number.isFinite(o)?o:P.width,s=Number.isFinite(s)?s:P.height,P.bind(0),H=P.destination;else throw new Error("whoops");return C||t.gl.copyTexImage2D(H,l,c,b,T,o,s,0),P&&P.unbind(),g&&h.destroy(),P}function $4(t){if(t instanceof Bs){let{width:e,height:r,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var d0=class extends dd{constructor(e,r){super(e,r),this.device=void 0,this.commandBuffer=void 0,this.device=e,this.commandBuffer=new Yw(e)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}};var ek;ek=Symbol.toStringTag;var up=class extends Ad{get[ek](){return"VertexArray"}static isConstantAttributeZeroSupported(e){return e.info.type==="webgl2"||Yg()==="Chrome"}constructor(e,r){super(e,r),this.device=void 0,this.handle=void 0,this.buffer=null,this.bufferValue=null,this.init=!1,this.device=e,this.handle=this.device.gl2.createVertexArray()}destroy(){if(super.destroy(),this.buffer){var e;(e=this.buffer)===null||e===void 0||e.destroy()}this.handle&&(this.device.gl2.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(e){let r=e;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl2.bindVertexArray(this.handle),this.device.gl2.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r}setBuffer(e,r){let i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:n,type:o,stride:s,offset:l,normalized:c,integer:h,divisor:g}=this._getAccessor(e);this.device.gl2.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),h?(this.device.assertWebGL2(),this.device.gl2.vertexAttribIPointer(e,n,o,s,l)):this.device.gl.vertexAttribPointer(e,n,o,c,s,l),this.device.gl.enableVertexAttribArray(e),this.device.gl2.vertexAttribDivisor(e,g||0),this.attributes[e]=i}setConstant(e,r){this._enable(e,!1),this.attributes[e]=r}bindBeforeRender(){if(this.device.gl2.bindVertexArray(this.handle),!this.init){let e=this.indexBuffer;this.device.gl2.bindBuffer(34963,e?.handle||null),this.init=!0}this._applyConstantAttributes()}unbindAfterRender(){this.device.gl2.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e<this.maxVertexAttributes;++e){let r=this.attributes[e];ArrayBuffer.isView(r)&&this.device.setConstantAttribute(e,r)}}_getAccessor(e){let r=this.attributeInfos[e];if(!r)throw new Error(`Unknown attribute location ${e}`);let i=kw(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=up.isConstantAttributeZeroSupported(this.device)||e!==0;(r||n)&&(e=Number(e),this.device.gl2.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(e):this.device.gl.disableVertexAttribArray(e),this.device.gl2.bindVertexArray(null))}getConstantBuffer(e,r){let i=Ree(r),n=i.byteLength*e,o=i.length*e;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s=s||!Bee(i,this.bufferValue),s){let l=Tw(r.constructor,o);Ew({target:l,source:i,start:0,count:o}),this.buffer.write(l),this.bufferValue=r}return this.buffer}};function Ree(t){return Array.isArray(t)?new Float32Array(t):t}function Bee(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var p0=class extends md{constructor(e,r){super(e,r),this.device=void 0,this.gl2=void 0,this.handle=void 0,this.layout=void 0,this.buffers={},this.unusedBuffers={},this.bindOnUse=!0,this._bound=!1,e.assertWebGL2(),this.device=e,this.gl2=e.gl2,this.handle=this.props.handle||this.gl2.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl2.deleteTransformFeedback(this.handle),super.destroy()}begin(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"point-list";this.gl2.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl2.beginTransformFeedback(J4(e))}end(){this.gl2.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl2.bindTransformFeedback(36386,null)}setBuffers(e){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in e)this.setBuffer(r,e[r])})}setBuffer(e,r){let i=this._getVaryingIndex(e),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[e]=n,gr.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(e){if(tk(e))return this.buffers[e]||null;let r=this._getVaryingIndex(e);return r>=0?this.buffers[r]:null}bind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof e!="function")return this.gl2.bindTransformFeedback(36386,e),this;let r;return this._bound?r=e():(this.gl2.bindTransformFeedback(36386,this.handle),this._bound=!0,r=e(),this._bound=!1,this.gl2.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof Jl)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=e.buffer.byteLength}=e;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(e){if(tk(e))return Number(e);for(let r of this.layout.varyings)if(e===r.name)return r.location;return-1}_bindBuffers(){for(let e in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,n,i)}}_unbindBuffers(){for(let e in this.buffers)this.gl2.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,o=r&&r.handle;!o||n===void 0?this.gl2.bindBufferBase(35982,e,o):this.gl2.bindBufferRange(35982,e,o,i,n)}};function tk(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}function QM(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return _i(!1),0}}function rk(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return _i(!1),0}}function ik(t,e){var r;let{sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,sourceAttachment:s=36064}=e||{},{target:l=null,sourceWidth:c,sourceHeight:h,sourceType:g}=e||{},{framebuffer:b,deleteFramebuffer:T}=ok(t);_i(b);let{gl:C,handle:P}=b;c=c||b.width,h=h||b.height;let H=s-36064;g=g||((r=b.colorAttachments[H])===null||r===void 0?void 0:r.type)||5121,l=Dee(l,g,o,c,h),g=g||W4(l);let U=C.bindFramebuffer(36160,P);return C.readPixels(i,n,c,h,o,g,l),C.bindFramebuffer(36160,U||null),T&&b.destroy(),l}function nk(t,e){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:l,sourceHeight:c,sourceType:h}=e||{},{framebuffer:g,deleteFramebuffer:b}=ok(t);_i(g),l=l||g.width,c=c||g.height;let T=g;h=h||5121;let C=r;if(!C){let H=QM(o),U=rk(h),J=s+l*c*H*U;C=T.device.createBuffer({byteLength:J})}let P=t.device.createCommandEncoder();return P.copyTextureToBuffer({source:t,width:l,height:c,origin:[i,n],destination:C,byteOffset:s}),P.destroy(),b&&g.destroy(),C}function ok(t){return t instanceof vf?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:Oee(t),deleteFramebuffer:!0}}function Oee(t,e){let{device:r,width:i,height:n,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[t]})}function Dee(t,e,r,i,n){if(t)return t;e=e||5121;let o=vv(e,{clamped:!1}),s=QM(r);return new o(i*n*s)}var Lee=256,Fee=1024,Nee=16384;var kee="clear: bad arguments";function sk(t,e){let r=Qo.attach(t),{framebuffer:i=null,color:n=null,depth:o=null,stencil:s=null}=e||{},l={};i&&(l.framebuffer=i);let c=0;n&&(c|=Nee,n!==!0&&(l.clearColor=n)),o&&(c|=Lee,o!==!0&&(l.clearDepth=o)),s&&(c|=Fee,o!==!0&&(l.clearStencil=o)),_i(c!==0,kee),Fu(r.gl,l,()=>{r.gl.clear(c)})}var xv=1,Qo=class extends Du{static isSupported(){return typeof WebGLRenderingContext<"u"||e4()}get features(){return this._features=this._features||C4(this.gl),this._features}get limits(){return this._limits=this._limits||I4(this.gl),this._limits}static attach(e){if(e instanceof Qo)return e;if(e?.device instanceof Du)return e.device;if(!Uee(e))throw new Error("Invalid WebGLRenderingContext");return new Qo({gl:e})}static async create(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gr.groupCollapsed(xv,"WebGLDevice created")(),typeof e.canvas=="string"&&await ud.pageLoaded,(gr.get("debug")||e.debug)&&await V4();let{spector:r}=e;if((gr.get("spector")||r)&&await k4(),gr.probe(xv+1,"DOM is loaded")(),e.gl&&e.gl.device)return Qo.attach(e.gl);let i=new Qo(e),n=`Created ${i.info.type}${i.debug?" debug":""} context: ${i.info.vendor}, ${i.info.renderer} for canvas: ${i.canvasContext.id}`;return gr.probe(xv,n)(),gr.table(xv,i.info)(),gr.groupEnd(xv)(),i}constructor(e){var r,i;super({...e,id:e.id||uo("webgl-device")}),this.info=void 0,this.canvasContext=void 0,this.handle=void 0,this.lost=void 0,this._resolveContextLost=void 0,this._features=void 0,this._limits=void 0,this.renderPass=null,this.gl=void 0,this.gl2=null,this.debug=!1,this.isWebGL1=void 0,this.isWebGL2=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this._extensions={},this._polyfilled=!1,this.spector=void 0,this._webglLimits=void 0,this._constants=void 0;let n=(r=e.gl)===null||r===void 0?void 0:r.device;if(n)throw new Error(`WebGL context already attached to device ${n.id}`);let o=e.canvas||((i=e.gl)===null||i===void 0?void 0:i.canvas);this.canvasContext=new u0(this,{...e,canvas:o}),this.lost=new Promise(g=>{this._resolveContextLost=g});let s=g=>{var b;return(b=this._resolveContextLost)===null||b===void 0?void 0:b.call(this,{reason:"destroyed",message:"Computer entered sleep mode, or too many apps or browser tabs are using the GPU."})},l=e.gl||null;if(l=l||(Rs()?g4(this.canvasContext.canvas,{...e,onContextLost:s}):null),l=l||(Rs()?null:t4({...e,onContextLost:s})),!l)throw new Error("WebGL context creation failed");this.handle=l,this.gl=this.handle,this.gl2=this.gl,this.isWebGL2=zee(this.gl),this.isWebGL1=!this.isWebGL2,this.canvasContext.resize(),this.info=_4(this.gl),this.gl.device=this,this.gl._version=this.isWebGL2?2:1,Nw(this.gl);let{enable:c=!0,copyState:h=!1}=e;if(hv(this.gl,{enable:c,copyState:h,log:function(){for(var g=arguments.length,b=new Array(g),T=0;T<g;T++)b[T]=arguments[T];return gr.log(1,...b)()}}),Rs()&&e.debug&&(this.gl=H4(this.gl,{...e,webgl2:this.isWebGL2,throwOnError:!0}),this.gl2=this.gl,this.debug=!0,gr.level=Math.max(gr.level,1),gr.warn("WebGL debug mode activated. Performance reduced.")()),Rs()&&e.spector){let g=this.handle.canvas||e.canvas;this.spector=U4({...this.props,canvas:g})}}destroy(){let e=this.gl.getExtension("STACKGL_destroy_context");e&&e.destroy()}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(e){return mv(this.gl,e)}isTextureFormatFilterable(e){return T4(this.gl,e)}isTextureFormatRenderable(e){return E4(this.gl,e)}assertWebGL2(){if(!this.gl2)throw new Error("Requires WebGL2");return this.gl2}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._getBufferProps(e);return new Jl(this,r)}_createTexture(e){return new Da(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new _d(this,e)}createShader(e){return new c0(this,e)}createFramebuffer(e){return new Nc(this,e)}createRenderPipeline(e){return new h0(this,e)}createVertexArray(e){return new up(this,e)}beginRenderPass(e){return new f0(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}createTransformFeedback(e){return new p0(this,e)}getDefaultRenderPass(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass}createCommandEncoder(e){return new d0(this,e)}submit(){var e;(e=this.renderPass)===null||e===void 0||e.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return ik(e,r)}readPixelsToBufferWebGL(e,r){return nk(e,r)}setParametersWebGL(e){Lu(this,e)}getParametersWebGL(e){return o0(this,e)}withParametersWebGL(e,r){Fu(this,e,r)}clearWebGL(e){sk(this,e)}get webglLimits(){return this._webglLimits=this._webglLimits||P4(this.gl),this._webglLimits}loseDevice(){var e;let r=!1,i=this.gl.getExtension("WEBGL_lose_context");return i&&(r=!0,i.loseContext()),(e=this._resolveContextLost)===null||e===void 0||e.call(this,{reason:"destroyed",message:"Application triggered context loss"}),r}pushState(){xf(this.gl)}popState(){Lc(this.gl)}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){r=r||this.gl2||this.gl;let i=Number(e);for(let n in r)if(r[n]===i)return`GL.${n}`;return String(e)}setConstantAttribute(e,r){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);let i=this._constants[e];switch(i&&Gee(i,r)&&gr.info(1,`setConstantAttribute(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:Vee(this,e,r);break;case Int32Array:Hee(this,e,r);break;case Uint32Array:jee(this,e,r);break;default:_i(!1)}}};Qo.type="webgl";function Uee(t){return typeof WebGLRenderingContext<"u"&&t instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function zee(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&t._version===2)}function Vee(t,e,r){switch(r.length){case 1:t.gl.vertexAttrib1fv(e,r);break;case 2:t.gl.vertexAttrib2fv(e,r);break;case 3:t.gl.vertexAttrib3fv(e,r);break;case 4:t.gl.vertexAttrib4fv(e,r);break;default:_i(!1)}}function Hee(t,e,r){var i;t.assertWebGL2(),(i=t.gl2)===null||i===void 0||i.vertexAttribI4iv(e,r)}function jee(t,e,r){var i;t.assertWebGL2(),(i=t.gl2)===null||i===void 0||i.vertexAttribI4uiv(e,r)}function Gee(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var ak,lk,ck={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function Kw(){return document.createElement("div")}function Wee(t){if(!t.picked)return null;if(t.object===ak)return lk;let e={html:Xee(t.object),style:ck};return lk=e,ak=t.object,e}var qee=new Set(["position","index"]);function Xee(t){let e=Kw();for(let r in t){if(qee.has(r))continue;let i=Kw();i.className="header",i.textContent=r;let n=Kw();n.className="value",n.textContent=Kee(t[r]);let o=Kw();Yee(o,i,n),o.appendChild(i),o.appendChild(n),e.appendChild(o)}return e.innerHTML}function Yee(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function Kee(t){let e;if(Array.isArray(t)&&t.length>4)e=`Array<${t.length}>`;else if(typeof t=="string")e=t;else if(typeof t=="number")e=String(t);else try{e=JSON.stringify(t)}catch{e="<Non-Serializable Object>"}let r=50;return e.length>r&&(e=e.slice(0,r)),e}function uk(t,e){let r,i=t,n="properties",o=/{[^}]*}/g,s=c=>c.replace(/[{}]/g,""),l=[...new Set(t.match(o).map(s))];for(let c of l){if(c.includes(".")){r=e;let h=c.split(".");for(let g of h)if(r.hasOwnProperty(g))r=r[g];else{r=void 0;break}}else e.hasOwnProperty(c)?r=e[c]:e[n]&&e[n].hasOwnProperty(c)?r=e[n][c]:r=void 0;i=i.replaceAll(`{${c}}`,r)}return i}function $M(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||ck};return t.html?r.html=uk(t.html,e.object):r.text=uk(t.text,e.object),r}:Wee:null}function fk(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function hk(t,e){let r=document.createElement("div");return r.style.width=Number.isFinite(t)?`${t}px`:t,r.style.height=`${e}px`,r.style.position="relative",r}var pk=Xl(dk()),Zee="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",rI=pk.default;function Ak(t=Zee){fk(t)}function mk(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var iI={};function gk(t){if(!iI[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),iI[t]=new Promise(i=>{e.onload=i})}return iI[t]}var _k="4.1.0";var nI,Jee=(nI=globalThis.loaders)===null||nI===void 0?void 0:nI.parseImageNode,oI=typeof Image<"u",sI=typeof ImageBitmap<"u",Qee=Boolean(Jee),aI=ld?!0:Qee;function yk(t){switch(t){case"auto":return sI||oI||aI;case"imagebitmap":return sI;case"image":return oI;case"data":return aI;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function vk(){if(sI)return"imagebitmap";if(oI)return"image";if(aI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function xk(t){let e=$ee(t);if(!e)throw new Error("Not an image");return e}function bv(t){switch(xk(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function $ee(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var ete=/^data:image\/svg\+xml/,tte=/\.svg((\?|#).*)?$/;function Zw(t){return t&&(ete.test(t)||tte.test(t))}function bk(t,e){if(Zw(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return lI(t,e)}function lI(t,e){if(Zw(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Jw(t,e,r){let i=bk(t,r),n=self.URL||self.webkitURL,o=typeof i!="string"&&n.createObjectURL(i);try{return await rte(o||i,e)}finally{o&&n.revokeObjectURL(o)}}async function rte(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";n(new Error(s))}}catch(o){n(o)}})}var ite={},wk=!0;async function Tk(t,e,r){let i;Zw(r)?i=await Jw(t,e,r):i=lI(t,r);let n=e&&e.imagebitmap;return await nte(i,n)}async function nte(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((ote(e)||!wk)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),wk=!1}return await createImageBitmap(t)}function ote(t){for(let e in t||ite)return!1;return!0}function Ek(t){return!ute(t,"ftyp",4)||!(t[8]&96)?null:ste(t)}function ste(t){switch(ate(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ate(t,e,r){return String.fromCharCode(...t.slice(e,r))}function lte(t){return[...t].map(e=>e.charCodeAt(0))}function ute(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=lte(e);for(let n=0;n<i.length;++n)if(i[n]!==t[n+r])return!1;return!0}var yh=!1,wv=!0;function LA(t){let e=Tv(t);return fte(e)||pte(e)||hte(e)||dte(e)||cte(e)}function cte(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Ek(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function fte(t){let e=Tv(t);return e.byteLength>=24&&e.getUint32(0,yh)===2303741511?{mimeType:"image/png",width:e.getUint32(16,yh),height:e.getUint32(20,yh)}:null}function hte(t){let e=Tv(t);return e.byteLength>=10&&e.getUint32(0,yh)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,wv),height:e.getUint16(8,wv)}:null}function dte(t){let e=Tv(t);return e.byteLength>=14&&e.getUint16(0,yh)===16973&&e.getUint32(2,wv)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,wv),height:e.getUint32(22,wv)}:null}function pte(t){let e=Tv(t);if(!(e.byteLength>=3&&e.getUint16(0,yh)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=Ate(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,yh);if(n.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,yh),width:e.getUint16(o+7,yh)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,yh)}return null}function Ate(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Tv(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Sk(t,e){var r;let{mimeType:i}=LA(t)||{},n=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Yn(n),await n(t,i)}async function Ck(t,e,r){e=e||{};let n=(e.image||{}).type||"auto",{url:o}=r||{},s=mte(n),l;switch(s){case"imagebitmap":l=await Tk(t,e,o);break;case"image":l=await Jw(t,e,o);break;case"data":l=await Sk(t,e);break;default:Yn(!1)}return n==="data"&&(l=bv(l)),l}function mte(t){switch(t){case"auto":case"data":return vk();default:return yk(t),t}}var gte=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],_te=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],yte={image:{type:"auto",decode:!0}},vh={id:"image",module:"images",name:"Images",version:_k,mimeTypes:_te,extensions:gte,parse:Ck,tests:[t=>Boolean(LA(new DataView(t)))],options:yte};var uI={};function cI(t){if(uI[t]===void 0){let e=ld?xte(t):vte(t);uI[t]=e}return uI[t]}function vte(t){var e,r;let i=["image/png","image/jpeg","image/gif"],n=((e=globalThis.loaders)===null||e===void 0?void 0:e.imageFormatsNode)||i,o=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Boolean(o)&&n.includes(t)}function xte(t){switch(t){case"image/avif":case"image/webp":return bte(t);default:return!0}}function bte(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var wte=new Ou({id:"deck"}),vr=wte;var fI={};function Mk(t){fI=t}function ca(t,e,r,i){vr.level>0&&fI[t]&&fI[t].call(null,e,r,i)}function Tte(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var Ik={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:Tte,parseTextSync:JSON.parse};function Ete(){let t="9.0.0-beta.2",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(vr.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:vr,_registerLoggers:Mk},TA([Ik,[vh,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var Qw=Ete();var go=t=>`${t}`;function xh(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var hI={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Rk(t){let e={};for(let[r,i]of Object.entries(t))e[r]=Ste(i);return e}function Bk(t,e,r){let i={};for(let[n,o]of Object.entries(e))t&&n in t&&!o.private?(o.validate&&xh(o.validate(t[n],o),`${r}: invalid ${n}`),i[n]=t[n]):i[n]=o.value;return i}function Ste(t){let e=Pk(t);if(e!=="object")return{value:t,...hI[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...hI[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=Pk(t.value),{...t,...hI[e],type:e}):{type:"object",value:null};throw new Error("props")}function Pk(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var Ok=go`\
|
|
553
|
+
${n}`)(e);let{gl:i}=this.device;if(i.shaderSource(this.handle,e),i.compileShader(this.handle),this.compilationStatus=i.getShaderParameter(this.handle,35713)?"success":"error",this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`)}};var dee=256,pee=1024,Aee=16384,ZM=6144,f0=class extends hd{constructor(e,r){super(e,r),this.device=void 0,this.glParameters=void 0,this.device=e,xf(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){Lc(this.device.gl),this.props.framebuffer&&Lu(this.device,{framebuffer:null})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={};this.props.framebuffer&&(r.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(r.viewport=e.viewport.slice(0,4),r.depthRange=[e.viewport[4],e.viewport[5]]):r.viewport=e.viewport),r.scissorTest=Boolean(e.scissorRect),e.scissorRect&&(r.scissor=e.scissorRect),e.blendConstant&&(r.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),e[2967]=e.stencilReference),this.glParameters=r,Lu(this.device,r)}clear(){let e={...this.glParameters},r=0;this.props.clearColor!==!1&&(r|=Aee,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=dee,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=pee,e.clearStencil=this.props.clearStencil),r!==0&&Fu(this.device,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];Fu(this.device.gl2,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int32Array:this.device.gl2.clearBufferiv(ZM,e,r);break;case Uint32Array:this.device.gl2.clearBufferuiv(ZM,e,r);break;case Float32Array:default:this.device.gl2.clearBufferfv(ZM,e,r);break}})}};var mee="Failed to deduce GL constant from typed array";function W4(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(mee)}}function vv(t,e){let{clamped:r=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var gee={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},_ee={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},_h=class{static getBytesPerElement(e){return vv(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return _i(e.size),vv(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new _h(gee,...r)}constructor(){this.offset=void 0,this.stride=void 0,this.type=void 0,this.size=void 0,this.divisor=void 0,this.normalized=void 0,this.integer=void 0,this.buffer=void 0,this.index=void 0;for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];r.forEach(n=>this._assign(n)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return _h.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return _h.getBytesPerVertex(this)}_assign(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e=Iw("Accessor",e,_ee),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}};function q4(t){return yee.includes(t)}var yee=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],X4={[5126]:[5126,1,"float","f32","float32"],[35664]:[5126,2,"vec2","vec2<f32>","float32x2"],[35665]:[5126,3,"vec3","vec3<f32>","float32x3"],[35666]:[5126,4,"vec4","vec4<f32>","float32x4"],[5124]:[5124,1,"int","i32","sint32"],[35667]:[5124,2,"ivec2","vec2<i32>","sint32x2"],[35668]:[5124,3,"ivec3","vec3<i32>","sint32x3"],[35669]:[5124,4,"ivec4","vec4<i32>","sint32x4"],[5125]:[5125,1,"uint","u32","uint32"],[36294]:[5125,2,"uvec2","vec2<u32>","uint32x2"],[36295]:[5125,3,"uvec3","vec3<u32>","uint32x3"],[36296]:[5125,4,"uvec4","vec4<u32>","uint32x4"],[35670]:[5126,1,"bool","f32","float32"],[35671]:[5126,2,"bvec2","vec2<f32>","float32x2"],[35672]:[5126,3,"bvec3","vec3<f32>","float32x3"],[35673]:[5126,4,"bvec4","vec4<f32>","float32x4"],[35674]:[5126,8,"mat2","mat2x2<f32>"],[35685]:[5126,8,"mat2x3","mat2x3<f32>"],[35686]:[5126,8,"mat2x4","mat2x4<f32>"],[35687]:[5126,12,"mat3x2","mat3x2<f32>"],[35675]:[5126,12,"mat3","mat3x3<f32>"],[35688]:[5126,12,"mat3x4","mat3x4<f32>"],[35689]:[5126,16,"mat4x2","mat4x2<f32>"],[35690]:[5126,16,"mat4x3","mat4x3<f32>"],[35676]:[5126,16,"mat4","mat4x4<f32>"]};function JM(t){let e=X4[t];if(!e)throw new Error("uniform");let[r,i,,n]=e;return{format:n,components:i,glType:r}}function Y4(t){let e=X4[t];if(!e)throw new Error("attribute");let[,r,,i,n]=e;return{attributeType:i,vertexFormat:n,components:r}}function Xw(t,e){let r={attributes:[],bindings:[]};r.attributes=vee(t,e);let i=wee(t,e);for(let l of i){let c=l.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));r.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:c})}let n=bee(t,e),o=0;for(let l of n)if(q4(l.type)){let{viewDimension:c,sampleType:h}=Eee(l.type);r.bindings.push({type:"texture",name:l.name,location:o,viewDimension:c,sampleType:h}),l.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=xee(t,e);return s!=null&&s.length&&(r.varyings=s),r}function vee(t,e){let r=[],i=t.getProgramParameter(e,35721);for(let n=0;n<i;n++){let o=t.getActiveAttrib(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l}=o,c=t.getAttribLocation(e,s);if(c>=0){let{attributeType:h}=Y4(l),g=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:c,stepMode:g,type:h})}}return r.sort((n,o)=>n.location-o.location),r}function xee(t,e){if(!zn(t))return[];let r=t,i=[],n=t.getProgramParameter(e,35971);for(let o=0;o<n;o++){let s=r.getTransformFeedbackVarying(e,o);if(!s)throw new Error("activeInfo");let{name:l,type:c,size:h}=s,{glType:g,components:b}=JM(c),T=new _h({type:g,size:h*b}),C={location:o,name:l,accessor:T};i.push(C)}return i.sort((o,s)=>o.location-s.location),i}function bee(t,e){let r=[],i=t.getProgramParameter(e,35718);for(let n=0;n<i;n++){let o=t.getActiveUniform(e,n);if(!o)throw new Error("activeInfo");let{name:s,size:l,type:c}=o,{name:h,isArray:g}=See(s),b=t.getUniformLocation(e,h),T={location:b,name:h,size:l,type:c,isArray:g};if(r.push(T),T.size>1)for(let C=0;C<T.size;C++){let P=`${h}[${C}]`;b=t.getUniformLocation(e,P);let H={...T,name:P,location:b};r.push(H)}}return r}function wee(t,e){if(!zn(t))return[];let r=t,i=(s,l)=>r.getActiveUniformBlockParameter(e,s,l),n=[],o=r.getProgramParameter(e,35382);for(let s=0;s<o;s++){let l={name:r.getActiveUniformBlockName(e,s)||"",location:i(s,35391),byteLength:i(s,35392),vertex:i(s,35396),fragment:i(s,35398),uniformCount:i(s,35394),uniforms:[]},c=i(s,35395)||[],h=r.getActiveUniforms(e,c,35383),g=r.getActiveUniforms(e,c,35384),b=r.getActiveUniforms(e,c,35387),T=r.getActiveUniforms(e,c,35388);for(let C=0;C<l.uniformCount;++C){let P=r.getActiveUniform(e,c[C]);if(!P)throw new Error("activeInfo");l.uniforms.push({name:P.name,format:JM(h[C]).format,type:h[C],arrayLength:g[C],byteOffset:b[C],byteStride:T[C]})}n.push(l)}return n.sort((s,l)=>s.location-l.location),n}var Tee={[35678]:["2d","float"],[35680]:["cube","float"],[35679]:["3d","float"],[35682]:["3d","depth"],[36289]:["2d-array","float"],[36292]:["2d-array","depth"],[36293]:["cube","float"],[36298]:["2d","sint"],[36299]:["3d","sint"],[36300]:["cube","sint"],[36303]:["2d-array","uint"],[36306]:["2d","uint"],[36307]:["3d","uint"],[36308]:["cube","uint"],[36311]:["2d-array","uint"]};function Eee(t){let e=Tee[t];if(!e)throw new Error("sampler");let[r,i]=e;return{viewDimension:r,sampleType:i}}function See(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};let r=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function K4(t,e,r,i){let n=t,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:return t.uniform1iv(e,s);case 35667:return t.uniform2iv(e,s);case 35668:return t.uniform3iv(e,s);case 35669:return t.uniform4iv(e,s);case 35670:return t.uniform1iv(e,s);case 35671:return t.uniform2iv(e,s);case 35672:return t.uniform3iv(e,s);case 35673:return t.uniform4iv(e,s);case 5125:return n.uniform1uiv(e,s,1);case 36294:return n.uniform2uiv(e,s,2);case 36295:return n.uniform3uiv(e,s,3);case 36296:return n.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return n.uniformMatrix2x3fv(e,!1,s);case 35686:return n.uniformMatrix2x4fv(e,!1,s);case 35687:return n.uniformMatrix3x2fv(e,!1,s);case 35688:return n.uniformMatrix3x4fv(e,!1,s);case 35689:return n.uniformMatrix4x2fv(e,!1,s);case 35690:return n.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function Z4(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function J4(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}var Q4=4,h0=class extends rc{constructor(e,r){super(e,r),this.device=void 0,this.handle=void 0,this.vs=void 0,this.fs=void 0,this.introspectedLayout=void 0,this.uniforms={},this.bindings={},this.varyings=null,this._uniformCount=0,this._uniformSetters={},this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;if(i&&i.length>0){var o;this.device.assertWebGL2(),this.varyings=i,(o=this.device.gl2)===null||o===void 0||o.transformFeedbackVaryings(this.handle,i,n)}switch(this._compileAndLink(),this.introspectedLayout=Xw(this.device.gl,this.handle),this.shaderLayout=xw(this.introspectedLayout,r.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":gr.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break;default:}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e){for(let[r,i]of Object.entries(e)){let n=this.shaderLayout.bindings.find(o=>o.name===r)||this.shaderLayout.bindings.find(o=>o.name===`${r}Uniforms`);if(!n){let o=this.shaderLayout.bindings.map(s=>`"${s.name}"`).join(", ");gr.warn(`Unknown binding "${r}" in render pipeline "${this.id}", expected one of ${o}`)();continue}switch(i||gr.warn(`Unsetting binding "${r}" in render pipeline "${this.id}"`)(),n.type){case"uniform":if(!(i instanceof Jl)&&!(i.buffer instanceof Jl))throw new Error("buffer value");break;case"texture":if(!(i instanceof Da||i instanceof Nc))throw new Error("texture value");break;case"sampler":gr.warn(`Ignoring sampler ${r}`)();break;default:throw new Error(n.type)}this.bindings[r]=i}}setUniforms(e){let{bindings:r}=t0(e);Object.keys(r).forEach(i=>{gr.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,e)}draw(e){var r;let{renderPass:i,vertexArray:n,vertexCount:o,instanceCount:s,firstVertex:l=0,transformFeedback:c}=e,h=Z4(this.props.topology),g=Boolean(n.indexBuffer),b=(r=n.indexBuffer)===null||r===void 0?void 0:r.glIndexType,T=Number(s)>0;if(!this._areTexturesRenderable()||o===0)return!1;this.device.gl.useProgram(this.handle),n.bindBeforeRender(i),c&&c.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let C=i;return B4(this.device,this.props.parameters,C.glParameters,()=>{if(g&&T){var P;(P=this.device.gl2)===null||P===void 0||P.drawElementsInstanced(h,o||0,b,l,s||0)}else if(g)this.device.gl.drawElements(h,o||0,b,l);else if(T){var H;(H=this.device.gl2)===null||H===void 0||H.drawArraysInstanced(h,l,o||0,s||0)}else this.device.gl.drawArrays(h,l,o||0);c&&c.end()}),n.unbindAfterRender(i),!0}_compileAndLink(){let{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),gr.time(Q4,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),gr.timeEnd(Q4,`linkProgram for ${this.id}`)(),!e.debug&&gr.level,!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}_areTexturesRenderable(){let e=!0;for(let[,r]of Object.entries(this.bindings))r instanceof Da&&(r.update(),e=e&&r.loaded);return e}_applyBindings(){this.device.gl.useProgram(this.handle);let{gl2:e}=this.device;if(!e)throw new Error("bindings");let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case"uniform":let{name:s}=n,l=e.getUniformBlockIndex(this.handle,s);if(l===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,i,l),o instanceof Jl?e.bindBufferBase(35345,i,o.handle):e.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case"texture":if(!(o instanceof Da||o instanceof Nc))throw new Error("texture");let c;if(o instanceof Da)c=o;else if(o instanceof Nc&&o.colorAttachments[0]instanceof Da)gr.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),c=o.colorAttachments[0];else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(c.target,c.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let r of this.shaderLayout.uniforms||[]){var e;let{name:i,location:n,type:o,textureUnit:s}=r,l=(e=this.uniforms[i])!==null&&e!==void 0?e:s;l!==void 0&&K4(this.device.gl,n,o,l)}}};var Yw=class extends pd{constructor(e){super(e,{}),this.device=void 0,this.commands=[],this.device=e}submitCommands(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.commands;for(let r of e)switch(r.name){case"copy-buffer-to-buffer":Cee(this.device,r.options);break;case"copy-buffer-to-texture":Mee(this.device,r.options);break;case"copy-texture-to-buffer":Iee(this.device,r.options);break;case"copy-texture-to-texture":Pee(this.device,r.options);break}}};function Cee(t,e){let r=e.source,i=e.destination,n=t.assertWebGL2();if(n){var o,s;n.bindBuffer(36662,r.handle),n.bindBuffer(36663,i.handle),n.copyBufferSubData(36662,36663,(o=e.sourceOffset)!==null&&o!==void 0?o:0,(s=e.destinationOffset)!==null&&s!==void 0?s:0,e.size),n.bindBuffer(36662,null),n.bindBuffer(36663,null)}else throw new Error("copyBufferToBuffer not implemented in WebGL1")}function Mee(t,e){throw new Error("Not implemented")}function Iee(t,e){let{source:r,mipLevel:i=0,aspect:n="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:l=0,origin:c=[0,0],destination:h,byteOffset:g=0,bytesPerRow:b,rowsPerImage:T}=e;if(n!=="all")throw new Error("not supported");if(i!==0||l!==0||b||T)throw new Error("not implemented");let C=t.assertWebGL2(),{framebuffer:P,destroyFramebuffer:H}=$4(r);try{let U=h,J=o||P.width,ee=s||P.height,ne=a0(P.texture.format,!0),oe=ne.dataFormat,k=ne.type;C.bindBuffer(35051,U.handle),C.bindFramebuffer(36160,P.handle),C.readPixels(c[0],c[1],J,ee,oe,k,g)}finally{C.bindBuffer(35051,null),C.bindFramebuffer(36160,null),H&&P.destroy()}}function Pee(t,e){let{source:r,origin:i=[0,0],destination:n}=e,{width:o=e.destination.width,height:s=e.destination.width}=e,l=0,c=6408,{framebuffer:h,destroyFramebuffer:g}=$4(r),[b,T]=i,C=!1;t.gl.bindFramebuffer(36160,h.handle);let P=null,H;if(n instanceof Da)P=n,o=Number.isFinite(o)?o:P.width,s=Number.isFinite(s)?s:P.height,P.bind(0),H=P.destination;else throw new Error("whoops");return C||t.gl.copyTexImage2D(H,l,c,b,T,o,s,0),P&&P.unbind(),g&&h.destroy(),P}function $4(t){if(t instanceof Bs){let{width:e,height:r,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var d0=class extends dd{constructor(e,r){super(e,r),this.device=void 0,this.commandBuffer=void 0,this.device=e,this.commandBuffer=new Yw(e)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}};var ek;ek=Symbol.toStringTag;var up=class extends Ad{get[ek](){return"VertexArray"}static isConstantAttributeZeroSupported(e){return e.info.type==="webgl2"||Yg()==="Chrome"}constructor(e,r){super(e,r),this.device=void 0,this.handle=void 0,this.buffer=null,this.bufferValue=null,this.init=!1,this.device=e,this.handle=this.device.gl2.createVertexArray()}destroy(){if(super.destroy(),this.buffer){var e;(e=this.buffer)===null||e===void 0||e.destroy()}this.handle&&(this.device.gl2.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(e){let r=e;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl2.bindVertexArray(this.handle),this.device.gl2.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r}setBuffer(e,r){let i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:n,type:o,stride:s,offset:l,normalized:c,integer:h,divisor:g}=this._getAccessor(e);this.device.gl2.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),h?(this.device.assertWebGL2(),this.device.gl2.vertexAttribIPointer(e,n,o,s,l)):this.device.gl.vertexAttribPointer(e,n,o,c,s,l),this.device.gl.enableVertexAttribArray(e),this.device.gl2.vertexAttribDivisor(e,g||0),this.attributes[e]=i}setConstant(e,r){this._enable(e,!1),this.attributes[e]=r}bindBeforeRender(){if(this.device.gl2.bindVertexArray(this.handle),!this.init){let e=this.indexBuffer;this.device.gl2.bindBuffer(34963,e?.handle||null),this.init=!0}this._applyConstantAttributes()}unbindAfterRender(){this.device.gl2.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e<this.maxVertexAttributes;++e){let r=this.attributes[e];ArrayBuffer.isView(r)&&this.device.setConstantAttribute(e,r)}}_getAccessor(e){let r=this.attributeInfos[e];if(!r)throw new Error(`Unknown attribute location ${e}`);let i=kw(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=up.isConstantAttributeZeroSupported(this.device)||e!==0;(r||n)&&(e=Number(e),this.device.gl2.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(e):this.device.gl.disableVertexAttribArray(e),this.device.gl2.bindVertexArray(null))}getConstantBuffer(e,r){let i=Ree(r),n=i.byteLength*e,o=i.length*e;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s=s||!Bee(i,this.bufferValue),s){let l=Tw(r.constructor,o);Ew({target:l,source:i,start:0,count:o}),this.buffer.write(l),this.bufferValue=r}return this.buffer}};function Ree(t){return Array.isArray(t)?new Float32Array(t):t}function Bee(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var p0=class extends md{constructor(e,r){super(e,r),this.device=void 0,this.gl2=void 0,this.handle=void 0,this.layout=void 0,this.buffers={},this.unusedBuffers={},this.bindOnUse=!0,this._bound=!1,e.assertWebGL2(),this.device=e,this.gl2=e.gl2,this.handle=this.props.handle||this.gl2.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl2.deleteTransformFeedback(this.handle),super.destroy()}begin(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"point-list";this.gl2.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl2.beginTransformFeedback(J4(e))}end(){this.gl2.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl2.bindTransformFeedback(36386,null)}setBuffers(e){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in e)this.setBuffer(r,e[r])})}setBuffer(e,r){let i=this._getVaryingIndex(e),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[e]=n,gr.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(e){if(tk(e))return this.buffers[e]||null;let r=this._getVaryingIndex(e);return r>=0?this.buffers[r]:null}bind(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof e!="function")return this.gl2.bindTransformFeedback(36386,e),this;let r;return this._bound?r=e():(this.gl2.bindTransformFeedback(36386,this.handle),this._bound=!0,r=e(),this._bound=!1,this.gl2.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof Jl)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=e.buffer.byteLength}=e;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(e){if(tk(e))return Number(e);for(let r of this.layout.varyings)if(e===r.name)return r.location;return-1}_bindBuffers(){for(let e in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,n,i)}}_unbindBuffers(){for(let e in this.buffers)this.gl2.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,o=r&&r.handle;!o||n===void 0?this.gl2.bindBufferBase(35982,e,o):this.gl2.bindBufferRange(35982,e,o,i,n)}};function tk(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}function QM(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return _i(!1),0}}function rk(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return _i(!1),0}}function ik(t,e){var r;let{sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,sourceAttachment:s=36064}=e||{},{target:l=null,sourceWidth:c,sourceHeight:h,sourceType:g}=e||{},{framebuffer:b,deleteFramebuffer:T}=ok(t);_i(b);let{gl:C,handle:P}=b;c=c||b.width,h=h||b.height;let H=s-36064;g=g||((r=b.colorAttachments[H])===null||r===void 0?void 0:r.type)||5121,l=Dee(l,g,o,c,h),g=g||W4(l);let U=C.bindFramebuffer(36160,P);return C.readPixels(i,n,c,h,o,g,l),C.bindFramebuffer(36160,U||null),T&&b.destroy(),l}function nk(t,e){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:l,sourceHeight:c,sourceType:h}=e||{},{framebuffer:g,deleteFramebuffer:b}=ok(t);_i(g),l=l||g.width,c=c||g.height;let T=g;h=h||5121;let C=r;if(!C){let H=QM(o),U=rk(h),J=s+l*c*H*U;C=T.device.createBuffer({byteLength:J})}let P=t.device.createCommandEncoder();return P.copyTextureToBuffer({source:t,width:l,height:c,origin:[i,n],destination:C,byteOffset:s}),P.destroy(),b&&g.destroy(),C}function ok(t){return t instanceof vf?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:Oee(t),deleteFramebuffer:!0}}function Oee(t,e){let{device:r,width:i,height:n,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[t]})}function Dee(t,e,r,i,n){if(t)return t;e=e||5121;let o=vv(e,{clamped:!1}),s=QM(r);return new o(i*n*s)}var Lee=256,Fee=1024,Nee=16384;var kee="clear: bad arguments";function sk(t,e){let r=Qo.attach(t),{framebuffer:i=null,color:n=null,depth:o=null,stencil:s=null}=e||{},l={};i&&(l.framebuffer=i);let c=0;n&&(c|=Nee,n!==!0&&(l.clearColor=n)),o&&(c|=Lee,o!==!0&&(l.clearDepth=o)),s&&(c|=Fee,o!==!0&&(l.clearStencil=o)),_i(c!==0,kee),Fu(r.gl,l,()=>{r.gl.clear(c)})}var xv=1,Qo=class extends Du{static isSupported(){return typeof WebGLRenderingContext<"u"||e4()}get features(){return this._features=this._features||C4(this.gl),this._features}get limits(){return this._limits=this._limits||I4(this.gl),this._limits}static attach(e){if(e instanceof Qo)return e;if(e?.device instanceof Du)return e.device;if(!Uee(e))throw new Error("Invalid WebGLRenderingContext");return new Qo({gl:e})}static async create(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gr.groupCollapsed(xv,"WebGLDevice created")(),typeof e.canvas=="string"&&await ud.pageLoaded,(gr.get("debug")||e.debug)&&await V4();let{spector:r}=e;if((gr.get("spector")||r)&&await k4(),gr.probe(xv+1,"DOM is loaded")(),e.gl&&e.gl.device)return Qo.attach(e.gl);let i=new Qo(e),n=`Created ${i.info.type}${i.debug?" debug":""} context: ${i.info.vendor}, ${i.info.renderer} for canvas: ${i.canvasContext.id}`;return gr.probe(xv,n)(),gr.table(xv,i.info)(),gr.groupEnd(xv)(),i}constructor(e){var r,i;super({...e,id:e.id||uo("webgl-device")}),this.info=void 0,this.canvasContext=void 0,this.handle=void 0,this.lost=void 0,this._resolveContextLost=void 0,this._features=void 0,this._limits=void 0,this.renderPass=null,this.gl=void 0,this.gl2=null,this.debug=!1,this.isWebGL1=void 0,this.isWebGL2=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this._extensions={},this._polyfilled=!1,this.spector=void 0,this._webglLimits=void 0,this._constants=void 0;let n=(r=e.gl)===null||r===void 0?void 0:r.device;if(n)throw new Error(`WebGL context already attached to device ${n.id}`);let o=e.canvas||((i=e.gl)===null||i===void 0?void 0:i.canvas);this.canvasContext=new u0(this,{...e,canvas:o}),this.lost=new Promise(g=>{this._resolveContextLost=g});let s=g=>{var b;return(b=this._resolveContextLost)===null||b===void 0?void 0:b.call(this,{reason:"destroyed",message:"Computer entered sleep mode, or too many apps or browser tabs are using the GPU."})},l=e.gl||null;if(l=l||(Rs()?g4(this.canvasContext.canvas,{...e,onContextLost:s}):null),l=l||(Rs()?null:t4({...e,onContextLost:s})),!l)throw new Error("WebGL context creation failed");this.handle=l,this.gl=this.handle,this.gl2=this.gl,this.isWebGL2=zee(this.gl),this.isWebGL1=!this.isWebGL2,this.canvasContext.resize(),this.info=_4(this.gl),this.gl.device=this,this.gl._version=this.isWebGL2?2:1,Nw(this.gl);let{enable:c=!0,copyState:h=!1}=e;if(hv(this.gl,{enable:c,copyState:h,log:function(){for(var g=arguments.length,b=new Array(g),T=0;T<g;T++)b[T]=arguments[T];return gr.log(1,...b)()}}),Rs()&&e.debug&&(this.gl=H4(this.gl,{...e,webgl2:this.isWebGL2,throwOnError:!0}),this.gl2=this.gl,this.debug=!0,gr.level=Math.max(gr.level,1),gr.warn("WebGL debug mode activated. Performance reduced.")()),Rs()&&e.spector){let g=this.handle.canvas||e.canvas;this.spector=U4({...this.props,canvas:g})}}destroy(){let e=this.gl.getExtension("STACKGL_destroy_context");e&&e.destroy()}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(e){return mv(this.gl,e)}isTextureFormatFilterable(e){return T4(this.gl,e)}isTextureFormatRenderable(e){return E4(this.gl,e)}assertWebGL2(){if(!this.gl2)throw new Error("Requires WebGL2");return this.gl2}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._getBufferProps(e);return new Jl(this,r)}_createTexture(e){return new Da(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new _d(this,e)}createShader(e){return new c0(this,e)}createFramebuffer(e){return new Nc(this,e)}createRenderPipeline(e){return new h0(this,e)}createVertexArray(e){return new up(this,e)}beginRenderPass(e){return new f0(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}createTransformFeedback(e){return new p0(this,e)}getDefaultRenderPass(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass}createCommandEncoder(e){return new d0(this,e)}submit(){var e;(e=this.renderPass)===null||e===void 0||e.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return ik(e,r)}readPixelsToBufferWebGL(e,r){return nk(e,r)}setParametersWebGL(e){Lu(this,e)}getParametersWebGL(e){return o0(this,e)}withParametersWebGL(e,r){Fu(this,e,r)}clearWebGL(e){sk(this,e)}get webglLimits(){return this._webglLimits=this._webglLimits||P4(this.gl),this._webglLimits}loseDevice(){var e;let r=!1,i=this.gl.getExtension("WEBGL_lose_context");return i&&(r=!0,i.loseContext()),(e=this._resolveContextLost)===null||e===void 0||e.call(this,{reason:"destroyed",message:"Application triggered context loss"}),r}pushState(){xf(this.gl)}popState(){Lc(this.gl)}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){r=r||this.gl2||this.gl;let i=Number(e);for(let n in r)if(r[n]===i)return`GL.${n}`;return String(e)}setConstantAttribute(e,r){this._constants=this._constants||new Array(this.limits.maxVertexAttributes).fill(null);let i=this._constants[e];switch(i&&Gee(i,r)&&gr.info(1,`setConstantAttribute(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:Vee(this,e,r);break;case Int32Array:Hee(this,e,r);break;case Uint32Array:jee(this,e,r);break;default:_i(!1)}}};Qo.type="webgl";function Uee(t){return typeof WebGLRenderingContext<"u"&&t instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function zee(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&t._version===2)}function Vee(t,e,r){switch(r.length){case 1:t.gl.vertexAttrib1fv(e,r);break;case 2:t.gl.vertexAttrib2fv(e,r);break;case 3:t.gl.vertexAttrib3fv(e,r);break;case 4:t.gl.vertexAttrib4fv(e,r);break;default:_i(!1)}}function Hee(t,e,r){var i;t.assertWebGL2(),(i=t.gl2)===null||i===void 0||i.vertexAttribI4iv(e,r)}function jee(t,e,r){var i;t.assertWebGL2(),(i=t.gl2)===null||i===void 0||i.vertexAttribI4uiv(e,r)}function Gee(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var ak,lk,ck={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function Kw(){return document.createElement("div")}function Wee(t){if(!t.picked)return null;if(t.object===ak)return lk;let e={html:Xee(t.object),style:ck};return lk=e,ak=t.object,e}var qee=new Set(["position","index"]);function Xee(t){let e=Kw();for(let r in t){if(qee.has(r))continue;let i=Kw();i.className="header",i.textContent=r;let n=Kw();n.className="value",n.textContent=Kee(t[r]);let o=Kw();Yee(o,i,n),o.appendChild(i),o.appendChild(n),e.appendChild(o)}return e.innerHTML}function Yee(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function Kee(t){let e;if(Array.isArray(t)&&t.length>4)e=`Array<${t.length}>`;else if(typeof t=="string")e=t;else if(typeof t=="number")e=String(t);else try{e=JSON.stringify(t)}catch{e="<Non-Serializable Object>"}let r=50;return e.length>r&&(e=e.slice(0,r)),e}function uk(t,e){let r,i=t,n="properties",o=/{[^}]*}/g,s=c=>c.replace(/[{}]/g,""),l=[...new Set(t.match(o).map(s))];for(let c of l){if(c.includes(".")){r=e;let h=c.split(".");for(let g of h)if(r.hasOwnProperty(g))r=r[g];else{r=void 0;break}}else e.hasOwnProperty(c)?r=e[c]:e[n]&&e[n].hasOwnProperty(c)?r=e[n][c]:r=void 0;i=i.replaceAll(`{${c}}`,r)}return i}function $M(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||ck};return t.html?r.html=uk(t.html,e.object):r.text=uk(t.text,e.object),r}:Wee:null}function fk(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function hk(t,e){let r=document.createElement("div");return r.style.width=Number.isFinite(t)?`${t}px`:t,r.style.height=`${e}px`,r.style.position="relative",r}var pk=Xl(dk()),Zee="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",rI=pk.default;function Ak(t=Zee){fk(t)}function mk(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var iI={};function gk(t){if(!iI[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),iI[t]=new Promise(i=>{e.onload=i})}return iI[t]}var _k="4.1.0";var nI,Jee=(nI=globalThis.loaders)===null||nI===void 0?void 0:nI.parseImageNode,oI=typeof Image<"u",sI=typeof ImageBitmap<"u",Qee=Boolean(Jee),aI=ld?!0:Qee;function yk(t){switch(t){case"auto":return sI||oI||aI;case"imagebitmap":return sI;case"image":return oI;case"data":return aI;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function vk(){if(sI)return"imagebitmap";if(oI)return"image";if(aI)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function xk(t){let e=$ee(t);if(!e)throw new Error("Not an image");return e}function bv(t){switch(xk(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function $ee(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var ete=/^data:image\/svg\+xml/,tte=/\.svg((\?|#).*)?$/;function Zw(t){return t&&(ete.test(t)||tte.test(t))}function bk(t,e){if(Zw(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return lI(t,e)}function lI(t,e){if(Zw(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Jw(t,e,r){let i=bk(t,r),n=self.URL||self.webkitURL,o=typeof i!="string"&&n.createObjectURL(i);try{return await rte(o||i,e)}finally{o&&n.revokeObjectURL(o)}}async function rte(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";n(new Error(s))}}catch(o){n(o)}})}var ite={},wk=!0;async function Tk(t,e,r){let i;Zw(r)?i=await Jw(t,e,r):i=lI(t,r);let n=e&&e.imagebitmap;return await nte(i,n)}async function nte(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((ote(e)||!wk)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),wk=!1}return await createImageBitmap(t)}function ote(t){for(let e in t||ite)return!1;return!0}function Ek(t){return!ute(t,"ftyp",4)||!(t[8]&96)?null:ste(t)}function ste(t){switch(ate(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ate(t,e,r){return String.fromCharCode(...t.slice(e,r))}function lte(t){return[...t].map(e=>e.charCodeAt(0))}function ute(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=lte(e);for(let n=0;n<i.length;++n)if(i[n]!==t[n+r])return!1;return!0}var yh=!1,wv=!0;function LA(t){let e=Tv(t);return fte(e)||pte(e)||hte(e)||dte(e)||cte(e)}function cte(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Ek(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function fte(t){let e=Tv(t);return e.byteLength>=24&&e.getUint32(0,yh)===2303741511?{mimeType:"image/png",width:e.getUint32(16,yh),height:e.getUint32(20,yh)}:null}function hte(t){let e=Tv(t);return e.byteLength>=10&&e.getUint32(0,yh)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,wv),height:e.getUint16(8,wv)}:null}function dte(t){let e=Tv(t);return e.byteLength>=14&&e.getUint16(0,yh)===16973&&e.getUint32(2,wv)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,wv),height:e.getUint32(22,wv)}:null}function pte(t){let e=Tv(t);if(!(e.byteLength>=3&&e.getUint16(0,yh)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=Ate(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,yh);if(n.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,yh),width:e.getUint16(o+7,yh)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,yh)}return null}function Ate(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Tv(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Sk(t,e){var r;let{mimeType:i}=LA(t)||{},n=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Yn(n),await n(t,i)}async function Ck(t,e,r){e=e||{};let n=(e.image||{}).type||"auto",{url:o}=r||{},s=mte(n),l;switch(s){case"imagebitmap":l=await Tk(t,e,o);break;case"image":l=await Jw(t,e,o);break;case"data":l=await Sk(t,e);break;default:Yn(!1)}return n==="data"&&(l=bv(l)),l}function mte(t){switch(t){case"auto":case"data":return vk();default:return yk(t),t}}var gte=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],_te=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],yte={image:{type:"auto",decode:!0}},vh={id:"image",module:"images",name:"Images",version:_k,mimeTypes:_te,extensions:gte,parse:Ck,tests:[t=>Boolean(LA(new DataView(t)))],options:yte};var uI={};function cI(t){if(uI[t]===void 0){let e=ld?xte(t):vte(t);uI[t]=e}return uI[t]}function vte(t){var e,r;let i=["image/png","image/jpeg","image/gif"],n=((e=globalThis.loaders)===null||e===void 0?void 0:e.imageFormatsNode)||i,o=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Boolean(o)&&n.includes(t)}function xte(t){switch(t){case"image/avif":case"image/webp":return bte(t);default:return!0}}function bte(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var wte=new Ou({id:"deck"}),vr=wte;var fI={};function Mk(t){fI=t}function ca(t,e,r,i){vr.level>0&&fI[t]&&fI[t].call(null,e,r,i)}function Tte(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var Ik={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:Tte,parseTextSync:JSON.parse};function Ete(){let t="9.0.0-beta.3",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(vr.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:vr,_registerLoggers:Mk},TA([Ik,[vh,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var Qw=Ete();var go=t=>`${t}`;function xh(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var hI={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Rk(t){let e={};for(let[r,i]of Object.entries(t))e[r]=Ste(i);return e}function Bk(t,e,r){let i={};for(let[n,o]of Object.entries(e))t&&n in t&&!o.private?(o.validate&&xh(o.validate(t[n],o),`${r}: invalid ${n}`),i[n]=t[n]):i[n]=o.value;return i}function Ste(t){let e=Pk(t);if(e!=="object")return{value:t,...hI[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...hI[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=Pk(t.value),{...t,...hI[e],type:e}):{type:"object",value:null};throw new Error("props")}function Pk(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var Ok=go`\
|
|
554
554
|
#ifdef MODULE_LOGDEPTH
|
|
555
555
|
logdepth_adjustPosition(gl_Position);
|
|
556
556
|
#endif
|
|
@@ -2564,7 +2564,7 @@ void main(void) {
|
|
|
2564
2564
|
fragColor.rgb = packUVsIntoRGB(uv);
|
|
2565
2565
|
}
|
|
2566
2566
|
}
|
|
2567
|
-
`;var Ule={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:oi.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]},textureParameters:{type:"object",ignore:!0}},bT=class extends Kn{getShaders(){return super.getShaders({vs:t5,fs:r5,modules:[wo,Oo]})}initializeState(){let e=this.getAttributeManager();e.remove(["instancePickingColors"]);let r=!0;e.add({indices:{size:1,isIndexed:!0,update:i=>i.value=this.state.mesh.indices,noAlloc:r},positions:{size:3,type:Ct.DOUBLE,fp64:this.use64bitPositions(),update:i=>i.value=this.state.mesh.positions,noAlloc:r},texCoords:{size:2,update:i=>i.value=this.state.mesh.texCoords,noAlloc:r}})}updateState({props:e,oldProps:r,changeFlags:i}){let n=this.getAttributeManager();if(i.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),n.invalidateAll()),e.bounds!==r.bounds){let o=this.state.mesh,s=this._createMesh();this.state.model.setVertexCount(s.vertexCount);for(let l in s)o&&o[l]!==s[l]&&n.invalidate(l);this.setState({mesh:s,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==r._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(e){let{image:r}=this.props,i=e.info;if(!i.color||!r)return i.bitmap=null,i;if(typeof r=="string")throw new Error("string");let{width:n,height:o}=r;i.index=0;let s=zle(i.color),l=[Math.floor(s[0]*n),Math.floor(s[1]*o)];return i.bitmap={size:{width:n,height:o},uv:s,pixel:l},i}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(e){super._updateAutoHighlight({...e,color:this.encodePickingColor(0)})}_createMesh(){let{bounds:e}=this.props,r=e;return i5(e)&&(r=[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]),R3(r,this.context.viewport.resolution)}_getModel(){return new Xi(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:"triangle-list",isInstanced:!1})}draw(e){let{uniforms:r,moduleParameters:i}=e,{model:n,coordinateConversion:o,bounds:s,disablePicking:l}=this.state,{image:c,desaturate:h,transparentColor:g,tintColor:b}=this.props;i.picking.isActive&&l||c&&n&&(n.setUniforms(r),n.setBindings({bitmapTexture:c}),n.setUniforms({desaturate:h,transparentColor:g.map(T=>T/255),tintColor:b.slice(0,3).map(T=>T/255),coordinateConversion:o,bounds:s}),n.draw(this.context.renderPass))}_getCoordinateUniforms(){let{LNGLAT:e,CARTESIAN:r,DEFAULT:i}=oi,{_imageCoordinateSystem:n}=this.props;if(n!==i){let{bounds:o}=this.props;if(!i5(o))throw new Error("_imageCoordinateSystem only supports rectangular bounds");let s=this.context.viewport.resolution?e:r;if(n=n===e?e:r,n===e&&s===r)return{coordinateConversion:-1,bounds:o};if(n===r&&s===e){let l=tl([o[0],o[1]]),c=tl([o[2],o[3]]);return{coordinateConversion:1,bounds:[l[0],l[1],c[0],c[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}},hm=bT;(()=>{bT.layerName="BitmapLayer"})(),(()=>{bT.defaultProps=Ule})();function zle(t){let[e,r,i]=t,n=(i&240)/256,o=(i&15)/16;return[(e+o)/256,(r+n)/256]}function i5(t){return Number.isFinite(t[0])}var n5=`#version 300 es
|
|
2567
|
+
`;var Ule={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:oi.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]},textureParameters:{type:"object",ignore:!0,value:null}},bT=class extends Kn{getShaders(){return super.getShaders({vs:t5,fs:r5,modules:[wo,Oo]})}initializeState(){let e=this.getAttributeManager();e.remove(["instancePickingColors"]);let r=!0;e.add({indices:{size:1,isIndexed:!0,update:i=>i.value=this.state.mesh.indices,noAlloc:r},positions:{size:3,type:Ct.DOUBLE,fp64:this.use64bitPositions(),update:i=>i.value=this.state.mesh.positions,noAlloc:r},texCoords:{size:2,update:i=>i.value=this.state.mesh.texCoords,noAlloc:r}})}updateState({props:e,oldProps:r,changeFlags:i}){let n=this.getAttributeManager();if(i.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),n.invalidateAll()),e.bounds!==r.bounds){let o=this.state.mesh,s=this._createMesh();this.state.model.setVertexCount(s.vertexCount);for(let l in s)o&&o[l]!==s[l]&&n.invalidate(l);this.setState({mesh:s,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==r._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(e){let{image:r}=this.props,i=e.info;if(!i.color||!r)return i.bitmap=null,i;if(typeof r=="string")throw new Error("string");let{width:n,height:o}=r;i.index=0;let s=zle(i.color),l=[Math.floor(s[0]*n),Math.floor(s[1]*o)];return i.bitmap={size:{width:n,height:o},uv:s,pixel:l},i}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(e){super._updateAutoHighlight({...e,color:this.encodePickingColor(0)})}_createMesh(){let{bounds:e}=this.props,r=e;return i5(e)&&(r=[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]),R3(r,this.context.viewport.resolution)}_getModel(){return new Xi(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),topology:"triangle-list",isInstanced:!1})}draw(e){let{uniforms:r,moduleParameters:i}=e,{model:n,coordinateConversion:o,bounds:s,disablePicking:l}=this.state,{image:c,desaturate:h,transparentColor:g,tintColor:b}=this.props;i.picking.isActive&&l||c&&n&&(n.setUniforms(r),n.setBindings({bitmapTexture:c}),n.setUniforms({desaturate:h,transparentColor:g.map(T=>T/255),tintColor:b.slice(0,3).map(T=>T/255),coordinateConversion:o,bounds:s}),n.draw(this.context.renderPass))}_getCoordinateUniforms(){let{LNGLAT:e,CARTESIAN:r,DEFAULT:i}=oi,{_imageCoordinateSystem:n}=this.props;if(n!==i){let{bounds:o}=this.props;if(!i5(o))throw new Error("_imageCoordinateSystem only supports rectangular bounds");let s=this.context.viewport.resolution?e:r;if(n=n===e?e:r,n===e&&s===r)return{coordinateConversion:-1,bounds:o};if(n===r&&s===e){let l=tl([o[0],o[1]]),c=tl([o[2],o[3]]);return{coordinateConversion:1,bounds:[l[0],l[1],c[0],c[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}},hm=bT;(()=>{bT.layerName="BitmapLayer"})(),(()=>{bT.defaultProps=Ule})();function zle(t){let[e,r,i]=t,n=(i&240)/256,o=(i&15)/16;return[(e+o)/256,(r+n)/256]}function i5(t){return Number.isFinite(t[0])}var n5=`#version 300 es
|
|
2568
2568
|
#define SHADER_NAME icon-layer-vertex-shader
|
|
2569
2569
|
|
|
2570
2570
|
in vec2 positions;
|
|
@@ -2683,7 +2683,7 @@ void main(void) {
|
|
|
2683
2683
|
fragColor = vec4(color, a);
|
|
2684
2684
|
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
2685
2685
|
}
|
|
2686
|
-
`;var Vle=1024,Hle=4,s5=()=>{},a5={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},jle={x:0,y:0,width:0,height:0};function Gle(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function Wle(t,e,r,i){let n=Math.min(r/e.width,i/e.height),o=Math.floor(e.width*n),s=Math.floor(e.height*n);return n===1?{data:e,width:o,height:s}:(t.canvas.height=s,t.canvas.width=o,t.clearRect(0,0,o,s),t.drawImage(e,0,0,e.width,e.height,0,0,o,s),{data:t.canvas,width:o,height:s})}function Fx(t){return t&&(t.id||t.url)}function qle(t,e,r,i){let n=t.width,o=t.height,s=t.device.createTexture({format:"rgba8unorm",width:e,height:r,sampler:i});return copyToTexture(t,s,{targetY:0,width:n,height:o}),t.delete(),s}function l5(t,e,r){for(let i=0;i<e.length;i++){let{icon:n,xOffset:o}=e[i],s=Fx(n);t[s]={...n,x:o,y:r}}}function Xle({icons:t,buffer:e,mapping:r={},xOffset:i=0,yOffset:n=0,rowHeight:o=0,canvasWidth:s}){let l=[];for(let c=0;c<t.length;c++){let h=t[c],g=Fx(h);if(!r[g]){let{height:b,width:T}=h;i+T+e>s&&(l5(r,l,n),i=0,n=o+n+e,o=0,l=[]),l.push({icon:h,xOffset:i}),i=i+T+e,o=Math.max(o,b)}}return l.length>0&&l5(r,l,n),{mapping:r,rowHeight:o,xOffset:i,yOffset:n,canvasWidth:s,canvasHeight:Gle(o+n+e)}}function Yle(t,e,r){if(!t||!e)return null;r=r||{};let i={},{iterable:n,objectInfo:o}=fa(t);for(let s of n){o.index++;let l=e(s,o),c=Fx(l);if(!l)throw new Error("Icon is missing.");if(!l.url)throw new Error("Icon url is missing.");!i[c]&&(!r[c]||l.url!==r[c].url)&&(i[c]={...l,source:s,sourceIndex:o.index})}return i}var Nx=class{constructor(e,{onUpdate:r=s5,onError:i=s5}){this._loadOptions=null,this._texture=null,this._externalTexture=null,this._mapping={},this._textureParameters=null,this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=Hle,this._canvasWidth=Vle,this._canvasHeight=0,this._canvas=null,this.device=e,this.onUpdate=r,this.onError=i}finalize(){this._texture?.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(e){let r=this._autoPacking?Fx(e):e;return this._mapping[r]||jle}setProps({loadOptions:e,autoPacking:r,iconAtlas:i,iconMapping:n,textureParameters:o}){e&&(this._loadOptions=e),r!==void 0&&(this._autoPacking=r),n&&(this._mapping=n),i&&(this._texture?.delete(),this._texture=null,this._externalTexture=i),o&&(this._textureParameters=o)}get isLoaded(){return this._pendingCount===0}packIcons(e,r){if(!this._autoPacking||typeof document>"u")return;let i=Object.values(Yle(e,r,this._mapping)||{});if(i.length>0){let{mapping:n,xOffset:o,yOffset:s,rowHeight:l,canvasHeight:c}=Xle({icons:i,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=l,this._mapping=n,this._xOffset=o,this._yOffset=s,this._canvasHeight=c,this._texture||(this._texture=this.device.createTexture({format:"rgba8unorm",width:this._canvasWidth,height:this._canvasHeight,sampler:this._textureParameters||a5})),this._texture.height!==this._canvasHeight&&(this._texture=qle(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||a5)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(i)}}_loadIcons(e){let r=this._canvas.getContext("2d",{willReadFrequently:!0});for(let i of e)this._pendingCount++,Oa(i.url,this._loadOptions).then(n=>{let o=Fx(i),s=this._mapping[o],{x:l,y:c,width:h,height:g}=s,{data:b,width:T,height:C}=Wle(r,n,h,g);this._texture.setSubImageData({data:b,x:l+(h-T)/2,y:c+(g-C)/2,width:T,height:C}),s.width=T,s.height=C,this._texture.generateMipmap(),this.onUpdate()}).catch(n=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:n})}).finally(()=>{this._pendingCount--})}};var u5=[0,0,0,255],Kle={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:u5},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,optional:!0},textureParameters:{type:"object",ignore:!0}},wT=class extends Kn{getShaders(){return super.getShaders({vs:n5,fs:o5,modules:[wo,Oo]})}initializeState(){this.state={iconManager:new Nx(this.context.device,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:Ct.DOUBLE,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:Ct.UNSIGNED_BYTE,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:Ct.UNSIGNED_BYTE,normalized:!0,transition:!0,accessor:"getColor",defaultValue:u5},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState(e){super.updateState(e);let{props:r,oldProps:i,changeFlags:n}=e,o=this.getAttributeManager(),{iconAtlas:s,iconMapping:l,data:c,getIcon:h,textureParameters:g}=r,{iconManager:b}=this.state;if(typeof s=="string")return;let T=s||this.internalState.isAsyncPropLoading("iconAtlas");b.setProps({loadOptions:r.loadOptions,autoPacking:!T,iconAtlas:s,iconMapping:T?l:null,textureParameters:g}),T?i.iconMapping!==r.iconMapping&&o.invalidate("getIcon"):(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&b.packIcons(c,h),n.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),o.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(e){super.finalizeState(e),this.state.iconManager.finalize()}draw({uniforms:e}){let{sizeScale:r,sizeMinPixels:i,sizeMaxPixels:n,sizeUnits:o,billboard:s,alphaCutoff:l}=this.props,{iconManager:c}=this.state,h=c.getTexture();if(h){let g=this.state.model;g.setBindings({iconsTexture:h}),g.setUniforms(e),g.setUniforms({iconsTextureDim:[h.width,h.height],sizeUnits:Os[o],sizeScale:r,sizeMinPixels:i,sizeMaxPixels:n,billboard:s,alphaCutoff:l}),g.draw(this.context.renderPass)}}_getModel(){let e=[-1,-1,1,-1,-1,1,1,1];return new Xi(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Tn({topology:"triangle-strip",attributes:{positions:{size:2,value:new Float32Array(e)}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(e){let r=this.getCurrentLayer()?.props.onIconError;r?r(e):vr.error(e.error.message)()}getInstanceOffset(e){let{width:r,height:i,anchorX:n=r/2,anchorY:o=i/2}=this.state.iconManager.getIconMapping(e);return[r/2-n,i/2-o]}getInstanceColorMode(e){return this.state.iconManager.getIconMapping(e).mask?1:0}getInstanceIconFrame(e){let{x:r,y:i,width:n,height:o}=this.state.iconManager.getIconMapping(e);return[r,i,n,o]}},Ld=wT;(()=>{wT.defaultProps=Kle})(),(()=>{wT.layerName="IconLayer"})();var c5=`#version 300 es
|
|
2686
|
+
`;var Vle=1024,Hle=4,s5=()=>{},a5={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},jle={x:0,y:0,width:0,height:0};function Gle(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function Wle(t,e,r,i){let n=Math.min(r/e.width,i/e.height),o=Math.floor(e.width*n),s=Math.floor(e.height*n);return n===1?{data:e,width:o,height:s}:(t.canvas.height=s,t.canvas.width=o,t.clearRect(0,0,o,s),t.drawImage(e,0,0,e.width,e.height,0,0,o,s),{data:t.canvas,width:o,height:s})}function Fx(t){return t&&(t.id||t.url)}function qle(t,e,r,i){let n=t.width,o=t.height,s=t.device.createTexture({format:"rgba8unorm",width:e,height:r,sampler:i});return copyToTexture(t,s,{targetY:0,width:n,height:o}),t.delete(),s}function l5(t,e,r){for(let i=0;i<e.length;i++){let{icon:n,xOffset:o}=e[i],s=Fx(n);t[s]={...n,x:o,y:r}}}function Xle({icons:t,buffer:e,mapping:r={},xOffset:i=0,yOffset:n=0,rowHeight:o=0,canvasWidth:s}){let l=[];for(let c=0;c<t.length;c++){let h=t[c],g=Fx(h);if(!r[g]){let{height:b,width:T}=h;i+T+e>s&&(l5(r,l,n),i=0,n=o+n+e,o=0,l=[]),l.push({icon:h,xOffset:i}),i=i+T+e,o=Math.max(o,b)}}return l.length>0&&l5(r,l,n),{mapping:r,rowHeight:o,xOffset:i,yOffset:n,canvasWidth:s,canvasHeight:Gle(o+n+e)}}function Yle(t,e,r){if(!t||!e)return null;r=r||{};let i={},{iterable:n,objectInfo:o}=fa(t);for(let s of n){o.index++;let l=e(s,o),c=Fx(l);if(!l)throw new Error("Icon is missing.");if(!l.url)throw new Error("Icon url is missing.");!i[c]&&(!r[c]||l.url!==r[c].url)&&(i[c]={...l,source:s,sourceIndex:o.index})}return i}var Nx=class{constructor(e,{onUpdate:r=s5,onError:i=s5}){this._loadOptions=null,this._texture=null,this._externalTexture=null,this._mapping={},this._textureParameters=null,this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=Hle,this._canvasWidth=Vle,this._canvasHeight=0,this._canvas=null,this.device=e,this.onUpdate=r,this.onError=i}finalize(){this._texture?.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(e){let r=this._autoPacking?Fx(e):e;return this._mapping[r]||jle}setProps({loadOptions:e,autoPacking:r,iconAtlas:i,iconMapping:n,textureParameters:o}){e&&(this._loadOptions=e),r!==void 0&&(this._autoPacking=r),n&&(this._mapping=n),i&&(this._texture?.delete(),this._texture=null,this._externalTexture=i),o&&(this._textureParameters=o)}get isLoaded(){return this._pendingCount===0}packIcons(e,r){if(!this._autoPacking||typeof document>"u")return;let i=Object.values(Yle(e,r,this._mapping)||{});if(i.length>0){let{mapping:n,xOffset:o,yOffset:s,rowHeight:l,canvasHeight:c}=Xle({icons:i,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=l,this._mapping=n,this._xOffset=o,this._yOffset=s,this._canvasHeight=c,this._texture||(this._texture=this.device.createTexture({format:"rgba8unorm",width:this._canvasWidth,height:this._canvasHeight,sampler:this._textureParameters||a5})),this._texture.height!==this._canvasHeight&&(this._texture=qle(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||a5)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(i)}}_loadIcons(e){let r=this._canvas.getContext("2d",{willReadFrequently:!0});for(let i of e)this._pendingCount++,Oa(i.url,this._loadOptions).then(n=>{let o=Fx(i),s=this._mapping[o],{x:l,y:c,width:h,height:g}=s,{data:b,width:T,height:C}=Wle(r,n,h,g);this._texture.setSubImageData({data:b,x:l+(h-T)/2,y:c+(g-C)/2,width:T,height:C}),s.width=T,s.height=C,this._texture.generateMipmap(),this.onUpdate()}).catch(n=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:n})}).finally(()=>{this._pendingCount--})}};var u5=[0,0,0,255],Kle={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:u5},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,optional:!0},textureParameters:{type:"object",ignore:!0,value:null}},wT=class extends Kn{getShaders(){return super.getShaders({vs:n5,fs:o5,modules:[wo,Oo]})}initializeState(){this.state={iconManager:new Nx(this.context.device,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:Ct.DOUBLE,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:Ct.UNSIGNED_BYTE,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:Ct.UNSIGNED_BYTE,normalized:!0,transition:!0,accessor:"getColor",defaultValue:u5},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState(e){super.updateState(e);let{props:r,oldProps:i,changeFlags:n}=e,o=this.getAttributeManager(),{iconAtlas:s,iconMapping:l,data:c,getIcon:h,textureParameters:g}=r,{iconManager:b}=this.state;if(typeof s=="string")return;let T=s||this.internalState.isAsyncPropLoading("iconAtlas");b.setProps({loadOptions:r.loadOptions,autoPacking:!T,iconAtlas:s,iconMapping:T?l:null,textureParameters:g}),T?i.iconMapping!==r.iconMapping&&o.invalidate("getIcon"):(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&b.packIcons(c,h),n.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),o.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(e){super.finalizeState(e),this.state.iconManager.finalize()}draw({uniforms:e}){let{sizeScale:r,sizeMinPixels:i,sizeMaxPixels:n,sizeUnits:o,billboard:s,alphaCutoff:l}=this.props,{iconManager:c}=this.state,h=c.getTexture();if(h){let g=this.state.model;g.setBindings({iconsTexture:h}),g.setUniforms(e),g.setUniforms({iconsTextureDim:[h.width,h.height],sizeUnits:Os[o],sizeScale:r,sizeMinPixels:i,sizeMaxPixels:n,billboard:s,alphaCutoff:l}),g.draw(this.context.renderPass)}}_getModel(){let e=[-1,-1,1,-1,-1,1,1,1];return new Xi(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Tn({topology:"triangle-strip",attributes:{positions:{size:2,value:new Float32Array(e)}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(e){let r=this.getCurrentLayer()?.props.onIconError;r?r(e):vr.error(e.error.message)()}getInstanceOffset(e){let{width:r,height:i,anchorX:n=r/2,anchorY:o=i/2}=this.state.iconManager.getIconMapping(e);return[r/2-n,i/2-o]}getInstanceColorMode(e){return this.state.iconManager.getIconMapping(e).mask?1:0}getInstanceIconFrame(e){let{x:r,y:i,width:n,height:o}=this.state.iconManager.getIconMapping(e);return[r,i,n,o]}},Ld=wT;(()=>{wT.defaultProps=Kle})(),(()=>{wT.layerName="IconLayer"})();var c5=`#version 300 es
|
|
2687
2687
|
#define SHADER_NAME line-layer-vertex-shader
|
|
2688
2688
|
|
|
2689
2689
|
in vec3 positions;
|
|
@@ -4295,7 +4295,7 @@ void main(void) {
|
|
|
4295
4295
|
vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
|
|
4296
4296
|
fragColor = vec4(lightColor, color.a * opacity);
|
|
4297
4297
|
}
|
|
4298
|
-
`;function zR(t){let e=t.positions||t.POSITION;vr.assert(e,'no "postions" or "POSITION" attribute in mesh');let r=e.value.length/e.size,i=t.COLOR_0||t.colors;i||(i={size:3,value:new Float32Array(r*3).fill(1)});let n=t.NORMAL||t.normals;n||(n={size:3,value:new Float32Array(r*3).fill(0)});let o=t.TEXCOORD_0||t.texCoords;return o||(o={size:2,value:new Float32Array(r*2).fill(0)}),{positions:e,colors:i,normals:n,texCoords:o}}function kH(t){return t instanceof Tn?(t.attributes=zR(t.attributes),t):t.attributes?new Tn({...t,topology:"triangle-list",attributes:zR(t.attributes)}):new Tn({topology:"triangle-list",attributes:zR(t)})}var Fpe=[0,0,0,255],Npe={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:Fpe},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0}},WE=class extends Kn{getShaders(){let e=this.context.device.info.type!=="webgl2",r={};return this.context.device.features.has("glsl-derivatives")&&(r.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:FH,fs:NH,modules:[wo,mp,Oo],transpileToGLSL100:e,defines:r})}getBounds(){if(this.props._instanced)return super.getBounds();let e=this.state.positionBounds;if(e)return e;let{mesh:r}=this.props;if(!r)return null;if(e=r.header?.boundingBox,!e){let{attributes:i}=kH(r);i.POSITION=i.POSITION||i.positions,e=ad(i)}return this.state.positionBounds=e,e}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:Ct.DOUBLE,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:Ct.UNSIGNED_BYTE,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:jE}),this.setState({emptyTexture:this.context.device.createTexture({data:new Uint8Array(4),width:1,height:1})})}updateState(e){super.updateState(e);let{props:r,oldProps:i,changeFlags:n}=e;if(r.mesh!==i.mesh||n.extensionsChanged){if(this.state.positionBounds=null,this.state.model?.destroy(),r.mesh){this.state.model=this.getModel(r.mesh);let o=r.mesh.attributes||r.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}r.texture!==i.texture&&r.texture instanceof Bs&&this.setTexture(r.texture),this.state.model&&this.state.model.setTopology(this.props.wireframe?"line-strip":"triangle-list")}finalizeState(e){super.finalizeState(e),this.state.emptyTexture.delete()}draw({uniforms:e}){let{model:r}=this.state;if(!r)return;let{viewport:i,renderPass:n}=this.context,{sizeScale:o,coordinateSystem:s,_instanced:l}=this.props;r.setUniforms(e),r.setUniforms({sizeScale:o,composeModelMatrix:!l||GE(i,s),flatShading:!this.state.hasNormals}),r.draw(n)}get isLoaded(){return Boolean(this.state?.model&&super.isLoaded)}getModel(e){let r=new Xi(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:kH(e),isInstanced:!0}),{texture:i}=this.props,{emptyTexture:n}=this.state;return r.setBindings({sampler:i||n}),r.setUniforms({hasTexture:Boolean(i)}),r}setTexture(e){let{emptyTexture:r,model:i}=this.state;i&&(i.setBindings({sampler:e||r}),i.setUniforms({hasTexture:Boolean(e)}))}},Rh=WE;(()=>{WE.defaultProps=Npe})(),(()=>{WE.layerName="SimpleMeshLayer"})();var Bh=function(t){return t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.ONE=1]="ONE",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.LINEAR=9729]="LINEAR",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t}(Bh||{});function I1(t,e,r,i){let n={defines:{MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},bindings:{},uniforms:{u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},parameters:{},glParameters:{},generatedTextures:[]};t.features.has("glsl-texture-lod")&&(n.defines.USE_TEX_LOD=1);let{imageBasedLightingEnvironment:o}=i;return o&&(n.bindings.u_DiffuseEnvSampler=o.diffuseEnvSampler,n.bindings.u_SpecularEnvSampler=o.specularEnvSampler,n.bindings.u_brdfLUT=o.brdfLutTexture,n.uniforms.u_ScaleIBLAmbient=[1,1]),i!=null&&i.pbrDebug&&(n.defines.PBR_DEBUG=1,n.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],n.uniforms.u_ScaleFGDSpec=[0,0,0,0]),r.NORMAL&&(n.defines.HAS_NORMALS=1),r.TANGENT&&i!==null&&i!==void 0&&i.useTangents&&(n.defines.HAS_TANGENTS=1),r.TEXCOORD_0&&(n.defines.HAS_UV=1),i!=null&&i.imageBasedLightingEnvironment&&(n.defines.USE_IBL=1),i!=null&&i.lights&&(n.defines.USE_LIGHTS=1),e&&kpe(t,e,n),n}function kpe(t,e,r){if(r.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&Upe(t,e.pbrMetallicRoughness,r),e.normalTexture){M1(t,e.normalTexture,"u_NormalSampler","HAS_NORMALMAP",r);let{scale:i=1}=e.normalTexture;r.uniforms.u_NormalScale=i}if(e.occlusionTexture){M1(t,e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP",r);let{strength:i=1}=e.occlusionTexture;r.uniforms.u_OcclusionStrength=i}switch(e.emissiveTexture&&(M1(t,e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP",r),r.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),e.alphaMode){case"MASK":let{alphaCutoff:i=.5}=e;r.defines.ALPHA_CUTOFF=1,r.uniforms.u_AlphaCutoff=i;break;case"BLEND":gr.warn("glTF BLEND alphaMode might not work well because it requires mesh sorting")(),r.parameters.blendColorOperation="add",r.parameters.blendColorSrcFactor="src-alpha",r.parameters.blendColorDstFactor="one-minus-src-alpha",r.parameters.blendAlphaOperation="add",r.parameters.blendAlphaSrcFactor="one",r.parameters.blendAlphaDstFactor="one-minus-src-alpha",r.glParameters.blend=!0,r.glParameters.blendEquation=Bh.FUNC_ADD,r.glParameters.blendFunc=[Bh.SRC_ALPHA,Bh.ONE_MINUS_SRC_ALPHA,Bh.ONE,Bh.ONE_MINUS_SRC_ALPHA];break}}function Upe(t,e,r){e.baseColorTexture&&M1(t,e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP",r),r.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&M1(t,e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP",r);let{metallicFactor:i=1,roughnessFactor:n=1}=e;r.uniforms.u_MetallicRoughnessValues=[i,n]}function M1(t,e,r){var i;let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4?arguments[4]:void 0,s=(e==null||(i=e.texture)===null||i===void 0||(i=i.sampler)===null||i===void 0?void 0:i.parameters)||{},l=e.texture.source.image,c,h={};l.compressed?(c=l,h={[Bh.TEXTURE_MIN_FILTER]:l.data.length>1?Bh.LINEAR_MIPMAP_NEAREST:Bh.LINEAR}):c={data:l};let g=t.createTexture({id:e.uniformName||e.id,parameters:{...s,...h},pixelStore:{[Bh.UNPACK_FLIP_Y_WEBGL]:!1},...c});o.bindings[r]=g,n&&(o.defines[n]=1),o.generatedTextures.push(g)}var UH="4.1.0";var qE={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},VR;async function jR(t){let e=t.modules||{};return e.basis?e.basis:(VR=VR||zpe(t),await VR)}async function zpe(t){let e=null,r=null;return[e,r]=await Promise.all([await ph(qE.TRANSCODER,"textures",t),await ph(qE.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await Vpe(e,r)}function Vpe(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(i=>{t(r).then(n=>{let{BasisFile:o,initializeBasis:s}=n;s(),i({BasisFile:o})})})}var HR;async function GR(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(HR=HR||Hpe(t),await HR)}async function Hpe(t){let e=null,r=null;return[e,r]=await Promise.all([await ph(qE.ENCODER,"textures",t),await ph(qE.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await jpe(e,r)}function jpe(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(i=>{t(r).then(n=>{let{BasisFile:o,KTX2File:s,initializeBasis:l,BasisEncoder:c}=n;l(),i({BasisFile:o,KTX2File:s,BasisEncoder:c})})})}var Lm={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var Gpe=["","WEBKIT_","MOZ_"],zH={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},XE=null;function VH(t){if(!XE){t=t||Wpe()||void 0,XE=new Set;for(let e of Gpe)for(let r in zH)if(t&&t.getExtension(`${e}${r}`)){let i=zH[r];XE.add(i)}}return XE}function Wpe(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var itt=new Uint8Array([0]);var HH,jH,GH,WH,qH,XH,YH,KH;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(HH||(HH={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(jH||(jH={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(GH||(GH={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(WH||(WH={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(qH||(qH={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(XH||(XH={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(YH||(YH={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(KH||(KH={}));var uc=[171,75,84,88,32,50,48,187,13,10,26,10];function ZH(t){let e=new Uint8Array(t);return!(e.byteLength<uc.length||e[0]!==uc[0]||e[1]!==uc[1]||e[2]!==uc[2]||e[3]!==uc[3]||e[4]!==uc[4]||e[5]!==uc[5]||e[6]!==uc[6]||e[7]!==uc[7]||e[8]!==uc[8]||e[9]!==uc[9]||e[10]!==uc[10]||e[11]!==uc[11])}var qpe={etc1:{basisFormat:0,compressed:!0,format:Lm.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Lm.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Lm.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Lm.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Lm.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Lm.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function qR(t,e){if(e.basis.containerFormat==="auto"){if(ZH(t)){let i=await GR(e);return JH(i.KTX2File,t,e)}let{BasisFile:r}=await jR(e);return WR(r,t,e)}switch(e.basis.module){case"encoder":let r=await GR(e);switch(e.basis.containerFormat){case"ktx2":return JH(r.KTX2File,t,e);case"basis":default:return WR(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:i}=await jR(e);return WR(i,t,e)}}function WR(t,e,r){let i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let n=i.getNumImages(),o=[];for(let s=0;s<n;s++){let l=i.getNumLevels(s),c=[];for(let h=0;h<l;h++)c.push(Xpe(i,s,h,r));o.push(c)}return o}finally{i.close(),i.delete()}}function Xpe(t,e,r,i){let n=t.getImageWidth(e,r),o=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:l,format:c,basisFormat:h}=QH(i,s),g=t.getImageTranscodedSizeInBytes(e,r,h),b=new Uint8Array(g);if(!t.transcodeImage(b,e,r,h,0,0))throw new Error("failed to start Basis transcoding");return{width:n,height:o,data:b,compressed:l,format:c,hasAlpha:s}}function JH(t,e,r){let i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let n=i.getLevels(),o=[];for(let s=0;s<n;s++){o.push(Ype(i,s,r));break}return[o]}finally{i.close(),i.delete()}}function Ype(t,e,r){let{alphaFlag:i,height:n,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:l,basisFormat:c}=QH(r,i),h=t.getImageTranscodedSizeInBytes(e,0,0,c),g=new Uint8Array(h);if(!t.transcodeImage(g,e,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:n,data:g,compressed:s,levelSize:h,hasAlpha:i,format:l}}function QH(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=YE()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),qpe[r]}function YE(){let t=VH();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var $H={name:"Basis",id:"basis",module:"textures",version:UH,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},XR={...$H,parse:qR};var Kpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zpe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},KR=class{constructor(e){this.name=void 0,this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;let i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(n=>{let{sampler:o,target:s,path:l}=n;rAe(i,o,s,l),Qpe(s,s._node)})}},KE=class{constructor(e){this.animations=void 0,this.animations=e.animations.map((r,i)=>{let n=r.name||`Animation-${i}`,o=r.samplers.map(l=>{let{input:c,interpolation:h="LINEAR",output:g}=l;return{input:ej(e.accessors[c]),interpolation:h,output:ej(e.accessors[g])}}),s=r.channels.map(l=>{let{sampler:c,target:h}=l;return{sampler:o[c],target:e.nodes[h.node],path:h.path}});return new KR({name:n,channels:s})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(r=>r.animate(e))}getAnimations(){return this.animations}};function ej(t){if(!t._animation){let e=Zpe[t.componentType],r=Kpe[t.type],i=r*t.count,{buffer:n,byteOffset:o}=t.bufferView.data,s=new e(n,o+(t.byteOffset||0),i);if(r===1)t._animation=Array.from(s);else{let l=[];for(let c=0;c<s.length;c+=r)l.push(Array.from(s.slice(c,c+r)));t._animation=l}}return t._animation}var Jpe=new ni;function Qpe(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){let r=Jpe.fromQuaternion(t.rotation);e.matrix.multiplyRight(r)}t.scale&&e.matrix.scale(t.scale)}var YR=new Hc;function $pe(t,e,r,i,n){if(e==="rotation"){YR.slerp({start:r,target:i,ratio:n});for(let o=0;o<YR.length;o++)t[e][o]=YR[o]}else for(let o=0;o<r.length;o++)t[e][o]=n*i[o]+(1-n)*r[o]}function eAe(t,e,r){let{p0:i,outTangent0:n,inTangent1:o,p1:s,tDiff:l,ratio:c}=r;for(let h=0;h<t[e].length;h++){let g=n[h]*l,b=o[h]*l;t[e][h]=(2*Math.pow(c,3)-3*Math.pow(c,2)+1)*i[h]+(Math.pow(c,3)-2*Math.pow(c,2)+c)*g+(-2*Math.pow(c,3)+3*Math.pow(c,2))*s[h]+(Math.pow(c,3)-Math.pow(c,2))*b}}function tAe(t,e,r){for(let i=0;i<r.length;i++)t[e][i]=r[i]}function rAe(t,e,r,i){let{input:n,interpolation:o,output:s}=e,l=n[n.length-1],c=t%l,h=n.findIndex(C=>C>=c),g=Math.max(0,h-1);if(!Array.isArray(r[i]))switch(i){case"translation":r[i]=[0,0,0];break;case"rotation":r[i]=[0,0,0,1];break;case"scale":r[i]=[1,1,1];break;default:gr.warn(`Bad animation path ${i}`)()}_i(r[i].length===s[g].length);let b=n[g],T=n[h];switch(o){case"STEP":tAe(r,i,s[g]);break;case"LINEAR":if(T>b){let C=(c-b)/(T-b);$pe(r,i,s[g],s[h],C)}break;case"CUBICSPLINE":if(T>b){let C=(c-b)/(T-b),P=T-b,H=s[3*g+1],U=s[3*g+2],J=s[3*h+0],ee=s[3*h+1];eAe(r,i,{p0:H,outTangent0:U,inTangent1:J,p1:ee,tDiff:P,ratio:C})}break;default:gr.warn(`Interpolation ${o} not supported`)();break}}var iAe=`
|
|
4298
|
+
`;function zR(t){let e=t.positions||t.POSITION;vr.assert(e,'no "postions" or "POSITION" attribute in mesh');let r=e.value.length/e.size,i=t.COLOR_0||t.colors;i||(i={size:3,value:new Float32Array(r*3).fill(1)});let n=t.NORMAL||t.normals;n||(n={size:3,value:new Float32Array(r*3).fill(0)});let o=t.TEXCOORD_0||t.texCoords;return o||(o={size:2,value:new Float32Array(r*2).fill(0)}),{positions:e,colors:i,normals:n,texCoords:o}}function kH(t){return t instanceof Tn?(t.attributes=zR(t.attributes),t):t.attributes?new Tn({...t,topology:"triangle-list",attributes:zR(t.attributes)}):new Tn({topology:"triangle-list",attributes:zR(t)})}var Fpe=[0,0,0,255],Npe={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:Fpe},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0,value:null}},WE=class extends Kn{getShaders(){let e=this.context.device.info.type!=="webgl2",r={};return this.context.device.features.has("glsl-derivatives")&&(r.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:FH,fs:NH,modules:[wo,mp,Oo],transpileToGLSL100:e,defines:r})}getBounds(){if(this.props._instanced)return super.getBounds();let e=this.state.positionBounds;if(e)return e;let{mesh:r}=this.props;if(!r)return null;if(e=r.header?.boundingBox,!e){let{attributes:i}=kH(r);i.POSITION=i.POSITION||i.positions,e=ad(i)}return this.state.positionBounds=e,e}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:Ct.DOUBLE,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:Ct.UNSIGNED_BYTE,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:jE}),this.setState({emptyTexture:this.context.device.createTexture({data:new Uint8Array(4),width:1,height:1})})}updateState(e){super.updateState(e);let{props:r,oldProps:i,changeFlags:n}=e;if(r.mesh!==i.mesh||n.extensionsChanged){if(this.state.positionBounds=null,this.state.model?.destroy(),r.mesh){this.state.model=this.getModel(r.mesh);let o=r.mesh.attributes||r.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}r.texture!==i.texture&&r.texture instanceof Bs&&this.setTexture(r.texture),this.state.model&&this.state.model.setTopology(this.props.wireframe?"line-strip":"triangle-list")}finalizeState(e){super.finalizeState(e),this.state.emptyTexture.delete()}draw({uniforms:e}){let{model:r}=this.state;if(!r)return;let{viewport:i,renderPass:n}=this.context,{sizeScale:o,coordinateSystem:s,_instanced:l}=this.props;r.setUniforms(e),r.setUniforms({sizeScale:o,composeModelMatrix:!l||GE(i,s),flatShading:!this.state.hasNormals}),r.draw(n)}get isLoaded(){return Boolean(this.state?.model&&super.isLoaded)}getModel(e){let r=new Xi(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:kH(e),isInstanced:!0}),{texture:i}=this.props,{emptyTexture:n}=this.state;return r.setBindings({sampler:i||n}),r.setUniforms({hasTexture:Boolean(i)}),r}setTexture(e){let{emptyTexture:r,model:i}=this.state;i&&(i.setBindings({sampler:e||r}),i.setUniforms({hasTexture:Boolean(e)}))}},Rh=WE;(()=>{WE.defaultProps=Npe})(),(()=>{WE.layerName="SimpleMeshLayer"})();var Bh=function(t){return t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.ONE=1]="ONE",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.LINEAR=9729]="LINEAR",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t}(Bh||{});function I1(t,e,r,i){let n={defines:{MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},bindings:{},uniforms:{u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},parameters:{},glParameters:{},generatedTextures:[]};t.features.has("glsl-texture-lod")&&(n.defines.USE_TEX_LOD=1);let{imageBasedLightingEnvironment:o}=i;return o&&(n.bindings.u_DiffuseEnvSampler=o.diffuseEnvSampler,n.bindings.u_SpecularEnvSampler=o.specularEnvSampler,n.bindings.u_brdfLUT=o.brdfLutTexture,n.uniforms.u_ScaleIBLAmbient=[1,1]),i!=null&&i.pbrDebug&&(n.defines.PBR_DEBUG=1,n.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],n.uniforms.u_ScaleFGDSpec=[0,0,0,0]),r.NORMAL&&(n.defines.HAS_NORMALS=1),r.TANGENT&&i!==null&&i!==void 0&&i.useTangents&&(n.defines.HAS_TANGENTS=1),r.TEXCOORD_0&&(n.defines.HAS_UV=1),i!=null&&i.imageBasedLightingEnvironment&&(n.defines.USE_IBL=1),i!=null&&i.lights&&(n.defines.USE_LIGHTS=1),e&&kpe(t,e,n),n}function kpe(t,e,r){if(r.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&Upe(t,e.pbrMetallicRoughness,r),e.normalTexture){M1(t,e.normalTexture,"u_NormalSampler","HAS_NORMALMAP",r);let{scale:i=1}=e.normalTexture;r.uniforms.u_NormalScale=i}if(e.occlusionTexture){M1(t,e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP",r);let{strength:i=1}=e.occlusionTexture;r.uniforms.u_OcclusionStrength=i}switch(e.emissiveTexture&&(M1(t,e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP",r),r.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),e.alphaMode){case"MASK":let{alphaCutoff:i=.5}=e;r.defines.ALPHA_CUTOFF=1,r.uniforms.u_AlphaCutoff=i;break;case"BLEND":gr.warn("glTF BLEND alphaMode might not work well because it requires mesh sorting")(),r.parameters.blendColorOperation="add",r.parameters.blendColorSrcFactor="src-alpha",r.parameters.blendColorDstFactor="one-minus-src-alpha",r.parameters.blendAlphaOperation="add",r.parameters.blendAlphaSrcFactor="one",r.parameters.blendAlphaDstFactor="one-minus-src-alpha",r.glParameters.blend=!0,r.glParameters.blendEquation=Bh.FUNC_ADD,r.glParameters.blendFunc=[Bh.SRC_ALPHA,Bh.ONE_MINUS_SRC_ALPHA,Bh.ONE,Bh.ONE_MINUS_SRC_ALPHA];break}}function Upe(t,e,r){e.baseColorTexture&&M1(t,e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP",r),r.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&M1(t,e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP",r);let{metallicFactor:i=1,roughnessFactor:n=1}=e;r.uniforms.u_MetallicRoughnessValues=[i,n]}function M1(t,e,r){var i;let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4?arguments[4]:void 0,s=(e==null||(i=e.texture)===null||i===void 0||(i=i.sampler)===null||i===void 0?void 0:i.parameters)||{},l=e.texture.source.image,c,h={};l.compressed?(c=l,h={[Bh.TEXTURE_MIN_FILTER]:l.data.length>1?Bh.LINEAR_MIPMAP_NEAREST:Bh.LINEAR}):c={data:l};let g=t.createTexture({id:e.uniformName||e.id,parameters:{...s,...h},pixelStore:{[Bh.UNPACK_FLIP_Y_WEBGL]:!1},...c});o.bindings[r]=g,n&&(o.defines[n]=1),o.generatedTextures.push(g)}var UH="4.1.0";var qE={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},VR;async function jR(t){let e=t.modules||{};return e.basis?e.basis:(VR=VR||zpe(t),await VR)}async function zpe(t){let e=null,r=null;return[e,r]=await Promise.all([await ph(qE.TRANSCODER,"textures",t),await ph(qE.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await Vpe(e,r)}function Vpe(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(i=>{t(r).then(n=>{let{BasisFile:o,initializeBasis:s}=n;s(),i({BasisFile:o})})})}var HR;async function GR(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(HR=HR||Hpe(t),await HR)}async function Hpe(t){let e=null,r=null;return[e,r]=await Promise.all([await ph(qE.ENCODER,"textures",t),await ph(qE.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await jpe(e,r)}function jpe(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(i=>{t(r).then(n=>{let{BasisFile:o,KTX2File:s,initializeBasis:l,BasisEncoder:c}=n;l(),i({BasisFile:o,KTX2File:s,BasisEncoder:c})})})}var Lm={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var Gpe=["","WEBKIT_","MOZ_"],zH={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},XE=null;function VH(t){if(!XE){t=t||Wpe()||void 0,XE=new Set;for(let e of Gpe)for(let r in zH)if(t&&t.getExtension(`${e}${r}`)){let i=zH[r];XE.add(i)}}return XE}function Wpe(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var itt=new Uint8Array([0]);var HH,jH,GH,WH,qH,XH,YH,KH;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(HH||(HH={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(jH||(jH={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(GH||(GH={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(WH||(WH={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(qH||(qH={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(XH||(XH={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(YH||(YH={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(KH||(KH={}));var uc=[171,75,84,88,32,50,48,187,13,10,26,10];function ZH(t){let e=new Uint8Array(t);return!(e.byteLength<uc.length||e[0]!==uc[0]||e[1]!==uc[1]||e[2]!==uc[2]||e[3]!==uc[3]||e[4]!==uc[4]||e[5]!==uc[5]||e[6]!==uc[6]||e[7]!==uc[7]||e[8]!==uc[8]||e[9]!==uc[9]||e[10]!==uc[10]||e[11]!==uc[11])}var qpe={etc1:{basisFormat:0,compressed:!0,format:Lm.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Lm.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Lm.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Lm.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Lm.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Lm.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function qR(t,e){if(e.basis.containerFormat==="auto"){if(ZH(t)){let i=await GR(e);return JH(i.KTX2File,t,e)}let{BasisFile:r}=await jR(e);return WR(r,t,e)}switch(e.basis.module){case"encoder":let r=await GR(e);switch(e.basis.containerFormat){case"ktx2":return JH(r.KTX2File,t,e);case"basis":default:return WR(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:i}=await jR(e);return WR(i,t,e)}}function WR(t,e,r){let i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let n=i.getNumImages(),o=[];for(let s=0;s<n;s++){let l=i.getNumLevels(s),c=[];for(let h=0;h<l;h++)c.push(Xpe(i,s,h,r));o.push(c)}return o}finally{i.close(),i.delete()}}function Xpe(t,e,r,i){let n=t.getImageWidth(e,r),o=t.getImageHeight(e,r),s=t.getHasAlpha(),{compressed:l,format:c,basisFormat:h}=QH(i,s),g=t.getImageTranscodedSizeInBytes(e,r,h),b=new Uint8Array(g);if(!t.transcodeImage(b,e,r,h,0,0))throw new Error("failed to start Basis transcoding");return{width:n,height:o,data:b,compressed:l,format:c,hasAlpha:s}}function JH(t,e,r){let i=new t(new Uint8Array(e));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let n=i.getLevels(),o=[];for(let s=0;s<n;s++){o.push(Ype(i,s,r));break}return[o]}finally{i.close(),i.delete()}}function Ype(t,e,r){let{alphaFlag:i,height:n,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:l,basisFormat:c}=QH(r,i),h=t.getImageTranscodedSizeInBytes(e,0,0,c),g=new Uint8Array(h);if(!t.transcodeImage(g,e,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:n,data:g,compressed:s,levelSize:h,hasAlpha:i,format:l}}function QH(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=YE()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),qpe[r]}function YE(){let t=VH();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var $H={name:"Basis",id:"basis",module:"textures",version:UH,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},XR={...$H,parse:qR};var Kpe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zpe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},KR=class{constructor(e){this.name=void 0,this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;let i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(n=>{let{sampler:o,target:s,path:l}=n;rAe(i,o,s,l),Qpe(s,s._node)})}},KE=class{constructor(e){this.animations=void 0,this.animations=e.animations.map((r,i)=>{let n=r.name||`Animation-${i}`,o=r.samplers.map(l=>{let{input:c,interpolation:h="LINEAR",output:g}=l;return{input:ej(e.accessors[c]),interpolation:h,output:ej(e.accessors[g])}}),s=r.channels.map(l=>{let{sampler:c,target:h}=l;return{sampler:o[c],target:e.nodes[h.node],path:h.path}});return new KR({name:n,channels:s})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(r=>r.animate(e))}getAnimations(){return this.animations}};function ej(t){if(!t._animation){let e=Zpe[t.componentType],r=Kpe[t.type],i=r*t.count,{buffer:n,byteOffset:o}=t.bufferView.data,s=new e(n,o+(t.byteOffset||0),i);if(r===1)t._animation=Array.from(s);else{let l=[];for(let c=0;c<s.length;c+=r)l.push(Array.from(s.slice(c,c+r)));t._animation=l}}return t._animation}var Jpe=new ni;function Qpe(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){let r=Jpe.fromQuaternion(t.rotation);e.matrix.multiplyRight(r)}t.scale&&e.matrix.scale(t.scale)}var YR=new Hc;function $pe(t,e,r,i,n){if(e==="rotation"){YR.slerp({start:r,target:i,ratio:n});for(let o=0;o<YR.length;o++)t[e][o]=YR[o]}else for(let o=0;o<r.length;o++)t[e][o]=n*i[o]+(1-n)*r[o]}function eAe(t,e,r){let{p0:i,outTangent0:n,inTangent1:o,p1:s,tDiff:l,ratio:c}=r;for(let h=0;h<t[e].length;h++){let g=n[h]*l,b=o[h]*l;t[e][h]=(2*Math.pow(c,3)-3*Math.pow(c,2)+1)*i[h]+(Math.pow(c,3)-2*Math.pow(c,2)+c)*g+(-2*Math.pow(c,3)+3*Math.pow(c,2))*s[h]+(Math.pow(c,3)-Math.pow(c,2))*b}}function tAe(t,e,r){for(let i=0;i<r.length;i++)t[e][i]=r[i]}function rAe(t,e,r,i){let{input:n,interpolation:o,output:s}=e,l=n[n.length-1],c=t%l,h=n.findIndex(C=>C>=c),g=Math.max(0,h-1);if(!Array.isArray(r[i]))switch(i){case"translation":r[i]=[0,0,0];break;case"rotation":r[i]=[0,0,0,1];break;case"scale":r[i]=[1,1,1];break;default:gr.warn(`Bad animation path ${i}`)()}_i(r[i].length===s[g].length);let b=n[g],T=n[h];switch(o){case"STEP":tAe(r,i,s[g]);break;case"LINEAR":if(T>b){let C=(c-b)/(T-b);$pe(r,i,s[g],s[h],C)}break;case"CUBICSPLINE":if(T>b){let C=(c-b)/(T-b),P=T-b,H=s[3*g+1],U=s[3*g+2],J=s[3*h+0],ee=s[3*h+1];eAe(r,i,{p0:H,outTangent0:U,inTangent1:J,p1:ee,tDiff:P,ratio:C})}break;default:gr.warn(`Interpolation ${o} not supported`)();break}}var iAe=`
|
|
4299
4299
|
#pragma vscode_glsllint_stage: vert
|
|
4300
4300
|
#if (__VERSION__ < 300)
|
|
4301
4301
|
#define _attr attribute
|
|
@@ -4649,7 +4649,7 @@ out vec2 clip_commonPosition;
|
|
|
4649
4649
|
in vec2 clip_commonPosition;
|
|
4650
4650
|
`,"fs:DECKGL_FILTER_COLOR":`
|
|
4651
4651
|
if (!clip_isInBounds(clip_commonPosition)) discard;
|
|
4652
|
-
`},HS=class extends um{getShaders(){let e="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=Boolean(this.props.clipByInstance)),this.state.clipByInstance=e,e?{modules:[x_e],inject:b_e}:{modules:[w_e],inject:T_e}}draw({uniforms:e}){let{clipBounds:r}=this.props;if(this.state.clipByInstance)e.clip_bounds=r;else{let i=this.projectPosition([r[0],r[1],0]),n=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[0],n[0]),Math.max(i[1],n[1])]}}},O_=HS;(()=>{HS.defaultProps=v_e})(),(()=>{HS.extensionName="ClipExtension"})();function fO(t,e,r){let i=E_e(t),n=Object.keys(i).filter(o=>i[o]!==Array);return S_e(t,{propArrayTypes:i,...e},{numericPropKeys:r&&r.numericPropKeys||n,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function E_e(t){let e={};for(let r of t)if(r.properties)for(let i in r.properties){let n=r.properties[i];e[i]=B_e(n,e[i])}return e}function S_e(t,e,r){let{pointPositionsCount:i,pointFeaturesCount:n,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:l,polygonPositionsCount:c,polygonObjectsCount:h,polygonRingsCount:g,polygonFeaturesCount:b,propArrayTypes:T,coordLength:C}=e,{numericPropKeys:P=[],PositionDataType:H=Float32Array,triangulate:U=!0}=r,J=t[0]&&"id"in t[0],ee=t.length>65535?Uint32Array:Uint16Array,ne={type:"Point",positions:new H(i*C),globalFeatureIds:new ee(i),featureIds:n>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},oe={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new H(o*C),globalFeatureIds:new ee(o),featureIds:l>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},k={type:"Polygon",polygonIndices:c>65535?new Uint32Array(h+1):new Uint16Array(h+1),primitivePolygonIndices:c>65535?new Uint32Array(g+1):new Uint16Array(g+1),positions:new H(c*C),globalFeatureIds:new ee(c),featureIds:b>65535?new Uint32Array(c):new Uint16Array(c),numericProps:{},properties:[],fields:[]};U&&(k.triangles=[]);for(let Y of[ne,oe,k])for(let X of P){let B=T[X];Y.numericProps[X]=new B(Y.positions.length/C)}oe.pathIndices[s]=o,k.polygonIndices[h]=c,k.primitivePolygonIndices[g]=c;let Ie={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let Y of t){let X=Y.geometry,B=Y.properties||{};switch(X.type){case"Point":C_e(X,ne,Ie,C,B),ne.properties.push(cO(B,P)),J&&ne.fields.push({id:Y.id}),Ie.pointFeature++;break;case"LineString":M_e(X,oe,Ie,C,B),oe.properties.push(cO(B,P)),J&&oe.fields.push({id:Y.id}),Ie.lineFeature++;break;case"Polygon":I_e(X,k,Ie,C,B),k.properties.push(cO(B,P)),J&&k.fields.push({id:Y.id}),Ie.polygonFeature++;break;default:throw new Error("Invalid geometry type")}Ie.feature++}return R_e(ne,oe,k,C)}function C_e(t,e,r,i,n){e.positions.set(t.data,r.pointPosition*i);let o=t.data.length/i;hO(e,n,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function M_e(t,e,r,i,n){e.positions.set(t.data,r.linePosition*i);let o=t.data.length/i;hO(e,n,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,l=t.indices.length;s<l;++s){let c=t.indices[s],h=s===l-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(h-c)/i}}function I_e(t,e,r,i,n){e.positions.set(t.data,r.polygonPosition*i);let o=t.data.length/i;hO(e,n,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,l=t.indices.length;s<l;++s){let c=r.polygonPosition;e.polygonIndices[r.polygonObject++]=c;let h=t.areas[s],g=t.indices[s],b=t.indices[s+1];for(let C=0,P=g.length;C<P;++C){let H=g[C],U=C===P-1?b===void 0?t.data.length:b[0]:g[C+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(U-H)/i}let T=r.polygonPosition;P_e(e,h,g,{startPosition:c,endPosition:T,coordLength:i})}}function P_e(t,e,r,i){let{startPosition:n,endPosition:o,coordLength:s}=i;if(!t.triangles)return;let l=n*s,c=o*s,h=t.positions.subarray(l,c),g=r[0],b=r.slice(1).map(C=>(C-g)/s),T=O3(h,b,s,e);for(let C=0,P=T.length;C<P;++C)t.triangles.push(n+T[C])}function uO(t,e){let r={};for(let i in t)r[i]={value:t[i],size:e};return r}function R_e(t,e,r,i){let n={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:uO(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:uO(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:i},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:uO(r.numericProps,1)}};return n.polygons&&r.triangles&&(n.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),n}function hO(t,e,r,i){for(let n in t.numericProps)if(n in e){let o=e[n];t.numericProps[n].fill(o,r,r+i)}}function cO(t,e){let r={};for(let i in t)e.includes(i)||(r[i]=t[i]);return r}function B_e(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function WS(t,e){let r=e?.globalFeatureId;return r!==void 0?O_e(t,r):D_e(t,e?.type)}function O_e(t,e){let r=A7(t);for(let i of r){let n=0,o=i.featureIds.value[0];for(let s=0;s<i.featureIds.value.length;s++){let l=i.featureIds.value[s];if(l!==o){if(e===i.globalFeatureIds.value[n])return jS(i,n,s);n=s,o=l}}if(e===i.globalFeatureIds.value[n])return jS(i,n,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function D_e(t,e){let r=A7(t,e);return L_e(r)}function p7(t,e,r){switch(t.type){case"Point":return U_e(t,e,r);case"LineString":return k_e(t,e,r);case"Polygon":return m7(t,e,r);default:let i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function A7(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function L_e(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let i=0,n=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==n&&(e.push(jS(r,i,o)),i=o,n=s)}e.push(jS(r,i,r.featureIds.value.length))}return e}function jS(t,e,r){let i=p7(t,e,r),n=N_e(t,e,r),o=F_e(t,e,r);return{type:"Feature",geometry:i,properties:n,...o}}function F_e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function N_e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=Object.assign({},t.properties[t.featureIds.value[e]]);for(let n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}function m7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.polygonIndices.value.filter(c=>c>=e&&c<=r),o=t.primitivePolygonIndices.value.filter(c=>c>=e&&c<=r);if(!(n.length>2)){let c=[];for(let h=0;h<o.length-1;h++){let g=o[h],b=o[h+1],T=GS(i,g,b);c.push(T)}return{type:"Polygon",coordinates:c}}let l=[];for(let c=0;c<n.length-1;c++){let h=n[c],g=n[c+1],b=m7(t,h,g).coordinates;l.push(b)}return{type:"MultiPolygon",coordinates:l}}function k_e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.pathIndices.value.filter(l=>l>=e&&l<=r);if(!(n.length>2))return{type:"LineString",coordinates:GS(i,n[0],n[1])};let s=[];for(let l=0;l<n.length-1;l++){let c=GS(i,n[l],n[l+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}function U_e(t,e,r){let{positions:i}=t,n=GS(i,e,r);return n.length>1?{type:"MultiPoint",coordinates:n}:{type:"Point",coordinates:n[0]}}function GS(t,e,r){e=e||0,r=r||t.value.length/t.size;let i=[];for(let n=e;n<r;n++){let o=Array();for(let s=n*t.size;s<(n+1)*t.size;s++)o.push(Number(t.value[s]));i.push(o)}return i}var yO=Xl(w7(),1);function T7(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let o=0;o<e;o++){let s=iye(t[o]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&r.push(i),r}function iye(t){let e=0;for(let r=0,i=t.length-1,n,o;r<t.length;i=r++)n=t[r],o=t[i],e+=(o[0]-n[0])*(n[1]+o[1]);return e}function E7(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?nye(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function nye(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var Ym=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,i,n,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(E7,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=[],c;for(;e.pos<r;){if(n<=0){let h=e.readVarint();i=h&7,n=h>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(c&&l.push(c),c=[]),c&&c.push([o,s]);else if(i===7)c&&c.push(c[0].slice());else throw new Error(`unknown command ${i}`)}return c&&l.push(c),l}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=1/0,c=-1/0,h=1/0,g=-1/0;for(;e.pos<r;){if(n<=0){let b=e.readVarint();i=b&7,n=b>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<l&&(l=o),o>c&&(c=o),s<h&&(h=s),s>g&&(g=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[l,h,c,g]}_toGeoJSON(e){let r=this.loadGeometry(),i=Ym.types[this.type],n,o;switch(this.type){case 1:let l=[];for(n=0;n<r.length;n++)l[n]=r[n][0];r=l,e(r,this);break;case 2:for(n=0;n<r.length;n++)e(r[n],this);break;case 3:for(r=T7(r),n=0;n<r.length;n++)for(o=0;o<r[n].length;o++)e(r[n][o],this);break}r.length===1?r=r[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;function c(h){for(let g=0;g<h.length;g++){let b=h[g];b[0]=(b[0]+s)*360/o-180;let T=180-(b[1]+l)*360/o;b[1]=360/Math.PI*Math.atan(Math.exp(T*Math.PI/180))-90}}return this._toGeoJSON(c)}};var X1=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(oye,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new Ym(this._pbf,r,this.extent,this._keys,this._values)}};function oye(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(sye(r)))}function sye(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Y1=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(aye,{},r)}};function aye(t,e,r){if(t===3&&r){let i=new X1(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function S7(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[Pp(t.data)]],indices:[t.indices]};let i=[],n=[],o=[],s=[],l,c=0;for(let h,g=0,b;g<e;g++){b=t.indices[g]-c,h=t.indices[g+1]-c||t.data.length;let T=t.data.slice(b,h),C=Pp(T);if(C===0){let P=t.data.slice(0,b),H=t.data.slice(h);t.data=P.concat(H),c+=h-b;continue}l===void 0&&(l=C<0),l===C<0?(s.length&&(i.push(o),n.push(s)),s=[b],o=[C]):(o.push(C),s.push(b))}return o&&i.push(o),s.length&&n.push(s),{type:r,areas:i,indices:n,data:t.data}}function C7(t,e,r,i){for(let n=0,o=t.length;n<o;n+=2){t[n]=(t[n]+e)*360/i-180;let s=180-(t[n+1]+r)*360/i;t[n+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function M7(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?lye(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function lye(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var I7,Km,AO,YS,mO,gO,K1;var Z1=class{constructor(e,r,i,n,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,this._geometryInfo=s,e.readFields(M7,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,I7=e.readVarint()+e.pos,Km=1,YS=0,mO=0,gO=0,K1=0;let r=[],i=[];for(;e.pos<I7;)if(YS<=0&&(AO=e.readVarint(),Km=AO&7,YS=AO>>3),YS--,Km===1||Km===2)mO+=e.readSVarint(),gO+=e.readSVarint(),Km===1&&r.push(K1),i.push(mO,gO),K1+=2;else if(Km===7){if(K1>0){let n=r[r.length-1];i.push(i[n],i[n+1]),K1+=2}}else throw new Error(`unknown command ${Km}`);return{data:i,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),i;e(r.data,this);let n=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,i={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/n,i={type:"LineString",...r};break;case 3:i=S7(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/n;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;return this._toBinaryCoordinates(c=>C7(c,s,l,o))}};var J1=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(uye,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new Z1(this._pbf,i,this.extent,this._keys,this._values,r)}};function uye(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(cye(r)))}function cye(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Q1=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(fye,{},r)}};function fye(t,e,r){if(t===3&&r){let i=new J1(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function KS(t,e){var r,i;let n=dye(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(i=e.mvt)===null||i===void 0?void 0:i.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:_O(t,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:P7(t,n)};case"geojson":return P7(t,n);case"binary-geometry":return _O(t,n);case"binary":return _O(t,n);default:throw new Error(o||"undefined shape")}}function _O(t,e){let[r,i]=hye(t,e),n=fO(r,i);return n.byteLength=t.byteLength,n}function hye(t,e){let r=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,i];let n=new Q1(new yO.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(s=>{let l=n.layers[s];if(l)for(let c=0;c<l.length;c++){let h=l.feature(c,i),g=Aye(h,e,s);r.push(g)}}),[r,i]}function P7(t,e){if(t.byteLength<=0)return[];let r=[],i=new Y1(new yO.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let l=0;l<s.length;l++){let c=s.feature(l),h=pye(c,e,o);r.push(h)}}),r}function dye(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:i}=t.mvt,n=i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z);if(r&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function pye(t,e,r){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:mye);return e.layerProperty&&(i.properties[e.layerProperty]=r),i}function Aye(t,e,r){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:gye);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=r),i}function mye(t,e){let{extent:r}=e;for(let i=0;i<t.length;i++){let n=t[i];n[0]/=r,n[1]/=r}}function gye(t,e){let{extent:r}=e;for(let i=0,n=t.length;i<n;++i)t[i]/=r}var _ye="4.1.0",ZS={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:_ye,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},yye={...ZS,parse:async(t,e)=>KS(t,e),parseSync:KS,binary:!0};var vye={Point:R7,MultiPoint:xye,LineString:B7,MultiLineString:bye,Polygon:O7,MultiPolygon:wye};function R7([t,e],[r,i],n){let o=$a(r[0],i[0],t),s=$a(r[1],i[1],e);return n.unprojectFlat([o,s])}function vO(t,e,r){return t.map(i=>R7(i,e,r))}function xye(t,e,r){return vO(t,e,r)}function B7(t,e,r){return vO(t,e,r)}function bye(t,e,r){return t.map(i=>B7(i,e,r))}function O7(t,e,r){return t.map(i=>vO(i,e,r))}function wye(t,e,r){return t.map(i=>O7(i,e,r))}function D7(t,e,r){let i=r.projectFlat([e.west,e.north]),n=r.projectFlat([e.east,e.south]),o=[i,n];return{...t,coordinates:vye[t.type](t.coordinates,o,r)}}var Tye=["points","lines","polygons"];function xO(t,e,r,i){for(let n of Tye){let o=t[n]&&Eye(t[n],e,r,i);if(o>=0)return o}return-1}function Eye(t,e,r,i){let n=t.featureIds.value;if(!n.length)return-1;let o=0,s=n[n.length-1]+1;if(i){let c=Sye(t,i);if(c)o=c[0],s=c[1]+1;else return-1}let l=-1;if(e in t.numericProps){let c=t.numericProps[e].value.findIndex((h,g)=>h===r&&n[g]>=o&&n[g]<s);return c>=0?t.globalFeatureIds.value[c]:-1}else e?l=L7(t.properties,c=>c[e]===r,o,s):t.fields&&(l=L7(t.fields,c=>c.id===r,o,s));return l>=0?Cye(t,l):-1}function Sye(t,e){if(!t.__layers){let r={},{properties:i}=t;for(let n=0;n<i.length;n++){let{layerName:o}=i[n];o&&(r[o]?r[o][1]=n:r[o]=[n,n])}t.__layers=r}return t.__layers[e]}function Cye(t,e){if(!t.__ids){let r=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let o=0;o<i.length;o++)r[i[o]]=n[o];t.__ids=r}return t.__ids[e]}function L7(t,e,r,i){for(let n=r;n<i;n++)if(e(t[n],n))return n;return-1}var bO=512,Mye={...Ch.defaultProps,data:Vp,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[ZS],binary:!0},JS=class extends Ph{initializeState(){super.initializeState();let e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:r,context:i,changeFlags:n}){n.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:i,changeFlags:n}),this._setWGS84PropertyForTiles());let{highlightColor:o}=e;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,r=null;if(typeof e=="string"&&!DR(e)){let{onDataLoad:i,fetch:n}=this.props;this.setState({data:null,tileJSON:null});try{r=await n(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}i&&i(r,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(r=e);r&&(e=r.tiles),this.setState({data:e,tileJSON:r})}_getTilesetOptions(){let e=super._getTilesetOptions(),r=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>i&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(n)||r.maxzoom<n)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:i}=this.state,{index:n,signal:o}=e,s=Ih(r,e);if(!s)return Promise.reject("Invalid URL");let l=this.getLoadOptions(),{fetch:c}=this.props;return l={...l,mimeType:"application/x-protobuf",mvt:{...l?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:n},gis:i?{format:"binary"}:{}},c(s,{propName:"data",layer:this,loadOptions:l,signal:o})}renderSubLayers(e){let{x:r,y:i,z:n}=e.tile.index,o=Math.pow(2,n),s=bO/o,l=-s,c=bO*r/o,h=bO*(1-i/o),g=new ni().scale([s,l,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=g,e.coordinateOrigin=[c,h,0],e.coordinateSystem=oi.CARTESIAN,e.extensions=[...e.extensions||[],new O_]);let b=super.renderSubLayers(e);return this.state.binary&&!(b instanceof Ch)&&vr.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),b}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,o=e.object,s=null,l=null;o&&(s=wO(o,r),l=F7(o));let{highlightColor:c}=this.props;typeof c=="function"&&(c=c(e)),(i!==s||n!==l)&&this.setState({highlightColor:c,hoveredFeatureId:s,hoveredFeatureLayerName:l})}getPickingInfo(e){let r=super.getPickingInfo(e),i=Boolean(this.context.viewport.resolution);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=WS(n,{globalFeatureId:r.index})}return r.object&&!i&&(r.object=k7(r.object,r.tile.bbox,this.context.viewport)),r}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:r,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,l=e.content,c=N7(s);if(!(N7(r)||c))return-1;let g=c?s:r;return Array.isArray(l)?l.findIndex(b=>{let T=wO(b,o)===g,C=c||F7(b)===i;return T&&C}):l&&n?xO(l,o,g,c?"":i):-1}_pickObjects(e){let{deck:r,viewport:i}=this.context,n=i.width,o=i.height,s=i.x,l=i.y,c=[this.id];return r.pickObjects({x:s,y:l,width:n,height:o,layerIds:c,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),i=new Set,n=[];for(let o of r){let s=wO(o.object,this.props.uniqueIdProperty);s===void 0?n.push(o.object):i.has(s)||(i.add(s),n.push(o.object))}return n}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(i=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>{if(!i.content)return null;if(this.state.binary&&Array.isArray(i.content)&&!i.content.length)return[];let{bbox:n}=i;if(i._contentWGS84===void 0&&LR(n)){let o=this.state.binary?WS(i.content):i.content;i._contentWGS84=o.map(s=>k7(s,n,this.context.viewport))}return i._contentWGS84}})})}},$1=JS;(()=>{JS.layerName="MVTLayer"})(),(()=>{JS.defaultProps=Mye})();function wO(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function F7(t){return t.properties?.layerName||null}function N7(t){return t!=null&&t!==""}function k7(t,e,r){let i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>D7(t.geometry,e,r).coordinates}),i}var U7="0123456789bcdefghjkmnpqrstuvwxyz",z7={};for(let t=0;t<U7.length;t++)z7[U7.charAt(t)]=t;var Iye=-90,Pye=90,Rye=-180,Bye=180;function Oye(t){let e=!0,r=Pye,i=Iye,n=Bye,o=Rye,s,l=0;for(let c=0,h=t.length;c<h;c++){let g=t[c].toLowerCase();l=z7[g];for(let b=4;b>=0;b--){let T=l>>b&1;e?(s=(n+o)/2,T===1?o=s:n=s):(s=(r+i)/2,T===1?i=s:r=s),e=!e}}return[i,o,r,n]}function V7(t){let[e,r,i,n]=Oye(t);return[n,i,n,e,r,e,r,i,n,i]}var Dye={getGeohash:{type:"accessor",value:t=>t.geohash}},QS=class extends lc{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(i,n)=>V7(r(i,n))}}},eb=QS;(()=>{QS.layerName="GeohashLayer"})(),(()=>{QS.defaultProps=Dye})();function F_(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function j7(t,e){let r=Fye(e),i=t;for(let n of r)i=Lye(i)?i[n]:void 0;return i}function Lye(t){return t!==null&&typeof t=="object"}var H7={};function Fye(t){if(typeof t=="string"){let e=H7[t];return e||(e=t.split("."),H7[t]=e),e}return Array.isArray(t)?t:[t]}var EO={};Js(EO,{addBinaryOp:()=>Vye,addUnaryOp:()=>zye,compile:()=>kye,compileAsync:()=>Uye,eval:()=>xl,evalAsync:()=>rb,parse:()=>Y7.default});var N_=Xl(TO()),Y7=Xl(TO()),rb=function t(e,r){try{var i,n=e;switch(n.type){case"ArrayExpression":return Promise.resolve(W7(n.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(C){return k_[n.operator](C[0],C[1])});case"CallExpression":var o,s,l,c=function(){if(typeof s=="function"){var C=s,P=C.apply,H=o;return Promise.resolve(W7(n.arguments,r)).then(function(U){return Promise.resolve(P.call(C,H,U))})}},h=n.callee.type==="MemberExpression"?Promise.resolve(G7(n.callee,r)).then(function(C){o=(l=C)[0],s=l[1]}):Promise.resolve(t(n.callee,r)).then(function(C){s=C});return Promise.resolve(h&&h.then?h.then(c):c());case"ConditionalExpression":return Promise.resolve(t(n.test,r)).then(function(C){return Promise.resolve(t(C?n.consequent:n.alternate,r))});case"Identifier":return Promise.resolve(r[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var g=function(C){return i?C:Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(P){return k_[n.operator](P[0],P[1])})},b=n.operator==="||"?(i=1,Promise.resolve(t(n.left,r)).then(function(C){return C||Promise.resolve(t(n.right,r))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(t(n.left,r)).then(function(C){return C&&Promise.resolve(t(n.right,r))})}();return Promise.resolve(b&&b.then?b.then(g):g(b));case"MemberExpression":return Promise.resolve(G7(n,r)).then(function(C){return C[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var T=eC[n.operator];return Promise.resolve(t(n.argument,r)).then(function(C){return T.call(eC,C)});default:return Promise.resolve(void 0)}}catch(C){return Promise.reject(C)}},G7=function(t,e){try{return Promise.resolve(rb(t.object,e)).then(function(r){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[r,r[n]]}var n,o=function(){if(t.computed)return Promise.resolve(rb(t.property,e)).then(function(s){n=s});n=t.property.name}();return o&&o.then?o.then(i):i()})}catch(r){return Promise.reject(r)}},W7=function(t,e){try{return Promise.resolve(Promise.all(t.map(function(r){return rb(r,e)})))}catch(r){return Promise.reject(r)}},Nye={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},k_={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},eC={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function q7(t,e){return t.map(function(r){return xl(r,e)})}function X7(t,e){var r,i=xl(t.object,e);if(r=t.computed?xl(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error('Access to member "'+r+'" disallowed.');return[i,i[r]]}function xl(t,e){var r=t;switch(r.type){case"ArrayExpression":return q7(r.elements,e);case"BinaryExpression":return k_[r.operator](xl(r.left,e),xl(r.right,e));case"CallExpression":var i,n,o;return r.callee.type==="MemberExpression"?(i=(o=X7(r.callee,e))[0],n=o[1]):n=xl(r.callee,e),typeof n!="function"?void 0:n.apply(i,q7(r.arguments,e));case"ConditionalExpression":return xl(r.test,e)?xl(r.consequent,e):xl(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?xl(r.left,e)||xl(r.right,e):r.operator==="&&"?xl(r.left,e)&&xl(r.right,e):k_[r.operator](xl(r.left,e),xl(r.right,e));case"MemberExpression":return X7(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return eC[r.operator](xl(r.argument,e));default:return}}function kye(t){return xl.bind(null,(0,N_.default)(t))}function Uye(t){return rb.bind(null,(0,N_.default)(t))}function zye(t,e){N_.default.addUnaryOp(t),eC[t]=e}function Vye(t,e,r){r?(N_.default.addBinaryOp(t,e),k_[t]=r):(N_.default.addBinaryOp(t,Nye[t]||1),k_[t]=e)}var{parse:Hye,eval:jye}=EO,SO={"-":t=>t};function Zm(t,e){if(t in SO)return SO[t];let r,i=Hye(t);return i.type==="Identifier"?r=n=>j7(n,t):(CO(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>jye(i,n)),SO[t]=r,r}function CO(t,e){if(Array.isArray(t))t.forEach(r=>CO(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)CO(t[r],e)}}var U_="@@=",MO="@@#",K7="@@type",tC="@@function";var Z7=t=>t&&typeof t=="object",Xd=class{constructor(...e){this.typeKey=K7,this.functionKey=tC,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=Zm,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(let r of e)this.merge(r)}merge(e){for(let r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){let i=e[r];this[r]=Z7(this[r])?Object.assign(this[r],i):i}}}validate(e){return F_(!this.typeKey||typeof this.typeKey=="string"),F_(Z7(this.classes)),!0}};function Gye(t){return typeof t=="string"&&t.startsWith(U_)}function Wye(t){return t.replace(U_,"")}function z_(t,e){let r={};for(let i in t){let n=t[i];Gye(n)&&(n=Wye(n),n=Zm(n,e)),r[i]=n}return r}function J7(t,e,r){let i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){let{log:o}=r;if(o){let s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?qye(i,e,r):Xye(n,e,r)}function qye(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=z_(e,r),new t(e)}function Xye(t,e,r){let{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=z_(e,r),i.createElement(t,e,n)}function Q7(t,e,r){let i=r.functions[t];if(!i){let{log:n}=r;if(n){let o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function IO(t){return typeof t=="string"?JSON.parse(t):t}var PO=t=>t&&typeof t=="object",Jm=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Xd?e.configuration:new Xd(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let r=IO(e),i=Yye(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}};function Yye(t,e){return e=new Xd(e),RO(t,"",e)}function RO(t,e,r){return Array.isArray(t)?t.map((i,n)=>RO(i,String(n),r)):Kye(t,r)?Zye(t,r):PO(t)?tC in t?Jye(t,r):BO(t,r):typeof t=="string"?Qye(t,e,r):t}function Kye(t,e){let{typeKey:r}=e;return PO(t)&&Boolean(t[r])}function Zye(t,e){let{typeKey:r}=e,i=t[r],n={...t};return delete n[r],n=BO(n,e),J7(i,n,e)}function Jye(t,e){let{functionKey:r}=e,i=t[r],n={...t};return delete n[r],n=BO(n,e),Q7(i,n,e)}function BO(t,e){F_(PO(t));let r={};for(let i in t){let n=t[i];r[i]=RO(n,i,e)}return r}function Qye(t,e,r){if(t.startsWith(U_)&&r.convertFunction)return t=t.replace(U_,""),r.convertFunction(t,r);if(t.startsWith(MO)){if(t=t.replace(MO,""),r.constants[t])return r.constants[t];let[i,n]=t.split(".");return r.enumerations[i][n]}return t}var V_={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},Fh=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:i}){e&&(V_.onInitialize=e),r&&(V_.onFinalize=r),i&&(V_.onMessage=i)}constructor(e="Transport"){this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=e}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(e={}){let r={transport:this,...e};V_.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};V_.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),V_.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(i,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}r.add(n)}return n})}};function $7(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!(r in e)||t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}function OO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eW(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function DO(t,e,r){return e&&eW(t.prototype,e),r&&eW(t,r),t}var ys=Xl(lW());var wft=typeof window<"u"?window:global;var Qm=typeof document<"u"?document:{};function tve(){}function rve(t){t&&console.error(t.error)}var cW={container:ys.default.object,gl:ys.default.object,mapboxApiAccessToken:ys.default.string,mapboxApiUrl:ys.default.string,attributionControl:ys.default.bool,preserveDrawingBuffer:ys.default.bool,reuseMaps:ys.default.bool,transformRequest:ys.default.func,mapOptions:ys.default.object,mapStyle:ys.default.oneOfType([ys.default.string,ys.default.object]),visible:ys.default.bool,asyncRender:ys.default.bool,onLoad:ys.default.func,onError:ys.default.func,width:ys.default.number,height:ys.default.number,viewState:ys.default.object,longitude:ys.default.number,latitude:ys.default.number,zoom:ys.default.number,bearing:ys.default.number,pitch:ys.default.number,altitude:ys.default.number},rC={container:Qm.body,mapboxApiAccessToken:ive(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:tve,onError:rve,width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function ive(){var t=null;if(typeof window<"u"&&window.location){var e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}return!t&&typeof process<"u"&&(t=t||process.env.MapboxAccessToken||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN),t||"no-token"}function uW(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"component";t.debug&&ys.default.checkPropTypes(cW,t,"prop",e)}var H_=function(){function t(e){var r=this;if(OO(this,t),Di(this,"mapboxgl",void 0),Di(this,"props",rC),Di(this,"_map",null),Di(this,"width",0),Di(this,"height",0),Di(this,"_fireLoadEvent",function(){r.props.onLoad({type:"load",target:r._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return DO(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(r){return this._update(this.props,r),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var r=this._map;r.style&&(r._frame&&(r._frame.cancel(),r._frame=null),r._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(r){this._map=t.savedMap;var i=this._map.getContainer(),n=r.container;for(n.classList.add("mapboxgl-map");i.childNodes.length>0;)n.appendChild(i.childNodes[0]);this._map._container=n,t.savedMap=null,r.mapStyle&&this._map.setStyle(r.mapStyle,{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(r){if(r.reuseMaps&&t.savedMap)this._reuse(r);else{if(r.gl){var i=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=i,r.gl}}var n={container:r.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:r.mapStyle,interactive:!1,trackResize:!1,attributionControl:r.attributionControl,preserveDrawingBuffer:r.preserveDrawingBuffer};r.transformRequest&&(n.transformRequest=r.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},n,r.mapOptions)),this._map.once("load",r.onLoad),this._map.on("error",r.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():(t.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(r){var i=this;r=Object.assign({},rC,r),uW(r,"Mapbox"),this.mapboxgl.accessToken=r.mapboxApiAccessToken||rC.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=r.mapboxApiUrl,this._create(r);var n=r,o=n.container;Object.defineProperty(o,"offsetWidth",{get:function(){return i.width}}),Object.defineProperty(o,"clientWidth",{get:function(){return i.width}}),Object.defineProperty(o,"offsetHeight",{get:function(){return i.height}}),Object.defineProperty(o,"clientHeight",{get:function(){return i.height}});var s=this._map.getCanvas();s&&(s.style.outline="none"),this._updateMapViewport({},r),this._updateMapSize({},r),this.props=r}},{key:"_update",value:function(r,i){if(this._map){i=Object.assign({},this.props,i),uW(i,"Mapbox");var n=this._updateMapViewport(r,i),o=this._updateMapSize(r,i);!i.asyncRender&&(n||o)&&this.redraw(),this.props=i}}},{key:"_updateMapSize",value:function(r,i){var n=r.width!==i.width||r.height!==i.height;return n&&(this.width=i.width,this.height=i.height,this.resize()),n}},{key:"_updateMapViewport",value:function(r,i){var n=this._getViewState(r),o=this._getViewState(i),s=o.latitude!==n.latitude||o.longitude!==n.longitude||o.zoom!==n.zoom||o.pitch!==n.pitch||o.bearing!==n.bearing||o.altitude!==n.altitude;return s&&(this._map.jumpTo(this._viewStateToMapboxProps(o)),o.altitude!==n.altitude&&(this._map.transform.altitude=o.altitude)),s}},{key:"_getViewState",value:function(r){var i=r.viewState||r,n=i.longitude,o=i.latitude,s=i.zoom,l=i.pitch,c=l===void 0?0:l,h=i.bearing,g=h===void 0?0:h,b=i.altitude,T=b===void 0?1.5:b;return{longitude:n,latitude:o,zoom:s,pitch:c,bearing:g,altitude:T}}},{key:"_checkStyleSheet",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"0.47.0";if(!(typeof Qm>"u"))try{var i=Qm.createElement("div");i.className="mapboxgl-map",i.style.display="none",Qm.body.append(i);var n=window.getComputedStyle(i).position!=="static";if(!n){var o=Qm.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(r,"/mapbox-gl.css")),Qm.head.append(o)}}catch{}}},{key:"_viewStateToMapboxProps",value:function(r){return{center:[r.longitude,r.latitude],zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}}}]),t}();Di(H_,"initialized",!1);Di(H_,"propTypes",cW);Di(H_,"defaultProps",rC);Di(H_,"savedMap",null);var fW={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function nve(t){let{container:e=document.body}=t;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=document.createElement("div");e.appendChild(i),Object.assign(i.style,fW);let n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,fW),{container:e,mapCanvas:i,deckCanvas:n}}var $m=class extends Rd{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:i}=nve(e),n=e.viewState||e.initialViewState,o=Number.isFinite(n&&n.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:i,...e}),s&&s.Map?this._map=o&&new H_({...e,viewState:n,container:r,mapboxgl:s}):this._map=s}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map._map.setStyle(e.mapStyle),super.setProps(e)}_drawLayers(e,r){if(this._map){let i=this.getViewports()[0];i&&this._map.setProps({width:i.width,height:i.height,viewState:i})}super._drawLayers(e,r)}};Kl.registerDevices([Qo]);var hW=t=>t.charAt(0)===t.charAt(0).toUpperCase(),ove=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function LO(t={},e){let r={},i=Object.keys(t).filter(e);for(let n of i)r[n]=t[n];return r}var sve={classes:LO(ib,hW),enumerations:{COORDINATE_SYSTEM:oi,GL:Ct}};TA([zy]);var Xp=new Jm({configuration:sve});function ave(t,e){let r={classes:LO(t,hW),functions:LO(t,ove)};e.mergeConfiguration(r)}function lve(t,e){if(!t)return;let r={};function i(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function n(o,s){ave(s,Xp),r[o]=s,i()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){n(o,window[o]);return}Object.defineProperty(window,o,{set:l=>n(o,l),get:()=>r[o]}),gk(s)})}function dW(t,e){let r=Xp.convert(t);e.setProps(r)}function uve(t,e){return t.filter(r=>r&&r.id&&!e.find(i=>i.id===r.id))}function cve({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:i,handleEvent:n,getTooltip:o,container:s}){let c={...n?{onClick:h=>n("deck-click-event",h),onHover:h=>n("deck-hover-event",h),onResize:h=>n("deck-resize-event",h),onViewStateChange:({viewState:h,interactionState:g,oldViewState:b})=>{let T=new Uu(h);h.nw=T.unproject([0,0]),h.se=T.unproject([T.width,T.height]),n("deck-view-state-change-event",h)},onDragStart:h=>n("deck-drag-start-event",h),onDrag:h=>n("deck-drag-event",h),onDragEnd:h=>n("deck-drag-end-event",h)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return vr.info("Using Mapbox base maps")(),new $m({...c,...e,map:rI,mapboxApiAccessToken:r,onLoad:mk});case"carto":return vr.info("Using Carto base maps")(),new $m({map:rI,...c,...e});case"google_maps":return vr.info("Using Google Maps base maps")(),Zz({...c,...e,googleMapsKey:i});default:return vr.info("No recognized map provider specified")(),new $m({...c,...e,map:null,mapboxApiAccessToken:null})}}function iC({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:i,tooltip:n,handleEvent:o,customLibraries:s,configuration:l}){let c;try{l&&Xp.mergeConfiguration(l);let h=i.layers||[],g=Xp.convert(i);P3(r,g);let b=(g.layers||[]).filter(U=>U),T=uve(h,b),C=$M(n),{mapProvider:P}=g;c=cve({mapProvider:P,props:g,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:C,container:r}),lve(s,()=>{if(T.length){let J=(Xp.convert({layers:i.layers}).layers||[]).filter(ee=>ee);J.length>b.length&&c.setProps({layers:J})}})}catch(h){console.error(h)}return c}function nC(){Fh.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:i,mapboxApiKey:n,jsonInput:o,tooltip:s}=pve(t);Ak();let l=t.getRootDOMElement(),c=hk(e,r);l.appendChild(c);let h=JSON.parse(o),g=iC({mapboxApiKey:n,container:c,jsonInput:h,tooltip:s,handleEvent:(b,T)=>dve(t,b,T),customLibraries:i});t.userData.deck=g},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:i}){let{deck:n}=t.userData,o;switch(e){case"json":o=Xp.convert(r),n.setProps(o);break;case"json-with-binary":o=Xp.convert(r);let s=t.jupyterModel.get("data_buffer"),l=fve({binary:s,convertedJson:o});n.setProps(l);break;default:}}})}function fve({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let i=e.layers[r].id,n=e.layers[r];e.layers[r]=n.clone({data:t[i]})}return e}function hve(t,e){return e instanceof Kn?e.id:e}function dve(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let i=JSON.parse(JSON.stringify(r,hve));t.sendJSONMessage(e,i)}function pve(t){let{jupyterModel:e}=t;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}var eg=class extends Fh{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let i=Fh._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(i)}};var bb={};Js(bb,{CONTROL_COMM_PROTOCOL_VERSION:()=>tK,CONTROL_COMM_TARGET:()=>eK,CONTROL_COMM_TIMEOUT:()=>rK,DOMWidgetModel:()=>GD,DOMWidgetView:()=>WD,IJupyterWidgetRegistry:()=>OTe,JUPYTER_WIDGETS_VERSION:()=>AC,JupyterPhosphorPanelWidget:()=>ETe,JupyterPhosphorWidget:()=>LK,LayoutModel:()=>STe,LayoutView:()=>CTe,ManagerBase:()=>nTe,PROTOCOL_VERSION:()=>mC,StyleModel:()=>MTe,StyleView:()=>ITe,ViewList:()=>BTe,WidgetModel:()=>cg,WidgetView:()=>uy,WrappedError:()=>tTe,assign:()=>Yd,base64ToBuffer:()=>aD,bufferToBase64:()=>sD,bufferToHex:()=>iTe,difference:()=>pC,hexToBuffer:()=>oD,isEqual:()=>Q_,put_buffers:()=>Yp,reject:()=>Uh,remove_buffers:()=>db,resolvePromisesDict:()=>$_,serialize_state:()=>iK,shims:()=>qD,unpack_models:()=>xb,uuid:()=>hb});var dC=Xl(mW());var gW;(function(t){t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]);function e(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"}t.isPrimitive=e;function r(g){return Array.isArray(g)}t.isArray=r;function i(g){return!e(g)&&!r(g)}t.isObject=i;function n(g,b){if(g===b)return!0;if(e(g)||e(b))return!1;var T=r(g),C=r(b);return T!==C?!1:T&&C?s(g,b):l(g,b)}t.deepEqual=n;function o(g){return e(g)?g:r(g)?c(g):h(g)}t.deepCopy=o;function s(g,b){if(g===b)return!0;if(g.length!==b.length)return!1;for(var T=0,C=g.length;T<C;++T)if(!n(g[T],b[T]))return!1;return!0}function l(g,b){if(g===b)return!0;for(var T in g)if(g[T]!==void 0&&!(T in b))return!1;for(var T in b)if(b[T]!==void 0&&!(T in g))return!1;for(var T in g){var C=g[T],P=b[T];if(!(C===void 0&&P===void 0)&&(C===void 0||P===void 0||!n(C,P)))return!1}return!0}function c(g){for(var b=new Array(g.length),T=0,C=g.length;T<C;++T)b[T]=o(g[T]);return b}function h(g){var b={};for(var T in g){var C=g[T];C!==void 0&&(b[T]=o(C))}return b}})(gW||(gW={}));var sht=function(){function t(){this._types=[],this._values=[]}return t.prototype.types=function(){return this._types.slice()},t.prototype.hasData=function(e){return this._types.indexOf(e)!==-1},t.prototype.getData=function(e){var r=this._types.indexOf(e);return r!==-1?this._values[r]:void 0},t.prototype.setData=function(e,r){this.clearData(e),this._types.push(e),this._values.push(r)},t.prototype.clearData=function(e){var r=this._types.indexOf(e);r!==-1&&(this._types.splice(r,1),this._values.splice(r,1))},t.prototype.clear=function(){this._types.length=0,this._values.length=0},t}(),_W=function(){function t(){var e=this;this.promise=new Promise(function(r,i){e._resolve=r,e._reject=i})}return t.prototype.resolve=function(e){var r=this._resolve;r(e)},t.prototype.reject=function(e){var r=this._reject;r(e)},t}(),kO;(function(t){t.getRandomValues=function(){var e=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof Ug<"u"&&NO()||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:e&&typeof e.randomFillSync=="function"?function(i){return e.randomFillSync(i)}:e&&typeof e.randomBytes=="function"?function(i){for(var n=e.randomBytes(i.length),o=0,s=n.length;o<s;++o)i[o]=n[o]}:function(i){for(var n=0,o=0,s=i.length;o<s;++o)o%4===0&&(n=Math.random()*4294967295>>>0),i[o]=n&255,n>>>=8}}()})(kO||(kO={}));var yW=function(){function t(e){this.name=e,this._tokenStructuralPropertyT=null}return t}(),sC;(function(t){t.uuid4=function(){for(var e=new Uint8Array(16),r=new Array(256),i=0;i<16;++i)r[i]="0"+i.toString(16);for(var i=16;i<256;++i)r[i]=i.toString(16);return function(){return kO.getRandomValues(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,r[e[0]]+r[e[1]]+r[e[2]]+r[e[3]]+"-"+r[e[4]]+r[e[5]]+"-"+r[e[6]]+r[e[7]]+"-"+r[e[8]]+r[e[9]]+"-"+r[e[10]]+r[e[11]]+r[e[12]]+r[e[13]]+r[e[14]]+r[e[15]]}}()})(sC||(sC={}));var JY=Xl(WY()),QY=Xl(ZY()),eTe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),hC=function(){return hC=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},hC.apply(this,arguments)};function pC(t,e){return t.filter(function(r){return e.indexOf(r)===-1})}function Q_(t,e){return(0,JY.default)(t,e)}var Yd=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};function hb(){return sC.uuid4()}var tTe=function(t){eTe(e,t);function e(r,i){var n=t.call(this,r)||this;return console.warn("WrappedError has been deprecated!"),i instanceof e?n.error_stack=i.error_stack:n.error_stack=[i],n.error_stack.push(n),n}return e}(Error);function $_(t){var e=Object.keys(t),r=[];return e.forEach(function(i){r.push(t[i])}),Promise.all(r).then(function(i){for(var n={},o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function Uh(t,e){return function(i){throw e&&console.error(new Error(t)),i}}function Yp(t,e,r){for(var i=0;i<e.length;i++){for(var n=e[i],o=t,s=0;s<n.length-1;s++)o=o[n[s]];o[n[n.length-1]]=r[i]}}function db(t){var e=[],r=[];function i(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o))for(var l=!1,c=0;c<o.length;c++){var h=o[c];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=o.slice(),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([c])),o[c]=null;else{var g=i(h,s.concat([c]));g!==h&&(l||(o=o.slice(),l=!0),o[c]=g)}}else if((0,QY.default)(o))for(var b in o){var l=!1;if(o.hasOwnProperty(b)){var h=o[b];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=hC({},o),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([b])),delete o[b];else{var g=i(h,s.concat([b]));g!==h&&(l||(o=hC({},o),l=!0),o[b]=g)}}}return o}var n=i(t,[]);return{state:n,buffers:e,buffer_paths:r}}var rTe=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"];function iTe(t){for(var e=new Uint8Array(t),r=[],i=0;i<e.length;i++)r.push(rTe[e[i]]);return r.join("")}function oD(t){for(var e=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function sD(t){return(0,dC.fromByteArray)(new Uint8Array(t))}function aD(t){return(0,dC.toByteArray)(t).buffer}var AC="1.2.0",mC="2.1.0";var pb=function(){return pb=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},pb.apply(this,arguments)},Kp=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(g){try{h(i.next(g))}catch(b){s(b)}}function c(g){try{h(i.throw(g))}catch(b){s(b)}}function h(g){g.done?o(g.value):n(g.value).then(l,c)}h((i=i.apply(t,e||[])).next())})},Zp=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(h){return function(g){return c([h,g])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,n=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],n=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},$Y=mC.split(".",1)[0],eK="jupyter.widget.control",tK="1.0.0",rK=4e3,nTe=function(){function t(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}return t.prototype.display_model=function(e,r,i){var n=this;return i===void 0&&(i={}),this.create_view(r,i).then(function(o){return n.display_view(e,o,i)}).catch(Uh("Could not create view",!0))},t.prototype.setViewOptions=function(e){return e===void 0&&(e={}),e},t.prototype.create_view=function(e,r){var i=this;r===void 0&&(r={});var n=e.state_change=e.state_change.then(function(){return i.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(function(s){var l=new s({model:e,options:i.setViewOptions(r)});return l.listenTo(e,"destroy",l.remove),Promise.resolve(l.render()).then(function(){return l})}).catch(Uh("Could not create a view for model id "+e.model_id,!0))}),o=hb();return e.views[o]=n,n.then(function(s){s.once("remove",function(){delete s.model.views[o]},i)}),e.state_change},t.prototype.callbacks=function(e){return{}},t.prototype.get_model=function(e){return this._models[e]},t.prototype.has_model=function(e){return this._models[e]!==void 0},t.prototype.handle_comm_open=function(e,r){var i=(r.metadata||{}).version||"";if(i.split(".",1)[0]!==$Y){var n="Wrong widget protocol version: received protocol version '"+i+"', but was expecting major version '"+$Y+"'";return console.error(n),Promise.reject(n)}var o=r.content.data,s=o.buffer_paths||[],l=(r.buffers||[]).map(function(c){return c instanceof DataView?c:new DataView(c instanceof ArrayBuffer?c:c.buffer)});return Yp(o.state,s,l),this.new_model({model_name:o.state._model_name,model_module:o.state._model_module,model_module_version:o.state._model_module_version,comm:e},o.state).catch(Uh("Could not create a model.",!0))},t.prototype.new_widget=function(e,r){var i=this;r===void 0&&(r={});var n;if(e.view_name===void 0||e.view_module===void 0||e.view_module_version===void 0)return Promise.reject("new_widget(...) must be given view information in the options.");e.comm?n=Promise.resolve(e.comm):n=this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:mC});var o=pb({},e);return n.then(function(s){o.comm=s;var l=i.new_model(o,r);return l.then(function(c){return c.sync("create",c),c})},function(){return o.model_id||(o.model_id=hb()),i.new_model(o,r)})},t.prototype.register_model=function(e,r){var i=this;this._models[e]=r,r.then(function(n){n.once("comm:close",function(){delete i._models[e]})})},t.prototype.new_model=function(e,r){return r===void 0&&(r={}),Kp(this,void 0,void 0,function(){var i,n;return Zp(this,function(o){switch(o.label){case 0:if(e.model_id)i=e.model_id;else if(e.comm)i=e.model_id=e.comm.comm_id;else throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");return n=this._make_model(e,r),this.register_model(i,n),[4,n];case 1:return[2,o.sent()]}})})},t.prototype._make_model=function(e,r){return r===void 0&&(r={}),Kp(this,void 0,void 0,function(){var i,n,o,s,l,c,h;return Zp(this,function(g){switch(g.label){case 0:i=e.model_id,n=this.loadClass(e.model_name,e.model_module,e.model_module_version),g.label=1;case 1:return g.trys.push([1,3,,4]),[4,n];case 2:return o=g.sent(),[3,4];case 3:throw s=g.sent(),console.error("Could not instantiate widget"),s;case 4:if(!o)throw new Error("Cannot find model module "+e.model_module+"@"+e.model_module_version+", "+e.model_name);return[4,o._deserialize_state(r,this)];case 5:return l=g.sent(),c={widget_manager:this,model_id:i,comm:e.comm},h=new o(l,c),h.name=e.model_name,h.module=e.model_module,[2,h]}})})},t.prototype._loadFromKernel=function(){return Kp(this,void 0,void 0,function(){var e,r,i,n,o,s,l,c,h,g,b,T,C,P=this;return Zp(this,function(H){switch(H.label){case 0:return H.trys.push([0,3,,4]),[4,this._create_comm(eK,hb(),{},{version:tK})];case 1:return i=H.sent(),[4,new Promise(function(U,J){i.on_msg(function(ee){if(e=ee.content.data,e.method!=="update_states"){console.warn(`
|
|
4652
|
+
`},HS=class extends um{getShaders(){let e="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=Boolean(this.props.clipByInstance)),this.state.clipByInstance=e,e?{modules:[x_e],inject:b_e}:{modules:[w_e],inject:T_e}}draw({uniforms:e}){let{clipBounds:r}=this.props;if(this.state.clipByInstance)e.clip_bounds=r;else{let i=this.projectPosition([r[0],r[1],0]),n=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[0],n[0]),Math.max(i[1],n[1])]}}},O_=HS;(()=>{HS.defaultProps=v_e})(),(()=>{HS.extensionName="ClipExtension"})();function fO(t,e,r){let i=E_e(t),n=Object.keys(i).filter(o=>i[o]!==Array);return S_e(t,{propArrayTypes:i,...e},{numericPropKeys:r&&r.numericPropKeys||n,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function E_e(t){let e={};for(let r of t)if(r.properties)for(let i in r.properties){let n=r.properties[i];e[i]=B_e(n,e[i])}return e}function S_e(t,e,r){let{pointPositionsCount:i,pointFeaturesCount:n,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:l,polygonPositionsCount:c,polygonObjectsCount:h,polygonRingsCount:g,polygonFeaturesCount:b,propArrayTypes:T,coordLength:C}=e,{numericPropKeys:P=[],PositionDataType:H=Float32Array,triangulate:U=!0}=r,J=t[0]&&"id"in t[0],ee=t.length>65535?Uint32Array:Uint16Array,ne={type:"Point",positions:new H(i*C),globalFeatureIds:new ee(i),featureIds:n>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},oe={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new H(o*C),globalFeatureIds:new ee(o),featureIds:l>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},k={type:"Polygon",polygonIndices:c>65535?new Uint32Array(h+1):new Uint16Array(h+1),primitivePolygonIndices:c>65535?new Uint32Array(g+1):new Uint16Array(g+1),positions:new H(c*C),globalFeatureIds:new ee(c),featureIds:b>65535?new Uint32Array(c):new Uint16Array(c),numericProps:{},properties:[],fields:[]};U&&(k.triangles=[]);for(let Y of[ne,oe,k])for(let X of P){let B=T[X];Y.numericProps[X]=new B(Y.positions.length/C)}oe.pathIndices[s]=o,k.polygonIndices[h]=c,k.primitivePolygonIndices[g]=c;let Ie={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let Y of t){let X=Y.geometry,B=Y.properties||{};switch(X.type){case"Point":C_e(X,ne,Ie,C,B),ne.properties.push(cO(B,P)),J&&ne.fields.push({id:Y.id}),Ie.pointFeature++;break;case"LineString":M_e(X,oe,Ie,C,B),oe.properties.push(cO(B,P)),J&&oe.fields.push({id:Y.id}),Ie.lineFeature++;break;case"Polygon":I_e(X,k,Ie,C,B),k.properties.push(cO(B,P)),J&&k.fields.push({id:Y.id}),Ie.polygonFeature++;break;default:throw new Error("Invalid geometry type")}Ie.feature++}return R_e(ne,oe,k,C)}function C_e(t,e,r,i,n){e.positions.set(t.data,r.pointPosition*i);let o=t.data.length/i;hO(e,n,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function M_e(t,e,r,i,n){e.positions.set(t.data,r.linePosition*i);let o=t.data.length/i;hO(e,n,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,l=t.indices.length;s<l;++s){let c=t.indices[s],h=s===l-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(h-c)/i}}function I_e(t,e,r,i,n){e.positions.set(t.data,r.polygonPosition*i);let o=t.data.length/i;hO(e,n,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,l=t.indices.length;s<l;++s){let c=r.polygonPosition;e.polygonIndices[r.polygonObject++]=c;let h=t.areas[s],g=t.indices[s],b=t.indices[s+1];for(let C=0,P=g.length;C<P;++C){let H=g[C],U=C===P-1?b===void 0?t.data.length:b[0]:g[C+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(U-H)/i}let T=r.polygonPosition;P_e(e,h,g,{startPosition:c,endPosition:T,coordLength:i})}}function P_e(t,e,r,i){let{startPosition:n,endPosition:o,coordLength:s}=i;if(!t.triangles)return;let l=n*s,c=o*s,h=t.positions.subarray(l,c),g=r[0],b=r.slice(1).map(C=>(C-g)/s),T=O3(h,b,s,e);for(let C=0,P=T.length;C<P;++C)t.triangles.push(n+T[C])}function uO(t,e){let r={};for(let i in t)r[i]={value:t[i],size:e};return r}function R_e(t,e,r,i){let n={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:uO(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:uO(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:i},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:uO(r.numericProps,1)}};return n.polygons&&r.triangles&&(n.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),n}function hO(t,e,r,i){for(let n in t.numericProps)if(n in e){let o=e[n];t.numericProps[n].fill(o,r,r+i)}}function cO(t,e){let r={};for(let i in t)e.includes(i)||(r[i]=t[i]);return r}function B_e(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function WS(t,e){let r=e?.globalFeatureId;return r!==void 0?O_e(t,r):D_e(t,e?.type)}function O_e(t,e){let r=A7(t);for(let i of r){let n=0,o=i.featureIds.value[0];for(let s=0;s<i.featureIds.value.length;s++){let l=i.featureIds.value[s];if(l!==o){if(e===i.globalFeatureIds.value[n])return jS(i,n,s);n=s,o=l}}if(e===i.globalFeatureIds.value[n])return jS(i,n,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function D_e(t,e){let r=A7(t,e);return L_e(r)}function p7(t,e,r){switch(t.type){case"Point":return U_e(t,e,r);case"LineString":return k_e(t,e,r);case"Polygon":return m7(t,e,r);default:let i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function A7(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function L_e(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let i=0,n=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==n&&(e.push(jS(r,i,o)),i=o,n=s)}e.push(jS(r,i,r.featureIds.value.length))}return e}function jS(t,e,r){let i=p7(t,e,r),n=N_e(t,e,r),o=F_e(t,e,r);return{type:"Feature",geometry:i,properties:n,...o}}function F_e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function N_e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=Object.assign({},t.properties[t.featureIds.value[e]]);for(let n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}function m7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.polygonIndices.value.filter(c=>c>=e&&c<=r),o=t.primitivePolygonIndices.value.filter(c=>c>=e&&c<=r);if(!(n.length>2)){let c=[];for(let h=0;h<o.length-1;h++){let g=o[h],b=o[h+1],T=GS(i,g,b);c.push(T)}return{type:"Polygon",coordinates:c}}let l=[];for(let c=0;c<n.length-1;c++){let h=n[c],g=n[c+1],b=m7(t,h,g).coordinates;l.push(b)}return{type:"MultiPolygon",coordinates:l}}function k_e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.pathIndices.value.filter(l=>l>=e&&l<=r);if(!(n.length>2))return{type:"LineString",coordinates:GS(i,n[0],n[1])};let s=[];for(let l=0;l<n.length-1;l++){let c=GS(i,n[l],n[l+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}function U_e(t,e,r){let{positions:i}=t,n=GS(i,e,r);return n.length>1?{type:"MultiPoint",coordinates:n}:{type:"Point",coordinates:n[0]}}function GS(t,e,r){e=e||0,r=r||t.value.length/t.size;let i=[];for(let n=e;n<r;n++){let o=Array();for(let s=n*t.size;s<(n+1)*t.size;s++)o.push(Number(t.value[s]));i.push(o)}return i}var yO=Xl(w7(),1);function T7(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let o=0;o<e;o++){let s=iye(t[o]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&r.push(i),r}function iye(t){let e=0;for(let r=0,i=t.length-1,n,o;r<t.length;i=r++)n=t[r],o=t[i],e+=(o[0]-n[0])*(n[1]+o[1]);return e}function E7(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?nye(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function nye(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var Ym=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,i,n,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(E7,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=[],c;for(;e.pos<r;){if(n<=0){let h=e.readVarint();i=h&7,n=h>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(c&&l.push(c),c=[]),c&&c.push([o,s]);else if(i===7)c&&c.push(c[0].slice());else throw new Error(`unknown command ${i}`)}return c&&l.push(c),l}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=1/0,c=-1/0,h=1/0,g=-1/0;for(;e.pos<r;){if(n<=0){let b=e.readVarint();i=b&7,n=b>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<l&&(l=o),o>c&&(c=o),s<h&&(h=s),s>g&&(g=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[l,h,c,g]}_toGeoJSON(e){let r=this.loadGeometry(),i=Ym.types[this.type],n,o;switch(this.type){case 1:let l=[];for(n=0;n<r.length;n++)l[n]=r[n][0];r=l,e(r,this);break;case 2:for(n=0;n<r.length;n++)e(r[n],this);break;case 3:for(r=T7(r),n=0;n<r.length;n++)for(o=0;o<r[n].length;o++)e(r[n][o],this);break}r.length===1?r=r[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;function c(h){for(let g=0;g<h.length;g++){let b=h[g];b[0]=(b[0]+s)*360/o-180;let T=180-(b[1]+l)*360/o;b[1]=360/Math.PI*Math.atan(Math.exp(T*Math.PI/180))-90}}return this._toGeoJSON(c)}};var X1=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(oye,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new Ym(this._pbf,r,this.extent,this._keys,this._values)}};function oye(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(sye(r)))}function sye(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Y1=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(aye,{},r)}};function aye(t,e,r){if(t===3&&r){let i=new X1(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function S7(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[Pp(t.data)]],indices:[t.indices]};let i=[],n=[],o=[],s=[],l,c=0;for(let h,g=0,b;g<e;g++){b=t.indices[g]-c,h=t.indices[g+1]-c||t.data.length;let T=t.data.slice(b,h),C=Pp(T);if(C===0){let P=t.data.slice(0,b),H=t.data.slice(h);t.data=P.concat(H),c+=h-b;continue}l===void 0&&(l=C<0),l===C<0?(s.length&&(i.push(o),n.push(s)),s=[b],o=[C]):(o.push(C),s.push(b))}return o&&i.push(o),s.length&&n.push(s),{type:r,areas:i,indices:n,data:t.data}}function C7(t,e,r,i){for(let n=0,o=t.length;n<o;n+=2){t[n]=(t[n]+e)*360/i-180;let s=180-(t[n+1]+r)*360/i;t[n+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function M7(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?lye(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function lye(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var I7,Km,AO,YS,mO,gO,K1;var Z1=class{constructor(e,r,i,n,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,this._geometryInfo=s,e.readFields(M7,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,I7=e.readVarint()+e.pos,Km=1,YS=0,mO=0,gO=0,K1=0;let r=[],i=[];for(;e.pos<I7;)if(YS<=0&&(AO=e.readVarint(),Km=AO&7,YS=AO>>3),YS--,Km===1||Km===2)mO+=e.readSVarint(),gO+=e.readSVarint(),Km===1&&r.push(K1),i.push(mO,gO),K1+=2;else if(Km===7){if(K1>0){let n=r[r.length-1];i.push(i[n],i[n+1]),K1+=2}}else throw new Error(`unknown command ${Km}`);return{data:i,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),i;e(r.data,this);let n=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,i={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/n,i={type:"LineString",...r};break;case 3:i=S7(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/n;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;return this._toBinaryCoordinates(c=>C7(c,s,l,o))}};var J1=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(uye,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new Z1(this._pbf,i,this.extent,this._keys,this._values,r)}};function uye(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(cye(r)))}function cye(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Q1=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(fye,{},r)}};function fye(t,e,r){if(t===3&&r){let i=new J1(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function KS(t,e){var r,i;let n=dye(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(i=e.mvt)===null||i===void 0?void 0:i.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:_O(t,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:P7(t,n)};case"geojson":return P7(t,n);case"binary-geometry":return _O(t,n);case"binary":return _O(t,n);default:throw new Error(o||"undefined shape")}}function _O(t,e){let[r,i]=hye(t,e),n=fO(r,i);return n.byteLength=t.byteLength,n}function hye(t,e){let r=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,i];let n=new Q1(new yO.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(s=>{let l=n.layers[s];if(l)for(let c=0;c<l.length;c++){let h=l.feature(c,i),g=Aye(h,e,s);r.push(g)}}),[r,i]}function P7(t,e){if(t.byteLength<=0)return[];let r=[],i=new Y1(new yO.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let l=0;l<s.length;l++){let c=s.feature(l),h=pye(c,e,o);r.push(h)}}),r}function dye(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:i}=t.mvt,n=i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z);if(r&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function pye(t,e,r){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:mye);return e.layerProperty&&(i.properties[e.layerProperty]=r),i}function Aye(t,e,r){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:gye);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=r),i}function mye(t,e){let{extent:r}=e;for(let i=0;i<t.length;i++){let n=t[i];n[0]/=r,n[1]/=r}}function gye(t,e){let{extent:r}=e;for(let i=0,n=t.length;i<n;++i)t[i]/=r}var _ye="4.1.0",ZS={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:_ye,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},yye={...ZS,parse:async(t,e)=>KS(t,e),parseSync:KS,binary:!0};var vye={Point:R7,MultiPoint:xye,LineString:B7,MultiLineString:bye,Polygon:O7,MultiPolygon:wye};function R7([t,e],[r,i],n){let o=$a(r[0],i[0],t),s=$a(r[1],i[1],e);return n.unprojectFlat([o,s])}function vO(t,e,r){return t.map(i=>R7(i,e,r))}function xye(t,e,r){return vO(t,e,r)}function B7(t,e,r){return vO(t,e,r)}function bye(t,e,r){return t.map(i=>B7(i,e,r))}function O7(t,e,r){return t.map(i=>vO(i,e,r))}function wye(t,e,r){return t.map(i=>O7(i,e,r))}function D7(t,e,r){let i=r.projectFlat([e.west,e.north]),n=r.projectFlat([e.east,e.south]),o=[i,n];return{...t,coordinates:vye[t.type](t.coordinates,o,r)}}var Tye=["points","lines","polygons"];function xO(t,e,r,i){for(let n of Tye){let o=t[n]&&Eye(t[n],e,r,i);if(o>=0)return o}return-1}function Eye(t,e,r,i){let n=t.featureIds.value;if(!n.length)return-1;let o=0,s=n[n.length-1]+1;if(i){let c=Sye(t,i);if(c)o=c[0],s=c[1]+1;else return-1}let l=-1;if(e in t.numericProps){let c=t.numericProps[e].value.findIndex((h,g)=>h===r&&n[g]>=o&&n[g]<s);return c>=0?t.globalFeatureIds.value[c]:-1}else e?l=L7(t.properties,c=>c[e]===r,o,s):t.fields&&(l=L7(t.fields,c=>c.id===r,o,s));return l>=0?Cye(t,l):-1}function Sye(t,e){if(!t.__layers){let r={},{properties:i}=t;for(let n=0;n<i.length;n++){let{layerName:o}=i[n];o&&(r[o]?r[o][1]=n:r[o]=[n,n])}t.__layers=r}return t.__layers[e]}function Cye(t,e){if(!t.__ids){let r=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let o=0;o<i.length;o++)r[i[o]]=n[o];t.__ids=r}return t.__ids[e]}function L7(t,e,r,i){for(let n=r;n<i;n++)if(e(t[n],n))return n;return-1}var bO=512,Mye={...Ch.defaultProps,data:Vp,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[ZS],binary:!0},JS=class extends Ph{constructor(...e){super(...e)}initializeState(){super.initializeState();let e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:r,context:i,changeFlags:n}){n.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:i,changeFlags:n}),this._setWGS84PropertyForTiles());let{highlightColor:o}=e;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,r=null;if(typeof e=="string"&&!DR(e)){let{onDataLoad:i,fetch:n}=this.props;this.setState({data:null,tileJSON:null});try{r=await n(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}i&&i(r,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(r=e);r&&(e=r.tiles),this.setState({data:e,tileJSON:r})}_getTilesetOptions(){let e=super._getTilesetOptions(),r=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>i&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(n)||r.maxzoom<n)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:i}=this.state,{index:n,signal:o}=e,s=Ih(r,e);if(!s)return Promise.reject("Invalid URL");let l=this.getLoadOptions(),{fetch:c}=this.props;return l={...l,mimeType:"application/x-protobuf",mvt:{...l?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:n},gis:i?{format:"binary"}:{}},c(s,{propName:"data",layer:this,loadOptions:l,signal:o})}renderSubLayers(e){let{x:r,y:i,z:n}=e.tile.index,o=Math.pow(2,n),s=bO/o,l=-s,c=bO*r/o,h=bO*(1-i/o),g=new ni().scale([s,l,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=g,e.coordinateOrigin=[c,h,0],e.coordinateSystem=oi.CARTESIAN,e.extensions=[...e.extensions||[],new O_]);let b=super.renderSubLayers(e);return this.state.binary&&!(b instanceof Ch)&&vr.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),b}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,o=e.object,s=null,l=null;o&&(s=wO(o,r),l=F7(o));let{highlightColor:c}=this.props;typeof c=="function"&&(c=c(e)),(i!==s||n!==l)&&this.setState({highlightColor:c,hoveredFeatureId:s,hoveredFeatureLayerName:l})}getPickingInfo(e){let r=super.getPickingInfo(e),i=Boolean(this.context.viewport.resolution);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=WS(n,{globalFeatureId:r.index})}return r.object&&!i&&(r.object=k7(r.object,r.tile.bbox,this.context.viewport)),r}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:r,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,l=e.content,c=N7(s);if(!(N7(r)||c))return-1;let g=c?s:r;return Array.isArray(l)?l.findIndex(b=>{let T=wO(b,o)===g,C=c||F7(b)===i;return T&&C}):l&&n?xO(l,o,g,c?"":i):-1}_pickObjects(e){let{deck:r,viewport:i}=this.context,n=i.width,o=i.height,s=i.x,l=i.y,c=[this.id];return r.pickObjects({x:s,y:l,width:n,height:o,layerIds:c,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),i=new Set,n=[];for(let o of r){let s=wO(o.object,this.props.uniqueIdProperty);s===void 0?n.push(o.object):i.has(s)||(i.add(s),n.push(o.object))}return n}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(i=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>{if(!i.content)return null;if(this.state.binary&&Array.isArray(i.content)&&!i.content.length)return[];let{bbox:n}=i;if(i._contentWGS84===void 0&&LR(n)){let o=this.state.binary?WS(i.content):i.content;i._contentWGS84=o.map(s=>k7(s,n,this.context.viewport))}return i._contentWGS84}})})}},$1=JS;(()=>{JS.layerName="MVTLayer"})(),(()=>{JS.defaultProps=Mye})();function wO(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function F7(t){return t.properties?.layerName||null}function N7(t){return t!=null&&t!==""}function k7(t,e,r){let i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>D7(t.geometry,e,r).coordinates}),i}var U7="0123456789bcdefghjkmnpqrstuvwxyz",z7={};for(let t=0;t<U7.length;t++)z7[U7.charAt(t)]=t;var Iye=-90,Pye=90,Rye=-180,Bye=180;function Oye(t){let e=!0,r=Pye,i=Iye,n=Bye,o=Rye,s,l=0;for(let c=0,h=t.length;c<h;c++){let g=t[c].toLowerCase();l=z7[g];for(let b=4;b>=0;b--){let T=l>>b&1;e?(s=(n+o)/2,T===1?o=s:n=s):(s=(r+i)/2,T===1?i=s:r=s),e=!e}}return[i,o,r,n]}function V7(t){let[e,r,i,n]=Oye(t);return[n,i,n,e,r,e,r,i,n,i]}var Dye={getGeohash:{type:"accessor",value:t=>t.geohash}},QS=class extends lc{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(i,n)=>V7(r(i,n))}}},eb=QS;(()=>{QS.layerName="GeohashLayer"})(),(()=>{QS.defaultProps=Dye})();function F_(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function j7(t,e){let r=Fye(e),i=t;for(let n of r)i=Lye(i)?i[n]:void 0;return i}function Lye(t){return t!==null&&typeof t=="object"}var H7={};function Fye(t){if(typeof t=="string"){let e=H7[t];return e||(e=t.split("."),H7[t]=e),e}return Array.isArray(t)?t:[t]}var EO={};Js(EO,{addBinaryOp:()=>Vye,addUnaryOp:()=>zye,compile:()=>kye,compileAsync:()=>Uye,eval:()=>xl,evalAsync:()=>rb,parse:()=>Y7.default});var N_=Xl(TO()),Y7=Xl(TO()),rb=function t(e,r){try{var i,n=e;switch(n.type){case"ArrayExpression":return Promise.resolve(W7(n.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(C){return k_[n.operator](C[0],C[1])});case"CallExpression":var o,s,l,c=function(){if(typeof s=="function"){var C=s,P=C.apply,H=o;return Promise.resolve(W7(n.arguments,r)).then(function(U){return Promise.resolve(P.call(C,H,U))})}},h=n.callee.type==="MemberExpression"?Promise.resolve(G7(n.callee,r)).then(function(C){o=(l=C)[0],s=l[1]}):Promise.resolve(t(n.callee,r)).then(function(C){s=C});return Promise.resolve(h&&h.then?h.then(c):c());case"ConditionalExpression":return Promise.resolve(t(n.test,r)).then(function(C){return Promise.resolve(t(C?n.consequent:n.alternate,r))});case"Identifier":return Promise.resolve(r[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var g=function(C){return i?C:Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(P){return k_[n.operator](P[0],P[1])})},b=n.operator==="||"?(i=1,Promise.resolve(t(n.left,r)).then(function(C){return C||Promise.resolve(t(n.right,r))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(t(n.left,r)).then(function(C){return C&&Promise.resolve(t(n.right,r))})}();return Promise.resolve(b&&b.then?b.then(g):g(b));case"MemberExpression":return Promise.resolve(G7(n,r)).then(function(C){return C[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var T=eC[n.operator];return Promise.resolve(t(n.argument,r)).then(function(C){return T.call(eC,C)});default:return Promise.resolve(void 0)}}catch(C){return Promise.reject(C)}},G7=function(t,e){try{return Promise.resolve(rb(t.object,e)).then(function(r){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[r,r[n]]}var n,o=function(){if(t.computed)return Promise.resolve(rb(t.property,e)).then(function(s){n=s});n=t.property.name}();return o&&o.then?o.then(i):i()})}catch(r){return Promise.reject(r)}},W7=function(t,e){try{return Promise.resolve(Promise.all(t.map(function(r){return rb(r,e)})))}catch(r){return Promise.reject(r)}},Nye={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},k_={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},eC={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function q7(t,e){return t.map(function(r){return xl(r,e)})}function X7(t,e){var r,i=xl(t.object,e);if(r=t.computed?xl(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error('Access to member "'+r+'" disallowed.');return[i,i[r]]}function xl(t,e){var r=t;switch(r.type){case"ArrayExpression":return q7(r.elements,e);case"BinaryExpression":return k_[r.operator](xl(r.left,e),xl(r.right,e));case"CallExpression":var i,n,o;return r.callee.type==="MemberExpression"?(i=(o=X7(r.callee,e))[0],n=o[1]):n=xl(r.callee,e),typeof n!="function"?void 0:n.apply(i,q7(r.arguments,e));case"ConditionalExpression":return xl(r.test,e)?xl(r.consequent,e):xl(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?xl(r.left,e)||xl(r.right,e):r.operator==="&&"?xl(r.left,e)&&xl(r.right,e):k_[r.operator](xl(r.left,e),xl(r.right,e));case"MemberExpression":return X7(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return eC[r.operator](xl(r.argument,e));default:return}}function kye(t){return xl.bind(null,(0,N_.default)(t))}function Uye(t){return rb.bind(null,(0,N_.default)(t))}function zye(t,e){N_.default.addUnaryOp(t),eC[t]=e}function Vye(t,e,r){r?(N_.default.addBinaryOp(t,e),k_[t]=r):(N_.default.addBinaryOp(t,Nye[t]||1),k_[t]=e)}var{parse:Hye,eval:jye}=EO,SO={"-":t=>t};function Zm(t,e){if(t in SO)return SO[t];let r,i=Hye(t);return i.type==="Identifier"?r=n=>j7(n,t):(CO(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>jye(i,n)),SO[t]=r,r}function CO(t,e){if(Array.isArray(t))t.forEach(r=>CO(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)CO(t[r],e)}}var U_="@@=",MO="@@#",K7="@@type",tC="@@function";var Z7=t=>t&&typeof t=="object",Xd=class{constructor(...e){this.typeKey=K7,this.functionKey=tC,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=Zm,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(let r of e)this.merge(r)}merge(e){for(let r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){let i=e[r];this[r]=Z7(this[r])?Object.assign(this[r],i):i}}}validate(e){return F_(!this.typeKey||typeof this.typeKey=="string"),F_(Z7(this.classes)),!0}};function Gye(t){return typeof t=="string"&&t.startsWith(U_)}function Wye(t){return t.replace(U_,"")}function z_(t,e){let r={};for(let i in t){let n=t[i];Gye(n)&&(n=Wye(n),n=Zm(n,e)),r[i]=n}return r}function J7(t,e,r){let i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){let{log:o}=r;if(o){let s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?qye(i,e,r):Xye(n,e,r)}function qye(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=z_(e,r),new t(e)}function Xye(t,e,r){let{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=z_(e,r),i.createElement(t,e,n)}function Q7(t,e,r){let i=r.functions[t];if(!i){let{log:n}=r;if(n){let o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function IO(t){return typeof t=="string"?JSON.parse(t):t}var PO=t=>t&&typeof t=="object",Jm=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Xd?e.configuration:new Xd(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let r=IO(e),i=Yye(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}};function Yye(t,e){return e=new Xd(e),RO(t,"",e)}function RO(t,e,r){return Array.isArray(t)?t.map((i,n)=>RO(i,String(n),r)):Kye(t,r)?Zye(t,r):PO(t)?tC in t?Jye(t,r):BO(t,r):typeof t=="string"?Qye(t,e,r):t}function Kye(t,e){let{typeKey:r}=e;return PO(t)&&Boolean(t[r])}function Zye(t,e){let{typeKey:r}=e,i=t[r],n={...t};return delete n[r],n=BO(n,e),J7(i,n,e)}function Jye(t,e){let{functionKey:r}=e,i=t[r],n={...t};return delete n[r],n=BO(n,e),Q7(i,n,e)}function BO(t,e){F_(PO(t));let r={};for(let i in t){let n=t[i];r[i]=RO(n,i,e)}return r}function Qye(t,e,r){if(t.startsWith(U_)&&r.convertFunction)return t=t.replace(U_,""),r.convertFunction(t,r);if(t.startsWith(MO)){if(t=t.replace(MO,""),r.constants[t])return r.constants[t];let[i,n]=t.split(".");return r.enumerations[i][n]}return t}var V_={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},Fh=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:i}){e&&(V_.onInitialize=e),r&&(V_.onFinalize=r),i&&(V_.onMessage=i)}constructor(e="Transport"){this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=e}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(e={}){let r={transport:this,...e};V_.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};V_.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),V_.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(i,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}r.add(n)}return n})}};function $7(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!(r in e)||t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}function OO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eW(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function DO(t,e,r){return e&&eW(t.prototype,e),r&&eW(t,r),t}var ys=Xl(lW());var wft=typeof window<"u"?window:global;var Qm=typeof document<"u"?document:{};function tve(){}function rve(t){t&&console.error(t.error)}var cW={container:ys.default.object,gl:ys.default.object,mapboxApiAccessToken:ys.default.string,mapboxApiUrl:ys.default.string,attributionControl:ys.default.bool,preserveDrawingBuffer:ys.default.bool,reuseMaps:ys.default.bool,transformRequest:ys.default.func,mapOptions:ys.default.object,mapStyle:ys.default.oneOfType([ys.default.string,ys.default.object]),visible:ys.default.bool,asyncRender:ys.default.bool,onLoad:ys.default.func,onError:ys.default.func,width:ys.default.number,height:ys.default.number,viewState:ys.default.object,longitude:ys.default.number,latitude:ys.default.number,zoom:ys.default.number,bearing:ys.default.number,pitch:ys.default.number,altitude:ys.default.number},rC={container:Qm.body,mapboxApiAccessToken:ive(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:tve,onError:rve,width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function ive(){var t=null;if(typeof window<"u"&&window.location){var e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}return!t&&typeof process<"u"&&(t=t||process.env.MapboxAccessToken||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN),t||"no-token"}function uW(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"component";t.debug&&ys.default.checkPropTypes(cW,t,"prop",e)}var H_=function(){function t(e){var r=this;if(OO(this,t),Di(this,"mapboxgl",void 0),Di(this,"props",rC),Di(this,"_map",null),Di(this,"width",0),Di(this,"height",0),Di(this,"_fireLoadEvent",function(){r.props.onLoad({type:"load",target:r._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return DO(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(r){return this._update(this.props,r),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var r=this._map;r.style&&(r._frame&&(r._frame.cancel(),r._frame=null),r._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(r){this._map=t.savedMap;var i=this._map.getContainer(),n=r.container;for(n.classList.add("mapboxgl-map");i.childNodes.length>0;)n.appendChild(i.childNodes[0]);this._map._container=n,t.savedMap=null,r.mapStyle&&this._map.setStyle(r.mapStyle,{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(r){if(r.reuseMaps&&t.savedMap)this._reuse(r);else{if(r.gl){var i=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=i,r.gl}}var n={container:r.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:r.mapStyle,interactive:!1,trackResize:!1,attributionControl:r.attributionControl,preserveDrawingBuffer:r.preserveDrawingBuffer};r.transformRequest&&(n.transformRequest=r.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},n,r.mapOptions)),this._map.once("load",r.onLoad),this._map.on("error",r.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():(t.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(r){var i=this;r=Object.assign({},rC,r),uW(r,"Mapbox"),this.mapboxgl.accessToken=r.mapboxApiAccessToken||rC.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=r.mapboxApiUrl,this._create(r);var n=r,o=n.container;Object.defineProperty(o,"offsetWidth",{get:function(){return i.width}}),Object.defineProperty(o,"clientWidth",{get:function(){return i.width}}),Object.defineProperty(o,"offsetHeight",{get:function(){return i.height}}),Object.defineProperty(o,"clientHeight",{get:function(){return i.height}});var s=this._map.getCanvas();s&&(s.style.outline="none"),this._updateMapViewport({},r),this._updateMapSize({},r),this.props=r}},{key:"_update",value:function(r,i){if(this._map){i=Object.assign({},this.props,i),uW(i,"Mapbox");var n=this._updateMapViewport(r,i),o=this._updateMapSize(r,i);!i.asyncRender&&(n||o)&&this.redraw(),this.props=i}}},{key:"_updateMapSize",value:function(r,i){var n=r.width!==i.width||r.height!==i.height;return n&&(this.width=i.width,this.height=i.height,this.resize()),n}},{key:"_updateMapViewport",value:function(r,i){var n=this._getViewState(r),o=this._getViewState(i),s=o.latitude!==n.latitude||o.longitude!==n.longitude||o.zoom!==n.zoom||o.pitch!==n.pitch||o.bearing!==n.bearing||o.altitude!==n.altitude;return s&&(this._map.jumpTo(this._viewStateToMapboxProps(o)),o.altitude!==n.altitude&&(this._map.transform.altitude=o.altitude)),s}},{key:"_getViewState",value:function(r){var i=r.viewState||r,n=i.longitude,o=i.latitude,s=i.zoom,l=i.pitch,c=l===void 0?0:l,h=i.bearing,g=h===void 0?0:h,b=i.altitude,T=b===void 0?1.5:b;return{longitude:n,latitude:o,zoom:s,pitch:c,bearing:g,altitude:T}}},{key:"_checkStyleSheet",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"0.47.0";if(!(typeof Qm>"u"))try{var i=Qm.createElement("div");i.className="mapboxgl-map",i.style.display="none",Qm.body.append(i);var n=window.getComputedStyle(i).position!=="static";if(!n){var o=Qm.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(r,"/mapbox-gl.css")),Qm.head.append(o)}}catch{}}},{key:"_viewStateToMapboxProps",value:function(r){return{center:[r.longitude,r.latitude],zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}}}]),t}();Di(H_,"initialized",!1);Di(H_,"propTypes",cW);Di(H_,"defaultProps",rC);Di(H_,"savedMap",null);var fW={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function nve(t){let{container:e=document.body}=t;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=document.createElement("div");e.appendChild(i),Object.assign(i.style,fW);let n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,fW),{container:e,mapCanvas:i,deckCanvas:n}}var $m=class extends Rd{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:i}=nve(e),n=e.viewState||e.initialViewState,o=Number.isFinite(n&&n.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:i,...e}),s&&s.Map?this._map=o&&new H_({...e,viewState:n,container:r,mapboxgl:s}):this._map=s}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map._map.setStyle(e.mapStyle),super.setProps(e)}_drawLayers(e,r){if(this._map){let i=this.getViewports()[0];i&&this._map.setProps({width:i.width,height:i.height,viewState:i})}super._drawLayers(e,r)}};Kl.registerDevices([Qo]);var hW=t=>t.charAt(0)===t.charAt(0).toUpperCase(),ove=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function LO(t={},e){let r={},i=Object.keys(t).filter(e);for(let n of i)r[n]=t[n];return r}var sve={classes:LO(ib,hW),enumerations:{COORDINATE_SYSTEM:oi,GL:Ct}};TA([zy]);var Xp=new Jm({configuration:sve});function ave(t,e){let r={classes:LO(t,hW),functions:LO(t,ove)};e.mergeConfiguration(r)}function lve(t,e){if(!t)return;let r={};function i(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function n(o,s){ave(s,Xp),r[o]=s,i()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){n(o,window[o]);return}Object.defineProperty(window,o,{set:l=>n(o,l),get:()=>r[o]}),gk(s)})}function dW(t,e){let r=Xp.convert(t);e.setProps(r)}function uve(t,e){return t.filter(r=>r&&r.id&&!e.find(i=>i.id===r.id))}function cve({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:i,handleEvent:n,getTooltip:o,container:s}){let c={...n?{onClick:h=>n("deck-click-event",h),onHover:h=>n("deck-hover-event",h),onResize:h=>n("deck-resize-event",h),onViewStateChange:({viewState:h,interactionState:g,oldViewState:b})=>{let T=new Uu(h);h.nw=T.unproject([0,0]),h.se=T.unproject([T.width,T.height]),n("deck-view-state-change-event",h)},onDragStart:h=>n("deck-drag-start-event",h),onDrag:h=>n("deck-drag-event",h),onDragEnd:h=>n("deck-drag-end-event",h)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return vr.info("Using Mapbox base maps")(),new $m({...c,...e,map:rI,mapboxApiAccessToken:r,onLoad:mk});case"carto":return vr.info("Using Carto base maps")(),new $m({map:rI,...c,...e});case"google_maps":return vr.info("Using Google Maps base maps")(),Zz({...c,...e,googleMapsKey:i});default:return vr.info("No recognized map provider specified")(),new $m({...c,...e,map:null,mapboxApiAccessToken:null})}}function iC({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:i,tooltip:n,handleEvent:o,customLibraries:s,configuration:l}){let c;try{l&&Xp.mergeConfiguration(l);let h=i.layers||[],g=Xp.convert(i);P3(r,g);let b=(g.layers||[]).filter(U=>U),T=uve(h,b),C=$M(n),{mapProvider:P}=g;c=cve({mapProvider:P,props:g,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:C,container:r}),lve(s,()=>{if(T.length){let J=(Xp.convert({layers:i.layers}).layers||[]).filter(ee=>ee);J.length>b.length&&c.setProps({layers:J})}})}catch(h){console.error(h)}return c}function nC(){Fh.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:i,mapboxApiKey:n,jsonInput:o,tooltip:s}=pve(t);Ak();let l=t.getRootDOMElement(),c=hk(e,r);l.appendChild(c);let h=JSON.parse(o),g=iC({mapboxApiKey:n,container:c,jsonInput:h,tooltip:s,handleEvent:(b,T)=>dve(t,b,T),customLibraries:i});t.userData.deck=g},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:i}){let{deck:n}=t.userData,o;switch(e){case"json":o=Xp.convert(r),n.setProps(o);break;case"json-with-binary":o=Xp.convert(r);let s=t.jupyterModel.get("data_buffer"),l=fve({binary:s,convertedJson:o});n.setProps(l);break;default:}}})}function fve({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let i=e.layers[r].id,n=e.layers[r];e.layers[r]=n.clone({data:t[i]})}return e}function hve(t,e){return e instanceof Kn?e.id:e}function dve(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let i=JSON.parse(JSON.stringify(r,hve));t.sendJSONMessage(e,i)}function pve(t){let{jupyterModel:e}=t;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}var eg=class extends Fh{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let i=Fh._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(i)}};var bb={};Js(bb,{CONTROL_COMM_PROTOCOL_VERSION:()=>tK,CONTROL_COMM_TARGET:()=>eK,CONTROL_COMM_TIMEOUT:()=>rK,DOMWidgetModel:()=>GD,DOMWidgetView:()=>WD,IJupyterWidgetRegistry:()=>OTe,JUPYTER_WIDGETS_VERSION:()=>AC,JupyterPhosphorPanelWidget:()=>ETe,JupyterPhosphorWidget:()=>LK,LayoutModel:()=>STe,LayoutView:()=>CTe,ManagerBase:()=>nTe,PROTOCOL_VERSION:()=>mC,StyleModel:()=>MTe,StyleView:()=>ITe,ViewList:()=>BTe,WidgetModel:()=>cg,WidgetView:()=>uy,WrappedError:()=>tTe,assign:()=>Yd,base64ToBuffer:()=>aD,bufferToBase64:()=>sD,bufferToHex:()=>iTe,difference:()=>pC,hexToBuffer:()=>oD,isEqual:()=>Q_,put_buffers:()=>Yp,reject:()=>Uh,remove_buffers:()=>db,resolvePromisesDict:()=>$_,serialize_state:()=>iK,shims:()=>qD,unpack_models:()=>xb,uuid:()=>hb});var dC=Xl(mW());var gW;(function(t){t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]);function e(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"}t.isPrimitive=e;function r(g){return Array.isArray(g)}t.isArray=r;function i(g){return!e(g)&&!r(g)}t.isObject=i;function n(g,b){if(g===b)return!0;if(e(g)||e(b))return!1;var T=r(g),C=r(b);return T!==C?!1:T&&C?s(g,b):l(g,b)}t.deepEqual=n;function o(g){return e(g)?g:r(g)?c(g):h(g)}t.deepCopy=o;function s(g,b){if(g===b)return!0;if(g.length!==b.length)return!1;for(var T=0,C=g.length;T<C;++T)if(!n(g[T],b[T]))return!1;return!0}function l(g,b){if(g===b)return!0;for(var T in g)if(g[T]!==void 0&&!(T in b))return!1;for(var T in b)if(b[T]!==void 0&&!(T in g))return!1;for(var T in g){var C=g[T],P=b[T];if(!(C===void 0&&P===void 0)&&(C===void 0||P===void 0||!n(C,P)))return!1}return!0}function c(g){for(var b=new Array(g.length),T=0,C=g.length;T<C;++T)b[T]=o(g[T]);return b}function h(g){var b={};for(var T in g){var C=g[T];C!==void 0&&(b[T]=o(C))}return b}})(gW||(gW={}));var sht=function(){function t(){this._types=[],this._values=[]}return t.prototype.types=function(){return this._types.slice()},t.prototype.hasData=function(e){return this._types.indexOf(e)!==-1},t.prototype.getData=function(e){var r=this._types.indexOf(e);return r!==-1?this._values[r]:void 0},t.prototype.setData=function(e,r){this.clearData(e),this._types.push(e),this._values.push(r)},t.prototype.clearData=function(e){var r=this._types.indexOf(e);r!==-1&&(this._types.splice(r,1),this._values.splice(r,1))},t.prototype.clear=function(){this._types.length=0,this._values.length=0},t}(),_W=function(){function t(){var e=this;this.promise=new Promise(function(r,i){e._resolve=r,e._reject=i})}return t.prototype.resolve=function(e){var r=this._resolve;r(e)},t.prototype.reject=function(e){var r=this._reject;r(e)},t}(),kO;(function(t){t.getRandomValues=function(){var e=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof Ug<"u"&&NO()||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:e&&typeof e.randomFillSync=="function"?function(i){return e.randomFillSync(i)}:e&&typeof e.randomBytes=="function"?function(i){for(var n=e.randomBytes(i.length),o=0,s=n.length;o<s;++o)i[o]=n[o]}:function(i){for(var n=0,o=0,s=i.length;o<s;++o)o%4===0&&(n=Math.random()*4294967295>>>0),i[o]=n&255,n>>>=8}}()})(kO||(kO={}));var yW=function(){function t(e){this.name=e,this._tokenStructuralPropertyT=null}return t}(),sC;(function(t){t.uuid4=function(){for(var e=new Uint8Array(16),r=new Array(256),i=0;i<16;++i)r[i]="0"+i.toString(16);for(var i=16;i<256;++i)r[i]=i.toString(16);return function(){return kO.getRandomValues(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,r[e[0]]+r[e[1]]+r[e[2]]+r[e[3]]+"-"+r[e[4]]+r[e[5]]+"-"+r[e[6]]+r[e[7]]+"-"+r[e[8]]+r[e[9]]+"-"+r[e[10]]+r[e[11]]+r[e[12]]+r[e[13]]+r[e[14]]+r[e[15]]}}()})(sC||(sC={}));var JY=Xl(WY()),QY=Xl(ZY()),eTe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),hC=function(){return hC=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},hC.apply(this,arguments)};function pC(t,e){return t.filter(function(r){return e.indexOf(r)===-1})}function Q_(t,e){return(0,JY.default)(t,e)}var Yd=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};function hb(){return sC.uuid4()}var tTe=function(t){eTe(e,t);function e(r,i){var n=t.call(this,r)||this;return console.warn("WrappedError has been deprecated!"),i instanceof e?n.error_stack=i.error_stack:n.error_stack=[i],n.error_stack.push(n),n}return e}(Error);function $_(t){var e=Object.keys(t),r=[];return e.forEach(function(i){r.push(t[i])}),Promise.all(r).then(function(i){for(var n={},o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function Uh(t,e){return function(i){throw e&&console.error(new Error(t)),i}}function Yp(t,e,r){for(var i=0;i<e.length;i++){for(var n=e[i],o=t,s=0;s<n.length-1;s++)o=o[n[s]];o[n[n.length-1]]=r[i]}}function db(t){var e=[],r=[];function i(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o))for(var l=!1,c=0;c<o.length;c++){var h=o[c];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=o.slice(),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([c])),o[c]=null;else{var g=i(h,s.concat([c]));g!==h&&(l||(o=o.slice(),l=!0),o[c]=g)}}else if((0,QY.default)(o))for(var b in o){var l=!1;if(o.hasOwnProperty(b)){var h=o[b];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=hC({},o),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([b])),delete o[b];else{var g=i(h,s.concat([b]));g!==h&&(l||(o=hC({},o),l=!0),o[b]=g)}}}return o}var n=i(t,[]);return{state:n,buffers:e,buffer_paths:r}}var rTe=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"];function iTe(t){for(var e=new Uint8Array(t),r=[],i=0;i<e.length;i++)r.push(rTe[e[i]]);return r.join("")}function oD(t){for(var e=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function sD(t){return(0,dC.fromByteArray)(new Uint8Array(t))}function aD(t){return(0,dC.toByteArray)(t).buffer}var AC="1.2.0",mC="2.1.0";var pb=function(){return pb=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},pb.apply(this,arguments)},Kp=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(g){try{h(i.next(g))}catch(b){s(b)}}function c(g){try{h(i.throw(g))}catch(b){s(b)}}function h(g){g.done?o(g.value):n(g.value).then(l,c)}h((i=i.apply(t,e||[])).next())})},Zp=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(h){return function(g){return c([h,g])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,n=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],n=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},$Y=mC.split(".",1)[0],eK="jupyter.widget.control",tK="1.0.0",rK=4e3,nTe=function(){function t(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}return t.prototype.display_model=function(e,r,i){var n=this;return i===void 0&&(i={}),this.create_view(r,i).then(function(o){return n.display_view(e,o,i)}).catch(Uh("Could not create view",!0))},t.prototype.setViewOptions=function(e){return e===void 0&&(e={}),e},t.prototype.create_view=function(e,r){var i=this;r===void 0&&(r={});var n=e.state_change=e.state_change.then(function(){return i.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(function(s){var l=new s({model:e,options:i.setViewOptions(r)});return l.listenTo(e,"destroy",l.remove),Promise.resolve(l.render()).then(function(){return l})}).catch(Uh("Could not create a view for model id "+e.model_id,!0))}),o=hb();return e.views[o]=n,n.then(function(s){s.once("remove",function(){delete s.model.views[o]},i)}),e.state_change},t.prototype.callbacks=function(e){return{}},t.prototype.get_model=function(e){return this._models[e]},t.prototype.has_model=function(e){return this._models[e]!==void 0},t.prototype.handle_comm_open=function(e,r){var i=(r.metadata||{}).version||"";if(i.split(".",1)[0]!==$Y){var n="Wrong widget protocol version: received protocol version '"+i+"', but was expecting major version '"+$Y+"'";return console.error(n),Promise.reject(n)}var o=r.content.data,s=o.buffer_paths||[],l=(r.buffers||[]).map(function(c){return c instanceof DataView?c:new DataView(c instanceof ArrayBuffer?c:c.buffer)});return Yp(o.state,s,l),this.new_model({model_name:o.state._model_name,model_module:o.state._model_module,model_module_version:o.state._model_module_version,comm:e},o.state).catch(Uh("Could not create a model.",!0))},t.prototype.new_widget=function(e,r){var i=this;r===void 0&&(r={});var n;if(e.view_name===void 0||e.view_module===void 0||e.view_module_version===void 0)return Promise.reject("new_widget(...) must be given view information in the options.");e.comm?n=Promise.resolve(e.comm):n=this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:mC});var o=pb({},e);return n.then(function(s){o.comm=s;var l=i.new_model(o,r);return l.then(function(c){return c.sync("create",c),c})},function(){return o.model_id||(o.model_id=hb()),i.new_model(o,r)})},t.prototype.register_model=function(e,r){var i=this;this._models[e]=r,r.then(function(n){n.once("comm:close",function(){delete i._models[e]})})},t.prototype.new_model=function(e,r){return r===void 0&&(r={}),Kp(this,void 0,void 0,function(){var i,n;return Zp(this,function(o){switch(o.label){case 0:if(e.model_id)i=e.model_id;else if(e.comm)i=e.model_id=e.comm.comm_id;else throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");return n=this._make_model(e,r),this.register_model(i,n),[4,n];case 1:return[2,o.sent()]}})})},t.prototype._make_model=function(e,r){return r===void 0&&(r={}),Kp(this,void 0,void 0,function(){var i,n,o,s,l,c,h;return Zp(this,function(g){switch(g.label){case 0:i=e.model_id,n=this.loadClass(e.model_name,e.model_module,e.model_module_version),g.label=1;case 1:return g.trys.push([1,3,,4]),[4,n];case 2:return o=g.sent(),[3,4];case 3:throw s=g.sent(),console.error("Could not instantiate widget"),s;case 4:if(!o)throw new Error("Cannot find model module "+e.model_module+"@"+e.model_module_version+", "+e.model_name);return[4,o._deserialize_state(r,this)];case 5:return l=g.sent(),c={widget_manager:this,model_id:i,comm:e.comm},h=new o(l,c),h.name=e.model_name,h.module=e.model_module,[2,h]}})})},t.prototype._loadFromKernel=function(){return Kp(this,void 0,void 0,function(){var e,r,i,n,o,s,l,c,h,g,b,T,C,P=this;return Zp(this,function(H){switch(H.label){case 0:return H.trys.push([0,3,,4]),[4,this._create_comm(eK,hb(),{},{version:tK})];case 1:return i=H.sent(),[4,new Promise(function(U,J){i.on_msg(function(ee){if(e=ee.content.data,e.method!=="update_states"){console.warn(`
|
|
4653
4653
|
Unknown `+e.method+` message on the Control channel
|
|
4654
4654
|
`);return}r=(ee.buffers||[]).map(function(ne){return ne instanceof DataView?ne:new DataView(ne instanceof ArrayBuffer?ne:ne.buffer)}),U(null)}),i.on_close(function(){return J("Control comm was closed too early")}),i.send({method:"request_states"},{}),setTimeout(function(){return J("Control comm did not respond in time")},rK)})];case 2:return H.sent(),i.close(),[3,4];case 3:return n=H.sent(),console.warn('Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason:',n),[2,this._loadFromKernelModels()];case 4:for(o=e.states,s={},l={},c=0;c<e.buffer_paths.length;c++)h=e.buffer_paths[c],g=h[0],b=h.slice(1),T=r[c],s[g]||(s[g]=[],l[g]=[]),s[g].push(b),l[g].push(T);return[4,Promise.all(Object.keys(o).map(function(U){return Kp(P,void 0,void 0,function(){var J,ee;return Zp(this,function(ne){switch(ne.label){case 0:return this.has_model(U)?(ee=void 0,[3,3]):[3,1];case 1:return[4,this._create_comm("jupyter.widget",U)];case 2:ee=ne.sent(),ne.label=3;case 3:return J=ee,[2,{widget_id:U,comm:J}]}})})}))];case 5:return C=H.sent(),[4,Promise.all(C.map(function(U){var J=U.widget_id,ee=U.comm;return Kp(P,void 0,void 0,function(){var ne,oe,k;return Zp(this,function(Ie){switch(Ie.label){case 0:ne=o[J],J in s&&Yp(ne,s[J],l[J]),Ie.label=1;case 1:return Ie.trys.push([1,6,,7]),ee?[4,this.new_model({model_name:ne.model_name,model_module:ne.model_module,model_module_version:ne.model_module_version,model_id:J,comm:ee},ne.state)]:[3,3];case 2:return Ie.sent(),[3,5];case 3:return[4,this.get_model(J)];case 4:oe=Ie.sent(),oe.set_state(ne.state),Ie.label=5;case 5:return[3,7];case 6:return k=Ie.sent(),console.error(k),[3,7];case 7:return[2]}})})}))];case 6:return H.sent(),[2]}})})},t.prototype._loadFromKernelModels=function(){return Kp(this,void 0,void 0,function(){var e,r,i=this;return Zp(this,function(n){switch(n.label){case 0:return[4,this._get_comm_info()];case 1:return e=n.sent(),[4,Promise.all(Object.keys(e).map(function(o){return Kp(i,void 0,void 0,function(){var s,l,c;return Zp(this,function(h){switch(h.label){case 0:return this.has_model(o)?[2]:[4,this._create_comm(this.comm_target_name,o)];case 1:return s=h.sent(),l="",c=new _W,s.on_msg(function(g){if(g.parent_header.msg_id===l&&g.header.msg_type==="comm_msg"&&g.content.data.method==="update"){var b=g.content.data,T=b.buffer_paths||[],C=g.buffers||[];Yp(b.state,T,C),c.resolve({comm:s,msg:g})}}),l=s.send({method:"request_state"},this.callbacks(void 0)),[2,c.promise]}})})}))];case 2:return r=n.sent(),[4,Promise.all(r.map(function(o){return Kp(i,void 0,void 0,function(){var s;return Zp(this,function(l){switch(l.label){case 0:return o?(s=o.msg.content,[4,this.new_model({model_name:s.data.state._model_name,model_module:s.data.state._model_module,model_module_version:s.data.state._model_module_version,comm:o.comm},s.data.state)]):[2];case 1:return l.sent(),[2]}})})}))];case 3:return n.sent(),[2]}})})},t.prototype.clear_state=function(){var e=this;return $_(this._models).then(function(r){Object.keys(r).forEach(function(i){return r[i].close()}),e._models=Object.create(null)})},t.prototype.get_state=function(e){var r=this;e===void 0&&(e={});var i=Object.keys(this._models).map(function(n){return r._models[n]});return Promise.all(i).then(function(n){return iK(n,e)})},t.prototype.set_state=function(e){var r=this;if(!(e.version_major&&e.version_major<=2))throw"Unsupported widget state format";var i=e.state,n=this._get_comm_info().then(function(o){return Promise.all(Object.keys(i).map(function(s){var l={base64:aD,hex:oD},c=i[s],h=c.state;if(c.buffers){var g=c.buffers.map(function(C){return C.path}),b=c.buffers.map(function(C){return new DataView(l[C.encoding](C.data))});Yp(c.state,g,b)}if(r.has_model(s))return r.get_model(s).then(function(C){return C.constructor._deserialize_state(h||{},r).then(function(P){return C.set_state(P),C})});var T={model_id:s,model_name:c.model_name,model_module:c.model_module,model_module_version:c.model_module_version};return o.hasOwnProperty(s)?r._create_comm(r.comm_target_name,s).then(function(C){return T.comm=C,r.new_model(T)}):r.new_model(T,h)}))});return n},t.prototype.disconnect=function(){var e=this;Object.keys(this._models).forEach(function(r){e._models[r].then(function(i){i.comm_live=!1})})},t.prototype.resolveUrl=function(e){return Promise.resolve(e)},t.prototype.filterExistingModelState=function(e){var r=this,i=e.state;return i=Object.keys(i).filter(function(n){return!r.has_model(n)}).reduce(function(n,o){return n[o]=i[o],n},{}),pb(pb({},e),{state:i})},t}();function iK(t,e){e===void 0&&(e={});var r={};return t.forEach(function(i){var n=i.model_id,o=db(i.serialize(i.get_state(e.drop_defaults))),s=o.buffers.map(function(l,c){return{data:sD(l),path:o.buffer_paths[c],encoding:"base64"}});r[n]={model_name:i.name,model_module:i.module,model_module_version:i.get("_model_module_version"),state:o.state},s.length>0&&(r[n].buffers=s)}),{version_major:2,version_minor:0,state:r}}var uD=function(){return uD=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},uD.apply(this,arguments)};function nK(t,e,r){if(t==null)return this;var i;if(typeof t=="object"?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var n=r.unset,o=r.silent,s=[],l=this._changing;this._changing=!0;try{l||(this._previousAttributes=uD({},this.attributes),this.changed={});var c=this.attributes,h=this.changed,g=this._previousAttributes;for(var b in i)e=i[b],Q_(c[b],e)||s.push(b),Q_(g[b],e)?delete h[b]:h[b]=e,n?delete c[b]:c[b]=e;if(this.id=this.get(this.idAttribute),!o){s.length&&(this._pending=r);for(var T=0;T<s.length;T++)this.trigger("change:"+s[T],this,c[s[T]],r)}if(l)return this;if(!o)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r)}finally{this._pending=!1,this._changing=!1}return this}var DK=Xl(pD()),jD=Xl(hD());var aK=Xl(pD()),sTe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ab=Element.prototype,aTe=Ab.matches||Ab.webkitMatchesSelector||Ab.mozMatchesSelector||Ab.msMatchesSelector||Ab.oMatchesSelector||function(e){for(var r=(this.document||this.ownerDocument).querySelectorAll(e),i=r.length;--i>=0&&r.item(i)!==this;);return i>-1},lK=function(t){sTe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._removeElement=function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype._setElement=function(r){this.el=r},e.prototype._setAttributes=function(r){for(var i in r)i in this.el?this.el[i]=r[i]:this.el.setAttribute(i,r[i])},e.prototype.delegate=function(r,i,n){typeof i!="string"&&(n=i,i=null),this._domEvents===void 0&&(this._domEvents=[]);var o=this.el,s=i?function(l){for(var c=l.target||l.srcElement;c&&c!==o;c=c.parentNode)if(aTe.call(c,i))return l.delegateTarget=c,n.handleEvent?n.handleEvent(l):n(l)}:n;return this.el.addEventListener(r,s,!1),this._domEvents.push({eventName:r,handler:s,listener:n,selector:i}),s},e.prototype.undelegate=function(r,i,n){if(typeof i=="function"&&(n=i,i=null),this.el&&this._domEvents)for(var o=this._domEvents.slice(),s=o.length;s--;){var l=o[s],c=l.eventName===r&&(n?l.listener===n:!0)&&(i?l.selector===i:!0);c&&(this.el.removeEventListener(l.eventName,l.handler,!1),this._domEvents.splice(s,1))}return this},e.prototype.undelegateEvents=function(){if(this.el&&this._domEvents){for(var r=this._domEvents.length,i=0;i<r;i++){var n=this._domEvents[i];this.el.removeEventListener(n.eventName,n.handler,!1)}this._domEvents.length=0}return this},e}(aK.View);var ti;(function(t){function e(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(Y[ge]===X)return ge}return-1}t.firstIndexOf=e;function r(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(Y[ge]===X)return ge}return-1}t.lastIndexOf=r;function i(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(X(Y[ge],ge))return ge}return-1}t.findFirstIndex=i;function n(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(X(Y[ge],ge))return ge}return-1}t.findLastIndex=n;function o(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=i(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findFirstValue=o;function s(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=n(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findLastValue=s;function l(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)<0?(K=Ut+1,ge-=$e+1):ge=$e}return K}t.lowerBound=l;function c(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)>0?ge=$e:(K=Ut+1,ge-=$e+1)}return K}t.upperBound=c;function h(Y,X,B){if(Y===X)return!0;if(Y.length!==X.length)return!1;for(var I=0,j=Y.length;I<j;++I)if(B?!B(Y[I],X[I]):Y[I]!==X[I])return!1;return!0}t.shallowEqual=h;function g(Y,X){X===void 0&&(X={});var B=X.start,I=X.stop,j=X.step;if(j===void 0&&(j=1),j===0)throw new Error("Slice `step` cannot be zero.");var re=Y.length;B===void 0?B=j<0?re-1:0:B<0?B=Math.max(B+re,j<0?-1:0):B>=re&&(B=j<0?re-1:re),I===void 0?I=j<0?-1:re:I<0?I=Math.max(I+re,j<0?-1:0):I>=re&&(I=j<0?re-1:re);var K;j<0&&I>=B||j>0&&B>=I?K=0:j<0?K=Math.floor((I-B+1)/j+1):K=Math.floor((I-B-1)/j+1);for(var ge=[],$e=0;$e<K;++$e)ge[$e]=Y[B+$e*j];return ge}t.slice=g;function b(Y,X,B){var I=Y.length;if(!(I<=1)&&(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1),X!==B)){for(var j=Y[X],re=X<B?1:-1,K=X;K!==B;K+=re)Y[K]=Y[K+re];Y[B]=j}}t.move=b;function T(Y,X,B){X===void 0&&(X=0),B===void 0&&(B=-1);var I=Y.length;if(!(I<=1))for(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1);X<B;){var j=Y[X],re=Y[B];Y[X++]=re,Y[B--]=j}}t.reverse=T;function C(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(!(j<=1)&&(B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1),!(B>=I))){var re=I-B+1;if(X>0?X=X%re:X<0&&(X=(X%re+re)%re),X!==0){var K=B+X;T(Y,B,K-1),T(Y,K,I),T(Y,B,I)}}}t.rotate=C;function P(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j!==0){B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K)Y[(B+K)%j]=X}}t.fill=P;function H(Y,X,B){var I=Y.length;X<0?X=Math.max(0,X+I):X=Math.min(X,I);for(var j=I;j>X;--j)Y[j]=Y[j-1];Y[X]=B}t.insert=H;function U(Y,X){var B=Y.length;if(X<0&&(X+=B),!(X<0||X>=B)){for(var I=Y[X],j=X+1;j<B;++j)Y[j-1]=Y[j];return Y.length=B-1,I}}t.removeAt=U;function J(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=e(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeFirstOf=J;function ee(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=r(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeLastOf=ee;function ne(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&Y[K]===X||I<B&&(K<=I||K>=B)&&Y[K]===X?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllOf=ne;function oe(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j,re=i(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeFirstWhere=oe;function k(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j,re=n(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeLastWhere=k;function Ie(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&X(Y[K],K)||I<B&&(K<=I||K>=B)&&X(Y[K],K)?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllWhere=Ie})(ti||(ti={}));function Vf(t){var e;return typeof t.iter=="function"?e=t.iter():e=new lTe(t),e}function hn(t,e){for(var r=0,i=Vf(t),n;(n=i.next())!==void 0;)if(e(n,r++)===!1)return}function uK(t){for(var e=0,r=[],i=Vf(t),n;(n=i.next())!==void 0;)r[e++]=n;return r}var lTe=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),Jdt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),Qdt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),$dt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),ept=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();function mD(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ng(Vf(t.map(Vf)))}var ng=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();function zh(){return new uTe}var uTe=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var tpt=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();function cK(t,e){return new cTe(Vf(t),e)}var cTe=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();function ty(t,e){for(var r=0,i=Vf(t),n;(n=i.next())!==void 0;)if(e(n,r++))return n}function fK(t,e){var r=Vf(t),i=r.next();if(i!==void 0){for(var n=i;(i=r.next())!==void 0;)e(i,n)>0&&(n=i);return n}}function Jp(t,e){return new fTe(Vf(t),e)}var fTe=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var rpt=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=AD.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),AD;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(AD||(AD={}));function gD(t,e,r){var i=0,n=Vf(t),o=n.next();if(o===void 0&&r===void 0)throw new TypeError("Reduce of empty iterable with no initial value.");if(o===void 0)return r;var s=n.next();if(s===void 0&&r===void 0)return o;if(s===void 0)return e(r,o,i++);var l;r===void 0?l=e(o,s,i++):l=e(e(r,o,i++),s,i++);for(var c;(c=n.next())!==void 0;)l=e(l,c,i++);return l}function mb(t){return new hTe(t,1)}var hTe=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();var ipt=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var npt=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),ey;(function(t){function e(s,l,c){c===void 0&&(c=0);for(var h=new Array(l.length),g=0,b=c,T=l.length;g<T;++g,++b){if(b=s.indexOf(l[g],b),b===-1)return null;h[g]=b}return h}t.findIndices=e;function r(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=0,T=h.length;b<T;++b){var C=h[b]-c;g+=C*C}return{score:g,indices:h}}t.matchSumOfSquares=r;function i(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=c-1,T=0,C=h.length;T<C;++T){var P=h[T];g+=P-b-1,b=P}return{score:g,indices:h}}t.matchSumOfDeltas=i;function n(s,l,c){for(var h=[],g=0,b=0,T=l.length;g<T;){for(var C=l[g],P=l[g];++g<T&&l[g]===P+1;)P++;b<C&&h.push(s.slice(b,C)),C<P+1&&h.push(c(s.slice(C,P+1))),b=P+1}return b<s.length&&h.push(s.slice(b)),h}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(ey||(ey={}));var opt=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var spt=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var hK;(function(t){function e(r){var i=document.body,n=function(o){o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",r),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}t.copyText=e})(hK||(hK={}));var Lo;(function(t){function e(o){var s=window.getComputedStyle(o),l=parseFloat(s.borderTopWidth)||0,c=parseFloat(s.borderLeftWidth)||0,h=parseFloat(s.borderRightWidth)||0,g=parseFloat(s.borderBottomWidth)||0,b=parseFloat(s.paddingTop)||0,T=parseFloat(s.paddingLeft)||0,C=parseFloat(s.paddingRight)||0,P=parseFloat(s.paddingBottom)||0,H=c+T+C+h,U=l+b+P+g;return{borderTop:l,borderLeft:c,borderRight:h,borderBottom:g,paddingTop:b,paddingLeft:T,paddingRight:C,paddingBottom:P,horizontalSum:H,verticalSum:U}}t.boxSizing=e;function r(o){var s=window.getComputedStyle(o),l=parseFloat(s.minWidth)||0,c=parseFloat(s.minHeight)||0,h=parseFloat(s.maxWidth)||1/0,g=parseFloat(s.maxHeight)||1/0;return h=Math.max(l,h),g=Math.max(c,g),{minWidth:l,minHeight:c,maxWidth:h,maxHeight:g}}t.sizeLimits=r;function i(o,s,l){var c=o.getBoundingClientRect();return s>=c.left&&s<c.right&&l>=c.top&&l<c.bottom}t.hitTest=i;function n(o,s){var l=o.getBoundingClientRect(),c=s.getBoundingClientRect();if(!(c.top<=l.top&&c.bottom>=l.bottom)){if(c.top<l.top&&c.height<=l.height){o.scrollTop-=l.top-c.top;return}if(c.bottom>l.bottom&&c.height>=l.height){o.scrollTop-=l.top-c.top;return}if(c.top<l.top&&c.height>l.height){o.scrollTop-=l.bottom-c.bottom;return}if(c.bottom>l.bottom&&c.height<l.height){o.scrollTop-=l.bottom-c.bottom;return}}}t.scrollIntoViewIfNeeded=n})(Lo||(Lo={}));var nu;(function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent);function e(r){return t.IS_MAC?r.metaKey:r.ctrlKey}t.accelKey=e})(nu||(nu={}));var jf;(function(t){function e(n){if(n in Hf.specificityCache)return Hf.specificityCache[n];var o=Hf.calculateSingle(n);return Hf.specificityCache[n]=o}t.calculateSpecificity=e;function r(n){if(n in Hf.validityCache)return Hf.validityCache[n];var o=!0;try{Hf.testElem.querySelector(n)}catch{o=!1}return Hf.validityCache[n]=o}t.isValid=r;function i(n,o){return Hf.protoMatchFunc.call(n,o)}t.matches=i})(jf||(jf={}));var Hf;(function(t){t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=function(){var g=Element.prototype;return g.matches||g.matchesSelector||g.mozMatchesSelector||g.msMatchesSelector||g.oMatchesSelector||g.webkitMatchesSelector||function(b){var T=this,C=T.ownerDocument?T.ownerDocument.querySelectorAll(b):[];return Array.prototype.indexOf.call(C,T)!==-1}}();function e(g){g=g.split(",",1)[0];var b=0,T=0,C=0;function P(H){var U=g.match(H);return U===null?!1:(g=g.slice(U[0].length),!0)}for(g=g.replace(h," $1 ");g.length>0;){if(P(r)){b++;continue}if(P(i)){T++;continue}if(P(n)){T++;continue}if(P(s)){C++;continue}if(P(l)){T++;continue}if(P(o)){C++;continue}if(!P(c))return 0}return b=Math.min(b,255),T=Math.min(T,255),C=Math.min(C,255),b<<16|T<<8|C}t.calculateSingle=e;var r=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,s=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,l=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,h=/:not\(([^\)]+)\)/g})(Hf||(Hf={}));var gb;(function(t){function e(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(Y[ge]===X)return ge}return-1}t.firstIndexOf=e;function r(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(Y[ge]===X)return ge}return-1}t.lastIndexOf=r;function i(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(X(Y[ge],ge))return ge}return-1}t.findFirstIndex=i;function n(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(X(Y[ge],ge))return ge}return-1}t.findLastIndex=n;function o(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=i(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findFirstValue=o;function s(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=n(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findLastValue=s;function l(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)<0?(K=Ut+1,ge-=$e+1):ge=$e}return K}t.lowerBound=l;function c(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)>0?ge=$e:(K=Ut+1,ge-=$e+1)}return K}t.upperBound=c;function h(Y,X,B){if(Y===X)return!0;if(Y.length!==X.length)return!1;for(var I=0,j=Y.length;I<j;++I)if(B?!B(Y[I],X[I]):Y[I]!==X[I])return!1;return!0}t.shallowEqual=h;function g(Y,X){X===void 0&&(X={});var B=X.start,I=X.stop,j=X.step;if(j===void 0&&(j=1),j===0)throw new Error("Slice `step` cannot be zero.");var re=Y.length;B===void 0?B=j<0?re-1:0:B<0?B=Math.max(B+re,j<0?-1:0):B>=re&&(B=j<0?re-1:re),I===void 0?I=j<0?-1:re:I<0?I=Math.max(I+re,j<0?-1:0):I>=re&&(I=j<0?re-1:re);var K;j<0&&I>=B||j>0&&B>=I?K=0:j<0?K=Math.floor((I-B+1)/j+1):K=Math.floor((I-B-1)/j+1);for(var ge=[],$e=0;$e<K;++$e)ge[$e]=Y[B+$e*j];return ge}t.slice=g;function b(Y,X,B){var I=Y.length;if(!(I<=1)&&(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1),X!==B)){for(var j=Y[X],re=X<B?1:-1,K=X;K!==B;K+=re)Y[K]=Y[K+re];Y[B]=j}}t.move=b;function T(Y,X,B){X===void 0&&(X=0),B===void 0&&(B=-1);var I=Y.length;if(!(I<=1))for(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1);X<B;){var j=Y[X],re=Y[B];Y[X++]=re,Y[B--]=j}}t.reverse=T;function C(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(!(j<=1)&&(B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1),!(B>=I))){var re=I-B+1;if(X>0?X=X%re:X<0&&(X=(X%re+re)%re),X!==0){var K=B+X;T(Y,B,K-1),T(Y,K,I),T(Y,B,I)}}}t.rotate=C;function P(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j!==0){B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K)Y[(B+K)%j]=X}}t.fill=P;function H(Y,X,B){var I=Y.length;X<0?X=Math.max(0,X+I):X=Math.min(X,I);for(var j=I;j>X;--j)Y[j]=Y[j-1];Y[X]=B}t.insert=H;function U(Y,X){var B=Y.length;if(X<0&&(X+=B),!(X<0||X>=B)){for(var I=Y[X],j=X+1;j<B;++j)Y[j-1]=Y[j];return Y.length=B-1,I}}t.removeAt=U;function J(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=e(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeFirstOf=J;function ee(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=r(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeLastOf=ee;function ne(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&Y[K]===X||I<B&&(K<=I||K>=B)&&Y[K]===X?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllOf=ne;function oe(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j,re=i(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeFirstWhere=oe;function k(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j,re=n(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeLastWhere=k;function Ie(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&X(Y[K],K)||I<B&&(K<=I||K>=B)&&X(Y[K],K)?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllWhere=Ie})(gb||(gb={}));function yD(t){var e;return typeof t.iter=="function"?e=t.iter():e=new dTe(t),e}function pK(t,e){for(var r=0,i=yD(t),n;(n=i.next())!==void 0;)if(e(n,r++)===!1)return}function AK(t,e){for(var r=0,i=yD(t),n;(n=i.next())!==void 0;)if(!e(n,r++))return!1;return!0}function mK(t,e){for(var r=0,i=yD(t),n;(n=i.next())!==void 0;)if(e(n,r++))return!0;return!1}var dTe=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),upt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),cpt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),fpt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),hpt=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();var dpt=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();var ppt=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var Apt=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();var mpt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();var gpt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var _pt=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=_D.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),_D;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(_D||(_D={}));var ypt=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();function gK(t){var e;return typeof t.retro=="function"?e=t.retro():e=new pTe(t),e}var pTe=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var vpt=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),dK;(function(t){function e(s,l,c){c===void 0&&(c=0);for(var h=new Array(l.length),g=0,b=c,T=l.length;g<T;++g,++b){if(b=s.indexOf(l[g],b),b===-1)return null;h[g]=b}return h}t.findIndices=e;function r(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=0,T=h.length;b<T;++b){var C=h[b]-c;g+=C*C}return{score:g,indices:h}}t.matchSumOfSquares=r;function i(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=c-1,T=0,C=h.length;T<C;++T){var P=h[T];g+=P-b-1,b=P}return{score:g,indices:h}}t.matchSumOfDeltas=i;function n(s,l,c){for(var h=[],g=0,b=0,T=l.length;g<T;){for(var C=l[g],P=l[g];++g<T&&l[g]===P+1;)P++;b<C&&h.push(s.slice(b,C)),C<P+1&&h.push(c(s.slice(C,P+1))),b=P+1}return b<s.length&&h.push(s.slice(b)),h}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(dK||(dK={}));var xpt=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var bpt=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var ou;(function(t){function e(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(Y[ge]===X)return ge}return-1}t.firstIndexOf=e;function r(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(Y[ge]===X)return ge}return-1}t.lastIndexOf=r;function i(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(X(Y[ge],ge))return ge}return-1}t.findFirstIndex=i;function n(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(X(Y[ge],ge))return ge}return-1}t.findLastIndex=n;function o(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=i(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findFirstValue=o;function s(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=n(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findLastValue=s;function l(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)<0?(K=Ut+1,ge-=$e+1):ge=$e}return K}t.lowerBound=l;function c(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)>0?ge=$e:(K=Ut+1,ge-=$e+1)}return K}t.upperBound=c;function h(Y,X,B){if(Y===X)return!0;if(Y.length!==X.length)return!1;for(var I=0,j=Y.length;I<j;++I)if(B?!B(Y[I],X[I]):Y[I]!==X[I])return!1;return!0}t.shallowEqual=h;function g(Y,X){X===void 0&&(X={});var B=X.start,I=X.stop,j=X.step;if(j===void 0&&(j=1),j===0)throw new Error("Slice `step` cannot be zero.");var re=Y.length;B===void 0?B=j<0?re-1:0:B<0?B=Math.max(B+re,j<0?-1:0):B>=re&&(B=j<0?re-1:re),I===void 0?I=j<0?-1:re:I<0?I=Math.max(I+re,j<0?-1:0):I>=re&&(I=j<0?re-1:re);var K;j<0&&I>=B||j>0&&B>=I?K=0:j<0?K=Math.floor((I-B+1)/j+1):K=Math.floor((I-B-1)/j+1);for(var ge=[],$e=0;$e<K;++$e)ge[$e]=Y[B+$e*j];return ge}t.slice=g;function b(Y,X,B){var I=Y.length;if(!(I<=1)&&(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1),X!==B)){for(var j=Y[X],re=X<B?1:-1,K=X;K!==B;K+=re)Y[K]=Y[K+re];Y[B]=j}}t.move=b;function T(Y,X,B){X===void 0&&(X=0),B===void 0&&(B=-1);var I=Y.length;if(!(I<=1))for(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1);X<B;){var j=Y[X],re=Y[B];Y[X++]=re,Y[B--]=j}}t.reverse=T;function C(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(!(j<=1)&&(B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1),!(B>=I))){var re=I-B+1;if(X>0?X=X%re:X<0&&(X=(X%re+re)%re),X!==0){var K=B+X;T(Y,B,K-1),T(Y,K,I),T(Y,B,I)}}}t.rotate=C;function P(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j!==0){B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K)Y[(B+K)%j]=X}}t.fill=P;function H(Y,X,B){var I=Y.length;X<0?X=Math.max(0,X+I):X=Math.min(X,I);for(var j=I;j>X;--j)Y[j]=Y[j-1];Y[X]=B}t.insert=H;function U(Y,X){var B=Y.length;if(X<0&&(X+=B),!(X<0||X>=B)){for(var I=Y[X],j=X+1;j<B;++j)Y[j-1]=Y[j];return Y.length=B-1,I}}t.removeAt=U;function J(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=e(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeFirstOf=J;function ee(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=r(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeLastOf=ee;function ne(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&Y[K]===X||I<B&&(K<=I||K>=B)&&Y[K]===X?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllOf=ne;function oe(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j,re=i(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeFirstWhere=oe;function k(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j,re=n(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeLastWhere=k;function Ie(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&X(Y[K],K)||I<B&&(K<=I||K>=B)&&X(Y[K],K)?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllWhere=Ie})(ou||(ou={}));function ATe(t){var e;return typeof t.iter=="function"?e=t.iter():e=new mTe(t),e}function _C(t,e){for(var r=0,i=ATe(t),n;(n=i.next())!==void 0;)if(e(n,r++)===!1)return}var mTe=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),Tpt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),Ept=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),Spt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),Cpt=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();var Mpt=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();function xD(){return new gTe}var gTe=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var Ipt=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();var Ppt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();var Rpt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var Bpt=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=vD.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),vD;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(vD||(vD={}));var Opt=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();var Dpt=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var Lpt=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),_K;(function(t){function e(s,l,c){c===void 0&&(c=0);for(var h=new Array(l.length),g=0,b=c,T=l.length;g<T;++g,++b){if(b=s.indexOf(l[g],b),b===-1)return null;h[g]=b}return h}t.findIndices=e;function r(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=0,T=h.length;b<T;++b){var C=h[b]-c;g+=C*C}return{score:g,indices:h}}t.matchSumOfSquares=r;function i(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=c-1,T=0,C=h.length;T<C;++T){var P=h[T];g+=P-b-1,b=P}return{score:g,indices:h}}t.matchSumOfDeltas=i;function n(s,l,c){for(var h=[],g=0,b=0,T=l.length;g<T;){for(var C=l[g],P=l[g];++g<T&&l[g]===P+1;)P++;b<C&&h.push(s.slice(b,C)),C<P+1&&h.push(c(s.slice(C,P+1))),b=P+1}return b<s.length&&h.push(s.slice(b)),h}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(_K||(_K={}));var Fpt=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var Npt=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var yK=function(){function t(e){this._root=new Sa.LeafNode,this.cmp=e}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var e=Sa.firstLeaf(this._root);return e.size>0?e.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var e=Sa.lastLeaf(this._root);return e.size>0?e.items[e.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return Sa.iterItems(this._root)},t.prototype.retro=function(){return Sa.retroItems(this._root)},t.prototype.slice=function(e,r){return Sa.sliceItems(this._root,e,r)},t.prototype.retroSlice=function(e,r){return Sa.retroSliceItems(this._root,e,r)},t.prototype.at=function(e){return Sa.itemAt(this._root,e)},t.prototype.has=function(e,r){return Sa.hasItem(this._root,e,r)},t.prototype.indexOf=function(e,r){return Sa.indexOf(this._root,e,r)},t.prototype.get=function(e,r){return Sa.getItem(this._root,e,r)},t.prototype.assign=function(e){this.clear(),this.update(e)},t.prototype.insert=function(e){var r=Sa.insertItem(this._root,e,this.cmp);return this._root=Sa.maybeSplitRoot(this._root),r},t.prototype.update=function(e){var r=this;_C(e,function(i){r.insert(i)})},t.prototype.delete=function(e,r){var i=Sa.deleteItem(this._root,e,r);return this._root=Sa.maybeExtractRoot(this._root),i},t.prototype.remove=function(e){var r=Sa.removeItem(this._root,e);return this._root=Sa.maybeExtractRoot(this._root),r},t.prototype.clear=function(){Sa.clear(this._root),this._root=new Sa.LeafNode},t}();(function(t){function e(r,i){var n=new t(i);return n.assign(r),n}t.from=e})(yK||(yK={}));var Sa;(function(t){var e=function(){function K(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(K.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),K}();t.BranchNode=e;var r=function(){function K(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(K.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),K}();t.LeafNode=r;function i(K){for(;K.type===0;)K=K.children[0];return K}t.firstLeaf=i;function n(K){for(;K.type===0;)K=K.children[K.children.length-1];return K}t.lastLeaf=n;function o(K){var ge=i(K);return new k(ge,0,-1)}t.iterItems=o;function s(K){var ge=n(K);return new Ie(ge,ge.size-1,-1)}t.retroItems=s;function l(K,ge,$e){ge===void 0?ge=0:ge<0?ge=Math.max(0,ge+K.size):ge=Math.min(ge,K.size),$e===void 0?$e=K.size:$e<0?$e=Math.max(0,$e+K.size):$e=Math.min($e,K.size);var Ut=Math.max(0,$e-ge);if(Ut===0)return xD();for(;K.type===0;){var $t=Y(K.sizes,ge);$t>0&&(ge-=K.sizes[$t-1]),K=K.children[$t]}return new k(K,ge,Ut)}t.sliceItems=l;function c(K,ge,$e){ge===void 0?ge=K.size-1:ge<0?ge=Math.max(-1,ge+K.size):ge=Math.min(ge,K.size-1),$e===void 0?$e=-1:$e<0?$e=Math.max(-1,$e+K.size):$e=Math.min($e,K.size-1);var Ut=Math.max(0,ge-$e);if(Ut===0)return xD();for(;K.type===0;){var $t=Y(K.sizes,ge);$t>0&&(ge-=K.sizes[$t-1]),K=K.children[$t]}return new Ie(K,ge,Ut)}t.retroSliceItems=c;function h(K,ge){if(ge<0&&(ge+=K.size),!(ge<0||ge>=K.size)){for(;K.type===0;){var $e=Y(K.sizes,ge);$e>0&&(ge-=K.sizes[$e-1]),K=K.children[$e]}return K.items[ge]}}t.itemAt=h;function g(K,ge,$e){for(;K.type===0;){var Ut=X(K.items,ge,$e);K=K.children[Ut]}var $t=B(K.items,ge,$e);return $t>=0}t.hasItem=g;function b(K,ge,$e){for(var Ut=0;K.type===0;){var $t=X(K.items,ge,$e);$t>0&&(Ut+=K.sizes[$t-1]),K=K.children[$t]}var Er=B(K.items,ge,$e);return Er>=0?Ut+Er:-Ut+Er}t.indexOf=b;function T(K,ge,$e){for(;K.type===0;){var Ut=X(K.items,ge,$e);K=K.children[Ut]}var $t=B(K.items,ge,$e);return $t>=0?K.items[$t]:void 0}t.getItem=T;function C(K,ge,$e){if(K.type===1){var Ut=B(K.items,ge,$e),$t;return Ut>=0?($t=K.items[Ut],K.items[Ut]=ge):($t=void 0,ou.insert(K.items,-Ut-1,ge)),$t}var Er=X(K.items,ge,$e),Ir=K.children[Er],Sr=Ir.size,cr=C(Ir,ge,$e),si=Ir.size;if(K.items[Er]=Ir.items[0],Sr===si)return cr;if(Ir.width>ne){var sr=j(Ir);ou.insert(K.children,Er+1,sr),ou.insert(K.items,Er+1,sr.items[0])}return I(K,Er),cr}t.insertItem=C;function P(K,ge,$e){if(K.type===1){var Ut=B(K.items,ge,$e);return Ut<0?void 0:ou.removeAt(K.items,Ut)}var $t=X(K.items,ge,$e),Er=K.children[$t],Ir=Er.size,Sr=P(Er,ge,$e),cr=Er.size;return Ir===cr||(K.items[$t]=Er.items[0],Er.width<oe&&($t=re(K,$t)),I(K,$t)),Sr}t.deleteItem=P;function H(K,ge){if(ge<0&&(ge+=K.size),!(ge<0||ge>=K.size)){if(K.type===1)return ou.removeAt(K.items,ge);var $e=Y(K.sizes,ge);$e>0&&(ge-=K.sizes[$e]);var Ut=K.children[$e],$t=H(Ut,ge);return K.items[$e]=Ut.items[0],Ut.width<oe&&($e=re(K,$e)),I(K,$e),$t}}t.removeItem=H;function U(K){K.type===0?(_C(K.children,U),K.children.length=0,K.sizes.length=0,K.items.length=0):(K.items.length=0,K.next=null,K.prev=null)}t.clear=U;function J(K){if(K.width<=ne)return K;var ge=new e,$e=j(K);return ge.sizes[0]=K.size,ge.sizes[1]=K.size+$e.size,ge.children[0]=K,ge.children[1]=$e,ge.items[0]=K.items[0],ge.items[1]=$e.items[0],ge}t.maybeSplitRoot=J;function ee(K){if(K.type===1||K.children.length>1)return K;var ge=K.children.pop();return U(K),ge}t.maybeExtractRoot=ee;var ne=32,oe=ne>>1,k=function(){function K(ge,$e,Ut){this._node=ge,this._index=$e,this._count=Ut}return K.prototype.iter=function(){return this},K.prototype.clone=function(){return new K(this._node,this._index,this._count)},K.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},K}(),Ie=function(){function K(ge,$e,Ut){this._node=ge,this._index=$e,this._count=Ut}return K.prototype.iter=function(){return this},K.prototype.clone=function(){return new K(this._node,this._index,this._count)},K.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},K}();function Y(K,ge){for(var $e=K.length,Ut=0;Ut<$e;++Ut)if(K[Ut]>ge)return Ut;return $e-1}function X(K,ge,$e){for(var Ut=K.length,$t=1;$t<Ut;++$t)if($e(K[$t],ge)>0)return $t-1;return Ut-1}function B(K,ge,$e){for(var Ut=K.length,$t=0;$t<Ut;++$t){var Er=$e(K[$t],ge);if(Er===0)return $t;if(Er>0)return-$t-1}return-Ut-1}function I(K,ge){for(var $e=K.sizes,Ut=K.children,$t=ge>0?$e[ge-1]:0,Er=Ut.length;ge<Er;++ge)$t=$e[ge]=$t+Ut[ge].size;$e.length=Ut.length}function j(K){if(K.type===1){for(var ge=new r,$e=K.items,Ut=ge.items,$t=oe,Er=$e.length;$t<Er;++$t)Ut.push($e[$t]);return $e.length=oe,K.next&&(K.next.prev=ge),ge.next=K.next,ge.prev=K,K.next=ge,ge}for(var Ir=new e,Sr=K.children,cr=Ir.children,$t=oe,Er=Sr.length;$t<Er;++$t)cr.push(Sr[$t]);Sr.length=oe;for(var si=K.items,sr=Ir.items,$t=oe,Er=si.length;$t<Er;++$t)sr.push(si[$t]);return si.length=oe,I(K,oe),I(Ir,0),Ir}function re(K,ge){var $e,Ut,$t,Er,Ir,Sr,cr=K.children[ge],si=ge===0?K.children[ge+1]:K.children[ge-1],sr=ge===0,er=cr.type===1,Si=si.width>oe;if(er&&Si&&sr){var de=cr,xe=si;return de.items.push(xe.items.shift()),K.items[ge+1]=xe.items[0],ge}if(er&&Si&&!sr){var de=cr,xe=si;return de.items.unshift(xe.items.pop()),K.items[ge]=de.items[0],ge-1}if(er&&!Si&&sr){var de=cr,xe=si;return($e=xe.items).unshift.apply($e,de.items),ou.removeAt(K.children,ge),ou.removeAt(K.items,ge+1),de.prev&&(de.prev.next=xe),xe.prev=de.prev,U(de),ge}if(er&&!Si&&!sr){var de=cr,xe=si;return(Ut=xe.items).push.apply(Ut,de.items),ou.removeAt(K.children,ge),ou.removeAt(K.items,ge),de.next&&(de.next.prev=xe),xe.next=de.next,U(de),ge-1}if(!er&&Si&&sr){var de=cr,xe=si;return de.children.push(xe.children.shift()),de.items.push(xe.items.shift()),K.items[ge+1]=xe.items[0],I(de,de.width-1),I(xe,0),ge}if(!er&&Si&&!sr){var de=cr,xe=si;return de.children.unshift(xe.children.pop()),de.items.unshift(xe.items.pop()),K.items[ge]=de.items[0],I(de,0),I(xe,xe.width-1),ge-1}if(!er&&!Si&&sr){var de=cr,xe=si;return($t=xe.children).unshift.apply($t,de.children),(Er=xe.items).unshift.apply(Er,de.items),ou.removeAt(K.children,ge),ou.removeAt(K.items,ge+1),I(xe,0),de.children.length=0,U(de),ge}if(!er&&!Si&&!sr){var de=cr,xe=si;return(Ir=xe.children).push.apply(Ir,de.children),(Sr=xe.items).push.apply(Sr,de.items),ou.removeAt(K.children,ge),ou.removeAt(K.items,ge),I(xe,0),de.children.length=0,U(de),ge-1}throw"unreachable"}})(Sa||(Sa={}));var yC=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(e){var r=this;this.clear(),_C(e,function(i){r.addLast(i)})},t.prototype.push=function(e){this.addLast(e)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(e){this.addFirst(e)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(e){var r=new Kd.LinkedListNode(this,e);return this._first?(r.next=this._first,this._first.prev=r,this._first=r):(this._first=r,this._last=r),this._size++,r},t.prototype.addLast=function(e){var r=new Kd.LinkedListNode(this,e);return this._last?(r.prev=this._last,this._last.next=r,this._last=r):(this._first=r,this._last=r),this._size++,r},t.prototype.insertBefore=function(e,r){if(!r||r===this._first)return this.addFirst(e);if(!(r instanceof Kd.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var i=new Kd.LinkedListNode(this,e),n=r,o=n.prev;return i.next=n,i.prev=o,n.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(e,r){if(!r||r===this._last)return this.addLast(e);if(!(r instanceof Kd.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var i=new Kd.LinkedListNode(this,e),n=r,o=n.next;return i.next=o,i.prev=n,n.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},t.prototype.removeLast=function(){var e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},t.prototype.removeNode=function(e){if(!(e instanceof Kd.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");var r=e;r===this._first&&r===this._last?(this._first=null,this._last=null):r===this._first?(this._first=r.next,this._first.prev=null):r===this._last?(this._last=r.prev,this._last.next=null):(r.next.prev=r.prev,r.prev.next=r.next),r.list=null,r.next=null,r.prev=null,this._size--},t.prototype.clear=function(){for(var e=this._first;e;){var r=e.next;e.list=null,e.prev=null,e.next=null,e=r}this._first=null,this._last=null,this._size=0},t}();(function(t){function e(s){var l=new t;return l.assign(s),l}t.from=e;var r=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.next,l.value}},s}();t.ForwardValueIterator=r;var i=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.prev,l.value}},s}();t.RetroValueIterator=i;var n=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.next,l}},s}();t.ForwardNodeIterator=n;var o=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.prev,l}},s}();t.RetroNodeIterator=o})(yC||(yC={}));var Kd;(function(t){var e=function(){function r(i,n){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=n}return r}();t.LinkedListNode=e})(Kd||(Kd={}));var bD=function(t,e){return bD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},bD(t,e)};function _Te(t,e){bD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var cc=function(){function t(e){this.type=e}return Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.conflate=function(e){return!1},t}(),ry=function(t){_Te(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.conflate=function(r){return!0},e}(cc),Br;(function(t){function e(B,I){var j=g.get(B);if(!j||j.length===0){ee(B,I);return}var re=AK(gK(j),function(K){return K?J(K,B,I):!0});re&&ee(B,I)}t.sendMessage=e;function r(B,I){if(!I.isConflatable){ne(B,I);return}var j=mK(h,function(re){return re.handler!==B||!re.msg||re.msg.type!==I.type||!re.msg.isConflatable?!1:re.msg.conflate(I)});j||ne(B,I)}t.postMessage=r;function i(B,I){var j=g.get(B);j&&j.indexOf(I)!==-1||(j?j.push(I):g.set(B,[I]))}t.installMessageHook=i;function n(B,I){var j=g.get(B);if(j){var re=j.indexOf(I);re!==-1&&(j[re]=null,k(j))}}t.removeMessageHook=n;function o(B){var I=g.get(B);I&&I.length>0&&(gb.fill(I,null),k(I)),pK(h,function(j){j.handler===B&&(j.handler=null,j.msg=null)})}t.clearData=o;function s(){P||C===0||(U(C),P=!0,oe(),P=!1)}t.flush=s;function l(){return T}t.getExceptionHandler=l;function c(B){var I=T;return T=B,I}t.setExceptionHandler=c;var h=new yC,g=new WeakMap,b=new Set,T=function(B){console.error(B)},C=0,P=!1,H=function(){var B=typeof requestAnimationFrame=="function";return B?requestAnimationFrame:setImmediate}(),U=function(){var B=typeof cancelAnimationFrame=="function";return B?cancelAnimationFrame:clearImmediate}();function J(B,I,j){var re=!0;try{typeof B=="function"?re=B(I,j):re=B.messageHook(I,j)}catch(K){T(K)}return re}function ee(B,I){try{B.processMessage(I)}catch(j){T(j)}}function ne(B,I){h.addLast({handler:B,msg:I}),C===0&&(C=H(oe))}function oe(){if(C=0,!h.isEmpty){var B={handler:null,msg:null};for(h.addLast(B);;){var I=h.removeFirst();if(I===B)return;I.handler&&I.msg&&e(I.handler,I.msg)}}}function k(B){b.size===0&&H(Ie),b.add(B)}function Ie(){b.forEach(Y),b.clear()}function Y(B){gb.removeAllWhere(B,X)}function X(B){return B===null}})(Br||(Br={}));var fc=function(){function t(e){this._pid=og.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}return t.prototype.get=function(e){var r,i=og.ensureMap(e);return this._pid in i?r=i[this._pid]:r=i[this._pid]=this._createValue(e),r},t.prototype.set=function(e,r){var i,n=og.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);var o=this._coerceValue(e,r);this._maybeNotify(e,i,n[this._pid]=o)},t.prototype.coerce=function(e){var r,i=og.ensureMap(e);this._pid in i?r=i[this._pid]:r=i[this._pid]=this._createValue(e);var n=this._coerceValue(e,r);this._maybeNotify(e,r,i[this._pid]=n)},t.prototype._createValue=function(e){var r=this._create;return r(e)},t.prototype._coerceValue=function(e,r){var i=this._coerce;return i?i(e,r):r},t.prototype._compareValue=function(e,r){var i=this._compare;return i?i(e,r):e===r},t.prototype._maybeNotify=function(e,r,i){var n=this._changed;n&&!this._compareValue(r,i)&&n(e,r,i)},t}();(function(t){function e(r){og.ownerData.delete(r)}t.clearData=e})(fc||(fc={}));var og;(function(t){t.ownerData=new WeakMap,t.nextPID=function(){var r=0;return function(){var i=Math.random(),n=(""+i).slice(2);return"pid-"+n+"-"+r++}}();function e(r){var i=t.ownerData.get(r);return i||(i=Object.create(null),t.ownerData.set(r,i),i)}t.ensureMap=e})(og||(og={}));var Mo=function(){function t(e){this.sender=e}return t.prototype.connect=function(e,r){return hc.connect(this,e,r)},t.prototype.disconnect=function(e,r){return hc.disconnect(this,e,r)},t.prototype.emit=function(e){hc.emit(this,e)},t}();(function(t){function e(c,h){hc.disconnectBetween(c,h)}t.disconnectBetween=e;function r(c){hc.disconnectSender(c)}t.disconnectSender=r;function i(c){hc.disconnectReceiver(c)}t.disconnectReceiver=i;function n(c){hc.disconnectAll(c)}t.disconnectAll=n;function o(c){hc.disconnectAll(c)}t.clearData=o;function s(){return hc.exceptionHandler}t.getExceptionHandler=s;function l(c){var h=hc.exceptionHandler;return hc.exceptionHandler=c,h}t.setExceptionHandler=l})(Mo||(Mo={}));var hc;(function(t){t.exceptionHandler=function(ee){console.error(ee)};function e(ee,ne,oe){oe=oe||void 0;var k=c.get(ee.sender);if(k||(k=[],c.set(ee.sender,k)),T(k,ee,ne,oe))return!1;var Ie=oe||ne,Y=h.get(Ie);Y||(Y=[],h.set(Ie,Y));var X={signal:ee,slot:ne,thisArg:oe};return k.push(X),Y.push(X),!0}t.connect=e;function r(ee,ne,oe){oe=oe||void 0;var k=c.get(ee.sender);if(!k||k.length===0)return!1;var Ie=T(k,ee,ne,oe);if(!Ie)return!1;var Y=oe||ne,X=h.get(Y);return Ie.signal=null,P(k),P(X),!0}t.disconnect=r;function i(ee,ne){var oe=c.get(ee);if(!(!oe||oe.length===0)){var k=h.get(ne);!k||k.length===0||(hn(k,function(Ie){Ie.signal&&Ie.signal.sender===ee&&(Ie.signal=null)}),P(oe),P(k))}}t.disconnectBetween=i;function n(ee){var ne=c.get(ee);!ne||ne.length===0||(hn(ne,function(oe){if(oe.signal){var k=oe.thisArg||oe.slot;oe.signal=null,P(h.get(k))}}),P(ne))}t.disconnectSender=n;function o(ee){var ne=h.get(ee);!ne||ne.length===0||(hn(ne,function(oe){if(oe.signal){var k=oe.signal.sender;oe.signal=null,P(c.get(k))}}),P(ne))}t.disconnectReceiver=o;function s(ee){n(ee),o(ee)}t.disconnectAll=s;function l(ee,ne){var oe=c.get(ee.sender);if(!(!oe||oe.length===0))for(var k=0,Ie=oe.length;k<Ie;++k){var Y=oe[k];Y.signal===ee&&C(Y,ne)}}t.emit=l;var c=new WeakMap,h=new WeakMap,g=new Set,b=function(){var ee=typeof requestAnimationFrame=="function";return ee?requestAnimationFrame:setImmediate}();function T(ee,ne,oe,k){return ty(ee,function(Ie){return Ie.signal===ne&&Ie.slot===oe&&Ie.thisArg===k})}function C(ee,ne){var oe=ee.signal,k=ee.slot,Ie=ee.thisArg;try{k.call(Ie,oe.sender,ne)}catch(Y){t.exceptionHandler(Y)}}function P(ee){g.size===0&&b(H),g.add(ee)}function H(){g.forEach(U),g.clear()}function U(ee){ti.removeAllWhere(ee,J)}function J(ee){return ee.signal===null}})(hc||(hc={}));var ha;(function(t){t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]);function e(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"}t.isPrimitive=e;function r(g){return Array.isArray(g)}t.isArray=r;function i(g){return!e(g)&&!r(g)}t.isObject=i;function n(g,b){if(g===b)return!0;if(e(g)||e(b))return!1;var T=r(g),C=r(b);return T!==C?!1:T&&C?s(g,b):l(g,b)}t.deepEqual=n;function o(g){return e(g)?g:r(g)?c(g):h(g)}t.deepCopy=o;function s(g,b){if(g===b)return!0;if(g.length!==b.length)return!1;for(var T=0,C=g.length;T<C;++T)if(!n(g[T],b[T]))return!1;return!0}function l(g,b){if(g===b)return!0;for(var T in g)if(g[T]!==void 0&&!(T in b))return!1;for(var T in b)if(b[T]!==void 0&&!(T in g))return!1;for(var T in g){var C=g[T],P=b[T];if(!(C===void 0&&P===void 0)&&(C===void 0||P===void 0||!n(C,P)))return!1}return!0}function c(g){for(var b=new Array(g.length),T=0,C=g.length;T<C;++T)b[T]=o(g[T]);return b}function h(g){var b={};for(var T in g){var C=g[T];C!==void 0&&(b[T]=o(C))}return b}})(ha||(ha={}));var xK=function(){function t(){this._types=[],this._values=[]}return t.prototype.types=function(){return this._types.slice()},t.prototype.hasData=function(e){return this._types.indexOf(e)!==-1},t.prototype.getData=function(e){var r=this._types.indexOf(e);return r!==-1?this._values[r]:void 0},t.prototype.setData=function(e,r){this.clearData(e),this._types.push(e),this._values.push(r)},t.prototype.clearData=function(e){var r=this._types.indexOf(e);r!==-1&&(this._types.splice(r,1),this._values.splice(r,1))},t.prototype.clear=function(){this._types.length=0,this._values.length=0},t}(),Xpt=function(){function t(){var e=this;this.promise=new Promise(function(r,i){e._resolve=r,e._reject=i})}return t.prototype.resolve=function(e){var r=this._resolve;r(e)},t.prototype.reject=function(e){var r=this._reject;r(e)},t}(),wD;(function(t){t.getRandomValues=function(){var e=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof Ug<"u"&&NO()||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:e&&typeof e.randomFillSync=="function"?function(i){return e.randomFillSync(i)}:e&&typeof e.randomBytes=="function"?function(i){for(var n=e.randomBytes(i.length),o=0,s=n.length;o<s;++o)i[o]=n[o]}:function(i){for(var n=0,o=0,s=i.length;o<s;++o)o%4===0&&(n=Math.random()*4294967295>>>0),i[o]=n&255,n>>>=8}}()})(wD||(wD={}));var Ypt=function(){function t(e){this.name=e,this._tokenStructuralPropertyT=null}return t}(),vK;(function(t){t.uuid4=function(){for(var e=new Uint8Array(16),r=new Array(256),i=0;i<16;++i)r[i]="0"+i.toString(16);for(var i=16;i<256;++i)r[i]=i.toString(16);return function(){return wD.getRandomValues(e),e[6]=64|e[6]&15,e[8]=128|e[8]&63,r[e[0]]+r[e[1]]+r[e[2]]+r[e[3]]+"-"+r[e[4]]+r[e[5]]+"-"+r[e[6]]+r[e[7]]+"-"+r[e[8]]+r[e[9]]+"-"+r[e[10]]+r[e[11]]+r[e[12]]+r[e[13]]+r[e[14]]+r[e[15]]}}()})(vK||(vK={}));var TD=function(t,e){return TD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},TD(t,e)};function wK(t,e){TD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var iy=function(){function t(e){this._fn=e}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var e=this._fn;this._fn=null,e()}},t}(),$pt=function(t){wK(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Mo(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),Mo.clearData(this))},e}(iy),ED=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(e){e.dispose()}),this._items.clear())},t.prototype.contains=function(e){return this._items.has(e)},t.prototype.add=function(e){this._items.add(e)},t.prototype.remove=function(e){this._items.delete(e)},t.prototype.clear=function(){this._items.clear()},t}();(function(t){function e(r){var i=new t;return hn(r,function(n){i.add(n)}),i}t.from=e})(ED||(ED={}));var bK=function(t){wK(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Mo(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),Mo.clearData(this))},e}(ED);(function(t){function e(r){var i=new t;return hn(r,function(n){i.add(n)}),i}t.from=e})(bK||(bK={}));function _b(){return CD.keyboardLayout}var SD=function(){function t(e,r){this.name=e,this._codes=r,this._keys=t.extractKeys(r)}return t.prototype.keys=function(){return Object.keys(this._keys)},t.prototype.isValidKey=function(e){return e in this._keys},t.prototype.keyForKeydownEvent=function(e){return this._codes[e.keyCode]||""},t}();(function(t){function e(r){var i=Object.create(null);for(var n in r)i[r[n]]=!0;return i}t.extractKeys=e})(SD||(SD={}));var yTe=new SD("en-us",{8:"Backspace",9:"Tab",13:"Enter",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}),CD;(function(t){t.keyboardLayout=yTe})(CD||(CD={}));var ny=function(){function t(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new Mo(this),this._commandExecuted=new Mo(this),this._keyBindingChanged=new Mo(this)}return Object.defineProperty(t.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),t.prototype.listCommands=function(){return Object.keys(this._commands)},t.prototype.hasCommand=function(e){return e in this._commands},t.prototype.addCommand=function(e,r){var i=this;if(e in this._commands)throw new Error("Command '"+e+"' already registered.");return this._commands[e]=sg.createCommand(r),this._commandChanged.emit({id:e,type:"added"}),new iy(function(){delete i._commands[e],i._commandChanged.emit({id:e,type:"removed"})})},t.prototype.notifyCommandChanged=function(e){if(e!==void 0&&!(e in this._commands))throw new Error("Command '"+e+"' is not registered.");this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})},t.prototype.label=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.label.call(void 0,r):""},t.prototype.mnemonic=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.mnemonic.call(void 0,r):-1},t.prototype.icon=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.icon.call(void 0,r):""},t.prototype.iconClass=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.iconClass.call(void 0,r):""},t.prototype.iconLabel=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.iconLabel.call(void 0,r):""},t.prototype.caption=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.caption.call(void 0,r):""},t.prototype.usage=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.usage.call(void 0,r):""},t.prototype.className=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.className.call(void 0,r):""},t.prototype.dataset=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.dataset.call(void 0,r):{}},t.prototype.isEnabled=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.isEnabled.call(void 0,r):!1},t.prototype.isToggled=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.isToggled.call(void 0,r):!1},t.prototype.isVisible=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];return i?i.isVisible.call(void 0,r):!1},t.prototype.execute=function(e,r){r===void 0&&(r=ha.emptyObject);var i=this._commands[e];if(!i)return Promise.reject(new Error("Command '"+e+"' not registered."));var n;try{n=i.execute.call(void 0,r)}catch(s){n=Promise.reject(s)}var o=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:r,result:o}),o},t.prototype.addKeyBinding=function(e){var r=this,i=sg.createKeyBinding(e);return this._keyBindings.push(i),this._keyBindingChanged.emit({binding:i,type:"added"}),new iy(function(){ti.removeFirstOf(r._keyBindings,i),r._keyBindingChanged.emit({binding:i,type:"removed"})})},t.prototype.processKeydownEvent=function(e){if(!this._replaying){var r=t.keystrokeForKeydownEvent(e);if(!r){this._replayKeydownEvents(),this._clearPendingState();return}this._keystrokes.push(r);var i=sg.matchKeyBinding(this._keyBindings,this._keystrokes,e),n=i.exact,o=i.partial;if(!n&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if(e.preventDefault(),e.stopPropagation(),n&&!o){this._executeKeyBinding(n),this._clearPendingState();return}n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var e=this;this._clearTimer(),this._timerID=window.setTimeout(function(){e._onPendingTimeout()},sg.CHORD_TIMEOUT)},t.prototype._clearTimer=function(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)},t.prototype._replayKeydownEvents=function(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(sg.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(e){var r=e.command,i=e.args;if(!this.hasCommand(r)||!this.isEnabled(r,i)){var n=this.hasCommand(r)?"enabled":"registered",o=e.keys.join(", "),s="Cannot execute key binding '"+o+"':",l="command '"+r+"' is not "+n+".";console.warn(s+" "+l);return}this.execute(r,i)},t.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},t.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},t}();(function(t){function e(s){for(var l="",c=!1,h=!1,g=!1,b=!1,T=0,C=s.split(/\s+/);T<C.length;T++){var P=C[T];P==="Accel"?nu.IS_MAC?h=!0:g=!0:P==="Alt"?c=!0:P==="Cmd"?h=!0:P==="Ctrl"?g=!0:P==="Shift"?b=!0:P.length>0&&(l=P)}return{cmd:h,ctrl:g,alt:c,shift:b,key:l}}t.parseKeystroke=e;function r(s){var l="",c=e(s);return c.ctrl&&(l+="Ctrl "),c.alt&&(l+="Alt "),c.shift&&(l+="Shift "),c.cmd&&nu.IS_MAC&&(l+="Cmd "),l+c.key}t.normalizeKeystroke=r;function i(s){var l;return nu.IS_WIN?l=s.winKeys||s.keys:nu.IS_MAC?l=s.macKeys||s.keys:l=s.linuxKeys||s.keys,l.map(r)}t.normalizeKeys=i;function n(s){var l="",c=e(s);return nu.IS_MAC?(c.ctrl&&(l+="\u2303 "),c.alt&&(l+="\u2325 "),c.shift&&(l+="\u21E7 "),c.cmd&&(l+="\u2318 ")):(c.ctrl&&(l+="Ctrl+"),c.alt&&(l+="Alt+"),c.shift&&(l+="Shift+")),l+c.key}t.formatKeystroke=n;function o(s){var l=_b().keyForKeydownEvent(s);if(!l)return"";var c="";return s.ctrlKey&&(c+="Ctrl "),s.altKey&&(c+="Alt "),s.shiftKey&&(c+="Shift "),s.metaKey&&nu.IS_MAC&&(c+="Cmd "),c+l}t.keystrokeForKeydownEvent=o})(ny||(ny={}));var sg;(function(t){t.CHORD_TIMEOUT=1e3;function e(U){var J,ee;return!U.icon||typeof U.icon=="string"?(ee=b(U.iconClass||U.icon,o),J=ee):(ee=b(U.iconClass,o),J=b(U.icon,g)),{execute:U.execute,label:b(U.label,o),mnemonic:b(U.mnemonic,s),icon:J,iconClass:ee,iconLabel:b(U.iconLabel,o),caption:b(U.caption,o),usage:b(U.usage,o),className:b(U.className,o),dataset:b(U.dataset,h),isEnabled:U.isEnabled||l,isToggled:U.isToggled||c,isVisible:U.isVisible||l}}t.createCommand=e;function r(U){return{keys:ny.normalizeKeys(U),selector:T(U),command:U.command,args:U.args||ha.emptyObject}}t.createKeyBinding=r;function i(U,J,ee){for(var ne=null,oe=!1,k=1/0,Ie=0,Y=0,X=U.length;Y<X;++Y){var B=U[Y],I=C(B.keys,J);if(I!==0){if(I===2){!oe&&P(B.selector,ee)!==-1&&(oe=!0);continue}var j=P(B.selector,ee);if(!(j===-1||j>k)){var re=jf.calculateSpecificity(B.selector);(!ne||j<k||re>=Ie)&&(ne=B,k=j,Ie=re)}}}return{exact:ne,partial:oe}}t.matchKeyBinding=i;function n(U){U.target.dispatchEvent(H(U))}t.replayKeyEvent=n;var o=function(){return""},s=function(){return-1},l=function(){return!0},c=function(){return!1},h=function(){return{}},g=function(){};function b(U,J){return U===void 0?J:typeof U=="function"?U:function(){return U}}function T(U){if(U.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+U.selector);if(!jf.isValid(U.selector))throw new Error("Invalid selector: "+U.selector);return U.selector}function C(U,J){if(U.length<J.length)return 0;for(var ee=0,ne=J.length;ee<ne;++ee)if(U[ee]!==J[ee])return 0;return U.length>J.length?2:1}function P(U,J){for(var ee=J.target,ne=J.currentTarget,oe=0;ee!==null;ee=ee.parentElement,++oe){if(ee.hasAttribute("data-lm-suppress-shortcuts")||ee.hasAttribute("data-p-suppress-shortcuts"))return-1;if(jf.matches(ee,U))return oe;if(ee===ne)return-1}return-1}function H(U){var J=document.createEvent("Event"),ee=U.bubbles||!0,ne=U.cancelable||!0;return J.initEvent(U.type||"keydown",ee,ne),J.key=U.key||"",J.keyCode=U.keyCode||0,J.which=U.keyCode||0,J.ctrlKey=U.ctrlKey||!1,J.altKey=U.altKey||!1,J.shiftKey=U.shiftKey||!1,J.metaKey=U.metaKey||!1,J.view=U.view||window,J}})(sg||(sg={}));var Qp;(function(t){function e(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(Y[ge]===X)return ge}return-1}t.firstIndexOf=e;function r(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(Y[ge]===X)return ge}return-1}t.lastIndexOf=r;function i(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(X(Y[ge],ge))return ge}return-1}t.findFirstIndex=i;function n(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(X(Y[ge],ge))return ge}return-1}t.findLastIndex=n;function o(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=i(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findFirstValue=o;function s(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=n(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findLastValue=s;function l(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)<0?(K=Ut+1,ge-=$e+1):ge=$e}return K}t.lowerBound=l;function c(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)>0?ge=$e:(K=Ut+1,ge-=$e+1)}return K}t.upperBound=c;function h(Y,X,B){if(Y===X)return!0;if(Y.length!==X.length)return!1;for(var I=0,j=Y.length;I<j;++I)if(B?!B(Y[I],X[I]):Y[I]!==X[I])return!1;return!0}t.shallowEqual=h;function g(Y,X){X===void 0&&(X={});var B=X.start,I=X.stop,j=X.step;if(j===void 0&&(j=1),j===0)throw new Error("Slice `step` cannot be zero.");var re=Y.length;B===void 0?B=j<0?re-1:0:B<0?B=Math.max(B+re,j<0?-1:0):B>=re&&(B=j<0?re-1:re),I===void 0?I=j<0?-1:re:I<0?I=Math.max(I+re,j<0?-1:0):I>=re&&(I=j<0?re-1:re);var K;j<0&&I>=B||j>0&&B>=I?K=0:j<0?K=Math.floor((I-B+1)/j+1):K=Math.floor((I-B-1)/j+1);for(var ge=[],$e=0;$e<K;++$e)ge[$e]=Y[B+$e*j];return ge}t.slice=g;function b(Y,X,B){var I=Y.length;if(!(I<=1)&&(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1),X!==B)){for(var j=Y[X],re=X<B?1:-1,K=X;K!==B;K+=re)Y[K]=Y[K+re];Y[B]=j}}t.move=b;function T(Y,X,B){X===void 0&&(X=0),B===void 0&&(B=-1);var I=Y.length;if(!(I<=1))for(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1);X<B;){var j=Y[X],re=Y[B];Y[X++]=re,Y[B--]=j}}t.reverse=T;function C(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(!(j<=1)&&(B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1),!(B>=I))){var re=I-B+1;if(X>0?X=X%re:X<0&&(X=(X%re+re)%re),X!==0){var K=B+X;T(Y,B,K-1),T(Y,K,I),T(Y,B,I)}}}t.rotate=C;function P(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j!==0){B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K)Y[(B+K)%j]=X}}t.fill=P;function H(Y,X,B){var I=Y.length;X<0?X=Math.max(0,X+I):X=Math.min(X,I);for(var j=I;j>X;--j)Y[j]=Y[j-1];Y[X]=B}t.insert=H;function U(Y,X){var B=Y.length;if(X<0&&(X+=B),!(X<0||X>=B)){for(var I=Y[X],j=X+1;j<B;++j)Y[j-1]=Y[j];return Y.length=B-1,I}}t.removeAt=U;function J(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=e(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeFirstOf=J;function ee(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=r(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeLastOf=ee;function ne(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&Y[K]===X||I<B&&(K<=I||K>=B)&&Y[K]===X?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllOf=ne;function oe(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j,re=i(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeFirstWhere=oe;function k(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j,re=n(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeLastWhere=k;function Ie(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&X(Y[K],K)||I<B&&(K<=I||K>=B)&&X(Y[K],K)?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllWhere=Ie})(Qp||(Qp={}));var uAt=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),cAt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),fAt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),hAt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),dAt=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();var pAt=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();var AAt=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var mAt=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();var gAt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();var _At=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var yAt=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=MD.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),MD;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(MD||(MD={}));var vAt=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();var xAt=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var bAt=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),TK;(function(t){function e(s,l,c){c===void 0&&(c=0);for(var h=new Array(l.length),g=0,b=c,T=l.length;g<T;++g,++b){if(b=s.indexOf(l[g],b),b===-1)return null;h[g]=b}return h}t.findIndices=e;function r(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=0,T=h.length;b<T;++b){var C=h[b]-c;g+=C*C}return{score:g,indices:h}}t.matchSumOfSquares=r;function i(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=c-1,T=0,C=h.length;T<C;++T){var P=h[T];g+=P-b-1,b=P}return{score:g,indices:h}}t.matchSumOfDeltas=i;function n(s,l,c){for(var h=[],g=0,b=0,T=l.length;g<T;){for(var C=l[g],P=l[g];++g<T&&l[g]===P+1;)P++;b<C&&h.push(s.slice(b,C)),C<P+1&&h.push(c(s.slice(C,P+1))),b=P+1}return b<s.length&&h.push(s.slice(b)),h}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(TK||(TK={}));var wAt=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var TAt=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var ID=function(t,e){return ID=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},ID(t,e)};function vTe(t,e){ID(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var vC=function(){function t(e){this.type="text",this.content=e}return t}(),xC=function(){function t(e,r,i,n){this.type="element",this.tag=e,this.attrs=r,this.children=i,this.renderer=n}return t}(),CAt=function(t){vTe(e,t);function e(r,i,n){return t.call(this,r,i,[],n||void 0)||this}return e}(xC);function Fo(t){for(var e={},r,i=[],n=1,o=arguments.length;n<o;++n){var s=arguments[n];typeof s=="string"?i.push(new vC(s)):s instanceof vC||s instanceof xC?i.push(s):s instanceof Array?l(i,s):(n===1||n===2)&&s&&typeof s=="object"&&("render"in s?r=s:e=s)}return new xC(t,e,i,r);function l(c,h){for(var g=0,b=h;g<b.length;g++){var T=b[g];typeof T=="string"?c.push(new vC(T)):(T instanceof vC||T instanceof xC)&&c.push(T)}}}(function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")})(Fo||(Fo={}));var Zd;(function(t){function e(i){return ag.createDOMNode(i)}t.realize=e;function r(i,n){var o=ag.hostMap.get(n)||[],s=ag.asContentArray(i);ag.hostMap.set(n,s),ag.updateContent(n,o,s)}t.render=r})(Zd||(Zd={}));var ag;(function(t){t.hostMap=new WeakMap;function e(C){return C?C instanceof Array?C:[C]:[]}t.asContentArray=e;function r(C){var P=arguments[1]||null,H=arguments[2]||null;if(P)P.insertBefore(r(C),H);else{if(C.type==="text")return document.createTextNode(C.content);if(P=document.createElement(C.tag),s(P,C.attrs),C.renderer)return C.renderer.render(P,{attrs:C.attrs,children:C.children}),P;for(var U=0,J=C.children.length;U<J;++U)r(C.children[U],P)}return P}t.createDOMNode=r;function i(C,P,H){if(P!==H){for(var U=T(C,P),J=P.slice(),ee=C.firstChild,ne=H.length,oe=0;oe<ne;++oe){if(oe>=J.length){r(H[oe],C);continue}var k=J[oe],Ie=H[oe];if(k===Ie){ee=ee.nextSibling;continue}if(k.type==="text"&&Ie.type==="text"){ee.textContent=Ie.content,ee=ee.nextSibling;continue}if(k.type==="text"||Ie.type==="text"){Qp.insert(J,oe,Ie),r(Ie,C,ee);continue}if(!k.renderer!=!Ie.renderer){Qp.insert(J,oe,Ie),r(Ie,C,ee);continue}var Y=Ie.attrs.key;if(Y&&Y in U){var X=U[Y];X.vNode!==k&&(Qp.move(J,J.indexOf(X.vNode,oe+1),oe),C.insertBefore(X.element,ee),k=X.vNode,ee=X.element)}if(k===Ie){ee=ee.nextSibling;continue}var B=k.attrs.key;if(B&&B!==Y){Qp.insert(J,oe,Ie),r(Ie,C,ee);continue}if(k.tag!==Ie.tag){Qp.insert(J,oe,Ie),r(Ie,C,ee);continue}l(ee,k.attrs,Ie.attrs),Ie.renderer?Ie.renderer.render(ee,{attrs:Ie.attrs,children:Ie.children}):i(ee,k.children,Ie.children),ee=ee.nextSibling}n(C,J,ne,!0)}}t.updateContent=i;function n(C,P,H,U){for(var J=P.length-1;J>=H;--J){var ee=P[J],ne=U?C.lastChild:C.childNodes[J];ee.type==="text"||(ee.renderer&&ee.renderer.unrender?ee.renderer.unrender(ne,{attrs:ee.attrs,children:ee.children}):n(ne,ee.children,0,!1)),U&&C.removeChild(ne)}}var o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function s(C,P){for(var H in P)H in o||(H.substr(0,2)==="on"?C[H]=P[H]:C.setAttribute(H,P[H]));P.className!==void 0&&C.setAttribute("class",P.className),P.htmlFor!==void 0&&C.setAttribute("for",P.htmlFor),P.dataset&&c(C,P.dataset),P.style&&g(C,P.style)}function l(C,P,H){if(P!==H){var U;for(U in P)U in o||U in H||(U.substr(0,2)==="on"?C[U]=null:C.removeAttribute(U));for(U in H)U in o||P[U]===H[U]||(U.substr(0,2)==="on"?C[U]=H[U]:C.setAttribute(U,H[U]));P.className!==H.className&&(H.className!==void 0?C.setAttribute("class",H.className):C.removeAttribute("class")),P.htmlFor!==H.htmlFor&&(H.htmlFor!==void 0?C.setAttribute("for",H.htmlFor):C.removeAttribute("for")),P.dataset!==H.dataset&&h(C,P.dataset||{},H.dataset||{}),P.style!==H.style&&b(C,P.style||{},H.style||{})}}function c(C,P){for(var H in P)C.setAttribute("data-"+H,P[H])}function h(C,P,H){for(var U in P)U in H||C.removeAttribute("data-"+U);for(var J in H)P[J]!==H[J]&&C.setAttribute("data-"+J,H[J])}function g(C,P){var H=C.style,U;for(U in P)H[U]=P[U]}function b(C,P,H){var U=C.style,J;for(J in P)J in H||(U[J]="");for(J in H)P[J]!==H[J]&&(U[J]=H[J])}function T(C,P){for(var H=C.firstChild,U=Object.create(null),J=0,ee=P;J<ee.length;J++){var ne=ee[J];ne.type==="element"&&ne.attrs.key&&(U[ne.attrs.key]={vNode:ne,element:H}),H=H.nextSibling}return U}})(ag||(ag={}));var bC;(function(t){function e(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(Y[ge]===X)return ge}return-1}t.firstIndexOf=e;function r(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(Y[ge]===X)return ge}return-1}t.lastIndexOf=r;function i(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K){var ge=(B+K)%j;if(X(Y[ge],ge))return ge}return-1}t.findFirstIndex=i;function n(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=Y.length;if(j===0)return-1;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;B<I?re=B+1+(j-I):re=B-I+1;for(var K=0;K<re;++K){var ge=(B-K+j)%j;if(X(Y[ge],ge))return ge}return-1}t.findLastIndex=n;function o(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=i(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findFirstValue=o;function s(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=n(Y,X,B,I);return j!==-1?Y[j]:void 0}t.findLastValue=s;function l(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)<0?(K=Ut+1,ge-=$e+1):ge=$e}return K}t.lowerBound=l;function c(Y,X,B,I,j){I===void 0&&(I=0),j===void 0&&(j=-1);var re=Y.length;if(re===0)return 0;I<0?I=Math.max(0,I+re):I=Math.min(I,re-1),j<0?j=Math.max(0,j+re):j=Math.min(j,re-1);for(var K=I,ge=j-I+1;ge>0;){var $e=ge>>1,Ut=K+$e;B(Y[Ut],X)>0?ge=$e:(K=Ut+1,ge-=$e+1)}return K}t.upperBound=c;function h(Y,X,B){if(Y===X)return!0;if(Y.length!==X.length)return!1;for(var I=0,j=Y.length;I<j;++I)if(B?!B(Y[I],X[I]):Y[I]!==X[I])return!1;return!0}t.shallowEqual=h;function g(Y,X){X===void 0&&(X={});var B=X.start,I=X.stop,j=X.step;if(j===void 0&&(j=1),j===0)throw new Error("Slice `step` cannot be zero.");var re=Y.length;B===void 0?B=j<0?re-1:0:B<0?B=Math.max(B+re,j<0?-1:0):B>=re&&(B=j<0?re-1:re),I===void 0?I=j<0?-1:re:I<0?I=Math.max(I+re,j<0?-1:0):I>=re&&(I=j<0?re-1:re);var K;j<0&&I>=B||j>0&&B>=I?K=0:j<0?K=Math.floor((I-B+1)/j+1):K=Math.floor((I-B-1)/j+1);for(var ge=[],$e=0;$e<K;++$e)ge[$e]=Y[B+$e*j];return ge}t.slice=g;function b(Y,X,B){var I=Y.length;if(!(I<=1)&&(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1),X!==B)){for(var j=Y[X],re=X<B?1:-1,K=X;K!==B;K+=re)Y[K]=Y[K+re];Y[B]=j}}t.move=b;function T(Y,X,B){X===void 0&&(X=0),B===void 0&&(B=-1);var I=Y.length;if(!(I<=1))for(X<0?X=Math.max(0,X+I):X=Math.min(X,I-1),B<0?B=Math.max(0,B+I):B=Math.min(B,I-1);X<B;){var j=Y[X],re=Y[B];Y[X++]=re,Y[B--]=j}}t.reverse=T;function C(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(!(j<=1)&&(B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1),!(B>=I))){var re=I-B+1;if(X>0?X=X%re:X<0&&(X=(X%re+re)%re),X!==0){var K=B+X;T(Y,B,K-1),T(Y,K,I),T(Y,B,I)}}}t.rotate=C;function P(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j!==0){B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);var re;I<B?re=I+1+(j-B):re=I-B+1;for(var K=0;K<re;++K)Y[(B+K)%j]=X}}t.fill=P;function H(Y,X,B){var I=Y.length;X<0?X=Math.max(0,X+I):X=Math.min(X,I);for(var j=I;j>X;--j)Y[j]=Y[j-1];Y[X]=B}t.insert=H;function U(Y,X){var B=Y.length;if(X<0&&(X+=B),!(X<0||X>=B)){for(var I=Y[X],j=X+1;j<B;++j)Y[j-1]=Y[j];return Y.length=B-1,I}}t.removeAt=U;function J(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=e(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeFirstOf=J;function ee(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j=r(Y,X,B,I);return j!==-1&&U(Y,j),j}t.removeLastOf=ee;function ne(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&Y[K]===X||I<B&&(K<=I||K>=B)&&Y[K]===X?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllOf=ne;function oe(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j,re=i(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeFirstWhere=oe;function k(Y,X,B,I){B===void 0&&(B=-1),I===void 0&&(I=0);var j,re=n(Y,X,B,I);return re!==-1&&(j=U(Y,re)),{index:re,value:j}}t.removeLastWhere=k;function Ie(Y,X,B,I){B===void 0&&(B=0),I===void 0&&(I=-1);var j=Y.length;if(j===0)return 0;B<0?B=Math.max(0,B+j):B=Math.min(B,j-1),I<0?I=Math.max(0,I+j):I=Math.min(I,j-1);for(var re=0,K=0;K<j;++K)B<=I&&K>=B&&K<=I&&X(Y[K],K)||I<B&&(K<=I||K>=B)&&X(Y[K],K)?re++:re>0&&(Y[K-re]=Y[K]);return re>0&&(Y.length=j-re),re}t.removeAllWhere=Ie})(bC||(bC={}));function SK(t){var e;return typeof t.iter=="function"?e=t.iter():e=new xTe(t),e}function lg(t,e){for(var r=0,i=SK(t),n;(n=i.next())!==void 0;)if(e(n,r++)===!1)return}var xTe=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),IAt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),PAt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),RAt=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),BAt=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();var OAt=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();var DAt=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var LAt=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();var FAt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();function CK(t,e){for(var r=0,i=SK(t),n;(n=i.next())!==void 0;)if(e(n,r++))return n}var NAt=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var kAt=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=PD.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),PD;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(PD||(PD={}));var UAt=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();var zAt=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var VAt=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),EK;(function(t){function e(s,l,c){c===void 0&&(c=0);for(var h=new Array(l.length),g=0,b=c,T=l.length;g<T;++g,++b){if(b=s.indexOf(l[g],b),b===-1)return null;h[g]=b}return h}t.findIndices=e;function r(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=0,T=h.length;b<T;++b){var C=h[b]-c;g+=C*C}return{score:g,indices:h}}t.matchSumOfSquares=r;function i(s,l,c){c===void 0&&(c=0);var h=e(s,l,c);if(!h)return null;for(var g=0,b=c-1,T=0,C=h.length;T<C;++T){var P=h[T];g+=P-b-1,b=P}return{score:g,indices:h}}t.matchSumOfDeltas=i;function n(s,l,c){for(var h=[],g=0,b=0,T=l.length;g<T;){for(var C=l[g],P=l[g];++g<T&&l[g]===P+1;)P++;b<C&&h.push(s.slice(b,C)),C<P+1&&h.push(c(s.slice(C,P+1))),b=P+1}return b<s.length&&h.push(s.slice(b)),h}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(EK||(EK={}));var HAt=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var jAt=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var ug=function(){function t(e){this.sender=e}return t.prototype.connect=function(e,r){return dc.connect(this,e,r)},t.prototype.disconnect=function(e,r){return dc.disconnect(this,e,r)},t.prototype.emit=function(e){dc.emit(this,e)},t}();(function(t){function e(c,h){dc.disconnectBetween(c,h)}t.disconnectBetween=e;function r(c){dc.disconnectSender(c)}t.disconnectSender=r;function i(c){dc.disconnectReceiver(c)}t.disconnectReceiver=i;function n(c){dc.disconnectAll(c)}t.disconnectAll=n;function o(c){dc.disconnectAll(c)}t.clearData=o;function s(){return dc.exceptionHandler}t.getExceptionHandler=s;function l(c){var h=dc.exceptionHandler;return dc.exceptionHandler=c,h}t.setExceptionHandler=l})(ug||(ug={}));var dc;(function(t){t.exceptionHandler=function(ee){console.error(ee)};function e(ee,ne,oe){oe=oe||void 0;var k=c.get(ee.sender);if(k||(k=[],c.set(ee.sender,k)),T(k,ee,ne,oe))return!1;var Ie=oe||ne,Y=h.get(Ie);Y||(Y=[],h.set(Ie,Y));var X={signal:ee,slot:ne,thisArg:oe};return k.push(X),Y.push(X),!0}t.connect=e;function r(ee,ne,oe){oe=oe||void 0;var k=c.get(ee.sender);if(!k||k.length===0)return!1;var Ie=T(k,ee,ne,oe);if(!Ie)return!1;var Y=oe||ne,X=h.get(Y);return Ie.signal=null,P(k),P(X),!0}t.disconnect=r;function i(ee,ne){var oe=c.get(ee);if(!(!oe||oe.length===0)){var k=h.get(ne);!k||k.length===0||(lg(k,function(Ie){Ie.signal&&Ie.signal.sender===ee&&(Ie.signal=null)}),P(oe),P(k))}}t.disconnectBetween=i;function n(ee){var ne=c.get(ee);!ne||ne.length===0||(lg(ne,function(oe){if(oe.signal){var k=oe.thisArg||oe.slot;oe.signal=null,P(h.get(k))}}),P(ne))}t.disconnectSender=n;function o(ee){var ne=h.get(ee);!ne||ne.length===0||(lg(ne,function(oe){if(oe.signal){var k=oe.signal.sender;oe.signal=null,P(c.get(k))}}),P(ne))}t.disconnectReceiver=o;function s(ee){n(ee),o(ee)}t.disconnectAll=s;function l(ee,ne){var oe=c.get(ee.sender);if(!(!oe||oe.length===0))for(var k=0,Ie=oe.length;k<Ie;++k){var Y=oe[k];Y.signal===ee&&C(Y,ne)}}t.emit=l;var c=new WeakMap,h=new WeakMap,g=new Set,b=function(){var ee=typeof requestAnimationFrame=="function";return ee?requestAnimationFrame:setImmediate}();function T(ee,ne,oe,k){return CK(ee,function(Ie){return Ie.signal===ne&&Ie.slot===oe&&Ie.thisArg===k})}function C(ee,ne){var oe=ee.signal,k=ee.slot,Ie=ee.thisArg;try{k.call(Ie,oe.sender,ne)}catch(Y){t.exceptionHandler(Y)}}function P(ee){g.size===0&&b(H),g.add(ee)}function H(){g.forEach(U),g.clear()}function U(ee){bC.removeAllWhere(ee,J)}function J(ee){return ee.signal===null}})(dc||(dc={}));var RD=function(t,e){return RD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},RD(t,e)};function IK(t,e){RD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var OD=function(){function t(e){this._fn=e}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var e=this._fn;this._fn=null,e()}},t}(),KAt=function(t){IK(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new ug(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),ug.clearData(this))},e}(OD),BD=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(e){e.dispose()}),this._items.clear())},t.prototype.contains=function(e){return this._items.has(e)},t.prototype.add=function(e){this._items.add(e)},t.prototype.remove=function(e){this._items.delete(e)},t.prototype.clear=function(){this._items.clear()},t}();(function(t){function e(r){var i=new t;return lg(r,function(n){i.add(n)}),i}t.from=e})(BD||(BD={}));var MK=function(t){IK(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new ug(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),ug.clearData(this))},e}(BD);(function(t){function e(r){var i=new t;return lg(r,function(n){i.add(n)}),i}t.from=e})(MK||(MK={}));var $p=function(){function t(e){var r=this;this._onScrollFrame=function(){if(r._scrollTarget){var i=r._scrollTarget,n=i.element,o=i.edge,s=i.distance,l=su.SCROLL_EDGE_SIZE-s,c=Math.pow(l/su.SCROLL_EDGE_SIZE,2),h=Math.max(1,Math.round(c*su.SCROLL_EDGE_SIZE));switch(o){case"top":n.scrollTop-=h;break;case"left":n.scrollLeft-=h;break;case"right":n.scrollLeft+=h;break;case"bottom":n.scrollTop+=h;break}requestAnimationFrame(r._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}return t.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=su.createMouseEvent("mouseup",-1,-1);su.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),t.prototype.start=function(e,r){var i=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,r),this._promise=new Promise(function(o,s){i._resolve=o});var n=su.createMouseEvent("mousemove",e,r);return document.dispatchEvent(n),this._promise},t.prototype.handleEvent=function(e){switch(e.type){case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}},t.prototype._evtMouseMove=function(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this._moveDragImage(e.clientX,e.clientY)},t.prototype._evtMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),e.button===0){if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){su.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}var r=su.dispatchDrop(this,this._currentTarget,e);this._finalize(r)}},t.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()},t.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},t.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},t.prototype._updateDragScroll=function(e){var r=su.findScrollTarget(e);!this._scrollTarget&&!r||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=r)},t.prototype._updateCurrentTarget=function(e){var r=this._currentTarget,i=this._currentTarget,n=this._currentElement,o=document.elementFromPoint(e.clientX,e.clientY);this._currentElement=o,o!==n&&o!==i&&su.dispatchDragExit(this,i,o,e),o!==n&&o!==i&&(i=su.dispatchDragEnter(this,o,i,e)),i!==r&&(this._currentTarget=i,su.dispatchDragLeave(this,r,i,e));var s=su.dispatchDragOver(this,i,e);this._setDropAction(s)},t.prototype._attachDragImage=function(e,r){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.top=r+"px",i.left=e+"px",document.body.appendChild(this.dragImage)}},t.prototype._moveDragImage=function(e,r){if(this.dragImage){var i=this.dragImage.style;i.top=r+"px",i.left=e+"px"}},t.prototype._detachDragImage=function(){if(this.dragImage){var e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}},t.prototype._setDropAction=function(e){if(e=su.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop");break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy");break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias");break;case"move":this._dropAction=e,this._override=t.overrideCursor("move");break}},t.prototype._finalize=function(e){var r=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,r&&r(e)},t}();(function(t){function e(i){var n=++r;return document.body.style.cursor=i,document.body.classList.add("lm-mod-override-cursor"),document.body.classList.add("p-mod-override-cursor"),new OD(function(){n===r&&(document.body.style.cursor="",document.body.classList.remove("lm-mod-override-cursor"),document.body.classList.remove("p-mod-override-cursor"))})}t.overrideCursor=e;var r=0})($p||($p={}));var su;(function(t){t.SCROLL_EDGE_SIZE=20;function e(T,C){return h[T]&g[C]?T:"none"}t.validateAction=e;function r(T,C,P){var H=document.createEvent("MouseEvent");return H.initMouseEvent(T,!0,!0,window,0,0,0,C,P,!1,!1,!1,!1,0,null),H}t.createMouseEvent=r;function i(T){for(var C=T.clientX,P=T.clientY,H=document.elementFromPoint(C,P);H;H=H.parentElement){var U=H.hasAttribute("data-lm-dragscroll");if(U=U||H.hasAttribute("data-p-dragscroll"),!!U){var J=0,ee=0;H===document.body&&(J=window.pageXOffset,ee=window.pageYOffset);var ne=H.getBoundingClientRect(),oe=ne.top+ee,k=ne.left+J,Ie=k+ne.width,Y=oe+ne.height;if(!(C<k||C>=Ie||P<oe||P>=Y)){var X=C-k+1,B=P-oe+1,I=Ie-C,j=Y-P,re=Math.min(X,B,I,j);if(!(re>t.SCROLL_EDGE_SIZE)){var K=void 0;switch(re){case j:K="bottom";break;case B:K="top";break;case I:K="right";break;case X:K="left";break;default:throw"unreachable"}var ge=H.scrollWidth-H.clientWidth,$e=H.scrollHeight-H.clientHeight,Ut=void 0;switch(K){case"top":Ut=$e>0&&H.scrollTop>0;break;case"left":Ut=ge>0&&H.scrollLeft>0;break;case"right":Ut=ge>0&&H.scrollLeft<ge;break;case"bottom":Ut=$e>0&&H.scrollTop<$e;break;default:throw"unreachable"}if(Ut)return{element:H,edge:K,distance:re}}}}}return null}t.findScrollTarget=i;function n(T,C,P,H){if(!C)return null;var U=b("lm-dragenter",T,H,P),J=!C.dispatchEvent(U);return J||(U=b("p-dragenter",T,H,P),J=!C.dispatchEvent(U),J)?C:C===document.body?P:(U=b("lm-dragenter",T,H,P),document.body.dispatchEvent(U),U=b("p-dragenter",T,H,P),document.body.dispatchEvent(U),document.body)}t.dispatchDragEnter=n;function o(T,C,P,H){if(C){var U=b("lm-dragexit",T,H,P);C.dispatchEvent(U),U=b("p-dragexit",T,H,P),C.dispatchEvent(U)}}t.dispatchDragExit=o;function s(T,C,P,H){if(C){var U=b("lm-dragleave",T,H,P);C.dispatchEvent(U),U=b("p-dragleave",T,H,P),C.dispatchEvent(U)}}t.dispatchDragLeave=s;function l(T,C,P){if(!C)return"none";var H=b("lm-dragover",T,P,null),U=!C.dispatchEvent(H);return U||(H=b("p-dragover",T,P,null),U=!C.dispatchEvent(H),U)?H.dropAction:"none"}t.dispatchDragOver=l;function c(T,C,P){if(!C)return"none";var H=b("lm-drop",T,P,null),U=!C.dispatchEvent(H);return U||(H=b("p-drop",T,P,null),U=!C.dispatchEvent(H),U)?H.dropAction:"none"}t.dispatchDrop=c;var h={none:0,copy:1,link:2,move:4},g={none:h.none,copy:h.copy,link:h.link,move:h.move,"copy-link":h.copy|h.link,"copy-move":h.copy|h.move,"link-move":h.link|h.move,all:h.copy|h.link|h.move};function b(T,C,P,H){var U=document.createEvent("MouseEvent");return U.initMouseEvent(T,!0,!0,window,0,P.screenX,P.screenY,P.clientX,P.clientY,P.ctrlKey,P.altKey,P.shiftKey,P.metaKey,P.button,H),U.dropAction="none",U.mimeData=C.mimeData,U.proposedAction=C.proposedAction,U.supportedActions=C.supportedActions,U.source=C.source,U}})(su||(su={}));var tA=function(){function t(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return t}(),pc;(function(t){function e(o,s){var l=o.length;if(l===0)return s;for(var c=0,h=0,g=0,b=0,T=0,C=0;C<l;++C){var P=o[C],H=P.minSize,U=P.maxSize,J=P.sizeHint;P.done=!1,P.size=Math.max(H,Math.min(J,U)),g+=P.size,c+=H,h+=U,P.stretch>0&&(b+=P.stretch,T++)}if(s===g)return 0;if(s<=c){for(var C=0;C<l;++C){var P=o[C];P.size=P.minSize}return s-c}if(s>=h){for(var C=0;C<l;++C){var P=o[C];P.size=P.maxSize}return s-h}var ee=.01,ne=l;if(s<g){for(var oe=g-s;T>0&&oe>ee;)for(var k=oe,Ie=b,C=0;C<l;++C){var P=o[C];if(!(P.done||P.stretch===0)){var Y=P.stretch*k/Ie;P.size-Y<=P.minSize?(oe-=P.size-P.minSize,b-=P.stretch,P.size=P.minSize,P.done=!0,ne--,T--):(oe-=Y,P.size-=Y)}}for(;ne>0&&oe>ee;)for(var Y=oe/ne,C=0;C<l;++C){var P=o[C];P.done||(P.size-Y<=P.minSize?(oe-=P.size-P.minSize,P.size=P.minSize,P.done=!0,ne--):(oe-=Y,P.size-=Y))}}else{for(var oe=s-g;T>0&&oe>ee;)for(var k=oe,Ie=b,C=0;C<l;++C){var P=o[C];if(!(P.done||P.stretch===0)){var Y=P.stretch*k/Ie;P.size+Y>=P.maxSize?(oe-=P.maxSize-P.size,b-=P.stretch,P.size=P.maxSize,P.done=!0,ne--,T--):(oe-=Y,P.size+=Y)}}for(;ne>0&&oe>ee;)for(var Y=oe/ne,C=0;C<l;++C){var P=o[C];P.done||(P.size+Y>=P.maxSize?(oe-=P.maxSize-P.size,P.size=P.maxSize,P.done=!0,ne--):(oe-=Y,P.size+=Y))}}return 0}t.calc=e;function r(o,s,l){o.length===0||l===0||(l>0?i(o,s,l):n(o,s,-l))}t.adjust=r;function i(o,s,l){for(var c=0,h=0;h<=s;++h){var g=o[h];c+=g.maxSize-g.size}for(var b=0,h=s+1,T=o.length;h<T;++h){var g=o[h];b+=g.size-g.minSize}l=Math.min(l,c,b);for(var C=l,h=s;h>=0&&C>0;--h){var g=o[h],P=g.maxSize-g.size;P>=C?(g.sizeHint=g.size+C,C=0):(g.sizeHint=g.size+P,C-=P)}for(var H=l,h=s+1,T=o.length;h<T&&H>0;++h){var g=o[h],P=g.size-g.minSize;P>=H?(g.sizeHint=g.size-H,H=0):(g.sizeHint=g.size-P,H-=P)}}function n(o,s,l){for(var c=0,h=s+1,g=o.length;h<g;++h){var b=o[h];c+=b.maxSize-b.size}for(var T=0,h=0;h<=s;++h){var b=o[h];T+=b.size-b.minSize}l=Math.min(l,c,T);for(var C=l,h=s+1,g=o.length;h<g&&C>0;++h){var b=o[h],P=b.maxSize-b.size;P>=C?(b.sizeHint=b.size+C,C=0):(b.sizeHint=b.size+P,C-=P)}for(var H=l,h=s;h>=0&&H>0;--h){var b=o[h],P=b.size-b.minSize;P>=H?(b.sizeHint=b.size-H,H=0):(b.sizeHint=b.size-P,H-=P)}}})(pc||(pc={}));var DD=function(t,e){return DD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},DD(t,e)};function Ua(t,e){DD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Vh=function(){return Vh=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Vh.apply(this,arguments)},LD=function(){function t(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Mo(this),this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0?typeof e.icon=="string"?(this._icon=null,this._iconClass=e.icon):this._icon=e.icon:this._icon=null,e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.iconRenderer!==void 0&&(this._icon=e.iconRenderer),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon===null?this.iconClass:this._icon},set:function(e){if(typeof e=="string")this._icon=null,this.iconClass=e;else{if(this._icon===e)return;this._icon=e,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(e){this.icon=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),t}(),ui=function(){function t(e){e===void 0&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Mo(this),this.node=wC.createNode(e),this.addClass("lm-Widget"),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),Mo.clearData(this),Br.clearData(this),fc.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return wC.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(e){this.node.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-removed",this);Br.sendMessage(this._parent,r)}if(this._parent=e,this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-added",this);Br.sendMessage(this._parent,r)}this.isDisposed||Br.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():zh()},t.prototype.contains=function(e){for(var r=e;r;r=r._parent)if(r===this)return!0;return!1},t.prototype.hasClass=function(e){return this.node.classList.contains(e)},t.prototype.addClass=function(e){this.node.classList.add(e)},t.prototype.removeClass=function(e){this.node.classList.remove(e)},t.prototype.toggleClass=function(e,r){return r===!0?(this.node.classList.add(e),!0):r===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)},t.prototype.update=function(){Br.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){Br.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){Br.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){Br.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&Br.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden"),this.isAttached&&(!this.parent||this.parent.isVisible)&&Br.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);Br.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&Br.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden"),this.isAttached&&(!this.parent||this.parent.isVisible)&&Br.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);Br.sendMessage(this.parent,e)}},t.prototype.setHidden=function(e){e?this.hide():this.show()},t.prototype.testFlag=function(e){return(this._flags&e)!==0},t.prototype.setFlag=function(e){this._flags|=e},t.prototype.clearFlag=function(e){this._flags&=~e},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}},t.prototype.notifyLayout=function(e){this._layout&&this._layout.processParentMessage(e)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(e){},t.prototype.onUpdateRequest=function(e){},t.prototype.onFitRequest=function(e){},t.prototype.onActivateRequest=function(e){},t.prototype.onBeforeShow=function(e){},t.prototype.onAfterShow=function(e){},t.prototype.onBeforeHide=function(e){},t.prototype.onAfterHide=function(e){},t.prototype.onBeforeAttach=function(e){},t.prototype.onAfterAttach=function(e){},t.prototype.onBeforeDetach=function(e){},t.prototype.onAfterDetach=function(e){},t.prototype.onChildAdded=function(e){},t.prototype.onChildRemoved=function(e){},t}();(function(t){var e;(function(l){l[l.IsDisposed=1]="IsDisposed",l[l.IsAttached=2]="IsAttached",l[l.IsHidden=4]="IsHidden",l[l.IsVisible=8]="IsVisible",l[l.DisallowLayout=16]="DisallowLayout"})(e=t.Flag||(t.Flag={}));var r;(function(l){l.BeforeShow=new cc("before-show"),l.AfterShow=new cc("after-show"),l.BeforeHide=new cc("before-hide"),l.AfterHide=new cc("after-hide"),l.BeforeAttach=new cc("before-attach"),l.AfterAttach=new cc("after-attach"),l.BeforeDetach=new cc("before-detach"),l.AfterDetach=new cc("after-detach"),l.ParentChanged=new cc("parent-changed"),l.UpdateRequest=new ry("update-request"),l.FitRequest=new ry("fit-request"),l.ActivateRequest=new ry("activate-request"),l.CloseRequest=new ry("close-request")})(r=t.Msg||(t.Msg={}));var i=function(l){Ua(c,l);function c(h,g){var b=l.call(this,h)||this;return b.child=g,b}return c}(cc);t.ChildMessage=i;var n=function(l){Ua(c,l);function c(h,g){var b=l.call(this,"resize")||this;return b.width=h,b.height=g,b}return c}(cc);t.ResizeMessage=n,function(l){l.UnknownSize=new l(-1,-1)}(n=t.ResizeMessage||(t.ResizeMessage={}));function o(l,c,h){if(h===void 0&&(h=null),l.parent)throw new Error("Cannot attach a child widget.");if(l.isAttached||document.body.contains(l.node))throw new Error("Widget is already attached.");if(!document.body.contains(c))throw new Error("Host is not attached.");Br.sendMessage(l,t.Msg.BeforeAttach),c.insertBefore(l.node,h),Br.sendMessage(l,t.Msg.AfterAttach)}t.attach=o;function s(l){if(l.parent)throw new Error("Cannot detach a child widget.");if(!l.isAttached||!document.body.contains(l.node))throw new Error("Widget is not attached.");Br.sendMessage(l,t.Msg.BeforeDetach),l.node.parentNode.removeChild(l.node),Br.sendMessage(l,t.Msg.AfterDetach)}t.detach=s})(ui||(ui={}));var wC;(function(t){t.titleProperty=new fc({name:"title",create:function(r){return new LD({owner:r})}});function e(r){return r.node||document.createElement("div")}t.createNode=e})(wC||(wC={}));var rA=function(){function t(e){e===void 0&&(e={}),this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,Mo.clearData(this),fc.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){var r=this._parent.node.style;r.minWidth="",r.minHeight="",r.maxWidth="",r.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}},t.prototype.init=function(){var e=this;hn(this,function(r){r.parent=e.parent})},t.prototype.onResize=function(e){hn(this,function(r){Br.sendMessage(r,ui.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(e){hn(this,function(r){Br.sendMessage(r,ui.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(e){hn(this,function(r){Br.sendMessage(r,e)})},t.prototype.onAfterAttach=function(e){hn(this,function(r){Br.sendMessage(r,e)})},t.prototype.onBeforeDetach=function(e){hn(this,function(r){Br.sendMessage(r,e)})},t.prototype.onAfterDetach=function(e){hn(this,function(r){Br.sendMessage(r,e)})},t.prototype.onBeforeShow=function(e){hn(this,function(r){r.isHidden||Br.sendMessage(r,e)})},t.prototype.onAfterShow=function(e){hn(this,function(r){r.isHidden||Br.sendMessage(r,e)})},t.prototype.onBeforeHide=function(e){hn(this,function(r){r.isHidden||Br.sendMessage(r,e)})},t.prototype.onAfterHide=function(e){hn(this,function(r){r.isHidden||Br.sendMessage(r,e)})},t.prototype.onChildRemoved=function(e){this.removeWidget(e.child)},t.prototype.onFitRequest=function(e){},t.prototype.onChildShown=function(e){},t.prototype.onChildHidden=function(e){},t}();(function(t){function e(o){return oy.horizontalAlignmentProperty.get(o)}t.getHorizontalAlignment=e;function r(o,s){oy.horizontalAlignmentProperty.set(o,s)}t.setHorizontalAlignment=r;function i(o){return oy.verticalAlignmentProperty.get(o)}t.getVerticalAlignment=i;function n(o,s){oy.verticalAlignmentProperty.set(o,s)}t.setVerticalAlignment=n})(rA||(rA={}));var yb=function(){function t(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var e=Lo.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight},t.prototype.update=function(e,r,i,n){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),s=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o<i)switch(rA.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(i-o)/2;break;case"right":e+=i-o;break;default:throw"unreachable"}if(s<n)switch(rA.getVerticalAlignment(this.widget)){case"top":break;case"center":r+=(n-s)/2;break;case"bottom":r+=n-s;break;default:throw"unreachable"}var l=!1,c=this.widget.node.style;if(this._top!==r&&(this._top=r,c.top=r+"px"),this._left!==e&&(this._left=e,c.left=e+"px"),this._width!==o&&(l=!0,this._width=o,c.width=o+"px"),this._height!==s&&(l=!0,this._height=s,c.height=s+"px"),l){var h=new ui.ResizeMessage(o,s);Br.sendMessage(this.widget,h)}},t}(),oy;(function(t){t.horizontalAlignmentProperty=new fc({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new fc({name:"verticalAlignment",create:function(){return"top"},changed:e});function e(r){r.parent&&r.parent.layout&&r.parent.update()}})(oy||(oy={}));var MC=function(t){Ua(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._widgets=[],r}return e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return Vf(this._widgets)},e.prototype.addWidget=function(r){this.insertWidget(this._widgets.length,r)},e.prototype.insertWidget=function(r,i){i.parent=this.parent;var n=this._widgets.indexOf(i),o=Math.max(0,Math.min(r,this._widgets.length));if(n===-1){ti.insert(this._widgets,o,i),this.parent&&this.attachWidget(o,i);return}o===this._widgets.length&&o--,n!==o&&(ti.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,i))},e.prototype.removeWidget=function(r){this.removeWidgetAt(this._widgets.indexOf(r))},e.prototype.removeWidgetAt=function(r){var i=ti.removeAt(this._widgets,r);i&&this.parent&&this.detachWidget(r,i)},e.prototype.init=function(){var r=this;t.prototype.init.call(this),hn(this,function(i,n){r.attachWidget(n,i)})},e.prototype.attachWidget=function(r,i){var n=this.parent.node.children[r];this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterAttach)},e.prototype.moveWidget=function(r,i,n){this.parent.isAttached&&Br.sendMessage(n,ui.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&Br.sendMessage(n,ui.Msg.AfterDetach);var o=this.parent.node.children[i];this.parent.isAttached&&Br.sendMessage(n,ui.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,o),this.parent.isAttached&&Br.sendMessage(n,ui.Msg.AfterAttach)},e.prototype.detachWidget=function(r,i){this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterDetach)},e}(rA),Wf=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i._fixed=0,i._spacing=4,i._dirty=!1,i._sizers=[],i._items=[],i._box=null,i._alignment="start",i._direction="top-to-bottom",r.direction!==void 0&&(i._direction=r.direction),r.alignment!==void 0&&(i._alignment=r.alignment),r.spacing!==void 0&&(i._spacing=Jd.clampSpacing(r.spacing)),i}return e.prototype.dispose=function(){hn(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(r){this._direction!==r&&(this._direction=r,this.parent&&(this.parent.dataset.direction=r,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(r){this._alignment!==r&&(this._alignment=r,this.parent&&(this.parent.dataset.alignment=r,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Jd.clampSpacing(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(r,i){ti.insert(this._items,r,new yb(i)),ti.insert(this._sizers,r,new tA),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){ti.move(this._items,r,i),ti.move(this._sizers,r,i),this.parent.update()},e.prototype.detachWidget=function(r,i){var n=ti.removeAt(this._items,r);ti.removeAt(this._sizers,r),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=0,n=this._items.length;i<n;++i)r+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,r-1);for(var o=Jd.isHorizontal(this._direction),s=o?this._fixed:0,l=o?0:this._fixed,i=0,n=this._items.length;i<n;++i){var c=this._items[i],h=this._sizers[i];if(c.isHidden){h.minSize=0,h.maxSize=0;continue}c.fit(),h.sizeHint=e.getSizeBasis(c.widget),h.stretch=e.getStretch(c.widget),o?(h.minSize=c.minWidth,h.maxSize=c.maxWidth,s+=c.minWidth,l=Math.max(l,c.minHeight)):(h.minSize=c.minHeight,h.maxSize=c.maxHeight,l+=c.minHeight,s=Math.max(s,c.minWidth))}var g=this._box=Lo.boxSizing(this.parent.node);s+=g.horizontalSum,l+=g.verticalSum;var b=this.parent.node.style;b.minWidth=s+"px",b.minHeight=l+"px",this._dirty=!0,this.parent.parent&&Br.sendMessage(this.parent.parent,ui.Msg.FitRequest),this._dirty&&Br.sendMessage(this.parent,ui.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=Lo.boxSizing(this.parent.node));var l=this._box.paddingTop,c=this._box.paddingLeft,h=r-this._box.horizontalSum,g=i-this._box.verticalSum,b;switch(this._direction){case"left-to-right":b=pc.calc(this._sizers,Math.max(0,h-this._fixed));break;case"top-to-bottom":b=pc.calc(this._sizers,Math.max(0,g-this._fixed));break;case"right-to-left":b=pc.calc(this._sizers,Math.max(0,h-this._fixed)),c+=h;break;case"bottom-to-top":b=pc.calc(this._sizers,Math.max(0,g-this._fixed)),l+=g;break;default:throw"unreachable"}var T=0,C=0;if(b>0)switch(this._alignment){case"start":break;case"center":T=0,C=b/2;break;case"end":T=0,C=b;break;case"justify":T=b/n,C=0;break;default:throw"unreachable"}for(var o=0,s=this._items.length;o<s;++o){var P=this._items[o];if(!P.isHidden){var H=this._sizers[o].size;switch(this._direction){case"left-to-right":P.update(c+C,l,H+T,g),c+=H+T+this._spacing;break;case"top-to-bottom":P.update(c,l+C,h,H+T),l+=H+T+this._spacing;break;case"right-to-left":P.update(c-C-H-T,l,H+T,g),c-=H+T+this._spacing;break;case"bottom-to-top":P.update(c,l-C-H-T,h,H+T),l-=H+T+this._spacing;break;default:throw"unreachable"}}}}},e}(MC);(function(t){function e(o){return Jd.stretchProperty.get(o)}t.getStretch=e;function r(o,s){Jd.stretchProperty.set(o,s)}t.setStretch=r;function i(o){return Jd.sizeBasisProperty.get(o)}t.getSizeBasis=i;function n(o,s){Jd.sizeBasisProperty.set(o,s)}t.setSizeBasis=n})(Wf||(Wf={}));var Jd;(function(t){t.stretchProperty=new fc({name:"stretch",create:function(){return 0},coerce:function(n,o){return Math.max(0,Math.floor(o))},changed:i}),t.sizeBasisProperty=new fc({name:"sizeBasis",create:function(){return 0},coerce:function(n,o){return Math.max(0,Math.floor(o))},changed:i});function e(n){return n==="left-to-right"||n==="right-to-left"}t.isHorizontal=e;function r(n){return Math.max(0,Math.floor(n))}t.clampSpacing=r;function i(n){n.parent&&n.parent.layout instanceof Wf&&n.parent.fit()}})(Jd||(Jd={}));var vb=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=FD.createLayout(r),i}return Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){this.layout.addWidget(r)},e.prototype.insertWidget=function(r,i){this.layout.insertWidget(r,i)},e}(ui),FD;(function(t){function e(r){return r.layout||new MC}t.createLayout=e})(FD||(FD={}));var PK=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:ND.createLayout(r)})||this;return i.addClass("lm-BoxPanel"),i.addClass("p-BoxPanel"),i}return Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(r){this.layout.direction=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(r){this.layout.alignment=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(r){r.child.addClass("lm-BoxPanel-child"),r.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-BoxPanel-child"),r.child.removeClass("p-BoxPanel-child")},e}(vb);(function(t){function e(o){return Wf.getStretch(o)}t.getStretch=e;function r(o,s){Wf.setStretch(o,s)}t.setStretch=r;function i(o){return Wf.getSizeBasis(o)}t.getSizeBasis=i;function n(o,s){Wf.setSizeBasis(o,s)}t.setSizeBasis=n})(PK||(PK={}));var ND;(function(t){function e(r){return r.layout||new Wf(r)}t.createLayout=e})(ND||(ND={}));var RK=function(t){Ua(e,t);function e(r){var i=t.call(this,{node:eA.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("lm-CommandPalette"),i.addClass("p-CommandPalette"),i.setFlag(ui.Flag.DisallowLayout),i.commands=r.commands,i.renderer=r.renderer||e.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(r){var i=eA.createItem(this.commands,r);return this._items.push(i),this.refresh(),i},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){var i=ti.removeAt(this._items,r);i&&this.refresh()},e.prototype.clearItems=function(){this._items.length!==0&&(this._items.length=0,this.refresh())},e.prototype.refresh=function(){if(this._results=null,this.inputNode.value!==""){var r=this.node.getElementsByClassName("lm-close-icon")[0];r.style.display="inherit"}else{var r=this.node.getElementsByClassName("lm-close-icon")[0];r.style.display="none"}this.update()},e.prototype.handleEvent=function(r){switch(r.type){case"click":this._evtClick(r);break;case"keydown":this._evtKeyDown(r);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},e.prototype.onActivateRequest=function(r){if(this.isAttached){var i=this.inputNode;i.focus(),i.select()}},e.prototype.onUpdateRequest=function(r){var i=this.inputNode.value,n=this.contentNode,o=this._results;if(o||(o=this._results=eA.search(this._items,i),this._activeIndex=i?ti.findFirstIndex(o,eA.canActivate):-1),!i&&o.length===0){Zd.render(null,n);return}if(i&&o.length===0){var s=this.renderer.renderEmptyMessage({query:i});Zd.render(s,n);return}for(var l=this.renderer,c=this._activeIndex,h=new Array(o.length),g=0,b=o.length;g<b;++g){var T=o[g];if(T.type==="header"){var C=T.indices,P=T.category;h[g]=l.renderHeader({category:P,indices:C})}else{var H=T.item,C=T.indices,U=g===c;h[g]=l.renderItem({item:H,indices:C,active:U})}}if(Zd.render(h,n),c<0||c>=o.length)n.scrollTop=0;else{var J=n.children[c];Lo.scrollIntoViewIfNeeded(n,J)}},e.prototype._evtClick=function(r){if(r.button===0){if(r.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var i=ti.findFirstIndex(this.contentNode.children,function(n){return n.contains(r.target)});i!==-1&&(r.preventDefault(),r.stopPropagation(),this._execute(i))}},e.prototype._evtKeyDown=function(r){if(!(r.altKey||r.ctrlKey||r.metaKey||r.shiftKey))switch(r.keyCode){case 13:r.preventDefault(),r.stopPropagation(),this._execute(this._activeIndex);break;case 38:r.preventDefault(),r.stopPropagation(),this._activatePreviousItem();break;case 40:r.preventDefault(),r.stopPropagation(),this._activateNextItem();break}},e.prototype._activateNextItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,i=this._results.length,n=r<i-1?r+1:0,o=n===0?i-1:n-1;this._activeIndex=ti.findFirstIndex(this._results,eA.canActivate,n,o),this.update()}},e.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,i=this._results.length,n=r<=0?i-1:r-1,o=n===i-1?0:n+1;this._activeIndex=ti.findLastIndex(this._results,eA.canActivate,n,o),this.update()}},e.prototype._execute=function(r){if(this._results){var i=this._results[r];if(i){if(i.type==="header"){var n=this.inputNode;n.value=i.category.toLowerCase()+" ",n.focus(),this.refresh();return}i.item.isEnabled&&(this.commands.execute(i.item.command,i.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var r=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",r),this.toggleClass("p-mod-focused",r)},e.prototype._onGenericChange=function(){this.refresh()},e}(ui);(function(t){var e=function(){function r(){}return r.prototype.renderHeader=function(i){var n=this.formatHeader(i);return Fo.li({className:"lm-CommandPalette-header p-CommandPalette-header"},n)},r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i);return Fo.li({className:n,dataset:o},this.renderItemIcon(i),this.renderItemContent(i),this.renderItemShortcut(i))},r.prototype.renderEmptyMessage=function(i){var n=this.formatEmptyMessage(i);return Fo.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},n)},r.prototype.renderItemIcon=function(i){var n=this.createIconClass(i);return typeof i.item.icon=="string"?Fo.div({className:n},i.item.iconLabel):Fo.div({className:n},i.item.icon,i.item.iconLabel)},r.prototype.renderItemContent=function(i){return Fo.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(i),this.renderItemCaption(i))},r.prototype.renderItemLabel=function(i){var n=this.formatItemLabel(i);return Fo.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},n)},r.prototype.renderItemCaption=function(i){var n=this.formatItemCaption(i);return Fo.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},n)},r.prototype.renderItemShortcut=function(i){var n=this.formatItemShortcut(i);return Fo.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},n)},r.prototype.createItemClass=function(i){var n="lm-CommandPalette-item";n+=" p-CommandPalette-item",i.item.isEnabled||(n+=" lm-mod-disabled",n+=" p-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled",n+=" p-mod-toggled"),i.active&&(n+=" lm-mod-active",n+=" p-mod-active");var o=i.item.className;return o&&(n+=" "+o),n},r.prototype.createItemDataset=function(i){return Vh(Vh({},i.item.dataset),{command:i.item.command})},r.prototype.createIconClass=function(i){var n="lm-CommandPalette-itemIcon";n+=" p-CommandPalette-itemIcon";var o=i.item.iconClass;return o?n+" "+o:n},r.prototype.formatHeader=function(i){return!i.indices||i.indices.length===0?i.category:ey.highlight(i.category,i.indices,Fo.mark)},r.prototype.formatEmptyMessage=function(i){return"No commands found that match '"+i.query+"'"},r.prototype.formatItemShortcut=function(i){var n=i.item.keyBinding;return n?n.keys.map(ny.formatKeystroke).join(", "):null},r.prototype.formatItemLabel=function(i){return!i.indices||i.indices.length===0?i.item.label:ey.highlight(i.item.label,i.indices,Fo.mark)},r.prototype.formatItemCaption=function(i){return i.item.caption},r}();t.Renderer=e,t.defaultRenderer=new e})(RK||(RK={}));var eA;(function(t){function e(){var T=document.createElement("div"),C=document.createElement("div"),P=document.createElement("div"),H=document.createElement("input"),U=document.createElement("ul"),J=document.createElement("button");return C.className="lm-CommandPalette-search",P.className="lm-CommandPalette-wrapper",H.className="lm-CommandPalette-input",J.className="lm-close-icon",U.className="lm-CommandPalette-content",C.classList.add("p-CommandPalette-search"),P.classList.add("p-CommandPalette-wrapper"),H.classList.add("p-CommandPalette-input"),U.classList.add("p-CommandPalette-content"),H.spellcheck=!1,P.appendChild(H),P.appendChild(J),C.appendChild(P),T.appendChild(C),T.appendChild(U),T}t.createNode=e;function r(T,C){return new b(T,C)}t.createItem=r;function i(T,C){var P=l(T,C);return P.sort(h),g(P)}t.search=i;function n(T){return T.type==="item"&&T.item.isEnabled}t.canActivate=n;function o(T){return T.trim().replace(/\s+/g," ")}function s(T){return T.replace(/\s+/g,"").toLowerCase()}function l(T,C){C=s(C);for(var P=[],H=0,U=T.length;H<U;++H){var J=T[H];if(J.isVisible){if(!C){P.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:J});continue}var ee=c(J,C);ee&&(J.isEnabled||(ee.score+=1e3),P.push(ee))}}return P}function c(T,C){for(var P=T.category.toLowerCase(),H=T.label.toLowerCase(),U=P+" "+H,J=1/0,ee=null,ne=/\b\w/g;;){var oe=ne.exec(U);if(!oe)break;var k=ey.matchSumOfDeltas(U,C,oe.index);if(!k)break;k&&k.score<=J&&(J=k.score,ee=k.indices)}if(!ee||J===1/0)return null;for(var Ie=P.length+1,Y=ti.lowerBound(ee,Ie,function(re,K){return re-K}),X=ee.slice(0,Y),B=ee.slice(Y),I=0,j=B.length;I<j;++I)B[I]-=Ie;return X.length===0?{matchType:0,categoryIndices:null,labelIndices:B,score:J,item:T}:B.length===0?{matchType:1,categoryIndices:X,labelIndices:null,score:J,item:T}:{matchType:2,categoryIndices:X,labelIndices:B,score:J,item:T}}function h(T,C){var P=T.matchType-C.matchType;if(P!==0)return P;var H=T.score-C.score;if(H!==0)return H;var U=0,J=0;switch(T.matchType){case 0:U=T.labelIndices[0],J=C.labelIndices[0];break;case 1:case 2:U=T.categoryIndices[0],J=C.categoryIndices[0];break}if(U!==J)return U-J;var ee=T.item.category.localeCompare(C.item.category);if(ee!==0)return ee;var ne=T.item.rank,oe=C.item.rank;return ne!==oe?ne<oe?-1:1:T.item.label.localeCompare(C.item.label)}function g(T){var C=new Array(T.length);ti.fill(C,!1);for(var P=[],H=0,U=T.length;H<U;++H)if(!C[H]){var J=T[H],ee=J.item,ne=J.categoryIndices,oe=ee.category;P.push({type:"header",category:oe,indices:ne});for(var k=H;k<U;++k)if(!C[k]){var Ie=T[k],Y=Ie.item,X=Ie.labelIndices;Y.category===oe&&(P.push({type:"item",item:Y,indices:X}),C[k]=!0)}}return P}var b=function(){function T(C,P){this._commands=C,this.category=o(P.category),this.command=P.command,this.args=P.args||ha.emptyObject,this.rank=P.rank!==void 0?P.rank:1/0}return Object.defineProperty(T.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"keyBinding",{get:function(){var C=this,P=C.command,H=C.args;return ti.findLastValue(this._commands.keyBindings,function(U){return U.command===P&&ha.deepEqual(U.args,H)})||null},enumerable:!0,configurable:!0}),T}()})(eA||(eA={}));var kD=function(t){Ua(e,t);function e(r){var i=t.call(this,{node:qu.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new Mo(i),i._menuRequested=new Mo(i),i.addClass("lm-Menu"),i.addClass("p-Menu"),i.setFlag(ui.Flag.DisallowLayout),i.commands=r.commands,i.renderer=r.renderer||e.defaultRenderer,i}return e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var r=this;r._parentMenu;)r=r._parentMenu;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var r=this;r._childMenu;)r=r._childMenu;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(r){this.activeIndex=r?this._items.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(r){(r<0||r>=this._items.length)&&(r=-1),r!==-1&&!qu.canActivate(this._items[r])&&(r=-1),this._activeIndex!==r&&(this._activeIndex=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var r=this._items.length,i=this._activeIndex,n=i<r-1?i+1:0,o=n===0?r-1:n-1;this.activeIndex=ti.findFirstIndex(this._items,qu.canActivate,n,o)},e.prototype.activatePreviousItem=function(){var r=this._items.length,i=this._activeIndex,n=i<=0?r-1:i-1,o=n===r-1?0:n+1;this.activeIndex=ti.findLastIndex(this._items,qu.canActivate,n,o)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var r=this.activeItem;if(r){if(this._cancelOpenTimer(),this._cancelCloseTimer(),r.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();var i=r.command,n=r.args;this.commands.isEnabled(i,n)?this.commands.execute(i,n):console.log("Command '"+i+"' is disabled.")}}},e.prototype.addItem=function(r){return this.insertItem(this._items.length,r)},e.prototype.insertItem=function(r,i){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(r,this._items.length)),o=qu.createItem(this,i);return ti.insert(this._items,n,o),this.update(),o},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){this.isAttached&&this.close(),this.activeIndex=-1;var i=ti.removeAt(this._items,r);i&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())},e.prototype.open=function(r,i,n){if(n===void 0&&(n={}),!this.isAttached){var o=n.forceX||!1,s=n.forceY||!1;qu.openRootMenu(this,r,i,o,s),this.activate()}},e.prototype.handleEvent=function(r){switch(r.type){case"keydown":this._evtKeyDown(r);break;case"mouseup":this._evtMouseUp(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseenter":this._evtMouseEnter(r);break;case"mouseleave":this._evtMouseLeave(r);break;case"mousedown":this._evtMouseDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},e.prototype.onActivateRequest=function(r){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(r){for(var i=this._items,n=this.renderer,o=this._activeIndex,s=qu.computeCollapsed(i),l=new Array(i.length),c=0,h=i.length;c<h;++c){var g=i[c],b=c===o,T=s[c];l[c]=n.renderItem({item:g,active:b,collapsed:T})}Zd.render(l,this.contentNode)},e.prototype.onCloseRequest=function(r){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var i=this._childMenu;i&&(this._childIndex=-1,this._childMenu=null,i._parentMenu=null,i.close());var n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,r)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation();var i=r.keyCode;if(i===13){this.triggerActiveItem();return}if(i===27){this.close();return}if(i===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(i===38){this.activatePreviousItem();return}if(i===39){var n=this.activeItem;n&&n.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(i===40){this.activateNextItem();return}var o=_b().keyForKeydownEvent(r);if(o){var s=this._activeIndex+1,l=qu.findMnemonic(this._items,o,s);l.index!==-1&&!l.multiple?(this.activeIndex=l.index,this.triggerActiveItem()):l.index!==-1?this.activeIndex=l.index:l.auto!==-1&&(this.activeIndex=l.auto)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(r){var i=ti.findFirstIndex(this.contentNode.children,function(o){return Lo.hitTest(o,r.clientX,r.clientY)});if(i!==this._activeIndex){if(this.activeIndex=i,i=this.activeIndex,i===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;!n||n.type!=="submenu"||!n.submenu||this._startOpenTimer()}},e.prototype._evtMouseEnter=function(r){for(var i=this._parentMenu;i;i=i._parentMenu)i._cancelOpenTimer(),i._cancelCloseTimer(),i.activeIndex=i._childIndex},e.prototype._evtMouseLeave=function(r){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var i=r.clientX,n=r.clientY;if(Lo.hitTest(this._childMenu.node,i,n)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},e.prototype._evtMouseDown=function(r){this._parentMenu||(qu.hitTestMenus(this,r.clientX,r.clientY)?(r.preventDefault(),r.stopPropagation()):this.close())},e.prototype._openChildMenu=function(r){r===void 0&&(r=!1);var i=this.activeItem;if(!i||i.type!=="submenu"||!i.submenu){this._closeChildMenu();return}var n=i.submenu;if(n!==this._childMenu){this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,Br.sendMessage(this,ui.Msg.UpdateRequest);var o=this.contentNode.children[this._activeIndex];qu.openSubmenu(n,o),r&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var r=this;this._openTimerID===0&&(this._openTimerID=window.setTimeout(function(){r._openTimerID=0,r._openChildMenu()},qu.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var r=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){r._closeTimerID=0,r._closeChildMenu()},qu.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e}(ui);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i);return Fo.li({className:n,dataset:o},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))},r.prototype.renderIcon=function(i){var n=this.createIconClass(i);return typeof i.item.icon=="string"?Fo.div({className:n},i.item.iconLabel):Fo.div({className:n},i.item.icon,i.item.iconLabel)},r.prototype.renderLabel=function(i){var n=this.formatLabel(i);return Fo.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},n)},r.prototype.renderShortcut=function(i){var n=this.formatShortcut(i);return Fo.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},n)},r.prototype.renderSubmenu=function(i){return Fo.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},r.prototype.createItemClass=function(i){var n="lm-Menu-item";n+=" p-Menu-item",i.item.isEnabled||(n+=" lm-mod-disabled",n+=" p-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled",n+=" p-mod-toggled"),i.item.isVisible||(n+=" lm-mod-hidden",n+=" p-mod-hidden"),i.active&&(n+=" lm-mod-active",n+=" p-mod-active"),i.collapsed&&(n+=" lm-mod-collapsed",n+=" p-mod-collapsed");var o=i.item.className;return o&&(n+=" "+o),n},r.prototype.createItemDataset=function(i){var n,o=i.item,s=o.type,l=o.command,c=o.dataset;return s==="command"?n=Vh(Vh({},c),{type:s,command:l}):n=Vh(Vh({},c),{type:s}),n},r.prototype.createIconClass=function(i){var n="lm-Menu-itemIcon";n+=" p-Menu-itemIcon";var o=i.item.iconClass;return o?n+" "+o:n},r.prototype.formatLabel=function(i){var n=i.item,o=n.label,s=n.mnemonic;if(s<0||s>=o.length)return o;var l=o.slice(0,s),c=o.slice(s+1),h=o[s],g=Fo.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},h);return[l,g,c]},r.prototype.formatShortcut=function(i){var n=i.item.keyBinding;return n?n.keys.map(ny.formatKeystroke).join(", "):null},r}();t.Renderer=e,t.defaultRenderer=new e})(kD||(kD={}));var qu;(function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;function e(){var g=document.createElement("div"),b=document.createElement("ul");return b.className="lm-Menu-content",b.classList.add("p-Menu-content"),g.appendChild(b),g.tabIndex=-1,g}t.createNode=e;function r(g){return g.type!=="separator"&&g.isEnabled&&g.isVisible}t.canActivate=r;function i(g,b){return new h(g.commands,b)}t.createItem=i;function n(g,b,T){for(var C=g;C;C=C.childMenu)if(Lo.hitTest(C.node,b,T))return!0;return!1}t.hitTestMenus=n;function o(g){var b=new Array(g.length);ti.fill(b,!1);for(var T=0,C=g.length;T<C;++T){var P=g[T];if(P.isVisible){if(P.type!=="separator")break;b[T]=!0}}for(var H=C-1;H>=0;--H){var P=g[H];if(P.isVisible){if(P.type!=="separator")break;b[H]=!0}}for(var U=!1;++T<H;){var P=g[T];P.isVisible&&(P.type!=="separator"?U=!1:U?b[T]=!0:U=!0)}return b}t.computeCollapsed=o;function s(g,b,T,C,P){Br.sendMessage(g,ui.Msg.UpdateRequest);var H=window.pageXOffset,U=window.pageYOffset,J=document.documentElement.clientWidth,ee=document.documentElement.clientHeight,ne=ee-(P?T:0),oe=g.node,k=oe.style;k.top="",k.left="",k.width="",k.height="",k.visibility="hidden",k.maxHeight=ne+"px",ui.attach(g,document.body);var Ie=oe.getBoundingClientRect(),Y=Ie.width,X=Ie.height;!C&&b+Y>H+J&&(b=H+J-Y),!P&&T+X>U+ee&&(T>U+ee?T=U+ee-X:T=T-X),k.top=Math.max(0,T)+"px",k.left=Math.max(0,b)+"px",k.visibility=""}t.openRootMenu=s;function l(g,b){Br.sendMessage(g,ui.Msg.UpdateRequest);var T=window.pageXOffset,C=window.pageYOffset,P=document.documentElement.clientWidth,H=document.documentElement.clientHeight,U=H,J=g.node,ee=J.style;ee.top="",ee.left="",ee.width="",ee.height="",ee.visibility="hidden",ee.maxHeight=U+"px",ui.attach(g,document.body);var ne=J.getBoundingClientRect(),oe=ne.width,k=ne.height,Ie=Lo.boxSizing(g.node),Y=b.getBoundingClientRect(),X=Y.right-t.SUBMENU_OVERLAP;X+oe>T+P&&(X=Y.left+t.SUBMENU_OVERLAP-oe);var B=Y.top-Ie.borderTop-Ie.paddingTop;B+k>C+H&&(B=Y.bottom+Ie.borderBottom+Ie.paddingBottom-k),ee.top=Math.max(0,B)+"px",ee.left=Math.max(0,X)+"px",ee.visibility=""}t.openSubmenu=l;function c(g,b,T){for(var C=-1,P=-1,H=!1,U=b.toUpperCase(),J=0,ee=g.length;J<ee;++J){var ne=(J+T)%ee,oe=g[ne];if(r(oe)){var k=oe.label;if(k.length!==0){var Ie=oe.mnemonic;if(Ie>=0&&Ie<k.length){k[Ie].toUpperCase()===U&&(C===-1?C=ne:H=!0);continue}P===-1&&k[0].toUpperCase()===U&&(P=ne)}}}return{index:C,multiple:H,auto:P}}t.findMnemonic=c;var h=function(){function g(b,T){this._commands=b,this.type=T.type||"command",this.command=T.command||"",this.args=T.args||ha.emptyObject,this.submenu=T.submenu||null}return Object.defineProperty(g.prototype,"label",{get:function(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"mnemonic",{get:function(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"icon",{get:function(){return this.type==="command"?this._commands.icon(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"iconClass",{get:function(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"iconLabel",{get:function(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"caption",{get:function(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"className",{get:function(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"dataset",{get:function(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"isEnabled",{get:function(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"isVisible",{get:function(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"keyBinding",{get:function(){if(this.type==="command"){var b=this,T=b.command,C=b.args;return ti.findLastValue(this._commands.keyBindings,function(P){return P.command===T&&ha.deepEqual(P.args,C)})||null}return null},enumerable:!0,configurable:!0}),g}()})(qu||(qu={}));var cmt=function(){function t(e){this._idTick=0,this._items=[],this.menu=new kD(e)}return t.prototype.addItem=function(e){var r=this,i=TC.createItem(e,this._idTick++);return this._items.push(i),new iy(function(){ti.removeFirstOf(r._items,i)})},t.prototype.open=function(e){var r=this;if(this.menu.clearItems(),this._items.length===0)return!1;var i=TC.matchItems(this._items,e);return!i||i.length===0?!1:(hn(i,function(n){r.menu.addItem(n)}),this.menu.open(e.clientX,e.clientY),!0)},t}(),TC;(function(t){function e(o,s){var l=i(o.selector),c=o.rank!==void 0?o.rank:1/0;return Vh(Vh({},o),{selector:l,rank:c,id:s})}t.createItem=e;function r(o,s){var l=s.target;if(!l)return null;var c=s.currentTarget;if(!c||!c.contains(l)&&(l=document.elementFromPoint(s.clientX,s.clientY),!l||!c.contains(l)))return null;for(var h=[],g=o.slice();l!==null;){for(var b=[],T=0,C=g.length;T<C;++T){var P=g[T];P&&jf.matches(l,P.selector)&&(b.push(P),g[T]=null)}if(b.length!==0&&(b.sort(n),h.push.apply(h,b)),l===c)break;l=l.parentElement}return h}t.matchItems=r;function i(o){if(o.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+o);if(!jf.isValid(o))throw new Error("Invalid selector: "+o);return o}function n(o,s){var l=jf.calculateSpecificity(o.selector),c=jf.calculateSpecificity(s.selector);if(l!==c)return c-l;var h=o.rank,g=s.rank;return h!==g?h<g?-1:1:o.id-s.id}})(TC||(TC={}));var bTe=function(t){Ua(e,t);function e(r){var i=t.call(this)||this;return i._spacing=4,i._dirty=!1,i._root=null,i._box=null,i._items=new Map,i.renderer=r.renderer,r.spacing!==void 0&&(i._spacing=bl.clampSpacing(r.spacing)),i}return e.prototype.dispose=function(){var r=this.iter();this._items.forEach(function(i){i.dispose()}),this._box=null,this._root=null,this._items.clear(),hn(r,function(i){i.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=bl.clampSpacing(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this._root===null},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():zh()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():zh()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():zh()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():zh()},e.prototype.handles=function(){return this._root?this._root.iterHandles():zh()},e.prototype.moveHandle=function(r,i,n){var o=r.classList.contains("lm-mod-hidden");if(o=o||r.classList.contains("p-mod-hidden"),!(!this._root||o)){var s=this._root.findSplitNode(r);if(s){var l;s.node.orientation==="horizontal"?l=i-r.offsetLeft:l=n-r.offsetTop,l!==0&&(s.node.holdSizes(),pc.adjust(s.node.sizers,s.index,l),this.parent&&this.parent.update())}}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(r){var i=this,n=new Set,o;r.main?o=bl.normalizeAreaConfig(r.main,n):o=null;var s=this.widgets(),l=this.tabBars(),c=this.handles();this._root=null,hn(s,function(h){n.has(h)||(h.parent=null)}),hn(l,function(h){h.dispose()}),hn(c,function(h){h.parentNode&&h.parentNode.removeChild(h)}),n.forEach(function(h){h.parent=i.parent}),o?this._root=bl.realizeAreaConfig(o,{createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}}):this._root=null,this.parent&&(n.forEach(function(h){i.attachWidget(h)}),this.parent.fit())},e.prototype.addWidget=function(r,i){i===void 0&&(i={});var n=i.ref||null,o=i.mode||"tab-after",s=null;if(this._root&&n&&(s=this._root.findTabNode(n)),n&&!s)throw new Error("Reference widget is not in the layout.");switch(r.parent=this.parent,o){case"tab-after":this._insertTab(r,n,s,!0);break;case"tab-before":this._insertTab(r,n,s,!1);break;case"split-top":this._insertSplit(r,n,s,"vertical",!1);break;case"split-left":this._insertSplit(r,n,s,"horizontal",!1);break;case"split-right":this._insertSplit(r,n,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(r,n,s,"vertical",!0);break}this.parent&&(this.attachWidget(r),this.parent.fit())},e.prototype.removeWidget=function(r){this._removeWidget(r),this.parent&&(this.detachWidget(r),this.parent.fit())},e.prototype.hitTestTabAreas=function(r,i){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=Lo.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),o=r-n.left-this._box.borderLeft,s=i-n.top-this._box.borderTop,l=this._root.hitTestTabNodes(o,s);if(!l)return null;var c=l.tabBar,h=l.top,g=l.left,b=l.width,T=l.height,C=this._box.borderLeft+this._box.borderRight,P=this._box.borderTop+this._box.borderBottom,H=n.width-C-(g+b),U=n.height-P-(h+T);return{tabBar:c,x:o,y:s,top:h,left:g,right:H,bottom:U,width:b,height:T}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),hn(this,function(i){r.attachWidget(i)}),hn(this.handles(),function(i){r.parent.node.appendChild(i)}),this.parent.fit()},e.prototype.attachWidget=function(r){this.parent.node!==r.node.parentNode&&(this._items.set(r,new yb(r)),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.AfterAttach))},e.prototype.detachWidget=function(r){if(this.parent.node===r.node.parentNode){this.parent.isAttached&&Br.sendMessage(r,ui.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.AfterDetach);var i=this._items.get(r);i&&(this._items.delete(r),i.dispose())}},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(r){if(this._root){var i=this._root.findTabNode(r);if(i){if(i.tabBar.titles.length>1){i.tabBar.removeTab(r.title);return}if(i.tabBar.dispose(),this._root===i){this._root=null;return}this._root.holdAllSizes();var n=i.parent;i.parent=null;var o=ti.removeFirstOf(n.children,i),s=ti.removeAt(n.handles,o);if(ti.removeAt(n.sizers,o),s.parentNode&&s.parentNode.removeChild(s),n.children.length>1){n.syncHandles();return}var l=n.parent;n.parent=null;var c=n.children[0],h=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,h.parentNode&&h.parentNode.removeChild(h),this._root===n){c.parent=null,this._root=c;return}var g=l,b=g.children.indexOf(n);if(c instanceof bl.TabLayoutNode){c.parent=g,g.children[b]=c;return}var T=ti.removeAt(g.handles,b);ti.removeAt(g.children,b),ti.removeAt(g.sizers,b),T.parentNode&&T.parentNode.removeChild(T);for(var C=0,P=c.children.length;C<P;++C){var H=c.children[C],U=c.handles[C],J=c.sizers[C];ti.insert(g.children,b+C,H),ti.insert(g.handles,b+C,U),ti.insert(g.sizers,b+C,J),H.parent=g}c.children.length=0,c.handles.length=0,c.sizers.length=0,c.parent=null,g.syncHandles()}}},e.prototype._insertTab=function(r,i,n,o){if(r!==i){if(!this._root){var s=new bl.TabLayoutNode(this._createTabBar());s.tabBar.addTab(r.title),this._root=s;return}n||(n=this._root.findFirstTabNode()),n.tabBar.titles.indexOf(r.title)===-1&&(this._removeWidget(r),r.hide());var l;i?l=n.tabBar.titles.indexOf(i.title):l=n.tabBar.currentIndex,n.tabBar.insertTab(l+(o?1:0),r.title)}},e.prototype._insertSplit=function(r,i,n,o,s){if(!(r===i&&n&&n.tabBar.titles.length===1)){this._removeWidget(r);var l=new bl.TabLayoutNode(this._createTabBar());if(l.tabBar.addTab(r.title),!this._root){this._root=l;return}if(!n||!n.parent){var c=this._splitRoot(o),h=s?c.children.length:0;c.normalizeSizes();var g=bl.createSizer(n?1:bl.GOLDEN_RATIO);ti.insert(c.children,h,l),ti.insert(c.sizers,h,g),ti.insert(c.handles,h,this._createHandle()),l.parent=c,c.normalizeSizes(),c.syncHandles();return}var b=n.parent;if(b.orientation===o){var T=b.children.indexOf(n);b.normalizeSizes();var C=b.sizers[T].sizeHint/=2,P=T+(s?1:0);ti.insert(b.children,P,l),ti.insert(b.sizers,P,bl.createSizer(C)),ti.insert(b.handles,P,this._createHandle()),l.parent=b,b.syncHandles();return}var H=ti.removeFirstOf(b.children,n),U=new bl.SplitLayoutNode(o);U.normalized=!0,U.children.push(n),U.sizers.push(bl.createSizer(.5)),U.handles.push(this._createHandle()),n.parent=U;var J=s?1:0;ti.insert(U.children,J,l),ti.insert(U.sizers,J,bl.createSizer(.5)),ti.insert(U.handles,J,this._createHandle()),l.parent=U,U.syncHandles(),ti.insert(b.children,H,U),U.parent=b}},e.prototype._splitRoot=function(r){var i=this._root;if(i instanceof bl.SplitLayoutNode&&i.orientation===r)return i;var n=this._root=new bl.SplitLayoutNode(r);return i&&(n.children.push(i),n.sizers.push(bl.createSizer(0)),n.handles.push(this._createHandle()),i.parent=n),n},e.prototype._fit=function(){var r=0,i=0;if(this._root){var n=this._root.fit(this._spacing,this._items);r=n.minWidth,i=n.minHeight}var o=this._box=Lo.boxSizing(this.parent.node);r+=o.horizontalSum,i+=o.verticalSum;var s=this.parent.node.style;s.minWidth=r+"px",s.minHeight=i+"px",this._dirty=!0,this.parent.parent&&Br.sendMessage(this.parent.parent,ui.Msg.FitRequest),this._dirty&&Br.sendMessage(this.parent,ui.Msg.UpdateRequest)},e.prototype._update=function(r,i){if(this._dirty=!1,!!this._root){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=Lo.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,l=i-this._box.verticalSum;this._root.update(n,o,s,l,this._spacing,this._items)}},e.prototype._createTabBar=function(){var r=this.renderer.createTabBar();return r.orientation="horizontal",this.parent&&(r.parent=this.parent,this.attachWidget(r)),r},e.prototype._createHandle=function(){var r=this.renderer.createHandle(),i=r.style;return i.position="absolute",i.top="0",i.left="0",i.width="0",i.height="0",this.parent&&this.parent.node.appendChild(r),r},e}(rA),bl;(function(t){t.GOLDEN_RATIO=.618;function e(b){return Math.max(0,Math.floor(b))}t.clampSpacing=e;function r(b){var T=new tA;return T.sizeHint=b,T.size=b,T}t.createSizer=r;function i(b,T){var C;return b.type==="tab-area"?C=l(b,T):C=c(b,T),C}t.normalizeAreaConfig=i;function n(b,T){var C;return b.type==="tab-area"?C=h(b,T):C=g(b,T),C}t.realizeAreaConfig=n;var o=function(){function b(T){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var C=new tA,P=new tA;C.stretch=0,P.stretch=1,this.tabBar=T,this.sizers=[C,P]}return Object.defineProperty(b.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),b.prototype.iterAllWidgets=function(){return mD(mb(this.tabBar),this.iterUserWidgets())},b.prototype.iterUserWidgets=function(){return Jp(this.tabBar.titles,function(T){return T.owner})},b.prototype.iterSelectedWidgets=function(){var T=this.tabBar.currentTitle;return T?mb(T.owner):zh()},b.prototype.iterTabBars=function(){return mb(this.tabBar)},b.prototype.iterHandles=function(){return zh()},b.prototype.findTabNode=function(T){return this.tabBar.titles.indexOf(T.title)!==-1?this:null},b.prototype.findSplitNode=function(T){return null},b.prototype.findFirstTabNode=function(){return this},b.prototype.hitTestTabNodes=function(T,C){return T<this._left||T>=this._left+this._width||C<this._top||C>=this._top+this._height?null:this},b.prototype.createConfig=function(){var T=this.tabBar.titles.map(function(P){return P.owner}),C=this.tabBar.currentIndex;return{type:"tab-area",widgets:T,currentIndex:C}},b.prototype.holdAllSizes=function(){},b.prototype.fit=function(T,C){var P=0,H=0,U=1/0,J=1/0,ee=C.get(this.tabBar),ne=this.tabBar.currentTitle,oe=ne?C.get(ne.owner):void 0,k=this.sizers,Ie=k[0],Y=k[1];return ee&&ee.fit(),oe&&oe.fit(),ee&&!ee.isHidden?(P=Math.max(P,ee.minWidth),H+=ee.minHeight,Ie.minSize=ee.minHeight,Ie.maxSize=ee.maxHeight):(Ie.minSize=0,Ie.maxSize=0),oe&&!oe.isHidden?(P=Math.max(P,oe.minWidth),H+=oe.minHeight,Y.minSize=oe.minHeight,Y.maxSize=1/0):(Y.minSize=0,Y.maxSize=1/0),{minWidth:P,minHeight:H,maxWidth:U,maxHeight:J}},b.prototype.update=function(T,C,P,H,U,J){this._top=C,this._left=T,this._width=P,this._height=H;var ee=J.get(this.tabBar),ne=this.tabBar.currentTitle,oe=ne?J.get(ne.owner):void 0;if(pc.calc(this.sizers,H),ee&&!ee.isHidden){var k=this.sizers[0].size;ee.update(T,C,P,k),C+=k}if(oe&&!oe.isHidden){var k=this.sizers[1].size;oe.update(T,C,P,k)}},b}();t.TabLayoutNode=o;var s=function(){function b(T){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=T}return b.prototype.iterAllWidgets=function(){var T=Jp(this.children,function(C){return C.iterAllWidgets()});return new ng(T)},b.prototype.iterUserWidgets=function(){var T=Jp(this.children,function(C){return C.iterUserWidgets()});return new ng(T)},b.prototype.iterSelectedWidgets=function(){var T=Jp(this.children,function(C){return C.iterSelectedWidgets()});return new ng(T)},b.prototype.iterTabBars=function(){var T=Jp(this.children,function(C){return C.iterTabBars()});return new ng(T)},b.prototype.iterHandles=function(){var T=Jp(this.children,function(C){return C.iterHandles()});return mD(this.handles,new ng(T))},b.prototype.findTabNode=function(T){for(var C=0,P=this.children.length;C<P;++C){var H=this.children[C].findTabNode(T);if(H)return H}return null},b.prototype.findSplitNode=function(T){var C=this.handles.indexOf(T);if(C!==-1)return{index:C,node:this};for(var P=0,H=this.children.length;P<H;++P){var U=this.children[P].findSplitNode(T);if(U)return U}return null},b.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},b.prototype.hitTestTabNodes=function(T,C){for(var P=0,H=this.children.length;P<H;++P){var U=this.children[P].hitTestTabNodes(T,C);if(U)return U}return null},b.prototype.createConfig=function(){var T=this.orientation,C=this.createNormalizedSizes(),P=this.children.map(function(H){return H.createConfig()});return{type:"split-area",orientation:T,children:P,sizes:C}},b.prototype.syncHandles=function(){var T=this;hn(this.handles,function(C,P){C.setAttribute("data-orientation",T.orientation),P===T.handles.length-1?(C.classList.add("lm-mod-hidden"),C.classList.add("p-mod-hidden")):(C.classList.remove("lm-mod-hidden"),C.classList.remove("p-mod-hidden"))})},b.prototype.holdSizes=function(){hn(this.sizers,function(T){T.sizeHint=T.size})},b.prototype.holdAllSizes=function(){hn(this.children,function(T){return T.holdAllSizes()}),this.holdSizes()},b.prototype.normalizeSizes=function(){var T=this.sizers.length;if(T!==0){this.holdSizes();var C=gD(this.sizers,function(P,H){return P+H.sizeHint},0);C===0?hn(this.sizers,function(P){P.size=P.sizeHint=1/T}):hn(this.sizers,function(P){P.size=P.sizeHint/=C}),this.normalized=!0}},b.prototype.createNormalizedSizes=function(){var T=this.sizers.length;if(T===0)return[];var C=this.sizers.map(function(H){return H.size}),P=gD(C,function(H,U){return H+U},0);return P===0?hn(C,function(H,U){C[U]=1/T}):hn(C,function(H,U){C[U]=H/P}),C},b.prototype.fit=function(T,C){for(var P=this.orientation==="horizontal",H=Math.max(0,this.children.length-1)*T,U=P?H:0,J=P?0:H,ee=1/0,ne=1/0,oe=0,k=this.children.length;oe<k;++oe){var Ie=this.children[oe].fit(T,C);P?(J=Math.max(J,Ie.minHeight),U+=Ie.minWidth,this.sizers[oe].minSize=Ie.minWidth):(U=Math.max(U,Ie.minWidth),J+=Ie.minHeight,this.sizers[oe].minSize=Ie.minHeight)}return{minWidth:U,minHeight:J,maxWidth:ee,maxHeight:ne}},b.prototype.update=function(T,C,P,H,U,J){var ee=this.orientation==="horizontal",ne=Math.max(0,this.children.length-1)*U,oe=Math.max(0,(ee?P:H)-ne);this.normalized&&(hn(this.sizers,function(I){I.sizeHint*=oe}),this.normalized=!1),pc.calc(this.sizers,oe);for(var k=0,Ie=this.children.length;k<Ie;++k){var Y=this.children[k],X=this.sizers[k].size,B=this.handles[k].style;ee?(Y.update(T,C,X,H,U,J),T+=X,B.top=C+"px",B.left=T+"px",B.width=U+"px",B.height=H+"px",T+=U):(Y.update(T,C,P,X,U,J),C+=X,B.top=C+"px",B.left=T+"px",B.width=P+"px",B.height=U+"px",C+=U)}},b}();t.SplitLayoutNode=s;function l(b,T){if(b.widgets.length===0)return null;var C=[];if(hn(b.widgets,function(H){T.has(H)||(T.add(H),C.push(H))}),C.length===0)return null;var P=b.currentIndex;return P!==-1&&(P<0||P>=C.length)&&(P=0),{type:"tab-area",widgets:C,currentIndex:P}}function c(b,T){for(var C=b.orientation,P=[],H=[],U=0,J=b.children.length;U<J;++U){var ee=i(b.children[U],T);ee&&(ee.type==="tab-area"||ee.orientation!==C?(P.push(ee),H.push(Math.abs(b.sizes[U]||0))):(P.push.apply(P,ee.children),H.push.apply(H,ee.sizes)))}return P.length===0?null:P.length===1?P[0]:{type:"split-area",orientation:C,children:P,sizes:H}}function h(b,T){var C=T.createTabBar();return hn(b.widgets,function(P){P.hide(),C.addTab(P.title)}),C.currentIndex=b.currentIndex,new o(C)}function g(b,T){var C=new s(b.orientation);return hn(b.children,function(P,H){var U=n(P,T),J=r(b.sizes[H]),ee=T.createHandle();C.children.push(U),C.handles.push(ee),C.sizers.push(J),U.parent=C}),C.syncHandles(),C.normalizeSizes(),C}})(bl||(bl={}));var EC=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:nf.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._previousTitle=null,i._dragData=null,i._tabMoved=new Mo(i),i._currentChanged=new Mo(i),i._tabCloseRequested=new Mo(i),i._tabDetachRequested=new Mo(i),i._tabActivateRequested=new Mo(i),i.addClass("lm-TabBar"),i.addClass("p-TabBar"),i.setFlag(ui.Flag.DisallowLayout),i.tabsMovable=r.tabsMovable||!1,i.allowDeselect=r.allowDeselect||!1,i.insertBehavior=r.insertBehavior||"select-tab-if-needed",i.removeBehavior=r.removeBehavior||"select-tab-after",i.renderer=r.renderer||e.defaultRenderer,i._orientation=r.orientation||"horizontal",i.dataset.orientation=i._orientation,i}return e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(r){this.currentIndex=r?this._titles.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(r){if((r<0||r>=this._titles.length)&&(r=-1),this._currentIndex!==r){var i=this._currentIndex,n=this._titles[i]||null,o=r,s=this._titles[o]||null;this._currentIndex=o,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:o,currentTitle:s})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._releaseMouse(),this._orientation=r,this.dataset.orientation=r)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(r){return this.insertTab(this._titles.length,r)},e.prototype.insertTab=function(r,i){this._releaseMouse();var n=nf.asTitle(i),o=this._titles.indexOf(n),s=Math.max(0,Math.min(r,this._titles.length));return o===-1?(ti.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,o===s||(ti.move(this._titles,o,s),this.update(),this._adjustCurrentForMove(o,s)),n)},e.prototype.removeTab=function(r){this.removeTabAt(this._titles.indexOf(r))},e.prototype.removeTabAt=function(r){this._releaseMouse();var i=ti.removeAt(this._titles,r);i&&(i.changed.disconnect(this._onTitleChanged,this),i===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(r,i))},e.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var r=0,i=this._titles;r<i.length;r++){var n=i[r];n.changed.disconnect(this._onTitleChanged,this)}var o=this.currentIndex,s=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),o!==-1&&this._currentChanged.emit({previousIndex:o,previousTitle:s,currentIndex:-1,currentTitle:null})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(r){for(var i=this._titles,n=this.renderer,o=this.currentTitle,s=new Array(i.length),l=0,c=i.length;l<c;++l){var h=i[l],g=h===o,b=g?c:c-l-1;s[l]=n.renderTab({title:h,current:g,zIndex:b})}Zd.render(s,this.contentNode)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&this._releaseMouse()},e.prototype._evtMouseDown=function(r){if(!(r.button!==0&&r.button!==1)&&!this._dragData){var i=this.contentNode.children,n=ti.findFirstIndex(i,function(s){return Lo.hitTest(s,r.clientX,r.clientY)});if(n!==-1&&(r.preventDefault(),r.stopPropagation(),this._dragData={tab:i[n],index:n,pressX:r.clientX,pressY:r.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},document.addEventListener("mouseup",this,!0),r.button!==1)){var o=i[n].querySelector(this.renderer.closeIconSelector);o&&o.contains(r.target)||(this.tabsMovable&&(document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(r){var i=this._dragData;if(i){r.preventDefault(),r.stopPropagation();var n=this.contentNode.children;if(!(!i.dragActive&&!nf.dragExceeded(i,r))){if(!i.dragActive){var o=i.tab.getBoundingClientRect();this._orientation==="horizontal"?(i.tabPos=i.tab.offsetLeft,i.tabSize=o.width,i.tabPressPos=i.pressX-o.left):(i.tabPos=i.tab.offsetTop,i.tabSize=o.height,i.tabPressPos=i.pressY-o.top),i.tabLayout=nf.snapTabLayout(n,this._orientation),i.contentRect=this.contentNode.getBoundingClientRect(),i.override=$p.overrideCursor("default"),i.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),i.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),i.dragActive=!0}if(!i.detachRequested&&nf.detachExceeded(i,r)){i.detachRequested=!0;var s=i.index,l=r.clientX,c=r.clientY,h=n[s],g=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:g,tab:h,clientX:l,clientY:c}),i.dragAborted)return}nf.layoutTabs(n,i,r,this._orientation)}}},e.prototype._evtMouseUp=function(r){var i=this;if(!(r.button!==0&&r.button!==1)){var n=this._dragData;if(n){if(r.preventDefault(),r.stopPropagation(),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),!n.dragActive){this._dragData=null;var o=this.contentNode.children,s=ti.findFirstIndex(o,function(g){return Lo.hitTest(g,r.clientX,r.clientY)});if(s!==n.index)return;var l=this._titles[s];if(!l.closable)return;if(r.button===1){this._tabCloseRequested.emit({index:s,title:l});return}var c=o[s].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(r.target)){this._tabCloseRequested.emit({index:s,title:l});return}return}if(r.button===0){nf.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("lm-mod-dragging"),n.tab.classList.remove("p-mod-dragging");var h=nf.parseTransitionDuration(n.tab);setTimeout(function(){if(!n.dragAborted){i._dragData=null,nf.resetTabPositions(i.contentNode.children,i._orientation),n.override.dispose(),i.removeClass("lm-mod-dragging"),i.removeClass("p-mod-dragging");var g=n.index,b=n.targetIndex;b===-1||g===b||(ti.move(i._titles,g,b),i._adjustCurrentForMove(g,b),i._tabMoved.emit({fromIndex:g,toIndex:b,title:i._titles[b]}),Br.sendMessage(i,ui.Msg.UpdateRequest))}},h)}}}},e.prototype._releaseMouse=function(){var r=this._dragData;r&&(this._dragData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),r.dragAborted=!0,r.dragActive&&(nf.resetTabPositions(this.contentNode.children,this._orientation),r.override.dispose(),r.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),r.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(r,i){var n=this.currentTitle,o=this._currentIndex,s=this.insertBehavior;if(s==="select-tab"||s==="select-tab-if-needed"&&o===-1){this._currentIndex=r,this._previousTitle=n,this._currentChanged.emit({previousIndex:o,previousTitle:n,currentIndex:r,currentTitle:i});return}o>=r&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(r,i){this._currentIndex===r?this._currentIndex=i:this._currentIndex<r&&this._currentIndex>=i?this._currentIndex++:this._currentIndex>r&&this._currentIndex<=i&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(r,i){var n=this._currentIndex,o=this.removeBehavior;if(n!==r){n>r&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:-1,currentTitle:null});return}if(o==="select-tab-after"){this._currentIndex=Math.min(r,this._titles.length-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(o==="select-tab-before"){this._currentIndex=Math.max(0,r-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(o==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(r,this._titles.length-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:-1,currentTitle:null})},e.prototype._onTitleChanged=function(r){this.update()},e}(ui);(function(t){var e=function(){function r(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return r.prototype.renderTab=function(i){var n=i.title.caption,o=this.createTabKey(i),s=this.createTabStyle(i),l=this.createTabClass(i),c=this.createTabDataset(i);return Fo.li({key:o,className:l,title:n,style:s,dataset:c},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i))},r.prototype.renderIcon=function(i){var n=i.title,o=this.createIconClass(i);return typeof n.icon=="string"?Fo.div({className:o},n.iconLabel):Fo.div({className:o},n.icon,n.iconLabel)},r.prototype.renderLabel=function(i){return Fo.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},i.title.label)},r.prototype.renderCloseIcon=function(i){return Fo.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},r.prototype.createTabKey=function(i){var n=this._tabKeys.get(i.title);return n===void 0&&(n="tab-key-"+this._tabID++,this._tabKeys.set(i.title,n)),n},r.prototype.createTabStyle=function(i){return{zIndex:""+i.zIndex}},r.prototype.createTabClass=function(i){var n="lm-TabBar-tab";return n+=" p-TabBar-tab",i.title.className&&(n+=" "+i.title.className),i.title.closable&&(n+=" lm-mod-closable",n+=" p-mod-closable"),i.current&&(n+=" lm-mod-current",n+=" p-mod-current"),n},r.prototype.createTabDataset=function(i){return i.title.dataset},r.prototype.createIconClass=function(i){var n="lm-TabBar-tabIcon";n+=" p-TabBar-tabIcon";var o=i.title.iconClass;return o?n+" "+o:n},r}();t.Renderer=e,t.defaultRenderer=new e})(EC||(EC={}));var nf;(function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20;function e(){var g=document.createElement("div"),b=document.createElement("ul");return b.className="lm-TabBar-content",b.classList.add("p-TabBar-content"),g.appendChild(b),g}t.createNode=e;function r(g){return g instanceof LD?g:new LD(g)}t.asTitle=r;function i(g){var b=window.getComputedStyle(g);return 1e3*(parseFloat(b.transitionDuration)||0)}t.parseTransitionDuration=i;function n(g,b){for(var T=new Array(g.length),C=0,P=g.length;C<P;++C){var H=g[C],U=window.getComputedStyle(H);b==="horizontal"?T[C]={pos:H.offsetLeft,size:H.offsetWidth,margin:parseFloat(U.marginLeft)||0}:T[C]={pos:H.offsetTop,size:H.offsetHeight,margin:parseFloat(U.marginTop)||0}}return T}t.snapTabLayout=n;function o(g,b){var T=Math.abs(b.clientX-g.pressX),C=Math.abs(b.clientY-g.pressY);return T>=t.DRAG_THRESHOLD||C>=t.DRAG_THRESHOLD}t.dragExceeded=o;function s(g,b){var T=g.contentRect;return b.clientX<T.left-t.DETACH_THRESHOLD||b.clientX>=T.right+t.DETACH_THRESHOLD||b.clientY<T.top-t.DETACH_THRESHOLD||b.clientY>=T.bottom+t.DETACH_THRESHOLD}t.detachExceeded=s;function l(g,b,T,C){var P,H,U,J;C==="horizontal"?(P=b.pressX,H=T.clientX-b.contentRect.left,U=T.clientX,J=b.contentRect.width):(P=b.pressY,H=T.clientY-b.contentRect.top,U=T.clientY,J=b.contentRect.height);for(var ee=b.index,ne=H-b.tabPressPos,oe=ne+b.tabSize,k=0,Ie=g.length;k<Ie;++k){var Y=void 0,X=b.tabLayout[k],B=X.pos+(X.size>>1);if(k<b.index&&ne<B)Y=b.tabSize+b.tabLayout[k+1].margin+"px",ee=Math.min(ee,k);else if(k>b.index&&oe>B)Y=-b.tabSize-X.margin+"px",ee=Math.max(ee,k);else if(k===b.index){var I=U-P,j=J-(b.tabPos+b.tabSize);Y=Math.max(-b.tabPos,Math.min(I,j))+"px"}else Y="";C==="horizontal"?g[k].style.left=Y:g[k].style.top=Y}b.targetIndex=ee}t.layoutTabs=l;function c(g,b){var T;b==="horizontal"?T=g.contentRect.width:T=g.contentRect.height;var C;if(g.targetIndex===g.index)C=0;else if(g.targetIndex>g.index){var P=g.tabLayout[g.targetIndex];C=P.pos+P.size-g.tabSize-g.tabPos}else{var P=g.tabLayout[g.targetIndex];C=P.pos-g.tabPos}var H=T-(g.tabPos+g.tabSize),U=Math.max(-g.tabPos,Math.min(C,H));b==="horizontal"?g.tab.style.left=U+"px":g.tab.style.top=U+"px"}t.finalizeTabPosition=c;function h(g,b){hn(g,function(T){b==="horizontal"?T.style.left="":T.style.top=""})}t.resetTabPositions=h})(nf||(nf={}));var BK=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;i._drag=null,i._tabsMovable=!0,i._pressData=null,i._layoutModified=new Mo(i),i.addClass("lm-DockPanel"),i.addClass("p-DockPanel"),i._mode=r.mode||"multiple-document",i._renderer=r.renderer||e.defaultRenderer,i._edges=r.edges||da.DEFAULT_EDGES,r.tabsMovable!==void 0&&(i._tabsMovable=r.tabsMovable),i.dataset.mode=i._mode;var n={createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}};return i.layout=new bTe({renderer:n,spacing:r.spacing}),i.overlay=r.overlay||new e.Overlay,i.node.appendChild(i.overlay.node),i}return e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(r){if(this._mode!==r){this._mode=r,this.dataset.mode=r;var i=this.layout;switch(r){case"multiple-document":hn(i.tabBars(),function(n){n.show()});break;case"single-document":i.restoreLayout(da.createSingleDocumentConfig(this));break;default:throw"unreachable"}Br.postMessage(this,da.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(r){this._tabsMovable=r,hn(this.tabBars(),function(i){return i.tabsMovable=r})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(r){var i=ty(this.tabBars(),function(n){return n.titles.indexOf(r.title)!==-1});if(!i)throw new Error("Widget is not contained in the dock panel.");i.currentTitle=r.title},e.prototype.activateWidget=function(r){this.selectWidget(r),r.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(r){this._mode="multiple-document",this.layout.restoreLayout(r),(nu.IS_EDGE||nu.IS_IE)&&Br.flush(),Br.postMessage(this,da.LayoutModified)},e.prototype.addWidget=function(r,i){i===void 0&&(i={}),this._mode==="single-document"?this.layout.addWidget(r):this.layout.addWidget(r,i),Br.postMessage(this,da.LayoutModified)},e.prototype.processMessage=function(r){r.type==="layout-modified"?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,r)},e.prototype.handleEvent=function(r){switch(r.type){case"lm-dragenter":this._evtDragEnter(r);break;case"lm-dragleave":this._evtDragLeave(r);break;case"lm-dragover":this._evtDragOver(r);break;case"lm-drop":this._evtDrop(r);break;case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(r){da.isGeneratedTabBarProperty.get(r.child)||(r.child.addClass("lm-DockPanel-widget"),r.child.addClass("p-DockPanel-widget"))},e.prototype.onChildRemoved=function(r){da.isGeneratedTabBarProperty.get(r.child)||(r.child.removeClass("lm-DockPanel-widget"),r.child.removeClass("p-DockPanel-widget"),Br.postMessage(this,da.LayoutModified))},e.prototype._evtDragEnter=function(r){r.mimeData.hasData("application/vnd.lumino.widget-factory")&&(r.preventDefault(),r.stopPropagation())},e.prototype._evtDragLeave=function(r){r.preventDefault(),r.stopPropagation(),this.overlay.hide(1)},e.prototype._evtDragOver=function(r){r.preventDefault(),r.stopPropagation(),this._showOverlay(r.clientX,r.clientY)==="invalid"?r.dropAction="none":r.dropAction=r.proposedAction},e.prototype._evtDrop=function(r){if(r.preventDefault(),r.stopPropagation(),this.overlay.hide(0),r.proposedAction==="none"){r.dropAction="none";return}var i=r.clientX,n=r.clientY,o=da.findDropTarget(this,i,n,this._edges),s=o.zone,l=o.target;if(s==="invalid"){r.dropAction="none";return}var c=r.mimeData,h=c.getData("application/vnd.lumino.widget-factory");if(typeof h!="function"){r.dropAction="none";return}var g=h();if(!(g instanceof ui)){r.dropAction="none";return}if(g.contains(this)){r.dropAction="none";return}var b=l?da.getDropRef(l.tabBar):null;switch(s){case"root-all":this.addWidget(g);break;case"root-top":this.addWidget(g,{mode:"split-top"});break;case"root-left":this.addWidget(g,{mode:"split-left"});break;case"root-right":this.addWidget(g,{mode:"split-right"});break;case"root-bottom":this.addWidget(g,{mode:"split-bottom"});break;case"widget-all":this.addWidget(g,{mode:"tab-after",ref:b});break;case"widget-top":this.addWidget(g,{mode:"split-top",ref:b});break;case"widget-left":this.addWidget(g,{mode:"split-left",ref:b});break;case"widget-right":this.addWidget(g,{mode:"split-right",ref:b});break;case"widget-bottom":this.addWidget(g,{mode:"split-bottom",ref:b});break;case"widget-tab":this.addWidget(g,{mode:"tab-after",ref:b});break;default:throw"unreachable"}r.dropAction=r.proposedAction,this.activateWidget(g)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&(this._releaseMouse(),Br.postMessage(this,da.LayoutModified))},e.prototype._evtMouseDown=function(r){if(r.button===0){var i=this.layout,n=r.target,o=ty(i.handles(),function(b){return b.contains(n)});if(o){r.preventDefault(),r.stopPropagation(),document.addEventListener("keydown",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("contextmenu",this,!0);var s=o.getBoundingClientRect(),l=r.clientX-s.left,c=r.clientY-s.top,h=window.getComputedStyle(o),g=$p.overrideCursor(h.cursor);this._pressData={handle:o,deltaX:l,deltaY:c,override:g}}}},e.prototype._evtMouseMove=function(r){if(this._pressData){r.preventDefault(),r.stopPropagation();var i=this.node.getBoundingClientRect(),n=r.clientX-i.left-this._pressData.deltaX,o=r.clientY-i.top-this._pressData.deltaY,s=this.layout;s.moveHandle(this._pressData.handle,n,o)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse(),Br.postMessage(this,da.LayoutModified))},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("keydown",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("contextmenu",this,!0))},e.prototype._showOverlay=function(r,i){var n=da.findDropTarget(this,r,i,this._edges),o=n.zone,s=n.target;if(o==="invalid")return this.overlay.hide(100),o;var l,c,h,g,b=Lo.boxSizing(this.node),T=this.node.getBoundingClientRect();switch(o){case"root-all":l=b.paddingTop,c=b.paddingLeft,h=b.paddingRight,g=b.paddingBottom;break;case"root-top":l=b.paddingTop,c=b.paddingLeft,h=b.paddingRight,g=T.height*da.GOLDEN_RATIO;break;case"root-left":l=b.paddingTop,c=b.paddingLeft,h=T.width*da.GOLDEN_RATIO,g=b.paddingBottom;break;case"root-right":l=b.paddingTop,c=T.width*da.GOLDEN_RATIO,h=b.paddingRight,g=b.paddingBottom;break;case"root-bottom":l=T.height*da.GOLDEN_RATIO,c=b.paddingLeft,h=b.paddingRight,g=b.paddingBottom;break;case"widget-all":l=s.top,c=s.left,h=s.right,g=s.bottom;break;case"widget-top":l=s.top,c=s.left,h=s.right,g=s.bottom+s.height/2;break;case"widget-left":l=s.top,c=s.left,h=s.right+s.width/2,g=s.bottom;break;case"widget-right":l=s.top,c=s.left+s.width/2,h=s.right,g=s.bottom;break;case"widget-bottom":l=s.top+s.height/2,c=s.left,h=s.right,g=s.bottom;break;case"widget-tab":var C=s.tabBar.node.getBoundingClientRect().height;l=s.top,c=s.left,h=s.right,g=s.bottom+s.height-C;break;default:throw"unreachable"}return this.overlay.show({top:l,left:c,right:h,bottom:g}),o},e.prototype._createTabBar=function(){var r=this._renderer.createTabBar();return da.isGeneratedTabBarProperty.set(r,!0),this._mode==="single-document"&&r.hide(),r.tabsMovable=this._tabsMovable,r.allowDeselect=!1,r.removeBehavior="select-previous-tab",r.insertBehavior="select-tab-if-needed",r.tabMoved.connect(this._onTabMoved,this),r.currentChanged.connect(this._onCurrentChanged,this),r.tabCloseRequested.connect(this._onTabCloseRequested,this),r.tabDetachRequested.connect(this._onTabDetachRequested,this),r.tabActivateRequested.connect(this._onTabActivateRequested,this),r},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){Br.postMessage(this,da.LayoutModified)},e.prototype._onCurrentChanged=function(r,i){var n=i.previousTitle,o=i.currentTitle;n&&n.owner.hide(),o&&o.owner.show(),(nu.IS_EDGE||nu.IS_IE)&&Br.flush(),Br.postMessage(this,da.LayoutModified)},e.prototype._onTabActivateRequested=function(r,i){i.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,i){i.title.owner.close()},e.prototype._onTabDetachRequested=function(r,i){var n=this;if(!this._drag){r.releaseMouse();var o=i.title,s=i.tab,l=i.clientX,c=i.clientY,h=new xK,g=function(){return o.owner};h.setData("application/vnd.lumino.widget-factory",g);var b=s.cloneNode(!0);this._drag=new $p({mimeData:h,dragImage:b,proposedAction:"move",supportedActions:"move"}),s.classList.add("lm-mod-hidden"),s.classList.add("p-mod-hidden");var T=function(){n._drag=null,s.classList.remove("lm-mod-hidden"),s.classList.remove("p-mod-hidden")};this._drag.start(l,c).then(T)}},e}(ui);(function(t){var e=function(){function i(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return i.prototype.show=function(n){var o=this.node.style;o.top=n.top+"px",o.left=n.left+"px",o.right=n.right+"px",o.bottom=n.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},i.prototype.hide=function(n){var o=this;if(!this._hidden){if(n<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(function(){o._timer=-1,o._hidden=!0,o.node.classList.add("lm-mod-hidden"),o.node.classList.add("p-mod-hidden")},n))}},i}();t.Overlay=e;var r=function(){function i(){}return i.prototype.createTabBar=function(){var n=new EC;return n.addClass("lm-DockPanel-tabBar"),n.addClass("p-DockPanel-tabBar"),n},i.prototype.createHandle=function(){var n=document.createElement("div");return n.className="lm-DockPanel-handle",n.classList.add("p-DockPanel-handle"),n},i}();t.Renderer=r,t.defaultRenderer=new r})(BK||(BK={}));var da;(function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new ry("layout-modified"),t.isGeneratedTabBarProperty=new fc({name:"isGeneratedTabBar",create:function(){return!1}});function e(n){if(n.isEmpty)return{main:null};var o=uK(n.widgets()),s=n.selectedWidgets().next(),l=s?o.indexOf(s):-1;return{main:{type:"tab-area",widgets:o,currentIndex:l}}}t.createSingleDocumentConfig=e;function r(n,o,s,l){if(!Lo.hitTest(n.node,o,s))return{zone:"invalid",target:null};var c=n.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(n.mode==="multiple-document"){var h=n.node.getBoundingClientRect(),g=o-h.left+1,b=s-h.top+1,T=h.right-o,C=h.bottom-s,P=Math.min(b,T,C,g);switch(P){case b:if(b<l.top)return{zone:"root-top",target:null};break;case T:if(T<l.right)return{zone:"root-right",target:null};break;case C:if(C<l.bottom)return{zone:"root-bottom",target:null};break;case g:if(g<l.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var H=c.hitTestTabAreas(o,s);if(!H)return{zone:"invalid",target:null};if(n.mode==="single-document")return{zone:"widget-all",target:H};var U=H.x-H.left+1,J=H.y-H.top+1,ee=H.left+H.width-H.x,ne=H.top+H.height-H.y,oe=H.tabBar.node.getBoundingClientRect().height;if(J<oe)return{zone:"widget-tab",target:H};var k=Math.round(H.width/3),Ie=Math.round(H.height/3);if(U>k&&ee>k&&J>Ie&&ne>Ie)return{zone:"widget-all",target:H};U/=k,J/=Ie,ee/=k,ne/=Ie;var Y=Math.min(U,J,ee,ne),X;switch(Y){case U:X="widget-left";break;case J:X="widget-top";break;case ee:X="widget-right";break;case ne:X="widget-bottom";break;default:throw"unreachable"}return{zone:X,target:H}}t.findDropTarget=r;function i(n){return n.titles.length===0?null:n.currentTitle?n.currentTitle.owner:n.titles[n.titles.length-1].owner}t.getDropRef=i})(da||(da={}));var fmt=function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new Mo(this),this._currentChanged=new Mo(this)}return t.prototype.dispose=function(){var e=this;this._counter<0||(this._counter=-1,Mo.clearData(this),hn(this._widgets,function(r){r.node.removeEventListener("focus",e,!0),r.node.removeEventListener("blur",e,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(e){var r=this._numbers.get(e);return r===void 0?-1:r},t.prototype.has=function(e){return this._numbers.has(e)},t.prototype.add=function(e){if(!this._numbers.has(e)){var r=e.node.contains(document.activeElement),i=r?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,i),this._nodes.set(e.node,e),e.node.addEventListener("focus",this,!0),e.node.addEventListener("blur",this,!0),e.disposed.connect(this._onWidgetDisposed,this),r&&this._setWidgets(e,e)}},t.prototype.remove=function(e){var r=this;if(this._numbers.has(e)&&(e.disposed.disconnect(this._onWidgetDisposed,this),e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0),ti.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget===e)){var i=cK(this._widgets,function(o){return r._numbers.get(o)!==-1}),n=fK(i,function(o,s){var l=r._numbers.get(o),c=r._numbers.get(s);return l-c})||null;this._setWidgets(n,null)}},t.prototype.handleEvent=function(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e);break}},t.prototype._setWidgets=function(e,r){var i=this._currentWidget;this._currentWidget=e;var n=this._activeWidget;this._activeWidget=r,i!==e&&this._currentChanged.emit({oldValue:i,newValue:e}),n!==r&&this._activeChanged.emit({oldValue:n,newValue:r})},t.prototype._evtFocus=function(e){var r=this._nodes.get(e.currentTarget);r!==this._currentWidget&&this._numbers.set(r,this._counter++),this._setWidgets(r,r)},t.prototype._evtBlur=function(e){var r=this._nodes.get(e.currentTarget),i=e.relatedTarget;if(!i){this._setWidgets(this._currentWidget,null);return}if(!r.node.contains(i)&&!ty(this._widgets,function(n){return n.node.contains(i)})){this._setWidgets(this._currentWidget,null);return}},t.prototype._onWidgetDisposed=function(e){this.remove(e)},t}(),UD=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,r)||this;return i._dirty=!1,i._rowSpacing=4,i._columnSpacing=4,i._items=[],i._rowStarts=[],i._columnStarts=[],i._rowSizers=[new tA],i._columnSizers=[new tA],i._box=null,r.rowCount!==void 0&&ol.reallocSizers(i._rowSizers,r.rowCount),r.columnCount!==void 0&&ol.reallocSizers(i._columnSizers,r.columnCount),r.rowSpacing!==void 0&&(i._rowSpacing=ol.clampValue(r.rowSpacing)),r.columnSpacing!==void 0&&(i._columnSpacing=ol.clampValue(r.columnSpacing)),i}return e.prototype.dispose=function(){hn(this._items,function(r){var i=r.widget;r.dispose(),i.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(r){r!==this.rowCount&&(ol.reallocSizers(this._rowSizers,r),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(r){r!==this.columnCount&&(ol.reallocSizers(this._columnSizers,r),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(r){r=ol.clampValue(r),this._rowSpacing!==r&&(this._rowSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(r){r=ol.clampValue(r),this._columnSpacing!==r&&(this._columnSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(r){var i=this._rowSizers[r];return i?i.stretch:-1},e.prototype.setRowStretch=function(r,i){var n=this._rowSizers[r];n&&(i=ol.clampValue(i),n.stretch!==i&&(n.stretch=i,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(r){var i=this._columnSizers[r];return i?i.stretch:-1},e.prototype.setColumnStretch=function(r,i){var n=this._columnSizers[r];n&&(i=ol.clampValue(i),n.stretch!==i&&(n.stretch=i,this.parent&&this.parent.update()))},e.prototype.iter=function(){return Jp(this._items,function(r){return r.widget})},e.prototype.addWidget=function(r){var i=ti.findFirstIndex(this._items,function(n){return n.widget===r});i===-1&&(this._items.push(new yb(r)),this.parent&&this.attachWidget(r))},e.prototype.removeWidget=function(r){var i=ti.findFirstIndex(this._items,function(o){return o.widget===r});if(i!==-1){var n=ti.removeAt(this._items,i);this.parent&&this.detachWidget(r),n.dispose()}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),hn(this,function(i){r.attachWidget(i)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&Br.sendMessage(r,ui.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(r){this.parent.isAttached&&Br.sendMessage(r,ui.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=this.rowCount;r<i;++r)this._rowSizers[r].minSize=0;for(var r=0,i=this.columnCount;r<i;++r)this._columnSizers[r].minSize=0;for(var n=this._items.filter(function(J){return!J.isHidden}),r=0,i=n.length;r<i;++r)n[r].fit();var o=this.rowCount-1,s=this.columnCount-1;n.sort(ol.rowSpanCmp);for(var r=0,i=n.length;r<i;++r){var l=n[r],c=e.getCellConfig(l.widget),h=Math.min(c.row,o),g=Math.min(c.row+c.rowSpan-1,o);ol.distributeMin(this._rowSizers,h,g,l.minHeight)}n.sort(ol.columnSpanCmp);for(var r=0,i=n.length;r<i;++r){var l=n[r],c=e.getCellConfig(l.widget),b=Math.min(c.column,s),T=Math.min(c.column+c.columnSpan-1,s);ol.distributeMin(this._columnSizers,b,T,l.minWidth)}if(this.fitPolicy==="set-no-constraint"){Br.sendMessage(this.parent,ui.Msg.UpdateRequest);return}for(var C=o*this._rowSpacing,P=s*this._columnSpacing,r=0,i=this.rowCount;r<i;++r)C+=this._rowSizers[r].minSize;for(var r=0,i=this.columnCount;r<i;++r)P+=this._columnSizers[r].minSize;var H=this._box=Lo.boxSizing(this.parent.node);P+=H.horizontalSum,C+=H.verticalSum;var U=this.parent.node.style;U.minWidth=P+"px",U.minHeight=C+"px",this._dirty=!0,this.parent.parent&&Br.sendMessage(this.parent.parent,ui.Msg.FitRequest),this._dirty&&Br.sendMessage(this.parent,ui.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1,r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=Lo.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,l=i-this._box.verticalSum,c=this.rowCount-1,h=this.columnCount-1,g=c*this._rowSpacing,b=h*this._columnSpacing;pc.calc(this._rowSizers,Math.max(0,l-g)),pc.calc(this._columnSizers,Math.max(0,s-b));for(var T=0,C=n,P=this.rowCount;T<P;++T)this._rowStarts[T]=C,C+=this._rowSizers[T].size+this._rowSpacing;for(var T=0,C=o,P=this.columnCount;T<P;++T)this._columnStarts[T]=C,C+=this._columnSizers[T].size+this._columnSpacing;for(var T=0,P=this._items.length;T<P;++T){var H=this._items[T];if(!H.isHidden){var U=e.getCellConfig(H.widget),J=Math.min(U.row,c),ee=Math.min(U.column,h),ne=Math.min(U.row+U.rowSpan-1,c),oe=Math.min(U.column+U.columnSpan-1,h),k=this._columnStarts[ee],Ie=this._rowStarts[J],Y=this._columnStarts[oe]+this._columnSizers[oe].size-k,X=this._rowStarts[ne]+this._rowSizers[ne].size-Ie;H.update(k,Ie,Y,X)}}},e}(rA);(function(t){function e(i){return ol.cellConfigProperty.get(i)}t.getCellConfig=e;function r(i,n){ol.cellConfigProperty.set(i,ol.normalizeConfig(n))}t.setCellConfig=r})(UD||(UD={}));var ol;(function(t){t.cellConfigProperty=new fc({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:l});function e(c){var h=Math.max(0,Math.floor(c.row||0)),g=Math.max(0,Math.floor(c.column||0)),b=Math.max(1,Math.floor(c.rowSpan||0)),T=Math.max(1,Math.floor(c.columnSpan||0));return{row:h,column:g,rowSpan:b,columnSpan:T}}t.normalizeConfig=e;function r(c){return Math.max(0,Math.floor(c))}t.clampValue=r;function i(c,h){var g=t.cellConfigProperty.get(c.widget),b=t.cellConfigProperty.get(h.widget);return g.rowSpan-b.rowSpan}t.rowSpanCmp=i;function n(c,h){var g=t.cellConfigProperty.get(c.widget),b=t.cellConfigProperty.get(h.widget);return g.columnSpan-b.columnSpan}t.columnSpanCmp=n;function o(c,h){for(h=Math.max(1,Math.floor(h));c.length<h;)c.push(new tA);c.length>h&&(c.length=h)}t.reallocSizers=o;function s(c,h,g,b){if(!(g<h)){if(h===g){var T=c[h];T.minSize=Math.max(T.minSize,b);return}for(var C=0,P=h;P<=g;++P)C+=c[P].minSize;if(!(C>=b))for(var H=(b-C)/(g-h+1),P=h;P<=g;++P)c[P].minSize+=H}}t.distributeMin=s;function l(c){c.parent&&c.parent.layout instanceof UD&&c.parent.fit()}})(ol||(ol={}));var OK=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:SC.createNode()})||this;return i._activeIndex=-1,i._menus=[],i._childMenu=null,i.addClass("lm-MenuBar"),i.addClass("p-MenuBar"),i.setFlag(ui.Flag.DisallowLayout),i.renderer=r.renderer||e.defaultRenderer,i}return e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(r){this.activeIndex=r?this._menus.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(r){(r<0||r>=this._menus.length)&&(r=-1),this._activeIndex!==r&&(this._activeIndex=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(r){this.insertMenu(this._menus.length,r)},e.prototype.insertMenu=function(r,i){this._closeChildMenu();var n=this._menus.indexOf(i),o=Math.max(0,Math.min(r,this._menus.length));if(n===-1){ti.insert(this._menus,o,i),i.addClass("lm-MenuBar-menu"),i.addClass("p-MenuBar-menu"),i.aboutToClose.connect(this._onMenuAboutToClose,this),i.menuRequested.connect(this._onMenuMenuRequested,this),i.title.changed.connect(this._onTitleChanged,this),this.update();return}o===this._menus.length&&o--,n!==o&&(ti.move(this._menus,n,o),this.update())},e.prototype.removeMenu=function(r){this.removeMenuAt(this._menus.indexOf(r))},e.prototype.removeMenuAt=function(r){this._closeChildMenu();var i=ti.removeAt(this._menus,r);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),i.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var r=0,i=this._menus;r<i.length;r++){var n=i[r];n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),n.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},e.prototype.handleEvent=function(r){switch(r.type){case"keydown":this._evtKeyDown(r);break;case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseleave":this._evtMouseLeave(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},e.prototype.onActivateRequest=function(r){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(r){for(var i=this._menus,n=this.renderer,o=this._activeIndex,s=new Array(i.length),l=0,c=i.length;l<c;++l){var h=i[l].title,g=l===o;s[l]=n.renderItem({title:h,active:g})}Zd.render(s,this.contentNode)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation();var i=r.keyCode;if(i===13||i===38||i===40){this.openActiveMenu();return}if(i===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(i===37){var n=this._activeIndex,o=this._menus.length;this.activeIndex=n===0?o-1:n-1;return}if(i===39){var n=this._activeIndex,o=this._menus.length;this.activeIndex=n===o-1?0:n+1;return}var s=_b().keyForKeydownEvent(r);if(s){var l=this._activeIndex+1,c=SC.findMnemonic(this._menus,s,l);c.index!==-1&&!c.multiple?(this.activeIndex=c.index,this.openActiveMenu()):c.index!==-1?this.activeIndex=c.index:c.auto!==-1&&(this.activeIndex=c.auto)}},e.prototype._evtMouseDown=function(r){if(Lo.hitTest(this.node,r.clientX,r.clientY)){r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();var i=ti.findFirstIndex(this.contentNode.children,function(n){return Lo.hitTest(n,r.clientX,r.clientY)});if(i===-1){this._closeChildMenu();return}r.button===0&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=i):(this.activeIndex=i,this._openChildMenu()))}},e.prototype._evtMouseMove=function(r){var i=ti.findFirstIndex(this.contentNode.children,function(n){return Lo.hitTest(n,r.clientX,r.clientY)});i!==this._activeIndex&&(i===-1&&this._childMenu||(this.activeIndex=i,this._childMenu&&this._openChildMenu()))},e.prototype._evtMouseLeave=function(r){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(){var r=this.activeMenu;if(!r){this._closeChildMenu();return}var i=this._childMenu;if(i!==r){this._childMenu=r,i?i.close():(this.addClass("lm-mod-active"),this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),Br.sendMessage(this,ui.Msg.UpdateRequest);var n=this.contentNode.children[this._activeIndex],o=n.getBoundingClientRect(),s=o.left,l=o.bottom;r.open(s,l,{forceX:!0,forceY:!0})}},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var r=this._childMenu;this._childMenu=null,r.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(r){r===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(r,i){if(r===this._childMenu){var n=this._activeIndex,o=this._menus.length;switch(i){case"next":this.activeIndex=n===o-1?0:n+1;break;case"previous":this.activeIndex=n===0?o-1:n-1;break}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(ui);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i);return Fo.li({className:n,dataset:o},this.renderIcon(i),this.renderLabel(i))},r.prototype.renderIcon=function(i){var n=this.createIconClass(i);return typeof i.title.icon=="string"?Fo.div({className:n},i.title.iconLabel):Fo.div({className:n},i.title.icon,i.title.iconLabel)},r.prototype.renderLabel=function(i){var n=this.formatLabel(i);return Fo.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},n)},r.prototype.createItemClass=function(i){var n="lm-MenuBar-item";return n+=" p-MenuBar-item",i.title.className&&(n+=" "+i.title.className),i.active&&(n+=" lm-mod-active",n+=" p-mod-active"),n},r.prototype.createItemDataset=function(i){return i.title.dataset},r.prototype.createIconClass=function(i){var n="lm-MenuBar-itemIcon";n+=" p-MenuBar-itemIcon";var o=i.title.iconClass;return o?n+" "+o:n},r.prototype.formatLabel=function(i){var n=i.title,o=n.label,s=n.mnemonic;if(s<0||s>=o.length)return o;var l=o.slice(0,s),c=o.slice(s+1),h=o[s],g=Fo.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},h);return[l,g,c]},r}();t.Renderer=e,t.defaultRenderer=new e})(OK||(OK={}));var SC;(function(t){function e(){var i=document.createElement("div"),n=document.createElement("ul");return n.className="lm-MenuBar-content",n.classList.add("p-MenuBar-content"),i.appendChild(n),i.tabIndex=-1,i}t.createNode=e;function r(i,n,o){for(var s=-1,l=-1,c=!1,h=n.toUpperCase(),g=0,b=i.length;g<b;++g){var T=(g+o)%b,C=i[T].title;if(C.label.length!==0){var P=C.mnemonic;if(P>=0&&P<C.label.length){C.label[P].toUpperCase()===h&&(s===-1?s=T:c=!0);continue}l===-1&&C.label[0].toUpperCase()===h&&(l=T)}}return{index:s,multiple:c,auto:l}}t.findMnemonic=r})(SC||(SC={}));var hmt=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:CC.createNode()})||this;return i._onRepeat=function(){if(i._repeatTimer=-1,!!i._pressData){var n=i._pressData.part;if(n!=="thumb"){i._repeatTimer=window.setTimeout(i._onRepeat,20);var o=i._pressData.mouseX,s=i._pressData.mouseY;if(n==="decrement"){if(!Lo.hitTest(i.decrementNode,o,s))return;i._stepRequested.emit("decrement");return}if(n==="increment"){if(!Lo.hitTest(i.incrementNode,o,s))return;i._stepRequested.emit("increment");return}if(n==="track"){if(!Lo.hitTest(i.trackNode,o,s))return;var l=i.thumbNode;if(Lo.hitTest(l,o,s))return;var c=l.getBoundingClientRect(),h=void 0;i._orientation==="horizontal"?h=o<c.left?"decrement":"increment":h=s<c.top?"decrement":"increment",i._pageRequested.emit(h);return}}}},i._value=0,i._page=10,i._maximum=100,i._repeatTimer=-1,i._pressData=null,i._thumbMoved=new Mo(i),i._stepRequested=new Mo(i),i._pageRequested=new Mo(i),i.addClass("lm-ScrollBar"),i.addClass("p-ScrollBar"),i.setFlag(ui.Flag.DisallowLayout),i._orientation=r.orientation||"vertical",i.dataset.orientation=i._orientation,r.maximum!==void 0&&(i._maximum=Math.max(0,r.maximum)),r.page!==void 0&&(i._page=Math.max(0,r.page)),r.value!==void 0&&(i._value=Math.max(0,Math.min(r.value,i._maximum))),i}return Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._releaseMouse(),this._orientation=r,this.dataset.orientation=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(r){r=Math.max(0,Math.min(r,this._maximum)),this._value!==r&&(this._value=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(r){r=Math.max(0,r),this._page!==r&&(this._page=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(r){r=Math.max(0,r),this._maximum!==r&&(this._maximum=r,this._value=Math.min(this._value,r),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(r){var i=this._value*100/this._maximum,n=this._page*100/(this._page+this._maximum);i=Math.max(0,Math.min(i,100)),n=Math.max(0,Math.min(n,100));var o=this.thumbNode.style;this._orientation==="horizontal"?(o.top="",o.height="",o.left=i+"%",o.width=n+"%",o.transform="translate("+-i+"%, 0%)"):(o.left="",o.width="",o.top=i+"%",o.height=n+"%",o.transform="translate(0%, "+-i+"%)")},e.prototype._evtKeyDown=function(r){if(r.preventDefault(),r.stopPropagation(),r.keyCode===27){var i=this._pressData?this._pressData.value:-1;this._releaseMouse(),i!==-1&&this._moveThumb(i)}},e.prototype._evtMouseDown=function(r){if(r.button===0&&(this.activate(),!this._pressData)){var i=CC.findPart(this,r.target);if(i){r.preventDefault(),r.stopPropagation();var n=$p.overrideCursor("default");if(this._pressData={part:i,override:n,delta:-1,value:-1,mouseX:r.clientX,mouseY:r.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),i==="thumb"){var o=this.thumbNode,s=o.getBoundingClientRect();this._orientation==="horizontal"?this._pressData.delta=r.clientX-s.left:this._pressData.delta=r.clientY-s.top,o.classList.add("lm-mod-active"),o.classList.add("p-mod-active"),this._pressData.value=this._value;return}if(i==="track"){var s=this.thumbNode.getBoundingClientRect(),l=void 0;this._orientation==="horizontal"?l=r.clientX<s.left?"decrement":"increment":l=r.clientY<s.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(l);return}if(i==="decrement"){this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("decrement");return}if(i==="increment"){this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("increment");return}}}},e.prototype._evtMouseMove=function(r){if(this._pressData&&(r.preventDefault(),r.stopPropagation(),this._pressData.mouseX=r.clientX,this._pressData.mouseY=r.clientY,this._pressData.part==="thumb")){var i=this.thumbNode.getBoundingClientRect(),n=this.trackNode.getBoundingClientRect(),o,s;this._orientation==="horizontal"?(o=r.clientX-n.left-this._pressData.delta,s=n.width-i.width):(o=r.clientY-n.top-this._pressData.delta,s=n.height-i.height);var l=s===0?0:o*this._maximum/s;this._moveThumb(l)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},e.prototype._moveThumb=function(r){r=Math.max(0,Math.min(r,this._maximum)),this._value!==r&&(this._value=r,this.update(),this._thumbMoved.emit(r))},e}(ui),CC;(function(t){function e(){var i=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div");return n.className="lm-ScrollBar-button",o.className="lm-ScrollBar-button",n.dataset.action="decrement",o.dataset.action="increment",s.className="lm-ScrollBar-track",l.className="lm-ScrollBar-thumb",n.classList.add("p-ScrollBar-button"),o.classList.add("p-ScrollBar-button"),s.classList.add("p-ScrollBar-track"),l.classList.add("p-ScrollBar-thumb"),s.appendChild(l),i.appendChild(n),i.appendChild(s),i.appendChild(o),i}t.createNode=e;function r(i,n){return i.thumbNode.contains(n)?"thumb":i.trackNode.contains(n)?"track":i.decrementNode.contains(n)?"decrement":i.incrementNode.contains(n)?"increment":null}t.findPart=r})(CC||(CC={}));var dmt=function(t){Ua(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._widget=null,r}return e.prototype.dispose=function(){if(this._widget){var r=this._widget;this._widget=null,r.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(r){r&&(r.parent=this.parent),this._widget!==r&&(this._widget&&this._widget.dispose(),this._widget=r,this.parent&&r&&this.attachWidget(r))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?mb(this._widget):zh()},e.prototype.removeWidget=function(r){this._widget===r&&(this._widget=null,this.parent&&this.detachWidget(r))},e.prototype.init=function(){var r=this;t.prototype.init.call(this),hn(this,function(i){r.attachWidget(i)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&Br.sendMessage(r,ui.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.AfterAttach)},e.prototype.detachWidget=function(r){this.parent.isAttached&&Br.sendMessage(r,ui.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&Br.sendMessage(r,ui.Msg.AfterDetach)},e}(rA),ay=function(t){Ua(e,t);function e(r){var i=t.call(this)||this;return i._fixed=0,i._spacing=4,i._dirty=!1,i._hasNormedSizes=!1,i._sizers=[],i._items=[],i._handles=[],i._box=null,i._alignment="start",i._orientation="horizontal",i.renderer=r.renderer,r.orientation!==void 0&&(i._orientation=r.orientation),r.alignment!==void 0&&(i._alignment=r.alignment),r.spacing!==void 0&&(i._spacing=Gf.clampSpacing(r.spacing)),i}return e.prototype.dispose=function(){hn(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._orientation=r,this.parent&&(this.parent.dataset.orientation=r,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(r){this._alignment!==r&&(this._alignment=r,this.parent&&(this.parent.dataset.alignment=r,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Gf.clampSpacing(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return Gf.normalize(this._sizers.map(function(r){return r.size}))},e.prototype.setRelativeSizes=function(r){for(var i=this._sizers.length,n=r.slice(0,i);n.length<i;)n.push(0);for(var o=Gf.normalize(n),s=0;s<i;++s){var l=this._sizers[s];l.sizeHint=o[s],l.size=o[s]}this._hasNormedSizes=!0,this.parent&&this.parent.update()},e.prototype.moveHandle=function(r,i){var n=this._handles[r];if(!(!n||n.classList.contains("lm-mod-hidden"))){var o;if(this._orientation==="horizontal"?o=i-n.offsetLeft:o=i-n.offsetTop,o!==0){for(var s=0,l=this._sizers;s<l.length;s++){var c=l[s];c.size>0&&(c.sizeHint=c.size)}pc.adjust(this._sizers,r,o),this.parent&&this.parent.update()}}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(r,i){var n=new yb(i),o=Gf.createHandle(this.renderer),s=Gf.averageSize(this._sizers),l=Gf.createSizer(s);ti.insert(this._items,r,n),ti.insert(this._sizers,r,l),ti.insert(this._handles,r,o),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.node.appendChild(o),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){ti.move(this._items,r,i),ti.move(this._sizers,r,i),ti.move(this._handles,r,i),this.parent.fit()},e.prototype.detachWidget=function(r,i){var n=ti.removeAt(this._items,r),o=ti.removeAt(this._handles,r);ti.removeAt(this._sizers,r),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.node.removeChild(o),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=-1,n=0,o=this._items.length;n<o;++n)this._items[n].isHidden?(this._handles[n].classList.add("lm-mod-hidden"),this._handles[n].classList.add("p-mod-hidden")):(this._handles[n].classList.remove("lm-mod-hidden"),this._handles[n].classList.remove("p-mod-hidden"),i=n,r++);i!==-1&&(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,r-1);for(var s=this._orientation==="horizontal",l=s?this._fixed:0,c=s?0:this._fixed,n=0,o=this._items.length;n<o;++n){var h=this._items[n],g=this._sizers[n];if(g.size>0&&(g.sizeHint=g.size),h.isHidden){g.minSize=0,g.maxSize=0;continue}h.fit(),g.stretch=e.getStretch(h.widget),s?(g.minSize=h.minWidth,g.maxSize=h.maxWidth,l+=h.minWidth,c=Math.max(c,h.minHeight)):(g.minSize=h.minHeight,g.maxSize=h.maxHeight,c+=h.minHeight,l=Math.max(l,h.minWidth))}var b=this._box=Lo.boxSizing(this.parent.node);l+=b.horizontalSum,c+=b.verticalSum;var T=this.parent.node.style;T.minWidth=l+"px",T.minHeight=c+"px",this._dirty=!0,this.parent.parent&&Br.sendMessage(this.parent.parent,ui.Msg.FitRequest),this._dirty&&Br.sendMessage(this.parent,ui.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=Lo.boxSizing(this.parent.node));var l=this._box.paddingTop,c=this._box.paddingLeft,h=r-this._box.horizontalSum,g=i-this._box.verticalSum,b,T=this._orientation==="horizontal";if(T?b=Math.max(0,h-this._fixed):b=Math.max(0,g-this._fixed),this._hasNormedSizes){for(var C=0,P=this._sizers;C<P.length;C++){var H=P[C];H.sizeHint*=b}this._hasNormedSizes=!1}var U=pc.calc(this._sizers,b),J=0,ee=0;if(U>0)switch(this._alignment){case"start":break;case"center":J=0,ee=U/2;break;case"end":J=0,ee=U;break;case"justify":J=U/n,ee=0;break;default:throw"unreachable"}for(var o=0,s=this._items.length;o<s;++o){var ne=this._items[o];if(!ne.isHidden){var oe=this._sizers[o].size,k=this._handles[o].style;T?(ne.update(c+ee,l,oe+J,g),c+=oe+J,k.top=l+"px",k.left=c+ee+"px",k.width=this._spacing+"px",k.height=g+"px",c+=this._spacing):(ne.update(c,l+ee,h,oe+J),l+=oe+J,k.top=l+ee+"px",k.left=c+"px",k.width=h+"px",k.height=this._spacing+"px",l+=this._spacing)}}}},e}(MC);(function(t){function e(i){return Gf.stretchProperty.get(i)}t.getStretch=e;function r(i,n){Gf.stretchProperty.set(i,n)}t.setStretch=r})(ay||(ay={}));var Gf;(function(t){t.stretchProperty=new fc({name:"stretch",create:function(){return 0},coerce:function(l,c){return Math.max(0,Math.floor(c))},changed:s});function e(l){var c=new tA;return c.sizeHint=Math.floor(l),c}t.createSizer=e;function r(l){var c=l.createHandle();return c.style.position="absolute",c}t.createHandle=r;function i(l){return Math.max(0,Math.floor(l))}t.clampSpacing=i;function n(l){return l.reduce(function(c,h){return c+h.size},0)/l.length||0}t.averageSize=n;function o(l){var c=l.length;if(c===0)return[];var h=l.reduce(function(g,b){return g+Math.abs(b)},0);return h===0?l.map(function(g){return 1/c}):l.map(function(g){return g/h})}t.normalize=o;function s(l){l.parent&&l.parent.layout instanceof ay&&l.parent.fit()}})(Gf||(Gf={}));var zD=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:VD.createLayout(r)})||this;return i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(r){this.layout.orientation=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(r){this.layout.alignment=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(r){this.layout.setRelativeSizes(r)},e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(r){r.child.addClass("lm-SplitPanel-child"),r.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-SplitPanel-child"),r.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&this._releaseMouse()},e.prototype._evtMouseDown=function(r){if(r.button===0){var i=this.layout,n=ti.findFirstIndex(i.handles,function(g){return g.contains(r.target)});if(n!==-1){r.preventDefault(),r.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var o,s=i.handles[n],l=s.getBoundingClientRect();i.orientation==="horizontal"?o=r.clientX-l.left:o=r.clientY-l.top;var c=window.getComputedStyle(s),h=$p.overrideCursor(c.cursor);this._pressData={index:n,delta:o,override:h}}}},e.prototype._evtMouseMove=function(r){r.preventDefault(),r.stopPropagation();var i,n=this.layout,o=this.node.getBoundingClientRect();n.orientation==="horizontal"?i=r.clientX-o.left-this._pressData.delta:i=r.clientY-o.top-this._pressData.delta,n.moveHandle(this._pressData.index,i)},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0))},e}(vb);(function(t){var e=function(){function n(){}return n.prototype.createHandle=function(){var o=document.createElement("div");return o.className="lm-SplitPanel-handle",o.classList.add("p-SplitPanel-handle"),o},n}();t.Renderer=e,t.defaultRenderer=new e;function r(n){return ay.getStretch(n)}t.getStretch=r;function i(n,o){ay.setStretch(n,o)}t.setStretch=i})(zD||(zD={}));var VD;(function(t){function e(r){return r.layout||new ay({renderer:r.renderer||zD.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing})}t.createLayout=e})(VD||(VD={}));var wTe=function(t){Ua(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._dirty=!1,r._items=[],r._box=null,r}return e.prototype.dispose=function(){hn(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(r,i){ti.insert(this._items,r,new yb(i)),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){ti.move(this._items,r,i),this.parent.update()},e.prototype.detachWidget=function(r,i){var n=ti.removeAt(this._items,r);this.parent.isAttached&&Br.sendMessage(i,ui.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&Br.sendMessage(i,ui.Msg.AfterDetach),n.widget.node.style.zIndex="",n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=0,n=0,o=this._items.length;n<o;++n){var s=this._items[n];s.isHidden||(s.fit(),r=Math.max(r,s.minWidth),i=Math.max(i,s.minHeight))}var l=this._box=Lo.boxSizing(this.parent.node);r+=l.horizontalSum,i+=l.verticalSum;var c=this.parent.node.style;c.minWidth=r+"px",c.minHeight=i+"px",this._dirty=!0,this.parent.parent&&Br.sendMessage(this.parent.parent,ui.Msg.FitRequest),this._dirty&&Br.sendMessage(this.parent,ui.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=Lo.boxSizing(this.parent.node));for(var l=this._box.paddingTop,c=this._box.paddingLeft,h=r-this._box.horizontalSum,g=i-this._box.verticalSum,o=0,s=this._items.length;o<s;++o){var b=this._items[o];b.isHidden||(b.widget.node.style.zIndex=""+o,b.update(c,l,h,g))}}},e}(MC),TTe=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:HD.createLayout(r)})||this;return i._widgetRemoved=new Mo(i),i.addClass("lm-StackedPanel"),i.addClass("p-StackedPanel"),i}return Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(r){r.child.addClass("lm-StackedPanel-child"),r.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-StackedPanel-child"),r.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(r.child)},e}(vb),HD;(function(t){function e(r){return r.layout||new wTe}t.createLayout=e})(HD||(HD={}));var pmt=function(t){Ua(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;i._currentChanged=new Mo(i),i.addClass("lm-TabPanel"),i.addClass("p-TabPanel"),i.tabBar=new EC(r),i.tabBar.addClass("lm-TabPanel-tabBar"),i.stackedPanel=new TTe,i.stackedPanel.addClass("lm-TabPanel-stackedPanel"),i.tabBar.addClass("p-TabPanel-tabBar"),i.stackedPanel.addClass("p-TabPanel-stackedPanel"),i.tabBar.tabMoved.connect(i._onTabMoved,i),i.tabBar.currentChanged.connect(i._onCurrentChanged,i),i.tabBar.tabCloseRequested.connect(i._onTabCloseRequested,i),i.tabBar.tabActivateRequested.connect(i._onTabActivateRequested,i),i.stackedPanel.widgetRemoved.connect(i._onWidgetRemoved,i),i._tabPlacement=r.tabPlacement||"top";var n=sy.directionFromPlacement(i._tabPlacement),o=sy.orientationFromPlacement(i._tabPlacement);i.tabBar.orientation=o,i.tabBar.dataset.placement=i._tabPlacement;var s=new Wf({direction:n,spacing:0});return Wf.setStretch(i.tabBar,0),Wf.setStretch(i.stackedPanel,1),s.addWidget(i.tabBar),s.addWidget(i.stackedPanel),i.layout=s,i}return Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(r){this.tabBar.currentIndex=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var r=this.tabBar.currentTitle;return r?r.owner:null},set:function(r){this.tabBar.currentTitle=r?r.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(r){this.tabBar.tabsMovable=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(r){if(this._tabPlacement!==r){this._tabPlacement=r;var i=sy.directionFromPlacement(r),n=sy.orientationFromPlacement(r);this.tabBar.orientation=n,this.tabBar.dataset.placement=r,this.layout.direction=i}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){this.insertWidget(this.widgets.length,r)},e.prototype.insertWidget=function(r,i){i!==this.currentWidget&&i.hide(),this.stackedPanel.insertWidget(r,i),this.tabBar.insertTab(r,i.title)},e.prototype._onCurrentChanged=function(r,i){var n=i.previousIndex,o=i.previousTitle,s=i.currentIndex,l=i.currentTitle,c=o?o.owner:null,h=l?l.owner:null;c&&c.hide(),h&&h.show(),this._currentChanged.emit({previousIndex:n,previousWidget:c,currentIndex:s,currentWidget:h}),(nu.IS_EDGE||nu.IS_IE)&&Br.flush()},e.prototype._onTabActivateRequested=function(r,i){i.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,i){i.title.owner.close()},e.prototype._onTabMoved=function(r,i){this.stackedPanel.insertWidget(i.toIndex,i.title.owner)},e.prototype._onWidgetRemoved=function(r,i){this.tabBar.removeTab(i.title)},e}(ui),sy;(function(t){function e(o){return i[o]}t.orientationFromPlacement=e;function r(o){return n[o]}t.directionFromPlacement=r;var i={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},n={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(sy||(sy={}));var ly=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),iA=function(){return iA=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},iA.apply(this,arguments)};function xb(t,e){if(Array.isArray(t)){var r=[];return t.forEach(function(n,o){r.push(xb(n,e))}),Promise.all(r)}else if(t instanceof Object){var i={};return Object.keys(t).forEach(function(n){i[n]=xb(t[n],e)}),$_(i)}else return typeof t=="string"&&t.slice(0,10)==="IPY_MODEL_"?e.get_model(t.slice(10,t.length)):Promise.resolve(t)}var cg=function(t){ly(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return{_model_module:"@jupyter-widgets/base",_model_name:"WidgetModel",_model_module_version:AC,_view_module:"@jupyter-widgets/base",_view_name:null,_view_module_version:AC,_view_count:null}},e.prototype.isNew=function(){return!1},e.prototype.initialize=function(r,i){this._expectedEchoMsgIds={},this._attrsToUpdate={},t.prototype.initialize.call(this,r,i),this.widget_manager=i.widget_manager,this.model_id=i.model_id;var n=i.comm;this.views=Object.create(null),this.state_change=Promise.resolve(),this._closed=!1,this._state_lock=null,this._msg_buffer=null,this._msg_buffer_callbacks=null,this._pending_msgs=0,this._buffered_state_diff={},n?(this.comm=n,n.on_close(this._handle_comm_closed.bind(this)),n.on_msg(this._handle_comm_msg.bind(this)),this.comm_live=!0):this.comm_live=!1},Object.defineProperty(e.prototype,"comm_live",{get:function(){return this._comm_live},set:function(r){this._comm_live=r,this.trigger("comm_live_update")},enumerable:!0,configurable:!0}),e.prototype.send=function(r,i,n){if(this.comm!==void 0){var o={method:"custom",content:r};this.comm.send(o,i,{},n)}},e.prototype.close=function(r){var i=this;if(r===void 0&&(r=!1),!this._closed){this._closed=!0,this.comm&&!r&&this.comm.close(),this.stopListening(),this.trigger("destroy",this),this.comm&&delete this.comm;var n=Object.keys(this.views).map(function(o){return i.views[o].then(function(s){return s.remove()})});return delete this.views,Promise.all(n).then(function(){})}},e.prototype._handle_comm_closed=function(r){this.trigger("comm:close"),this.close(!0)},e.prototype._handle_comm_msg=function(r){var i=this,n=r.content.data,o=n.method;switch(o){case"update":case"echo_update":return this.state_change=this.state_change.then(function(){var s,l,c,h=n.state,g=(s=n.buffer_paths,s??[]),b=(c=(l=r.buffers)===null||l===void 0?void 0:l.slice(0,g.length),c??[]).map(function(P){return P instanceof DataView?P:new DataView(P instanceof ArrayBuffer?P:P.buffer)});if(Yp(h,g,b),r.parent_header&&o==="echo_update"){var T=r.parent_header.msg_id,C=Object.keys(h).filter(function(P){return i._expectedEchoMsgIds.hasOwnProperty(P)});C.forEach(function(P){var H=i._expectedEchoMsgIds[P]!==T;H?delete h[P]:(delete i._expectedEchoMsgIds[P],i._msg_buffer!==null&&Object.prototype.hasOwnProperty.call(i._msg_buffer,P)&&delete h[P])})}return i.constructor._deserialize_state(h,i.widget_manager)}).then(function(s){i.set_state(s)}).catch(Uh("Could not process update msg for model id: "+this.model_id,!0)),this.state_change;case"custom":return this.trigger("msg:custom",n.content,r.buffers),Promise.resolve()}},e.prototype.set_state=function(r){this._state_lock=r;try{this.set(r)}catch(i){console.error("Error setting state: "+i.message)}finally{this._state_lock=null}},e.prototype.get_state=function(r){var i=this.attributes;if(r){var n=this.defaults,o=typeof n=="function"?n.call(this):n,s={};return Object.keys(i).forEach(function(l){Q_(i[l],o[l])||(s[l]=i[l])}),s}else return iA({},i)},e.prototype._handle_status=function(r){if(this.comm!==void 0&&r.content.execution_state==="idle"&&(this._pending_msgs--,this._pending_msgs<0&&(console.error("Jupyter Widgets message throttle: Pending messages < 0 (="+this._pending_msgs+"), which is unexpected. Resetting to 0 to continue."),this._pending_msgs=0),this._msg_buffer!==null&&this._pending_msgs<1)){var i=this.send_sync_message(this._msg_buffer,this._msg_buffer_callbacks);this.rememberLastUpdateFor(i),this._msg_buffer=null,this._msg_buffer_callbacks=null}},e.prototype.callbacks=function(r){return this.widget_manager.callbacks(r)},e.prototype.set=function(r,i,n){var o=nK.call(this,r,i,n);if(this._buffered_state_diff!==void 0){var s=this.changedAttributes()||{};if(this._state_lock)for(var l=0,c=Object.keys(this._state_lock);l<c.length;l++){var h=c[l];s[h]===this._state_lock[h]&&delete s[h]}this._buffered_state_diff=Yd(this._buffered_state_diff,s)}return o},e.prototype.sync=function(r,i,n){var o=this;if(n===void 0&&(n={}),this.comm===void 0)throw"Syncing error: no comm channel defined";var s=r==="patch"?n.attrs:i.get_state(n.drop_defaults);if(this._state_lock)for(var l=0,c=Object.keys(this._state_lock);l<c.length;l++){var h=c[l];s[h]===this._state_lock[h]&&delete s[h]}Object.keys(s).forEach(function(C){o._attrsToUpdate[C]=!0});var g=this.serialize(s);if(Object.keys(g).length>0){var b=n.callbacks||this.callbacks();if(this._pending_msgs>=1){switch(r){case"patch":this._msg_buffer=Yd(this._msg_buffer||{},g);break;case"update":case"create":this._msg_buffer=g;break;default:throw"unrecognized syncing method"}this._msg_buffer_callbacks=b}else{var T=this.send_sync_message(s,b);this.rememberLastUpdateFor(T)}}},e.prototype.rememberLastUpdateFor=function(r){var i=this;Object.keys(this._attrsToUpdate).forEach(function(n){i._expectedEchoMsgIds[n]=r}),this._attrsToUpdate={}},e.prototype.serialize=function(r){for(var i=this.constructor.serializers||{},n=0,o=Object.keys(r);n<o.length;n++){var s=o[n];try{i[s]&&i[s].serialize?r[s]=i[s].serialize(r[s],this):r[s]=JSON.parse(JSON.stringify(r[s])),r[s]&&r[s].toJSON&&(r[s]=r[s].toJSON())}catch(l){throw console.error("Error serializing widget state attribute: ",s),l}}return r},e.prototype.send_sync_message=function(r,i){var n=this;if(i===void 0&&(i={}),!this.comm)return"";try{i={shell:iA({},i.shell),iopub:iA({},i.iopub),input:i.input};var o=i.iopub.status;i.iopub.status=function(c){n._handle_status(c),o&&o(c)};var s=db(r),l=this.comm.send({method:"update",state:s.state,buffer_paths:s.buffer_paths},i,{},s.buffers);return this._pending_msgs++,l}catch(c){console.error("Could not send widget sync message",c)}return""},e.prototype.save_changes=function(r){if(this.comm_live){var i={patch:!0};r&&(i.callbacks=r),this.save(this._buffered_state_diff,i),this._buffered_state_diff={}}},e.prototype.on_some_change=function(r,i,n){var o=this;this.on("change",function(){r.some(o.hasChanged,o)&&i.apply(n,arguments)},this)},e.prototype.toJSON=function(r){return"IPY_MODEL_"+this.model_id},e._deserialize_state=function(r,i){var n=this.serializers,o;if(n){o={};for(var s in r)n[s]&&n[s].deserialize?o[s]=n[s].deserialize(r[s],i):o[s]=r[s]}else o=r;return $_(o)},e}(DK.Model);var GD=function(t){ly(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return Yd(t.prototype.defaults.call(this),{_dom_classes:[]})},e.serializers=iA(iA({},cg.serializers),{layout:{deserialize:xb},style:{deserialize:xb}}),e}(cg);var uy=function(t){ly(e,t);function e(r){return t.call(this,r)||this}return e.prototype.initialize=function(r){var i=this;this.listenTo(this.model,"change",function(){var n=Object.keys(i.model.changedAttributes()||{});n[0]==="_view_count"&&n.length===1||i.update()}),this.options=r.options,this.once("remove",function(){typeof i.model.get("_view_count")=="number"&&(i.model.set("_view_count",i.model.get("_view_count")-1),i.model.save_changes())}),this.once("displayed",function(){typeof i.model.get("_view_count")=="number"&&(i.model.set("_view_count",i.model.get("_view_count")+1),i.model.save_changes())}),this.displayed=new Promise(function(n,o){i.once("displayed",n)})},e.prototype.update=function(r){},e.prototype.render=function(){},e.prototype.create_child_view=function(r,i){return i===void 0&&(i={}),i=iA({parent:this},i),this.model.widget_manager.create_view(r,i).catch(Uh("Could not create child view",!0))},e.prototype.callbacks=function(){return this.model.callbacks(this)},e.prototype.send=function(r,i){this.model.send(r,this.callbacks(),i)},e.prototype.touch=function(){this.model.save_changes(this.callbacks())},e.prototype.remove=function(){return t.prototype.remove.call(this),this.trigger("remove"),this},e}(lK);var LK=function(t){ly(e,t);function e(r){var i=this,n=r.view;return delete r.view,i=t.call(this,r)||this,i._view=n,i}return e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e.prototype.processMessage=function(r){t.prototype.processMessage.call(this,r),this._view.processPhosphorMessage(r)},e}(ui);var ETe=function(t){ly(e,t);function e(r){var i=this,n=r.view;return delete r.view,i=t.call(this,r)||this,i._view=n,i}return e.prototype.processMessage=function(r){t.prototype.processMessage.call(this,r),this._view.processPhosphorMessage(r)},e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e}(vb);var WD=function(t){ly(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){var i=this;t.prototype.initialize.call(this,r),this.listenTo(this.model,"change:_dom_classes",function(n,o){var s=n.previous("_dom_classes");i.update_classes(s,o)}),this.layoutPromise=Promise.resolve(),this.listenTo(this.model,"change:layout",function(n,o){i.setLayout(o,n.previous("layout"))}),this.stylePromise=Promise.resolve(),this.listenTo(this.model,"change:style",function(n,o){i.setStyle(o,n.previous("style"))}),this.displayed.then(function(){i.update_classes([],i.model.get("_dom_classes")),i.setLayout(i.model.get("layout")),i.setStyle(i.model.get("style"))}),this._comm_live_update(),this.listenTo(this.model,"comm_live_update",function(){i._comm_live_update()})},e.prototype.setLayout=function(r,i){var n=this;r&&(this.layoutPromise=this.layoutPromise.then(function(o){return o&&(o.unlayout(),n.stopListening(o.model),o.remove()),n.create_child_view(r).then(function(s){return n.displayed.then(function(){return s.trigger("displayed"),n.listenTo(s.model,"change",function(){Br.postMessage(n.pWidget,ui.ResizeMessage.UnknownSize)}),Br.postMessage(n.pWidget,ui.ResizeMessage.UnknownSize),s})}).catch(Uh("Could not add LayoutView to DOMWidgetView",!0))}))},e.prototype.setStyle=function(r,i){var n=this;r&&(this.stylePromise=this.stylePromise.then(function(o){return o&&(o.unstyle(),n.stopListening(o.model),o.remove()),n.create_child_view(r).then(function(s){return n.displayed.then(function(){return s.trigger("displayed"),s})}).catch(Uh("Could not add styleView to DOMWidgetView",!0))}))},e.prototype.update_classes=function(r,i,n){n===void 0&&(n=this.el),pC(r,i).map(function(o){n.classList?n.classList.remove(o):n.setAttribute("class",n.getAttribute("class").replace(o,""))}),pC(i,r).map(function(o){n.classList?n.classList.add(o):n.setAttribute("class",n.getAttribute("class").concat(" ",o))})},e.prototype.update_mapped_classes=function(r,i,n){var o=this.model.previous(i),s=r[o]?r[o]:[];o=this.model.get(i);var l=r[o]?r[o]:[];this.update_classes(s,l,n||this.el)},e.prototype.set_mapped_classes=function(r,i,n){var o=this.model.get(i),s=r[o]?r[o]:[];this.update_classes([],s,n||this.el)},e.prototype._setElement=function(r){this.pWidget&&this.pWidget.dispose(),this.$el=r instanceof jD.default?r:(0,jD.default)(r),this.el=this.$el[0],this.pWidget=new LK({node:r,view:this})},e.prototype.remove=function(){return this.pWidget&&this.pWidget.dispose(),t.prototype.remove.call(this)},e.prototype.processPhosphorMessage=function(r){switch(r.type){case"after-attach":this.trigger("displayed");break}},e.prototype._comm_live_update=function(){this.model.comm_live?this.pWidget.removeClass("jupyter-widgets-disconnected"):this.pWidget.addClass("jupyter-widgets-disconnected")},e}(uy);var FK=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),NK={align_content:null,align_items:null,align_self:null,border:null,bottom:null,display:null,flex:null,flex_flow:null,height:null,justify_content:null,justify_items:null,left:null,margin:null,max_height:null,max_width:null,min_height:null,min_width:null,overflow:null,overflow_x:null,overflow_y:null,order:null,padding:null,right:null,top:null,visibility:null,width:null,object_fit:null,object_position:null,grid_auto_columns:null,grid_auto_flow:null,grid_auto_rows:null,grid_gap:null,grid_template_rows:null,grid_template_columns:null,grid_template_areas:null,grid_row:null,grid_column:null,grid_area:null},STe=function(t){FK(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return Yd(t.prototype.defaults.call(this),{_model_name:"LayoutModel",_view_name:"LayoutView"},NK)},e}(cg);var CTe=function(t){FK(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){this._traitNames=[],t.prototype.initialize.call(this,r);for(var i=0,n=Object.keys(NK);i<n.length;i++){var o=n[i];this.registerTrait(o)}},e.prototype.registerTrait=function(r){var i=this;if(this._traitNames.push(r),r==="overflow_x"||r==="overflow_y"){this.listenTo(this.model,"change:"+r,function(n,o){i.handleOverflowChange(r,o)}),this.handleOverflowChange(r,this.model.get(r));return}this.listenTo(this.model,"change:"+r,function(n,o){i.handleChange(r,o)}),this.handleChange(r,this.model.get(r))},e.prototype.css_name=function(r){return r.replace(/_/g,"-")},e.prototype.handleChange=function(r,i){var n=this.options.parent;n?i===null?n.el.style.removeProperty(this.css_name(r)):n.el.style[this.css_name(r)]=i:console.warn("Style not applied because a parent view does not exist")},e.prototype.handleOverflowChange=function(r,i){var n=this.options.parent;n?i===null?this.model.get("overflow")===null&&n.el.style.removeProperty(this.css_name(r)):n.el.style[this.css_name(r)]=i:console.warn("Style not applied because a parent view does not exist")},e.prototype.unlayout=function(){var r=this,i=this.options.parent;this._traitNames.forEach(function(n){i?i.el.style.removeProperty(r.css_name(n)):console.warn("Style not removed because a parent view does not exist")},this)},e}(uy);var kK=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),MTe=function(t){kK(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){var r=this.constructor;return Yd(t.prototype.defaults.call(this),{_model_name:"StyleModel",_view_name:"StyleView"},Object.keys(r.styleProperties).reduce(function(i,n){return i[n]=r.styleProperties[n].default,i},{}))},e.styleProperties={},e}(cg);var ITe=function(t){kK(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){this._traitNames=[],t.prototype.initialize.call(this,r);for(var i=this.model.constructor,n=0,o=Object.keys(i.styleProperties);n<o.length;n++){var s=o[n];this.registerTrait(s)}this.style()},e.prototype.registerTrait=function(r){var i=this;this._traitNames.push(r),this.listenTo(this.model,"change:"+r,function(n,o){i.handleChange(r,o)})},e.prototype.handleChange=function(r,i){var n=this.options.parent;if(n){var o=this.model.constructor,s=o.styleProperties,l=s[r].attribute,c=s[r].selector,h=c?n.el.querySelectorAll(c):[n.el];if(i===null)for(var g=0;g!==h.length;++g)h[g].style.removeProperty(l);else for(var g=0;g!==h.length;++g)h[g].style[l]=i}else console.warn("Style not applied because a parent view does not exist")},e.prototype.style=function(){for(var r=0,i=this._traitNames;r<i.length;r++){var n=i[r];this.handleChange(n,this.model.get(n))}},e.prototype.unstyle=function(){var r=this.options.parent,i=this.model.constructor,n=i.styleProperties;this._traitNames.forEach(function(o){if(r)for(var s=n[o].attribute,l=n[o].selector,c=l?r.el.querySelectorAll(l):[r.el],h=0;h!==c.length;++h)c[h].style.removeProperty(s);else console.warn("Style not removed because a parent view does not exist")},this)},e}(uy);var PTe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(g){try{h(i.next(g))}catch(b){s(b)}}function c(g){try{h(i.throw(g))}catch(b){s(b)}}function h(g){g.done?o(g.value):n(g.value).then(l,c)}h((i=i.apply(t,e||[])).next())})},RTe=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(h){return function(g){return c([h,g])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,n=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(g){h=[6,g],n=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},qD;(function(t){var e;(function(r){var i=function(){function o(s){this.targets=Object.create(null),this.comms=Object.create(null),this.kernel=null,this.jsServicesKernel=null,this.init_kernel(s)}return o.prototype.init_kernel=function(s){this.kernel=s,this.jsServicesKernel=s},o.prototype.new_comm=function(s,l,c,h,g,b){return PTe(this,void 0,void 0,function(){var T,C;return RTe(this,function(P){return T=this.jsServicesKernel.createComm(s,g),C=new n(T),this.register_comm(C),C.open(l,c,h,b),[2,C]})})},o.prototype.register_target=function(s,l){var c=this,h=this.jsServicesKernel.registerCommTarget(s,function(g,b){var T=new n(g);c.register_comm(T);try{return l(T,b)}catch(C){T.close(),console.error(C),console.error(new Error("Exception opening new comm"))}});this.targets[s]=h},o.prototype.unregister_target=function(s,l){var c=this.targets[s];c.dispose(),delete this.targets[s]},o.prototype.register_comm=function(s){return this.comms[s.comm_id]=Promise.resolve(s),s.kernel=this.kernel,s.comm_id},o}();r.CommManager=i;var n=function(){function o(s){this.jsServicesComm=null,this.kernel=null,this.jsServicesComm=s}return Object.defineProperty(o.prototype,"comm_id",{get:function(){return this.jsServicesComm.commId},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"target_name",{get:function(){return this.jsServicesComm.targetName},enumerable:!0,configurable:!0}),o.prototype.open=function(s,l,c,h){var g=this.jsServicesComm.open(s,c,h);return this._hookupCallbacks(g,l),g.msg.header.msg_id},o.prototype.send=function(s,l,c,h){var g=this.jsServicesComm.send(s,c,h);return this._hookupCallbacks(g,l),g.msg.header.msg_id},o.prototype.close=function(s,l,c,h){var g=this.jsServicesComm.close(s,c,h);return this._hookupCallbacks(g,l),g.msg.header.msg_id},o.prototype.on_msg=function(s){this.jsServicesComm.onMsg=s.bind(this)},o.prototype.on_close=function(s){this.jsServicesComm.onClose=s.bind(this)},o.prototype._hookupCallbacks=function(s,l){l&&(s.onReply=function(c){l.shell&&l.shell.reply&&l.shell.reply(c)},s.onStdin=function(c){l.input&&l.input(c)},s.onIOPub=function(c){if(l.iopub){if(l.iopub.status&&c.header.msg_type==="status")l.iopub.status(c);else if(l.iopub.clear_output&&c.header.msg_type==="clear_output")l.iopub.clear_output(c);else if(l.iopub.output)switch(c.header.msg_type){case"display_data":case"execute_result":case"stream":case"error":l.iopub.output(c);break;default:break}}})},o}();r.Comm=n})(e=t.services||(t.services={}))})(qD||(qD={}));var BTe=function(){function t(e,r,i){this.initialize(e,r,i)}return t.prototype.initialize=function(e,r,i){this._handler_context=i||this,this._models=[],this.views=[],this._create_view=e,this._remove_view=r||function(n){n.remove()}},t.prototype.update=function(e,r,i,n){var o=i||this._remove_view,s=r||this._create_view;n=n||this._handler_context;for(var l=0;l<e.length&&!(l>=this._models.length||e[l]!==this._models[l]);l++);for(var c=l,h=this.views.splice(c,this.views.length-c),g=0;g<h.length;g++)h[g].then(function(b){o.call(n,b)});for(;l<e.length;l++)this.views.push(Promise.resolve(s.call(n,e[l],l)));return this._models=e.slice(),Promise.all(this.views)},t.prototype.remove=function(){var e=this;return Promise.all(this.views).then(function(r){r.forEach(function(i){return e._remove_view.call(e._handler_context,i)}),e.views=[],e._models=[]})},t.prototype.dispose=function(){this.views=null,this._models=null},t}();var OTe=new yW("jupyter.extensions.jupyterWidgetRegistry");function DTe(t){switch(t){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"float32":return Float32Array;case"float64":return Float64Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`Unrecognized dtype ${t}`)}}function UK(t,e){if(!t)return null;for(let r in t){let i=t[r].attributes;for(let n in i){let{dtype:o,value:s}=i[n],l=DTe(o);i[n].value=new l(s.buffer)}}return t}var nA=null,XD=bb&&GD;if(XD){class t extends XD{defaults(){return{...super.defaults(),_model_name:nA.model_name,_model_module:nA.model_module,_model_module_version:nA.model_module_version,_view_name:nA.view_name,_view_module:nA.view_module,_view_module_version:nA.view_module_version,custom_libraries:[],json_input:null,mapbox_key:null,selected_data:[],data_buffer:null,tooltip:null,width:"100%",height:500,js_warning:!1}}static get serializers(){return{...XD.serializers,data_buffer:{deserialize:UK}}}static get model_name(){return"JupyterTransportModel"}static get model_module(){return Fy}static get model_module_version(){return Ly}static get view_name(){return"JupyterTransportView"}static get view_module(){return Fy}static get view_module_version(){return Ly}}nA=t}var zK=nA;var HK=null,VK=bb&&WD;if(VK){class t extends VK{initialize(){this.listenTo(this.model,"destroy",this.remove),this.transport=new eg,this.transport.jupyterModel=this.model,this.transport.jupyterView=this,this.transport._initialize(),super.initialize.apply(this,arguments)}remove(){this.transport&&(this.transport._finalize(),this.transport.jupyterModel=null,this.transport.jupyterView=null,this.transport=null)}render(){super.render(),this.model.on("change:json_input",this.onJsonChanged.bind(this)),this.model.on("change:data_buffer",this.onDataBufferChanged.bind(this)),this.onDataBufferChanged()}onJsonChanged(){let r=JSON.parse(this.model.get("json_input"));this.transport._messageReceived({type:"json",json:r})}onDataBufferChanged(){let r=this.model.get("json_input"),i=this.model.get("data_buffer");r&&i?this.transport._messageReceived({type:"json-with-binary",json:r,binary:i}):this.transport._messageReceived({type:"json",json:r})}}HK=t}var jK=HK;var YD={};Js(YD,{Accessor:()=>_h,AnimationLoop:()=>vp,AnimationLoopTemplate:()=>z2,Buffer:()=>rn,BufferTransform:()=>xp,CanvasContext:()=>ud,ClipSpace:()=>B0,CommandBuffer:()=>pd,CommandEncoder:()=>dd,ComputePass:()=>rv,ComputePipeline:()=>MA,ConeGeometry:()=>V2,CubeGeometry:()=>wp,CylinderGeometry:()=>H2,Device:()=>Du,ExternalTexture:()=>CA,Framebuffer:()=>vf,GPUGeometry:()=>P0,Geometry:()=>Tn,GroupNode:()=>Kc,IcoSphereGeometry:()=>j2,KeyFrames:()=>U2,Model:()=>Xi,ModelNode:()=>wh,PipelineFactory:()=>Xc,PlaneGeometry:()=>G2,RenderPass:()=>hd,RenderPipeline:()=>rc,Resource:()=>tn,Sampler:()=>fd,ScenegraphNode:()=>Yc,Shader:()=>cd,SphereGeometry:()=>W2,StatsManager:()=>ev,Texture:()=>Bs,TextureTransform:()=>wd,Timeline:()=>yp,TransformFeedback:()=>md,TruncatedConeGeometry:()=>bp,UniformBlock:()=>$g,UniformBufferLayout:()=>Qg,UniformStore:()=>e0,VERSION:()=>mw,VertexArray:()=>Ad,WEBGLBuffer:()=>Jl,WEBGLCommandEncoder:()=>d0,WEBGLFramebuffer:()=>Nc,WEBGLRenderPass:()=>f0,WEBGLRenderPipeline:()=>h0,WEBGLRenderbuffer:()=>Fc,WEBGLResource:()=>DA,WEBGLSampler:()=>_d,WEBGLShader:()=>c0,WEBGLTexture:()=>Da,WEBGLTransformFeedback:()=>p0,WEBGLVertexArray:()=>up,WebGLCanvasContext:()=>u0,WebGLDevice:()=>Qo,WebGLResource:()=>DA,_ShaderInputs:()=>I0,_TEXTURE_FORMATS:()=>BA,_checkFloat32ColorAttachment:()=>zw,assert:()=>_i,assertWebGL2Context:()=>i4,assertWebGLContext:()=>Lw,cancelAnimationFrame:()=>Ow,cast:()=>BM,checkProps:()=>Iw,convertGLToTextureFormat:()=>OA,decodeShaderAttributeType:()=>yw,decodeShaderUniformType:()=>bw,decodeTextureFormat:()=>sv,decodeVertexFormat:()=>iv,deepEqual:()=>i0,fillArray:()=>Ew,formatCompilerLog:()=>_w,formatValue:()=>DM,getAttributeInfosFromLayouts:()=>nv,getDataTypeFromTypedArray:()=>RM,getGLParameters:()=>o0,getScratchArray:()=>Tw,getScratchArrayBuffer:()=>ov,getShaderLayout:()=>Xw,getTypedArrayFromDataType:()=>Sw,getVertexFormatFromAttribute:()=>Cw,getWebGL2Context:()=>uv,glsl:()=>FM,isNumberArray:()=>Dc,isObjectEmpty:()=>EA,isPowerOfTwo:()=>tv,isTypedArray:()=>MM,isUniformValue:()=>OM,isWebGL:()=>NM,isWebGL2:()=>zn,loadFile:()=>ZN,loadImage:()=>Rw,loadImageBitmap:()=>JN,loadScript:()=>r0,log:()=>gr,luma:()=>Kl,makeAnimationLoop:()=>PU,makeRandomNumberGenerator:()=>LM,mergeShaderLayout:()=>xw,polyfillContext:()=>Nw,popContextState:()=>Lc,pushContextState:()=>xf,random:()=>QN,registerHeadlessGL:()=>$N,requestAnimationFrame:()=>Bw,resetGLParameters:()=>p4,setDeviceParameters:()=>jw,setGLParameters:()=>Lu,setPathPrefix:()=>KN,splitUniformsAndBindings:()=>t0,stubRemovedMethods:()=>Mw,trackContextState:()=>hv,uid:()=>uo,withDeviceParameters:()=>O4,withGLParameters:()=>Fu});var KD={};Js(KD,{fetchFile:()=>qg,load:()=>Oa,parse:()=>lp,registerLoaders:()=>TA});var GK=document.body&&document.body.getAttribute("data-base-url");GK&&(window.__webpack_public_path__=`${GK}nbextensions/pydeck/nb_extension`);nC();globalThis.deck=globalThis.deck||{};Object.assign(globalThis.deck,ib);globalThis.luma=globalThis.luma||{};Object.assign(globalThis.luma,YD);globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.loaders,KD);return rJ(LTe);})();
|
|
4655
4655
|
return __exports__;
|