"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[829],{8460:function(e,t,r){let n,o,i,l,a;r.d(t,{EK:function(){return e5},N9:function(){return function e(t,...r){let n=t.uniformSetters||t,o=r.length;for(let i=0;i<o;++i){let l=r[i];if(Array.isArray(l)){let a=l.length;for(let u=0;u<a;++u)e(n,l[u])}else for(let s in l){let f=n[s];f&&f(l[s])}}}},cU:function(){return eT},m4:function(){return x},o8:function(){return e2},qX:function(){return N},y0:function(){return e7}});/* @license twgl.js 5.5.4 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/twgl.js for details */ let u=Float32Array;function s(e,t,r){let n=new u(3);return e&&(n[0]=e),t&&(n[1]=t),r&&(n[2]=r),n}function f(e,t,r){r=r||new u(3);let n=e[2]*t[0]-e[0]*t[2],o=e[0]*t[1]-e[1]*t[0];return r[0]=e[1]*t[2]-e[2]*t[1],r[1]=n,r[2]=o,r}function c(e,t){t=t||new u(3);let r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=Math.sqrt(r);return n>1e-5?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=0,t[1]=0,t[2]=0),t}let m=Float32Array;function y(e,t){return(t=t||new m(16))[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function b(e){return(e=e||new m(16))[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function p(e,t){t=t||new m(16);let r=e[0],n=e[1],o=e[2],i=e[3],l=e[4],a=e[5],u=e[6],s=e[7],f=e[8],c=e[9],y=e[10],b=e[11],p=e[12],d=e[13],h=e[14],x=e[15],g=y*x,v=h*b,A=u*x,F=h*s,w=u*b,E=y*s,P=o*x,T=h*i,S=o*b,R=y*i,M=o*s,z=u*i,I=f*d,C=p*c,U=l*d,k=p*a,O=l*c,D=f*a,B=r*d,L=p*n,_=r*c,j=f*n,$=r*a,N=l*n,V=g*a+F*c+w*d-(v*a+A*c+E*d),W=v*n+P*c+R*d-(g*n+T*c+S*d),Y=A*n+T*a+M*d-(F*n+P*a+z*d),G=E*n+S*a+z*c-(w*n+R*a+M*c),H=1/(r*V+l*W+f*Y+p*G);return t[0]=H*V,t[1]=H*W,t[2]=H*Y,t[3]=H*G,t[4]=H*(v*l+A*f+E*p-(g*l+F*f+w*p)),t[5]=H*(g*r+T*f+S*p-(v*r+P*f+R*p)),t[6]=H*(F*r+P*l+z*p-(A*r+T*l+M*p)),t[7]=H*(w*r+R*l+M*f-(E*r+S*l+z*f)),t[8]=H*(I*s+k*b+O*x-(C*s+U*b+D*x)),t[9]=H*(C*i+B*b+j*x-(I*i+L*b+_*x)),t[10]=H*(U*i+L*s+$*x-(k*i+B*s+N*x)),t[11]=H*(D*i+_*s+N*b-(O*i+j*s+$*b)),t[12]=H*(U*y+D*h+C*u-(O*h+I*u+k*y)),t[13]=H*(_*h+I*o+L*y-(B*y+j*h+C*o)),t[14]=H*(B*u+N*h+k*o-($*h+U*o+L*u)),t[15]=H*($*y+O*o+j*u-(_*u+N*y+D*o)),t}function d(e,t,r){r=r||s();let n=t[0],o=t[1],i=t[2],l=n*e[3]+o*e[7]+i*e[11]+e[15];return r[0]=(n*e[0]+o*e[4]+i*e[8]+e[12])/l,r[1]=(n*e[1]+o*e[5]+i*e[9]+e[13])/l,r[2]=(n*e[2]+o*e[6]+i*e[10]+e[14])/l,r}function h(e,t,r){r=r||s();let n=t[0],o=t[1],i=t[2];return r[0]=n*e[0]+o*e[4]+i*e[8],r[1]=n*e[1]+o*e[5]+i*e[9],r[2]=n*e[2]+o*e[6]+i*e[10],r}var x=Object.freeze({__proto__:null,axisRotate:function(e,t,r,n){n=n||new m(16);let o=t[0],i=t[1],l=t[2],a=Math.sqrt(o*o+i*i+l*l);o/=a,i/=a,l/=a;let u=o*o,s=i*i,f=l*l,c=Math.cos(r),y=Math.sin(r),b=1-c,p=u+(1-u)*c,d=o*i*b+l*y,h=o*l*b-i*y,x=o*i*b-l*y,g=s+(1-s)*c,v=i*l*b+o*y,A=o*l*b+i*y,F=i*l*b-o*y,w=f+(1-f)*c,E=e[0],P=e[1],T=e[2],S=e[3],R=e[4],M=e[5],z=e[6],I=e[7],C=e[8],U=e[9],k=e[10],O=e[11];return n[0]=p*E+d*R+h*C,n[1]=p*P+d*M+h*U,n[2]=p*T+d*z+h*k,n[3]=p*S+d*I+h*O,n[4]=x*E+g*R+v*C,n[5]=x*P+g*M+v*U,n[6]=x*T+g*z+v*k,n[7]=x*S+g*I+v*O,n[8]=A*E+F*R+w*C,n[9]=A*P+F*M+w*U,n[10]=A*T+F*z+w*k,n[11]=A*S+F*I+w*O,e!==n&&(n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n},axisRotation:function(e,t,r){r=r||new m(16);let n=e[0],o=e[1],i=e[2],l=Math.sqrt(n*n+o*o+i*i);n/=l,o/=l,i/=l;let a=n*n,u=o*o,s=i*i,f=Math.cos(t),c=Math.sin(t),y=1-f;return r[0]=a+(1-a)*f,r[1]=n*o*y+i*c,r[2]=n*i*y-o*c,r[3]=0,r[4]=n*o*y-i*c,r[5]=u+(1-u)*f,r[6]=o*i*y+n*c,r[7]=0,r[8]=n*i*y+o*c,r[9]=o*i*y-n*c,r[10]=s+(1-s)*f,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},copy:y,create:function(){return new m(16).fill(0)},frustum:function(e,t,r,n,o,i,l){l=l||new m(16);let a=t-e,u=n-r,s=o-i;return l[0]=2*o/a,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=2*o/u,l[6]=0,l[7]=0,l[8]=(e+t)/a,l[9]=(n+r)/u,l[10]=i/s,l[11]=-1,l[12]=0,l[13]=0,l[14]=o*i/s,l[15]=0,l},getAxis:function(e,t,r){r=r||s();let n=4*t;return r[0]=e[n+0],r[1]=e[n+1],r[2]=e[n+2],r},getTranslation:function(e,t){return(t=t||s())[0]=e[12],t[1]=e[13],t[2]=e[14],t},identity:b,inverse:p,lookAt:function(e,t,r,l){var a;return l=l||new m(16),n=n||s(),o=o||s(),c(((a=(a=i=i||s())||new u(3))[0]=e[0]-t[0],a[1]=e[1]-t[1],a[2]=e[2]-t[2],a),i),c(f(r,i,n),n),c(f(i,n,o),o),l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=0,l[4]=o[0],l[5]=o[1],l[6]=o[2],l[7]=0,l[8]=i[0],l[9]=i[1],l[10]=i[2],l[11]=0,l[12]=e[0],l[13]=e[1],l[14]=e[2],l[15]=1,l},multiply:function(e,t,r){r=r||new m(16);let n=e[0],o=e[1],i=e[2],l=e[3],a=e[4],u=e[5],s=e[6],f=e[7],c=e[8],y=e[9],b=e[10],p=e[11],d=e[12],h=e[13],x=e[14],g=e[15],v=t[0],A=t[1],F=t[2],w=t[3],E=t[4],P=t[5],T=t[6],S=t[7],R=t[8],M=t[9],z=t[10],I=t[11],C=t[12],U=t[13],k=t[14],O=t[15];return r[0]=n*v+a*A+c*F+d*w,r[1]=o*v+u*A+y*F+h*w,r[2]=i*v+s*A+b*F+x*w,r[3]=l*v+f*A+p*F+g*w,r[4]=n*E+a*P+c*T+d*S,r[5]=o*E+u*P+y*T+h*S,r[6]=i*E+s*P+b*T+x*S,r[7]=l*E+f*P+p*T+g*S,r[8]=n*R+a*M+c*z+d*I,r[9]=o*R+u*M+y*z+h*I,r[10]=i*R+s*M+b*z+x*I,r[11]=l*R+f*M+p*z+g*I,r[12]=n*C+a*U+c*k+d*O,r[13]=o*C+u*U+y*k+h*O,r[14]=i*C+s*U+b*k+x*O,r[15]=l*C+f*U+p*k+g*O,r},negate:function(e,t){return(t=t||new m(16))[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},ortho:function(e,t,r,n,o,i,l){return(l=l||new m(16))[0]=2/(t-e),l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=2/(n-r),l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2/(o-i),l[11]=0,l[12]=(t+e)/(e-t),l[13]=(n+r)/(r-n),l[14]=(i+o)/(o-i),l[15]=1,l},perspective:function(e,t,r,n,o){o=o||new m(16);let i=Math.tan(.5*Math.PI-.5*e),l=1/(r-n);return o[0]=i/t,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(r+n)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*n*l*2,o[15]=0,o},rotateX:function(e,t,r){r=r||new m(16);let n=e[4],o=e[5],i=e[6],l=e[7],a=e[8],u=e[9],s=e[10],f=e[11],c=Math.cos(t),y=Math.sin(t);return r[4]=c*n+y*a,r[5]=c*o+y*u,r[6]=c*i+y*s,r[7]=c*l+y*f,r[8]=c*a-y*n,r[9]=c*u-y*o,r[10]=c*s-y*i,r[11]=c*f-y*l,e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r},rotateY:function(e,t,r){r=r||new m(16);let n=e[0],o=e[1],i=e[2],l=e[3],a=e[8],u=e[9],s=e[10],f=e[11],c=Math.cos(t),y=Math.sin(t);return r[0]=c*n-y*a,r[1]=c*o-y*u,r[2]=c*i-y*s,r[3]=c*l-y*f,r[8]=c*a+y*n,r[9]=c*u+y*o,r[10]=c*s+y*i,r[11]=c*f+y*l,e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r},rotateZ:function(e,t,r){r=r||new m(16);let n=e[0],o=e[1],i=e[2],l=e[3],a=e[4],u=e[5],s=e[6],f=e[7],c=Math.cos(t),y=Math.sin(t);return r[0]=c*n+y*a,r[1]=c*o+y*u,r[2]=c*i+y*s,r[3]=c*l+y*f,r[4]=c*a-y*n,r[5]=c*u-y*o,r[6]=c*s-y*i,r[7]=c*f-y*l,e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r},rotationX:function(e,t){t=t||new m(16);let r=Math.cos(e),n=Math.sin(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},rotationY:function(e,t){t=t||new m(16);let r=Math.cos(e),n=Math.sin(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},rotationZ:function(e,t){t=t||new m(16);let r=Math.cos(e),n=Math.sin(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},scale:function(e,t,r){r=r||new m(16);let n=t[0],o=t[1],i=t[2];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=n*e[3],r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=o*e[7],r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=i*e[11],e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r},scaling:function(e,t){return(t=t||new m(16))[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},setAxis:function(e,t,r,n){n!==e&&(n=y(e,n));let o=4*r;return n[o+0]=t[0],n[o+1]=t[1],n[o+2]=t[2],n},setDefaultType:function(e){let t=m;return m=e,t},setTranslation:function(e,t,r){return e!==(r=r||b())&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11]),r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r},transformDirection:h,transformNormal:function(e,t,r){r=r||s();let n=p(e),o=t[0],i=t[1],l=t[2];return r[0]=o*n[0]+i*n[1]+l*n[2],r[1]=o*n[4]+i*n[5]+l*n[6],r[2]=o*n[8]+i*n[9]+l*n[10],r},transformPoint:d,translate:function(e,t,r){r=r||new m(16);let n=t[0],o=t[1],i=t[2],l=e[0],a=e[1],u=e[2],s=e[3],f=e[4],c=e[5],y=e[6],b=e[7],p=e[8],d=e[9],h=e[10],x=e[11],g=e[12],v=e[13],A=e[14],F=e[15];return e!==r&&(r[0]=l,r[1]=a,r[2]=u,r[3]=s,r[4]=f,r[5]=c,r[6]=y,r[7]=b,r[8]=p,r[9]=d,r[10]=h,r[11]=x),r[12]=l*n+f*o+p*i+g,r[13]=a*n+c*o+d*i+v,r[14]=u*n+y*o+h*i+A,r[15]=s*n+b*o+x*i+F,r},translation:function(e,t){return(t=t||new m(16))[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},transpose:function(e,t){if((t=t||new m(16))===e){let r;return r=e[1],e[1]=e[4],e[4]=r,r=e[2],e[2]=e[8],e[8]=r,r=e[3],e[3]=e[12],e[12]=r,r=e[6],e[6]=e[9],e[9]=r,r=e[7],e[7]=e[13],e[13]=r,r=e[11],e[11]=e[14],e[14]=r,t}let n=e[0],o=e[1],i=e[2],l=e[3],a=e[4],u=e[5],s=e[6],f=e[7],c=e[8],y=e[9],b=e[10],p=e[11],d=e[12],h=e[13],x=e[14],g=e[15];return t[0]=n,t[1]=a,t[2]=c,t[3]=d,t[4]=o,t[5]=u,t[6]=y,t[7]=h,t[8]=i,t[9]=s,t[10]=b,t[11]=x,t[12]=l,t[13]=f,t[14]=p,t[15]=g,t}});let g={};{let v=g;v[5120]=Int8Array,v[5121]=Uint8Array,v[5122]=Int16Array,v[5123]=Uint16Array,v[5124]=Int32Array,v[5125]=Uint32Array,v[5126]=Float32Array,v[32819]=Uint16Array,v[32820]=Uint16Array,v[33635]=Uint16Array,v[5131]=Uint16Array,v[33640]=Uint32Array,v[35899]=Uint32Array,v[35902]=Uint32Array,v[36269]=Uint32Array,v[34042]=Uint32Array}function A(e){if(e instanceof Int8Array)return 5120;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return 5121;if(e instanceof Int16Array)return 5122;if(e instanceof Uint16Array)return 5123;if(e instanceof Int32Array)return 5124;if(e instanceof Uint32Array)return 5125;if(e instanceof Float32Array)return 5126;throw Error("unsupported typed array type")}function F(e){if(e===Int8Array)return 5120;if(e===Uint8Array||e===Uint8ClampedArray)return 5121;if(e===Int16Array)return 5122;if(e===Uint16Array)return 5123;if(e===Int32Array)return 5124;if(e===Uint32Array)return 5125;if(e===Float32Array)return 5126;throw Error("unsupported typed array type")}function w(e){let t=g[e];if(!t)throw Error("unknown gl type");return t}let E="undefined"!=typeof SharedArrayBuffer?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function P(...e){console.error(...e)}let T=new Map;function S(e,t){if(!e||"object"!=typeof e)return!1;let r=T.get(t);r||(r=new WeakMap,T.set(t,r));let n=r.get(e);if(void 0===n){let o=Object.prototype.toString.call(e);n=o.substring(8,o.length-1)===t,r.set(e,n)}return n}function R(e,t){return"undefined"!=typeof WebGLTexture&&S(t,"WebGLTexture")}let M={attribPrefix:""};function z(e,t,r,n){var o;if("undefined"!=typeof WebGLBuffer&&S(t,"WebGLBuffer"))return t;r=r||34962;let i=e.createBuffer();return o=r,e.bindBuffer(o,i),e.bufferData(o,t,n||35044),i}function I(e){return"indices"===e}function C(e){return e.length?e:e.data}let U=/coord|texture/i,k=/color|colour/i;function O(e,t,r){return e.numComponents||e.size||function(e,t){let r;if(t%(r=U.test(e)?2:k.test(e)?4:3)>0)throw Error(`Can not guess numComponents for attribute '${e}'. Tried ${r} but ${t} values is not evenly divisible by ${r}. You should specify it.`);return r}(t,r||C(e).length)}function D(e,t){if(E(e))return e;if(E(e.data))return e.data;Array.isArray(e)&&(e={data:e});let r=e.type?B(e.type):void 0;return r||(r=I(t)?Uint16Array:Float32Array),new r(e.data)}function B(e){return"number"==typeof e?w(e):e||Float32Array}function L(e,t){var r;return{buffer:t.buffer,numValues:24,type:"number"==typeof(r=t.type)?r:r?F(r):5126,arrayType:B(t.type)}}function _(e,t){let r=t.data||t,n=B(t.type),o=r*n.BYTES_PER_ELEMENT,i=e.createBuffer();return e.bindBuffer(34962,i),e.bufferData(34962,o,t.drawType||35044),{buffer:i,numValues:r,type:F(n),arrayType:n}}function j(e,t,r){let n=D(t,r);return{arrayType:n.constructor,buffer:z(e,n,void 0,t.drawType),type:A(n),numValues:0}}let $=["position","positions","a_position"];function N(e,t,r){let n=function(e,t){let r={};return Object.keys(t).forEach(function(n){if(!I(n)){let o=t[n],i=o.attrib||o.name||o.attribName||M.attribPrefix+n;if(o.value){if(!Array.isArray(o.value)&&!E(o.value))throw Error("array.value is not array or typedarray");r[i]={value:o.value}}else{let l;l=o.buffer&&o.buffer instanceof WebGLBuffer?L:"number"==typeof o||"number"==typeof o.data?_:j;let{buffer:a,type:u,numValues:s,arrayType:f}=l(e,o,n),c=void 0!==o.normalize?o.normalize:f===Int8Array||f===Uint8Array,m=O(o,n,s);r[i]={buffer:a,numComponents:m,type:u,normalize:c,stride:o.stride||0,offset:o.offset||0,divisor:void 0===o.divisor?void 0:o.divisor,drawType:o.drawType}}}}),e.bindBuffer(34962,null),r}(e,t),o=Object.assign({},r||{});o.attribs=Object.assign({},r?r.attribs:{},n);let i=t.indices;if(i){let l=D(i,"indices");o.indices=z(e,l,34963),o.numElements=l.length,o.elementType=A(l)}else o.numElements||(o.numElements=function(e,t){var r;let n,o;for(o=0;o<$.length&&!((n=$[o])in t)&&!((n=M.attribPrefix+n)in t);++o);o===$.length&&(n=Object.keys(t)[0]);let i=t[n];if(!i.buffer)return 1;e.bindBuffer(34962,i.buffer);let l=e.getBufferParameter(34962,34660);e.bindBuffer(34962,null);let a=5120===(r=i.type)||5121===r?1:5122===r||5123===r?2:5124===r||5125===r||5126===r?4:0,u=i.numComponents||i.size,s=l/a/u;if(s%1!=0)throw Error(`numComponents ${u} not correct for length ${length}`);return s}(e,o.attribs));return o}function V(e,t,r){var n,o;let i,l=r||Float32Array;return n=new l(e*t),o=e,i=0,n.push=function(){for(let e=0;e<arguments.length;++e){let t=arguments[e];if(t instanceof Array||E(t))for(let r=0;r<t.length;++r)n[i++]=t[r];else n[i++]=t}},n.reset=function(e){i=e||0},n.numComponents=o,Object.defineProperty(n,"numElements",{get:function(){return this.length/this.numComponents|0}}),n}function W(e,t,r){let n=e.length,o=new Float32Array(3);for(let i=0;i<n;i+=3)r(t,[e[i],e[i+1],e[i+2]],o),e[i]=o[0],e[i+1]=o[1],e[i+2]=o[2]}function Y(e,t,r){r=r||s();let n=t[0],o=t[1],i=t[2];return r[0]=n*e[0]+o*e[1]+i*e[2],r[1]=n*e[4]+o*e[5]+i*e[6],r[2]=n*e[8]+o*e[9]+i*e[10],r}function G(e,t,r){return e=e||2,{position:{numComponents:2,data:[(t=t||0)+-1*(e*=.5),(r=r||0)+-1*e,t+1*e,r+-1*e,t+-1*e,r+1*e,t+1*e,r+1*e]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function H(e,t,r,n,o){var i,l;e=e||1,t=t||1,r=r||1,n=n||1,o=o||b();let a=(r+1)*(n+1),u=V(3,a),s=V(3,a),f=V(2,a);for(let c=0;c<=n;c++)for(let m=0;m<=r;m++){let y=m/r,x=c/n;u.push(e*y-.5*e,0,t*x-.5*t),s.push(0,1,0),f.push(y,x)}let g=r+1,v=V(3,r*n*2,Uint16Array);for(let A=0;A<n;A++)for(let F=0;F<r;F++)v.push((A+0)*g+F,(A+1)*g+F,(A+0)*g+F+1),v.push((A+1)*g+F,(A+1)*g+F+1,(A+0)*g+F+1);let w=(i={position:u,normal:s,texcoord:f,indices:v},l=o,Object.keys(i).forEach(function(e){let t=i[e];e.indexOf("pos")>=0?W(t,l,d):e.indexOf("tan")>=0||e.indexOf("binorm")>=0?W(t,l,h):e.indexOf("norm")>=0&&W(t,p(l),Y)}),i);return w}function X(e,t,r,n,o,i,l){if(t<=0||r<=0)throw Error("subdivisionAxis and subdivisionHeight must be > 0");n=n||0,o=o||Math.PI,i=i||0,l=l||2*Math.PI;let a=o-n,u=l-i,s=(t+1)*(r+1),f=V(3,s),c=V(3,s),m=V(2,s);for(let y=0;y<=r;y++)for(let b=0;b<=t;b++){let p=b/t,d=y/r,h=u*p+i,x=a*d+n,g=Math.sin(h),v=Math.cos(h),A=Math.sin(x),F=Math.cos(x),w=v*A,E=g*A;f.push(e*w,e*F,e*E),c.push(w,F,E),m.push(1-p,d)}let P=t+1,T=V(3,t*r*2,Uint16Array);for(let S=0;S<t;S++)for(let R=0;R<r;R++)T.push((R+0)*P+S,(R+0)*P+S+1,(R+1)*P+S),T.push((R+1)*P+S,(R+0)*P+S+1,(R+1)*P+S+1);return{position:f,normal:c,texcoord:m,indices:T}}let q=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function K(e){e=e||1;let t=e/2,r=[[-t,-t,-t],[+t,-t,-t],[-t,+t,-t],[+t,+t,-t],[-t,-t,+t],[+t,-t,+t],[-t,+t,+t],[+t,+t,+t]],n=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],o=[[1,0],[0,0],[0,1],[1,1]],i=V(3,24),l=V(3,24),a=V(2,24),u=V(3,12,Uint16Array);for(let s=0;s<6;++s){let f=q[s];for(let c=0;c<4;++c){let m=r[f[c]],y=n[s],b=o[c];i.push(m),l.push(y),a.push(b)}let p=4*s;u.push(p+0,p+1,p+2),u.push(p+0,p+2,p+3)}return{position:i,normal:l,texcoord:a,indices:u}}function Z(e,t,r,n,o,i,l){if(n<3)throw Error("radialSubdivisions must be 3 or greater");if(o<1)throw Error("verticalSubdivisions must be 1 or greater");let a=void 0===i||i,u=void 0===l||l,s=(a?2:0)+(u?2:0),f=(n+1)*(o+1+s),c=V(3,f),m=V(3,f),y=V(2,f),b=V(3,n*(o+s/2)*2,Uint16Array),p=n+1,d=Math.atan2(e-t,r),h=Math.cos(d),x=Math.sin(d),g=a?-2:0,v=o+(u?2:0);for(let A=g;A<=v;++A){let F,w=A/o,E=r*w;A<0?(E=0,w=1,F=e):A>o?(E=r,w=1,F=t):F=e+(t-e)*(A/o),(-2===A||A===o+2)&&(F=0,w=0),E-=r/2;for(let P=0;P<p;++P){let T=Math.sin(P*Math.PI*2/n),S=Math.cos(P*Math.PI*2/n);c.push(T*F,E,S*F),A<0?m.push(0,-1,0):A>o?m.push(0,1,0):0===F?m.push(0,0,0):m.push(T*h,x,S*h),y.push(P/n,1-w)}}for(let R=0;R<o+s;++R)if((1!==R||!a)&&(R!==o+s-2||!u))for(let M=0;M<n;++M)b.push(p*(R+0)+0+M,p*(R+0)+1+M,p*(R+1)+1+M),b.push(p*(R+0)+0+M,p*(R+1)+1+M,p*(R+1)+0+M);return{position:c,normal:m,texcoord:y,indices:b}}function J(e,t){t=t||[];let r=[];for(let n=0;n<e.length;n+=4){let o=e[n],i=e.slice(n+1,n+4);i.push.apply(i,t);for(let l=0;l<o;++l)r.push.apply(r,i)}return r}function Q(){let e=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],t=J([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),r=J([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),n=e.length/3,o={position:V(3,n),texcoord:V(2,n),normal:V(3,n),color:V(4,n,Uint8Array),indices:V(3,n/3,Uint16Array)};o.position.push(e),o.texcoord.push([.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0]),o.normal.push(t),o.color.push(r);for(let i=0;i<n;++i)o.indices.push(i);return o}function ee(e,t,r,n,o,i,l){if(o<=0)throw Error("subdivisionDown must be > 0");i=i||0,l=l||1;let a=l-i,s=(o+1)*8,f=V(3,s),c=V(3,s),m=V(2,s);function y(t,r,l,s,y,b){for(let p=0;p<=o;p++){var d,h,x;let g=r/1,v=p/o,A=(g-.5)*2,F=(i+v*a)*Math.PI,w=Math.sin(F),E=Math.cos(F),P=e+(t-e)*w,T=A*n,S=E*e,R=w*P;f.push(T,S,R);let M=(d=[0,w,E],(h=h||new u(3))[0]=d[0]*l[0],h[1]=d[1]*l[1],h[2]=d[2]*l[2],(x=x||new u(3))[0]=h[0]+s[0],x[1]=h[1]+s[1],x[2]=h[2]+s[2],x);c.push(M),m.push(g*y+b,v)}}for(let b=0;b<2;b++){let p=(b/1-.5)*2;y(t,b,[1,1,1],[0,0,0],1,0),y(t,b,[0,0,0],[p,0,0],0,0),y(r,b,[1,1,1],[0,0,0],1,0),y(r,b,[0,0,0],[p,0,0],0,1)}let d=V(3,2*o*4,Uint16Array);function h(e,t){for(let r=0;r<o;++r)d.push(e+r+0,e+r+1,t+r+0),d.push(e+r+1,t+r+1,t+r+0)}let x=o+1;return h(0*x,4*x),h(5*x,7*x),h(6*x,2*x),h(3*x,1*x),{position:f,normal:c,texcoord:m,indices:d}}function et(e,t,r,n,o,i){return Z(e,e,t,r,n,o,i)}function er(e,t,r,n,o,i){if(r<3)throw Error("radialSubdivisions must be 3 or greater");if(n<3)throw Error("verticalSubdivisions must be 3 or greater");o=o||0,i=i||2*Math.PI;let l=i-o,a=r+1,u=n+1,s=a*u,f=V(3,s),c=V(3,s),m=V(2,s),y=V(3,r*n*2,Uint16Array);for(let b=0;b<u;++b){let p=b/n,d=p*Math.PI*2,h=Math.sin(d),x=e+h*t,g=Math.cos(d),v=g*t;for(let A=0;A<a;++A){let F=A/r,w=o+F*l,E=Math.sin(w),P=Math.cos(w),T=E*x,S=P*x,R=E*h,M=P*h;f.push(T,v,S),c.push(R,g,M),m.push(F,1-p)}}for(let z=0;z<n;++z)for(let I=0;I<r;++I){let C=1+I,U=1+z;y.push(a*z+I,a*U+I,a*z+C),y.push(a*U+I,a*U+C,a*z+C)}return{position:f,normal:c,texcoord:m,indices:y}}function en(e,t,r,n,o){if(t<3)throw Error("divisions must be at least 3");r=r||1,o=o||1,n=n||0;let i=(t+1)*(r+1),l=V(3,i),a=V(3,i),u=V(2,i),s=V(3,r*t*2,Uint16Array),f=0,c=e-n,m=t+1;for(let y=0;y<=r;++y){let b=n+c*Math.pow(y/r,o);for(let p=0;p<=t;++p){let d=2*Math.PI*p/t,h=b*Math.cos(d),x=b*Math.sin(d);if(l.push(h,0,x),a.push(0,1,0),u.push(1-p/t,y/r),y>0&&p!==t){let g=f+(p+1),v=f+p,A=f+p-m,F=f+(p+1)-m;s.push(g,v,A),s.push(g,A,F)}}f+=t+1}return{position:l,normal:a,texcoord:u,indices:s}}function eo(e){return function(t){let r=e.apply(this,Array.prototype.slice.call(arguments,1));return function(e,t){let r={};return Object.keys(t).forEach(function(n){r[n]=function(e,t,r){let n=D(t,r);return z(e,n,"indices"===r?34963:34962)}(e,t[n],n)}),t.indices?(r.numElements=t.indices.length,r.elementType=A(D(t.indices))):r.numElements=function(e){let t,r;for(r=0;r<$.length&&!((t=$[r])in e);++r);r===$.length&&(t=Object.keys(e)[0]);let n=e[t],o=C(n).length;if(void 0===o)return 1;let i=O(n,t);if(o%i>0)throw Error(`numComponents ${i} not correct for length ${o}`);return o/i}(t),r}(t,r)}}function ei(e){return function(t){let r=e.apply(null,Array.prototype.slice.call(arguments,1));return N(t,r)}}function el(e){return!!e.texStorage2D}ei(Q),eo(Q),ei(K),eo(K),ei(H),eo(H),ei(X),eo(X),ei(Z),eo(Z),ei(G),eo(G),ei(ee),eo(ee),ei(et),eo(et),ei(er),eo(er),ei(en),eo(en);let ea=function(){let e={},t={};return function(r,n){return!function(r){let n=r.constructor.name;if(!e[n]){for(let o in r)if("number"==typeof r[o]){let i=t[r[o]];t[r[o]]=i?`${i} | ${o}`:o}e[n]=!0}}(r),t[n]||("number"==typeof n?`0x${n.toString(16)}`:n)}}(),eu={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},es=function(){return a=a||("undefined"!=typeof document&&document.createElement?document.createElement("canvas").getContext("2d"):null)};{let ef={};ef[6406]={numColorComponents:1},ef[6409]={numColorComponents:1},ef[6410]={numColorComponents:2},ef[6407]={numColorComponents:3},ef[6408]={numColorComponents:4},ef[6403]={numColorComponents:1},ef[36244]={numColorComponents:1},ef[33319]={numColorComponents:2},ef[33320]={numColorComponents:2},ef[6407]={numColorComponents:3},ef[36248]={numColorComponents:3},ef[6408]={numColorComponents:4},ef[36249]={numColorComponents:4},ef[6402]={numColorComponents:1},ef[34041]={numColorComponents:2}}function ec(e){if(!l){let t={};t[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},t[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},t[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[5121,5131,36193,5126]},t[6407]={textureFormat:6407,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},t[6408]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},t[6402]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5125,5123]},t[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[5121]},t[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[5120]},t[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[5126,5131]},t[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[5126]},t[33330]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[5121]},t[33329]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[5120]},t[33332]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5123]},t[33331]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5122]},t[33334]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5125]},t[33333]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5124]},t[33323]={textureFormat:33319,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[5121]},t[36757]={textureFormat:33319,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[5120]},t[33327]={textureFormat:33319,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[5126,5131]},t[33328]={textureFormat:33319,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[5126]},t[33336]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5121]},t[33335]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[5120]},t[33338]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5123]},t[33337]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5122]},t[33340]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5125]},t[33339]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5124]},t[32849]={textureFormat:6407,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[5121]},t[35905]={textureFormat:6407,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[5121]},t[36194]={textureFormat:6407,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[5121,33635]},t[36758]={textureFormat:6407,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[5120]},t[35898]={textureFormat:6407,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35899]},t[35901]={textureFormat:6407,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35902]},t[34843]={textureFormat:6407,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[5126,5131]},t[34837]={textureFormat:6407,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[5126]},t[36221]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[5121]},t[36239]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[5120]},t[36215]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[5123]},t[36233]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[5122]},t[36209]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[5125]},t[36227]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[5124]},t[32856]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[5121]},t[35907]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[5121]},t[36759]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[5120]},t[32855]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[5121,32820,33640]},t[32854]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[5121,32819]},t[32857]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[33640]},t[34842]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[5126,5131]},t[34836]={textureFormat:6408,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[5126]},t[36220]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5121]},t[36238]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5120]},t[36975]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[33640]},t[36214]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5123]},t[36232]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[5122]},t[36226]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[5124]},t[36208]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[5125]},t[33189]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5123,5125]},t[33190]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5125]},t[36012]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[5126]},t[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[34042]},t[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[36269]},Object.keys(t).forEach(function(e){let r=t[e];r.bytesPerElementMap={},r.bytesPerElement.forEach(function(e,t){let n=r.type[t];r.bytesPerElementMap[n]=e})}),l=t}return l[e]}function em(e){let t=ec(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function ey(e,t,r,n,o){if(o%1!=0)throw"can't guess dimensions";if(r||n){if(n){if(!r&&(r=o/n)%1)throw"can't guess dimensions"}else if((n=o/r)%1)throw"can't guess dimensions"}else{let i=Math.sqrt(o/(34067===t?6:1));i%1==0?(r=i,n=i):(r=o,n=1)}return{width:r,height:n}}function eb(e,t){void 0!==t.colorspaceConversion&&e.pixelStorei(37443,t.colorspaceConversion),void 0!==t.premultiplyAlpha&&e.pixelStorei(37441,t.premultiplyAlpha),void 0!==t.flipY&&e.pixelStorei(37440,t.flipY)}function ep(e){e.pixelStorei(3317,4),el(e)&&(e.pixelStorei(3314,0),e.pixelStorei(32878,0),e.pixelStorei(3316,0),e.pixelStorei(3315,0),e.pixelStorei(32877,0))}function ed(e,t,r){var n,o,i,l;let a=r.target||3553;e.bindTexture(a,t),n=e,o=a,i=e.texParameteri,(l=r).minMag&&(i.call(n,o,10241,l.minMag),i.call(n,o,10240,l.minMag)),l.min&&i.call(n,o,10241,l.min),l.mag&&i.call(n,o,10240,l.mag),l.wrap&&(i.call(n,o,10242,l.wrap),i.call(n,o,10243,l.wrap),(32879===o||"undefined"!=typeof WebGLSampler&&S(o,"WebGLSampler"))&&i.call(n,o,32882,l.wrap)),l.wrapR&&i.call(n,o,32882,l.wrapR),l.wrapS&&i.call(n,o,10242,l.wrapS),l.wrapT&&i.call(n,o,10243,l.wrapT),void 0!==l.minLod&&i.call(n,o,33082,l.minLod),void 0!==l.maxLod&&i.call(n,o,33083,l.maxLod),void 0!==l.baseLevel&&i.call(n,o,33084,l.baseLevel),void 0!==l.maxLevel&&i.call(n,o,33085,l.maxLevel),void 0!==l.compareFunc&&i.call(n,o,34893,l.compareFunc),void 0!==l.compareMode&&i.call(n,o,34892,l.compareMode)}function eh(e,t,r,n,o,i){r=r||eu.textureOptions,i=i||6408;let l=r.target||3553;if(n=n||r.width,o=o||r.height,e.bindTexture(l,t),function(e,t,r,n){if(!el(e))return(t&t-1)==0&&(r&r-1)==0;let o=ec(n);if(!o)throw"unknown internal format";return o.colorRenderable&&o.textureFilterable}(e,n,o,i))e.generateMipmap(l);else{let a=!function(e){let t=ec(e);if(!t)throw"unknown internal format";return t.textureFilterable}(i)?9728:9729;e.texParameteri(l,10241,a),e.texParameteri(l,10240,a),e.texParameteri(l,10242,33071),e.texParameteri(l,10243,33071)}}function ex(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function eg(e,t){return(t=t||{}).cubeFaceOrder||[34069,34070,34071,34072,34073,34074]}function ev(e,t){let r=eg(e,t),n=r.map(function(e,t){return{face:e,ndx:t}});return n.sort(function(e,t){return e.face-t.face}),n}function eA(e,t,r,n){n=n||eu.textureOptions;let o=n.target||3553,i=n.level||0,l=r.width,a=r.height,u=n.internalFormat||n.format||6408,s=em(u),f=n.format||s.format,c=n.type||s.type;if(eb(e,n),e.bindTexture(o,t),34067===o){let m,y;let b=r.width,p=r.height;if(b/6===p)m=p,y=[0,0,1,0,2,0,3,0,4,0,5,0];else if(p/6===b)m=b,y=[0,0,0,1,0,2,0,3,0,4,0,5];else if(b/3==p/2)m=b/3,y=[0,0,1,0,2,0,0,1,1,1,2,1];else if(b/2==p/3)m=b/2,y=[0,0,1,0,0,1,1,1,0,2,1,2];else throw"can't figure out cube map from element: "+(r.src?r.src:r.nodeName);let d=es();d?(d.canvas.width=m,d.canvas.height=m,l=m,a=m,ev(e,n).forEach(function(t){let n=y[2*t.ndx+0]*m,o=y[2*t.ndx+1]*m;d.drawImage(r,n,o,m,m,0,0,m,m),e.texImage2D(t.face,i,u,f,c,d.canvas)}),d.canvas.width=1,d.canvas.height=1):"undefined"!=typeof createImageBitmap&&(l=m,a=m,ev(e,n).forEach(function(s){let b=y[2*s.ndx+0]*m,p=y[2*s.ndx+1]*m;e.texImage2D(s.face,i,u,m,m,0,f,c,null),createImageBitmap(r,b,p,m,m,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(r){eb(e,n),e.bindTexture(o,t),e.texImage2D(s.face,i,u,f,c,r),ex(n)&&eh(e,t,n,l,a,u)})}))}else if(32879===o||35866===o){let h=Math.min(r.width,r.height),x=Math.max(r.width,r.height),g=x/h;if(g%1!=0)throw"can not compute 3D dimensions of element";let v=r.width===x?1:0,A=r.height===x?1:0;e.pixelStorei(3317,1),e.pixelStorei(3314,r.width),e.pixelStorei(32878,0),e.pixelStorei(32877,0),e.texImage3D(o,i,u,h,h,h,0,f,c,null);for(let F=0;F<g;++F){let w=F*h*v,E=F*h*A;e.pixelStorei(3316,w),e.pixelStorei(3315,E),e.texSubImage3D(o,i,0,0,F,h,h,1,f,c,r)}ep(e)}else e.texImage2D(o,i,u,f,c,r);ex(n)&&eh(e,t,n,l,a,u),ed(e,t,n)}function eF(){}function ew(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof ImageData&&e instanceof ImageData||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function eE(e,t,r){return ew(e)?(setTimeout(function(){r(null,e)}),e):function(e,t,r){var n;let o;if(r=r||eF,t=void 0!==(n=t=void 0!==t?t:eu.crossOrigin)||function(e){if("undefined"!=typeof document){let t=document.createElement("a");return t.href=e,t.hostname===location.hostname&&t.port===location.port&&t.protocol===location.protocol}{let r=new URL(location.href).origin,n=new URL(e,location.href).origin;return n===r}}(e)?n:"anonymous","undefined"!=typeof Image){o=new Image,void 0!==t&&(o.crossOrigin=t);let i=function(){o.removeEventListener("error",l),o.removeEventListener("load",a),o=null},l=function(){let t="couldn't load image: "+e;P(t),r(t,o),i()},a=function(){r(null,o),i()};o.addEventListener("error",l),o.addEventListener("load",a),o.src=e}else if("undefined"!=typeof ImageBitmap){let u,s;let f=function(){r(u,s)},c={};t&&(c.mode="cors"),fetch(e,c).then(function(e){if(!e.ok)throw e;return e.blob()}).then(function(e){return createImageBitmap(e,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(e){s=e,setTimeout(f)}).catch(function(e){u=e,setTimeout(f)}),o=null}return o}(e,t,r)}function eP(e,t,r){var n;r=r||eu.textureOptions;let o=r.target||3553;if(e.bindTexture(o,t),!1===r.color)return;let i=E(n=(n=r.color)||eu.textureColor)?n:new Uint8Array([255*n[0],255*n[1],255*n[2],255*n[3]]);if(34067===o)for(let l=0;l<6;++l)e.texImage2D(34069+l,0,6408,1,1,0,6408,5121,i);else 32879===o||35866===o?e.texImage3D(o,0,6408,1,1,1,0,6408,5121,i):e.texImage2D(o,0,6408,1,1,0,6408,5121,i)}function eT(e,t,r){r=r||eF,t=t||eu.textureOptions;let n=e.createTexture(),o=t.target||3553,i=t.width||1,l=t.height||1,a=t.internalFormat||6408;e.bindTexture(o,n),34067===o&&(e.texParameteri(o,10242,33071),e.texParameteri(o,10243,33071));let u=t.src;if(u){if("function"==typeof u&&(u=u(e,t)),"string"==typeof u){var s,f;s=t,f=(f=r)||eF,eP(e,n,s=s||eu.textureOptions),eE((s=Object.assign({},s)).src,s.crossOrigin,function(t,r){t?f(t,n,r):(eA(e,n,r,s),f(null,n,r))})}else if(E(u)||Array.isArray(u)&&("number"==typeof u[0]||Array.isArray(u[0])||E(u[0]))){let c=function(e,t,r,n){var o,i;let l;n=n||eu.textureOptions;let a=n.target||3553;e.bindTexture(a,t);let u=n.width,s=n.height,f=n.depth,c=n.level||0,m=n.internalFormat||n.format||6408,y=em(m),b=n.format||y.format,p=n.type||(o=r,i=y.type,E(o)?A(o):i||5121);if(E(r))r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));else{let d=w(p);r=new d(r)}let h=function(e,t){let r=ec(e);if(!r)throw"unknown internal format";let n=r.bytesPerElementMap[t];if(void 0===n)throw"unknown internal format";return n}(m,p),x=r.byteLength/h;if(x%1)throw"length wrong size for format: "+ea(e,b);if(32879===a||35866===a){if(u||s||f)!u||s&&f?!s||u&&f?(u=(l=ey(e,a,u,s,x/f)).width,s=l.height):(u=(l=ey(e,a,u,f,x/s)).width,f=l.height):(s=(l=ey(e,a,s,f,x/u)).width,f=l.height);else{let g=Math.cbrt(x);if(g%1!=0)throw"can't guess cube size of array of numElements: "+x;u=g,s=g,f=g}}else u=(l=ey(e,a,u,s,x)).width,s=l.height;if(ep(e),e.pixelStorei(3317,n.unpackAlignment||1),eb(e,n),34067===a){let v=h/r.BYTES_PER_ELEMENT,F=x/6*v;ev(e,n).forEach(t=>{let n=F*t.ndx,o=r.subarray(n,n+F);e.texImage2D(t.face,c,m,u,s,0,b,p,o)})}else 32879===a||35866===a?e.texImage3D(a,c,m,u,s,f,0,b,p,r):e.texImage2D(a,c,m,u,s,0,b,p,r);return{width:u,height:s,depth:f,type:p}}(e,n,u,t);i=c.width,l=c.height}else Array.isArray(u)&&("string"==typeof u[0]||ew(u[0]))?34067===o?function(e,t,r,n){let o;n=n||eF;let i=r.src;if(6!==i.length)throw"there must be 6 urls for a cubemap";let l=r.level||0,a=r.internalFormat||r.format||6408,u=em(a),s=r.format||u.format,f=r.type||5121,c=r.target||3553;if(34067!==c)throw"target must be TEXTURE_CUBE_MAP";eP(e,t,r),r=Object.assign({},r);let m=6,y=[],b=eg(e,r);o=i.map(function(i,u){var p;return eE(i,r.crossOrigin,(p=b[u],function(i,u){--m,i?y.push(i):u.width!==u.height?y.push("cubemap face img is not a square: "+u.src):(eb(e,r),e.bindTexture(c,t),5===m?eg().forEach(function(t){e.texImage2D(t,l,a,s,f,u)}):e.texImage2D(p,l,a,s,f,u),ex(r)&&e.generateMipmap(c)),0===m&&n(y.length?y:void 0,t,o)}))})}(e,n,t,r):function(e,t,r,n){let o;n=n||eF;let i=r.src,l=r.internalFormat||r.format||6408,a=em(l),u=r.format||a.format,s=r.type||5121,f=r.target||35866;if(32879!==f&&35866!==f)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";eP(e,t,r),r=Object.assign({},r);let c=i.length,m=[],y=r.level||0,b=r.width,p=r.height,d=i.length,h=!0;o=i.map(function(i,a){return eE(i,r.crossOrigin,function(i,x){if(--c,i)m.push(i);else{if(eb(e,r),e.bindTexture(f,t),h){h=!1,b=r.width||x.width,p=r.height||x.height,e.texImage3D(f,y,l,b,p,d,0,u,s,null);for(let g=0;g<d;++g)e.texSubImage3D(f,y,0,0,g,b,p,1,u,s,x)}else{let v,A=x;(x.width!==b||x.height!==p)&&(A=(v=es()).canvas,v.canvas.width=b,v.canvas.height=p,v.drawImage(x,0,0,b,p)),e.texSubImage3D(f,y,0,0,a,b,p,1,u,s,A),v&&A===v.canvas&&(v.canvas.width=0,v.canvas.height=0)}ex(r)&&e.generateMipmap(f)}0===c&&n(m.length?m:void 0,t,o)})})}(e,n,t,r):(eA(e,n,u,t),i=u.width,l=u.height)}else!function(e,t,r){let n=r.target||3553;e.bindTexture(n,t);let o=r.level||0,i=r.internalFormat||r.format||6408,l=em(i),a=r.format||l.format,u=r.type||l.type;if(eb(e,r),34067===n)for(let s=0;s<6;++s)e.texImage2D(34069+s,o,i,r.width,r.height,0,a,u,null);else 32879===n||35866===n?e.texImage3D(n,o,i,r.width,r.height,r.depth,0,a,u,null):e.texImage2D(n,o,i,r.width,r.height,0,a,u,null)}(e,n,t);return ex(t)&&eh(e,n,t,i,l,a),ed(e,n,t),n}function eS(e){return"undefined"!=typeof document&&document.getElementById?document.getElementById(e):null}let eR={};function eM(e,t){return eR[t].bindPoint}function ez(e,t){return function(r){e.uniform1i(t,r)}}function eI(e,t){return function(r){e.uniform1iv(t,r)}}function eC(e,t){return function(r){e.uniform2iv(t,r)}}function eU(e,t){return function(r){e.uniform3iv(t,r)}}function ek(e,t){return function(r){e.uniform4iv(t,r)}}function eO(e,t,r,n){let o=eM(e,t);return el(e)?function(t){let i,l;!t||R(e,t)?(i=t,l=null):(i=t.texture,l=t.sampler),e.uniform1i(n,r),e.activeTexture(33984+r),e.bindTexture(o,i),e.bindSampler(r,l)}:function(t){e.uniform1i(n,r),e.activeTexture(33984+r),e.bindTexture(o,t)}}function eD(e,t,r,n,o){let i=eM(e,t),l=new Int32Array(o);for(let a=0;a<o;++a)l[a]=r+a;return el(e)?function(t){e.uniform1iv(n,l),t.forEach(function(t,n){let o,a;e.activeTexture(33984+l[n]),!t||R(e,t)?(o=t,a=null):(o=t.texture,a=t.sampler),e.bindSampler(r,a),e.bindTexture(i,o)})}:function(t){e.uniform1iv(n,l),t.forEach(function(t,r){e.activeTexture(33984+l[r]),e.bindTexture(i,t)})}}function eB(e,t){return function(r){if(r.value)switch(e.disableVertexAttribArray(t),r.value.length){case 4:e.vertexAttrib4fv(t,r.value);break;case 3:e.vertexAttrib3fv(t,r.value);break;case 2:e.vertexAttrib2fv(t,r.value);break;case 1:e.vertexAttrib1fv(t,r.value);break;default:throw Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(34962,r.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,r.numComponents||r.size,r.type||5126,r.normalize||!1,r.stride||0,r.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,r.divisor||0)}}function eL(e,t){return function(r){if(r.value){if(e.disableVertexAttribArray(t),4===r.value.length)e.vertexAttrib4iv(t,r.value);else throw Error("The length of an integer constant value must be 4!")}else e.bindBuffer(34962,r.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,r.numComponents||r.size,r.type||5124,r.stride||0,r.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,r.divisor||0)}}function e_(e,t){return function(r){if(r.value){if(e.disableVertexAttribArray(t),4===r.value.length)e.vertexAttrib4uiv(t,r.value);else throw Error("The length of an unsigned integer constant value must be 4!")}else e.bindBuffer(34962,r.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,r.numComponents||r.size,r.type||5125,r.stride||0,r.offset||0),e.vertexAttribDivisor&&e.vertexAttribDivisor(t,r.divisor||0)}}function ej(e,t,r){let n=r.size,o=r.count;return function(r){e.bindBuffer(34962,r.buffer);let i=r.size||r.numComponents||n,l=i/o,a=r.type||5126,u=eR[a],s=u.size*i,f=r.normalize||!1,c=r.offset||0,m=s/o;for(let y=0;y<o;++y)e.enableVertexAttribArray(t+y),e.vertexAttribPointer(t+y,l,a,f,s,c+m*y),e.vertexAttribDivisor&&e.vertexAttribDivisor(t+y,r.divisor||0)}}eR[5126]={Type:Float32Array,size:4,setter:function(e,t){return function(r){e.uniform1f(t,r)}},arraySetter:function(e,t){return function(r){e.uniform1fv(t,r)}}},eR[35664]={Type:Float32Array,size:8,setter:function(e,t){return function(r){e.uniform2fv(t,r)}},cols:2},eR[35665]={Type:Float32Array,size:12,setter:function(e,t){return function(r){e.uniform3fv(t,r)}},cols:3},eR[35666]={Type:Float32Array,size:16,setter:function(e,t){return function(r){e.uniform4fv(t,r)}},cols:4},eR[5124]={Type:Int32Array,size:4,setter:ez,arraySetter:eI},eR[35667]={Type:Int32Array,size:8,setter:eC,cols:2},eR[35668]={Type:Int32Array,size:12,setter:eU,cols:3},eR[35669]={Type:Int32Array,size:16,setter:ek,cols:4},eR[5125]={Type:Uint32Array,size:4,setter:function(e,t){return function(r){e.uniform1ui(t,r)}},arraySetter:function(e,t){return function(r){e.uniform1uiv(t,r)}}},eR[36294]={Type:Uint32Array,size:8,setter:function(e,t){return function(r){e.uniform2uiv(t,r)}},cols:2},eR[36295]={Type:Uint32Array,size:12,setter:function(e,t){return function(r){e.uniform3uiv(t,r)}},cols:3},eR[36296]={Type:Uint32Array,size:16,setter:function(e,t){return function(r){e.uniform4uiv(t,r)}},cols:4},eR[35670]={Type:Uint32Array,size:4,setter:ez,arraySetter:eI},eR[35671]={Type:Uint32Array,size:8,setter:eC,cols:2},eR[35672]={Type:Uint32Array,size:12,setter:eU,cols:3},eR[35673]={Type:Uint32Array,size:16,setter:ek,cols:4},eR[35674]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2fv(t,!1,r)}},rows:2,cols:2},eR[35675]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3fv(t,!1,r)}},rows:3,cols:3},eR[35676]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4fv(t,!1,r)}},rows:4,cols:4},eR[35685]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2x3fv(t,!1,r)}},rows:2,cols:3},eR[35686]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2x4fv(t,!1,r)}},rows:2,cols:4},eR[35687]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3x2fv(t,!1,r)}},rows:3,cols:2},eR[35688]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3x4fv(t,!1,r)}},rows:3,cols:4},eR[35689]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4x2fv(t,!1,r)}},rows:4,cols:2},eR[35690]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4x3fv(t,!1,r)}},rows:4,cols:3},eR[35678]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:3553},eR[35680]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:34067},eR[35679]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:32879},eR[35682]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:3553},eR[36289]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:35866},eR[36292]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:35866},eR[36293]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:34067},eR[36298]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:3553},eR[36299]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:32879},eR[36300]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:34067},eR[36303]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:35866},eR[36306]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:3553},eR[36307]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:32879},eR[36308]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:34067},eR[36311]={Type:null,size:0,setter:eO,arraySetter:eD,bindPoint:35866};let e$={};e$[5126]={size:4,setter:eB},e$[35664]={size:8,setter:eB},e$[35665]={size:12,setter:eB},e$[35666]={size:16,setter:eB},e$[5124]={size:4,setter:eL},e$[35667]={size:8,setter:eL},e$[35668]={size:12,setter:eL},e$[35669]={size:16,setter:eL},e$[5125]={size:4,setter:e_},e$[36294]={size:8,setter:e_},e$[36295]={size:12,setter:e_},e$[36296]={size:16,setter:e_},e$[35670]={size:4,setter:eL},e$[35671]={size:8,setter:eL},e$[35672]={size:12,setter:eL},e$[35673]={size:16,setter:eL},e$[35674]={size:4,setter:ej,count:2},e$[35675]={size:9,setter:ej,count:3},e$[35676]={size:16,setter:ej,count:4};let eN=/ERROR:\s*\d+:(\d+)/gi,eV=/^[ \t]*\n/;function eW(e){let t=0;return eV.test(e)&&(t=1,e=e.replace(eV,"")),{lineOffset:t,shaderSource:e}}function eY(e,t,r){let n,o,i;if("function"==typeof t&&(r=t,t=void 0),"function"==typeof e)r=e,e=void 0;else if(e&&!Array.isArray(e)){let l=e;r=l.errorCallback,e=l.attribLocations,n=l.transformFeedbackVaryings,o=l.transformFeedbackMode,i=l.callback}let a=r||P,u=[],s={errorCallback(e,...t){u.push(e),a(e,...t)},transformFeedbackVaryings:n,transformFeedbackMode:o,callback:i,errors:u};{let f={};Array.isArray(e)?e.forEach(function(e,r){f[e]=t?t[r]:r}):f=e||{},s.attribLocations=f}return s}let eG=["VERTEX_SHADER","FRAGMENT_SHADER"],eH=(e=0)=>new Promise(t=>setTimeout(t,e));function eX(e,t,r){let n=e.createProgram(),{attribLocations:o,transformFeedbackVaryings:i,transformFeedbackMode:l}=eY(r);for(let a=0;a<t.length;++a){let u=t[a];if("string"==typeof u){let s=eS(u),f=s?s.text:u,c=e[eG[a]];if(s&&s.type){var m;c=((m=s.type).indexOf("frag")>=0?35632:m.indexOf("vert")>=0?35633:void 0)||c}u=e.createShader(c),e.shaderSource(u,eW(f).shaderSource),e.compileShader(u),e.attachShader(n,u)}}Object.entries(o).forEach(([t,r])=>e.bindAttribLocation(n,r,t));{let y=i;y&&(y.attribs&&(y=y.attribs),Array.isArray(y)||(y=Object.keys(y)),e.transformFeedbackVaryings(n,y,l||35981))}return e.linkProgram(n),n}function eq(e,t,r,n,o){let i=eY(r,n,o),l=new Set(t),a=eX(e,t,i);function u(e,t){let r=eQ(e,t,i.errorCallback);return r&&function(e,t,r){let n=e.getAttachedShaders(t);for(let o of n)r.has(o)&&e.deleteShader(o);e.deleteProgram(t)}(e,t,l),r}if(i.callback){eZ(e,a).then(()=>{let t=u(e,a);i.callback(t,t?void 0:a)});return}return u(e,a)?void 0:a}function eK(e){return function(t,r,...n){return new Promise((o,i)=>{let l=eY(...n);l.callback=(e,t)=>{e?i(e):o(t)},e(t,r,l)})}}async function eZ(e,t){let r=e.getExtension("KHR_parallel_shader_compile"),n=r?(e,t)=>e.getProgramParameter(t,r.COMPLETION_STATUS_KHR):()=>!0,o=0;do await eH(o),o=1e3/60;while(!n(e,t))}async function eJ(e,t){for(let r of Object.values(t))await eZ(e,r)}function eQ(e,t,r){r=r||P;let n=e.getProgramParameter(t,35714);if(!n){let o=e.getProgramInfoLog(t);r(`Error in program linking: ${o}`);let i=e.getAttachedShaders(t),l=i.map(t=>(function(e,t,r,n){n=n||P;let o=e.getShaderParameter(r,35713);if(!o){let i=e.getShaderInfoLog(r),{lineOffset:l,shaderSource:a}=eW(e.getShaderSource(r)),u=`${function(e,t="",r=0){let n=[...t.matchAll(eN)],o=new Map(n.map((e,r)=>{let o=parseInt(e[1]),i=n[r+1],l=i?i.index:t.length,a=t.substring(e.index,l);return[o-1,a]}));return e.split("\n").map((e,t)=>{let n=o.get(t);return`${t+1+r}: ${e}${n?`

^^^ ${n}`:""}`}).join("\n")}(a,i,l)}
Error compiling ${ea(e,t)}: ${i}`;return n(u),u}return""})(e,e.getShaderParameter(t,e.SHADER_TYPE),t,r));return`${o}
${l.filter(e=>e).join("\n")}`}}function e0(e){let t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}eK(eq),eK(e5);let e1=/(\.|\[|]|\w+)/g,e3=e=>e>="0"&&e<="9";function e2(e,t,r){r.vertexArrayObject?e.bindVertexArray(r.vertexArrayObject):(function(e,t){for(let r in t){let n=e[r];n&&n(t[r])}}(t.attribSetters||t,r.attribs),r.indices&&e.bindBuffer(34963,r.indices))}function e6(e,t){let r=function(e,t){let r=0,n={},o={},i=e.getProgramParameter(t,35718);for(let l=0;l<i;++l){let a=e.getActiveUniform(t,l);if(e0(a))continue;let u=a.name;u.endsWith("[0]")&&(u=u.substr(0,u.length-3));let s=e.getUniformLocation(t,a.name);if(s){let f=function(t,n,o){let i;let l=n.name.endsWith("[0]"),a=n.type,u=eR[a];if(!u)throw Error(`unknown type: 0x${a.toString(16)}`);if(u.bindPoint){let s=r;r+=n.size,i=l?u.arraySetter(e,a,s,o,n.size):u.setter(e,a,s,o,n.size)}else i=u.arraySetter&&l?u.arraySetter(e,o):u.setter(e,o);return i.location=o,i}(0,a,s);n[u]=f,function(e,t,r,n){let o=e.split(e1).filter(e=>""!==e),i=0,l="";for(;;){let a=o[i++];l+=a;let u=e3(a[0]),s=u?parseInt(a):a;u&&(l+=o[i++]);let f=i===o.length;if(f){r[s]=t;break}{let c=o[i++],m="["===c,y=r[s]||(m?[]:{});r[s]=y,r=y,n[l]=n[l]||function(e){return function(t){(function e(t,r){for(let n in r){let o=t[n];"function"==typeof o?o(r[n]):e(t[n],r[n])}})(e,t)}}(y),l+=c}}}(u,f,o,n)}}return n}(e,t),n=function(e,t){let r={},n=e.getProgramParameter(t,35721);for(let o=0;o<n;++o){let i=e.getActiveAttrib(t,o);if(e0(i))continue;let l=e.getAttribLocation(t,i.name),a=e$[i.type],u=a.setter(e,l,a);u.location=l,r[i.name]=u}return r}(e,t),o={program:t,uniformSetters:r,attribSetters:n};return el(e)&&(o.uniformBlockSpec=function(e,t){let r=e.getProgramParameter(t,35718),n=[],o=[];for(let i=0;i<r;++i){o.push(i),n.push({});let l=e.getActiveUniform(t,i);n[i].name=l.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(r){let i=r[0],l=r[1];e.getActiveUniforms(t,o,e[i]).forEach(function(e,t){n[t][l]=e})});let a={},u=e.getProgramParameter(t,35382);for(let s=0;s<u;++s){let f=e.getActiveUniformBlockName(t,s),c={index:e.getUniformBlockIndex(t,f),usedByVertexShader:e.getActiveUniformBlockParameter(t,s,35396),usedByFragmentShader:e.getActiveUniformBlockParameter(t,s,35398),size:e.getActiveUniformBlockParameter(t,s,35392),uniformIndices:e.getActiveUniformBlockParameter(t,s,35395)};c.used=c.usedByVertexShader||c.usedByFragmentShader,a[f]=c}return{blockSpecs:a,uniformData:n}}(e,t),o.transformFeedbackInfo=function(e,t){let r={},n=e.getProgramParameter(t,35971);for(let o=0;o<n;++o){let i=e.getTransformFeedbackVarying(t,o);r[i.name]={index:o,type:i.type,size:i.size}}return r}(e,t)),o}let e4=/\s|{|}|;/;function e5(e,t,r,n,o){let i=eY(r,n,o),l=[];if(t=t.map(function(e){if(!e4.test(e)){let t=eS(e);if(t)e=t.text;else{let r=`no element with id: ${e}`;i.errorCallback(r),l.push(r)}}return e}),l.length)return i.errorCallback(""),i.callback&&setTimeout(()=>{i.callback(`
${i.errors.join("\n")}`)}),null;let a=i.callback;a&&(i.callback=(t,r)=>{a(t,t?void 0:e6(e,r))});let u=eq(e,t,i,void 0,void 0);return u?e6(e,u):null}function e8(e,t,r,n,o){for(let[i,l]of Object.entries(t)){let a={...o},u=r[i];Array.isArray(u)||Object.assign(a,u);let s=eQ(e,l,a.errorCallback);if(s){for(let f of Object.values(t)){let c=e.getAttachedShaders(f);for(let m of(e.deleteProgram(f),c))n.has(m)||e.deleteShader(m)}return s}}}function e9(e,t,r={}){let n=new Set,o=Object.fromEntries(Object.entries(t).map(([t,o])=>{let i={...r},l=Array.isArray(o)?o:o.shaders;return Array.isArray(o)||Object.assign(i,o),l.forEach(n.add,n),[t,eX(e,l,i)]}));if(r.callback){eJ(e,o).then(()=>{let i=e8(e,o,t,n,r);r.callback(i,i?void 0:o)});return}let i=e8(e,o,t,n,r);return i?void 0:o}function e7(e,t,r,n,o,i){r=void 0===r?4:r;let l=t.indices,a=t.elementType,u=void 0===n?t.numElements:n;o=void 0===o?0:o,a||l?void 0!==i?e.drawElementsInstanced(r,u,void 0===a?5123:t.elementType,o,i):e.drawElements(r,u,void 0===a?5123:t.elementType,o):void 0!==i?e.drawArraysInstanced(r,o,u,i):e.drawArrays(r,o,u)}eK(e9),eK(function(e,t,r){function n(e,t){return Object.fromEntries(Object.entries(t).map(([t,r])=>[t,e6(e,r)]))}r=eY(r);let o=r.callback;o&&(r.callback=(t,r)=>{o(t,t?void 0:n(e,r))});let i=e9(e,t,r);if(!o&&i)return n(e,i)});let te={};te[34041]=33306,te[6401]=36128,te[36168]=36128,te[6402]=36096,te[33189]=36096,te[33190]=36096,te[36012]=36096,te[35056]=33306,te[36013]=33306;let tt={};tt[32854]=!0,tt[32855]=!0,tt[36194]=!0,tt[34041]=!0,tt[33189]=!0,tt[6401]=!0,tt[36168]=!0}}]);