@uptimizr/dashboard 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +2 -2
- package/out/__next._full.txt +2 -2
- package/out/__next._head.txt +1 -1
- package/out/__next._index.txt +1 -1
- package/out/__next._tree.txt +1 -1
- package/out/_next/static/chunks/{2h051-1hu4co_.js → 020h1b22yfzjc.js} +1 -1
- package/out/_next/static/chunks/{0k9-8s-jof_gw.js → 0jsh6juckq525.js} +1 -1
- package/out/_next/static/chunks/{1zcrrq1fx8g2y.js → 0n0thxa3jkour.js} +2 -2
- package/out/_next/static/chunks/0yvei5e7uye4f.js +3 -0
- package/out/_next/static/chunks/{01aeari2x_tlz.js → 10w513bgw-bgi.js} +1 -1
- package/out/_next/static/chunks/{39lxb7c--3_2u.js → 16hx9_epo71u-.js} +1 -1
- package/out/_next/static/chunks/{3d5yb9ybkz7hx.js → 1bxxv3nsl2-o_.js} +1 -1
- package/out/_next/static/chunks/{2yzui3v-besdu.js → 1f-2upk7uaxky.js} +1 -1
- package/out/_next/static/chunks/{38wksra3d_k-4.js → 1q-gcxr6o4bx2.js} +1 -1
- package/out/_next/static/chunks/{0fxfsshoxnnh6.js → 1st81sc3owvku.js} +1 -1
- package/out/_next/static/chunks/28ud4w7xswcir.js +1 -0
- package/out/_next/static/chunks/{1--aypw9o8yng.js → 2cqxw5m39njar.js} +4 -4
- package/out/_next/static/chunks/{09p5fltt7o3to.js → 2fle007r0cdnq.js} +1 -1
- package/out/_next/static/chunks/{29v8falcmjvev.js → 2jfmqd86u1tzv.js} +1 -1
- package/out/_next/static/chunks/{1bv97vf67p_ri.js → 2owp-uukmhm4s.js} +2 -2
- package/out/_next/static/chunks/{13oqt2aoms4f6.js → 2pkoed609lf41.js} +1 -1
- package/out/_next/static/chunks/{3pyggl13glbdc.js → 2wdk-kbm-n-m5.js} +1 -1
- package/out/_next/static/chunks/{42oyfkhdvb-u3.js → 30_2jsjk52x2i.js} +1 -1
- package/out/_next/static/chunks/{0zcdc17ie6lmh.js → 33h_kt3pzks_y.js} +1 -1
- package/out/_next/static/chunks/{2s0dwzg7kq36n.js → 366e7izc386pj.js} +1 -1
- package/out/_next/static/chunks/{0ufakw529sr9d.js → 36waz9xq39n4t.js} +4 -4
- package/out/_next/static/chunks/{1ll0ta8a2qx1p.js → 39dscgnk4__gl.js} +2 -2
- package/out/_next/static/chunks/{413o2v11bygt5.js → 3ghwe2mr2ig7e.js} +1 -1
- package/out/_next/static/chunks/3mcfjxvxo0o3e.js +1 -0
- package/out/_next/static/chunks/{259xlbe69b9tc.js → 3oj29s_tuqbkm.js} +1 -1
- package/out/_next/static/chunks/{3bsvp8qhjqdu0.js → 3r2hbpm4wju16.js} +1 -1
- package/out/_next/static/chunks/{340pg0qkv5tqq.js → 3rx1jhuop94-l.js} +1 -1
- package/out/_not-found/__next._full.txt +1 -1
- package/out/_not-found/__next._head.txt +1 -1
- package/out/_not-found/__next._index.txt +1 -1
- package/out/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/out/_not-found/__next._not-found.txt +1 -1
- package/out/_not-found/__next._tree.txt +1 -1
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +1 -1
- package/out/index.html +1 -1
- package/out/index.txt +2 -2
- package/package.json +3 -3
- package/out/_next/static/chunks/06m_64ysu9kn0.js +0 -1
- package/out/_next/static/chunks/34rcp8qrbp522.js +0 -3
- package/out/_next/static/chunks/3l6t8b3addlw7.js +0 -1
- /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → RC8D0Hg382TugUN5Syz31}/_buildManifest.js +0 -0
- /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → RC8D0Hg382TugUN5Syz31}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → RC8D0Hg382TugUN5Syz31}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70928,e=>{"use strict";var t,s,r=e.i(10534),i=e.i(79124),a=e.i(65703),o=e.i(79675),n=e.i(21834);function l(e,t,s=null){let h=t.pathArray,c=t.closeArray,u=t.closePath,d=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),p=t.instance,f=t.updatable;if(p){let e=r.TmpVectors.Vector3[0].setAll(Number.MAX_VALUE),s=r.TmpVectors.Vector3[1].setAll(-Number.MAX_VALUE),l=p.getVerticesData(a.VertexBuffer.PositionKind);if((t=>{let r=h[0].length,a=0,o=p._originalBuilderSideOrientation===i.Mesh.DOUBLESIDE?2:1;for(let i=1;i<=o;++i)for(let i=0;i<h.length;++i){let o=h[i],n=o.length;r=r<n?r:n;for(let i=0;i<r;++i){let r=o[i];t[a]=r.x,t[a+1]=r.y,t[a+2]=r.z,e.minimizeInPlaceFromFloats(r.x,r.y,r.z),s.maximizeInPlaceFromFloats(r.x,r.y,r.z),a+=3}if(p._creationDataStorage&&p._creationDataStorage.closePath){let e=o[0];t[a]=e.x,t[a+1]=e.y,t[a+2]=e.z,a+=3}}})(l),p.hasBoundingInfo?p.getBoundingInfo().reConstruct(e,s,p._worldMatrix):p.buildBoundingInfo(e,s,p._worldMatrix),p.updateVerticesData(a.VertexBuffer.PositionKind,l,!1,!1),t.colors){let e=p.getVerticesData(a.VertexBuffer.ColorKind);for(let s=0,r=0;s<t.colors.length;s++,r+=4){let i=t.colors[s];e[r]=i.r,e[r+1]=i.g,e[r+2]=i.b,e[r+3]=i.a}p.updateVerticesData(a.VertexBuffer.ColorKind,e,!1,!1)}if(t.uvs){let e=p.getVerticesData(a.VertexBuffer.UVKind);for(let s=0;s<t.uvs.length;s++)e[2*s]=t.uvs[s].x,e[2*s+1]=n.useOpenGLOrientationForUV?1-t.uvs[s].y:t.uvs[s].y;p.updateVerticesData(a.VertexBuffer.UVKind,e,!1,!1)}if(!p.areNormalsFrozen||p.isFacetDataEnabled){let e=p.getIndices(),t=p.getVerticesData(a.VertexBuffer.NormalKind),s=p.isFacetDataEnabled?p.getFacetDataParameters():null;if(o.VertexData.ComputeNormals(l,e,t,s),p._creationDataStorage&&p._creationDataStorage.closePath){let e,s;for(let r=0;r<h.length;r++)e=3*p._creationDataStorage.idx[r],s=r+1<h.length?(p._creationDataStorage.idx[r+1]-1)*3:t.length-3,t[e]=(t[e]+t[s])*.5,t[e+1]=(t[e+1]+t[s+1])*.5,t[e+2]=(t[e+2]+t[s+2])*.5,t[s]=t[e],t[s+1]=t[e+1],t[s+2]=t[e+2]}p.areNormalsFrozen||p.updateVerticesData(a.VertexBuffer.NormalKind,t,!1,!1)}return p}{let r=new i.Mesh(e,s);r._originalBuilderSideOrientation=d,r._creationDataStorage=new i._CreationDataStorage;let l=function(e){let t,s,r,i,l,h,c,u,d,p,f,x,g,m=e.pathArray,V=e.closeArray||!1,O=e.closePath||!1,_=e.invertUV||!1,M=Math.floor(m[0].length/2),y=e.offset||M;y=y>M?M:Math.floor(y);let T=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,v=e.uvs,b=e.colors,A=[],I=[],D=[],w=[],F=[],P=[],L=[],z=[],B=[],C=[];if(m.length<2){let e=[],t=[];for(r=0;r<m[0].length-y;r++)e.push(m[0][r]),t.push(m[0][r+y]);m=[e,t]}let E=0,S=+!!O,R=+!!V;for(s=0,t=m[0].length;s<m.length+R;s++){for(L[s]=0,F[s]=[0],t=t<(h=(l=s===m.length?m[0]:m[s]).length)?t:h,i=0;i<h;)A.push(l[i].x,l[i].y,l[i].z),i>0&&(c=l[i].subtract(l[i-1]).length()+L[s],F[s].push(c),L[s]=c),i++;O&&(i--,A.push(l[0].x,l[0].y,l[0].z),c=l[i].subtract(l[0]).length()+L[s],F[s].push(c),L[s]=c),B[s]=h+S,C[s]=E,E+=h+S}for(r=0;r<t+S;r++)for(s=0,z[r]=0,P[r]=[0];s<m.length-1+R;s++)u=m[s],d=s===m.length-1?m[0]:m[s+1],r===t?(p=u[0],f=d[0]):(p=u[r],f=d[r]),c=f.subtract(p).length()+z[r],P[r].push(c),z[r]=c;if(v)for(s=0;s<v.length;s++)w.push(v[s].x,n.useOpenGLOrientationForUV?1-v[s].y:v[s].y);else for(s=0;s<m.length+R;s++)for(r=0;r<t+S;r++)x=0!=L[s]?F[s][r]/L[s]:0,g=0!=z[r]?P[r][s]/z[r]:0,_?w.push(g,x):w.push(x,n.useOpenGLOrientationForUV?1-g:g);let U=0,N=B[s=0]-1,W=B[s+1]-1,G=N<W?N:W,H=C[1]-C[0],Z=B.length-1;for(;U<=G&&s<Z;)I.push(U,U+H,U+1),I.push(U+H+1,U+1,U+H),(U+=1)===G&&(H=C[++s+1]-C[s],N=B[s]-1,W=B[s+1]-1,U=C[s],G=N<W?N+U:W+U);if(o.VertexData.ComputeNormals(A,I,D),O){let e,t;for(s=0;s<m.length;s++){e=3*C[s],t=s+1<m.length?(C[s+1]-1)*3:D.length-3,D[e]=(D[e]+D[t])*.5,D[e+1]=(D[e+1]+D[t+1])*.5,D[e+2]=(D[e+2]+D[t+2])*.5;let r=Math.sqrt(D[e]*D[e]+D[e+1]*D[e+1]+D[e+2]*D[e+2]);D[e]/=r,D[e+1]/=r,D[e+2]/=r,D[t]=D[e],D[t+1]=D[e+1],D[t+2]=D[e+2]}}if(V){let e=3*C[0],s=3*C[m.length];for(r=0;r<t+S;r++){D[e]=(D[e]+D[s])*.5,D[e+1]=(D[e+1]+D[s+1])*.5,D[e+2]=(D[e+2]+D[s+2])*.5;let t=Math.sqrt(D[e]*D[e]+D[e+1]*D[e+1]+D[e+2]*D[e+2]);D[e]/=t,D[e+1]/=t,D[e+2]/=t,D[s]=D[e],D[s+1]=D[e+1],D[s+2]=D[e+2],e+=3,s+=3}}o.VertexData._ComputeSides(T,A,I,D,w,e.frontUVs,e.backUVs);let X=null;if(b){X=new Float32Array(4*b.length);for(let e=0;e<b.length;e++)X[4*e]=b[e].r,X[4*e+1]=b[e].g,X[4*e+2]=b[e].b,X[4*e+3]=b[e].a}let k=new o.VertexData,Y=new Float32Array(A),K=new Float32Array(D),Q=new Float32Array(w);return k.indices=I,k.positions=Y,k.normals=K,k.uvs=Q,X&&k.set(X,a.VertexBuffer.ColorKind),O&&(k._idx=C),k}(t);return u&&(r._creationDataStorage.idx=l._idx),r._creationDataStorage.closePath=u,r._creationDataStorage.closeArray=c,l.applyToMesh(r,f),r}}var h=e.i(75053);function c(e){let t=e.pattern||i.Mesh.NO_FLIP,s=e.tileWidth||e.tileSize||1,r=e.tileHeight||e.tileSize||1,a=e.alignHorizontal||0,n=e.alignVertical||0,l=e.width||e.size||1,h=Math.floor(l/s),c=l-h*s,u=e.height||e.size||1,d=Math.floor(u/r),p=u-d*r,f=s*h/2,x=r*d/2,g=0,m=0,V=0,O=0,_=0,M=0;if(c>0||p>0){switch(V=-f,O=-x,_=f,M=x,a){case i.Mesh.CENTER:c/=2,V-=c,_+=c;break;case i.Mesh.LEFT:_+=c,g=-c/2;break;case i.Mesh.RIGHT:V-=c,g=c/2}switch(n){case i.Mesh.CENTER:p/=2,O-=p,M+=p;break;case i.Mesh.BOTTOM:M+=p,m=-p/2;break;case i.Mesh.TOP:O-=p,m=p/2}}let y=[],T=[],v=[];v[0]=[0,0,1,0,1,1,0,1],v[1]=[0,0,1,0,1,1,0,1],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(v[1]=[1,1,0,1,0,0,1,0]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(v[1]=[1,0,0,0,0,1,1,1]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(v[1]=[0,1,1,1,1,0,0,0]);let b=[],A=[],I=[],D=0;for(let e=0;e<d;e++)for(let a=0;a<h;a++)y.push(-f+a*s+g,-x+e*r+m,0),y.push(-f+(a+1)*s+g,-x+e*r+m,0),y.push(-f+(a+1)*s+g,-x+(e+1)*r+m,0),y.push(-f+a*s+g,-x+(e+1)*r+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(v[(a%2+e%2)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(v[e%2]):b.concat(v[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),D+=4;if(c>0||p>0){let e,o,l,u,v,w=p>0&&(n===i.Mesh.CENTER||n===i.Mesh.TOP),F=p>0&&(n===i.Mesh.CENTER||n===i.Mesh.BOTTOM),P=c>0&&(a===i.Mesh.CENTER||a===i.Mesh.RIGHT),L=c>0&&(a===i.Mesh.CENTER||a===i.Mesh.LEFT);if(w&&P&&(y.push(V+g,O+m,0),y.push(-f+g,O+m,0),y.push(-f+g,O+p+m,0),y.push(V+g,O+p+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,u=1,v=1,e=[o=1-c/s,l=1-p/r,u,l,u,v,o,v],t===i.Mesh.ROTATE_ROW&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),t===i.Mesh.FLIP_ROW&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),t===i.Mesh.FLIP_N_ROTATE_ROW&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w&&L&&(y.push(f+g,O+m,0),y.push(_+g,O+m,0),y.push(_+g,O+p+m,0),y.push(f+g,O+p+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,v=1,e=[o=0,l=1-p/r,u=c/s,l,u,v,o,v],(t===i.Mesh.ROTATE_ROW||t===i.Mesh.ROTATE_TILE&&h%2==0)&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_ROW||t===i.Mesh.FLIP_TILE&&h%2==0)&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_TILE&&h%2==0)&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),F&&P&&(y.push(V+g,x+m,0),y.push(-f+g,x+m,0),y.push(-f+g,M+m,0),y.push(V+g,M+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,l=0,u=1,e=[o=1-c/s,l,u,l,u,v=p/r,o,v],(t===i.Mesh.ROTATE_ROW&&d%2==1||t===i.Mesh.ROTATE_TILE&&d%1==0)&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_ROW&&d%2==1||t===i.Mesh.FLIP_TILE&&d%2==0)&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===i.Mesh.FLIP_N_ROTATE_TILE&&d%2==0)&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),F&&L&&(y.push(f+g,x+m,0),y.push(_+g,x+m,0),y.push(_+g,M+m,0),y.push(f+g,M+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,e=[o=0,l=0,u=c/s,l,u,v=p/r,o,v],(t===i.Mesh.ROTATE_ROW&&d%2==1||t===i.Mesh.ROTATE_TILE&&(d+h)%2==1)&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_ROW&&d%2==1||t===i.Mesh.FLIP_TILE&&(d+h)%2==1)&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===i.Mesh.FLIP_N_ROTATE_TILE&&(d+h)%2==1)&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w){let e=[];o=0,l=1-p/r,u=1,v=1,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let r=0;r<h;r++)y.push(-f+r*s+g,O+m,0),y.push(-f+(r+1)*s+g,O+m,0),y.push(-f+(r+1)*s+g,O+p+m,0),y.push(-f+r*s+g,O+p+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(r+1)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[1]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(F){let e=[];o=0,l=0,u=1,v=p/r,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let r=0;r<h;r++)y.push(-f+r*s+g,M-p+m,0),y.push(-f+(r+1)*s+g,M-p+m,0),y.push(-f+(r+1)*s+g,M+m,0),y.push(-f+r*s+g,M+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(r+d)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[d%2]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(P){let e=[];o=1-c/s,l=0,u=1,v=1,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let s=0;s<d;s++)y.push(V+g,-x+s*r+m,0),y.push(V+c+g,-x+s*r+m,0),y.push(V+c+g,-x+(s+1)*r+m,0),y.push(V+g,-x+(s+1)*r+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(s+1)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[s%2]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(L){let e=[];o=0,l=0,u=c/r,v=1,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let s=0;s<d;s++)y.push(_-c+g,-x+s*r+m,0),y.push(_+g,-x+s*r+m,0),y.push(_+g,-x+(s+1)*r+m,0),y.push(_-c+g,-x+(s+1)*r+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(s+h)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[s%2]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}let w=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;o.VertexData._ComputeSides(w,y,I,T,b,e.frontUVs,e.backUVs);let F=new o.VertexData;return F.indices=I,F.positions=y,F.normals=T,F.uvs=b,F.colors=w===o.VertexData.DOUBLESIDE?A.concat(A):A,F}function u(e){let t,s=e.faceUV||Array(6),a=e.faceColors,l=e.pattern||i.Mesh.NO_FLIP,u=e.width||e.size||1,d=e.height||e.size||1,p=e.depth||e.size||1,f=e.tileWidth||e.tileSize||1,x=e.tileHeight||e.tileSize||1,g=e.alignHorizontal||0,m=e.alignVertical||0,V=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;for(let e=0;e<6;e++)void 0===s[e]&&(s[e]=new r.Vector4(0,0,1,1)),a&&void 0===a[e]&&(a[e]=new h.Color4(1,1,1,1));let O=u/2,_=d/2,M=p/2,y=[];for(let e=0;e<2;e++)y[e]=c({pattern:l,tileWidth:f,tileHeight:x,width:u,height:d,alignVertical:m,alignHorizontal:g,sideOrientation:V});for(let e=2;e<4;e++)y[e]=c({pattern:l,tileWidth:f,tileHeight:x,width:p,height:d,alignVertical:m,alignHorizontal:g,sideOrientation:V});let T=m;m===i.Mesh.BOTTOM?T=i.Mesh.TOP:m===i.Mesh.TOP&&(T=i.Mesh.BOTTOM);for(let e=4;e<6;e++)y[e]=c({pattern:l,tileWidth:f,tileHeight:x,width:u,height:p,alignVertical:T,alignHorizontal:g,sideOrientation:V});let v=[],b=[],A=[],I=[],D=[],w=[],F=[],P=[],L=0;for(let e=0;e<6;e++){let i=y[e].positions.length;w[e]=[],F[e]=[];for(let t=0;t<i/3;t++)w[e].push(new r.Vector3(y[e].positions[3*t],y[e].positions[3*t+1],y[e].positions[3*t+2])),F[e].push(new r.Vector3(y[e].normals[3*t],y[e].normals[3*t+1],y[e].normals[3*t+2]));t=y[e].uvs.length,P[e]=[];for(let r=0;r<t;r+=2)P[e][r]=s[e].x+(s[e].z-s[e].x)*y[e].uvs[r],P[e][r+1]=s[e].y+(s[e].w-s[e].y)*y[e].uvs[r+1],n.useOpenGLOrientationForUV&&(P[e][r+1]=1-P[e][r+1]);if(A=A.concat(P[e]),I=I.concat(y[e].indices.map(e=>e+L)),L+=w[e].length,a){let t=a[e];for(let s=0;s<w[e].length;s++)D.push(t.r,t.g,t.b,t.a)}}let z=[{m:r.Matrix.RotationY(Math.PI),t:new r.Vector3(0,0,M),op:1},{m:r.Matrix.Identity(),t:new r.Vector3(0,0,M),op:-1},{m:r.Matrix.RotationY(-Math.PI/2),t:new r.Vector3(O,0,0),op:1},{m:r.Matrix.RotationY(Math.PI/2),t:new r.Vector3(O,0,0),op:-1},{m:r.Matrix.RotationX(Math.PI/2),t:new r.Vector3(0,_,0),op:1},{m:r.Matrix.RotationX(-Math.PI/2),t:new r.Vector3(0,_,0),op:-1}];for(let e=0;e<6;e++){let{m:t,t:s,op:i}=z[e];for(let a of w[e]){let e=r.Vector3.TransformCoordinates(a,t),o=1===i?e.add(s):e.subtract(s);v.push(o.x,o.y,o.z)}for(let s of F[e]){let e=r.Vector3.TransformNormal(s,t);b.push(e.x,e.y,e.z)}}let B=new o.VertexData;return B.indices=I,B.positions=v,B.normals=b,B.uvs=A,a&&(B.colors=V===o.VertexData.DOUBLESIDE?D.concat(D):D),B}o.VertexData.CreateTiledPlane=c,o.VertexData.CreateTiledBox=u;var d=e.i(91095),p=i,f=e.i(21324),x=e.i(52344),g=e.i(46847),m=e.i(54670);class V extends p.Mesh{_isShaderMaterial(e){return!!e&&"ShaderMaterial"===e.getClassName()}constructor(t,s=null,r=null,i=null,o,n,l,c){super(t,s,r,i,o),this.useVertexColor=n,this.useVertexAlpha=l,this.color=new h.Color3(1,1,1),this.alpha=1,this._shaderLanguage=0,this._ownsMaterial=!1,i&&(this.color=i.color.clone(),this.alpha=i.alpha,this.useVertexColor=i.useVertexColor,this.useVertexAlpha=i.useVertexAlpha),this.intersectionThreshold=.1;const u={attributes:[a.VertexBuffer.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:[],useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?u.defines.push("#define VERTEXALPHA"):u.needAlphaBlending=!1,this.useVertexColor?(u.defines.push("#define VERTEXCOLOR"),u.attributes.push(a.VertexBuffer.ColorKind)):(u.uniforms.push("color"),this._color4=new h.Color4),c)this.material=c;else{this.getScene().getEngine().isWebGPU&&!V.ForceGLSL&&(this._shaderLanguage=1),u.shaderLanguage=this._shaderLanguage,u.extraInitializationsAsync=async()=>{1===this._shaderLanguage?await Promise.all([e.A(63042),e.A(94393)]):await Promise.all([e.A(94077),e.A(91270)])};const t=new g.ShaderMaterial("colorShader",this.getScene(),"color",u,!1);t.doNotSerialize=!0,this._ownsMaterial=!0,this._setInternalMaterial(t)}}getClassName(){return"LinesMesh"}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){let t=this.material;if(t===e)return;let s=t&&this._ownsMaterial;this._ownsMaterial=!1,this._setInternalMaterial(e),s&&t?.dispose()}_setInternalMaterial(e){this._setMaterial(e),this.material&&(this.material.fillMode=x.Material.LineListDrawMode,this.material.disableLighting=!0)}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;let s=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,s):this._geometry._bind(t,s,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){let{r:e,g:t,b:s}=this.color;this._color4.set(e,t,s,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,s){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let r=this.getScene().getEngine();return this._unIndexed?r.drawArraysType(x.Material.LineListDrawMode,e.verticesStart,e.verticesCount,s):r.drawElementsType(x.Material.LineListDrawMode,e.indexStart,e.indexCount,s),this}dispose(e,t=!1,s){!s&&(this._ownsMaterial?this.material?.dispose(!1,!1,!0):t&&this.material?.dispose(!1,!1,!0)),super.dispose(e)}clone(e,t=null,s){return t&&void 0===t._addToSceneRootNodes?(t.source=this,new V(e,this.getScene(),t.parent,t.source,t.doNotCloneChildren)):new V(e,this.getScene(),t,this,s)}createInstance(e){let t=new O(e,this);if(this.instancedBuffers)for(let e in t.instancedBuffers={},this.instancedBuffers)t.instancedBuffers[e]=this.instancedBuffers[e];return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){let s=new V(e.name,t);return s.color=h.Color3.FromArray(e.color),s.alpha=e.alpha,s}}V.ForceGLSL=!1;class O extends f.InstancedMesh{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}(t=V.prototype).enableEdgesRendering??(t.enableEdgesRendering=(0,m._MissingSideEffect)("LinesMesh","enableEdgesRendering")),(s=O.prototype).enableEdgesRendering??(s.enableEdgesRendering=(0,m._MissingSideEffect)("InstancedLinesMesh","enableEdgesRendering"));var _=e.i(83464);function M(e,t,s=null){let r=t.instance,i=t.lines,n=t.colors;if(r){let e,t,s=r.getVerticesData(a.VertexBuffer.PositionKind);n&&(e=r.getVerticesData(a.VertexBuffer.ColorKind));let o=0,l=0;for(let r=0;r<i.length;r++){let a=i[r];for(let i=0;i<a.length;i++)s[o]=a[i].x,s[o+1]=a[i].y,s[o+2]=a[i].z,n&&e&&(t=n[r],e[l]=t[i].r,e[l+1]=t[i].g,e[l+2]=t[i].b,e[l+3]=t[i].a,l+=4),o+=3}return r.updateVerticesData(a.VertexBuffer.PositionKind,s,!1,!1),n&&e&&r.updateVerticesData(a.VertexBuffer.ColorKind,e,!1,!1),r.refreshBoundingInfo(),r}let l=new V(e,s,null,void 0,void 0,!!n,t.useVertexAlpha,t.material);return(function(e){let t=[],s=[],r=e.lines,i=e.colors,a=[],n=0;for(let e=0;e<r.length;e++){let o=r[e];for(let r=0;r<o.length;r++){let{x:l,y:h,z:c}=o[r];if(s.push(l,h,c),i){let{r:t,g:s,b:o,a:n}=i[e][r];a.push(t,s,o,n)}r>0&&(t.push(n-1),t.push(n)),n++}}let l=new o.VertexData;return l.indices=t,l.positions=s,i&&(l.colors=a),l})(t).applyToMesh(l,t.updatable),l}var y=r,T=e.i(42473),v=e.i(26722),b=e.i(47867);class A extends y.Vector2{constructor(e,t){super(e.x,e.y),this.index=t}}class I{constructor(){this.elements=[]}add(e){let t=[];for(let s of e){let e=new A(s,this.elements.length);t.push(e),this.elements.push(e)}return t}computeBounds(){let e=new y.Vector2(this.elements[0].x,this.elements[0].y),t=new y.Vector2(this.elements[0].x,this.elements[0].y);for(let s of this.elements)s.x<e.x?e.x=s.x:s.x>t.x&&(t.x=s.x),s.y<e.y?e.y=s.y:s.y>t.y&&(t.y=s.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class D{_addToepoint(e){for(let t of e)this._epoints.push(t.x,t.y)}constructor(e,t,s,r=earcut){let i;this._points=new I,this._outlinepoints=new I,this._holes=[],this._epoints=[],this._eholes=[],this.bjsEarcut=r,this._name=e,this._scene=s||b.EngineStore.LastCreatedScene,i=t instanceof T.Path2?t.getPoints():t,this._addToepoint(i),this._points.add(i),this._outlinepoints.add(i),void 0===this.bjsEarcut&&_.Logger.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);let t=new I;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,s=2){let r=new i.Mesh(this._name,this._scene),o=this.buildVertexData(t,s);return r.setVerticesData(a.VertexBuffer.PositionKind,o.positions,e),r.setVerticesData(a.VertexBuffer.NormalKind,o.normals,e),r.setVerticesData(a.VertexBuffer.UVKind,o.uvs,e),r.setIndices(o.indices),r}buildVertexData(e=0,t=2){let s=new o.VertexData,r=[],i=[],a=[],n=this._points.computeBounds();for(let e of this._points.elements)r.push(0,1,0),i.push(e.x,0,e.y),a.push((e.x-n.min.x)/n.width,(e.y-n.min.y)/n.height);let l=[],h=this.bjsEarcut(this._epoints,this._eholes,2);for(let e=0;e<h.length;e++)l.push(h[e]);if(e>0){let s=i.length/3;for(let t of this._points.elements)r.push(0,-1,0),i.push(t.x,-e,t.y),a.push(1-(t.x-n.min.x)/n.width,1-(t.y-n.min.y)/n.height);let o=l.length;for(let e=0;e<o;e+=3){let t=l[e+0],r=l[e+1],i=l[e+2];l.push(i+s),l.push(r+s),l.push(t+s)}for(let s of(this._addSide(i,r,a,l,n,this._outlinepoints,e,!1,t),this._holes))this._addSide(i,r,a,l,n,s,e,!0,t)}return s.indices=l,s.positions=i,s.normals=r,s.uvs=a,s}_addSide(e,t,s,r,i,a,o,n,l){let h=e.length/3,c=0;for(let u=0;u<a.elements.length;u++){let d,p=a.elements[u],f=a.elements[(u+1)%a.elements.length];e.push(p.x,0,p.y),e.push(p.x,-o,p.y),e.push(f.x,0,f.y),e.push(f.x,-o,f.y);let x=a.elements[(u+a.elements.length-1)%a.elements.length],g=a.elements[(u+2)%a.elements.length],m=new y.Vector3(-(f.y-p.y),0,f.x-p.x),V=new y.Vector3(-(p.y-x.y),0,p.x-x.x),O=new y.Vector3(-(g.y-f.y),0,g.x-f.x);n||(m=m.scale(-1),V=V.scale(-1),O=O.scale(-1));let _=m.normalizeToNew(),M=V.normalizeToNew(),T=y.Vector3.Dot(M,_);M=T>l?T<v.Epsilon-1?new y.Vector3(p.x,0,p.y).subtract(new y.Vector3(f.x,0,f.y)).normalize():V.add(m).normalize():_;let b=y.Vector3.Dot(O,m);d=b>l?b<v.Epsilon-1?new y.Vector3(f.x,0,f.y).subtract(new y.Vector3(p.x,0,p.y)).normalize():O.add(m).normalize():_,s.push(c/i.width,0),s.push(c/i.width,1),c+=m.length(),s.push(c/i.width,0),s.push(c/i.width,1),t.push(M.x,M.y,M.z),t.push(M.x,M.y,M.z),t.push(d.x,d.y,d.z),t.push(d.x,d.y,d.z),n?(r.push(h),r.push(h+2),r.push(h+1),r.push(h+1),r.push(h+2),r.push(h+3)):(r.push(h),r.push(h+1),r.push(h+2),r.push(h+1),r.push(h+3),r.push(h+2)),h+=4}}}function w(e,t,s=null,l=earcut){let c;t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);let u=t.shape,d=t.holes||[],p=t.depth||0,f=t.smoothingThreshold||2,x=[];for(let e=0;e<u.length;e++)x[e]=new r.Vector2(u[e].x,u[e].z);x[0].equalsWithEpsilon(x[x.length-1],1e-8)&&x.pop();let g=new D(e,x,s||b.EngineStore.LastCreatedScene,l);for(let e=0;e<d.length;e++){c=[];for(let t=0;t<d[e].length;t++)c.push(new r.Vector2(d[e][t].x,d[e][t].z));g.addHole(c)}let m=g.build(!1,p,f);return m._originalBuilderSideOrientation=t.sideOrientation,(function(e,t,s,i,l,c,u){let d,p,f,x,g=s||[,,,],m=[],V=u||!1;for(let e=0;e<3;e++)void 0===g[e]&&(g[e]=new r.Vector4(0,0,1,1)),i&&void 0===i[e]&&(i[e]=new h.Color4(1,1,1,1));let O=e.getVerticesData(a.VertexBuffer.PositionKind),_=e.getVerticesData(a.VertexBuffer.NormalKind),M=e.getVerticesData(a.VertexBuffer.UVKind),y=e.getIndices(),T=O.length/9,v=0,b=[0];if(V)for(let e=T;e<O.length/3;e+=4)b.push(v+=Math.sqrt((p=O[3*(e+2)]-O[3*e])*p+(f=O[3*(e+2)+2]-O[3*e+2])*f));let A=0;for(let e=0;e<_.length;e+=3).001>Math.abs(_[e+1])&&(A=1),.001>Math.abs(_[e+1]-1)&&(A=0),.001>Math.abs(_[e+1]+1)&&(A=2),x=e/3,1===A?((d=x-T)%4<1.5?V?M[2*x]=g[A].x+(g[A].z-g[A].x)*b[Math.floor(d/4)]/v:M[2*x]=g[A].x:V?M[2*x]=g[A].x+(g[A].z-g[A].x)*b[Math.floor(d/4)+1]/v:M[2*x]=g[A].z,d%2==0?M[2*x+1]=n.useOpenGLOrientationForUV?1-g[A].w:g[A].w:M[2*x+1]=n.useOpenGLOrientationForUV?1-g[A].y:g[A].y):(M[2*x]=(1-M[2*x])*g[A].x+M[2*x]*g[A].z,M[2*x+1]=(1-M[2*x+1])*g[A].y+M[2*x+1]*g[A].w,n.useOpenGLOrientationForUV&&(M[2*x+1]=1-M[2*x+1])),i&&m.push(i[A].r,i[A].g,i[A].b,i[A].a);o.VertexData._ComputeSides(t,O,y,_,M,l,c);let I=new o.VertexData;return I.indices=y,I.positions=O,I.normals=_,I.uvs=M,i&&(I.colors=t===o.VertexData.DOUBLESIDE?m.concat(m):m),I})(m,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs,t.wrap).applyToMesh(m,t.updatable),m}function F(e,t,s=null,r=earcut){return w(e,t,s,r)}function P(e,t,s,a,o,n,h,c,u,d,p,f,x,g,m,V,O,_,M,y,v){let b,A=(e,t,s,a,o,n,l,h,c,u,d)=>{let p=s.getTangents(),f=s.getNormals(),x=s.getBinormals(),g=s.getDistances();if(d){for(let e=0;e<p.length;e++)if(0==p[e].x&&0==p[e].y&&0==p[e].z&&p[e].copyFrom(p[e-1]),0==f[e].x&&0==f[e].y&&0==f[e].z&&f[e].copyFrom(f[e-1]),0==x[e].x&&0==x[e].y&&0==x[e].z&&x[e].copyFrom(x[e-1]),e>0){let t=p[e-1];0>r.Vector3.Dot(t,p[e])&&p[e].scaleInPlace(-1),t=f[e-1],0>r.Vector3.Dot(t,f[e])&&f[e].scaleInPlace(-1),t=x[e-1],0>r.Vector3.Dot(t,x[e])&&x[e].scaleInPlace(-1)}}let m=0,V=u&&h?h:()=>null!==n?n:0,O=u&&l?l:()=>null!==o?o:r.Vector3.OneReadOnly,_=2*(c!==i.Mesh.NO_CAP&&c!==i.Mesh.CAP_END),M=r.TmpVectors.Matrix[0];for(let s=0;s<t.length;s++){let i=[],o=V(s,g[s]),n=O(s,g[s]);r.Matrix.RotationAxisToRef(p[s],m,M);for(let a=0;a<e.length;a++){let o=p[s].scale(e[a].z).add(f[s].scale(e[a].x)).add(x[s].scale(e[a].y)),l=r.Vector3.Zero();r.Vector3.TransformCoordinatesToRef(o,M,l),l.multiplyInPlace(n).addInPlace(t[s]),i[a]=l}a[_]=i,m+=o,_++}let y=v||(e=>{let t,s=[],i=r.Vector3.Zero();for(t=0;t<e.length;t++)i.addInPlace(e[t]);for(i.scaleInPlace(1/e.length),t=0;t<e.length;t++)s.push(i);return s});switch(c){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:a[0]=y(a[2]),a[1]=a[2];break;case i.Mesh.CAP_END:a[_]=a[_-1],a[_+1]=y(a[_-1]);break;case i.Mesh.CAP_ALL:a[0]=y(a[2]),a[1]=a[2],a[_]=a[_-1],a[_+1]=y(a[_-1])}return a},I=null!==a?new r.Vector3(a,a,a):null;if(m){let e=m._creationDataStorage;return M?e.path3D.update(s,M):e.path3D.update(s),m=l("",{pathArray:b=A(t,s,e.path3D,e.pathArray,I,o,n,h,e.cap,p,y),closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:m},f||void 0)}let D=M?new T.Path3D(s,M):new T.Path3D(s),w=l(e,{pathArray:b=A(t,s,D,[],I,o,n,h,d=d<0||d>3?0:d,p,y),closeArray:c,closePath:u,updatable:x,sideOrientation:g,invertUV:V,frontUVs:O||void 0,backUVs:_||void 0},f);return w._creationDataStorage.pathArray=b,w._creationDataStorage.path3D=D,w._creationDataStorage.cap=d,w}var L=i;class z extends L.Mesh{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e),(0,m._IsSideEffectImplemented)(this.createOrUpdateSubmeshesOctree)&&this.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){let s=this.getWorldMatrix(),i=r.TmpVectors.Matrix[5];s.invertToRef(i);let a=r.TmpVectors.Vector3[8];if(r.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,i,a),e=a.x,t=a.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());let o=this._getFacetAt(e,t),n=-(o.x*e+o.z*t+o.w)/o.y;return r.Vector3.TransformCoordinatesFromFloatsToRef(0,n,0,s,a),a.y}getNormalAtCoordinates(e,t){let s=new r.Vector3(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,s),s}getNormalAtCoordinatesToRef(e,t,s){let i=this.getWorldMatrix(),a=r.TmpVectors.Matrix[5];i.invertToRef(a);let o=r.TmpVectors.Vector3[8];if(r.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,a,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());let n=this._getFacetAt(e,t);return r.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,i,s),this}updateCoordinateHeights(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){let s=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),r=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),i=this._heightQuads[r*this._subdivisionsX+s];return t<i.slope.x*e+i.slope.y?i.facet1:i.facet2}_initHeightQuads(){let e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let s=0;s<t;s++)for(let t=0;t<e;t++){let i={slope:r.Vector2.Zero(),facet1:new r.Vector4(0,0,0,0),facet2:new r.Vector4(0,0,0,0)};this._heightQuads[s*e+t]=i}return this}_computeHeightQuads(){let e,t,s,i,o,n,l,h=this.getVerticesData(a.VertexBuffer.PositionKind);if(!h)return this;let c=r.TmpVectors.Vector3[3],u=r.TmpVectors.Vector3[2],d=r.TmpVectors.Vector3[1],p=r.TmpVectors.Vector3[0],f=r.TmpVectors.Vector3[4],x=r.TmpVectors.Vector3[5],g=r.TmpVectors.Vector3[6],m=r.TmpVectors.Vector3[7],V=r.TmpVectors.Vector3[8],O=this._subdivisionsX,_=this._subdivisionsY;for(let a=0;a<_;a++)for(let _=0;_<O;_++){e=3*_,t=a*(O+1)*3,s=(a+1)*(O+1)*3,c.x=h[t+e],c.y=h[t+e+1],c.z=h[t+e+2],u.x=h[t+e+3],u.y=h[t+e+4],u.z=h[t+e+5],d.x=h[s+e],d.y=h[s+e+1],d.z=h[s+e+2],p.x=h[s+e+3],p.y=h[s+e+4],p.z=h[s+e+5],i=(p.z-c.z)/(p.x-c.x),o=c.z-i*c.x,u.subtractToRef(c,f),d.subtractToRef(c,x),p.subtractToRef(c,g),r.Vector3.CrossToRef(g,x,m),r.Vector3.CrossToRef(f,g,V),m.normalize(),V.normalize(),n=-(m.x*c.x+m.y*c.y+m.z*c.z),l=-(V.x*u.x+V.y*u.y+V.z*u.z);let M=this._heightQuads[a*O+_];M.slope.copyFromFloats(i,o),M.facet1.copyFromFloats(m.x,m.y,m.z,n),M.facet2.copyFromFloats(V.x,V.y,V.z,l)}return this}serialize(e){super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){let s=new z(e.name,t);return s._subdivisionsX=e.subdivisionsX||1,s._subdivisionsY=e.subdivisionsY||1,s._minX=e.minX,s._maxX=e.maxX,s._minZ=e.minZ,s._maxZ=e.maxZ,s._width=e.width,s._height=e.height,s}}var B=e.i(29711);function C(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s,i,a,l,c,u,d,p=[];p[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},p[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},p[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},p[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},p[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},p[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},p[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},p[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},p[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},p[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},p[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},p[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},p[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},p[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},p[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};let f=e.type&&(e.type<0||e.type>=p.length)?0:e.type||0,x=e.size,g=e.sizeX||x||1,m=e.sizeY||x||1,V=e.sizeZ||x||1,O=e.custom||p[f],_=O.face.length,M=e.faceUV||Array(_),y=e.faceColors,T=void 0===e.flat||e.flat,v=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,b=[],A=[],I=[],D=[],w=[],F=0,P=0,L=[];if(T)for(s=0;s<_;s++)y&&void 0===y[s]&&(y[s]=new h.Color4(1,1,1,1)),M&&void 0===M[s]&&(M[s]=new r.Vector4(0,0,1,1));if(T)for(s=0;s<_;s++){let e=O.face[s].length;for(t=0,c=.5*Math.tan((l=2*Math.PI/e)/2),u=.5;t<e;t++)b.push(O.vertex[O.face[s][t]][0]*g,O.vertex[O.face[s][t]][1]*m,O.vertex[O.face[s][t]][2]*V),L.push(F),F++,i=M[s].x+(M[s].z-M[s].x)*(.5+c),a=M[s].y+(M[s].w-M[s].y)*(u-.5),D.push(i,n.useOpenGLOrientationForUV?1-a:a),d=c*Math.cos(l)-u*Math.sin(l),u=c*Math.sin(l)+u*Math.cos(l),c=d,y&&w.push(y[s].r,y[s].g,y[s].b,y[s].a);for(t=0;t<e-2;t++)A.push(L[0+P],L[t+2+P],L[t+1+P]);P+=e}else{for(t=0;t<O.vertex.length;t++)b.push(O.vertex[t][0]*g,O.vertex[t][1]*m,O.vertex[t][2]*V),D.push(0,+!!n.useOpenGLOrientationForUV);for(s=0;s<_;s++)for(t=0;t<O.face[s].length-2;t++)A.push(O.face[s][0],O.face[s][t+2],O.face[s][t+1])}o.VertexData.ComputeNormals(b,A,I),o.VertexData._ComputeSides(v,b,A,I,D,e.frontUVs,e.backUVs);let z=new o.VertexData;return z.positions=b,z.indices=A,z.normals=I,z.uvs=D,y&&T&&(z.colors=w),z})(t).applyToMesh(a,t.updatable),a}var E=e.i(35270);let S=new r.Vector3(1,0,0),R=new r.Vector3(-1,0,0),U=new r.Vector3(0,1,0),N=new r.Vector3(0,-1,0),W=new r.Vector3(0,0,1),G=new r.Vector3(0,0,-1);class H{constructor(e=r.Vector3.Zero(),t=r.Vector3.Up(),s=r.Vector2.Zero(),i=0,a=0,o=null,n=null,l=null,h=null){this.position=e,this.normal=t,this.uv=s,this.vertexIdx=i,this.vertexIdxForBones=a,this.localPositionOverride=o,this.localNormalOverride=n,this.matrixIndicesOverride=l,this.matrixWeightsOverride=h}clone(){return new H(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}class Z{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),_.Logger.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.Logger.Warn("y is not an integer, floor(y) used"))}clone(){return new Z(this.x,this.y)}rotate60About(e){let t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){let t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),_.Logger.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.Logger.Warn("n not an integer only floor(n) used"));let s=this.x;return this.x=e-s-this.y,this.y=t+s,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),_.Logger.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.Logger.Warn("n is not an integer, floor(n) used"));let s=this.x;return this.x=this.y-t,this.y=e+t-s-this.y,this}toCartesianOrigin(e,t){let s=r.Vector3.Zero();return s.x=e.x+2*this.x*t+this.y*t,s.y=e.y+Math.sqrt(3)*this.y*t,s}static Zero(){return new Z(0,0)}}class X{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new k("icosahedron","Regular",[[0,v.PHI,-1],[-v.PHI,1,0],[-1,0,-v.PHI],[1,0,-v.PHI],[v.PHI,1,0],[0,v.PHI,1],[-1,0,v.PHI],[-v.PHI,-1,0],[0,-v.PHI,-1],[v.PHI,-1,0],[1,0,v.PHI],[0,-v.PHI,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,6]])}setIndices(){let e,t,s,r,i,a,o,n,l=12,h={},c=this.m,u=this.n,d=c;0!==u&&(d=(0,E.HighestCommonFactor)(c,u));let p=c/d,f=u/d,x=Z.Zero(),g=new Z(c,u),m=new Z(-u,c+u),V=Z.Zero(),O=Z.Zero(),_=Z.Zero(),M=[],y=[],T=this.vertByDist,v=(e,t,s,r)=>{a=e+"|"+s,o=t+"|"+r,a in h||o in h?a in h&&!(o in h)?h[o]=h[a]:o in h&&!(a in h)&&(h[a]=h[o]):(h[a]=l,h[o]=l,l++),T[s][0]>2?y[h[a]]=[-T[s][0],T[s][1],h[a]]:y[h[a]]=[M[T[s][0]],T[s][1],h[a]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let o=0;o<20;o++){if(s=(M=this.IDATA.face[o])[2],r=M[1],i=M[0],(a=o+"|"+(n=x.x+"|"+x.y))in h||(h[a]=s,y[s]=[M[T[n][0]],T[n][1]]),(a=o+"|"+(n=g.x+"|"+g.y))in h||(h[a]=r,y[r]=[M[T[n][0]],T[n][1]]),(a=o+"|"+(n=m.x+"|"+m.y))in h||(h[a]=i,y[i]=[M[T[n][0]],T[n][1]]),e=this.IDATA.edgematch[o][0],"B"===(t=this.IDATA.edgematch[o][1]))for(let t=1;t<d;t++)O.x=c-t*(p+f),O.y=u+t*p,_.x=-t*f,_.y=t*(p+f),v(o,e,n=O.x+"|"+O.y,_.x+"|"+_.y);if("O"===t)for(let t=1;t<d;t++)_.x=-t*f,_.y=t*(p+f),V.x=t*p,V.y=t*f,v(o,e,n=_.x+"|"+_.y,V.x+"|"+V.y);if(e=this.IDATA.edgematch[o][2],(t=this.IDATA.edgematch[o][3])&&"A"===t)for(let t=1;t<d;t++)V.x=t*p,V.y=t*f,O.x=c-(d-t)*(p+f),O.y=u+(d-t)*p,v(o,e,n=V.x+"|"+V.y,O.x+"|"+O.y);for(let e=0;e<this.vertices.length;e++)(a=o+"|"+(n=this.vertices[e].x+"|"+this.vertices[e].y))in h||(h[a]=l++,T[n][0]>2?y[h[a]]=[-T[n][0],T[n][1],h[a]]:y[h[a]]=[M[T[n][0]],T[n][1],h[a]])}this.closestTo=y,this.vecToidx=h}calcCoeffs(){let e=this.m,t=this.n,s=Math.sqrt(3)/3,r=e*e+t*t+e*t;this.coau=(e+t)/r,this.cobu=-t/r,this.coav=-s*(e-t)/r,this.cobv=s*(2*e+t)/r}createInnerFacets(){let e=this.m,t=this.n;for(let s=0;s<t+e+1;s++)for(let e=this.min[s];e<this.max[s]+1;e++)e<this.max[s]&&e<this.max[s+1]+1&&this.innerFacets.push(["|"+e+"|"+s,"|"+e+"|"+(s+1),"|"+(e+1)+"|"+s]),s>0&&e<this.max[s-1]&&e+1<this.max[s]+1&&this.innerFacets.push(["|"+e+"|"+s,"|"+(e+1)+"|"+s,"|"+(e+1)+"|"+(s-1)])}edgeVecsABOB(){let e=this.m,t=this.n,s=new Z(-t,e+t);for(let r=1;r<e+t;r++){let e=new Z(this.min[r],r),t=new Z(this.min[r-1],r-1),i=new Z(this.min[r+1],r+1),a=e.clone(),o=t.clone(),n=i.clone();a.rotate60About(s),o.rotate60About(s),n.rotate60About(s);let l=new Z(this.max[a.y],a.y),h=new Z(this.max[a.y-1],a.y-1),c=new Z(this.max[a.y-1]-1,a.y-1);(a.x!==l.x||a.y!==l.y)&&(a.x!==h.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,c]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,c,l])):a.y===n.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,h]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([e,h,i])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,h]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,l])))}}mapABOBtoOBOA(){let e=new Z(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){let s=[];for(let r=0;r<3;r++)e.x=this.isoVecsABOB[t][r].x,e.y=this.isoVecsABOB[t][r].y,0===this.vertexTypes[t][r]&&e.rotateNeg120(this.m,this.n),s.push(e.clone());this.isoVecsOBOA.push(s)}}mapABOBtoBAOA(){let e=new Z(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){let s=[];for(let r=0;r<3;r++)e.x=this.isoVecsABOB[t][r].x,e.y=this.isoVecsABOB[t][r].y,1===this.vertexTypes[t][r]&&e.rotate120(this.m,this.n),s.push(e.clone());this.isoVecsBAOA.push(s)}}MapToFace(e,t){let s,i,a=this.IDATA.face[e],o=a[2],n=a[1],l=a[0],h=r.Vector3.FromArray(this.IDATA.vertex[o]),c=r.Vector3.FromArray(this.IDATA.vertex[n]),u=r.Vector3.FromArray(this.IDATA.vertex[l]),d=c.subtract(h),p=u.subtract(h),f=d.scale(this.coau).add(p.scale(this.cobu)),x=d.scale(this.coav).add(p.scale(this.cobv)),g=[];for(let r=0;r<this.cartesian.length;r++)i=f.scale(this.cartesian[r].x).add(x.scale(this.cartesian[r].y)).add(h),g[r]=[i.x,i.y,i.z],s=e+"|"+this.vertices[r].x+"|"+this.vertices[r].y,t.vertex[this.vecToidx[s]]=[i.x,i.y,i.z]}build(e,t){let s,r,i=[],a=Z.Zero(),o=new Z(e,t),n=new Z(-t,e+t);i.push(a,o,n);for(let s=t;s<e+1;s++)for(let t=0;t<e+1-s;t++)i.push(new Z(t,s));if(t>0){let s=(0,E.HighestCommonFactor)(e,t),r=e/s,a=t/s;for(let o=1;o<s;o++)i.push(new Z(o*r,o*a)),i.push(new Z(-o*a,o*(r+a))),i.push(new Z(e-o*(r+a),t+o*r));let o=e/t;for(let s=1;s<t;s++)for(let r=0;r<s*o;r++)i.push(new Z(r,s)),i.push(new Z(r,s).rotate120(e,t)),i.push(new Z(r,s).rotateNeg120(e,t))}i.sort((e,t)=>e.x-t.x),i.sort((e,t)=>e.y-t.y);let l=Array(e+t+1),h=Array(e+t+1);for(let e=0;e<l.length;e++)l[e]=1/0,h[e]=-1/0;let c=i.length;for(let e=0;e<c;e++)r=i[e].x,l[s=i[e].y]=Math.min(r,l[s]),h[s]=Math.max(r,h[s]);let u=(s,r)=>{let i=s.clone();return("A"===r&&i.rotateNeg120(e,t),"B"===r&&i.rotate120(e,t),i.x<0)?i.y:i.x+i.y},d=[],p=[],f=[],x=[],g={},m=[],V=-1,O=-1;for(let e=0;e<c;e++)d[e]=i[e].toCartesianOrigin(new Z(0,0),.5),p[e]=u(i[e],"O"),f[e]=u(i[e],"A"),x[e]=u(i[e],"B"),p[e]===f[e]&&f[e]===x[e]?(V=3,O=p[e]):p[e]===f[e]?(V=4,O=p[e]):f[e]===x[e]?(V=5,O=f[e]):x[e]===p[e]&&(V=6,O=p[e]),p[e]<f[e]&&p[e]<x[e]&&(V=2,O=p[e]),f[e]<p[e]&&f[e]<x[e]&&(V=1,O=f[e]),x[e]<f[e]&&x[e]<p[e]&&(V=0,O=x[e]),m.push([V,O,i[e].x,i[e].y]);m.sort((e,t)=>e[2]-t[2]),m.sort((e,t)=>e[3]-t[3]),m.sort((e,t)=>e[1]-t[1]),m.sort((e,t)=>e[0]-t[0]);for(let e=0;e<m.length;e++)g[m[e][2]+"|"+m[e][3]]=[m[e][0],m[e][1],e];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=g,this.cartesian=d,this.min=l,this.max=h,this}}class k{constructor(e,t,s,r){this.name=e,this.category=t,this.vertex=s,this.face=r}}class Y extends k{innerToData(e,t){for(let s=0;s<t.innerFacets.length;s++)this.face.push(t.innerFacets[s].map(s=>t.vecToidx[e+s]))}mapABOBtoDATA(e,t){let s=t.IDATA.edgematch[e][0];for(let r=0;r<t.isoVecsABOB.length;r++){let i=[];for(let a=0;a<3;a++)0===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsABOB[r][a].x+"|"+t.isoVecsABOB[r][a].y):i.push(s+"|"+t.isoVecsABOB[r][a].x+"|"+t.isoVecsABOB[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}mapOBOAtoDATA(e,t){let s=t.IDATA.edgematch[e][0];for(let r=0;r<t.isoVecsOBOA.length;r++){let i=[];for(let a=0;a<3;a++)1===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsOBOA[r][a].x+"|"+t.isoVecsOBOA[r][a].y):i.push(s+"|"+t.isoVecsOBOA[r][a].x+"|"+t.isoVecsOBOA[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}mapBAOAtoDATA(e,t){let s=t.IDATA.edgematch[e][2];for(let r=0;r<t.isoVecsBAOA.length;r++){let i=[];for(let a=0;a<3;a++)1===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsBAOA[r][a].x+"|"+t.isoVecsBAOA[r][a].y):i.push(s+"|"+t.isoVecsBAOA[r][a].x+"|"+t.isoVecsBAOA[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}orderData(e){let t=[];for(let e=0;e<13;e++)t[e]=[];let s=e.closestTo;for(let e=0;e<s.length;e++)s[e][0]>-1?s[e][1]>0&&t[s[e][0]].push([e,s[e][1]]):t[12].push([e,s[e][0]]);let r=[];for(let e=0;e<12;e++)r[e]=e;let i=12;for(let e=0;e<12;e++){t[e].sort((e,t)=>e[1]-t[1]);for(let s=0;s<t[e].length;s++)r[t[e][s][0]]=i++}for(let e=0;e<t[12].length;e++)r[t[12][e][0]]=i++;for(let e=0;e<this.vertex.length;e++)this.vertex[e].push(r[e]);this.vertex.sort((e,t)=>e[3]-t[3]);for(let e=0;e<this.vertex.length;e++)this.vertex[e].pop();for(let e=0;e<this.face.length;e++)for(let t=0;t<this.face[e].length;t++)this.face[e][t]=r[this.face[e][t]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){let s=[],r=[],i=t.pop();r.push(i);let a=this.face[i].indexOf(e);a=(a+2)%3;let o=this.face[i][a];s.push(o);let n=0;for(;t.length>0;)i=t[n],this.face[i].indexOf(o)>-1?(a=(this.face[i].indexOf(o)+1)%3,o=this.face[i][a],s.push(o),r.push(i),t.splice(n,1),n=0):n++;return this.adjacentFaces.push(s),r}toGoldbergPolyhedronData(){let e,t,s,r,i,a=new k("GeoDual","Goldberg",[],[]);a.name="GD dual";let o=this.vertex.length,n=Array(o);for(let e=0;e<o;e++)n[e]=[];for(let e=0;e<this.face.length;e++)for(let t=0;t<3;t++)n[this.face[e][t]].push(e);this.adjacentFaces=[];for(let o=0;o<n.length;o++)for(let l of(a.face[o]=this.setOrder(o,n[o].concat([])),n[o])){e=0,t=0,s=0,r=this.face[l];for(let a=0;a<3;a++)e+=(i=this.vertex[r[a]])[0],t+=i[1],s+=i[2];a.vertex[l]=[e/3,t/3,s/3]}return a}static BuildGeodesicData(e){let t=new Y("Geodesic-m-n","Geodesic",[[0,v.PHI,-1],[-v.PHI,1,0],[-1,0,-v.PHI],[1,0,-v.PHI],[v.PHI,1,0],[0,v.PHI,1],[-1,0,v.PHI],[-v.PHI,-1,0],[0,-v.PHI,-1],[v.PHI,-1,0],[1,0,v.PHI],[0,-v.PHI,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;s<e.IDATA.face.length;s++)e.MapToFace(s,t),t.innerToData(s,e),"B"===e.IDATA.edgematch[s][1]&&t.mapABOBtoDATA(s,e),"O"===e.IDATA.edgematch[s][1]&&t.mapOBOAtoDATA(s,e),"A"===e.IDATA.edgematch[s][3]&&t.mapBAOAtoDATA(s,e);return t.orderData(e),t.vertex=t.vertex.map(function(e){let t=e[0],s=e[1],r=e[2],i=Math.sqrt(t*t+s*s+r*r);return e[0]*=1/i,e[1]*=1/i,e[2]*=1/i,e}),t}}var K=i;class Q extends K.Mesh{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return void 0===t?(e>this.goldbergData.nbUnsharedFaces-1&&(_.Logger.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(_.Logger.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(_.Logger.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let t=0;t<e.length;t++){let s=e[t][0],r=e[t][1],i=e[t][2];for(let e=s;e<r+1;e++)this.goldbergData.faceColors[e]=i}let t=[];for(let e=0;e<12;e++)for(let s=0;s<5;s++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);for(let e=12;e<this.goldbergData.faceColors.length;e++)for(let s=0;s<6;s++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);return t}setGoldbergFaceColors(e){let t=this._changeGoldbergFaceColors(e);this.setVerticesData(a.VertexBuffer.ColorKind,t)}updateGoldbergFaceColors(e){let t=this._changeGoldbergFaceColors(e);this.updateVerticesData(a.VertexBuffer.ColorKind,t)}_changeGoldbergFaceUVs(e){let t=this.getVerticesData(a.VertexBuffer.UVKind);for(let s=0;s<e.length;s++){let r,i,a=e[s][0],o=e[s][1],n=e[s][2],l=e[s][3],h=e[s][4],c=[],u=[];for(let e=0;e<5;e++)r=n.x+l*Math.cos(h+e*Math.PI/2.5),i=n.y+l*Math.sin(h+e*Math.PI/2.5),r<0&&(r=0),r>1&&(r=1),c.push(r,i);for(let e=0;e<6;e++)r=n.x+l*Math.cos(h+e*Math.PI/3),i=n.y+l*Math.sin(h+e*Math.PI/3),r<0&&(r=0),r>1&&(r=1),u.push(r,i);for(let e=a;e<Math.min(12,o+1);e++)for(let s=0;s<5;s++)t[10*e+2*s]=c[2*s],t[10*e+2*s+1]=c[2*s+1];for(let e=Math.max(12,a);e<o+1;e++)for(let s=0;s<6;s++)t[12*e-24+2*s]=u[2*s],t[12*e-23+2*s]=u[2*s+1]}return t}setGoldbergFaceUVs(e){let t=this._changeGoldbergFaceUVs(e);this.setVerticesData(a.VertexBuffer.UVKind,t)}updateGoldbergFaceUVs(e){let t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(a.VertexBuffer.UVKind,t)}placeOnGoldbergFaceAt(e,t,s){e.rotation=r.Vector3.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]),e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(s.x)).add(this.goldbergData.faceYaxis[t].scale(s.y)).add(this.goldbergData.faceZaxis[t].scale(s.z))}serialize(e){super.serialize(e),e.type="GoldbergMesh";let t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors)for(let e of(t.faceColors=[],this.goldbergData.faceColors))t.faceColors.push(e.asArray());if(this.goldbergData.faceCenters)for(let e of(t.faceCenters=[],this.goldbergData.faceCenters))t.faceCenters.push(e.asArray());if(this.goldbergData.faceZaxis)for(let e of(t.faceZaxis=[],this.goldbergData.faceZaxis))t.faceZaxis.push(e.asArray());if(this.goldbergData.faceYaxis)for(let e of(t.faceYaxis=[],this.goldbergData.faceYaxis))t.faceYaxis.push(e.asArray());if(this.goldbergData.faceXaxis)for(let e of(t.faceXaxis=[],this.goldbergData.faceXaxis))t.faceXaxis.push(e.asArray());e.goldbergData=t}static Parse(e,t){let s=e.goldbergData;s.faceColors=s.faceColors.map(e=>h.Color4.FromArray(e)),s.faceCenters=s.faceCenters.map(e=>r.Vector3.FromArray(e)),s.faceZaxis=s.faceZaxis.map(e=>r.Vector3.FromArray(e)),s.faceXaxis=s.faceXaxis.map(e=>r.Vector3.FromArray(e)),s.faceYaxis=s.faceYaxis.map(e=>r.Vector3.FromArray(e));let i=new Q(e.name,t);return i.goldbergData=s,i}}var q=e.i(66235);class j{constructor(e){this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){this._currentPath=new T.Path2(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,s,r){this._currentPath.addQuadraticCurveTo(e,t,s,r,this._resolution)}bezierCurveTo(e,t,s,r,i,a){this._currentPath.addBezierCurveTo(e,t,s,r,i,a,this._resolution)}extractHoles(){for(let e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){let e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}e.s(["MeshBuilder",0,{CreateBox:function(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],s=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],i=[],a=e.width||e.size||1,l=e.height||e.size||1,c=e.depth||e.size||1,u=e.wrap||!1,d=void 0===e.topBaseAt?1:e.topBaseAt,p=void 0===e.bottomBaseAt?0:e.bottomBaseAt;d=(d+4)%4,p=(p+4)%4;let f=[2,0,3,1][d],x=[2,0,1,3][p],g=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(u){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],g=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];let e=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],s=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]],r=[17,18,19,16],i=[22,23,20,21];for(;f>0;)e.unshift(e.pop()),r.unshift(r.pop()),f--;for(;x>0;)s.unshift(s.pop()),i.unshift(i.pop()),x--;e=e.flat(),s=s.flat(),g=g.concat(e).concat(s),t.push(r[0],r[2],r[3],r[0],r[1],r[2]),t.push(i[0],i[2],i[3],i[0],i[1],i[2])}let m=[a/2,l/2,c/2],V=g.reduce((e,t,s)=>e.concat(t*m[s%3]),[]),O=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,_=e.faceUV||Array(6),M=e.faceColors,y=[];for(let e=0;e<6;e++)void 0===_[e]&&(_[e]=new r.Vector4(0,0,1,1)),M&&void 0===M[e]&&(M[e]=new h.Color4(1,1,1,1));for(let e=0;e<6;e++)if(i.push(_[e].z,n.useOpenGLOrientationForUV?1-_[e].w:_[e].w),i.push(_[e].x,n.useOpenGLOrientationForUV?1-_[e].w:_[e].w),i.push(_[e].x,n.useOpenGLOrientationForUV?1-_[e].y:_[e].y),i.push(_[e].z,n.useOpenGLOrientationForUV?1-_[e].y:_[e].y),M)for(let t=0;t<4;t++)y.push(M[e].r,M[e].g,M[e].b,M[e].a);o.VertexData._ComputeSides(O,V,t,s,i,e.frontUVs,e.backUVs);let T=new o.VertexData;return T.indices=t,T.positions=V,T.normals=s,T.uvs=i,M&&(T.colors=O===o.VertexData.DOUBLESIDE?y.concat(y):y),T})(t).applyToMesh(a,t.updatable),a},CreateTiledBox:function(e,t,s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,u(t).applyToMesh(r,t.updatable),r},CreateSphere:function(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=0|(e.segments||32),s=e.diameterX||e.diameter||1,i=e.diameterY||e.diameter||1,a=e.diameterZ||e.diameter||1,l=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,h=e.slice&&e.slice<=0?1:e.slice||1,c=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,u=!!e.dedupTopBottomIndices,d=new r.Vector3(s/2,i/2,a/2),p=2+t,f=2*p,x=[],g=[],m=[],V=[];for(let e=0;e<=p;e++){let t=e/p,s=t*Math.PI*h;for(let e=0;e<=f;e++){let i=e/f,a=i*Math.PI*2*l,o=r.Matrix.RotationZ(-s),h=r.Matrix.RotationY(a),c=r.Vector3.TransformCoordinates(r.Vector3.Up(),o),u=r.Vector3.TransformCoordinates(c,h),p=u.multiply(d),x=u.divide(d).normalize();g.push(p.x,p.y,p.z),m.push(x.x,x.y,x.z),V.push(i,n.useOpenGLOrientationForUV?1-t:t)}if(e>0){let t=g.length/3;for(let s=t-2*(f+1);s+f+2<t;s++)u?(e>1&&(x.push(s),x.push(s+1),x.push(s+f+1)),(e<p||h<1)&&(x.push(s+f+1),x.push(s+1),x.push(s+f+2))):(x.push(s),x.push(s+1),x.push(s+f+1),x.push(s+f+1),x.push(s+1),x.push(s+f+2))}}o.VertexData._ComputeSides(c,g,x,m,V,e.frontUVs,e.backUVs);let O=new o.VertexData;return O.indices=x,O.positions=g,O.normals=m,O.uvs=V,O})(t).applyToMesh(a,t.updatable),a},CreateDisc:function(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=[],s=[],r=[],i=[],a=e.radius||.5,l=e.tessellation||64,h=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,c=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;t.push(0,0,0),i.push(.5,.5);let u=2*Math.PI*h,d=1===h?u/l:u/(l-1),p=0;for(let e=0;e<l;e++){let e=Math.cos(p),s=Math.sin(p),r=(e+1)/2,o=(1-s)/2;t.push(a*e,a*s,0),i.push(r,n.useOpenGLOrientationForUV?1-o:o),p+=d}1===h&&(t.push(t[3],t[4],t[5]),i.push(i[2],n.useOpenGLOrientationForUV?1-i[3]:i[3]));let f=t.length/3;for(let e=1;e<f-1;e++)s.push(e+1,0,e);o.VertexData.ComputeNormals(t,s,r),o.VertexData._ComputeSides(c,t,s,r,i,e.frontUVs,e.backUVs);let x=new o.VertexData;return x.indices=s,x.positions=t,x.normals=r,x.uvs=i,x})(t).applyToMesh(r,t.updatable),r},CreateIcoSphere:function(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s=e.sideOrientation||o.VertexData.DEFAULTSIDE,i=e.radius||1,a=void 0===e.flat||e.flat,l=0|(e.subdivisions||4),h=e.radiusX||i,c=e.radiusY||i,u=e.radiusZ||i,d=(1+Math.sqrt(5))/2,p=[-1,d,-0,1,d,0,-1,-d,0,1,-d,0,0,-1,-d,0,1,-d,0,-1,d,0,1,d,d,0,1,d,0,-1,-d,0,1,-d,0,-1],f=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],x=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],g=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],m=138/1024,V=239/1024,O=60/1024,_=26/1024,M=-40/1024,y=20/1024,T=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],v=[],b=[],A=[],I=[],D=0,w=[,,,],F=[,,,];for(t=0;t<3;t++)w[t]=r.Vector3.Zero(),F[t]=r.Vector2.Zero();for(let e=0;e<20;e++){for(t=0;t<3;t++){let s=f[3*e+t];w[t].copyFromFloats(p[3*x[s]],p[3*x[s]+1],p[3*x[s]+2]),w[t].normalize(),F[t].copyFromFloats(g[2*s]*m+O+T[e]*M,g[2*s+1]*V+_+T[e]*y)}let s=(e,t,s,i)=>{let o,d=r.Vector3.Lerp(w[0],w[2],t/l),p=r.Vector3.Lerp(w[1],w[2],t/l),f=l===t?w[2]:r.Vector3.Lerp(d,p,e/(l-t));if(f.normalize(),a){let e=r.Vector3.Lerp(w[0],w[2],i/l),t=r.Vector3.Lerp(w[1],w[2],i/l);o=r.Vector3.Lerp(e,t,s/(l-i))}else o=new r.Vector3(f.x,f.y,f.z);o.x/=h,o.y/=c,o.z/=u,o.normalize();let x=r.Vector2.Lerp(F[0],F[2],t/l),g=r.Vector2.Lerp(F[1],F[2],t/l),m=l===t?F[2]:r.Vector2.Lerp(x,g,e/(l-t));b.push(f.x*h,f.y*c,f.z*u),A.push(o.x,o.y,o.z),I.push(m.x,n.useOpenGLOrientationForUV?1-m.y:m.y),v.push(D),D++};for(let e=0;e<l;e++)for(let t=0;t+e<l;t++)s(t,e,t+1/3,e+1/3),s(t+1,e,t+1/3,e+1/3),s(t,e+1,t+1/3,e+1/3),t+e+1<l&&(s(t+1,e,t+2/3,e+2/3),s(t+1,e+1,t+2/3,e+2/3),s(t,e+1,t+2/3,e+2/3))}o.VertexData._ComputeSides(s,b,v,A,I,e.frontUVs,e.backUVs);let P=new o.VertexData;return P.indices=v,P.positions=b,P.normals=A,P.uvs=I,P})(t).applyToMesh(a,t.updatable),a},CreateRibbon:l,CreateCylinder:function(e,t={},s){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s,a,l,c,u,p,f,x,g=e.height||2,m=0===e.diameterTop?0:e.diameterTop||e.diameter||1,V=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;m=m||1e-5,V=V||1e-5;let O=0|(e.tessellation||24),_=0|(e.subdivisions||1),M=!!e.hasRings,y=!!e.enclose,T=0===e.cap?0:e.cap||i.Mesh.CAP_ALL,v=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,b=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,A=e.faceUV||[,,,],I=e.faceColors,D=2+(1+(1!==v&&y?2:0))*(M?_:1);for(t=0;t<D;t++)I&&void 0===I[t]&&(I[t]=new h.Color4(1,1,1,1));for(t=0;t<D;t++)A&&void 0===A[t]&&(A[t]=new r.Vector4(0,0,1,1));let w=[],F=[],P=[],L=[],z=[],B=2*Math.PI*v/O,C=(V-m)/2/g,E=r.Vector3.Zero(),S=r.Vector3.Zero(),R=r.Vector3.Zero(),U=r.Vector3.Zero(),N=r.Vector3.Zero(),W=d.Axis.Y,G=1,H=0;for(c=0;c<=_;c++)for(p=0,l=((a=c/_)*(m-V)+V)/2,f=M&&0!==c&&c!==_?2:1;p<f;p++){for(M&&(G+=p),y&&(G+=2*p),u=0;u<=O;u++)E.x=Math.cos(-(s=u*B))*l,E.y=-g/2+a*g,E.z=Math.sin(-s)*l,0===m&&c===_?(S.x=P[P.length-(O+1)*3],S.y=P[P.length-(O+1)*3+1],S.z=P[P.length-(O+1)*3+2]):(S.x=E.x,S.z=E.z,S.y=Math.sqrt(S.x*S.x+S.z*S.z)*C,S.normalize()),0===u&&(R.copyFrom(E),U.copyFrom(S)),F.push(E.x,E.y,E.z),P.push(S.x,S.y,S.z),x=M?H!==G?A[G].y:A[G].w:A[G].y+(A[G].w-A[G].y)*a,L.push(A[G].x+(A[G].z-A[G].x)*u/O,n.useOpenGLOrientationForUV?1-x:x),I&&z.push(I[G].r,I[G].g,I[G].b,I[G].a);1!==v&&y&&(F.push(E.x,E.y,E.z),F.push(0,E.y,0),F.push(0,E.y,0),F.push(R.x,R.y,R.z),r.Vector3.CrossToRef(W,S,N),N.normalize(),P.push(N.x,N.y,N.z,N.x,N.y,N.z),r.Vector3.CrossToRef(U,W,N),N.normalize(),P.push(N.x,N.y,N.z,N.x,N.y,N.z),x=M?H!==G?A[G+1].y:A[G+1].w:A[G+1].y+(A[G+1].w-A[G+1].y)*a,L.push(A[G+1].x,n.useOpenGLOrientationForUV?1-x:x),L.push(A[G+1].z,n.useOpenGLOrientationForUV?1-x:x),x=M?H!==G?A[G+2].y:A[G+2].w:A[G+2].y+(A[G+2].w-A[G+2].y)*a,L.push(A[G+2].x,n.useOpenGLOrientationForUV?1-x:x),L.push(A[G+2].z,n.useOpenGLOrientationForUV?1-x:x),I&&(z.push(I[G+1].r,I[G+1].g,I[G+1].b,I[G+1].a),z.push(I[G+1].r,I[G+1].g,I[G+1].b,I[G+1].a),z.push(I[G+2].r,I[G+2].g,I[G+2].b,I[G+2].a),z.push(I[G+2].r,I[G+2].g,I[G+2].b,I[G+2].a))),H!==G&&(H=G)}let Z=1!==v&&y?O+4:O;for(G=0,c=0;G<_;G++){let e=0,t=0,s=0,r=0;for(u=0;u<O;u++)e=c*(Z+1)+u,t=(c+1)*(Z+1)+u,s=c*(Z+1)+(u+1),r=(c+1)*(Z+1)+(u+1),w.push(e,t,s),w.push(r,s,t);1!==v&&y&&(w.push(e+2,t+2,s+2),w.push(r+2,s+2,t+2),w.push(e+4,t+4,s+4),w.push(r+4,s+4,t+4)),c=M?c+2:c+1}let X=e=>{let t,s,i,a=e?m/2:V/2;if(0===a)return;let o=e?A[D-1]:A[0],l=null;I&&(l=e?I[D-1]:I[0]);let h=F.length/3,c=e?g/2:-g/2,u=new r.Vector3(0,c,0);F.push(u.x,u.y,u.z),P.push(0,e?1:-1,0);let d=o.y+(o.w-o.y)*.5;L.push(o.x+(o.z-o.x)*.5,n.useOpenGLOrientationForUV?1-d:d),l&&z.push(l.r,l.g,l.b,l.a);let p=new r.Vector2(.5,.5);for(i=0;i<=O;i++){let h=Math.cos(-(t=2*Math.PI*i*v/O)),u=Math.sin(-t);s=new r.Vector3(h*a,c,u*a);let d=new r.Vector2(h*p.x+.5,u*p.y+.5);F.push(s.x,s.y,s.z),P.push(0,e?1:-1,0);let f=o.y+(o.w-o.y)*d.y;L.push(o.x+(o.z-o.x)*d.x,n.useOpenGLOrientationForUV?1-f:f),l&&z.push(l.r,l.g,l.b,l.a)}for(i=0;i<O;i++)e?(w.push(h),w.push(h+(i+2)),w.push(h+(i+1))):(w.push(h),w.push(h+(i+1)),w.push(h+(i+2)))};(T===i.Mesh.CAP_START||T===i.Mesh.CAP_ALL)&&X(!1),(T===i.Mesh.CAP_END||T===i.Mesh.CAP_ALL)&&X(!0),o.VertexData._ComputeSides(b,F,w,P,L,e.frontUVs,e.backUVs);let k=new o.VertexData;return k.indices=w,k.positions=F,k.normals=P,k.uvs=L,I&&(k.colors=z),k})(t).applyToMesh(a,t.updatable),a},CreateTorus:function(e,t={},s){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=[],s=[],i=[],a=[],l=e.diameter||1,h=e.thickness||.5,c=0|(e.tessellation||16),u=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,d=c+1;for(let e=0;e<=c;e++){let o=e/c,u=e*Math.PI*2/c-Math.PI/2,p=r.Matrix.Translation(l/2,0,0).multiply(r.Matrix.RotationY(u));for(let l=0;l<=c;l++){let u=1-l/c,f=l*Math.PI*2/c+Math.PI,x=Math.cos(f),g=Math.sin(f),m=new r.Vector3(x,g,0),V=m.scale(h/2),O=new r.Vector2(o,u);V=r.Vector3.TransformCoordinates(V,p),m=r.Vector3.TransformNormal(m,p),s.push(V.x,V.y,V.z),i.push(m.x,m.y,m.z),a.push(O.x,n.useOpenGLOrientationForUV?1-O.y:O.y);let _=(e+1)%d,M=(l+1)%d;t.push(e*d+l),t.push(e*d+M),t.push(_*d+l),t.push(e*d+M),t.push(_*d+M),t.push(_*d+l)}}o.VertexData._ComputeSides(u,s,t,i,a,e.frontUVs,e.backUVs);let p=new o.VertexData;return p.indices=t,p.positions=s,p.normals=i,p.uvs=a,p})(t).applyToMesh(a,t.updatable),a},CreateTorusKnot:function(e,t={},s){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s,i=[],a=[],l=[],h=[],c=e.radius||2,u=e.tube||.5,d=e.radialSegments||32,p=e.tubularSegments||32,f=e.p||2,x=e.q||3,g=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,m=e=>{let t=Math.cos(e),s=Math.sin(e),i=x/f*e,a=Math.cos(i),o=c*Math.sin(i)*.5;return new r.Vector3(c*(2+a)*.5*t,c*(2+a)*s*.5,o)};for(t=0;t<=d;t++){let e=t%d/d*2*f*Math.PI,i=m(e),o=m(e+.01),l=o.subtract(i),c=o.add(i),x=r.Vector3.Cross(l,c);for(c=r.Vector3.Cross(x,l),x.normalize(),c.normalize(),s=0;s<p;s++){let e=s%p/p*2*Math.PI,r=-u*Math.cos(e),o=u*Math.sin(e);a.push(i.x+r*c.x+o*x.x),a.push(i.y+r*c.y+o*x.y),a.push(i.z+r*c.z+o*x.z),h.push(t/d),h.push(n.useOpenGLOrientationForUV?1-s/p:s/p)}}for(t=0;t<d;t++)for(s=0;s<p;s++){let e=(s+1)%p,r=t*p+s,a=(t+1)*p+s,o=(t+1)*p+e,n=t*p+e;i.push(n),i.push(a),i.push(r),i.push(n),i.push(o),i.push(a)}o.VertexData.ComputeNormals(a,i,l),o.VertexData._ComputeSides(g,a,i,l,h,e.frontUVs,e.backUVs);let V=new o.VertexData;return V.indices=i,V.positions=a,V.normals=l,V.uvs=h,V})(t).applyToMesh(a,t.updatable),a},CreateLineSystem:M,CreateLines:function(e,t,s=null){let r=t.colors?[t.colors]:null;return M(e,{lines:[t.points],updatable:t.updatable,instance:t.instance,colors:r,useVertexAlpha:t.useVertexAlpha,material:t.material},s)},CreateDashedLines:function(e,t,s=null){let a=t.points,n=t.instance,l=t.gapSize||1,h=t.dashSize||3;if(n)return(t.dashNb||t.dashSize||t.gapSize||t.useVertexAlpha||t.material)&&_.Logger.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),n.updateMeshPositions(e=>{let t,s,i,o,l=r.Vector3.Zero(),h=e.length/6,c=0,u=0;for(i=0;i<a.length-1;i++)a[i+1].subtractToRef(a[i],l),c+=l.length();let d=c/h,p=n._creationDataStorage.dashSize,f=p*d/(p+n._creationDataStorage.gapSize);for(i=0;i<a.length-1;i++)for(a[i+1].subtractToRef(a[i],l),t=Math.floor(l.length()/d),l.normalize(),o=0;o<t&&u<e.length;)s=d*o,e[u]=a[i].x+s*l.x,e[u+1]=a[i].y+s*l.y,e[u+2]=a[i].z+s*l.z,e[u+3]=a[i].x+(s+f)*l.x,e[u+4]=a[i].y+(s+f)*l.y,e[u+5]=a[i].z+(s+f)*l.z,u+=6,o++;for(;u<e.length;)e[u]=a[i].x,e[u+1]=a[i].y,e[u+2]=a[i].z,u+=3},!1),n;let c=new V(e,s,null,void 0,void 0,void 0,t.useVertexAlpha,t.material);return(function(e){let t,s,i,a=e.dashSize||3,n=e.gapSize||1,l=e.dashNb||200,h=e.points,c=[],u=[],d=r.Vector3.Zero(),p=0,f=0;for(i=0;i<h.length-1;i++)h[i+1].subtractToRef(h[i],d),p+=d.length();let x=p/l,g=a*x/(a+n);for(i=0;i<h.length-1;i++){h[i+1].subtractToRef(h[i],d),t=Math.floor(d.length()/x),d.normalize();for(let e=0;e<t;e++)s=x*e,c.push(h[i].x+s*d.x,h[i].y+s*d.y,h[i].z+s*d.z),c.push(h[i].x+(s+g)*d.x,h[i].y+(s+g)*d.y,h[i].z+(s+g)*d.z),u.push(f,f+1),f+=2}let m=new o.VertexData;return m.positions=c,m.indices=u,m})(t).applyToMesh(c,t.updatable),c._creationDataStorage=new i._CreationDataStorage,c._creationDataStorage.dashSize=h,c._creationDataStorage.gapSize=l,c},ExtrudeShape:function(e,t,s=null){let r=t.path,a=t.shape,o=t.scale||1,n=t.rotation||0,l=0===t.cap?0:t.cap||i.Mesh.NO_CAP,h=t.updatable,c=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),u=t.instance||null,d=t.invertUV||!1,p=t.closeShape||!1,f=t.closePath||!1,x=t.capFunction||null;return P(e,a,r,o,n,null,null,f,p,l,!1,s,!!h,c,u,d,t.frontUVs||null,t.backUVs||null,t.firstNormal||null,!!t.adjustFrame,x)},ExtrudeShapeCustom:function(e,t,s=null){let a=t.path,o=t.shape,n=r.Vector3.Zero(),l=t.rotationFunction||(()=>0),h=t.closePath||t.ribbonCloseArray||!1,c=t.closeShape||t.ribbonClosePath||!1,u=0===t.cap?0:t.cap||i.Mesh.NO_CAP,d=t.updatable,p=t.firstNormal||null,f=t.adjustFrame||!1,x=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),g=t.instance,m=t.invertUV||!1,V=t.capFunction||null;return P(e,o,a,null,null,t.scaleVectorFunction??((e,s)=>{let r=t.scaleFunction?.(e,s)??1;return n.copyFromFloats(r,r,r)}),l,h,c,u,!0,s,!!d,x,g||null,m,t.frontUVs||null,t.backUVs||null,p,f,V||null)},CreateLathe:function(e,t,s=null){let a,o,n,h,c=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,u=void 0===t.closed||t.closed,d=t.shape,p=t.radius||1,f=t.tessellation||64,x=t.clip||0,g=t.updatable,m=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),V=t.cap||i.Mesh.NO_CAP,O=2*Math.PI,_=[],M=t.invertUV||!1,y=O/f*c;for(a=0;a<=f-x;a++){for(h=[],(V==i.Mesh.CAP_START||V==i.Mesh.CAP_ALL)&&(h.push(new r.Vector3(0,d[0].y,0)),h.push(new r.Vector3(Math.cos(a*y)*d[0].x*p,d[0].y,Math.sin(a*y)*d[0].x*p))),o=0;o<d.length;o++)n=new r.Vector3(Math.cos(a*y)*d[o].x*p,d[o].y,Math.sin(a*y)*d[o].x*p),h.push(n);(V==i.Mesh.CAP_END||V==i.Mesh.CAP_ALL)&&(h.push(new r.Vector3(Math.cos(a*y)*d[d.length-1].x*p,d[d.length-1].y,Math.sin(a*y)*d[d.length-1].x*p)),h.push(new r.Vector3(0,d[d.length-1].y,0))),_.push(h)}return l(e,{pathArray:_,closeArray:u,sideOrientation:m,updatable:g,invertUV:M,frontUVs:t.frontUVs,backUVs:t.backUVs},s)},CreateTiledPlane:function(e,t,s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,c(t).applyToMesh(r,t.updatable),r},CreatePlane:function(e,t={},s=null){let r,a,l,h,c,u,d,p,f,x,g=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),g._originalBuilderSideOrientation=t.sideOrientation,(r=[],a=[],l=[],h=[],c=void 0!==t.width?t.width:void 0!==t.size?t.size:1,u=void 0!==t.height?t.height:void 0!==t.size?t.size:1,d=0===t.sideOrientation?0:t.sideOrientation||o.VertexData.DEFAULTSIDE,p=c/2,f=u/2,a.push(-p,-f,0),l.push(0,0,-1),h.push(0,+!!n.useOpenGLOrientationForUV),a.push(p,-f,0),l.push(0,0,-1),h.push(1,+!!n.useOpenGLOrientationForUV),a.push(p,f,0),l.push(0,0,-1),h.push(1,+!n.useOpenGLOrientationForUV),a.push(-p,f,0),l.push(0,0,-1),h.push(0,+!n.useOpenGLOrientationForUV),r.push(0),r.push(1),r.push(2),r.push(0),r.push(2),r.push(3),o.VertexData._ComputeSides(d,a,r,l,h,t.frontUVs,t.backUVs),(x=new o.VertexData).indices=r,x.positions=a,x.normals=l,x.uvs=h,x).applyToMesh(g,t.updatable),t.sourcePlane&&(g.translate(t.sourcePlane.normal,-t.sourcePlane.d),g.setDirection(t.sourcePlane.normal.scale(-1))),g},CreateGround:function(e,t={},s){let i=new z(e,s);return i._setReady(!1),i._subdivisionsX=t.subdivisionsX||t.subdivisions||1,i._subdivisionsY=t.subdivisionsY||t.subdivisions||1,i._width=t.width||1,i._height=t.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,(function(e){let t,s,i=[],a=[],l=[],h=[],c=e.width||e.size||1,u=e.height||e.size||1,d=0|(e.subdivisionsX||e.subdivisions||1),p=0|(e.subdivisionsY||e.subdivisions||1);for(t=0;t<=p;t++)for(s=0;s<=d;s++){let e=new r.Vector3(s*c/d-c/2,0,(p-t)*u/p-u/2),i=new r.Vector3(0,1,0);a.push(e.x,e.y,e.z),l.push(i.x,i.y,i.z),h.push(s/d,n.useOpenGLOrientationForUV?t/p:1-t/p)}for(t=0;t<p;t++)for(s=0;s<d;s++)i.push(s+1+(t+1)*(d+1)),i.push(s+1+t*(d+1)),i.push(s+t*(d+1)),i.push(s+(t+1)*(d+1)),i.push(s+1+(t+1)*(d+1)),i.push(s+t*(d+1));let f=new o.VertexData;return f.indices=i,f.positions=a,f.normals=l,f.uvs=h,f})(t).applyToMesh(i,t.updatable),i._setReady(!0),i},CreateTiledGround:function(e,t,s=null){let a=new i.Mesh(e,s);return(function(e){let t,s,i,a,n=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,l=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,h=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,c=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,u=e.subdivisions||{w:1,h:1},d=e.precision||{w:1,h:1},p=[],f=[],x=[],g=[];u.h=u.h<1?1:u.h,u.w=u.w<1?1:u.w,d.w=d.w<1?1:d.w,d.h=d.h<1?1:d.h;let m={w:(h-n)/u.w,h:(c-l)/u.h};for(i=0;i<u.h;i++)for(a=0;a<u.w;a++)!function(e,i,a,o){let n=f.length/3,l=d.w+1;for(t=0;t<d.h;t++)for(s=0;s<d.w;s++){let e=[n+s+t*l,n+(s+1)+t*l,n+(s+1)+(t+1)*l,n+s+(t+1)*l];p.push(e[1]),p.push(e[2]),p.push(e[3]),p.push(e[0]),p.push(e[1]),p.push(e[3])}let h=r.Vector3.Zero(),c=new r.Vector3(0,1,0);for(t=0;t<=d.h;t++)for(s=0,h.z=t*(o-i)/d.h+i;s<=d.w;s++)h.x=s*(a-e)/d.w+e,h.y=0,f.push(h.x,h.y,h.z),x.push(c.x,c.y,c.z),g.push(s/d.w,t/d.h)}(n+a*m.w,l+i*m.h,n+(a+1)*m.w,l+(i+1)*m.h);let V=new o.VertexData;return V.indices=p,V.positions=f,V.normals=x,V.uvs=g,V})(t).applyToMesh(a,t.updatable),a},CreateGroundFromHeightMap:function(e,t,s={},i=null){let a,n=s.width||10,l=s.height||10,c=s.subdivisions||1,u=s.minHeight||0,d=s.maxHeight||1,p=s.colorFilter||new h.Color3(.3,.59,.11),f=s.alphaFilter||0,x=s.updatable,g=s.onReady,m=new z(e,i=i||b.EngineStore.LastCreatedScene);m._subdivisionsX=c,m._subdivisionsY=c,m._width=n,m._height=l,m._maxX=m._width/2,m._maxZ=m._height/2,m._minX=-m._maxX,m._minZ=-m._maxZ,m._setReady(!1),s.passHeightBufferInCallback&&(a=new Float32Array((c+1)*(c+1)));let V=(e,t,s)=>{(function(e){let t,s,i=[],a=[],n=[],l=[],c=e.colorFilter||new h.Color3(.3,.59,.11),u=e.alphaFilter||0,d=!1;if(e.minHeight>e.maxHeight){d=!0;let t=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=t}for(t=0;t<=e.subdivisions;t++)for(s=0;s<=e.subdivisions;s++){let i=new r.Vector3(s*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),o=(((i.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(i.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth)*4,h=e.buffer[o]/255,p=e.buffer[o+1]/255,f=e.buffer[o+2]/255,x=e.buffer[o+3]/255;d&&(h=1-h,p=1-p,f=1-f);let g=h*c.r+p*c.g+f*c.b;x>=u?i.y=e.minHeight+(e.maxHeight-e.minHeight)*g:i.y=e.minHeight-v.Epsilon,e.heightBuffer&&(e.heightBuffer[t*(e.subdivisions+1)+s]=i.y),a.push(i.x,i.y,i.z),n.push(0,0,0),l.push(s/e.subdivisions,1-t/e.subdivisions)}for(t=0;t<e.subdivisions;t++)for(s=0;s<e.subdivisions;s++){let r=s+1+(t+1)*(e.subdivisions+1),o=s+1+t*(e.subdivisions+1),n=s+t*(e.subdivisions+1),l=s+(t+1)*(e.subdivisions+1),h=a[3*r+1]>=e.minHeight,c=a[3*o+1]>=e.minHeight,u=a[3*n+1]>=e.minHeight;h&&c&&u&&(i.push(r),i.push(o),i.push(n)),a[3*l+1]>=e.minHeight&&h&&u&&(i.push(l),i.push(r),i.push(n))}o.VertexData.ComputeNormals(a,i,n);let p=new o.VertexData;return p.indices=i,p.positions=a,p.normals=n,p.uvs=l,p})({width:n,height:l,subdivisions:c,minHeight:u,maxHeight:d,colorFilter:p,buffer:e,bufferWidth:t,bufferHeight:s,alphaFilter:f,heightBuffer:a}).applyToMesh(m,x),g&&g(m,a),m._setReady(!0)};return"string"==typeof t?(i.addPendingData(m),B.Tools.LoadImage(t,e=>{let t=e.width,s=e.height;i.isDisposed||V(i?.getEngine().resizeImageBitmap(e,t,s),t,s),i.removePendingData(m)},(e,t)=>{i.removePendingData(m),s.onError&&s.onError(e,t)},i.offlineProvider)):V(t.data,t.width,t.height),m},CreatePolygon:w,ExtrudePolygon:F,CreateTube:function(e,t,s=null){let a,o,n=t.path,h=t.instance,c=1;void 0!==t.radius?c=t.radius:h&&(c=h._creationDataStorage.radius);let u=t.tessellation||64,d=t.radiusFunction||null,p=t.cap||i.Mesh.NO_CAP,f=t.invertUV||!1,x=t.updatable,g=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;let m=(e,t,s,a,o,n,l,h)=>{let c,u,d,p,f=t.getTangents(),x=t.getNormals(),g=t.getDistances(),m=2*Math.PI/o*h,V=n||(()=>a),O=r.TmpVectors.Matrix[0],_=2*(l!==i.Mesh.NO_CAP&&l!==i.Mesh.CAP_END);for(let t=0;t<e.length;t++){u=V(t,g[t]),c=[],d=x[t];for(let s=0;s<o;s++)r.Matrix.RotationAxisToRef(f[t],m*s,O),p=c[s]?c[s]:r.Vector3.Zero(),r.Vector3.TransformCoordinatesToRef(d,O,p),p.scaleInPlace(u).addInPlace(e[t]),c[s]=p;s[_]=c,_++}let M=(t,s)=>{let r=[];for(let i=0;i<t;i++)r.push(e[s]);return r};switch(l){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:s[0]=M(o,0),s[1]=s[2].slice(0);break;case i.Mesh.CAP_END:s[_]=s[_-1].slice(0),s[_+1]=M(o,e.length-1);break;case i.Mesh.CAP_ALL:s[0]=M(o,0),s[1]=s[2].slice(0),s[_]=s[_-1].slice(0),s[_+1]=M(o,e.length-1)}return s};if(h){let e=h._creationDataStorage,s=t.arc||e.arc;return a=e.path3D.update(n),h=l("",{pathArray:o=m(n,a,e.pathArray,c,e.tessellation,d,e.cap,s),instance:h}),e.path3D=a,e.pathArray=o,e.arc=s,e.radius=c,h}a=new T.Path3D(n);let V=l(e,{pathArray:o=m(n,a,[],c,u,d,p=p<0||p>3?0:p,t.arc),closePath:!0,closeArray:!1,updatable:x,sideOrientation:g,invertUV:f,frontUVs:t.frontUVs,backUVs:t.backUVs},s);return V._creationDataStorage.pathArray=o,V._creationDataStorage.path3D=a,V._creationDataStorage.tessellation=u,V._creationDataStorage.cap=p,V._creationDataStorage.arc=t.arc,V._creationDataStorage.radius=c,V},CreatePolyhedron:C,CreateGeodesic:function(e,t,s=null){let r=t.m||1;r!==Math.floor(r)&&(r=Math.floor(r),_.Logger.Warn("m not an integer only floor(m) used"));let i=t.n||0;if(i!==Math.floor(i)&&(i=Math.floor(i),_.Logger.Warn("n not an integer only floor(n) used")),i>r){let e=i;i=r,r=e,_.Logger.Warn("n > m therefore m and n swapped")}let a=new X;return a.build(r,i),C(e,{custom:Y.BuildGeodesicData(a),size:t.size,sizeX:t.sizeX,sizeY:t.sizeY,sizeZ:t.sizeZ,faceUV:t.faceUV,faceColors:t.faceColors,flat:t.flat,updatable:t.updatable,sideOrientation:t.sideOrientation,frontUVs:t.frontUVs,backUVs:t.backUVs},s)},CreateGoldberg:function(e,t,s=null){let a=t.size,l=t.sizeX||a||1,c=t.sizeY||a||1,u=t.sizeZ||a||1,d=t.m||1;d!==Math.floor(d)&&(d=Math.floor(d),_.Logger.Warn("m not an integer only floor(m) used"));let p=t.n||0;if(p!==Math.floor(p)&&(p=Math.floor(p),_.Logger.Warn("n not an integer only floor(n) used")),p>d){let e=p;p=d,d=e,_.Logger.Warn("n > m therefore m and n swapped")}let f=new X;f.build(d,p);let x=Y.BuildGeodesicData(f),g=x.toGoldbergPolyhedronData(),m=new Q(e,s);t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),m._originalBuilderSideOrientation=t.sideOrientation,(function(e,t){let s=e.size,i=e.sizeX||s||1,a=e.sizeY||s||1,l=e.sizeZ||s||1,h=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,c=[],u=[],d=[],p=[],f=1/0,x=-1/0,g=1/0,m=-1/0;for(let e=0;e<t.vertex.length;e++)f=Math.min(f,t.vertex[e][0]*i),x=Math.max(x,t.vertex[e][0]*i),g=Math.min(g,t.vertex[e][1]*a),m=Math.max(m,t.vertex[e][1]*a);let V=0;for(let e=0;e<t.face.length;e++){let s=t.face[e],o=r.Vector3.FromArray(t.vertex[s[0]]),h=r.Vector3.FromArray(t.vertex[s[2]]),O=r.Vector3.FromArray(t.vertex[s[1]]),_=h.subtract(o),M=O.subtract(o),y=r.Vector3.Cross(M,_).normalize();for(let e=0;e<s.length;e++){d.push(y.x,y.y,y.z);let r=t.vertex[s[e]];c.push(r[0]*i,r[1]*a,r[2]*l);let o=(r[1]*a-g)/(m-g);p.push((r[0]*i-f)/(x-f),n.useOpenGLOrientationForUV?1-o:o)}for(let e=0;e<s.length-2;e++)u.push(V,V+e+2,V+e+1);V+=s.length}o.VertexData._ComputeSides(h,c,u,d,p);let O=new o.VertexData;return O.positions=c,O.indices=u,O.normals=d,O.uvs=p,O})(t,g).applyToMesh(m,t.updatable),m.goldbergData.nbSharedFaces=x.sharedNodes,m.goldbergData.nbUnsharedFaces=x.poleNodes,m.goldbergData.adjacentFaces=x.adjacentFaces,m.goldbergData.nbFaces=m.goldbergData.nbSharedFaces+m.goldbergData.nbUnsharedFaces,m.goldbergData.nbFacesAtPole=(m.goldbergData.nbUnsharedFaces-12)/12;for(let e=0;e<x.vertex.length;e++)m.goldbergData.faceCenters.push(r.Vector3.FromArray(x.vertex[e])),m.goldbergData.faceCenters[e].x*=l,m.goldbergData.faceCenters[e].y*=c,m.goldbergData.faceCenters[e].z*=u,m.goldbergData.faceColors.push(new h.Color4(1,1,1,1));for(let e=0;e<g.face.length;e++){let t=g.face[e],s=r.Vector3.FromArray(g.vertex[t[0]]),i=r.Vector3.FromArray(g.vertex[t[2]]),a=r.Vector3.FromArray(g.vertex[t[1]]),o=i.subtract(s),n=a.subtract(s),l=r.Vector3.Cross(n,o).normalize(),h=r.Vector3.Cross(n,l).normalize();m.goldbergData.faceXaxis.push(n.normalize()),m.goldbergData.faceYaxis.push(l),m.goldbergData.faceZaxis.push(h)}return m},CreateDecal:function(e,t,s){let l=!!t.skeleton,h=!!t.morphTargetManager?.numTargets,c=s.localMode||l,u=t.getIndices(),d=l||h?t.getPositionData(!0,!0):t.getVerticesData(a.VertexBuffer.PositionKind),p=l||h?t.getNormalsData(!0,!0):t.getVerticesData(a.VertexBuffer.NormalKind),f=c?l?t.getVerticesData(a.VertexBuffer.PositionKind):d:null,x=c?l?t.getVerticesData(a.VertexBuffer.NormalKind):p:null,g=t.getVerticesData(a.VertexBuffer.UVKind),m=l?t.getVerticesData(a.VertexBuffer.MatricesIndicesKind):null,V=l?t.getVerticesData(a.VertexBuffer.MatricesWeightsKind):null,O=l?t.getVerticesData(a.VertexBuffer.MatricesIndicesExtraKind):null,_=l?t.getVerticesData(a.VertexBuffer.MatricesWeightsExtraKind):null,M=s.position||r.Vector3.Zero(),y=s.normal||r.Vector3.Up(),T=s.size||r.Vector3.One(),v=s.angle||0;if(!y){let e=new r.Vector3(0,0,1),s=t.getScene().activeCamera,i=r.Vector3.TransformCoordinates(e,s.getWorldMatrix());y=s.globalPosition.subtract(i)}let b=-Math.atan2(y.z,y.x)-Math.PI/2,A=Math.sqrt(y.x*y.x+y.z*y.z),I=Math.atan2(y.y,A),D=new o.VertexData;D.indices=[],D.positions=[],D.normals=[],D.uvs=[],D.matricesIndices=l?[]:null,D.matricesWeights=l?[]:null,D.matricesIndicesExtra=O?[]:null,D.matricesWeightsExtra=_?[]:null;let w=0,F=(e,t)=>{let i=new H;if(!u||!d||!p)return i;let a=u[e];if(i.vertexIdx=3*a,i.vertexIdxForBones=4*a,i.position=new r.Vector3(d[3*a],d[3*a+1],d[3*a+2]),r.Vector3.TransformCoordinatesToRef(i.position,t,i.position),i.normal=new r.Vector3(p[3*a],p[3*a+1],p[3*a+2]),r.Vector3.TransformNormalToRef(i.normal,t,i.normal),s.captureUVS&&g){let e=g[2*a+1];i.uv=new r.Vector2(g[2*a],n.useOpenGLOrientationForUV?1-e:e)}return i},P=[0,0,0,0],L=(e,t)=>{if(0===e.length)return e;let s=.5*Math.abs(r.Vector3.Dot(T,t)),i=(e,t,s,r)=>{for(let i=0;i<r;++i)if(e[s+i]===t)return s+i;return -1},a=(e,a)=>{let o=r.Vector3.GetClipFactor(e.position,a.position,t,s),n=P,l=P;if(m&&V){let t=e.matrixIndicesOverride?0:e.vertexIdxForBones,s=e.matrixIndicesOverride??m,r=e.matrixWeightsOverride??V,h=a.matrixIndicesOverride?0:a.vertexIdxForBones,c=a.matrixIndicesOverride??m,u=a.matrixWeightsOverride??V;n=[0,0,0,0],l=[0,0,0,0];let d=0;for(let e=0;e<4;++e)if(r[t+e]>0){let a=i(c,s[t+e],h,4);n[d]=s[t+e],l[d]=(0,E.Lerp)(r[t+e],a>=0?u[a]:0,o),d++}for(let e=0;e<4&&d<4;++e){let r=c[h+e];-1===i(s,r,t,4)&&(n[d]=r,l[d]=(0,E.Lerp)(0,u[h+e],o),d++)}let p=l[0]+l[1]+l[2]+l[3];l[0]/=p,l[1]/=p,l[2]/=p,l[3]/=p}let h=e.localPositionOverride?e.localPositionOverride[0]:f?.[e.vertexIdx]??0,c=e.localPositionOverride?e.localPositionOverride[1]:f?.[e.vertexIdx+1]??0,u=e.localPositionOverride?e.localPositionOverride[2]:f?.[e.vertexIdx+2]??0,d=a.localPositionOverride?a.localPositionOverride[0]:f?.[a.vertexIdx]??0,p=a.localPositionOverride?a.localPositionOverride[1]:f?.[a.vertexIdx+1]??0,g=a.localPositionOverride?a.localPositionOverride[2]:f?.[a.vertexIdx+2]??0,O=e.localNormalOverride?e.localNormalOverride[0]:x?.[e.vertexIdx]??0,_=e.localNormalOverride?e.localNormalOverride[1]:x?.[e.vertexIdx+1]??0,M=e.localNormalOverride?e.localNormalOverride[2]:x?.[e.vertexIdx+2]??0,y=a.localNormalOverride?a.localNormalOverride[0]:x?.[a.vertexIdx]??0,T=a.localNormalOverride?a.localNormalOverride[1]:x?.[a.vertexIdx+1]??0,v=a.localNormalOverride?a.localNormalOverride[2]:x?.[a.vertexIdx+2]??0,b=O+(y-O)*o,A=_+(T-_)*o,I=M+(v-M)*o,D=Math.sqrt(b*b+A*A+I*I);return new H(r.Vector3.Lerp(e.position,a.position,o),r.Vector3.Lerp(e.normal,a.normal,o).normalize(),r.Vector2.Lerp(e.uv,a.uv,o),-1,-1,f?[h+(d-h)*o,c+(p-c)*o,u+(g-u)*o]:null,x?[b/D,A/D,I/D]:null,n,l)},o=null;e.length>3&&(o=[]);for(let i=0;i<e.length;i+=3){let n=null,l=null,h=null,c=null,u=r.Vector3.Dot(e[i].position,t)-s,d=r.Vector3.Dot(e[i+1].position,t)-s,p=r.Vector3.Dot(e[i+2].position,t)-s,f=u>0,x=d>0,g=p>0;switch(+!!f+ +!!x+ +!!g){case 0:e.length>3?(o.push(e[i]),o.push(e[i+1]),o.push(e[i+2])):o=e;break;case 1:if(o=o??[],f&&(n=e[i+1],l=e[i+2],h=a(e[i],n),c=a(e[i],l)),x){n=e[i],l=e[i+2],h=a(e[i+1],n),c=a(e[i+1],l),o.push(h),o.push(l.clone()),o.push(n.clone()),o.push(l.clone()),o.push(h.clone()),o.push(c);break}g&&(n=e[i],l=e[i+1],h=a(e[i+2],n),c=a(e[i+2],l)),n&&l&&h&&c&&(o.push(n.clone()),o.push(l.clone()),o.push(h),o.push(c),o.push(h.clone()),o.push(l.clone()));break;case 2:o=o??[],f||(l=a(n=e[i].clone(),e[i+1]),h=a(n,e[i+2]),o.push(n),o.push(l),o.push(h)),x||(l=a(n=e[i+1].clone(),e[i+2]),h=a(n,e[i]),o.push(n),o.push(l),o.push(h)),g||(l=a(n=e[i+2].clone(),e[i]),h=a(n,e[i+1]),o.push(n),o.push(l),o.push(h))}}return o},z=t instanceof i.Mesh?t:null,B=z?._thinInstanceDataStorage.matrixData,C=z?.thinInstanceCount||1,Z=r.TmpVectors.Matrix[0];Z.copyFrom(r.Matrix.IdentityReadOnly);for(let e=0;e<C;++e){if(z?.hasThinInstances&&B){let t=16*e;Z.setRowFromFloats(0,B[t+0],B[t+1],B[t+2],B[t+3]),Z.setRowFromFloats(1,B[t+4],B[t+5],B[t+6],B[t+7]),Z.setRowFromFloats(2,B[t+8],B[t+9],B[t+10],B[t+11]),Z.setRowFromFloats(3,B[t+12],B[t+13],B[t+14],B[t+15])}let i=r.Matrix.RotationYawPitchRoll(b,I,v).multiply(r.Matrix.Translation(M.x,M.y,M.z)),a=r.Matrix.Invert(i),o=t.getWorldMatrix(),l=Z.multiply(o).multiply(a),h=[,,,];for(let e=0;e<u.length;e+=3){let t=h;if((t[0]=F(e,l),t[1]=F(e+1,l),t[2]=F(e+2,l),!(s.cullBackFaces&&0>=-t[0].normal.z&&0>=-t[1].normal.z&&0>=-t[2].normal.z)&&(t=L(t,S))&&(t=L(t,R))&&(t=L(t,U))&&(t=L(t,N))&&(t=L(t,W)))&&(t=L(t,G)))for(let e=0;e<t.length;e++){let r=t[e];if(D.indices.push(w),c?(r.localPositionOverride?(D.positions[3*w]=r.localPositionOverride[0],D.positions[3*w+1]=r.localPositionOverride[1],D.positions[3*w+2]=r.localPositionOverride[2]):f&&(D.positions[3*w]=f[r.vertexIdx],D.positions[3*w+1]=f[r.vertexIdx+1],D.positions[3*w+2]=f[r.vertexIdx+2]),r.localNormalOverride?(D.normals[3*w]=r.localNormalOverride[0],D.normals[3*w+1]=r.localNormalOverride[1],D.normals[3*w+2]=r.localNormalOverride[2]):x&&(D.normals[3*w]=x[r.vertexIdx],D.normals[3*w+1]=x[r.vertexIdx+1],D.normals[3*w+2]=x[r.vertexIdx+2])):(r.position.toArray(D.positions,3*w),r.normal.toArray(D.normals,3*w)),D.matricesIndices&&D.matricesWeights&&(r.matrixIndicesOverride?(D.matricesIndices[4*w]=r.matrixIndicesOverride[0],D.matricesIndices[4*w+1]=r.matrixIndicesOverride[1],D.matricesIndices[4*w+2]=r.matrixIndicesOverride[2],D.matricesIndices[4*w+3]=r.matrixIndicesOverride[3]):(m&&(D.matricesIndices[4*w]=m[r.vertexIdxForBones],D.matricesIndices[4*w+1]=m[r.vertexIdxForBones+1],D.matricesIndices[4*w+2]=m[r.vertexIdxForBones+2],D.matricesIndices[4*w+3]=m[r.vertexIdxForBones+3]),O&&D.matricesIndicesExtra&&(D.matricesIndicesExtra[4*w]=O[r.vertexIdxForBones],D.matricesIndicesExtra[4*w+1]=O[r.vertexIdxForBones+1],D.matricesIndicesExtra[4*w+2]=O[r.vertexIdxForBones+2],D.matricesIndicesExtra[4*w+3]=O[r.vertexIdxForBones+3])),r.matrixWeightsOverride?(D.matricesWeights[4*w]=r.matrixWeightsOverride[0],D.matricesWeights[4*w+1]=r.matrixWeightsOverride[1],D.matricesWeights[4*w+2]=r.matrixWeightsOverride[2],D.matricesWeights[4*w+3]=r.matrixWeightsOverride[3]):(V&&(D.matricesWeights[4*w]=V[r.vertexIdxForBones],D.matricesWeights[4*w+1]=V[r.vertexIdxForBones+1],D.matricesWeights[4*w+2]=V[r.vertexIdxForBones+2],D.matricesWeights[4*w+3]=V[r.vertexIdxForBones+3]),_&&D.matricesWeightsExtra&&(D.matricesWeightsExtra[4*w]=_[r.vertexIdxForBones],D.matricesWeightsExtra[4*w+1]=_[r.vertexIdxForBones+1],D.matricesWeightsExtra[4*w+2]=_[r.vertexIdxForBones+2],D.matricesWeightsExtra[4*w+3]=_[r.vertexIdxForBones+3]))),s.captureUVS)r.uv.toArray(D.uvs,2*w);else{D.uvs.push(.5+r.position.x/T.x);let e=.5+r.position.y/T.y;D.uvs.push(n.useOpenGLOrientationForUV?1-e:e)}w++}}}0===D.indices.length&&(D.indices=null),0===D.positions.length&&(D.positions=null),0===D.normals.length&&(D.normals=null),0===D.uvs.length&&(D.uvs=null),D.matricesIndices?.length===0&&(D.matricesIndices=null),D.matricesWeights?.length===0&&(D.matricesWeights=null),D.matricesIndicesExtra?.length===0&&(D.matricesIndicesExtra=null),D.matricesWeightsExtra?.length===0&&(D.matricesWeightsExtra=null);let X=new i.Mesh(e,t.getScene());return D.applyToMesh(X),c?(X.skeleton=t.skeleton,X.parent=t):(X.position=M.clone(),X.rotation=new r.Vector3(I,b,v)),X.computeWorldMatrix(!0),X.refreshBoundingInfo(!0,!0),X},CreateCapsule:function(e,t={orientation:r.Vector3.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},s=null){let a=new i.Mesh(e,s);return(function(e={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){let t,s,i=0|Math.max(e.subdivisions?e.subdivisions:2,1),a=0|Math.max(e.tessellation?e.tessellation:16,3),l=Math.max(e.height?e.height:1,0),h=Math.max(e.radius?e.radius:.25,0),c=0|Math.max(e.capSubdivisions?e.capSubdivisions:6,1),u=Math.max(e.radiusTop?e.radiusTop:h,0),d=Math.max(e.radiusBottom?e.radiusBottom:h,0),p=2*Math.PI,f=Math.max(e.topCapSubdivisions?e.topCapSubdivisions:c,1),x=Math.max(e.bottomCapSubdivisions?e.bottomCapSubdivisions:c,1),g=Math.acos((d-u)/l),m=[],V=[],O=[],_=[],M=0,y=[],T=.5*(l-(u+d)),v=.5*Math.PI,b=r.Vector3.Zero(),A=r.Vector3.Zero(),I=Math.cos(g),D=Math.sin(g),w=new r.Vector2(u*D,T+u*I).subtract(new r.Vector2(d*D,-T+d*I)).length(),F=u*g+w+d*(v-g),P=0;for(s=0;s<=f;s++){let e=[],r=v-s/f*g;P+=u*g/f;let i=Math.cos(r),o=Math.sin(r),l=i*u;for(t=0;t<=a;t++){let s=t/a,r=s*p+0,h=Math.sin(r),c=Math.cos(r);A.x=l*h,A.y=T+o*u,A.z=l*c,V.push(A.x,A.y,A.z),b.set(i*h,o,i*c),O.push(b.x,b.y,b.z),_.push(s,n.useOpenGLOrientationForUV?P/F:1-P/F),e.push(M),M++}y.push(e)}let L=l-u-d+I*u-I*d,z=D*(d-u)/L;for(s=1;s<=i;s++){let e=[];P+=w/i;let r=D*(s*(d-u)/i+u);for(t=0;t<=a;t++){let o=t/a,l=o*p+0,h=Math.sin(l),c=Math.cos(l);A.x=r*h,A.y=T+I*u-s*L/i,A.z=r*c,V.push(A.x,A.y,A.z),b.set(h,z,c).normalize(),O.push(b.x,b.y,b.z),_.push(o,n.useOpenGLOrientationForUV?P/F:1-P/F),e.push(M),M++}y.push(e)}for(s=1;s<=x;s++){let e=[],r=v-g-s/x*(Math.PI-g);P+=d*g/x;let i=Math.cos(r),o=Math.sin(r),l=i*d;for(t=0;t<=a;t++){let s=t/a,r=s*p+0,h=Math.sin(r),c=Math.cos(r);A.x=l*h,A.y=-T+o*d,A.z=l*c,V.push(A.x,A.y,A.z),b.set(i*h,o,i*c),O.push(b.x,b.y,b.z),_.push(s,n.useOpenGLOrientationForUV?P/F:1-P/F),e.push(M),M++}y.push(e)}for(t=0;t<a;t++)for(s=0;s<f+i+x;s++){let e=y[s][t],r=y[s+1][t],i=y[s+1][t+1],a=y[s][t+1];m.push(e),m.push(r),m.push(a),m.push(r),m.push(i),m.push(a)}if(m=m.reverse(),e.orientation&&!e.orientation.equals(r.Vector3.Up())){let t=new r.Matrix;e.orientation.clone().scale(.5*Math.PI).cross(r.Vector3.Up()).toQuaternion().toRotationMatrix(t);let s=r.Vector3.Zero();for(let e=0;e<V.length;e+=3)s.set(V[e],V[e+1],V[e+2]),r.Vector3.TransformCoordinatesToRef(s.clone(),t,s),V[e]=s.x,V[e+1]=s.y,V[e+2]=s.z}let B=new o.VertexData;return B.positions=V,B.normals=O,B.uvs=_,B.indices=m,B})(t).applyToMesh(a,t.updatable),a},CreateText:function(e,t,s,a={size:50,resolution:8,depth:1},o=null,n=earcut){let l=function(e,t,s,r){let i=Array.from(e),a=t/r.resolution,o=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,n=[],l=0,h=0;for(let e=0;e<i.length;e++){let t=i[e];if("\n"===t)l=0,h-=o;else{let e=function(e,t,s,r,i,a){let o=a.glyphs[e]||a.glyphs["?"];if(!o)return null;let n=new j(i);if(o.o){let e=o.o.split(" ");for(let i=0,a=e.length;i<a;)switch(e[i++]){case"m":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r;n.moveTo(a,o);break}case"l":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r;n.lineTo(a,o);break}case"q":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r,l=parseInt(e[i++])*t+s,h=parseInt(e[i++])*t+r;n.quadraticCurveTo(l,h,a,o);break}case"b":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r,l=parseInt(e[i++])*t+s,h=parseInt(e[i++])*t+r,c=parseInt(e[i++])*t+s,u=parseInt(e[i++])*t+r;n.bezierCurveTo(l,h,c,u,a,o)}}}return n.extractHoles(),{offsetX:o.ha*t,shapePath:n}}(t,a,l,h,s,r);e&&(l+=e.offsetX,n.push(e.shapePath))}}return n}(t,a.size||50,a.resolution||8,s),h=[],c=0;for(let t of l){if(!t.paths.length)continue;let s=t.holes.slice();for(let l of t.paths){let t=[],u=[];for(let e of l.getPoints())u.push(new r.Vector3(e.x,0,e.y));for(let e of s.slice()){let i=e.getPoints(),a=!1;for(let e of i)if(l.isPointInside(e)){a=!0;break}if(!a)continue;let o=[];for(let e of i)o.push(new r.Vector3(e.x,0,e.y));t.push(o),s.splice(s.indexOf(e),1)}if(!t.length&&s.length)for(let e of s){let s=e.getPoints(),i=[];for(let e of s)i.push(new r.Vector3(e.x,0,e.y));t.push(i)}let d=F(e,{shape:u,holes:t.length?t:void 0,depth:a.depth||1,faceUV:a.faceUV||a.perLetterFaceUV?.(c),faceColors:a.faceColors||a.perLetterFaceColors?.(c),sideOrientation:i.Mesh._GetDefaultSideOrientation(a.sideOrientation||i.Mesh.DOUBLESIDE)},o,n);h.push(d),c++}}let u=i.Mesh.MergeMeshes(h,!0,!0);if(u){let t=u.getBoundingInfo().boundingBox;u.position.x+=-(t.minimumWorld.x+t.maximumWorld.x)/2,u.position.y+=-(t.minimumWorld.y+t.maximumWorld.y)/2,u.position.z+=-(t.minimumWorld.z+t.maximumWorld.z)/2+t.extendSize.z,u.name=e;let s=new q.TransformNode("pivot",o);s.rotation.x=-Math.PI/2,u.parent=s,u.bakeCurrentTransformIntoVertices(),u.parent=null,s.dispose()}return u}}],70928)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70928,e=>{"use strict";var t,s,r=e.i(10534),i=e.i(79124),a=e.i(65703),o=e.i(79675),n=e.i(21834);function l(e,t,s=null){let h=t.pathArray,c=t.closeArray,u=t.closePath,d=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),p=t.instance,f=t.updatable;if(p){let e=r.TmpVectors.Vector3[0].setAll(Number.MAX_VALUE),s=r.TmpVectors.Vector3[1].setAll(-Number.MAX_VALUE),l=p.getVerticesData(a.VertexBuffer.PositionKind);if((t=>{let r=h[0].length,a=0,o=p._originalBuilderSideOrientation===i.Mesh.DOUBLESIDE?2:1;for(let i=1;i<=o;++i)for(let i=0;i<h.length;++i){let o=h[i],n=o.length;r=r<n?r:n;for(let i=0;i<r;++i){let r=o[i];t[a]=r.x,t[a+1]=r.y,t[a+2]=r.z,e.minimizeInPlaceFromFloats(r.x,r.y,r.z),s.maximizeInPlaceFromFloats(r.x,r.y,r.z),a+=3}if(p._creationDataStorage&&p._creationDataStorage.closePath){let e=o[0];t[a]=e.x,t[a+1]=e.y,t[a+2]=e.z,a+=3}}})(l),p.hasBoundingInfo?p.getBoundingInfo().reConstruct(e,s,p._worldMatrix):p.buildBoundingInfo(e,s,p._worldMatrix),p.updateVerticesData(a.VertexBuffer.PositionKind,l,!1,!1),t.colors){let e=p.getVerticesData(a.VertexBuffer.ColorKind);for(let s=0,r=0;s<t.colors.length;s++,r+=4){let i=t.colors[s];e[r]=i.r,e[r+1]=i.g,e[r+2]=i.b,e[r+3]=i.a}p.updateVerticesData(a.VertexBuffer.ColorKind,e,!1,!1)}if(t.uvs){let e=p.getVerticesData(a.VertexBuffer.UVKind);for(let s=0;s<t.uvs.length;s++)e[2*s]=t.uvs[s].x,e[2*s+1]=n.useOpenGLOrientationForUV?1-t.uvs[s].y:t.uvs[s].y;p.updateVerticesData(a.VertexBuffer.UVKind,e,!1,!1)}if(!p.areNormalsFrozen||p.isFacetDataEnabled){let e=p.getIndices(),t=p.getVerticesData(a.VertexBuffer.NormalKind),s=p.isFacetDataEnabled?p.getFacetDataParameters():null;if(o.VertexData.ComputeNormals(l,e,t,s),p._creationDataStorage&&p._creationDataStorage.closePath){let e,s;for(let r=0;r<h.length;r++)e=3*p._creationDataStorage.idx[r],s=r+1<h.length?(p._creationDataStorage.idx[r+1]-1)*3:t.length-3,t[e]=(t[e]+t[s])*.5,t[e+1]=(t[e+1]+t[s+1])*.5,t[e+2]=(t[e+2]+t[s+2])*.5,t[s]=t[e],t[s+1]=t[e+1],t[s+2]=t[e+2]}p.areNormalsFrozen||p.updateVerticesData(a.VertexBuffer.NormalKind,t,!1,!1)}return p}{let r=new i.Mesh(e,s);r._originalBuilderSideOrientation=d,r._creationDataStorage=new i._CreationDataStorage;let l=function(e){let t,s,r,i,l,h,c,u,d,p,f,x,g,m=e.pathArray,V=e.closeArray||!1,O=e.closePath||!1,_=e.invertUV||!1,M=Math.floor(m[0].length/2),y=e.offset||M;y=y>M?M:Math.floor(y);let T=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,v=e.uvs,b=e.colors,A=[],I=[],D=[],w=[],F=[],P=[],L=[],z=[],B=[],C=[];if(m.length<2){let e=[],t=[];for(r=0;r<m[0].length-y;r++)e.push(m[0][r]),t.push(m[0][r+y]);m=[e,t]}let E=0,S=+!!O,R=+!!V;for(s=0,t=m[0].length;s<m.length+R;s++){for(L[s]=0,F[s]=[0],t=t<(h=(l=s===m.length?m[0]:m[s]).length)?t:h,i=0;i<h;)A.push(l[i].x,l[i].y,l[i].z),i>0&&(c=l[i].subtract(l[i-1]).length()+L[s],F[s].push(c),L[s]=c),i++;O&&(i--,A.push(l[0].x,l[0].y,l[0].z),c=l[i].subtract(l[0]).length()+L[s],F[s].push(c),L[s]=c),B[s]=h+S,C[s]=E,E+=h+S}for(r=0;r<t+S;r++)for(s=0,z[r]=0,P[r]=[0];s<m.length-1+R;s++)u=m[s],d=s===m.length-1?m[0]:m[s+1],r===t?(p=u[0],f=d[0]):(p=u[r],f=d[r]),c=f.subtract(p).length()+z[r],P[r].push(c),z[r]=c;if(v)for(s=0;s<v.length;s++)w.push(v[s].x,n.useOpenGLOrientationForUV?1-v[s].y:v[s].y);else for(s=0;s<m.length+R;s++)for(r=0;r<t+S;r++)x=0!=L[s]?F[s][r]/L[s]:0,g=0!=z[r]?P[r][s]/z[r]:0,_?w.push(g,x):w.push(x,n.useOpenGLOrientationForUV?1-g:g);let U=0,N=B[s=0]-1,W=B[s+1]-1,G=N<W?N:W,H=C[1]-C[0],Z=B.length-1;for(;U<=G&&s<Z;)I.push(U,U+H,U+1),I.push(U+H+1,U+1,U+H),(U+=1)===G&&(H=C[++s+1]-C[s],N=B[s]-1,W=B[s+1]-1,U=C[s],G=N<W?N+U:W+U);if(o.VertexData.ComputeNormals(A,I,D),O){let e,t;for(s=0;s<m.length;s++){e=3*C[s],t=s+1<m.length?(C[s+1]-1)*3:D.length-3,D[e]=(D[e]+D[t])*.5,D[e+1]=(D[e+1]+D[t+1])*.5,D[e+2]=(D[e+2]+D[t+2])*.5;let r=Math.sqrt(D[e]*D[e]+D[e+1]*D[e+1]+D[e+2]*D[e+2]);D[e]/=r,D[e+1]/=r,D[e+2]/=r,D[t]=D[e],D[t+1]=D[e+1],D[t+2]=D[e+2]}}if(V){let e=3*C[0],s=3*C[m.length];for(r=0;r<t+S;r++){D[e]=(D[e]+D[s])*.5,D[e+1]=(D[e+1]+D[s+1])*.5,D[e+2]=(D[e+2]+D[s+2])*.5;let t=Math.sqrt(D[e]*D[e]+D[e+1]*D[e+1]+D[e+2]*D[e+2]);D[e]/=t,D[e+1]/=t,D[e+2]/=t,D[s]=D[e],D[s+1]=D[e+1],D[s+2]=D[e+2],e+=3,s+=3}}o.VertexData._ComputeSides(T,A,I,D,w,e.frontUVs,e.backUVs);let X=null;if(b){X=new Float32Array(4*b.length);for(let e=0;e<b.length;e++)X[4*e]=b[e].r,X[4*e+1]=b[e].g,X[4*e+2]=b[e].b,X[4*e+3]=b[e].a}let k=new o.VertexData,Y=new Float32Array(A),K=new Float32Array(D),Q=new Float32Array(w);return k.indices=I,k.positions=Y,k.normals=K,k.uvs=Q,X&&k.set(X,a.VertexBuffer.ColorKind),O&&(k._idx=C),k}(t);return u&&(r._creationDataStorage.idx=l._idx),r._creationDataStorage.closePath=u,r._creationDataStorage.closeArray=c,l.applyToMesh(r,f),r}}var h=e.i(75053);function c(e){let t=e.pattern||i.Mesh.NO_FLIP,s=e.tileWidth||e.tileSize||1,r=e.tileHeight||e.tileSize||1,a=e.alignHorizontal||0,n=e.alignVertical||0,l=e.width||e.size||1,h=Math.floor(l/s),c=l-h*s,u=e.height||e.size||1,d=Math.floor(u/r),p=u-d*r,f=s*h/2,x=r*d/2,g=0,m=0,V=0,O=0,_=0,M=0;if(c>0||p>0){switch(V=-f,O=-x,_=f,M=x,a){case i.Mesh.CENTER:c/=2,V-=c,_+=c;break;case i.Mesh.LEFT:_+=c,g=-c/2;break;case i.Mesh.RIGHT:V-=c,g=c/2}switch(n){case i.Mesh.CENTER:p/=2,O-=p,M+=p;break;case i.Mesh.BOTTOM:M+=p,m=-p/2;break;case i.Mesh.TOP:O-=p,m=p/2}}let y=[],T=[],v=[];v[0]=[0,0,1,0,1,1,0,1],v[1]=[0,0,1,0,1,1,0,1],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(v[1]=[1,1,0,1,0,0,1,0]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(v[1]=[1,0,0,0,0,1,1,1]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(v[1]=[0,1,1,1,1,0,0,0]);let b=[],A=[],I=[],D=0;for(let e=0;e<d;e++)for(let a=0;a<h;a++)y.push(-f+a*s+g,-x+e*r+m,0),y.push(-f+(a+1)*s+g,-x+e*r+m,0),y.push(-f+(a+1)*s+g,-x+(e+1)*r+m,0),y.push(-f+a*s+g,-x+(e+1)*r+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(v[(a%2+e%2)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(v[e%2]):b.concat(v[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),D+=4;if(c>0||p>0){let e,o,l,u,v,w=p>0&&(n===i.Mesh.CENTER||n===i.Mesh.TOP),F=p>0&&(n===i.Mesh.CENTER||n===i.Mesh.BOTTOM),P=c>0&&(a===i.Mesh.CENTER||a===i.Mesh.RIGHT),L=c>0&&(a===i.Mesh.CENTER||a===i.Mesh.LEFT);if(w&&P&&(y.push(V+g,O+m,0),y.push(-f+g,O+m,0),y.push(-f+g,O+p+m,0),y.push(V+g,O+p+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,u=1,v=1,e=[o=1-c/s,l=1-p/r,u,l,u,v,o,v],t===i.Mesh.ROTATE_ROW&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),t===i.Mesh.FLIP_ROW&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),t===i.Mesh.FLIP_N_ROTATE_ROW&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w&&L&&(y.push(f+g,O+m,0),y.push(_+g,O+m,0),y.push(_+g,O+p+m,0),y.push(f+g,O+p+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,v=1,e=[o=0,l=1-p/r,u=c/s,l,u,v,o,v],(t===i.Mesh.ROTATE_ROW||t===i.Mesh.ROTATE_TILE&&h%2==0)&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_ROW||t===i.Mesh.FLIP_TILE&&h%2==0)&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_TILE&&h%2==0)&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),F&&P&&(y.push(V+g,x+m,0),y.push(-f+g,x+m,0),y.push(-f+g,M+m,0),y.push(V+g,M+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,l=0,u=1,e=[o=1-c/s,l,u,l,u,v=p/r,o,v],(t===i.Mesh.ROTATE_ROW&&d%2==1||t===i.Mesh.ROTATE_TILE&&d%1==0)&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_ROW&&d%2==1||t===i.Mesh.FLIP_TILE&&d%2==0)&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===i.Mesh.FLIP_N_ROTATE_TILE&&d%2==0)&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),F&&L&&(y.push(f+g,x+m,0),y.push(_+g,x+m,0),y.push(_+g,M+m,0),y.push(f+g,M+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,e=[o=0,l=0,u=c/s,l,u,v=p/r,o,v],(t===i.Mesh.ROTATE_ROW&&d%2==1||t===i.Mesh.ROTATE_TILE&&(d+h)%2==1)&&(e=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_ROW&&d%2==1||t===i.Mesh.FLIP_TILE&&(d+h)%2==1)&&(e=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===i.Mesh.FLIP_N_ROTATE_TILE&&(d+h)%2==1)&&(e=[o,1-l,u,1-l,u,1-v,o,1-v]),b=b.concat(e),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w){let e=[];o=0,l=1-p/r,u=1,v=1,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let r=0;r<h;r++)y.push(-f+r*s+g,O+m,0),y.push(-f+(r+1)*s+g,O+m,0),y.push(-f+(r+1)*s+g,O+p+m,0),y.push(-f+r*s+g,O+p+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(r+1)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[1]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(F){let e=[];o=0,l=0,u=1,v=p/r,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let r=0;r<h;r++)y.push(-f+r*s+g,M-p+m,0),y.push(-f+(r+1)*s+g,M-p+m,0),y.push(-f+(r+1)*s+g,M+m,0),y.push(-f+r*s+g,M+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(r+d)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[d%2]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(P){let e=[];o=1-c/s,l=0,u=1,v=1,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let s=0;s<d;s++)y.push(V+g,-x+s*r+m,0),y.push(V+c+g,-x+s*r+m,0),y.push(V+c+g,-x+(s+1)*r+m,0),y.push(V+g,-x+(s+1)*r+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(s+1)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[s%2]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(L){let e=[];o=0,l=0,u=c/r,v=1,e[0]=[o,l,u,l,u,v,o,v],e[1]=[o,l,u,l,u,v,o,v],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-u,1-l,1-u,1-v,1-o,1-v]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-u,l,1-u,v,1-o,v]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,u,1-l,u,1-v,o,1-v]);for(let s=0;s<d;s++)y.push(_-c+g,-x+s*r+m,0),y.push(_+g,-x+s*r+m,0),y.push(_+g,-x+(s+1)*r+m,0),y.push(_-c+g,-x+(s+1)*r+m,0),I.push(D,D+1,D+3,D+1,D+2,D+3),D+=4,b=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?b.concat(e[(s+h)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?b.concat(e[s%2]):b.concat(e[0]),A.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}let w=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;o.VertexData._ComputeSides(w,y,I,T,b,e.frontUVs,e.backUVs);let F=new o.VertexData;return F.indices=I,F.positions=y,F.normals=T,F.uvs=b,F.colors=w===o.VertexData.DOUBLESIDE?A.concat(A):A,F}function u(e){let t,s=e.faceUV||Array(6),a=e.faceColors,l=e.pattern||i.Mesh.NO_FLIP,u=e.width||e.size||1,d=e.height||e.size||1,p=e.depth||e.size||1,f=e.tileWidth||e.tileSize||1,x=e.tileHeight||e.tileSize||1,g=e.alignHorizontal||0,m=e.alignVertical||0,V=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;for(let e=0;e<6;e++)void 0===s[e]&&(s[e]=new r.Vector4(0,0,1,1)),a&&void 0===a[e]&&(a[e]=new h.Color4(1,1,1,1));let O=u/2,_=d/2,M=p/2,y=[];for(let e=0;e<2;e++)y[e]=c({pattern:l,tileWidth:f,tileHeight:x,width:u,height:d,alignVertical:m,alignHorizontal:g,sideOrientation:V});for(let e=2;e<4;e++)y[e]=c({pattern:l,tileWidth:f,tileHeight:x,width:p,height:d,alignVertical:m,alignHorizontal:g,sideOrientation:V});let T=m;m===i.Mesh.BOTTOM?T=i.Mesh.TOP:m===i.Mesh.TOP&&(T=i.Mesh.BOTTOM);for(let e=4;e<6;e++)y[e]=c({pattern:l,tileWidth:f,tileHeight:x,width:u,height:p,alignVertical:T,alignHorizontal:g,sideOrientation:V});let v=[],b=[],A=[],I=[],D=[],w=[],F=[],P=[],L=0;for(let e=0;e<6;e++){let i=y[e].positions.length;w[e]=[],F[e]=[];for(let t=0;t<i/3;t++)w[e].push(new r.Vector3(y[e].positions[3*t],y[e].positions[3*t+1],y[e].positions[3*t+2])),F[e].push(new r.Vector3(y[e].normals[3*t],y[e].normals[3*t+1],y[e].normals[3*t+2]));t=y[e].uvs.length,P[e]=[];for(let r=0;r<t;r+=2)P[e][r]=s[e].x+(s[e].z-s[e].x)*y[e].uvs[r],P[e][r+1]=s[e].y+(s[e].w-s[e].y)*y[e].uvs[r+1],n.useOpenGLOrientationForUV&&(P[e][r+1]=1-P[e][r+1]);if(A=A.concat(P[e]),I=I.concat(y[e].indices.map(e=>e+L)),L+=w[e].length,a){let t=a[e];for(let s=0;s<w[e].length;s++)D.push(t.r,t.g,t.b,t.a)}}let z=[{m:r.Matrix.RotationY(Math.PI),t:new r.Vector3(0,0,M),op:1},{m:r.Matrix.Identity(),t:new r.Vector3(0,0,M),op:-1},{m:r.Matrix.RotationY(-Math.PI/2),t:new r.Vector3(O,0,0),op:1},{m:r.Matrix.RotationY(Math.PI/2),t:new r.Vector3(O,0,0),op:-1},{m:r.Matrix.RotationX(Math.PI/2),t:new r.Vector3(0,_,0),op:1},{m:r.Matrix.RotationX(-Math.PI/2),t:new r.Vector3(0,_,0),op:-1}];for(let e=0;e<6;e++){let{m:t,t:s,op:i}=z[e];for(let a of w[e]){let e=r.Vector3.TransformCoordinates(a,t),o=1===i?e.add(s):e.subtract(s);v.push(o.x,o.y,o.z)}for(let s of F[e]){let e=r.Vector3.TransformNormal(s,t);b.push(e.x,e.y,e.z)}}let B=new o.VertexData;return B.indices=I,B.positions=v,B.normals=b,B.uvs=A,a&&(B.colors=V===o.VertexData.DOUBLESIDE?D.concat(D):D),B}o.VertexData.CreateTiledPlane=c,o.VertexData.CreateTiledBox=u;var d=e.i(91095),p=i,f=e.i(21324),x=e.i(52344),g=e.i(46847),m=e.i(54670);class V extends p.Mesh{_isShaderMaterial(e){return!!e&&"ShaderMaterial"===e.getClassName()}constructor(t,s=null,r=null,i=null,o,n,l,c){super(t,s,r,i,o),this.useVertexColor=n,this.useVertexAlpha=l,this.color=new h.Color3(1,1,1),this.alpha=1,this._shaderLanguage=0,this._ownsMaterial=!1,i&&(this.color=i.color.clone(),this.alpha=i.alpha,this.useVertexColor=i.useVertexColor,this.useVertexAlpha=i.useVertexAlpha),this.intersectionThreshold=.1;const u={attributes:[a.VertexBuffer.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:[],useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?u.defines.push("#define VERTEXALPHA"):u.needAlphaBlending=!1,this.useVertexColor?(u.defines.push("#define VERTEXCOLOR"),u.attributes.push(a.VertexBuffer.ColorKind)):(u.uniforms.push("color"),this._color4=new h.Color4),c)this.material=c;else{this.getScene().getEngine().isWebGPU&&!V.ForceGLSL&&(this._shaderLanguage=1),u.shaderLanguage=this._shaderLanguage,u.extraInitializationsAsync=async()=>{1===this._shaderLanguage?await Promise.all([e.A(63042),e.A(94393)]):await Promise.all([e.A(94077),e.A(91270)])};const t=new g.ShaderMaterial("colorShader",this.getScene(),"color",u,!1);t.doNotSerialize=!0,this._ownsMaterial=!0,this._setInternalMaterial(t)}}getClassName(){return"LinesMesh"}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){let t=this.material;if(t===e)return;let s=t&&this._ownsMaterial;this._ownsMaterial=!1,this._setInternalMaterial(e),s&&t?.dispose()}_setInternalMaterial(e){this._setMaterial(e),this.material&&(this.material.fillMode=x.Material.LineListDrawMode,this.material.disableLighting=!0)}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;let s=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,s):this._geometry._bind(t,s,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){let{r:e,g:t,b:s}=this.color;this._color4.set(e,t,s,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,s){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let r=this.getScene().getEngine();return this._unIndexed?r.drawArraysType(x.Material.LineListDrawMode,e.verticesStart,e.verticesCount,s):r.drawElementsType(x.Material.LineListDrawMode,e.indexStart,e.indexCount,s),this}dispose(e,t=!1,s){!s&&(this._ownsMaterial?this.material?.dispose(!1,!1,!0):t&&this.material?.dispose(!1,!1,!0)),super.dispose(e)}clone(e,t=null,s){return t&&void 0===t._addToSceneRootNodes?(t.source=this,new V(e,this.getScene(),t.parent,t.source,t.doNotCloneChildren)):new V(e,this.getScene(),t,this,s)}createInstance(e){let t=new O(e,this);if(this.instancedBuffers)for(let e in t.instancedBuffers={},this.instancedBuffers)t.instancedBuffers[e]=this.instancedBuffers[e];return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){let s=new V(e.name,t);return s.color=h.Color3.FromArray(e.color),s.alpha=e.alpha,s}}V.ForceGLSL=!1;class O extends f.InstancedMesh{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}(t=V.prototype).enableEdgesRendering??(t.enableEdgesRendering=(0,m._MissingSideEffect)("LinesMesh","enableEdgesRendering")),(s=O.prototype).enableEdgesRendering??(s.enableEdgesRendering=(0,m._MissingSideEffect)("InstancedLinesMesh","enableEdgesRendering"));var _=e.i(83464);function M(e,t,s=null){let r=t.instance,i=t.lines,n=t.colors;if(r){let e,t,s=r.getVerticesData(a.VertexBuffer.PositionKind);n&&(e=r.getVerticesData(a.VertexBuffer.ColorKind));let o=0,l=0;for(let r=0;r<i.length;r++){let a=i[r];for(let i=0;i<a.length;i++)s[o]=a[i].x,s[o+1]=a[i].y,s[o+2]=a[i].z,n&&e&&(t=n[r],e[l]=t[i].r,e[l+1]=t[i].g,e[l+2]=t[i].b,e[l+3]=t[i].a,l+=4),o+=3}return r.updateVerticesData(a.VertexBuffer.PositionKind,s,!1,!1),n&&e&&r.updateVerticesData(a.VertexBuffer.ColorKind,e,!1,!1),r.refreshBoundingInfo(),r}let l=new V(e,s,null,void 0,void 0,!!n,t.useVertexAlpha,t.material);return(function(e){let t=[],s=[],r=e.lines,i=e.colors,a=[],n=0;for(let e=0;e<r.length;e++){let o=r[e];for(let r=0;r<o.length;r++){let{x:l,y:h,z:c}=o[r];if(s.push(l,h,c),i){let{r:t,g:s,b:o,a:n}=i[e][r];a.push(t,s,o,n)}r>0&&(t.push(n-1),t.push(n)),n++}}let l=new o.VertexData;return l.indices=t,l.positions=s,i&&(l.colors=a),l})(t).applyToMesh(l,t.updatable),l}var y=r,T=e.i(42473),v=e.i(26722),b=e.i(47867);class A extends y.Vector2{constructor(e,t){super(e.x,e.y),this.index=t}}class I{constructor(){this.elements=[]}add(e){let t=[];for(let s of e){let e=new A(s,this.elements.length);t.push(e),this.elements.push(e)}return t}computeBounds(){let e=new y.Vector2(this.elements[0].x,this.elements[0].y),t=new y.Vector2(this.elements[0].x,this.elements[0].y);for(let s of this.elements)s.x<e.x?e.x=s.x:s.x>t.x&&(t.x=s.x),s.y<e.y?e.y=s.y:s.y>t.y&&(t.y=s.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class D{_addToepoint(e){for(let t of e)this._epoints.push(t.x,t.y)}constructor(e,t,s,r=earcut){let i;this._points=new I,this._outlinepoints=new I,this._holes=[],this._epoints=[],this._eholes=[],this.bjsEarcut=r,this._name=e,this._scene=s||b.EngineStore.LastCreatedScene,i=t instanceof T.Path2?t.getPoints():t,this._addToepoint(i),this._points.add(i),this._outlinepoints.add(i),void 0===this.bjsEarcut&&_.Logger.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);let t=new I;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,s=2){let r=new i.Mesh(this._name,this._scene),o=this.buildVertexData(t,s);return r.setVerticesData(a.VertexBuffer.PositionKind,o.positions,e),r.setVerticesData(a.VertexBuffer.NormalKind,o.normals,e),r.setVerticesData(a.VertexBuffer.UVKind,o.uvs,e),r.setIndices(o.indices),r}buildVertexData(e=0,t=2){let s=new o.VertexData,r=[],i=[],a=[],n=this._points.computeBounds();for(let e of this._points.elements)r.push(0,1,0),i.push(e.x,0,e.y),a.push((e.x-n.min.x)/n.width,(e.y-n.min.y)/n.height);let l=[],h=this.bjsEarcut(this._epoints,this._eholes,2);for(let e=0;e<h.length;e++)l.push(h[e]);if(e>0){let s=i.length/3;for(let t of this._points.elements)r.push(0,-1,0),i.push(t.x,-e,t.y),a.push(1-(t.x-n.min.x)/n.width,1-(t.y-n.min.y)/n.height);let o=l.length;for(let e=0;e<o;e+=3){let t=l[e+0],r=l[e+1],i=l[e+2];l.push(i+s),l.push(r+s),l.push(t+s)}for(let s of(this._addSide(i,r,a,l,n,this._outlinepoints,e,!1,t),this._holes))this._addSide(i,r,a,l,n,s,e,!0,t)}return s.indices=l,s.positions=i,s.normals=r,s.uvs=a,s}_addSide(e,t,s,r,i,a,o,n,l){let h=e.length/3,c=0;for(let u=0;u<a.elements.length;u++){let d,p=a.elements[u],f=a.elements[(u+1)%a.elements.length];e.push(p.x,0,p.y),e.push(p.x,-o,p.y),e.push(f.x,0,f.y),e.push(f.x,-o,f.y);let x=a.elements[(u+a.elements.length-1)%a.elements.length],g=a.elements[(u+2)%a.elements.length],m=new y.Vector3(-(f.y-p.y),0,f.x-p.x),V=new y.Vector3(-(p.y-x.y),0,p.x-x.x),O=new y.Vector3(-(g.y-f.y),0,g.x-f.x);n||(m=m.scale(-1),V=V.scale(-1),O=O.scale(-1));let _=m.normalizeToNew(),M=V.normalizeToNew(),T=y.Vector3.Dot(M,_);M=T>l?T<v.Epsilon-1?new y.Vector3(p.x,0,p.y).subtract(new y.Vector3(f.x,0,f.y)).normalize():V.add(m).normalize():_;let b=y.Vector3.Dot(O,m);d=b>l?b<v.Epsilon-1?new y.Vector3(f.x,0,f.y).subtract(new y.Vector3(p.x,0,p.y)).normalize():O.add(m).normalize():_,s.push(c/i.width,0),s.push(c/i.width,1),c+=m.length(),s.push(c/i.width,0),s.push(c/i.width,1),t.push(M.x,M.y,M.z),t.push(M.x,M.y,M.z),t.push(d.x,d.y,d.z),t.push(d.x,d.y,d.z),n?(r.push(h),r.push(h+2),r.push(h+1),r.push(h+1),r.push(h+2),r.push(h+3)):(r.push(h),r.push(h+1),r.push(h+2),r.push(h+1),r.push(h+3),r.push(h+2)),h+=4}}}function w(e,t,s=null,l=earcut){let c;t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);let u=t.shape,d=t.holes||[],p=t.depth||0,f=t.smoothingThreshold||2,x=[];for(let e=0;e<u.length;e++)x[e]=new r.Vector2(u[e].x,u[e].z);x[0].equalsWithEpsilon(x[x.length-1],1e-8)&&x.pop();let g=new D(e,x,s||b.EngineStore.LastCreatedScene,l);for(let e=0;e<d.length;e++){c=[];for(let t=0;t<d[e].length;t++)c.push(new r.Vector2(d[e][t].x,d[e][t].z));g.addHole(c)}let m=g.build(!1,p,f);return m._originalBuilderSideOrientation=t.sideOrientation,(function(e,t,s,i,l,c,u){let d,p,f,x,g=s||[,,,],m=[],V=u||!1;for(let e=0;e<3;e++)void 0===g[e]&&(g[e]=new r.Vector4(0,0,1,1)),i&&void 0===i[e]&&(i[e]=new h.Color4(1,1,1,1));let O=e.getVerticesData(a.VertexBuffer.PositionKind),_=e.getVerticesData(a.VertexBuffer.NormalKind),M=e.getVerticesData(a.VertexBuffer.UVKind),y=e.getIndices(),T=O.length/9,v=0,b=[0];if(V)for(let e=T;e<O.length/3;e+=4)b.push(v+=Math.sqrt((p=O[3*(e+2)]-O[3*e])*p+(f=O[3*(e+2)+2]-O[3*e+2])*f));let A=0;for(let e=0;e<_.length;e+=3).001>Math.abs(_[e+1])&&(A=1),.001>Math.abs(_[e+1]-1)&&(A=0),.001>Math.abs(_[e+1]+1)&&(A=2),x=e/3,1===A?((d=x-T)%4<1.5?V?M[2*x]=g[A].x+(g[A].z-g[A].x)*b[Math.floor(d/4)]/v:M[2*x]=g[A].x:V?M[2*x]=g[A].x+(g[A].z-g[A].x)*b[Math.floor(d/4)+1]/v:M[2*x]=g[A].z,d%2==0?M[2*x+1]=n.useOpenGLOrientationForUV?1-g[A].w:g[A].w:M[2*x+1]=n.useOpenGLOrientationForUV?1-g[A].y:g[A].y):(M[2*x]=(1-M[2*x])*g[A].x+M[2*x]*g[A].z,M[2*x+1]=(1-M[2*x+1])*g[A].y+M[2*x+1]*g[A].w,n.useOpenGLOrientationForUV&&(M[2*x+1]=1-M[2*x+1])),i&&m.push(i[A].r,i[A].g,i[A].b,i[A].a);o.VertexData._ComputeSides(t,O,y,_,M,l,c);let I=new o.VertexData;return I.indices=y,I.positions=O,I.normals=_,I.uvs=M,i&&(I.colors=t===o.VertexData.DOUBLESIDE?m.concat(m):m),I})(m,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs,t.wrap).applyToMesh(m,t.updatable),m}function F(e,t,s=null,r=earcut){return w(e,t,s,r)}function P(e,t,s,a,o,n,h,c,u,d,p,f,x,g,m,V,O,_,M,y,v){let b,A=(e,t,s,a,o,n,l,h,c,u,d)=>{let p=s.getTangents(),f=s.getNormals(),x=s.getBinormals(),g=s.getDistances();if(d){for(let e=0;e<p.length;e++)if(0==p[e].x&&0==p[e].y&&0==p[e].z&&p[e].copyFrom(p[e-1]),0==f[e].x&&0==f[e].y&&0==f[e].z&&f[e].copyFrom(f[e-1]),0==x[e].x&&0==x[e].y&&0==x[e].z&&x[e].copyFrom(x[e-1]),e>0){let t=p[e-1];0>r.Vector3.Dot(t,p[e])&&p[e].scaleInPlace(-1),t=f[e-1],0>r.Vector3.Dot(t,f[e])&&f[e].scaleInPlace(-1),t=x[e-1],0>r.Vector3.Dot(t,x[e])&&x[e].scaleInPlace(-1)}}let m=0,V=u&&h?h:()=>null!==n?n:0,O=u&&l?l:()=>null!==o?o:r.Vector3.OneReadOnly,_=2*(c!==i.Mesh.NO_CAP&&c!==i.Mesh.CAP_END),M=r.TmpVectors.Matrix[0];for(let s=0;s<t.length;s++){let i=[],o=V(s,g[s]),n=O(s,g[s]);r.Matrix.RotationAxisToRef(p[s],m,M);for(let a=0;a<e.length;a++){let o=p[s].scale(e[a].z).add(f[s].scale(e[a].x)).add(x[s].scale(e[a].y)),l=r.Vector3.Zero();r.Vector3.TransformCoordinatesToRef(o,M,l),l.multiplyInPlace(n).addInPlace(t[s]),i[a]=l}a[_]=i,m+=o,_++}let y=v||(e=>{let t,s=[],i=r.Vector3.Zero();for(t=0;t<e.length;t++)i.addInPlace(e[t]);for(i.scaleInPlace(1/e.length),t=0;t<e.length;t++)s.push(i);return s});switch(c){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:a[0]=y(a[2]),a[1]=a[2];break;case i.Mesh.CAP_END:a[_]=a[_-1],a[_+1]=y(a[_-1]);break;case i.Mesh.CAP_ALL:a[0]=y(a[2]),a[1]=a[2],a[_]=a[_-1],a[_+1]=y(a[_-1])}return a},I=null!==a?new r.Vector3(a,a,a):null;if(m){let e=m._creationDataStorage;return M?e.path3D.update(s,M):e.path3D.update(s),m=l("",{pathArray:b=A(t,s,e.path3D,e.pathArray,I,o,n,h,e.cap,p,y),closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:m},f||void 0)}let D=M?new T.Path3D(s,M):new T.Path3D(s),w=l(e,{pathArray:b=A(t,s,D,[],I,o,n,h,d=d<0||d>3?0:d,p,y),closeArray:c,closePath:u,updatable:x,sideOrientation:g,invertUV:V,frontUVs:O||void 0,backUVs:_||void 0},f);return w._creationDataStorage.pathArray=b,w._creationDataStorage.path3D=D,w._creationDataStorage.cap=d,w}var L=i;class z extends L.Mesh{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e),(0,m._IsSideEffectImplemented)(this.createOrUpdateSubmeshesOctree)&&this.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){let s=this.getWorldMatrix(),i=r.TmpVectors.Matrix[5];s.invertToRef(i);let a=r.TmpVectors.Vector3[8];if(r.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,i,a),e=a.x,t=a.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());let o=this._getFacetAt(e,t),n=-(o.x*e+o.z*t+o.w)/o.y;return r.Vector3.TransformCoordinatesFromFloatsToRef(0,n,0,s,a),a.y}getNormalAtCoordinates(e,t){let s=new r.Vector3(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,s),s}getNormalAtCoordinatesToRef(e,t,s){let i=this.getWorldMatrix(),a=r.TmpVectors.Matrix[5];i.invertToRef(a);let o=r.TmpVectors.Vector3[8];if(r.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,a,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());let n=this._getFacetAt(e,t);return r.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,i,s),this}updateCoordinateHeights(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){let s=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),r=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),i=this._heightQuads[r*this._subdivisionsX+s];return t<i.slope.x*e+i.slope.y?i.facet1:i.facet2}_initHeightQuads(){let e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let s=0;s<t;s++)for(let t=0;t<e;t++){let i={slope:r.Vector2.Zero(),facet1:new r.Vector4(0,0,0,0),facet2:new r.Vector4(0,0,0,0)};this._heightQuads[s*e+t]=i}return this}_computeHeightQuads(){let e,t,s,i,o,n,l,h=this.getVerticesData(a.VertexBuffer.PositionKind);if(!h)return this;let c=r.TmpVectors.Vector3[3],u=r.TmpVectors.Vector3[2],d=r.TmpVectors.Vector3[1],p=r.TmpVectors.Vector3[0],f=r.TmpVectors.Vector3[4],x=r.TmpVectors.Vector3[5],g=r.TmpVectors.Vector3[6],m=r.TmpVectors.Vector3[7],V=r.TmpVectors.Vector3[8],O=this._subdivisionsX,_=this._subdivisionsY;for(let a=0;a<_;a++)for(let _=0;_<O;_++){e=3*_,t=a*(O+1)*3,s=(a+1)*(O+1)*3,c.x=h[t+e],c.y=h[t+e+1],c.z=h[t+e+2],u.x=h[t+e+3],u.y=h[t+e+4],u.z=h[t+e+5],d.x=h[s+e],d.y=h[s+e+1],d.z=h[s+e+2],p.x=h[s+e+3],p.y=h[s+e+4],p.z=h[s+e+5],i=(p.z-c.z)/(p.x-c.x),o=c.z-i*c.x,u.subtractToRef(c,f),d.subtractToRef(c,x),p.subtractToRef(c,g),r.Vector3.CrossToRef(g,x,m),r.Vector3.CrossToRef(f,g,V),m.normalize(),V.normalize(),n=-(m.x*c.x+m.y*c.y+m.z*c.z),l=-(V.x*u.x+V.y*u.y+V.z*u.z);let M=this._heightQuads[a*O+_];M.slope.copyFromFloats(i,o),M.facet1.copyFromFloats(m.x,m.y,m.z,n),M.facet2.copyFromFloats(V.x,V.y,V.z,l)}return this}serialize(e){super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){let s=new z(e.name,t);return s._subdivisionsX=e.subdivisionsX||1,s._subdivisionsY=e.subdivisionsY||1,s._minX=e.minX,s._maxX=e.maxX,s._minZ=e.minZ,s._maxZ=e.maxZ,s._width=e.width,s._height=e.height,s}}var B=e.i(29711);function C(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s,i,a,l,c,u,d,p=[];p[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},p[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},p[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},p[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},p[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},p[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},p[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},p[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},p[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},p[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},p[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},p[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},p[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},p[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},p[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};let f=e.type&&(e.type<0||e.type>=p.length)?0:e.type||0,x=e.size,g=e.sizeX||x||1,m=e.sizeY||x||1,V=e.sizeZ||x||1,O=e.custom||p[f],_=O.face.length,M=e.faceUV||Array(_),y=e.faceColors,T=void 0===e.flat||e.flat,v=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,b=[],A=[],I=[],D=[],w=[],F=0,P=0,L=[];if(T)for(s=0;s<_;s++)y&&void 0===y[s]&&(y[s]=new h.Color4(1,1,1,1)),M&&void 0===M[s]&&(M[s]=new r.Vector4(0,0,1,1));if(T)for(s=0;s<_;s++){let e=O.face[s].length;for(t=0,c=.5*Math.tan((l=2*Math.PI/e)/2),u=.5;t<e;t++)b.push(O.vertex[O.face[s][t]][0]*g,O.vertex[O.face[s][t]][1]*m,O.vertex[O.face[s][t]][2]*V),L.push(F),F++,i=M[s].x+(M[s].z-M[s].x)*(.5+c),a=M[s].y+(M[s].w-M[s].y)*(u-.5),D.push(i,n.useOpenGLOrientationForUV?1-a:a),d=c*Math.cos(l)-u*Math.sin(l),u=c*Math.sin(l)+u*Math.cos(l),c=d,y&&w.push(y[s].r,y[s].g,y[s].b,y[s].a);for(t=0;t<e-2;t++)A.push(L[0+P],L[t+2+P],L[t+1+P]);P+=e}else{for(t=0;t<O.vertex.length;t++)b.push(O.vertex[t][0]*g,O.vertex[t][1]*m,O.vertex[t][2]*V),D.push(0,+!!n.useOpenGLOrientationForUV);for(s=0;s<_;s++)for(t=0;t<O.face[s].length-2;t++)A.push(O.face[s][0],O.face[s][t+2],O.face[s][t+1])}o.VertexData.ComputeNormals(b,A,I),o.VertexData._ComputeSides(v,b,A,I,D,e.frontUVs,e.backUVs);let z=new o.VertexData;return z.positions=b,z.indices=A,z.normals=I,z.uvs=D,y&&T&&(z.colors=w),z})(t).applyToMesh(a,t.updatable),a}var E=e.i(35270);let S=new r.Vector3(1,0,0),R=new r.Vector3(-1,0,0),U=new r.Vector3(0,1,0),N=new r.Vector3(0,-1,0),W=new r.Vector3(0,0,1),G=new r.Vector3(0,0,-1);class H{constructor(e=r.Vector3.Zero(),t=r.Vector3.Up(),s=r.Vector2.Zero(),i=0,a=0,o=null,n=null,l=null,h=null){this.position=e,this.normal=t,this.uv=s,this.vertexIdx=i,this.vertexIdxForBones=a,this.localPositionOverride=o,this.localNormalOverride=n,this.matrixIndicesOverride=l,this.matrixWeightsOverride=h}clone(){return new H(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}class Z{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),_.Logger.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.Logger.Warn("y is not an integer, floor(y) used"))}clone(){return new Z(this.x,this.y)}rotate60About(e){let t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){let t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),_.Logger.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.Logger.Warn("n not an integer only floor(n) used"));let s=this.x;return this.x=e-s-this.y,this.y=t+s,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),_.Logger.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),_.Logger.Warn("n is not an integer, floor(n) used"));let s=this.x;return this.x=this.y-t,this.y=e+t-s-this.y,this}toCartesianOrigin(e,t){let s=r.Vector3.Zero();return s.x=e.x+2*this.x*t+this.y*t,s.y=e.y+Math.sqrt(3)*this.y*t,s}static Zero(){return new Z(0,0)}}class X{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new k("icosahedron","Regular",[[0,v.PHI,-1],[-v.PHI,1,0],[-1,0,-v.PHI],[1,0,-v.PHI],[v.PHI,1,0],[0,v.PHI,1],[-1,0,v.PHI],[-v.PHI,-1,0],[0,-v.PHI,-1],[v.PHI,-1,0],[1,0,v.PHI],[0,-v.PHI,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,6]])}setIndices(){let e,t,s,r,i,a,o,n,l=12,h={},c=this.m,u=this.n,d=c;0!==u&&(d=(0,E.HighestCommonFactor)(c,u));let p=c/d,f=u/d,x=Z.Zero(),g=new Z(c,u),m=new Z(-u,c+u),V=Z.Zero(),O=Z.Zero(),_=Z.Zero(),M=[],y=[],T=this.vertByDist,v=(e,t,s,r)=>{a=e+"|"+s,o=t+"|"+r,a in h||o in h?a in h&&!(o in h)?h[o]=h[a]:o in h&&!(a in h)&&(h[a]=h[o]):(h[a]=l,h[o]=l,l++),T[s][0]>2?y[h[a]]=[-T[s][0],T[s][1],h[a]]:y[h[a]]=[M[T[s][0]],T[s][1],h[a]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let o=0;o<20;o++){if(s=(M=this.IDATA.face[o])[2],r=M[1],i=M[0],(a=o+"|"+(n=x.x+"|"+x.y))in h||(h[a]=s,y[s]=[M[T[n][0]],T[n][1]]),(a=o+"|"+(n=g.x+"|"+g.y))in h||(h[a]=r,y[r]=[M[T[n][0]],T[n][1]]),(a=o+"|"+(n=m.x+"|"+m.y))in h||(h[a]=i,y[i]=[M[T[n][0]],T[n][1]]),e=this.IDATA.edgematch[o][0],"B"===(t=this.IDATA.edgematch[o][1]))for(let t=1;t<d;t++)O.x=c-t*(p+f),O.y=u+t*p,_.x=-t*f,_.y=t*(p+f),v(o,e,n=O.x+"|"+O.y,_.x+"|"+_.y);if("O"===t)for(let t=1;t<d;t++)_.x=-t*f,_.y=t*(p+f),V.x=t*p,V.y=t*f,v(o,e,n=_.x+"|"+_.y,V.x+"|"+V.y);if(e=this.IDATA.edgematch[o][2],(t=this.IDATA.edgematch[o][3])&&"A"===t)for(let t=1;t<d;t++)V.x=t*p,V.y=t*f,O.x=c-(d-t)*(p+f),O.y=u+(d-t)*p,v(o,e,n=V.x+"|"+V.y,O.x+"|"+O.y);for(let e=0;e<this.vertices.length;e++)(a=o+"|"+(n=this.vertices[e].x+"|"+this.vertices[e].y))in h||(h[a]=l++,T[n][0]>2?y[h[a]]=[-T[n][0],T[n][1],h[a]]:y[h[a]]=[M[T[n][0]],T[n][1],h[a]])}this.closestTo=y,this.vecToidx=h}calcCoeffs(){let e=this.m,t=this.n,s=Math.sqrt(3)/3,r=e*e+t*t+e*t;this.coau=(e+t)/r,this.cobu=-t/r,this.coav=-s*(e-t)/r,this.cobv=s*(2*e+t)/r}createInnerFacets(){let e=this.m,t=this.n;for(let s=0;s<t+e+1;s++)for(let e=this.min[s];e<this.max[s]+1;e++)e<this.max[s]&&e<this.max[s+1]+1&&this.innerFacets.push(["|"+e+"|"+s,"|"+e+"|"+(s+1),"|"+(e+1)+"|"+s]),s>0&&e<this.max[s-1]&&e+1<this.max[s]+1&&this.innerFacets.push(["|"+e+"|"+s,"|"+(e+1)+"|"+s,"|"+(e+1)+"|"+(s-1)])}edgeVecsABOB(){let e=this.m,t=this.n,s=new Z(-t,e+t);for(let r=1;r<e+t;r++){let e=new Z(this.min[r],r),t=new Z(this.min[r-1],r-1),i=new Z(this.min[r+1],r+1),a=e.clone(),o=t.clone(),n=i.clone();a.rotate60About(s),o.rotate60About(s),n.rotate60About(s);let l=new Z(this.max[a.y],a.y),h=new Z(this.max[a.y-1],a.y-1),c=new Z(this.max[a.y-1]-1,a.y-1);(a.x!==l.x||a.y!==l.y)&&(a.x!==h.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,c]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,c,l])):a.y===n.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,h]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([e,h,i])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,h]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,l])))}}mapABOBtoOBOA(){let e=new Z(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){let s=[];for(let r=0;r<3;r++)e.x=this.isoVecsABOB[t][r].x,e.y=this.isoVecsABOB[t][r].y,0===this.vertexTypes[t][r]&&e.rotateNeg120(this.m,this.n),s.push(e.clone());this.isoVecsOBOA.push(s)}}mapABOBtoBAOA(){let e=new Z(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){let s=[];for(let r=0;r<3;r++)e.x=this.isoVecsABOB[t][r].x,e.y=this.isoVecsABOB[t][r].y,1===this.vertexTypes[t][r]&&e.rotate120(this.m,this.n),s.push(e.clone());this.isoVecsBAOA.push(s)}}MapToFace(e,t){let s,i,a=this.IDATA.face[e],o=a[2],n=a[1],l=a[0],h=r.Vector3.FromArray(this.IDATA.vertex[o]),c=r.Vector3.FromArray(this.IDATA.vertex[n]),u=r.Vector3.FromArray(this.IDATA.vertex[l]),d=c.subtract(h),p=u.subtract(h),f=d.scale(this.coau).add(p.scale(this.cobu)),x=d.scale(this.coav).add(p.scale(this.cobv)),g=[];for(let r=0;r<this.cartesian.length;r++)i=f.scale(this.cartesian[r].x).add(x.scale(this.cartesian[r].y)).add(h),g[r]=[i.x,i.y,i.z],s=e+"|"+this.vertices[r].x+"|"+this.vertices[r].y,t.vertex[this.vecToidx[s]]=[i.x,i.y,i.z]}build(e,t){let s,r,i=[],a=Z.Zero(),o=new Z(e,t),n=new Z(-t,e+t);i.push(a,o,n);for(let s=t;s<e+1;s++)for(let t=0;t<e+1-s;t++)i.push(new Z(t,s));if(t>0){let s=(0,E.HighestCommonFactor)(e,t),r=e/s,a=t/s;for(let o=1;o<s;o++)i.push(new Z(o*r,o*a)),i.push(new Z(-o*a,o*(r+a))),i.push(new Z(e-o*(r+a),t+o*r));let o=e/t;for(let s=1;s<t;s++)for(let r=0;r<s*o;r++)i.push(new Z(r,s)),i.push(new Z(r,s).rotate120(e,t)),i.push(new Z(r,s).rotateNeg120(e,t))}i.sort((e,t)=>e.x-t.x),i.sort((e,t)=>e.y-t.y);let l=Array(e+t+1),h=Array(e+t+1);for(let e=0;e<l.length;e++)l[e]=1/0,h[e]=-1/0;let c=i.length;for(let e=0;e<c;e++)r=i[e].x,l[s=i[e].y]=Math.min(r,l[s]),h[s]=Math.max(r,h[s]);let u=(s,r)=>{let i=s.clone();return("A"===r&&i.rotateNeg120(e,t),"B"===r&&i.rotate120(e,t),i.x<0)?i.y:i.x+i.y},d=[],p=[],f=[],x=[],g={},m=[],V=-1,O=-1;for(let e=0;e<c;e++)d[e]=i[e].toCartesianOrigin(new Z(0,0),.5),p[e]=u(i[e],"O"),f[e]=u(i[e],"A"),x[e]=u(i[e],"B"),p[e]===f[e]&&f[e]===x[e]?(V=3,O=p[e]):p[e]===f[e]?(V=4,O=p[e]):f[e]===x[e]?(V=5,O=f[e]):x[e]===p[e]&&(V=6,O=p[e]),p[e]<f[e]&&p[e]<x[e]&&(V=2,O=p[e]),f[e]<p[e]&&f[e]<x[e]&&(V=1,O=f[e]),x[e]<f[e]&&x[e]<p[e]&&(V=0,O=x[e]),m.push([V,O,i[e].x,i[e].y]);m.sort((e,t)=>e[2]-t[2]),m.sort((e,t)=>e[3]-t[3]),m.sort((e,t)=>e[1]-t[1]),m.sort((e,t)=>e[0]-t[0]);for(let e=0;e<m.length;e++)g[m[e][2]+"|"+m[e][3]]=[m[e][0],m[e][1],e];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=g,this.cartesian=d,this.min=l,this.max=h,this}}class k{constructor(e,t,s,r){this.name=e,this.category=t,this.vertex=s,this.face=r}}class Y extends k{innerToData(e,t){for(let s=0;s<t.innerFacets.length;s++)this.face.push(t.innerFacets[s].map(s=>t.vecToidx[e+s]))}mapABOBtoDATA(e,t){let s=t.IDATA.edgematch[e][0];for(let r=0;r<t.isoVecsABOB.length;r++){let i=[];for(let a=0;a<3;a++)0===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsABOB[r][a].x+"|"+t.isoVecsABOB[r][a].y):i.push(s+"|"+t.isoVecsABOB[r][a].x+"|"+t.isoVecsABOB[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}mapOBOAtoDATA(e,t){let s=t.IDATA.edgematch[e][0];for(let r=0;r<t.isoVecsOBOA.length;r++){let i=[];for(let a=0;a<3;a++)1===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsOBOA[r][a].x+"|"+t.isoVecsOBOA[r][a].y):i.push(s+"|"+t.isoVecsOBOA[r][a].x+"|"+t.isoVecsOBOA[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}mapBAOAtoDATA(e,t){let s=t.IDATA.edgematch[e][2];for(let r=0;r<t.isoVecsBAOA.length;r++){let i=[];for(let a=0;a<3;a++)1===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsBAOA[r][a].x+"|"+t.isoVecsBAOA[r][a].y):i.push(s+"|"+t.isoVecsBAOA[r][a].x+"|"+t.isoVecsBAOA[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}orderData(e){let t=[];for(let e=0;e<13;e++)t[e]=[];let s=e.closestTo;for(let e=0;e<s.length;e++)s[e][0]>-1?s[e][1]>0&&t[s[e][0]].push([e,s[e][1]]):t[12].push([e,s[e][0]]);let r=[];for(let e=0;e<12;e++)r[e]=e;let i=12;for(let e=0;e<12;e++){t[e].sort((e,t)=>e[1]-t[1]);for(let s=0;s<t[e].length;s++)r[t[e][s][0]]=i++}for(let e=0;e<t[12].length;e++)r[t[12][e][0]]=i++;for(let e=0;e<this.vertex.length;e++)this.vertex[e].push(r[e]);this.vertex.sort((e,t)=>e[3]-t[3]);for(let e=0;e<this.vertex.length;e++)this.vertex[e].pop();for(let e=0;e<this.face.length;e++)for(let t=0;t<this.face[e].length;t++)this.face[e][t]=r[this.face[e][t]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){let s=[],r=[],i=t.pop();r.push(i);let a=this.face[i].indexOf(e);a=(a+2)%3;let o=this.face[i][a];s.push(o);let n=0;for(;t.length>0;)i=t[n],this.face[i].indexOf(o)>-1?(a=(this.face[i].indexOf(o)+1)%3,o=this.face[i][a],s.push(o),r.push(i),t.splice(n,1),n=0):n++;return this.adjacentFaces.push(s),r}toGoldbergPolyhedronData(){let e,t,s,r,i,a=new k("GeoDual","Goldberg",[],[]);a.name="GD dual";let o=this.vertex.length,n=Array(o);for(let e=0;e<o;e++)n[e]=[];for(let e=0;e<this.face.length;e++)for(let t=0;t<3;t++)n[this.face[e][t]].push(e);this.adjacentFaces=[];for(let o=0;o<n.length;o++)for(let l of(a.face[o]=this.setOrder(o,n[o].concat([])),n[o])){e=0,t=0,s=0,r=this.face[l];for(let a=0;a<3;a++)e+=(i=this.vertex[r[a]])[0],t+=i[1],s+=i[2];a.vertex[l]=[e/3,t/3,s/3]}return a}static BuildGeodesicData(e){let t=new Y("Geodesic-m-n","Geodesic",[[0,v.PHI,-1],[-v.PHI,1,0],[-1,0,-v.PHI],[1,0,-v.PHI],[v.PHI,1,0],[0,v.PHI,1],[-1,0,v.PHI],[-v.PHI,-1,0],[0,-v.PHI,-1],[v.PHI,-1,0],[1,0,v.PHI],[0,-v.PHI,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;s<e.IDATA.face.length;s++)e.MapToFace(s,t),t.innerToData(s,e),"B"===e.IDATA.edgematch[s][1]&&t.mapABOBtoDATA(s,e),"O"===e.IDATA.edgematch[s][1]&&t.mapOBOAtoDATA(s,e),"A"===e.IDATA.edgematch[s][3]&&t.mapBAOAtoDATA(s,e);return t.orderData(e),t.vertex=t.vertex.map(function(e){let t=e[0],s=e[1],r=e[2],i=Math.sqrt(t*t+s*s+r*r);return e[0]*=1/i,e[1]*=1/i,e[2]*=1/i,e}),t}}var K=i;class Q extends K.Mesh{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return void 0===t?(e>this.goldbergData.nbUnsharedFaces-1&&(_.Logger.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(_.Logger.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(_.Logger.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let t=0;t<e.length;t++){let s=e[t][0],r=e[t][1],i=e[t][2];for(let e=s;e<r+1;e++)this.goldbergData.faceColors[e]=i}let t=[];for(let e=0;e<12;e++)for(let s=0;s<5;s++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);for(let e=12;e<this.goldbergData.faceColors.length;e++)for(let s=0;s<6;s++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);return t}setGoldbergFaceColors(e){let t=this._changeGoldbergFaceColors(e);this.setVerticesData(a.VertexBuffer.ColorKind,t)}updateGoldbergFaceColors(e){let t=this._changeGoldbergFaceColors(e);this.updateVerticesData(a.VertexBuffer.ColorKind,t)}_changeGoldbergFaceUVs(e){let t=this.getVerticesData(a.VertexBuffer.UVKind);for(let s=0;s<e.length;s++){let r,i,a=e[s][0],o=e[s][1],n=e[s][2],l=e[s][3],h=e[s][4],c=[],u=[];for(let e=0;e<5;e++)r=n.x+l*Math.cos(h+e*Math.PI/2.5),i=n.y+l*Math.sin(h+e*Math.PI/2.5),r<0&&(r=0),r>1&&(r=1),c.push(r,i);for(let e=0;e<6;e++)r=n.x+l*Math.cos(h+e*Math.PI/3),i=n.y+l*Math.sin(h+e*Math.PI/3),r<0&&(r=0),r>1&&(r=1),u.push(r,i);for(let e=a;e<Math.min(12,o+1);e++)for(let s=0;s<5;s++)t[10*e+2*s]=c[2*s],t[10*e+2*s+1]=c[2*s+1];for(let e=Math.max(12,a);e<o+1;e++)for(let s=0;s<6;s++)t[12*e-24+2*s]=u[2*s],t[12*e-23+2*s]=u[2*s+1]}return t}setGoldbergFaceUVs(e){let t=this._changeGoldbergFaceUVs(e);this.setVerticesData(a.VertexBuffer.UVKind,t)}updateGoldbergFaceUVs(e){let t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(a.VertexBuffer.UVKind,t)}placeOnGoldbergFaceAt(e,t,s){e.rotation=r.Vector3.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]),e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(s.x)).add(this.goldbergData.faceYaxis[t].scale(s.y)).add(this.goldbergData.faceZaxis[t].scale(s.z))}serialize(e){super.serialize(e),e.type="GoldbergMesh";let t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors)for(let e of(t.faceColors=[],this.goldbergData.faceColors))t.faceColors.push(e.asArray());if(this.goldbergData.faceCenters)for(let e of(t.faceCenters=[],this.goldbergData.faceCenters))t.faceCenters.push(e.asArray());if(this.goldbergData.faceZaxis)for(let e of(t.faceZaxis=[],this.goldbergData.faceZaxis))t.faceZaxis.push(e.asArray());if(this.goldbergData.faceYaxis)for(let e of(t.faceYaxis=[],this.goldbergData.faceYaxis))t.faceYaxis.push(e.asArray());if(this.goldbergData.faceXaxis)for(let e of(t.faceXaxis=[],this.goldbergData.faceXaxis))t.faceXaxis.push(e.asArray());e.goldbergData=t}static Parse(e,t){let s=e.goldbergData;s.faceColors=s.faceColors.map(e=>h.Color4.FromArray(e)),s.faceCenters=s.faceCenters.map(e=>r.Vector3.FromArray(e)),s.faceZaxis=s.faceZaxis.map(e=>r.Vector3.FromArray(e)),s.faceXaxis=s.faceXaxis.map(e=>r.Vector3.FromArray(e)),s.faceYaxis=s.faceYaxis.map(e=>r.Vector3.FromArray(e));let i=new Q(e.name,t);return i.goldbergData=s,i}}var q=e.i(82100);class j{constructor(e){this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){this._currentPath=new T.Path2(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,s,r){this._currentPath.addQuadraticCurveTo(e,t,s,r,this._resolution)}bezierCurveTo(e,t,s,r,i,a){this._currentPath.addBezierCurveTo(e,t,s,r,i,a,this._resolution)}extractHoles(){for(let e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){let e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}e.s(["MeshBuilder",0,{CreateBox:function(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],s=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],i=[],a=e.width||e.size||1,l=e.height||e.size||1,c=e.depth||e.size||1,u=e.wrap||!1,d=void 0===e.topBaseAt?1:e.topBaseAt,p=void 0===e.bottomBaseAt?0:e.bottomBaseAt;d=(d+4)%4,p=(p+4)%4;let f=[2,0,3,1][d],x=[2,0,1,3][p],g=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(u){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],g=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];let e=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],s=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]],r=[17,18,19,16],i=[22,23,20,21];for(;f>0;)e.unshift(e.pop()),r.unshift(r.pop()),f--;for(;x>0;)s.unshift(s.pop()),i.unshift(i.pop()),x--;e=e.flat(),s=s.flat(),g=g.concat(e).concat(s),t.push(r[0],r[2],r[3],r[0],r[1],r[2]),t.push(i[0],i[2],i[3],i[0],i[1],i[2])}let m=[a/2,l/2,c/2],V=g.reduce((e,t,s)=>e.concat(t*m[s%3]),[]),O=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,_=e.faceUV||Array(6),M=e.faceColors,y=[];for(let e=0;e<6;e++)void 0===_[e]&&(_[e]=new r.Vector4(0,0,1,1)),M&&void 0===M[e]&&(M[e]=new h.Color4(1,1,1,1));for(let e=0;e<6;e++)if(i.push(_[e].z,n.useOpenGLOrientationForUV?1-_[e].w:_[e].w),i.push(_[e].x,n.useOpenGLOrientationForUV?1-_[e].w:_[e].w),i.push(_[e].x,n.useOpenGLOrientationForUV?1-_[e].y:_[e].y),i.push(_[e].z,n.useOpenGLOrientationForUV?1-_[e].y:_[e].y),M)for(let t=0;t<4;t++)y.push(M[e].r,M[e].g,M[e].b,M[e].a);o.VertexData._ComputeSides(O,V,t,s,i,e.frontUVs,e.backUVs);let T=new o.VertexData;return T.indices=t,T.positions=V,T.normals=s,T.uvs=i,M&&(T.colors=O===o.VertexData.DOUBLESIDE?y.concat(y):y),T})(t).applyToMesh(a,t.updatable),a},CreateTiledBox:function(e,t,s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,u(t).applyToMesh(r,t.updatable),r},CreateSphere:function(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=0|(e.segments||32),s=e.diameterX||e.diameter||1,i=e.diameterY||e.diameter||1,a=e.diameterZ||e.diameter||1,l=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,h=e.slice&&e.slice<=0?1:e.slice||1,c=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,u=!!e.dedupTopBottomIndices,d=new r.Vector3(s/2,i/2,a/2),p=2+t,f=2*p,x=[],g=[],m=[],V=[];for(let e=0;e<=p;e++){let t=e/p,s=t*Math.PI*h;for(let e=0;e<=f;e++){let i=e/f,a=i*Math.PI*2*l,o=r.Matrix.RotationZ(-s),h=r.Matrix.RotationY(a),c=r.Vector3.TransformCoordinates(r.Vector3.Up(),o),u=r.Vector3.TransformCoordinates(c,h),p=u.multiply(d),x=u.divide(d).normalize();g.push(p.x,p.y,p.z),m.push(x.x,x.y,x.z),V.push(i,n.useOpenGLOrientationForUV?1-t:t)}if(e>0){let t=g.length/3;for(let s=t-2*(f+1);s+f+2<t;s++)u?(e>1&&(x.push(s),x.push(s+1),x.push(s+f+1)),(e<p||h<1)&&(x.push(s+f+1),x.push(s+1),x.push(s+f+2))):(x.push(s),x.push(s+1),x.push(s+f+1),x.push(s+f+1),x.push(s+1),x.push(s+f+2))}}o.VertexData._ComputeSides(c,g,x,m,V,e.frontUVs,e.backUVs);let O=new o.VertexData;return O.indices=x,O.positions=g,O.normals=m,O.uvs=V,O})(t).applyToMesh(a,t.updatable),a},CreateDisc:function(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=[],s=[],r=[],i=[],a=e.radius||.5,l=e.tessellation||64,h=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,c=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;t.push(0,0,0),i.push(.5,.5);let u=2*Math.PI*h,d=1===h?u/l:u/(l-1),p=0;for(let e=0;e<l;e++){let e=Math.cos(p),s=Math.sin(p),r=(e+1)/2,o=(1-s)/2;t.push(a*e,a*s,0),i.push(r,n.useOpenGLOrientationForUV?1-o:o),p+=d}1===h&&(t.push(t[3],t[4],t[5]),i.push(i[2],n.useOpenGLOrientationForUV?1-i[3]:i[3]));let f=t.length/3;for(let e=1;e<f-1;e++)s.push(e+1,0,e);o.VertexData.ComputeNormals(t,s,r),o.VertexData._ComputeSides(c,t,s,r,i,e.frontUVs,e.backUVs);let x=new o.VertexData;return x.indices=s,x.positions=t,x.normals=r,x.uvs=i,x})(t).applyToMesh(r,t.updatable),r},CreateIcoSphere:function(e,t={},s=null){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s=e.sideOrientation||o.VertexData.DEFAULTSIDE,i=e.radius||1,a=void 0===e.flat||e.flat,l=0|(e.subdivisions||4),h=e.radiusX||i,c=e.radiusY||i,u=e.radiusZ||i,d=(1+Math.sqrt(5))/2,p=[-1,d,-0,1,d,0,-1,-d,0,1,-d,0,0,-1,-d,0,1,-d,0,-1,d,0,1,d,d,0,1,d,0,-1,-d,0,1,-d,0,-1],f=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],x=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],g=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],m=138/1024,V=239/1024,O=60/1024,_=26/1024,M=-40/1024,y=20/1024,T=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],v=[],b=[],A=[],I=[],D=0,w=[,,,],F=[,,,];for(t=0;t<3;t++)w[t]=r.Vector3.Zero(),F[t]=r.Vector2.Zero();for(let e=0;e<20;e++){for(t=0;t<3;t++){let s=f[3*e+t];w[t].copyFromFloats(p[3*x[s]],p[3*x[s]+1],p[3*x[s]+2]),w[t].normalize(),F[t].copyFromFloats(g[2*s]*m+O+T[e]*M,g[2*s+1]*V+_+T[e]*y)}let s=(e,t,s,i)=>{let o,d=r.Vector3.Lerp(w[0],w[2],t/l),p=r.Vector3.Lerp(w[1],w[2],t/l),f=l===t?w[2]:r.Vector3.Lerp(d,p,e/(l-t));if(f.normalize(),a){let e=r.Vector3.Lerp(w[0],w[2],i/l),t=r.Vector3.Lerp(w[1],w[2],i/l);o=r.Vector3.Lerp(e,t,s/(l-i))}else o=new r.Vector3(f.x,f.y,f.z);o.x/=h,o.y/=c,o.z/=u,o.normalize();let x=r.Vector2.Lerp(F[0],F[2],t/l),g=r.Vector2.Lerp(F[1],F[2],t/l),m=l===t?F[2]:r.Vector2.Lerp(x,g,e/(l-t));b.push(f.x*h,f.y*c,f.z*u),A.push(o.x,o.y,o.z),I.push(m.x,n.useOpenGLOrientationForUV?1-m.y:m.y),v.push(D),D++};for(let e=0;e<l;e++)for(let t=0;t+e<l;t++)s(t,e,t+1/3,e+1/3),s(t+1,e,t+1/3,e+1/3),s(t,e+1,t+1/3,e+1/3),t+e+1<l&&(s(t+1,e,t+2/3,e+2/3),s(t+1,e+1,t+2/3,e+2/3),s(t,e+1,t+2/3,e+2/3))}o.VertexData._ComputeSides(s,b,v,A,I,e.frontUVs,e.backUVs);let P=new o.VertexData;return P.indices=v,P.positions=b,P.normals=A,P.uvs=I,P})(t).applyToMesh(a,t.updatable),a},CreateRibbon:l,CreateCylinder:function(e,t={},s){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s,a,l,c,u,p,f,x,g=e.height||2,m=0===e.diameterTop?0:e.diameterTop||e.diameter||1,V=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;m=m||1e-5,V=V||1e-5;let O=0|(e.tessellation||24),_=0|(e.subdivisions||1),M=!!e.hasRings,y=!!e.enclose,T=0===e.cap?0:e.cap||i.Mesh.CAP_ALL,v=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,b=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,A=e.faceUV||[,,,],I=e.faceColors,D=2+(1+(1!==v&&y?2:0))*(M?_:1);for(t=0;t<D;t++)I&&void 0===I[t]&&(I[t]=new h.Color4(1,1,1,1));for(t=0;t<D;t++)A&&void 0===A[t]&&(A[t]=new r.Vector4(0,0,1,1));let w=[],F=[],P=[],L=[],z=[],B=2*Math.PI*v/O,C=(V-m)/2/g,E=r.Vector3.Zero(),S=r.Vector3.Zero(),R=r.Vector3.Zero(),U=r.Vector3.Zero(),N=r.Vector3.Zero(),W=d.Axis.Y,G=1,H=0;for(c=0;c<=_;c++)for(p=0,l=((a=c/_)*(m-V)+V)/2,f=M&&0!==c&&c!==_?2:1;p<f;p++){for(M&&(G+=p),y&&(G+=2*p),u=0;u<=O;u++)E.x=Math.cos(-(s=u*B))*l,E.y=-g/2+a*g,E.z=Math.sin(-s)*l,0===m&&c===_?(S.x=P[P.length-(O+1)*3],S.y=P[P.length-(O+1)*3+1],S.z=P[P.length-(O+1)*3+2]):(S.x=E.x,S.z=E.z,S.y=Math.sqrt(S.x*S.x+S.z*S.z)*C,S.normalize()),0===u&&(R.copyFrom(E),U.copyFrom(S)),F.push(E.x,E.y,E.z),P.push(S.x,S.y,S.z),x=M?H!==G?A[G].y:A[G].w:A[G].y+(A[G].w-A[G].y)*a,L.push(A[G].x+(A[G].z-A[G].x)*u/O,n.useOpenGLOrientationForUV?1-x:x),I&&z.push(I[G].r,I[G].g,I[G].b,I[G].a);1!==v&&y&&(F.push(E.x,E.y,E.z),F.push(0,E.y,0),F.push(0,E.y,0),F.push(R.x,R.y,R.z),r.Vector3.CrossToRef(W,S,N),N.normalize(),P.push(N.x,N.y,N.z,N.x,N.y,N.z),r.Vector3.CrossToRef(U,W,N),N.normalize(),P.push(N.x,N.y,N.z,N.x,N.y,N.z),x=M?H!==G?A[G+1].y:A[G+1].w:A[G+1].y+(A[G+1].w-A[G+1].y)*a,L.push(A[G+1].x,n.useOpenGLOrientationForUV?1-x:x),L.push(A[G+1].z,n.useOpenGLOrientationForUV?1-x:x),x=M?H!==G?A[G+2].y:A[G+2].w:A[G+2].y+(A[G+2].w-A[G+2].y)*a,L.push(A[G+2].x,n.useOpenGLOrientationForUV?1-x:x),L.push(A[G+2].z,n.useOpenGLOrientationForUV?1-x:x),I&&(z.push(I[G+1].r,I[G+1].g,I[G+1].b,I[G+1].a),z.push(I[G+1].r,I[G+1].g,I[G+1].b,I[G+1].a),z.push(I[G+2].r,I[G+2].g,I[G+2].b,I[G+2].a),z.push(I[G+2].r,I[G+2].g,I[G+2].b,I[G+2].a))),H!==G&&(H=G)}let Z=1!==v&&y?O+4:O;for(G=0,c=0;G<_;G++){let e=0,t=0,s=0,r=0;for(u=0;u<O;u++)e=c*(Z+1)+u,t=(c+1)*(Z+1)+u,s=c*(Z+1)+(u+1),r=(c+1)*(Z+1)+(u+1),w.push(e,t,s),w.push(r,s,t);1!==v&&y&&(w.push(e+2,t+2,s+2),w.push(r+2,s+2,t+2),w.push(e+4,t+4,s+4),w.push(r+4,s+4,t+4)),c=M?c+2:c+1}let X=e=>{let t,s,i,a=e?m/2:V/2;if(0===a)return;let o=e?A[D-1]:A[0],l=null;I&&(l=e?I[D-1]:I[0]);let h=F.length/3,c=e?g/2:-g/2,u=new r.Vector3(0,c,0);F.push(u.x,u.y,u.z),P.push(0,e?1:-1,0);let d=o.y+(o.w-o.y)*.5;L.push(o.x+(o.z-o.x)*.5,n.useOpenGLOrientationForUV?1-d:d),l&&z.push(l.r,l.g,l.b,l.a);let p=new r.Vector2(.5,.5);for(i=0;i<=O;i++){let h=Math.cos(-(t=2*Math.PI*i*v/O)),u=Math.sin(-t);s=new r.Vector3(h*a,c,u*a);let d=new r.Vector2(h*p.x+.5,u*p.y+.5);F.push(s.x,s.y,s.z),P.push(0,e?1:-1,0);let f=o.y+(o.w-o.y)*d.y;L.push(o.x+(o.z-o.x)*d.x,n.useOpenGLOrientationForUV?1-f:f),l&&z.push(l.r,l.g,l.b,l.a)}for(i=0;i<O;i++)e?(w.push(h),w.push(h+(i+2)),w.push(h+(i+1))):(w.push(h),w.push(h+(i+1)),w.push(h+(i+2)))};(T===i.Mesh.CAP_START||T===i.Mesh.CAP_ALL)&&X(!1),(T===i.Mesh.CAP_END||T===i.Mesh.CAP_ALL)&&X(!0),o.VertexData._ComputeSides(b,F,w,P,L,e.frontUVs,e.backUVs);let k=new o.VertexData;return k.indices=w,k.positions=F,k.normals=P,k.uvs=L,I&&(k.colors=z),k})(t).applyToMesh(a,t.updatable),a},CreateTorus:function(e,t={},s){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t=[],s=[],i=[],a=[],l=e.diameter||1,h=e.thickness||.5,c=0|(e.tessellation||16),u=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,d=c+1;for(let e=0;e<=c;e++){let o=e/c,u=e*Math.PI*2/c-Math.PI/2,p=r.Matrix.Translation(l/2,0,0).multiply(r.Matrix.RotationY(u));for(let l=0;l<=c;l++){let u=1-l/c,f=l*Math.PI*2/c+Math.PI,x=Math.cos(f),g=Math.sin(f),m=new r.Vector3(x,g,0),V=m.scale(h/2),O=new r.Vector2(o,u);V=r.Vector3.TransformCoordinates(V,p),m=r.Vector3.TransformNormal(m,p),s.push(V.x,V.y,V.z),i.push(m.x,m.y,m.z),a.push(O.x,n.useOpenGLOrientationForUV?1-O.y:O.y);let _=(e+1)%d,M=(l+1)%d;t.push(e*d+l),t.push(e*d+M),t.push(_*d+l),t.push(e*d+M),t.push(_*d+M),t.push(_*d+l)}}o.VertexData._ComputeSides(u,s,t,i,a,e.frontUVs,e.backUVs);let p=new o.VertexData;return p.indices=t,p.positions=s,p.normals=i,p.uvs=a,p})(t).applyToMesh(a,t.updatable),a},CreateTorusKnot:function(e,t={},s){let a=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),a._originalBuilderSideOrientation=t.sideOrientation,(function(e){let t,s,i=[],a=[],l=[],h=[],c=e.radius||2,u=e.tube||.5,d=e.radialSegments||32,p=e.tubularSegments||32,f=e.p||2,x=e.q||3,g=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,m=e=>{let t=Math.cos(e),s=Math.sin(e),i=x/f*e,a=Math.cos(i),o=c*Math.sin(i)*.5;return new r.Vector3(c*(2+a)*.5*t,c*(2+a)*s*.5,o)};for(t=0;t<=d;t++){let e=t%d/d*2*f*Math.PI,i=m(e),o=m(e+.01),l=o.subtract(i),c=o.add(i),x=r.Vector3.Cross(l,c);for(c=r.Vector3.Cross(x,l),x.normalize(),c.normalize(),s=0;s<p;s++){let e=s%p/p*2*Math.PI,r=-u*Math.cos(e),o=u*Math.sin(e);a.push(i.x+r*c.x+o*x.x),a.push(i.y+r*c.y+o*x.y),a.push(i.z+r*c.z+o*x.z),h.push(t/d),h.push(n.useOpenGLOrientationForUV?1-s/p:s/p)}}for(t=0;t<d;t++)for(s=0;s<p;s++){let e=(s+1)%p,r=t*p+s,a=(t+1)*p+s,o=(t+1)*p+e,n=t*p+e;i.push(n),i.push(a),i.push(r),i.push(n),i.push(o),i.push(a)}o.VertexData.ComputeNormals(a,i,l),o.VertexData._ComputeSides(g,a,i,l,h,e.frontUVs,e.backUVs);let V=new o.VertexData;return V.indices=i,V.positions=a,V.normals=l,V.uvs=h,V})(t).applyToMesh(a,t.updatable),a},CreateLineSystem:M,CreateLines:function(e,t,s=null){let r=t.colors?[t.colors]:null;return M(e,{lines:[t.points],updatable:t.updatable,instance:t.instance,colors:r,useVertexAlpha:t.useVertexAlpha,material:t.material},s)},CreateDashedLines:function(e,t,s=null){let a=t.points,n=t.instance,l=t.gapSize||1,h=t.dashSize||3;if(n)return(t.dashNb||t.dashSize||t.gapSize||t.useVertexAlpha||t.material)&&_.Logger.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),n.updateMeshPositions(e=>{let t,s,i,o,l=r.Vector3.Zero(),h=e.length/6,c=0,u=0;for(i=0;i<a.length-1;i++)a[i+1].subtractToRef(a[i],l),c+=l.length();let d=c/h,p=n._creationDataStorage.dashSize,f=p*d/(p+n._creationDataStorage.gapSize);for(i=0;i<a.length-1;i++)for(a[i+1].subtractToRef(a[i],l),t=Math.floor(l.length()/d),l.normalize(),o=0;o<t&&u<e.length;)s=d*o,e[u]=a[i].x+s*l.x,e[u+1]=a[i].y+s*l.y,e[u+2]=a[i].z+s*l.z,e[u+3]=a[i].x+(s+f)*l.x,e[u+4]=a[i].y+(s+f)*l.y,e[u+5]=a[i].z+(s+f)*l.z,u+=6,o++;for(;u<e.length;)e[u]=a[i].x,e[u+1]=a[i].y,e[u+2]=a[i].z,u+=3},!1),n;let c=new V(e,s,null,void 0,void 0,void 0,t.useVertexAlpha,t.material);return(function(e){let t,s,i,a=e.dashSize||3,n=e.gapSize||1,l=e.dashNb||200,h=e.points,c=[],u=[],d=r.Vector3.Zero(),p=0,f=0;for(i=0;i<h.length-1;i++)h[i+1].subtractToRef(h[i],d),p+=d.length();let x=p/l,g=a*x/(a+n);for(i=0;i<h.length-1;i++){h[i+1].subtractToRef(h[i],d),t=Math.floor(d.length()/x),d.normalize();for(let e=0;e<t;e++)s=x*e,c.push(h[i].x+s*d.x,h[i].y+s*d.y,h[i].z+s*d.z),c.push(h[i].x+(s+g)*d.x,h[i].y+(s+g)*d.y,h[i].z+(s+g)*d.z),u.push(f,f+1),f+=2}let m=new o.VertexData;return m.positions=c,m.indices=u,m})(t).applyToMesh(c,t.updatable),c._creationDataStorage=new i._CreationDataStorage,c._creationDataStorage.dashSize=h,c._creationDataStorage.gapSize=l,c},ExtrudeShape:function(e,t,s=null){let r=t.path,a=t.shape,o=t.scale||1,n=t.rotation||0,l=0===t.cap?0:t.cap||i.Mesh.NO_CAP,h=t.updatable,c=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),u=t.instance||null,d=t.invertUV||!1,p=t.closeShape||!1,f=t.closePath||!1,x=t.capFunction||null;return P(e,a,r,o,n,null,null,f,p,l,!1,s,!!h,c,u,d,t.frontUVs||null,t.backUVs||null,t.firstNormal||null,!!t.adjustFrame,x)},ExtrudeShapeCustom:function(e,t,s=null){let a=t.path,o=t.shape,n=r.Vector3.Zero(),l=t.rotationFunction||(()=>0),h=t.closePath||t.ribbonCloseArray||!1,c=t.closeShape||t.ribbonClosePath||!1,u=0===t.cap?0:t.cap||i.Mesh.NO_CAP,d=t.updatable,p=t.firstNormal||null,f=t.adjustFrame||!1,x=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),g=t.instance,m=t.invertUV||!1,V=t.capFunction||null;return P(e,o,a,null,null,t.scaleVectorFunction??((e,s)=>{let r=t.scaleFunction?.(e,s)??1;return n.copyFromFloats(r,r,r)}),l,h,c,u,!0,s,!!d,x,g||null,m,t.frontUVs||null,t.backUVs||null,p,f,V||null)},CreateLathe:function(e,t,s=null){let a,o,n,h,c=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,u=void 0===t.closed||t.closed,d=t.shape,p=t.radius||1,f=t.tessellation||64,x=t.clip||0,g=t.updatable,m=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),V=t.cap||i.Mesh.NO_CAP,O=2*Math.PI,_=[],M=t.invertUV||!1,y=O/f*c;for(a=0;a<=f-x;a++){for(h=[],(V==i.Mesh.CAP_START||V==i.Mesh.CAP_ALL)&&(h.push(new r.Vector3(0,d[0].y,0)),h.push(new r.Vector3(Math.cos(a*y)*d[0].x*p,d[0].y,Math.sin(a*y)*d[0].x*p))),o=0;o<d.length;o++)n=new r.Vector3(Math.cos(a*y)*d[o].x*p,d[o].y,Math.sin(a*y)*d[o].x*p),h.push(n);(V==i.Mesh.CAP_END||V==i.Mesh.CAP_ALL)&&(h.push(new r.Vector3(Math.cos(a*y)*d[d.length-1].x*p,d[d.length-1].y,Math.sin(a*y)*d[d.length-1].x*p)),h.push(new r.Vector3(0,d[d.length-1].y,0))),_.push(h)}return l(e,{pathArray:_,closeArray:u,sideOrientation:m,updatable:g,invertUV:M,frontUVs:t.frontUVs,backUVs:t.backUVs},s)},CreateTiledPlane:function(e,t,s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,c(t).applyToMesh(r,t.updatable),r},CreatePlane:function(e,t={},s=null){let r,a,l,h,c,u,d,p,f,x,g=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),g._originalBuilderSideOrientation=t.sideOrientation,(r=[],a=[],l=[],h=[],c=void 0!==t.width?t.width:void 0!==t.size?t.size:1,u=void 0!==t.height?t.height:void 0!==t.size?t.size:1,d=0===t.sideOrientation?0:t.sideOrientation||o.VertexData.DEFAULTSIDE,p=c/2,f=u/2,a.push(-p,-f,0),l.push(0,0,-1),h.push(0,+!!n.useOpenGLOrientationForUV),a.push(p,-f,0),l.push(0,0,-1),h.push(1,+!!n.useOpenGLOrientationForUV),a.push(p,f,0),l.push(0,0,-1),h.push(1,+!n.useOpenGLOrientationForUV),a.push(-p,f,0),l.push(0,0,-1),h.push(0,+!n.useOpenGLOrientationForUV),r.push(0),r.push(1),r.push(2),r.push(0),r.push(2),r.push(3),o.VertexData._ComputeSides(d,a,r,l,h,t.frontUVs,t.backUVs),(x=new o.VertexData).indices=r,x.positions=a,x.normals=l,x.uvs=h,x).applyToMesh(g,t.updatable),t.sourcePlane&&(g.translate(t.sourcePlane.normal,-t.sourcePlane.d),g.setDirection(t.sourcePlane.normal.scale(-1))),g},CreateGround:function(e,t={},s){let i=new z(e,s);return i._setReady(!1),i._subdivisionsX=t.subdivisionsX||t.subdivisions||1,i._subdivisionsY=t.subdivisionsY||t.subdivisions||1,i._width=t.width||1,i._height=t.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,(function(e){let t,s,i=[],a=[],l=[],h=[],c=e.width||e.size||1,u=e.height||e.size||1,d=0|(e.subdivisionsX||e.subdivisions||1),p=0|(e.subdivisionsY||e.subdivisions||1);for(t=0;t<=p;t++)for(s=0;s<=d;s++){let e=new r.Vector3(s*c/d-c/2,0,(p-t)*u/p-u/2),i=new r.Vector3(0,1,0);a.push(e.x,e.y,e.z),l.push(i.x,i.y,i.z),h.push(s/d,n.useOpenGLOrientationForUV?t/p:1-t/p)}for(t=0;t<p;t++)for(s=0;s<d;s++)i.push(s+1+(t+1)*(d+1)),i.push(s+1+t*(d+1)),i.push(s+t*(d+1)),i.push(s+(t+1)*(d+1)),i.push(s+1+(t+1)*(d+1)),i.push(s+t*(d+1));let f=new o.VertexData;return f.indices=i,f.positions=a,f.normals=l,f.uvs=h,f})(t).applyToMesh(i,t.updatable),i._setReady(!0),i},CreateTiledGround:function(e,t,s=null){let a=new i.Mesh(e,s);return(function(e){let t,s,i,a,n=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,l=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,h=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,c=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,u=e.subdivisions||{w:1,h:1},d=e.precision||{w:1,h:1},p=[],f=[],x=[],g=[];u.h=u.h<1?1:u.h,u.w=u.w<1?1:u.w,d.w=d.w<1?1:d.w,d.h=d.h<1?1:d.h;let m={w:(h-n)/u.w,h:(c-l)/u.h};for(i=0;i<u.h;i++)for(a=0;a<u.w;a++)!function(e,i,a,o){let n=f.length/3,l=d.w+1;for(t=0;t<d.h;t++)for(s=0;s<d.w;s++){let e=[n+s+t*l,n+(s+1)+t*l,n+(s+1)+(t+1)*l,n+s+(t+1)*l];p.push(e[1]),p.push(e[2]),p.push(e[3]),p.push(e[0]),p.push(e[1]),p.push(e[3])}let h=r.Vector3.Zero(),c=new r.Vector3(0,1,0);for(t=0;t<=d.h;t++)for(s=0,h.z=t*(o-i)/d.h+i;s<=d.w;s++)h.x=s*(a-e)/d.w+e,h.y=0,f.push(h.x,h.y,h.z),x.push(c.x,c.y,c.z),g.push(s/d.w,t/d.h)}(n+a*m.w,l+i*m.h,n+(a+1)*m.w,l+(i+1)*m.h);let V=new o.VertexData;return V.indices=p,V.positions=f,V.normals=x,V.uvs=g,V})(t).applyToMesh(a,t.updatable),a},CreateGroundFromHeightMap:function(e,t,s={},i=null){let a,n=s.width||10,l=s.height||10,c=s.subdivisions||1,u=s.minHeight||0,d=s.maxHeight||1,p=s.colorFilter||new h.Color3(.3,.59,.11),f=s.alphaFilter||0,x=s.updatable,g=s.onReady,m=new z(e,i=i||b.EngineStore.LastCreatedScene);m._subdivisionsX=c,m._subdivisionsY=c,m._width=n,m._height=l,m._maxX=m._width/2,m._maxZ=m._height/2,m._minX=-m._maxX,m._minZ=-m._maxZ,m._setReady(!1),s.passHeightBufferInCallback&&(a=new Float32Array((c+1)*(c+1)));let V=(e,t,s)=>{(function(e){let t,s,i=[],a=[],n=[],l=[],c=e.colorFilter||new h.Color3(.3,.59,.11),u=e.alphaFilter||0,d=!1;if(e.minHeight>e.maxHeight){d=!0;let t=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=t}for(t=0;t<=e.subdivisions;t++)for(s=0;s<=e.subdivisions;s++){let i=new r.Vector3(s*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),o=(((i.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(i.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth)*4,h=e.buffer[o]/255,p=e.buffer[o+1]/255,f=e.buffer[o+2]/255,x=e.buffer[o+3]/255;d&&(h=1-h,p=1-p,f=1-f);let g=h*c.r+p*c.g+f*c.b;x>=u?i.y=e.minHeight+(e.maxHeight-e.minHeight)*g:i.y=e.minHeight-v.Epsilon,e.heightBuffer&&(e.heightBuffer[t*(e.subdivisions+1)+s]=i.y),a.push(i.x,i.y,i.z),n.push(0,0,0),l.push(s/e.subdivisions,1-t/e.subdivisions)}for(t=0;t<e.subdivisions;t++)for(s=0;s<e.subdivisions;s++){let r=s+1+(t+1)*(e.subdivisions+1),o=s+1+t*(e.subdivisions+1),n=s+t*(e.subdivisions+1),l=s+(t+1)*(e.subdivisions+1),h=a[3*r+1]>=e.minHeight,c=a[3*o+1]>=e.minHeight,u=a[3*n+1]>=e.minHeight;h&&c&&u&&(i.push(r),i.push(o),i.push(n)),a[3*l+1]>=e.minHeight&&h&&u&&(i.push(l),i.push(r),i.push(n))}o.VertexData.ComputeNormals(a,i,n);let p=new o.VertexData;return p.indices=i,p.positions=a,p.normals=n,p.uvs=l,p})({width:n,height:l,subdivisions:c,minHeight:u,maxHeight:d,colorFilter:p,buffer:e,bufferWidth:t,bufferHeight:s,alphaFilter:f,heightBuffer:a}).applyToMesh(m,x),g&&g(m,a),m._setReady(!0)};return"string"==typeof t?(i.addPendingData(m),B.Tools.LoadImage(t,e=>{let t=e.width,s=e.height;i.isDisposed||V(i?.getEngine().resizeImageBitmap(e,t,s),t,s),i.removePendingData(m)},(e,t)=>{i.removePendingData(m),s.onError&&s.onError(e,t)},i.offlineProvider)):V(t.data,t.width,t.height),m},CreatePolygon:w,ExtrudePolygon:F,CreateTube:function(e,t,s=null){let a,o,n=t.path,h=t.instance,c=1;void 0!==t.radius?c=t.radius:h&&(c=h._creationDataStorage.radius);let u=t.tessellation||64,d=t.radiusFunction||null,p=t.cap||i.Mesh.NO_CAP,f=t.invertUV||!1,x=t.updatable,g=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;let m=(e,t,s,a,o,n,l,h)=>{let c,u,d,p,f=t.getTangents(),x=t.getNormals(),g=t.getDistances(),m=2*Math.PI/o*h,V=n||(()=>a),O=r.TmpVectors.Matrix[0],_=2*(l!==i.Mesh.NO_CAP&&l!==i.Mesh.CAP_END);for(let t=0;t<e.length;t++){u=V(t,g[t]),c=[],d=x[t];for(let s=0;s<o;s++)r.Matrix.RotationAxisToRef(f[t],m*s,O),p=c[s]?c[s]:r.Vector3.Zero(),r.Vector3.TransformCoordinatesToRef(d,O,p),p.scaleInPlace(u).addInPlace(e[t]),c[s]=p;s[_]=c,_++}let M=(t,s)=>{let r=[];for(let i=0;i<t;i++)r.push(e[s]);return r};switch(l){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:s[0]=M(o,0),s[1]=s[2].slice(0);break;case i.Mesh.CAP_END:s[_]=s[_-1].slice(0),s[_+1]=M(o,e.length-1);break;case i.Mesh.CAP_ALL:s[0]=M(o,0),s[1]=s[2].slice(0),s[_]=s[_-1].slice(0),s[_+1]=M(o,e.length-1)}return s};if(h){let e=h._creationDataStorage,s=t.arc||e.arc;return a=e.path3D.update(n),h=l("",{pathArray:o=m(n,a,e.pathArray,c,e.tessellation,d,e.cap,s),instance:h}),e.path3D=a,e.pathArray=o,e.arc=s,e.radius=c,h}a=new T.Path3D(n);let V=l(e,{pathArray:o=m(n,a,[],c,u,d,p=p<0||p>3?0:p,t.arc),closePath:!0,closeArray:!1,updatable:x,sideOrientation:g,invertUV:f,frontUVs:t.frontUVs,backUVs:t.backUVs},s);return V._creationDataStorage.pathArray=o,V._creationDataStorage.path3D=a,V._creationDataStorage.tessellation=u,V._creationDataStorage.cap=p,V._creationDataStorage.arc=t.arc,V._creationDataStorage.radius=c,V},CreatePolyhedron:C,CreateGeodesic:function(e,t,s=null){let r=t.m||1;r!==Math.floor(r)&&(r=Math.floor(r),_.Logger.Warn("m not an integer only floor(m) used"));let i=t.n||0;if(i!==Math.floor(i)&&(i=Math.floor(i),_.Logger.Warn("n not an integer only floor(n) used")),i>r){let e=i;i=r,r=e,_.Logger.Warn("n > m therefore m and n swapped")}let a=new X;return a.build(r,i),C(e,{custom:Y.BuildGeodesicData(a),size:t.size,sizeX:t.sizeX,sizeY:t.sizeY,sizeZ:t.sizeZ,faceUV:t.faceUV,faceColors:t.faceColors,flat:t.flat,updatable:t.updatable,sideOrientation:t.sideOrientation,frontUVs:t.frontUVs,backUVs:t.backUVs},s)},CreateGoldberg:function(e,t,s=null){let a=t.size,l=t.sizeX||a||1,c=t.sizeY||a||1,u=t.sizeZ||a||1,d=t.m||1;d!==Math.floor(d)&&(d=Math.floor(d),_.Logger.Warn("m not an integer only floor(m) used"));let p=t.n||0;if(p!==Math.floor(p)&&(p=Math.floor(p),_.Logger.Warn("n not an integer only floor(n) used")),p>d){let e=p;p=d,d=e,_.Logger.Warn("n > m therefore m and n swapped")}let f=new X;f.build(d,p);let x=Y.BuildGeodesicData(f),g=x.toGoldbergPolyhedronData(),m=new Q(e,s);t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),m._originalBuilderSideOrientation=t.sideOrientation,(function(e,t){let s=e.size,i=e.sizeX||s||1,a=e.sizeY||s||1,l=e.sizeZ||s||1,h=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,c=[],u=[],d=[],p=[],f=1/0,x=-1/0,g=1/0,m=-1/0;for(let e=0;e<t.vertex.length;e++)f=Math.min(f,t.vertex[e][0]*i),x=Math.max(x,t.vertex[e][0]*i),g=Math.min(g,t.vertex[e][1]*a),m=Math.max(m,t.vertex[e][1]*a);let V=0;for(let e=0;e<t.face.length;e++){let s=t.face[e],o=r.Vector3.FromArray(t.vertex[s[0]]),h=r.Vector3.FromArray(t.vertex[s[2]]),O=r.Vector3.FromArray(t.vertex[s[1]]),_=h.subtract(o),M=O.subtract(o),y=r.Vector3.Cross(M,_).normalize();for(let e=0;e<s.length;e++){d.push(y.x,y.y,y.z);let r=t.vertex[s[e]];c.push(r[0]*i,r[1]*a,r[2]*l);let o=(r[1]*a-g)/(m-g);p.push((r[0]*i-f)/(x-f),n.useOpenGLOrientationForUV?1-o:o)}for(let e=0;e<s.length-2;e++)u.push(V,V+e+2,V+e+1);V+=s.length}o.VertexData._ComputeSides(h,c,u,d,p);let O=new o.VertexData;return O.positions=c,O.indices=u,O.normals=d,O.uvs=p,O})(t,g).applyToMesh(m,t.updatable),m.goldbergData.nbSharedFaces=x.sharedNodes,m.goldbergData.nbUnsharedFaces=x.poleNodes,m.goldbergData.adjacentFaces=x.adjacentFaces,m.goldbergData.nbFaces=m.goldbergData.nbSharedFaces+m.goldbergData.nbUnsharedFaces,m.goldbergData.nbFacesAtPole=(m.goldbergData.nbUnsharedFaces-12)/12;for(let e=0;e<x.vertex.length;e++)m.goldbergData.faceCenters.push(r.Vector3.FromArray(x.vertex[e])),m.goldbergData.faceCenters[e].x*=l,m.goldbergData.faceCenters[e].y*=c,m.goldbergData.faceCenters[e].z*=u,m.goldbergData.faceColors.push(new h.Color4(1,1,1,1));for(let e=0;e<g.face.length;e++){let t=g.face[e],s=r.Vector3.FromArray(g.vertex[t[0]]),i=r.Vector3.FromArray(g.vertex[t[2]]),a=r.Vector3.FromArray(g.vertex[t[1]]),o=i.subtract(s),n=a.subtract(s),l=r.Vector3.Cross(n,o).normalize(),h=r.Vector3.Cross(n,l).normalize();m.goldbergData.faceXaxis.push(n.normalize()),m.goldbergData.faceYaxis.push(l),m.goldbergData.faceZaxis.push(h)}return m},CreateDecal:function(e,t,s){let l=!!t.skeleton,h=!!t.morphTargetManager?.numTargets,c=s.localMode||l,u=t.getIndices(),d=l||h?t.getPositionData(!0,!0):t.getVerticesData(a.VertexBuffer.PositionKind),p=l||h?t.getNormalsData(!0,!0):t.getVerticesData(a.VertexBuffer.NormalKind),f=c?l?t.getVerticesData(a.VertexBuffer.PositionKind):d:null,x=c?l?t.getVerticesData(a.VertexBuffer.NormalKind):p:null,g=t.getVerticesData(a.VertexBuffer.UVKind),m=l?t.getVerticesData(a.VertexBuffer.MatricesIndicesKind):null,V=l?t.getVerticesData(a.VertexBuffer.MatricesWeightsKind):null,O=l?t.getVerticesData(a.VertexBuffer.MatricesIndicesExtraKind):null,_=l?t.getVerticesData(a.VertexBuffer.MatricesWeightsExtraKind):null,M=s.position||r.Vector3.Zero(),y=s.normal||r.Vector3.Up(),T=s.size||r.Vector3.One(),v=s.angle||0;if(!y){let e=new r.Vector3(0,0,1),s=t.getScene().activeCamera,i=r.Vector3.TransformCoordinates(e,s.getWorldMatrix());y=s.globalPosition.subtract(i)}let b=-Math.atan2(y.z,y.x)-Math.PI/2,A=Math.sqrt(y.x*y.x+y.z*y.z),I=Math.atan2(y.y,A),D=new o.VertexData;D.indices=[],D.positions=[],D.normals=[],D.uvs=[],D.matricesIndices=l?[]:null,D.matricesWeights=l?[]:null,D.matricesIndicesExtra=O?[]:null,D.matricesWeightsExtra=_?[]:null;let w=0,F=(e,t)=>{let i=new H;if(!u||!d||!p)return i;let a=u[e];if(i.vertexIdx=3*a,i.vertexIdxForBones=4*a,i.position=new r.Vector3(d[3*a],d[3*a+1],d[3*a+2]),r.Vector3.TransformCoordinatesToRef(i.position,t,i.position),i.normal=new r.Vector3(p[3*a],p[3*a+1],p[3*a+2]),r.Vector3.TransformNormalToRef(i.normal,t,i.normal),s.captureUVS&&g){let e=g[2*a+1];i.uv=new r.Vector2(g[2*a],n.useOpenGLOrientationForUV?1-e:e)}return i},P=[0,0,0,0],L=(e,t)=>{if(0===e.length)return e;let s=.5*Math.abs(r.Vector3.Dot(T,t)),i=(e,t,s,r)=>{for(let i=0;i<r;++i)if(e[s+i]===t)return s+i;return -1},a=(e,a)=>{let o=r.Vector3.GetClipFactor(e.position,a.position,t,s),n=P,l=P;if(m&&V){let t=e.matrixIndicesOverride?0:e.vertexIdxForBones,s=e.matrixIndicesOverride??m,r=e.matrixWeightsOverride??V,h=a.matrixIndicesOverride?0:a.vertexIdxForBones,c=a.matrixIndicesOverride??m,u=a.matrixWeightsOverride??V;n=[0,0,0,0],l=[0,0,0,0];let d=0;for(let e=0;e<4;++e)if(r[t+e]>0){let a=i(c,s[t+e],h,4);n[d]=s[t+e],l[d]=(0,E.Lerp)(r[t+e],a>=0?u[a]:0,o),d++}for(let e=0;e<4&&d<4;++e){let r=c[h+e];-1===i(s,r,t,4)&&(n[d]=r,l[d]=(0,E.Lerp)(0,u[h+e],o),d++)}let p=l[0]+l[1]+l[2]+l[3];l[0]/=p,l[1]/=p,l[2]/=p,l[3]/=p}let h=e.localPositionOverride?e.localPositionOverride[0]:f?.[e.vertexIdx]??0,c=e.localPositionOverride?e.localPositionOverride[1]:f?.[e.vertexIdx+1]??0,u=e.localPositionOverride?e.localPositionOverride[2]:f?.[e.vertexIdx+2]??0,d=a.localPositionOverride?a.localPositionOverride[0]:f?.[a.vertexIdx]??0,p=a.localPositionOverride?a.localPositionOverride[1]:f?.[a.vertexIdx+1]??0,g=a.localPositionOverride?a.localPositionOverride[2]:f?.[a.vertexIdx+2]??0,O=e.localNormalOverride?e.localNormalOverride[0]:x?.[e.vertexIdx]??0,_=e.localNormalOverride?e.localNormalOverride[1]:x?.[e.vertexIdx+1]??0,M=e.localNormalOverride?e.localNormalOverride[2]:x?.[e.vertexIdx+2]??0,y=a.localNormalOverride?a.localNormalOverride[0]:x?.[a.vertexIdx]??0,T=a.localNormalOverride?a.localNormalOverride[1]:x?.[a.vertexIdx+1]??0,v=a.localNormalOverride?a.localNormalOverride[2]:x?.[a.vertexIdx+2]??0,b=O+(y-O)*o,A=_+(T-_)*o,I=M+(v-M)*o,D=Math.sqrt(b*b+A*A+I*I);return new H(r.Vector3.Lerp(e.position,a.position,o),r.Vector3.Lerp(e.normal,a.normal,o).normalize(),r.Vector2.Lerp(e.uv,a.uv,o),-1,-1,f?[h+(d-h)*o,c+(p-c)*o,u+(g-u)*o]:null,x?[b/D,A/D,I/D]:null,n,l)},o=null;e.length>3&&(o=[]);for(let i=0;i<e.length;i+=3){let n=null,l=null,h=null,c=null,u=r.Vector3.Dot(e[i].position,t)-s,d=r.Vector3.Dot(e[i+1].position,t)-s,p=r.Vector3.Dot(e[i+2].position,t)-s,f=u>0,x=d>0,g=p>0;switch(+!!f+ +!!x+ +!!g){case 0:e.length>3?(o.push(e[i]),o.push(e[i+1]),o.push(e[i+2])):o=e;break;case 1:if(o=o??[],f&&(n=e[i+1],l=e[i+2],h=a(e[i],n),c=a(e[i],l)),x){n=e[i],l=e[i+2],h=a(e[i+1],n),c=a(e[i+1],l),o.push(h),o.push(l.clone()),o.push(n.clone()),o.push(l.clone()),o.push(h.clone()),o.push(c);break}g&&(n=e[i],l=e[i+1],h=a(e[i+2],n),c=a(e[i+2],l)),n&&l&&h&&c&&(o.push(n.clone()),o.push(l.clone()),o.push(h),o.push(c),o.push(h.clone()),o.push(l.clone()));break;case 2:o=o??[],f||(l=a(n=e[i].clone(),e[i+1]),h=a(n,e[i+2]),o.push(n),o.push(l),o.push(h)),x||(l=a(n=e[i+1].clone(),e[i+2]),h=a(n,e[i]),o.push(n),o.push(l),o.push(h)),g||(l=a(n=e[i+2].clone(),e[i]),h=a(n,e[i+1]),o.push(n),o.push(l),o.push(h))}}return o},z=t instanceof i.Mesh?t:null,B=z?._thinInstanceDataStorage.matrixData,C=z?.thinInstanceCount||1,Z=r.TmpVectors.Matrix[0];Z.copyFrom(r.Matrix.IdentityReadOnly);for(let e=0;e<C;++e){if(z?.hasThinInstances&&B){let t=16*e;Z.setRowFromFloats(0,B[t+0],B[t+1],B[t+2],B[t+3]),Z.setRowFromFloats(1,B[t+4],B[t+5],B[t+6],B[t+7]),Z.setRowFromFloats(2,B[t+8],B[t+9],B[t+10],B[t+11]),Z.setRowFromFloats(3,B[t+12],B[t+13],B[t+14],B[t+15])}let i=r.Matrix.RotationYawPitchRoll(b,I,v).multiply(r.Matrix.Translation(M.x,M.y,M.z)),a=r.Matrix.Invert(i),o=t.getWorldMatrix(),l=Z.multiply(o).multiply(a),h=[,,,];for(let e=0;e<u.length;e+=3){let t=h;if((t[0]=F(e,l),t[1]=F(e+1,l),t[2]=F(e+2,l),!(s.cullBackFaces&&0>=-t[0].normal.z&&0>=-t[1].normal.z&&0>=-t[2].normal.z)&&(t=L(t,S))&&(t=L(t,R))&&(t=L(t,U))&&(t=L(t,N))&&(t=L(t,W)))&&(t=L(t,G)))for(let e=0;e<t.length;e++){let r=t[e];if(D.indices.push(w),c?(r.localPositionOverride?(D.positions[3*w]=r.localPositionOverride[0],D.positions[3*w+1]=r.localPositionOverride[1],D.positions[3*w+2]=r.localPositionOverride[2]):f&&(D.positions[3*w]=f[r.vertexIdx],D.positions[3*w+1]=f[r.vertexIdx+1],D.positions[3*w+2]=f[r.vertexIdx+2]),r.localNormalOverride?(D.normals[3*w]=r.localNormalOverride[0],D.normals[3*w+1]=r.localNormalOverride[1],D.normals[3*w+2]=r.localNormalOverride[2]):x&&(D.normals[3*w]=x[r.vertexIdx],D.normals[3*w+1]=x[r.vertexIdx+1],D.normals[3*w+2]=x[r.vertexIdx+2])):(r.position.toArray(D.positions,3*w),r.normal.toArray(D.normals,3*w)),D.matricesIndices&&D.matricesWeights&&(r.matrixIndicesOverride?(D.matricesIndices[4*w]=r.matrixIndicesOverride[0],D.matricesIndices[4*w+1]=r.matrixIndicesOverride[1],D.matricesIndices[4*w+2]=r.matrixIndicesOverride[2],D.matricesIndices[4*w+3]=r.matrixIndicesOverride[3]):(m&&(D.matricesIndices[4*w]=m[r.vertexIdxForBones],D.matricesIndices[4*w+1]=m[r.vertexIdxForBones+1],D.matricesIndices[4*w+2]=m[r.vertexIdxForBones+2],D.matricesIndices[4*w+3]=m[r.vertexIdxForBones+3]),O&&D.matricesIndicesExtra&&(D.matricesIndicesExtra[4*w]=O[r.vertexIdxForBones],D.matricesIndicesExtra[4*w+1]=O[r.vertexIdxForBones+1],D.matricesIndicesExtra[4*w+2]=O[r.vertexIdxForBones+2],D.matricesIndicesExtra[4*w+3]=O[r.vertexIdxForBones+3])),r.matrixWeightsOverride?(D.matricesWeights[4*w]=r.matrixWeightsOverride[0],D.matricesWeights[4*w+1]=r.matrixWeightsOverride[1],D.matricesWeights[4*w+2]=r.matrixWeightsOverride[2],D.matricesWeights[4*w+3]=r.matrixWeightsOverride[3]):(V&&(D.matricesWeights[4*w]=V[r.vertexIdxForBones],D.matricesWeights[4*w+1]=V[r.vertexIdxForBones+1],D.matricesWeights[4*w+2]=V[r.vertexIdxForBones+2],D.matricesWeights[4*w+3]=V[r.vertexIdxForBones+3]),_&&D.matricesWeightsExtra&&(D.matricesWeightsExtra[4*w]=_[r.vertexIdxForBones],D.matricesWeightsExtra[4*w+1]=_[r.vertexIdxForBones+1],D.matricesWeightsExtra[4*w+2]=_[r.vertexIdxForBones+2],D.matricesWeightsExtra[4*w+3]=_[r.vertexIdxForBones+3]))),s.captureUVS)r.uv.toArray(D.uvs,2*w);else{D.uvs.push(.5+r.position.x/T.x);let e=.5+r.position.y/T.y;D.uvs.push(n.useOpenGLOrientationForUV?1-e:e)}w++}}}0===D.indices.length&&(D.indices=null),0===D.positions.length&&(D.positions=null),0===D.normals.length&&(D.normals=null),0===D.uvs.length&&(D.uvs=null),D.matricesIndices?.length===0&&(D.matricesIndices=null),D.matricesWeights?.length===0&&(D.matricesWeights=null),D.matricesIndicesExtra?.length===0&&(D.matricesIndicesExtra=null),D.matricesWeightsExtra?.length===0&&(D.matricesWeightsExtra=null);let X=new i.Mesh(e,t.getScene());return D.applyToMesh(X),c?(X.skeleton=t.skeleton,X.parent=t):(X.position=M.clone(),X.rotation=new r.Vector3(I,b,v)),X.computeWorldMatrix(!0),X.refreshBoundingInfo(!0,!0),X},CreateCapsule:function(e,t={orientation:r.Vector3.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},s=null){let a=new i.Mesh(e,s);return(function(e={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){let t,s,i=0|Math.max(e.subdivisions?e.subdivisions:2,1),a=0|Math.max(e.tessellation?e.tessellation:16,3),l=Math.max(e.height?e.height:1,0),h=Math.max(e.radius?e.radius:.25,0),c=0|Math.max(e.capSubdivisions?e.capSubdivisions:6,1),u=Math.max(e.radiusTop?e.radiusTop:h,0),d=Math.max(e.radiusBottom?e.radiusBottom:h,0),p=2*Math.PI,f=Math.max(e.topCapSubdivisions?e.topCapSubdivisions:c,1),x=Math.max(e.bottomCapSubdivisions?e.bottomCapSubdivisions:c,1),g=Math.acos((d-u)/l),m=[],V=[],O=[],_=[],M=0,y=[],T=.5*(l-(u+d)),v=.5*Math.PI,b=r.Vector3.Zero(),A=r.Vector3.Zero(),I=Math.cos(g),D=Math.sin(g),w=new r.Vector2(u*D,T+u*I).subtract(new r.Vector2(d*D,-T+d*I)).length(),F=u*g+w+d*(v-g),P=0;for(s=0;s<=f;s++){let e=[],r=v-s/f*g;P+=u*g/f;let i=Math.cos(r),o=Math.sin(r),l=i*u;for(t=0;t<=a;t++){let s=t/a,r=s*p+0,h=Math.sin(r),c=Math.cos(r);A.x=l*h,A.y=T+o*u,A.z=l*c,V.push(A.x,A.y,A.z),b.set(i*h,o,i*c),O.push(b.x,b.y,b.z),_.push(s,n.useOpenGLOrientationForUV?P/F:1-P/F),e.push(M),M++}y.push(e)}let L=l-u-d+I*u-I*d,z=D*(d-u)/L;for(s=1;s<=i;s++){let e=[];P+=w/i;let r=D*(s*(d-u)/i+u);for(t=0;t<=a;t++){let o=t/a,l=o*p+0,h=Math.sin(l),c=Math.cos(l);A.x=r*h,A.y=T+I*u-s*L/i,A.z=r*c,V.push(A.x,A.y,A.z),b.set(h,z,c).normalize(),O.push(b.x,b.y,b.z),_.push(o,n.useOpenGLOrientationForUV?P/F:1-P/F),e.push(M),M++}y.push(e)}for(s=1;s<=x;s++){let e=[],r=v-g-s/x*(Math.PI-g);P+=d*g/x;let i=Math.cos(r),o=Math.sin(r),l=i*d;for(t=0;t<=a;t++){let s=t/a,r=s*p+0,h=Math.sin(r),c=Math.cos(r);A.x=l*h,A.y=-T+o*d,A.z=l*c,V.push(A.x,A.y,A.z),b.set(i*h,o,i*c),O.push(b.x,b.y,b.z),_.push(s,n.useOpenGLOrientationForUV?P/F:1-P/F),e.push(M),M++}y.push(e)}for(t=0;t<a;t++)for(s=0;s<f+i+x;s++){let e=y[s][t],r=y[s+1][t],i=y[s+1][t+1],a=y[s][t+1];m.push(e),m.push(r),m.push(a),m.push(r),m.push(i),m.push(a)}if(m=m.reverse(),e.orientation&&!e.orientation.equals(r.Vector3.Up())){let t=new r.Matrix;e.orientation.clone().scale(.5*Math.PI).cross(r.Vector3.Up()).toQuaternion().toRotationMatrix(t);let s=r.Vector3.Zero();for(let e=0;e<V.length;e+=3)s.set(V[e],V[e+1],V[e+2]),r.Vector3.TransformCoordinatesToRef(s.clone(),t,s),V[e]=s.x,V[e+1]=s.y,V[e+2]=s.z}let B=new o.VertexData;return B.positions=V,B.normals=O,B.uvs=_,B.indices=m,B})(t).applyToMesh(a,t.updatable),a},CreateText:function(e,t,s,a={size:50,resolution:8,depth:1},o=null,n=earcut){let l=function(e,t,s,r){let i=Array.from(e),a=t/r.resolution,o=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,n=[],l=0,h=0;for(let e=0;e<i.length;e++){let t=i[e];if("\n"===t)l=0,h-=o;else{let e=function(e,t,s,r,i,a){let o=a.glyphs[e]||a.glyphs["?"];if(!o)return null;let n=new j(i);if(o.o){let e=o.o.split(" ");for(let i=0,a=e.length;i<a;)switch(e[i++]){case"m":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r;n.moveTo(a,o);break}case"l":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r;n.lineTo(a,o);break}case"q":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r,l=parseInt(e[i++])*t+s,h=parseInt(e[i++])*t+r;n.quadraticCurveTo(l,h,a,o);break}case"b":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r,l=parseInt(e[i++])*t+s,h=parseInt(e[i++])*t+r,c=parseInt(e[i++])*t+s,u=parseInt(e[i++])*t+r;n.bezierCurveTo(l,h,c,u,a,o)}}}return n.extractHoles(),{offsetX:o.ha*t,shapePath:n}}(t,a,l,h,s,r);e&&(l+=e.offsetX,n.push(e.shapePath))}}return n}(t,a.size||50,a.resolution||8,s),h=[],c=0;for(let t of l){if(!t.paths.length)continue;let s=t.holes.slice();for(let l of t.paths){let t=[],u=[];for(let e of l.getPoints())u.push(new r.Vector3(e.x,0,e.y));for(let e of s.slice()){let i=e.getPoints(),a=!1;for(let e of i)if(l.isPointInside(e)){a=!0;break}if(!a)continue;let o=[];for(let e of i)o.push(new r.Vector3(e.x,0,e.y));t.push(o),s.splice(s.indexOf(e),1)}if(!t.length&&s.length)for(let e of s){let s=e.getPoints(),i=[];for(let e of s)i.push(new r.Vector3(e.x,0,e.y));t.push(i)}let d=F(e,{shape:u,holes:t.length?t:void 0,depth:a.depth||1,faceUV:a.faceUV||a.perLetterFaceUV?.(c),faceColors:a.faceColors||a.perLetterFaceColors?.(c),sideOrientation:i.Mesh._GetDefaultSideOrientation(a.sideOrientation||i.Mesh.DOUBLESIDE)},o,n);h.push(d),c++}}let u=i.Mesh.MergeMeshes(h,!0,!0);if(u){let t=u.getBoundingInfo().boundingBox;u.position.x+=-(t.minimumWorld.x+t.maximumWorld.x)/2,u.position.y+=-(t.minimumWorld.y+t.maximumWorld.y)/2,u.position.z+=-(t.minimumWorld.z+t.maximumWorld.z)/2+t.extendSize.z,u.name=e;let s=new q.TransformNode("pivot",o);s.rotation.x=-Math.PI/2,u.parent=s,u.bakeCurrentTransformIntoVertices(),u.parent=null,s.dispose()}return u}}],70928)}]);
|
|
@@ -103,7 +103,7 @@ varying vMainUV{X}: vec2f;
|
|
|
103
103
|
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["mainUVVaryingDeclarationWGSL",0,{name:f,shader:a}],58834);let n="logDepthDeclaration",o=`#ifdef LOGARITHMICDEPTH
|
|
104
104
|
uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;
|
|
105
105
|
#endif
|
|
106
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[n]||(i.ShaderStore.IncludesShadersStoreWGSL[n]=o),e.s(["logDepthDeclarationWGSL",0,{name:n,shader:o}],23681)},
|
|
106
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[n]||(i.ShaderStore.IncludesShadersStoreWGSL[n]=o),e.s(["logDepthDeclarationWGSL",0,{name:n,shader:o}],23681)},48163,e=>{"use strict";var i=e.i(1719);let t="harmonicsFunctions",r=`#ifdef USESPHERICALFROMREFLECTIONMAP
|
|
107
107
|
#ifdef SPHERICAL_HARMONICS
|
|
108
108
|
fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00
|
|
109
109
|
+ uniforms.vSphericalL1_1*(normal.y)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62390,t=>{"use strict";var e=t.i(82721),i=t.i(82350),s=t.i(14831),n=t.i(48477);class l extends e.FlowGraphExecutionBlock{constructor(t){super(t),this.config=t,this.outputSignals=[],this.reset=this._registerSignalInput("reset"),this.lastIndex=this.registerDataOutput("lastIndex",i.RichTypeFlowGraphInteger,new s.FlowGraphInteger(-1)),this.setNumberOfOutputSignals(t?.outputSignalCount)}_getNextIndex(t){if(!t.includes(!1)&&this.config.isLoop&&t.fill(!1),!this.config.isRandom)return t.indexOf(!1);{let e=t.map((t,e)=>t?-1:e).filter(t=>-1!==t);return e.length?e[Math.floor(Math.random()*e.length)]:-1}}setNumberOfOutputSignals(t=1){for(;this.outputSignals.length>t;){let t=this.outputSignals.pop();t&&(t.disconnectFromAll(),this._unregisterSignalOutput(t.name))}for(;this.outputSignals.length<t;)this.outputSignals.push(this._registerSignalOutput(`out_${this.outputSignals.length}`))}_execute(t,e){if(t._hasExecutionVariable(this,"indexesUsed")||t._setExecutionVariable(this,"indexesUsed",this.outputSignals.map(()=>!1)),e===this.reset){t._deleteExecutionVariable(this,"indexesUsed"),this.lastIndex.setValue(new s.FlowGraphInteger(-1),t);return}let i=t._getExecutionVariable(this,"indexesUsed",[]),n=this._getNextIndex(i);n>-1&&(this.lastIndex.setValue(new s.FlowGraphInteger(n),t),i[n]=!0,t._setExecutionVariable(this,"indexesUsed",i),this.outputSignals[n]._activateSignal(t))}getClassName(){return"FlowGraphMultiGateBlock"}serialize(t){super.serialize(t),t.config.outputSignalCount=this.config.outputSignalCount,t.config.isRandom=this.config.isRandom,t.config.loop=this.config.isLoop,t.config.startIndex=this.config.startIndex}}let o=!1;function a(){o||(o=!0,(0,n.RegisterClass)("FlowGraphMultiGateBlock",l))}t.s(["FlowGraphMultiGateBlock",0,l,"RegisterFlowGraphMultiGateBlock",0,a],81869),a(),t.s([],69700),t.i(69700),t.i(81869),t.s(["FlowGraphMultiGateBlock",0,l],62390)}]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#define ADDITIONAL_UBO_DECLARATION
|
|
3
3
|
#include<sceneUboDeclaration>
|
|
4
4
|
#include<meshUboDeclaration>
|
|
5
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["defaultUboDeclarationWGSL",0,{name:t,shader:r}])},85833,e=>{"use strict";var i=e.i(1719),t=e.i(95611),r=e.i(96024),n=e.i(78073),a=e.i(62983),f=e.i(70882),o=e.i(88356),d=e.i(58731),l=e.i(76295),c=e.i(
|
|
5
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["defaultUboDeclarationWGSL",0,{name:t,shader:r}])},85833,e=>{"use strict";var i=e.i(1719),t=e.i(95611),r=e.i(96024),n=e.i(78073),a=e.i(62983),f=e.i(70882),o=e.i(88356),d=e.i(58731),l=e.i(76295),c=e.i(76752),s=e.i(58834),v=e.i(13103),u=e.i(64832),m=e.i(77715),E=e.i(91676);let I="lightVxFragmentDeclaration",A=`#ifdef LIGHT{X}
|
|
6
6
|
uniform vLightData{X}: vec4f;uniform vLightDiffuse{X}: vec4f;
|
|
7
7
|
#ifdef SPECULARTERM
|
|
8
8
|
uniform vLightSpecular{X}: vec4f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2348,2413,e=>{"use strict";let t=1/1.2;e.s(["ZOOM_IN_FACTOR",0,t,"ZOOM_OUT_FACTOR",0,1.2,"attachDoubleClickFocus",0,function(e,t,s){let a=()=>{let t=e.pick(e.pointerX,e.pointerY);t?.hit&&t.pickedPoint&&s.setTarget(t.pickedPoint)};return t.addEventListener("dblclick",a),()=>t.removeEventListener("dblclick",a)},"disableWheelZoom",0,function(e){e.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"resetFocus",0,function(e,t){e.setTarget(t.target),e.alpha=t.alpha,e.beta=t.beta,e.radius=t.radius},"stepZoom",0,function(e,t){let s=e.lowerRadiusLimit??.01,a=e.upperRadiusLimit??1/0;e.radius=Math.min(a,Math.max(s,e.radius*t))}],2348);var s=e.i(28100);e.s(["ZoomButtons",0,function({onZoom:e,onReset:a}){let n="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:n,onClick:()=>e(t),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:n,onClick:()=>e(1.2),children:"−"}),a?(0,s.jsx)("button",{type:"button","aria-label":"Reset camera focus to center",title:"Reset focus to center",className:n,onClick:a,children:(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,s.jsx)("path",{d:"M8 1v2.5M8 12.5V15M1 8h2.5M12.5 8H15"})]})}):null]})}],2413)},25476,e=>{"use strict";e.s(["attachMeshHover",0,function(e,t,s){let a=0,n=null,c=t=>{let c=t.offsetX,r=t.offsetY;a||(a=requestAnimationFrame(()=>{var t,i;let l;a=0;let u=e.pick(c,r,e=>e.isPickable&&e.isEnabled()),h=u?.pickedMesh?(t=u.pickedMesh,i=u.thinInstanceIndex??-1,(l=t.metadata)?i>=0&&l.hoverLabels?l.hoverLabels[i]??null:l.hoverLabel??null:null):null;h?s({label:h,x:c,y:r}):null!==n&&s(null),n=h}))},r=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return t.addEventListener("pointermove",c),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointermove",c),t.removeEventListener("pointerleave",r),a&&cancelAnimationFrame(a)}}])},39592,e=>{"use strict";var t=e.i(28100),s=e.i(11623),a=e.i(56054),n=e.i(2348),c=e.i(25476),r=e.i(2413);function i(e){let t=Math.min(1,Math.max(0,e));return[.118+(.22-.118)*t,.227+.513*t,.541+(.97-.541)*t]}function l(e){return`${e.vx}|${e.vy}|${e.vz}`}function u({mode:e}){return(0,t.jsxs)("div",{className:"absolute bottom-3 right-3 max-w-72 rounded-md border border-edge bg-ink/80 px-2 py-1.5 text-xs text-fg backdrop-blur",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-[#38bdf8]"}),"divergence"===e?"Gaze-heavy":"Gaze"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-[#f4c84b]"}),"divergence"===e?"Click-heavy":"Clicks"]})]}),(0,t.jsx)("p",{className:"mt-1 text-fg-muted",children:"divergence"===e?"Per-voxel normalized difference: which signal dominates each cell. Color & size scale with the gap.":"Gaze = where viewers looked; Clicks = where they acted. Cells with gaze but no clicks are looked-at but un-acted-on."})]})}function h({active:e,onClick:s,children:a}){return(0,t.jsx)("button",{type:"button",onClick:s,className:`rounded px-2 py-0.5 font-medium transition ${e?"bg-amber text-ink":"text-fg-muted hover:text-fg"}`,children:a})}e.s(["GazeClickDivergence3DView",0,function({gazeVoxels:o,clickVoxels:d,cellSize:j,proxyMeshes:k=[]}){let p=(0,s.useRef)(null),m=(0,s.useRef)(null),v=(0,s.useRef)(null),[g,b]=(0,s.useState)("loading"),[x,f]=(0,s.useState)(null),[y,w]=(0,s.useState)("overlay"),[z,q]=(0,s.useState)(null),C=(0,s.useRef)(o),M=(0,s.useRef)(d),_=(0,s.useRef)(k),A=(0,s.useRef)(y);C.current=o,M.current=d,_.current=k,A.current=y;let R=(0,s.useRef)(null),P=o.length>0||d.length>0||k.length>0;return(0,s.useEffect)(()=>{let t=p.current;if(!t)return;if(!P)return void b("empty");let s=!1,r=null;return b("loading"),f(null),(async()=>{try{let[{Engine:u},{Scene:h},{ArcRotateCamera:o},{HemisphericLight:d},{Vector3:k,Color3:p,Color4:g,Matrix:x},{MeshBuilder:f},{StandardMaterial:y}]=await Promise.all([e.A(3905),e.A(94432),e.A(59694),e.A(88004),e.A(27940),e.A(27124),e.A(14074),e.A(35983),e.A(18561)]);if(s)return;let w=C.current,z=M.current,P=_.current,N=[...w,...z],L=0,E=0,F=0,T=0;for(let e of N)L+=(e.vx+.5)*j,E+=(e.vy+.5)*j,F+=(e.vz+.5)*j,T++;if(0===T)for(let e of P)L+=(e.aabb[0]+e.aabb[3])/2,E+=(e.aabb[1]+e.aabb[4])/2,F+=(e.aabb[2]+e.aabb[5])/2,T++;let S=new k(L/T,E/T,F/T),B=4*j;for(let e of N){let t=(e.vx+.5)*j-S.x,s=(e.vy+.5)*j-S.y,a=(e.vz+.5)*j-S.z;B=Math.max(B,Math.sqrt(t*t+s*s+a*a))}for(let e of P){let t=(e.aabb[0]+e.aabb[3])/2-S.x,s=(e.aabb[1]+e.aabb[4])/2-S.y,a=(e.aabb[2]+e.aabb[5])/2-S.z;B=Math.max(B,Math.sqrt(t*t+s*s+a*a))}let O=new u(t,!0,{preserveDrawingBuffer:!1}),Z=new h(O);Z.clearColor=new g(.04,.05,.07,1);let I=new o("divergence-cam",Math.PI/4,Math.PI/3,2.4*B,S,Z);I.attachControl(t,!0),(0,n.disableWheelZoom)(I),m.current=I,v.current={target:S,alpha:I.alpha,beta:I.beta,radius:I.radius},new d("divergence-light",new k(.4,1,.3),Z);let D=null,G="\0",$=Math.max(.02*B,.25*j)/(.9*j),W=[],H=(e,t,s,a,n)=>{if(0===t.length)return;let c=f.CreateSphere(e,{diameter:.9*j,segments:6},Z),r=new y(`${e}-mat`,Z);r.diffuseColor=new p(1,1,1),r.specularColor=new p(0,0,0),c.material=r,c.metadata={hoverLabel:n},W.push(c);let i=t.length,l=new Float32Array(16*i),u=new Float32Array(4*i);for(let e=0;e<i;e++){let n=t[e],c=n.count/s,r=$*(.5+.5*c);x.Scaling(r,r,r).multiply(x.Translation((n.vx+.5)*j,(n.vy+.5)*j,(n.vz+.5)*j)).copyToArray(l,16*e);let[i,h,o]=a(c);u[4*e]=i,u[4*e+1]=h,u[4*e+2]=o,u[4*e+3]=1}c.thinInstanceSetBuffer("matrix",l,16,!1),c.thinInstanceSetBuffer("color",u,4,!0)},K=()=>{for(let e of((()=>{let e=_.current,t=e.map(e=>`${e.name}:${e.aabb.join(",")}`).join("|");if(t===G||(G=t,D&&(D.dispose(!1,!0),D=null),0===e.length))return;D=f.CreateBox("scene-proxy",{size:1},Z);let s=new y("scene-proxy-mat",Z);s.wireframe=!0,s.disableLighting=!0,s.emissiveColor=new p(.32,.4,.52),s.alpha=.35,D.material=s,D.isPickable=!0,D.thinInstanceEnablePicking=!0,D.metadata={hoverLabels:e.map(e=>e.name)};let a=e.length,n=new Float32Array(16*a);for(let t=0;t<a;t++){let s=e[t].aabb,a=Math.max(s[3]-s[0],.001),c=Math.max(s[4]-s[1],.001),r=Math.max(s[5]-s[2],.001);x.Scaling(a,c,r).multiply(x.Translation((s[0]+s[3])/2,(s[1]+s[4])/2,(s[2]+s[5])/2)).copyToArray(n,16*t)}D.thinInstanceSetBuffer("matrix",n,16,!0)})(),W))e.dispose(!1,!0);W=[];let e=C.current,t=M.current,s=e.reduce((e,t)=>Math.max(e,t.count),1),n=t.reduce((e,t)=>Math.max(e,t.count),1),c=A.current;if("divergence"===c){let c=new Map(e.map(e=>[l(e),e])),r=new Map(t.map(e=>[l(e),e])),u=new Set([...c.keys(),...r.keys()]),h=[],o=[];for(let e of u){let t=(c.get(e)?.count??0)/s,a=(r.get(e)?.count??0)/n,i=r.get(e)??c.get(e),l=a-t,u={vx:i.vx,vy:i.vy,vz:i.vz,count:1e3*Math.abs(l)};(l>=0?h:o).push(u)}H("div-click",h,1e3,a.heatRgb,"Click-heavy"),H("div-gaze",o,1e3,i,"Gaze-heavy")}else("overlay"===c||"gaze"===c)&&H("gaze-voxel",e,s,i,"Gaze"),("overlay"===c||"click"===c)&&H("click-voxel",t,n,a.heatRgb,"Click")};R.current=K,K(),O.runRenderLoop(()=>Z.render());let U=()=>O.resize();window.addEventListener("resize",U);let V=(0,c.attachMeshHover)(Z,t,q),X=(0,n.attachDoubleClickFocus)(Z,t,I);b("ready"),r=()=>{window.removeEventListener("resize",U),V(),X(),q(null),R.current=null,m.current=null,v.current=null,Z.dispose(),O.dispose()}}catch(e){if(s)return;b("error"),f(e instanceof Error?e.message:"Failed to render overlay.")}})(),()=>{s=!0,r?.()}},[P,j]),(0,s.useEffect)(()=>{R.current?.()},[o,d,k,j,y]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:p,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),z?(0,t.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-64 truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:z.x+12,top:z.y+12},children:z.label}):null,"ready"===g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(h,{active:"overlay"===y,onClick:()=>w("overlay"),children:"Overlay"}),(0,t.jsx)(h,{active:"gaze"===y,onClick:()=>w("gaze"),children:"Gaze"}),(0,t.jsx)(h,{active:"click"===y,onClick:()=>w("click"),children:"Clicks"}),(0,t.jsx)(h,{active:"divergence"===y,onClick:()=>w("divergence"),children:"Divergence"})]}),(0,t.jsx)(r.ZoomButtons,{onZoom:e=>m.current&&(0,n.stepZoom)(m.current,e),onReset:()=>m.current&&v.current&&(0,n.resetFocus)(m.current,v.current)}),(0,t.jsx)(u,{mode:y})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===g?"Rendering…":"empty"===g?"No gaze or click hit-points in range. Enable gaze + pointer capture in the SDK.":"error"===g?x??"Overlay unavailable.":null})]})}])},3905,e=>{e.v(t=>Promise.all(["static/chunks/3pdpaqzwhhijn.js","static/chunks/08bm3ye5govev.js","static/chunks/0g6u34xkzrpjn.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2gh4z57fem0_v.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0g7p8zp2kxve5.js"].map(t=>e.l(t))).then(()=>t(66232)))},94432,e=>{e.v(t=>Promise.all(["static/chunks/2kje_jvmwsvwo.js","static/chunks/1j--a56ji33_x.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vpcaaf-0dn7q.js"].map(t=>e.l(t))).then(()=>t(92494)))},59694,e=>{e.v(t=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/245h82k-g1nxr.js","static/chunks/3ovd8o_usay7j.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3pyggl13glbdc.js"].map(t=>e.l(t))).then(()=>t(67186)))},88004,e=>{e.v(t=>Promise.all(["static/chunks/2p8dbh81chhon.js","static/chunks/1oara6fkfvgs3.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(15768)))},27940,e=>{e.v(t=>Promise.all(["static/chunks/0w0sx062qmcsh.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(23235)))},27124,e=>{e.v(t=>Promise.all(["static/chunks/1par9m038tiov.js","static/chunks/1j--a56ji33_x.js","static/chunks/2j-sax2xfdv7l.js","static/chunks/340pg0qkv5tqq.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/0gwa154w_0wuh.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3pyggl13glbdc.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/01aeari2x_tlz.js"].map(t=>e.l(t))).then(()=>t(70928)))},14074,e=>{e.v(t=>Promise.all(["static/chunks/1zcrrq1fx8g2y.js","static/chunks/1tdg_eolxlcdl.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/0vddljjnmozzx.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0f_nv15a8q415.js","static/chunks/3g_h_00xs9u59.js","static/chunks/2npk7tr63h7rl.js","static/chunks/25ctnyh7njp-d.js"].map(t=>e.l(t))).then(()=>t(87566)))},35983,e=>{e.v(t=>Promise.all(["static/chunks/4227p7752rnny.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/2npk7tr63h7rl.js","static/chunks/1vkww9l6lgqag.js","static/chunks/25ctnyh7njp-d.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3pyggl13glbdc.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(50608)))},18561,e=>{e.v(t=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/1vkww9l6lgqag.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/117ys3lltfmcu.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js"].map(t=>e.l(t))).then(()=>t(85106)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2348,2413,e=>{"use strict";let t=1/1.2;e.s(["ZOOM_IN_FACTOR",0,t,"ZOOM_OUT_FACTOR",0,1.2,"attachDoubleClickFocus",0,function(e,t,s){let a=()=>{let t=e.pick(e.pointerX,e.pointerY);t?.hit&&t.pickedPoint&&s.setTarget(t.pickedPoint)};return t.addEventListener("dblclick",a),()=>t.removeEventListener("dblclick",a)},"disableWheelZoom",0,function(e){e.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"resetFocus",0,function(e,t){e.setTarget(t.target),e.alpha=t.alpha,e.beta=t.beta,e.radius=t.radius},"stepZoom",0,function(e,t){let s=e.lowerRadiusLimit??.01,a=e.upperRadiusLimit??1/0;e.radius=Math.min(a,Math.max(s,e.radius*t))}],2348);var s=e.i(28100);e.s(["ZoomButtons",0,function({onZoom:e,onReset:a}){let n="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:n,onClick:()=>e(t),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:n,onClick:()=>e(1.2),children:"−"}),a?(0,s.jsx)("button",{type:"button","aria-label":"Reset camera focus to center",title:"Reset focus to center",className:n,onClick:a,children:(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,s.jsx)("path",{d:"M8 1v2.5M8 12.5V15M1 8h2.5M12.5 8H15"})]})}):null]})}],2413)},25476,e=>{"use strict";e.s(["attachMeshHover",0,function(e,t,s){let a=0,n=null,c=t=>{let c=t.offsetX,r=t.offsetY;a||(a=requestAnimationFrame(()=>{var t,i;let l;a=0;let u=e.pick(c,r,e=>e.isPickable&&e.isEnabled()),h=u?.pickedMesh?(t=u.pickedMesh,i=u.thinInstanceIndex??-1,(l=t.metadata)?i>=0&&l.hoverLabels?l.hoverLabels[i]??null:l.hoverLabel??null:null):null;h?s({label:h,x:c,y:r}):null!==n&&s(null),n=h}))},r=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return t.addEventListener("pointermove",c),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointermove",c),t.removeEventListener("pointerleave",r),a&&cancelAnimationFrame(a)}}])},39592,e=>{"use strict";var t=e.i(28100),s=e.i(11623),a=e.i(56054),n=e.i(2348),c=e.i(25476),r=e.i(2413);function i(e){let t=Math.min(1,Math.max(0,e));return[.118+(.22-.118)*t,.227+.513*t,.541+(.97-.541)*t]}function l(e){return`${e.vx}|${e.vy}|${e.vz}`}function u({mode:e}){return(0,t.jsxs)("div",{className:"absolute bottom-3 right-3 max-w-72 rounded-md border border-edge bg-ink/80 px-2 py-1.5 text-xs text-fg backdrop-blur",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-[#38bdf8]"}),"divergence"===e?"Gaze-heavy":"Gaze"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-[#f4c84b]"}),"divergence"===e?"Click-heavy":"Clicks"]})]}),(0,t.jsx)("p",{className:"mt-1 text-fg-muted",children:"divergence"===e?"Per-voxel normalized difference: which signal dominates each cell. Color & size scale with the gap.":"Gaze = where viewers looked; Clicks = where they acted. Cells with gaze but no clicks are looked-at but un-acted-on."})]})}function h({active:e,onClick:s,children:a}){return(0,t.jsx)("button",{type:"button",onClick:s,className:`rounded px-2 py-0.5 font-medium transition ${e?"bg-amber text-ink":"text-fg-muted hover:text-fg"}`,children:a})}e.s(["GazeClickDivergence3DView",0,function({gazeVoxels:o,clickVoxels:d,cellSize:j,proxyMeshes:k=[]}){let m=(0,s.useRef)(null),p=(0,s.useRef)(null),v=(0,s.useRef)(null),[b,x]=(0,s.useState)("loading"),[g,f]=(0,s.useState)(null),[w,y]=(0,s.useState)("overlay"),[z,q]=(0,s.useState)(null),C=(0,s.useRef)(o),M=(0,s.useRef)(d),_=(0,s.useRef)(k),A=(0,s.useRef)(w);C.current=o,M.current=d,_.current=k,A.current=w;let R=(0,s.useRef)(null),P=o.length>0||d.length>0||k.length>0;return(0,s.useEffect)(()=>{let t=m.current;if(!t)return;if(!P)return void x("empty");let s=!1,r=null;return x("loading"),f(null),(async()=>{try{let[{Engine:u},{Scene:h},{ArcRotateCamera:o},{HemisphericLight:d},{Vector3:k,Color3:m,Color4:b,Matrix:g},{MeshBuilder:f},{StandardMaterial:w}]=await Promise.all([e.A(3905),e.A(94432),e.A(59694),e.A(88004),e.A(27940),e.A(27124),e.A(14074),e.A(35983),e.A(18561)]);if(s)return;let y=C.current,z=M.current,P=_.current,N=[...y,...z],L=0,E=0,F=0,T=0;for(let e of N)L+=(e.vx+.5)*j,E+=(e.vy+.5)*j,F+=(e.vz+.5)*j,T++;if(0===T)for(let e of P)L+=(e.aabb[0]+e.aabb[3])/2,E+=(e.aabb[1]+e.aabb[4])/2,F+=(e.aabb[2]+e.aabb[5])/2,T++;let S=new k(L/T,E/T,F/T),B=4*j;for(let e of N){let t=(e.vx+.5)*j-S.x,s=(e.vy+.5)*j-S.y,a=(e.vz+.5)*j-S.z;B=Math.max(B,Math.sqrt(t*t+s*s+a*a))}for(let e of P){let t=(e.aabb[0]+e.aabb[3])/2-S.x,s=(e.aabb[1]+e.aabb[4])/2-S.y,a=(e.aabb[2]+e.aabb[5])/2-S.z;B=Math.max(B,Math.sqrt(t*t+s*s+a*a))}let O=new u(t,!0,{preserveDrawingBuffer:!1}),Z=new h(O);Z.clearColor=new b(.04,.05,.07,1);let I=new o("divergence-cam",Math.PI/4,Math.PI/3,2.4*B,S,Z);I.attachControl(t,!0),(0,n.disableWheelZoom)(I),p.current=I,v.current={target:S,alpha:I.alpha,beta:I.beta,radius:I.radius},new d("divergence-light",new k(.4,1,.3),Z);let D=null,G="\0",$=Math.max(.02*B,.25*j)/(.9*j),W=[],H=(e,t,s,a,n)=>{if(0===t.length)return;let c=f.CreateSphere(e,{diameter:.9*j,segments:6},Z),r=new w(`${e}-mat`,Z);r.diffuseColor=new m(1,1,1),r.specularColor=new m(0,0,0),c.material=r,c.metadata={hoverLabel:n},W.push(c);let i=t.length,l=new Float32Array(16*i),u=new Float32Array(4*i);for(let e=0;e<i;e++){let n=t[e],c=n.count/s,r=$*(.5+.5*c);g.Scaling(r,r,r).multiply(g.Translation((n.vx+.5)*j,(n.vy+.5)*j,(n.vz+.5)*j)).copyToArray(l,16*e);let[i,h,o]=a(c);u[4*e]=i,u[4*e+1]=h,u[4*e+2]=o,u[4*e+3]=1}c.thinInstanceSetBuffer("matrix",l,16,!1),c.thinInstanceSetBuffer("color",u,4,!0)},K=()=>{for(let e of((()=>{let e=_.current,t=e.map(e=>`${e.name}:${e.aabb.join(",")}`).join("|");if(t===G||(G=t,D&&(D.dispose(!1,!0),D=null),0===e.length))return;D=f.CreateBox("scene-proxy",{size:1},Z);let s=new w("scene-proxy-mat",Z);s.wireframe=!0,s.disableLighting=!0,s.emissiveColor=new m(.32,.4,.52),s.alpha=.35,D.material=s,D.isPickable=!0,D.thinInstanceEnablePicking=!0,D.metadata={hoverLabels:e.map(e=>e.name)};let a=e.length,n=new Float32Array(16*a);for(let t=0;t<a;t++){let s=e[t].aabb,a=Math.max(s[3]-s[0],.001),c=Math.max(s[4]-s[1],.001),r=Math.max(s[5]-s[2],.001);g.Scaling(a,c,r).multiply(g.Translation((s[0]+s[3])/2,(s[1]+s[4])/2,(s[2]+s[5])/2)).copyToArray(n,16*t)}D.thinInstanceSetBuffer("matrix",n,16,!0)})(),W))e.dispose(!1,!0);W=[];let e=C.current,t=M.current,s=e.reduce((e,t)=>Math.max(e,t.count),1),n=t.reduce((e,t)=>Math.max(e,t.count),1),c=A.current;if("divergence"===c){let c=new Map(e.map(e=>[l(e),e])),r=new Map(t.map(e=>[l(e),e])),u=new Set([...c.keys(),...r.keys()]),h=[],o=[];for(let e of u){let t=(c.get(e)?.count??0)/s,a=(r.get(e)?.count??0)/n,i=r.get(e)??c.get(e),l=a-t,u={vx:i.vx,vy:i.vy,vz:i.vz,count:1e3*Math.abs(l)};(l>=0?h:o).push(u)}H("div-click",h,1e3,a.heatRgb,"Click-heavy"),H("div-gaze",o,1e3,i,"Gaze-heavy")}else("overlay"===c||"gaze"===c)&&H("gaze-voxel",e,s,i,"Gaze"),("overlay"===c||"click"===c)&&H("click-voxel",t,n,a.heatRgb,"Click")};R.current=K,K(),O.runRenderLoop(()=>Z.render());let U=()=>O.resize();window.addEventListener("resize",U);let V=(0,c.attachMeshHover)(Z,t,q),X=(0,n.attachDoubleClickFocus)(Z,t,I);x("ready"),r=()=>{window.removeEventListener("resize",U),V(),X(),q(null),R.current=null,p.current=null,v.current=null,Z.dispose(),O.dispose()}}catch(e){if(s)return;x("error"),f(e instanceof Error?e.message:"Failed to render overlay.")}})(),()=>{s=!0,r?.()}},[P,j]),(0,s.useEffect)(()=>{R.current?.()},[o,d,k,j,w]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:m,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),z?(0,t.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-64 truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:z.x+12,top:z.y+12},children:z.label}):null,"ready"===b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(h,{active:"overlay"===w,onClick:()=>y("overlay"),children:"Overlay"}),(0,t.jsx)(h,{active:"gaze"===w,onClick:()=>y("gaze"),children:"Gaze"}),(0,t.jsx)(h,{active:"click"===w,onClick:()=>y("click"),children:"Clicks"}),(0,t.jsx)(h,{active:"divergence"===w,onClick:()=>y("divergence"),children:"Divergence"})]}),(0,t.jsx)(r.ZoomButtons,{onZoom:e=>p.current&&(0,n.stepZoom)(p.current,e),onReset:()=>p.current&&v.current&&(0,n.resetFocus)(p.current,v.current)}),(0,t.jsx)(u,{mode:w})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===b?"Rendering…":"empty"===b?"No gaze or click hit-points in range. Enable gaze + pointer capture in the SDK.":"error"===b?g??"Overlay unavailable.":null})]})}])},3905,e=>{e.v(t=>Promise.all(["static/chunks/3pdpaqzwhhijn.js","static/chunks/08bm3ye5govev.js","static/chunks/0g6u34xkzrpjn.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2gh4z57fem0_v.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0g7p8zp2kxve5.js"].map(t=>e.l(t))).then(()=>t(66232)))},94432,e=>{e.v(t=>Promise.all(["static/chunks/2kje_jvmwsvwo.js","static/chunks/1j--a56ji33_x.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/3vaho-xrtuchd.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vpcaaf-0dn7q.js"].map(t=>e.l(t))).then(()=>t(92494)))},59694,e=>{e.v(t=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/245h82k-g1nxr.js","static/chunks/3ovd8o_usay7j.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/2wdk-kbm-n-m5.js"].map(t=>e.l(t))).then(()=>t(67186)))},88004,e=>{e.v(t=>Promise.all(["static/chunks/2p8dbh81chhon.js","static/chunks/1oara6fkfvgs3.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(15768)))},27940,e=>{e.v(t=>Promise.all(["static/chunks/0w0sx062qmcsh.js","static/chunks/25ctnyh7njp-d.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(23235)))},27124,e=>{e.v(t=>Promise.all(["static/chunks/1par9m038tiov.js","static/chunks/1j--a56ji33_x.js","static/chunks/2j-sax2xfdv7l.js","static/chunks/3rx1jhuop94-l.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/0gwa154w_0wuh.js","static/chunks/0oap0o8a8a_cl.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/2wdk-kbm-n-m5.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/25ctnyh7njp-d.js","static/chunks/2npk7tr63h7rl.js","static/chunks/10w513bgw-bgi.js"].map(t=>e.l(t))).then(()=>t(70928)))},14074,e=>{e.v(t=>Promise.all(["static/chunks/0n0thxa3jkour.js","static/chunks/1tdg_eolxlcdl.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/0vddljjnmozzx.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js","static/chunks/0f_nv15a8q415.js","static/chunks/3g_h_00xs9u59.js","static/chunks/2npk7tr63h7rl.js","static/chunks/25ctnyh7njp-d.js"].map(t=>e.l(t))).then(()=>t(87566)))},35983,e=>{e.v(t=>Promise.all(["static/chunks/4227p7752rnny.js","static/chunks/1j--a56ji33_x.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/2npk7tr63h7rl.js","static/chunks/1vkww9l6lgqag.js","static/chunks/25ctnyh7njp-d.js","static/chunks/0f_nv15a8q415.js","static/chunks/3vaho-xrtuchd.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/2wdk-kbm-n-m5.js","static/chunks/3pdpaqzwhhijn.js"].map(t=>e.l(t))).then(()=>t(50608)))},18561,e=>{e.v(t=>Promise.all(["static/chunks/1j--a56ji33_x.js","static/chunks/1vkww9l6lgqag.js","static/chunks/3pdpaqzwhhijn.js","static/chunks/2npk7tr63h7rl.js","static/chunks/117ys3lltfmcu.js","static/chunks/25ctnyh7njp-d.js","static/chunks/1vzmzrjhlm1q5.js","static/chunks/3g_h_00xs9u59.js","static/chunks/1vpcaaf-0dn7q.js","static/chunks/3vaho-xrtuchd.js"].map(t=>e.l(t))).then(()=>t(85106)))}]);
|