Spaces:
Running
Running
/*!For license information please see LICENSES*/(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{356:function(e,t,r){"use strict";r.d(t,"a",(function(){return Y})),r.d(t,"b",(function(){return qr})),r.d(t,"c",(function(){return Dr})),r.d(t,"d",(function(){return Bt})),r.d(t,"e",(function(){return Lt})),r.d(t,"f",(function(){return _r})),r.d(t,"g",(function(){return Zr})),r.d(t,"h",(function(){return Jr})),r.d(t,"i",(function(){return Br})),r.d(t,"j",(function(){return Mr}));let n=Float32Array;function o(e,t,r){const o=new n(3);return e&&(o[0]=e),t&&(o[1]=t),r&&(o[2]=r),o}function l(a,b,e){return(e=e||new n(3))[0]=a[0]+b[0],e[1]=a[1]+b[1],e[2]=a[2]+b[2],e}function c(a,b,e){return(e=e||new n(3))[0]=a[0]*b[0],e[1]=a[1]*b[1],e[2]=a[2]*b[2],e}let f=Float32Array;function m(e){return(e=e||new f(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 d(e,t){t=t||new f(16);const r=e[0],n=e[1],o=e[2],l=e[3],c=e[4],m=e[5],d=e[6],y=e[7],h=e[8],x=e[9],v=e[10],w=e[11],F=e[12],A=e[13],E=e[14],P=e[15],T=v*P,S=E*w,R=d*P,z=E*y,I=d*w,C=v*y,M=o*P,k=E*l,U=o*w,B=v*l,O=o*y,L=d*l,D=h*A,_=F*x,$=c*A,j=F*m,W=c*x,V=h*m,N=r*A,G=F*n,H=r*x,Y=h*n,X=r*m,K=c*n,J=T*m+z*x+I*A-(S*m+R*x+C*A),Z=S*n+M*x+B*A-(T*n+k*x+U*A),Q=R*n+k*m+O*A-(z*n+M*m+L*A),ee=C*n+U*m+L*x-(I*n+B*m+O*x),te=1/(r*J+c*Z+h*Q+F*ee);return t[0]=te*J,t[1]=te*Z,t[2]=te*Q,t[3]=te*ee,t[4]=te*(S*c+R*h+C*F-(T*c+z*h+I*F)),t[5]=te*(T*r+k*h+U*F-(S*r+M*h+B*F)),t[6]=te*(z*r+M*c+L*F-(R*r+k*c+O*F)),t[7]=te*(I*r+B*c+O*h-(C*r+U*c+L*h)),t[8]=te*(D*y+j*w+W*P-(_*y+$*w+V*P)),t[9]=te*(_*l+N*w+Y*P-(D*l+G*w+H*P)),t[10]=te*($*l+G*y+X*P-(j*l+N*y+K*P)),t[11]=te*(V*l+H*y+K*w-(W*l+Y*y+X*w)),t[12]=te*($*v+V*E+_*d-(W*E+D*d+j*v)),t[13]=te*(H*E+D*o+G*v-(N*v+Y*E+_*o)),t[14]=te*(N*d+K*E+j*o-(X*E+$*o+G*d)),t[15]=te*(X*v+W*o+Y*d-(H*d+K*v+V*o)),t}function y(e,t,r){r=r||o();const n=t[0],l=t[1],c=t[2],f=n*e[3]+l*e[7]+c*e[11]+e[15];return r[0]=(n*e[0]+l*e[4]+c*e[8]+e[12])/f,r[1]=(n*e[1]+l*e[5]+c*e[9]+e[13])/f,r[2]=(n*e[2]+l*e[6]+c*e[10]+e[14])/f,r}function h(e,t,r){r=r||o();const n=t[0],l=t[1],c=t[2];return r[0]=n*e[0]+l*e[4]+c*e[8],r[1]=n*e[1]+l*e[5]+c*e[9],r[2]=n*e[2]+l*e[6]+c*e[10],r}const x=5120,v=5121,w=5122,F=5123,A=5124,E=5125,P=5126,T={};{const e=T;e[x]=Int8Array,e[5121]=Uint8Array,e[5122]=Int16Array,e[5123]=Uint16Array,e[A]=Int32Array,e[5125]=Uint32Array,e[5126]=Float32Array,e[32819]=Uint16Array,e[32820]=Uint16Array,e[33635]=Uint16Array,e[5131]=Uint16Array,e[33640]=Uint32Array,e[35899]=Uint32Array,e[35902]=Uint32Array,e[36269]=Uint32Array,e[34042]=Uint32Array}function S(e){if(e instanceof Int8Array)return x;if(e instanceof Uint8Array)return v;if(e instanceof Uint8ClampedArray)return v;if(e instanceof Int16Array)return w;if(e instanceof Uint16Array)return F;if(e instanceof Int32Array)return A;if(e instanceof Uint32Array)return E;if(e instanceof Float32Array)return P;throw new Error("unsupported typed array type")}function R(e){if(e===Int8Array)return x;if(e===Uint8Array)return v;if(e===Uint8ClampedArray)return v;if(e===Int16Array)return w;if(e===Uint16Array)return F;if(e===Int32Array)return A;if(e===Uint32Array)return E;if(e===Float32Array)return P;throw new Error("unsupported typed array type")}function z(e){const t=T[e];if(!t)throw new Error("unknown gl type");return t}const I="undefined"!=typeof SharedArrayBuffer?function(a){return a&&a.buffer&&(a.buffer instanceof ArrayBuffer||a.buffer instanceof SharedArrayBuffer)}:function(a){return a&&a.buffer&&a.buffer instanceof ArrayBuffer};function C(...e){console.error(...e)}function M(e,t){return"undefined"!=typeof WebGLRenderbuffer&&t instanceof WebGLRenderbuffer}function k(e,t){return"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture}const U=34962,B={attribPrefix:""};function O(e,t,r,n,o){e.bindBuffer(t,r),e.bufferData(t,n,o||35044)}function L(e,t,r,n){if(o=t,"undefined"!=typeof WebGLBuffer&&o instanceof WebGLBuffer)return t;var o;r=r||U;const l=e.createBuffer();return O(e,r,l,t,n),l}function D(e){return"indices"===e}function _(e){return e.length?e:e.data}const $=/coord|texture/i,j=/color|colour/i;function W(e,t){let r;if(r=$.test(e)?2:j.test(e)?4:3,t%r>0)throw new 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}function V(e,t){return e.numComponents||e.size||W(t,_(e).length)}function N(e,t){if(I(e))return e;if(I(e.data))return e.data;Array.isArray(e)&&(e={data:e});let r=e.type;return r||(r=D(t)?Uint16Array:Float32Array),new r(e.data)}function G(e,t){const r={};return Object.keys(t).forEach((function(n){if(!D(n)){const l=t[n],c=l.attrib||l.name||l.attribName||B.attribPrefix+n;if(l.value){if(!Array.isArray(l.value)&&!I(l.value))throw new Error("array.value is not array or typedarray");r[c]={value:l.value}}else{let t,f,m,d;if(l.buffer&&l.buffer instanceof WebGLBuffer)t=l.buffer,d=l.numComponents||l.size,f=l.type,m=l.normalize;else if("number"==typeof l||"number"==typeof l.data){const r=l.data||l,c=l.type||Float32Array,y=r*c.BYTES_PER_ELEMENT;f=R(c),m=void 0!==l.normalize?l.normalize:(o=c)===Int8Array||o===Uint8Array,d=l.numComponents||l.size||W(n,r),t=e.createBuffer(),e.bindBuffer(U,t),e.bufferData(U,y,l.drawType||35044)}else{const r=N(l,n);t=L(e,r,void 0,l.drawType),f=S(r),m=void 0!==l.normalize?l.normalize:function(e){return e instanceof Int8Array||e instanceof Uint8Array}(r),d=V(l,n)}r[c]={buffer:t,numComponents:d,type:f,normalize:m,stride:l.stride||0,offset:l.offset||0,divisor:void 0===l.divisor?void 0:l.divisor,drawType:l.drawType}}}var o})),e.bindBuffer(U,null),r}const H=["position","positions","a_position"];function Y(e,t,r){const n=G(e,t),o=Object.assign({},r||{});o.attribs=Object.assign({},r?r.attribs:{},n);const l=t.indices;if(l){const t=N(l,"indices");o.indices=L(e,t,34963),o.numElements=t.length,o.elementType=S(t)}else o.numElements||(o.numElements=function(e,t){let r,n;for(n=0;n<H.length&&(r=H[n],!(r in t))&&(r=B.attribPrefix+r,!(r in t));++n);n===H.length&&(r=Object.keys(t)[0]);const o=t[r];if(!o.buffer)return 1;e.bindBuffer(U,o.buffer);const l=e.getBufferParameter(U,34660);var c;e.bindBuffer(U,null);const f=l/(5120===(c=o.type)||5121===c?1:5122===c||5123===c?2:5124===c||5125===c||5126===c?4:0),m=o.numComponents||o.size,d=f/m;if(d%1!=0)throw new Error(`numComponents ${m} not correct for length ${length}`);return d}(e,o.attribs));return o}function X(e,t,r){const n="indices"===r?34963:U;return L(e,N(t,r),n)}function K(e,t){const r={};return Object.keys(t).forEach((function(n){r[n]=X(e,t[n],n)})),t.indices?(r.numElements=t.indices.length,r.elementType=S(N(t.indices))):r.numElements=function(e){let t,r;for(r=0;r<H.length&&(t=H[r],!(t in e));++r);r===H.length&&(t=Object.keys(e)[0]);const n=e[t],o=_(n).length;if(void 0===o)return 1;const l=V(n,t),c=o/l;if(o%l>0)throw new Error(`numComponents ${l} not correct for length ${o}`);return c}(t),r}function J(e,t){let cursor=0;return e.push=function(){for(let t=0;t<arguments.length;++t){const r=arguments[t];if(r instanceof Array||I(r))for(let t=0;t<r.length;++t)e[cursor++]=r[t];else e[cursor++]=r}},e.reset=function(e){cursor=e||0},e.numComponents=t,Object.defineProperty(e,"numElements",{get:function(){return this.length/this.numComponents|0}}),e}function Z(e,t,r){return J(new(r||Float32Array)(e*t),e)}function Q(e,t,r){const n=e.length,o=new Float32Array(3);for(let l=0;l<n;l+=3)r(t,[e[l],e[l+1],e[l+2]],o),e[l]=o[0],e[l+1]=o[1],e[l+2]=o[2]}function ee(e,t,r){r=r||o();const n=t[0],l=t[1],c=t[2];return r[0]=n*e[0]+l*e[1]+c*e[2],r[1]=n*e[4]+l*e[5]+c*e[6],r[2]=n*e[8]+l*e[9]+c*e[10],r}function te(e,t){return Q(e,t,h),e}function re(e,t){return Q(e,d(t),ee),e}function ne(e,t){return Q(e,t,y),e}function oe(e,t){return Object.keys(e).forEach((function(r){const n=e[r];r.indexOf("pos")>=0?ne(n,t):r.indexOf("tan")>=0||r.indexOf("binorm")>=0?te(n,t):r.indexOf("norm")>=0&&re(n,t)})),e}function ie(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 ae(e,t,r,n,o){e=e||1,t=t||1,r=r||1,n=n||1,o=o||m();const l=(r+1)*(n+1),c=Z(3,l),f=Z(3,l),d=Z(2,l);for(let o=0;o<=n;o++)for(let l=0;l<=r;l++){const u=l/r,m=o/n;c.push(e*u-.5*e,0,t*m-.5*t),f.push(0,1,0),d.push(u,m)}const y=r+1,h=Z(3,r*n*2,Uint16Array);for(let e=0;e<n;e++)for(let t=0;t<r;t++)h.push((e+0)*y+t,(e+1)*y+t,(e+0)*y+t+1),h.push((e+1)*y+t,(e+1)*y+t+1,(e+0)*y+t+1);return oe({position:c,normal:f,texcoord:d,indices:h},o)}function ue(e,t,r,n,o,l,c){if(t<=0||r<=0)throw new Error("subdivisionAxis and subdivisionHeight must be > 0");n=n||0,l=l||0;const f=(o=o||Math.PI)-n,m=(c=c||2*Math.PI)-l,d=(t+1)*(r+1),y=Z(3,d),h=Z(3,d),x=Z(2,d);for(let o=0;o<=r;o++)for(let c=0;c<=t;c++){const u=c/t,d=o/r,v=m*u+l,w=f*d+n,F=Math.sin(v),A=Math.cos(v),E=Math.sin(w),P=A*E,T=Math.cos(w),S=F*E;y.push(e*P,e*T,e*S),h.push(P,T,S),x.push(1-u,d)}const v=t+1,w=Z(3,t*r*2,Uint16Array);for(let e=0;e<t;e++)for(let t=0;t<r;t++)w.push((t+0)*v+e,(t+0)*v+e+1,(t+1)*v+e),w.push((t+1)*v+e,(t+0)*v+e+1,(t+1)*v+e+1);return{position:y,normal:h,texcoord:x,indices:w}}const se=[[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 le(e){const t=(e=e||1)/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]],l=Z(3,24),c=Z(3,24),f=Z(2,24),m=Z(3,12,Uint16Array);for(let e=0;e<6;++e){const t=se[e];for(let m=0;m<4;++m){const d=r[t[m]],y=n[e],h=o[m];l.push(d),c.push(y),f.push(h)}const d=4*e;m.push(d+0,d+1,d+2),m.push(d+0,d+2,d+3)}return{position:l,normal:c,texcoord:f,indices:m}}function ce(e,t,r,n,o,l,c){if(n<3)throw new Error("radialSubdivisions must be 3 or greater");if(o<1)throw new Error("verticalSubdivisions must be 1 or greater");const f=void 0===l||l,m=void 0===c||c,d=(f?2:0)+(m?2:0),y=(n+1)*(o+1+d),h=Z(3,y),x=Z(3,y),v=Z(2,y),w=Z(3,n*(o+d/2)*2,Uint16Array),F=n+1,A=Math.atan2(e-t,r),E=Math.cos(A),P=Math.sin(A),T=o+(m?2:0);for(let l=f?-2:0;l<=T;++l){let c,f=l/o,m=r*f;l<0?(m=0,f=1,c=e):l>o?(m=r,f=1,c=t):c=e+l/o*(t-e),-2!==l&&l!==o+2||(c=0,f=0),m-=r/2;for(let e=0;e<F;++e){const t=Math.sin(e*Math.PI*2/n),r=Math.cos(e*Math.PI*2/n);h.push(t*c,m,r*c),l<0?x.push(0,-1,0):l>o?x.push(0,1,0):0===c?x.push(0,0,0):x.push(t*E,P,r*E),v.push(e/n,1-f)}}for(let e=0;e<o+d;++e)if(!(1===e&&f||e===o+d-2&&m))for(let t=0;t<n;++t)w.push(F*(e+0)+0+t,F*(e+0)+1+t,F*(e+1)+1+t),w.push(F*(e+0)+0+t,F*(e+1)+1+t,F*(e+1)+0+t);return{position:h,normal:x,texcoord:v,indices:w}}function fe(e,t){t=t||[];const data=[];for(let r=0;r<e.length;r+=4){const n=e[r],element=e.slice(r+1,r+4);element.push.apply(element,t);for(let e=0;e<n;++e)data.push.apply(data,element)}return data}function me(){const 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=fe([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=fe([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:Z(3,n),texcoord:Z(2,n),normal:Z(3,n),color:Z(4,n,Uint8Array),indices:Z(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 e=0;e<n;++e)o.indices.push(e);return o}function de(e,t,r,n,o,f,m){if(o<=0)throw new Error("subdivisionDown must be > 0");const d=(m=m||1)-(f=f||0),y=2*(o+1)*4,h=Z(3,y),x=Z(3,y),v=Z(2,y);function w(a,b,s){return a+(b-a)*s}function F(t,r,m,y,F,A){for(let E=0;E<=o;E++){const P=r/1,T=E/o,S=2*(P-.5),R=(f+T*d)*Math.PI,s=Math.sin(R),z=Math.cos(R),I=w(e,t,s),C=S*n,M=z*e,k=s*I;h.push(C,M,k);const U=l(c([0,s,z],m),y);x.push(U),v.push(P*F+A,T)}}for(let e=0;e<2;e++){const n=2*(e/1-.5);F(t,e,[1,1,1],[0,0,0],1,0),F(t,e,[0,0,0],[n,0,0],0,0),F(r,e,[1,1,1],[0,0,0],1,0),F(r,e,[0,0,0],[n,0,0],0,1)}const A=Z(3,2*o*4,Uint16Array);function E(e,t){for(let r=0;r<o;++r)A.push(e+r+0,e+r+1,t+r+0),A.push(e+r+1,t+r+1,t+r+0)}const P=o+1;return E(0*P,4*P),E(5*P,7*P),E(6*P,2*P),E(3*P,1*P),{position:h,normal:x,texcoord:v,indices:A}}function ye(e,t,r,n,o,l){return ce(e,e,t,r,n,o,l)}function be(e,t,r,n,o,l){if(r<3)throw new Error("radialSubdivisions must be 3 or greater");if(n<3)throw new Error("verticalSubdivisions must be 3 or greater");o=o||0;const c=(l=l||2*Math.PI)-o,f=r+1,m=n+1,d=f*m,y=Z(3,d),h=Z(3,d),x=Z(2,d),v=Z(3,r*n*2,Uint16Array);for(let l=0;l<m;++l){const m=l/n,d=m*Math.PI*2,v=Math.sin(d),w=e+v*t,F=Math.cos(d),A=F*t;for(let e=0;e<f;++e){const u=e/r,t=o+u*c,n=Math.sin(t),l=Math.cos(t),f=n*w,d=l*w,E=n*v,P=l*v;y.push(f,A,d),h.push(E,F,P),x.push(u,1-m)}}for(let e=0;e<n;++e)for(let t=0;t<r;++t){const r=1+t,n=1+e;v.push(f*e+t,f*n+t,f*e+r),v.push(f*n+t,f*n+r,f*e+r)}return{position:y,normal:h,texcoord:x,indices:v}}function pe(e,t,r,n,o){if(t<3)throw new Error("divisions must be at least 3");o=o||1,n=n||0;const l=(t+1)*((r=r||1)+1),c=Z(3,l),f=Z(3,l),m=Z(2,l),d=Z(3,r*t*2,Uint16Array);let y=0;const h=e-n,x=t+1;for(let e=0;e<=r;++e){const l=n+h*Math.pow(e/r,o);for(let i=0;i<=t;++i){const n=2*Math.PI*i/t,o=l*Math.cos(n),h=l*Math.sin(n);if(c.push(o,0,h),f.push(0,1,0),m.push(1-i/t,e/r),e>0&&i!==t){const a=y+(i+1),b=y+i,e=y+i-x,t=y+(i+1)-x;d.push(a,b,e),d.push(a,e,t)}}y+=t+1}return{position:c,normal:f,texcoord:m,indices:d}}function he(e){return function(t){const r=e.apply(this,Array.prototype.slice.call(arguments,1));return K(t,r)}}function xe(e){return function(t){const r=e.apply(null,Array.prototype.slice.call(arguments,1));return Y(t,r)}}xe(me),he(me),xe(le),he(le),xe(ae),he(ae),xe(ue),he(ue),xe(ce),he(ce),xe(ie),he(ie),xe(de),he(de),xe(ye),he(ye),xe(be),he(be),xe(pe),he(pe);function ge(e){return!!e.texStorage2D}const ve=function(){const e={},t={};return function(r,n){return function(r){const n=r.constructor.name;if(!e[n]){for(const e in r)if("number"==typeof r[e]){const n=t[r[e]];t[r[e]]=n?`${n} | ${e}`:e}e[n]=!0}}(r),t[n]||("number"==typeof n?`0x${n.toString(16)}`:n)}}();const we={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},Fe=I,Ae=function(){let e;return function(){return e=e||("undefined"!=typeof document&&document.createElement?document.createElement("canvas").getContext("2d"):null),e}}(),Ee=6406,Pe=6407,Te=6408,Se=6409,Re=6410,ze=6402,Ie=34041,Ce=33071,Me=3553,ke=34067,Ue=32879,Be=35866,Oe=34069,Le=10241,De=10240,_e=10242,$e=10243,je=3317,We=5120,Ve=5121,Ne=5122,Ge=5123,He=5124,Ye=5125,Xe=5126,Ke=5131,qe=36193,Je=33640,Ze=33319,Qe=33320,et=6403,tt=36244,nt=36248,ot=36249,it={};{const e=it;e[6406]={numColorComponents:1},e[6409]={numColorComponents:1},e[6410]={numColorComponents:2},e[Pe]={numColorComponents:3},e[Te]={numColorComponents:4},e[et]={numColorComponents:1},e[36244]={numColorComponents:1},e[Ze]={numColorComponents:2},e[33320]={numColorComponents:2},e[Pe]={numColorComponents:3},e[36248]={numColorComponents:3},e[Te]={numColorComponents:4},e[36249]={numColorComponents:4},e[6402]={numColorComponents:1},e[34041]={numColorComponents:2}}let at;function ut(e){if(!at){const e={};e[6406]={textureFormat:Ee,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Ve,Ke,qe,Xe]},e[6409]={textureFormat:Se,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Ve,Ke,qe,Xe]},e[6410]={textureFormat:Re,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[Ve,Ke,qe,Xe]},e[Pe]={textureFormat:Pe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[Ve,Ke,qe,Xe,33635]},e[Te]={textureFormat:Te,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[Ve,Ke,qe,Xe,32819,32820]},e[6402]={textureFormat:ze,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ye,Ge]},e[33321]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[Ve]},e[36756]={textureFormat:et,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[We]},e[33325]={textureFormat:et,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[Xe,Ke]},e[33326]={textureFormat:et,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[Xe]},e[33330]={textureFormat:tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Ve]},e[33329]={textureFormat:tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[We]},e[33332]={textureFormat:tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ge]},e[33331]={textureFormat:tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ne]},e[33334]={textureFormat:tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ye]},e[33333]={textureFormat:tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[He]},e[33323]={textureFormat:Ze,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[Ve]},e[36757]={textureFormat:Ze,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[We]},e[33327]={textureFormat:Ze,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[Xe,Ke]},e[33328]={textureFormat:Ze,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[Xe]},e[33336]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ve]},e[33335]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[We]},e[33338]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ge]},e[33337]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ne]},e[33340]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ye]},e[33339]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[He]},e[32849]={textureFormat:Pe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[Ve]},e[35905]={textureFormat:Pe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Ve]},e[36194]={textureFormat:Pe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[Ve,33635]},e[36758]={textureFormat:Pe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[We]},e[35898]={textureFormat:Pe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Xe,Ke,35899]},e[35901]={textureFormat:Pe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Xe,Ke,35902]},e[34843]={textureFormat:Pe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[Xe,Ke]},e[34837]={textureFormat:Pe,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Xe]},e[36221]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Ve]},e[36239]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[We]},e[36215]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Ge]},e[36233]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Ne]},e[36209]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ye]},e[36227]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[He]},e[32856]={textureFormat:Te,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Ve]},e[35907]={textureFormat:Te,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Ve]},e[36759]={textureFormat:Te,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[We]},e[32855]={textureFormat:Te,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[Ve,32820,Je]},e[32854]={textureFormat:Te,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[Ve,32819]},e[32857]={textureFormat:Te,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Je]},e[34842]={textureFormat:Te,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[Xe,Ke]},e[34836]={textureFormat:Te,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[Xe]},e[36220]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ve]},e[36238]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[We]},e[36975]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Je]},e[36214]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ge]},e[36232]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ne]},e[36226]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[He]},e[36208]={textureFormat:ot,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ye]},e[33189]={textureFormat:ze,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ge,Ye]},e[33190]={textureFormat:ze,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ye]},e[36012]={textureFormat:ze,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Xe]},e[35056]={textureFormat:Ie,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[34042]},e[36013]={textureFormat:Ie,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[36269]},Object.keys(e).forEach((function(t){const r=e[t];r.bytesPerElementMap={},r.bytesPerElement.forEach((function(e,t){const n=r.type[t];r.bytesPerElementMap[n]=e}))})),at=e}return at[e]}function st(e,t){const r=ut(e);if(!r)throw"unknown internal format";const n=r.bytesPerElementMap[t];if(void 0===n)throw"unknown internal format";return n}function lt(e){const t=ut(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function ct(e){return 0==(e&e-1)}function ft(e,t,r,n){if(!ge(e))return ct(t)&&ct(r);const o=ut(n);if(!o)throw"unknown internal format";return o.colorRenderable&&o.textureFilterable}function mt(e){const t=ut(e);if(!t)throw"unknown internal format";return t.textureFilterable}function yt(e,t,r){return Fe(t)?S(t):r||Ve}function bt(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{const e=Math.sqrt(o/(t===ke?6:1));e%1==0?(r=e,n=e):(r=o,n=1)}return{width:r,height:n}}function pt(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 ht(e){e.pixelStorei(je,4),ge(e)&&(e.pixelStorei(3314,0),e.pixelStorei(32878,0),e.pixelStorei(3316,0),e.pixelStorei(3315,0),e.pixelStorei(32877,0))}function xt(e,t,r,n){var o;n.minMag&&(r.call(e,t,Le,n.minMag),r.call(e,t,De,n.minMag)),n.min&&r.call(e,t,Le,n.min),n.mag&&r.call(e,t,De,n.mag),n.wrap&&(r.call(e,t,_e,n.wrap),r.call(e,t,$e,n.wrap),(t===Ue||(o=t,"undefined"!=typeof WebGLSampler&&o instanceof WebGLSampler))&&r.call(e,t,32882,n.wrap)),n.wrapR&&r.call(e,t,32882,n.wrapR),n.wrapS&&r.call(e,t,_e,n.wrapS),n.wrapT&&r.call(e,t,$e,n.wrapT),n.minLod&&r.call(e,t,33082,n.minLod),n.maxLod&&r.call(e,t,33083,n.maxLod),n.baseLevel&&r.call(e,t,33084,n.baseLevel),n.maxLevel&&r.call(e,t,33085,n.maxLevel)}function gt(e,t,r){const n=r.target||Me;e.bindTexture(n,t),xt(e,n,e.texParameteri,r)}function vt(e,t,r,n,o,l){r=r||we.textureOptions,l=l||Te;const c=r.target||Me;if(n=n||r.width,o=o||r.height,e.bindTexture(c,t),ft(e,n,o,l))e.generateMipmap(c);else{const t=mt(l)?9729:9728;e.texParameteri(c,Le,t),e.texParameteri(c,De,t),e.texParameteri(c,_e,Ce),e.texParameteri(c,$e,Ce)}}function wt(e){return!0===e.auto||void 0===e.auto&&void 0===e.level}function Ft(e,t){return(t=t||{}).cubeFaceOrder||[Oe,34070,34071,34072,34073,34074]}function At(e,t){const r=Ft(0,t).map((function(e,t){return{face:e,ndx:t}}));return r.sort((function(a,b){return a.face-b.face})),r}function Et(e,t,element,r){const n=(r=r||we.textureOptions).target||Me,o=r.level||0;let l=element.width,c=element.height;const f=r.internalFormat||r.format||Te,m=lt(f),d=r.format||m.format,y=r.type||m.type;if(pt(e,r),e.bindTexture(n,t),n===ke){const m=element.width,h=element.height;let x,v;if(m/6===h)x=h,v=[0,0,1,0,2,0,3,0,4,0,5,0];else if(h/6===m)x=m,v=[0,0,0,1,0,2,0,3,0,4,0,5];else if(m/3==h/2)x=m/3,v=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(m/2!=h/3)throw"can't figure out cube map from element: "+(element.src?element.src:element.nodeName);x=m/2,v=[0,0,1,0,0,1,1,1,0,2,1,2]}const w=Ae();w?(w.canvas.width=x,w.canvas.height=x,l=x,c=x,At(0,r).forEach((function(t){const r=v[2*t.ndx+0]*x,n=v[2*t.ndx+1]*x;w.drawImage(element,r,n,x,x,0,0,x,x),e.texImage2D(t.face,o,f,d,y,w.canvas)})),w.canvas.width=1,w.canvas.height=1):"undefined"!=typeof createImageBitmap&&(l=x,c=x,At(0,r).forEach((function(m){const h=v[2*m.ndx+0]*x,w=v[2*m.ndx+1]*x;e.texImage2D(m.face,o,f,x,x,0,d,y,null),createImageBitmap(element,h,w,x,x,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(h){pt(e,r),e.bindTexture(n,t),e.texImage2D(m.face,o,f,d,y,h),wt(r)&&vt(e,t,r,l,c,f)}))})))}else if(n===Ue||n===Be){const t=Math.min(element.width,element.height),r=Math.max(element.width,element.height),l=r/t;if(l%1!=0)throw"can not compute 3D dimensions of element";const c=element.width===r?1:0,m=element.height===r?1:0;e.pixelStorei(je,1),e.pixelStorei(3314,element.width),e.pixelStorei(32878,0),e.pixelStorei(32877,0),e.texImage3D(n,o,f,t,t,t,0,d,y,null);for(let r=0;r<l;++r){const l=r*t*c,f=r*t*m;e.pixelStorei(3316,l),e.pixelStorei(3315,f),e.texSubImage3D(n,o,0,0,r,t,t,1,d,y,element)}ht(e)}else e.texImage2D(n,o,f,d,y,element);wt(r)&&vt(e,t,r,l,c,f),gt(e,t,r)}function Pt(){}function Tt(e,t){return void 0!==t||function(e){if("undefined"!=typeof document){const a=document.createElement("a");return a.href=e,a.hostname===location.hostname&&a.port===location.port&&a.protocol===location.protocol}{const t=new URL(location.href).origin;return new URL(e,location.href).origin===t}}(e)?t:"anonymous"}function St(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof ImageData&&e instanceof ImageData||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function Rt(e,t,r){return St(e)?(setTimeout((function(){r(null,e)})),e):function(e,t,r){let img;if(r=r||Pt,t=void 0!==t?t:we.crossOrigin,t=Tt(e,t),"undefined"!=typeof Image){img=new Image,void 0!==t&&(img.crossOrigin=t);const n=function(){img.removeEventListener("error",o),img.removeEventListener("load",l),img=null},o=function(){const t="couldn't load image: "+e;C(t),r(t,img),n()},l=function(){r(null,img),n()};return img.addEventListener("error",o),img.addEventListener("load",l),img.src=e,img}if("undefined"!=typeof ImageBitmap){let n,o;const l=function(){r(n,o)},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){o=e,setTimeout(l)})).catch((function(e){n=e,setTimeout(l)})),img=null}return img}(e,t,r)}function zt(e,t,r){const n=(r=r||we.textureOptions).target||Me;if(e.bindTexture(n,t),!1===r.color)return;const o=function(e){return e=e||we.textureColor,Fe(e)?e:new Uint8Array([255*e[0],255*e[1],255*e[2],255*e[3]])}(r.color);if(n===ke)for(let t=0;t<6;++t)e.texImage2D(Oe+t,0,Te,1,1,0,Te,Ve,o);else n===Ue||n===Be?e.texImage3D(n,0,Te,1,1,1,0,Te,Ve,o):e.texImage2D(n,0,Te,1,1,0,Te,Ve,o)}function It(e,t,r,n){n=n||Pt,r=r||we.textureOptions,zt(e,t,r);return Rt((r=Object.assign({},r)).src,r.crossOrigin,(function(o,img){o?n(o,t,img):(Et(e,t,img,r),n(null,t,img))}))}function Ct(e,t,r,n){n=n||Pt;const o=r.src;if(6!==o.length)throw"there must be 6 urls for a cubemap";const l=r.level||0,c=r.internalFormat||r.format||Te,f=lt(c),m=r.format||f.format,d=r.type||Ve,y=r.target||Me;if(y!==ke)throw"target must be TEXTURE_CUBE_MAP";zt(e,t,r),r=Object.assign({},r);let h=6;const x=[],v=Ft(0,r);let w;w=o.map((function(o,f){return Rt(o,r.crossOrigin,(F=v[f],function(o,img){--h,o?x.push(o):img.width!==img.height?x.push("cubemap face img is not a square: "+img.src):(pt(e,r),e.bindTexture(y,t),5===h?Ft().forEach((function(t){e.texImage2D(t,l,c,m,d,img)})):e.texImage2D(F,l,c,m,d,img),wt(r)&&e.generateMipmap(y)),0===h&&n(x.length?x:void 0,t,w)}));var F}))}function Mt(e,t,r,n){n=n||Pt;const o=r.src,l=r.internalFormat||r.format||Te,c=lt(l),f=r.format||c.format,m=r.type||Ve,d=r.target||Be;if(d!==Ue&&d!==Be)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";zt(e,t,r),r=Object.assign({},r);let y=o.length;const h=[];let x;const v=r.level||0;let w=r.width,F=r.height;const A=o.length;let E=!0;x=o.map((function(o,c){return Rt(o,r.crossOrigin,(P=c,function(o,img){if(--y,o)h.push(o);else{if(pt(e,r),e.bindTexture(d,t),E){E=!1,w=r.width||img.width,F=r.height||img.height,e.texImage3D(d,v,l,w,F,A,0,f,m,null);for(let s=0;s<A;++s)e.texSubImage3D(d,v,0,0,s,w,F,1,f,m,img)}else{let t,r=img;img.width===w&&img.height===F||(t=Ae(),r=t.canvas,t.canvas.width=w,t.canvas.height=F,t.drawImage(img,0,0,w,F)),e.texSubImage3D(d,v,0,0,P,w,F,1,f,m,r),t&&r===t.canvas&&(t.canvas.width=0,t.canvas.height=0)}wt(r)&&e.generateMipmap(d)}0===y&&n(h.length?h:void 0,t,x)}));var P}))}function kt(e,t,r,n){const o=(n=n||we.textureOptions).target||Me;e.bindTexture(o,t);let l=n.width,c=n.height,f=n.depth;const m=n.level||0,d=n.internalFormat||n.format||Te,y=lt(d),h=n.format||y.format,x=n.type||yt(0,r,y.type);if(Fe(r))r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));else{const e=z(x);r=new e(r)}const v=st(d,x),w=r.byteLength/v;if(w%1)throw"length wrong size for format: "+ve(e,h);let F;if(o===Ue||o===Be)if(l||c||f)!l||c&&f?!c||l&&f?(F=bt(0,o,l,c,w/f),l=F.width,c=F.height):(F=bt(0,o,l,f,w/c),l=F.width,f=F.height):(F=bt(0,o,c,f,w/l),c=F.width,f=F.height);else{const e=Math.cbrt(w);if(e%1!=0)throw"can't guess cube size of array of numElements: "+w;l=e,c=e,f=e}else F=bt(0,o,l,c,w),l=F.width,c=F.height;if(ht(e),e.pixelStorei(je,n.unpackAlignment||1),pt(e,n),o===ke){const t=w/6*(v/r.BYTES_PER_ELEMENT);At(0,n).forEach((n=>{const o=t*n.ndx,data=r.subarray(o,o+t);e.texImage2D(n.face,m,d,l,c,0,h,x,data)}))}else o===Ue||o===Be?e.texImage3D(o,m,d,l,c,f,0,h,x,r):e.texImage2D(o,m,d,l,c,0,h,x,r);return{width:l,height:c,depth:f,type:x}}function Ut(e,t,r){const n=r.target||Me;e.bindTexture(n,t);const o=r.level||0,l=r.internalFormat||r.format||Te,c=lt(l),f=r.format||c.format,m=r.type||c.type;if(pt(e,r),n===ke)for(let t=0;t<6;++t)e.texImage2D(Oe+t,o,l,r.width,r.height,0,f,m,null);else n===Ue||n===Be?e.texImage3D(n,o,l,r.width,r.height,r.depth,0,f,m,null):e.texImage2D(n,o,l,r.width,r.height,0,f,m,null)}function Bt(e,t,r){r=r||Pt,t=t||we.textureOptions;const n=e.createTexture(),o=t.target||Me;let l=t.width||1,c=t.height||1;const f=t.internalFormat||Te;e.bindTexture(o,n),o===ke&&(e.texParameteri(o,_e,Ce),e.texParameteri(o,$e,Ce));let m=t.src;if(m)if("function"==typeof m&&(m=m(e,t)),"string"==typeof m)It(e,n,t,r);else if(Fe(m)||Array.isArray(m)&&("number"==typeof m[0]||Array.isArray(m[0])||Fe(m[0]))){const r=kt(e,n,m,t);l=r.width,c=r.height}else Array.isArray(m)&&("string"==typeof m[0]||St(m[0]))?o===ke?Ct(e,n,t,r):Mt(e,n,t,r):(Et(e,n,m,t),l=m.width,c=m.height);else Ut(e,n,t);return wt(t)&&vt(e,n,t,l,c,f),gt(e,n,t),n}function Ot(e,t,r,n,o,l){n=n||r.width,o=o||r.height,l=l||r.depth;const c=r.target||Me;e.bindTexture(c,t);const f=r.level||0,m=r.internalFormat||r.format||Te,d=lt(m),y=r.format||d.format;let h;const x=r.src;if(h=x&&(Fe(x)||Array.isArray(x)&&"number"==typeof x[0])?r.type||yt(0,x,d.type):r.type||d.type,c===ke)for(let t=0;t<6;++t)e.texImage2D(Oe+t,f,m,n,o,0,y,h,null);else c===Ue||c===Be?e.texImage3D(c,f,m,n,o,l,0,y,h,null):e.texImage2D(c,f,m,n,o,0,y,h,null)}function Lt(e,t,r){r=r||Pt;let n=0;const o=[],l={},c={};function f(){0===n&&setTimeout((function(){r(o.length?o:void 0,l,c)}),0)}return Object.keys(t).forEach((function(r){const m=t[r];let d;var y;("string"==typeof(y=m.src)||Array.isArray(y)&&"string"==typeof y[0])&&(d=function(e,t,img){c[r]=img,--n,e&&o.push(e),f()},++n),l[r]=Bt(e,m,d)})),f(),l}const Dt=C;function _t(e){return"undefined"!=typeof document&&document.getElementById?document.getElementById(e):null}const $t=33984,jt=34962,Wt=5126,Vt=5124,Nt=5125,Gt=3553,Ht=34067,Yt=32879,Xt=35866,Kt={};function qt(e,t){return Kt[t].bindPoint}function Jt(e,t){return function(r){e.uniform1i(t,r)}}function Zt(e,t){return function(r){e.uniform1iv(t,r)}}function Qt(e,t){return function(r){e.uniform2iv(t,r)}}function er(e,t){return function(r){e.uniform3iv(t,r)}}function rr(e,t){return function(r){e.uniform4iv(t,r)}}function nr(e,t,r,n){const o=qt(0,t);return ge(e)?function(t){let l,c;k(0,t)?(l=t,c=null):(l=t.texture,c=t.sampler),e.uniform1i(n,r),e.activeTexture($t+r),e.bindTexture(o,l),e.bindSampler(r,c)}:function(t){e.uniform1i(n,r),e.activeTexture($t+r),e.bindTexture(o,t)}}function or(e,t,r,n,o){const l=qt(0,t),c=new Int32Array(o);for(let e=0;e<o;++e)c[e]=r+e;return ge(e)?function(t){e.uniform1iv(n,c),t.forEach((function(t,n){let o,f;e.activeTexture($t+c[n]),k(0,t)?(o=t,f=null):(o=t.texture,f=t.sampler),e.bindSampler(r,f),e.bindTexture(l,o)}))}:function(t){e.uniform1iv(n,c),t.forEach((function(t,r){e.activeTexture($t+c[r]),e.bindTexture(l,t)}))}}function ir(e,t){return function(b){if(b.value)switch(e.disableVertexAttribArray(t),b.value.length){case 4:e.vertexAttrib4fv(t,b.value);break;case 3:e.vertexAttrib3fv(t,b.value);break;case 2:e.vertexAttrib2fv(t,b.value);break;case 1:e.vertexAttrib1fv(t,b.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(jt,b.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,b.numComponents||b.size,b.type||Wt,b.normalize||!1,b.stride||0,b.offset||0),void 0!==b.divisor&&e.vertexAttribDivisor(t,b.divisor)}}function ar(e,t){return function(b){if(b.value){if(e.disableVertexAttribArray(t),4!==b.value.length)throw new Error("The length of an integer constant value must be 4!");e.vertexAttrib4iv(t,b.value)}else e.bindBuffer(jt,b.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,b.numComponents||b.size,b.type||Vt,b.stride||0,b.offset||0),void 0!==b.divisor&&e.vertexAttribDivisor(t,b.divisor)}}function ur(e,t){return function(b){if(b.value){if(e.disableVertexAttribArray(t),4!==b.value.length)throw new Error("The length of an unsigned integer constant value must be 4!");e.vertexAttrib4uiv(t,b.value)}else e.bindBuffer(jt,b.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,b.numComponents||b.size,b.type||Nt,b.stride||0,b.offset||0),void 0!==b.divisor&&e.vertexAttribDivisor(t,b.divisor)}}function sr(e,t,r){const n=r.size,o=r.count;return function(b){e.bindBuffer(jt,b.buffer);const r=b.size||b.numComponents||n,l=r/o,c=b.type||Wt,f=Kt[c].size*r,m=b.normalize||!1,d=b.offset||0,y=f/o;for(let i=0;i<o;++i)e.enableVertexAttribArray(t+i),e.vertexAttribPointer(t+i,l,c,m,f,d+y*i),void 0!==b.divisor&&e.vertexAttribDivisor(t+i,b.divisor)}}Kt[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)}}},Kt[35664]={Type:Float32Array,size:8,setter:function(e,t){return function(r){e.uniform2fv(t,r)}},cols:2},Kt[35665]={Type:Float32Array,size:12,setter:function(e,t){return function(r){e.uniform3fv(t,r)}},cols:3},Kt[35666]={Type:Float32Array,size:16,setter:function(e,t){return function(r){e.uniform4fv(t,r)}},cols:4},Kt[5124]={Type:Int32Array,size:4,setter:Jt,arraySetter:Zt},Kt[35667]={Type:Int32Array,size:8,setter:Qt,cols:2},Kt[35668]={Type:Int32Array,size:12,setter:er,cols:3},Kt[35669]={Type:Int32Array,size:16,setter:rr,cols:4},Kt[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)}}},Kt[36294]={Type:Uint32Array,size:8,setter:function(e,t){return function(r){e.uniform2uiv(t,r)}},cols:2},Kt[36295]={Type:Uint32Array,size:12,setter:function(e,t){return function(r){e.uniform3uiv(t,r)}},cols:3},Kt[36296]={Type:Uint32Array,size:16,setter:function(e,t){return function(r){e.uniform4uiv(t,r)}},cols:4},Kt[35670]={Type:Uint32Array,size:4,setter:Jt,arraySetter:Zt},Kt[35671]={Type:Uint32Array,size:8,setter:Qt,cols:2},Kt[35672]={Type:Uint32Array,size:12,setter:er,cols:3},Kt[35673]={Type:Uint32Array,size:16,setter:rr,cols:4},Kt[35674]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2fv(t,!1,r)}},rows:2,cols:2},Kt[35675]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3fv(t,!1,r)}},rows:3,cols:3},Kt[35676]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4fv(t,!1,r)}},rows:4,cols:4},Kt[35685]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2x3fv(t,!1,r)}},rows:2,cols:3},Kt[35686]={Type:Float32Array,size:32,setter:function(e,t){return function(r){e.uniformMatrix2x4fv(t,!1,r)}},rows:2,cols:4},Kt[35687]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3x2fv(t,!1,r)}},rows:3,cols:2},Kt[35688]={Type:Float32Array,size:48,setter:function(e,t){return function(r){e.uniformMatrix3x4fv(t,!1,r)}},rows:3,cols:4},Kt[35689]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4x2fv(t,!1,r)}},rows:4,cols:2},Kt[35690]={Type:Float32Array,size:64,setter:function(e,t){return function(r){e.uniformMatrix4x3fv(t,!1,r)}},rows:4,cols:3},Kt[35678]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Gt},Kt[35680]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Ht},Kt[35679]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Yt},Kt[35682]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Gt},Kt[36289]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Xt},Kt[36292]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Xt},Kt[36293]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Ht},Kt[36298]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Gt},Kt[36299]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Yt},Kt[36300]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Ht},Kt[36303]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Xt},Kt[36306]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Gt},Kt[36307]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Yt},Kt[36308]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Ht},Kt[36311]={Type:null,size:0,setter:nr,arraySetter:or,bindPoint:Xt};const lr={};lr[5126]={size:4,setter:ir},lr[35664]={size:8,setter:ir},lr[35665]={size:12,setter:ir},lr[35666]={size:16,setter:ir},lr[5124]={size:4,setter:ar},lr[35667]={size:8,setter:ar},lr[35668]={size:12,setter:ar},lr[35669]={size:16,setter:ar},lr[5125]={size:4,setter:ur},lr[36294]={size:8,setter:ur},lr[36295]={size:12,setter:ur},lr[36296]={size:16,setter:ur},lr[35670]={size:4,setter:ar},lr[35671]={size:8,setter:ar},lr[35672]={size:12,setter:ar},lr[35673]={size:16,setter:ar},lr[35674]={size:4,setter:sr,count:2},lr[35675]={size:9,setter:sr,count:3},lr[35676]={size:16,setter:sr,count:4};const cr=/ERROR:\s*\d+:(\d+)/gi;const fr=/^[ \t]*\n/;function mr(e){let t=0;return fr.test(e)&&(t=1,e=e.replace(fr,"")),{lineOffset:t,shaderSource:e}}function dr(e,t){return e.errorCallback(t),e.callback&&setTimeout((()=>{e.callback(`${t}\n${e.errors.join("\n")}`)})),null}function yr(e,t,r,n){const o=e.createShader(r);return e.shaderSource(o,mr(t).shaderSource),e.compileShader(o),n.callback||function(e,t,r,n){n=n||Dt;const o=e.getShaderParameter(r,35713);if(!o){const o=e.getShaderInfoLog(r),{lineOffset:l,shaderSource:c}=mr(e.getShaderSource(r));n(`${function(e,t="",r=0){const n=[...t.matchAll(cr)],o=new Map(n.map(((e,r)=>{const o=parseInt(e[1]),l=n[r+1],c=l?l.index:t.length;return[o-1,t.substring(e.index,c)]})));return e.split("\n").map(((line,e)=>{const t=o.get(e);return`${e+1+r}: ${line}${t?`\n\n^^^ ${t}`:""}`})).join("\n")}(c,o,l)}\nError compiling ${ve(e,t)}: ${o}`)}return o}(e,r,o,n.errorCallback)?o:(e.deleteShader(o),null)}function pr(e,t,r){let n,o,l;if("function"==typeof t&&(r=t,t=void 0),"function"==typeof e)r=e,e=void 0;else if(e&&!Array.isArray(e)){if(e.errorCallback&&e.errors)return e;const t=e;r=t.errorCallback,e=t.attribLocations,n=t.transformFeedbackVaryings,o=t.transformFeedbackMode,l=t.callback}const c=r||Dt,f=[],m={errorCallback(e,...t){f.push(e),c(e,...t)},transformFeedbackVaryings:n,transformFeedbackMode:o,callback:l,errors:f};if(e){let r={};Array.isArray(e)?e.forEach((function(e,n){r[e]=t?t[n]:n})):r=e,m.attribLocations=r}return m}const xr=["VERTEX_SHADER","FRAGMENT_SHADER"];function gr(e,t){return t.indexOf("frag")>=0?35632:t.indexOf("vert")>=0?35633:void 0}function vr(e,t){t.forEach((function(t){e.deleteShader(t)}))}const wr=(e=0)=>new Promise((t=>setTimeout(t,e)));function Fr(e,t,r,n,o){const l=pr(r,n,o),c=[],f=[];for(let r=0;r<t.length;++r){let n=t[r];if("string"==typeof n){const t=_t(n),o=t?t.text:n;let c=e[xr[r]];t&&t.type&&(c=gr(0,t.type)||c),n=yr(e,o,c,l),f.push(n)}m=n,"undefined"!=typeof WebGLShader&&m instanceof WebGLShader&&c.push(n)}var m;if(c.length!==t.length)return vr(e,f),dr(l,"not enough shaders for program");const d=e.createProgram();c.forEach((function(t){e.attachShader(d,t)})),l.attribLocations&&Object.keys(l.attribLocations).forEach((function(t){e.bindAttribLocation(d,l.attribLocations[t],t)}));let y=l.transformFeedbackVaryings;return y&&(y.attribs&&(y=y.attribs),Array.isArray(y)||(y=Object.keys(y)),e.transformFeedbackVaryings(d,y,l.transformFeedbackMode||35981)),e.linkProgram(d),l.callback?(async function(e,t,r){const n=e.getExtension("KHR_parallel_shader_compile"),o=n?(e,t)=>e.getProgramParameter(t,n.COMPLETION_STATUS_KHR):()=>!0;let l=0;do{await wr(l),l=1e3/60}while(!o(e,t));const c=Ar(e,t,r.errorCallback),f=c?void 0:r.errors.join("\n");if(!c){(r.errorCallback||Dt)(f),e.deleteProgram(t),t=null}r.callback(f,t)}(e,d,l),null):Ar(e,d,l.errorCallback)?d:(e.deleteProgram(d),vr(e,f),null)}function Ar(e,t,r){r=r||Dt;const n=e.getProgramParameter(t,35714);if(!n){r(`Error in program linking: ${e.getProgramInfoLog(t)}`)}return n}function Er(e,t,r,n,o){const l=pr(r,n,o),c=[];for(let r=0;r<t.length;++r){const n=yr(e,t[r],e[xr[r]],l);if(!l.callback&&!n)return null;c.push(n)}return Fr(e,c,l)}function Pr(e){const t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}const Tr=/(\.|\[|]|\w+)/g;function Sr(e,t,r,n){const o=e.split(Tr).filter((s=>""!==s));let l=0,path="";for(;;){const e=o[l++];path+=e;const c=(s=e[0])>="0"&&s<="9",f=c?parseInt(e):e;c&&(path+=o[l++]);if(l===o.length){r[f]=t;break}{const e=o[l++],t="["===e,c=r[f]||(t?[]:{});r[f]=c,r=c,n[path]=n[path]||function(e){return function(t){Cr(e,t)}}(c),path+=e}}var s}function Rr(e,t){let r=0;function n(t,n,o){const l=n.name.endsWith("[0]"),c=n.type,f=Kt[c];if(!f)throw new Error(`unknown type: 0x${c.toString(16)}`);let m;if(f.bindPoint){const t=r;r+=n.size,m=l?f.arraySetter(e,c,t,o,n.size):f.setter(e,c,t,o,n.size)}else m=f.arraySetter&&l?f.arraySetter(e,o):f.setter(e,o);return m.location=o,m}const o={},l={},c=e.getProgramParameter(t,35718);for(let r=0;r<c;++r){const c=e.getActiveUniform(t,r);if(Pr(c))continue;let f=c.name;f.endsWith("[0]")&&(f=f.substr(0,f.length-3));const m=e.getUniformLocation(t,c.name);if(m){const e=n(0,c,m);o[f]=e,Sr(f,e,l,o)}}return o}function zr(e,t){const r={},n=e.getProgramParameter(t,35971);for(let o=0;o<n;++o){const n=e.getTransformFeedbackVarying(t,o);r[n.name]={index:o,type:n.type,size:n.size}}return r}function Ir(e,t){const r=e.getProgramParameter(t,35718),n=[],o=[];for(let l=0;l<r;++l){o.push(l),n.push({});const r=e.getActiveUniform(t,l);n[l].name=r.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach((function(r){const l=r[0],c=r[1];e.getActiveUniforms(t,o,e[l]).forEach((function(e,t){n[t][c]=e}))}));const l={},c=e.getProgramParameter(t,35382);for(let r=0;r<c;++r){const n=e.getActiveUniformBlockName(t,r),o={index:e.getUniformBlockIndex(t,n),usedByVertexShader:e.getActiveUniformBlockParameter(t,r,35396),usedByFragmentShader:e.getActiveUniformBlockParameter(t,r,35398),size:e.getActiveUniformBlockParameter(t,r,35392),uniformIndices:e.getActiveUniformBlockParameter(t,r,35395)};o.used=o.usedByVertexShader||o.usedByFragmentShader,l[n]=o}return{blockSpecs:l,uniformData:n}}function Cr(e,t){for(const r in t){const n=e[r];"function"==typeof n?n(t[r]):Cr(e[r],t[r])}}function Mr(e,...t){const r=e.uniformSetters||e,n=t.length;for(let e=0;e<n;++e){const n=t[e];if(Array.isArray(n)){const e=n.length;for(let t=0;t<e;++t)Mr(r,n[t])}else for(const e in n){const t=r[e];t&&t(n[e])}}}function kr(e,t){const r={},n=e.getProgramParameter(t,35721);for(let o=0;o<n;++o){const n=e.getActiveAttrib(t,o);if(Pr(n))continue;const l=e.getAttribLocation(t,n.name),c=lr[n.type],f=c.setter(e,l,c);f.location=l,r[n.name]=f}return r}function Ur(e,t){for(const r in t){const n=e[r];n&&n(t[r])}}function Br(e,t,r){r.vertexArrayObject?e.bindVertexArray(r.vertexArrayObject):(Ur(t.attribSetters||t,r.attribs),r.indices&&e.bindBuffer(34963,r.indices))}function Or(e,t){const r={program:t,uniformSetters:Rr(e,t),attribSetters:kr(e,t)};return ge(e)&&(r.uniformBlockSpec=Ir(e,t),r.transformFeedbackInfo=zr(e,t)),r}const Lr=/\s|{|}|;/;function Dr(e,t,r,n,o){const l=pr(r,n,o),c=[];if(t=t.map((function(source){if(!Lr.test(source)){const script=_t(source);if(script)source=script.text;else{const e=`no element with id: ${source}`;l.errorCallback(e),c.push(e)}}return source})),c.length)return dr(l,"");const f=l.callback;f&&(l.callback=(t,r)=>{let n;t||(n=Or(e,r)),f(t,n)});const m=Er(e,t,l);return m?Or(e,m):null}function _r(e,t,r,n,o,l){r=void 0===r?4:r;const c=t.indices,f=t.elementType,m=void 0===n?t.numElements:n;o=void 0===o?0:o,f||c?void 0!==l?e.drawElementsInstanced(r,m,void 0===f?5123:t.elementType,o,l):e.drawElements(r,m,void 0===f?5123:t.elementType,o):void 0!==l?e.drawArraysInstanced(r,o,m,l):e.drawArrays(r,o,m)}const $r=36161,jr=34041,Wr=36064,Vr=36096,Nr=33306,Gr=33071,Hr=9729,Yr=[{format:6408,type:5121,min:Hr,wrap:Gr},{format:jr}],Xr={};Xr[34041]=Nr,Xr[6401]=36128,Xr[36168]=36128,Xr[6402]=Vr,Xr[33189]=Vr,Xr[33190]=Vr,Xr[36012]=Vr,Xr[35056]=Nr,Xr[36013]=Nr;const Kr={};Kr[32854]=!0,Kr[32855]=!0,Kr[36194]=!0,Kr[34041]=!0,Kr[33189]=!0,Kr[6401]=!0,Kr[36168]=!0;function qr(e,t,r,n){const o=36160,l=e.createFramebuffer();e.bindFramebuffer(o,l),r=r||e.drawingBufferWidth,n=n||e.drawingBufferHeight;const c=[],f={framebuffer:l,attachments:[],width:r,height:n};return(t=t||Yr).forEach((function(t,i){let l=t.attachment;const m=t.samples,d=t.format;let y=t.attachmentPoint||function(e,t){return Xr[e]||Xr[t]}(d,t.internalFormat);if(y||(y=Wr+i),function(e){return e>=Wr&&e<36096}(y)&&c.push(y),!l)if(void 0!==m||function(e){return Kr[e]}(d))l=e.createRenderbuffer(),e.bindRenderbuffer($r,l),m>1?e.renderbufferStorageMultisample($r,m,d,r,n):e.renderbufferStorage($r,d,r,n);else{const o=Object.assign({},t);o.width=r,o.height=n,void 0===o.auto&&(o.auto=!1,o.min=o.min||o.minMag||Hr,o.mag=o.mag||o.minMag||Hr,o.wrapS=o.wrapS||o.wrap||Gr,o.wrapT=o.wrapT||o.wrap||Gr),l=Bt(e,o)}if(M(0,l))e.framebufferRenderbuffer(o,y,$r,l);else{if(!k(0,l))throw new Error("unknown attachment type");void 0!==t.layer?e.framebufferTextureLayer(o,y,l,t.level||0,t.layer):e.framebufferTexture2D(o,y,t.target||3553,l,t.level||0)}f.attachments.push(l)})),e.drawBuffers&&e.drawBuffers(c),f}function Jr(e,t,r,n,o){n=n||e.drawingBufferWidth,o=o||e.drawingBufferHeight,t.width=n,t.height=o,(r=r||Yr).forEach((function(r,l){const c=t.attachments[l],f=r.format,m=r.samples;if(void 0!==m||M(0,c))e.bindRenderbuffer($r,c),m>1?e.renderbufferStorageMultisample($r,m,f,n,o):e.renderbufferStorage($r,f,n,o);else{if(!k(0,c))throw new Error("unknown attachment type");Ot(e,c,r,n,o)}}))}function Zr(canvas,e){e=e||1,e=Math.max(0,e);const t=canvas.clientWidth*e|0,r=canvas.clientHeight*e|0;return(canvas.width!==t||canvas.height!==r)&&(canvas.width=t,canvas.height=r,!0)}}}]); |